private enum ResolveType
{
/// <summary>
- /// Display (first.last)
+ /// Client specified name format
/// </summary>
- AgentCompleteName,
+ AgentDefaultName,
/// <summary>
/// Display
/// </summary>
/// <returns>Display text for URI</returns>
public string GetLinkName(string uri)
{
+ if (!RadegastInstance.GlobalInstance.GlobalSettings["resolve_uris"])
+ {
+ return uri;
+ }
+
Match match = patternUri.Match(uri);
if (!match.Success)
{
#region Name Resolution
/// <summary>
- /// Amount of time in milliseconds to wait before giving up on name resolution
- /// </summary>
- private const int NameResolveTimeoutInMs = 150;
-
- /// <summary>
/// Gets the name of an agent by UUID. Will block for a short period of time to allow for name resolution.
/// </summary>
/// <param name="agentID">Agent UUID</param>
instance.Names.NameUpdated += handler;
- if (nameType == ResolveType.AgentCompleteName)
+ if (nameType == ResolveType.AgentDefaultName)
{
- name = instance.Names.GetLegacyName(agentID);
+ name = instance.Names.Get(agentID);
}
else if (nameType == ResolveType.AgentUsername)
{
}
else
{
+ instance.Names.NameUpdated -= handler;
return agentID.ToString();
}
if (name == RadegastInstance.INCOMPLETE_NAME)
{
- gotName.WaitOne(NameResolveTimeoutInMs, false);
+ gotName.WaitOne(instance.GlobalSettings["resolve_uri_time"], false);
}
instance.Names.NameUpdated -= handler;
instance.Client.Groups.RequestGroupName(groupID);
if (name == RadegastInstance.INCOMPLETE_NAME)
{
- gotName.WaitOne(NameResolveTimeoutInMs, false);
+ gotName.WaitOne(instance.GlobalSettings["resolve_uri_time"], false);
}
instance.Client.Groups.GroupNamesReply -= handler;
instance.Client.Parcels.RequestParcelInfo(parcelID);
if (name == RadegastInstance.INCOMPLETE_NAME)
{
- gotName.WaitOne(NameResolveTimeoutInMs, false);
+ gotName.WaitOne(instance.GlobalSettings["resolve_uri_time"], false);
}
instance.Client.Parcels.ParcelInfoReply -= handler;
{
switch (type)
{
- case ResolveType.AgentCompleteName:
+ case ResolveType.AgentDefaultName:
case ResolveType.AgentDisplayName:
case ResolveType.AgentUsername:
return GetAgentName(id, type);
case "about":
case "inspect":
case "completename":
- return Resolve(agentID, ResolveType.AgentCompleteName);
+ return Resolve(agentID, ResolveType.AgentDefaultName);
case "displayname":
return Resolve(agentID, ResolveType.AgentDisplayName);
case "username":
return Resolve(agentID, ResolveType.AgentUsername);
case "im":
- return "IM " + Resolve(agentID, ResolveType.AgentCompleteName);
+ return "IM " + Resolve(agentID, ResolveType.AgentDefaultName);
case "offerteleport":
- return "Offer Teleport to " + Resolve(agentID, ResolveType.AgentCompleteName);
+ return "Offer Teleport to " + Resolve(agentID, ResolveType.AgentDefaultName);
case "pay":
- return "Pay " + Resolve(agentID, ResolveType.AgentCompleteName);
+ return "Pay " + Resolve(agentID, ResolveType.AgentDefaultName);
case "requestfriend":
- return "Friend Request " + Resolve(agentID, ResolveType.AgentCompleteName);
+ return "Friend Request " + Resolve(agentID, ResolveType.AgentDefaultName);
case "mute":
- return "Mute " + Resolve(agentID, ResolveType.AgentCompleteName);
+ return "Mute " + Resolve(agentID, ResolveType.AgentDefaultName);
case "unmute":
- return "Unmute " + Resolve(agentID, ResolveType.AgentCompleteName);
+ return "Unmute " + Resolve(agentID, ResolveType.AgentDefaultName);
default:
return match.ToString();
}
this.cbFriendsHighlight = new System.Windows.Forms.CheckBox();
this.cbTaskBarHighLight = new System.Windows.Forms.CheckBox();
this.cbMisc = new System.Windows.Forms.GroupBox();
+ this.txtResolveURITime = new System.Windows.Forms.TextBox();
+ this.label4 = new System.Windows.Forms.Label();
+ this.cbResolveURIs = new System.Windows.Forms.CheckBox();
this.cbShowScriptErrors = new System.Windows.Forms.CheckBox();
this.cbDisableHTTPInventory = new System.Windows.Forms.CheckBox();
this.cbHideLoginGraphics = new System.Windows.Forms.CheckBox();
this.rbDNSmart = new System.Windows.Forms.RadioButton();
this.rbDNOff = new System.Windows.Forms.RadioButton();
this.tbpAutoResponse = new System.Windows.Forms.TabPage();
+ this.gnAutoScriptPermission = new System.Windows.Forms.GroupBox();
+ this.cbAutoScriptPermission = new System.Windows.Forms.ComboBox();
this.gnAutoInventory = new System.Windows.Forms.GroupBox();
this.cbOnInvOffer = new System.Windows.Forms.ComboBox();
this.txtAutoResponse = new System.Windows.Forms.TextBox();
this.autoSitUUID = new System.Windows.Forms.TextBox();
this.autoSitName = new System.Windows.Forms.TextBox();
this.autoSitNameLabel = new System.Windows.Forms.Label();
- this.gnAutoScriptPermission = new System.Windows.Forms.GroupBox();
- this.cbAutoScriptPermission = new System.Windows.Forms.ComboBox();
this.tcGraphics.SuspendLayout();
this.tbpGeneral.SuspendLayout();
this.cbHighLight.SuspendLayout();
this.Chat.SuspendLayout();
this.gbDisplayNames.SuspendLayout();
this.tbpAutoResponse.SuspendLayout();
+ this.gnAutoScriptPermission.SuspendLayout();
this.gnAutoInventory.SuspendLayout();
this.gbAutoResponse.SuspendLayout();
this.tbpBot.SuspendLayout();
this.pseudoHome.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pseudoHomeTolerance)).BeginInit();
this.autoSit.SuspendLayout();
- this.gnAutoScriptPermission.SuspendLayout();
this.SuspendLayout();
//
// tcGraphics
//
// cbMisc
//
+ this.cbMisc.Controls.Add(this.txtResolveURITime);
+ this.cbMisc.Controls.Add(this.label4);
+ this.cbMisc.Controls.Add(this.cbResolveURIs);
this.cbMisc.Controls.Add(this.cbShowScriptErrors);
this.cbMisc.Controls.Add(this.cbDisableHTTPInventory);
this.cbMisc.Controls.Add(this.cbHideLoginGraphics);
this.cbMisc.Controls.Add(this.cbSyntaxHighlight);
this.cbMisc.Location = new System.Drawing.Point(270, 6);
this.cbMisc.Name = "cbMisc";
- this.cbMisc.Size = new System.Drawing.Size(236, 310);
+ this.cbMisc.Size = new System.Drawing.Size(236, 345);
this.cbMisc.TabIndex = 2;
this.cbMisc.TabStop = false;
//
+ // txtResolveURITime
+ //
+ this.txtResolveURITime.Location = new System.Drawing.Point(138, 318);
+ this.txtResolveURITime.Name = "txtResolveURITime";
+ this.txtResolveURITime.Size = new System.Drawing.Size(53, 20);
+ this.txtResolveURITime.TabIndex = 20;
+ this.txtResolveURITime.Text = "100";
+ this.txtResolveURITime.TextChanged += new System.EventHandler(this.txtResolveURITime_TextChanged);
+ //
+ // label4
+ //
+ this.label4.AutoSize = true;
+ this.label4.Location = new System.Drawing.Point(23, 321);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(109, 13);
+ this.label4.TabIndex = 19;
+ this.label4.Text = "Resolve Timeout (ms)";
+ //
+ // cbResolveURIs
+ //
+ this.cbResolveURIs.AutoSize = true;
+ this.cbResolveURIs.Location = new System.Drawing.Point(6, 304);
+ this.cbResolveURIs.Name = "cbResolveURIs";
+ this.cbResolveURIs.Size = new System.Drawing.Size(92, 17);
+ this.cbResolveURIs.TabIndex = 18;
+ this.cbResolveURIs.Text = "Resolve URIs";
+ this.cbResolveURIs.UseVisualStyleBackColor = true;
+ this.cbResolveURIs.CheckedChanged += new System.EventHandler(this.cbResolveURIs_CheckedChanged);
+ //
// cbShowScriptErrors
//
this.cbShowScriptErrors.AutoSize = true;
//
// txtReconnectTime
//
- this.txtReconnectTime.Location = new System.Drawing.Point(151, 96);
+ this.txtReconnectTime.Location = new System.Drawing.Point(157, 88);
this.txtReconnectTime.Name = "txtReconnectTime";
this.txtReconnectTime.Size = new System.Drawing.Size(53, 20);
this.txtReconnectTime.TabIndex = 8;
// label2
//
this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(22, 91);
+ this.label2.Location = new System.Drawing.Point(23, 91);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(128, 13);
this.label2.TabIndex = 7;
"14",
"16",
"20"});
- this.cbFontSize.Location = new System.Drawing.Point(97, 51);
+ this.cbFontSize.Location = new System.Drawing.Point(104, 53);
this.cbFontSize.Name = "cbFontSize";
this.cbFontSize.Size = new System.Drawing.Size(54, 21);
this.cbFontSize.TabIndex = 3;
// label1
//
this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(24, 54);
+ this.label1.Location = new System.Drawing.Point(26, 56);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(73, 13);
this.label1.TabIndex = 2;
this.tbpAutoResponse.Text = "Auto Response";
this.tbpAutoResponse.UseVisualStyleBackColor = true;
//
+ // gnAutoScriptPermission
+ //
+ this.gnAutoScriptPermission.Controls.Add(this.cbAutoScriptPermission);
+ this.gnAutoScriptPermission.Location = new System.Drawing.Point(9, 216);
+ this.gnAutoScriptPermission.Name = "gnAutoScriptPermission";
+ this.gnAutoScriptPermission.Size = new System.Drawing.Size(281, 54);
+ this.gnAutoScriptPermission.TabIndex = 3;
+ this.gnAutoScriptPermission.TabStop = false;
+ this.gnAutoScriptPermission.Text = "On script permission questions";
+ //
+ // cbAutoScriptPermission
+ //
+ this.cbAutoScriptPermission.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cbAutoScriptPermission.FormattingEnabled = true;
+ this.cbAutoScriptPermission.Items.AddRange(new object[] {
+ "Ask",
+ "Auto Accept",
+ "Auto Decline"});
+ this.cbAutoScriptPermission.Location = new System.Drawing.Point(6, 19);
+ this.cbAutoScriptPermission.Name = "cbAutoScriptPermission";
+ this.cbAutoScriptPermission.Size = new System.Drawing.Size(121, 21);
+ this.cbAutoScriptPermission.TabIndex = 0;
+ this.cbAutoScriptPermission.SelectedIndexChanged += new System.EventHandler(this.cbAutoScriptPermission_SelectedIndexChanged);
+ //
// gnAutoInventory
//
this.gnAutoInventory.Controls.Add(this.cbOnInvOffer);
this.autoSitNameLabel.Text = "Name";
this.autoSitNameLabel.Click += new System.EventHandler(this.autoSitNameLabel_Click);
//
- // gnAutoScriptPermission
- //
- this.gnAutoScriptPermission.Controls.Add(this.cbAutoScriptPermission);
- this.gnAutoScriptPermission.Location = new System.Drawing.Point(9, 216);
- this.gnAutoScriptPermission.Name = "gnAutoScriptPermission";
- this.gnAutoScriptPermission.Size = new System.Drawing.Size(281, 54);
- this.gnAutoScriptPermission.TabIndex = 3;
- this.gnAutoScriptPermission.TabStop = false;
- this.gnAutoScriptPermission.Text = "On script permission questions";
- //
- // cbAutoScriptPermission
- //
- this.cbAutoScriptPermission.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.cbAutoScriptPermission.FormattingEnabled = true;
- this.cbAutoScriptPermission.Items.AddRange(new object[] {
- "Ask",
- "Auto Accept",
- "Auto Decline"});
- this.cbAutoScriptPermission.Location = new System.Drawing.Point(6, 19);
- this.cbAutoScriptPermission.Name = "cbAutoScriptPermission";
- this.cbAutoScriptPermission.Size = new System.Drawing.Size(121, 21);
- this.cbAutoScriptPermission.TabIndex = 0;
- this.cbAutoScriptPermission.SelectedIndexChanged += new System.EventHandler(this.cbAutoScriptPermission_SelectedIndexChanged);
- //
// frmSettings
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.gbDisplayNames.PerformLayout();
this.tbpAutoResponse.ResumeLayout(false);
this.tbpAutoResponse.PerformLayout();
+ this.gnAutoScriptPermission.ResumeLayout(false);
this.gnAutoInventory.ResumeLayout(false);
this.gbAutoResponse.ResumeLayout(false);
this.gbAutoResponse.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pseudoHomeTolerance)).EndInit();
this.autoSit.ResumeLayout(false);
this.autoSit.PerformLayout();
- this.gnAutoScriptPermission.ResumeLayout(false);
this.ResumeLayout(false);
}
public System.Windows.Forms.CheckBox cbShowScriptErrors;
public System.Windows.Forms.GroupBox gnAutoScriptPermission;
public System.Windows.Forms.ComboBox cbAutoScriptPermission;
+ public System.Windows.Forms.TextBox txtResolveURITime;
+ public System.Windows.Forms.Label label4;
+ public System.Windows.Forms.CheckBox cbResolveURIs;
}
if (!s.ContainsKey("reconnect_time")) s["reconnect_time"] = 120;
+ if (!s.ContainsKey("resolve_uri_time")) s["resolve_uri_time"] = 100;
+
+ if (!s.ContainsKey("resolve_uris")) s["resolve_uris"] = true;
+
if (!s.ContainsKey("transaction_notification_chat")) s["transaction_notification_chat"] = true;
if (!s.ContainsKey("transaction_notification_dialog")) s["transaction_notification_dialog"] = true;
cbAutoReconnect.Checked = s["auto_reconnect"].AsBoolean();
cbAutoReconnect.CheckedChanged += new EventHandler(cbAutoReconnect_CheckedChanged);
+ cbResolveURIs.Checked = s["resolve_uris"].AsBoolean();
+ cbResolveURIs.CheckedChanged += new EventHandler(cbResolveURIs_CheckedChanged); ;
+
cbHideLoginGraphics.Checked = s["hide_login_graphics"].AsBoolean();
cbHideLoginGraphics.CheckedChanged += new EventHandler(cbHideLoginGraphics_CheckedChanged);
txtReconnectTime.Text = s["reconnect_time"].AsInteger().ToString();
+ txtResolveURITime.Text = s["resolve_uri_time"].AsInteger().ToString();
+
cbRadegastClientTag.Checked = s["send_rad_client_tag"];
cbRadegastClientTag.CheckedChanged += (sender, e) =>
{
s["auto_reconnect"] = OSD.FromBoolean(cbAutoReconnect.Checked);
}
+ private void cbResolveURIs_CheckedChanged(object sender, EventArgs e)
+ {
+ s["resolve_uris"] = OSD.FromBoolean(cbResolveURIs.Checked);
+ }
+
void cbFriendsNotifications_CheckedChanged(object sender, EventArgs e)
{
s["show_friends_online_notifications"] = OSD.FromBoolean(cbFriendsNotifications.Checked);
s["reconnect_time"] = t;
}
+ private void txtResolveURITime_TextChanged(object sender, EventArgs e)
+ {
+ string input = System.Text.RegularExpressions.Regex.Replace(txtResolveURITime.Text, @"[^\d]", "");
+ int t = 100;
+ int.TryParse(input, out t);
+
+ if (txtResolveURITime.Text != t.ToString())
+ {
+ txtResolveURITime.Text = t.ToString();
+ txtResolveURITime.Select(txtResolveURITime.Text.Length, 0);
+ }
+
+ s["resolve_uri_time"] = t;
+ }
+
private void cbRadegastLogToFile_CheckedChanged(object sender, EventArgs e)
{
s["log_to_file"] = OSD.FromBoolean(cbRadegastLogToFile.Checked);