From 99a6d8611f192e89602f2e0a79c7c94f51c7ebd7 Mon Sep 17 00:00:00 2001 From: Jim Radford Date: Sun, 26 Apr 2009 09:38:34 +0000 Subject: [PATCH] LIBOMV-485 Adds missing options to Login DefaultLoginParams to hopefully correct the login issue with Mono LIBOMV-492 Adds local network interfaces to the listen IP dropdown in WinGridProxy LIBOMV-477 remove cruft debug code from LindenMessages.cs git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2664 52acb1d6-8a22-11de-b505-999d5b087335 --- OpenMetaverse/Login.cs | 42 +++++++- OpenMetaverse/Messages/LindenMessages.cs | 1 - Programs/WinGridProxy/Form1.Designer.cs | 129 ++++++++++++----------- Programs/WinGridProxy/Form1.cs | 45 ++++---- Programs/WinGridProxy/Form1.resx | 18 ++-- 5 files changed, 137 insertions(+), 98 deletions(-) diff --git a/OpenMetaverse/Login.cs b/OpenMetaverse/Login.cs index ca1ca82a..7a74aee5 100644 --- a/OpenMetaverse/Login.cs +++ b/OpenMetaverse/Login.cs @@ -71,23 +71,52 @@ namespace OpenMetaverse /// public struct LoginParams { + /// The URL of the Login Server public string URI; + /// The number of milliseconds to wait before a login is considered + /// failed due to timeout public int Timeout; + /// The request method + /// login_to_server is currently the only supported method public string MethodName; + /// The Agents First name public string FirstName; + /// The Agents Last name public string LastName; + /// A md5 hashed password + /// plaintext password will be automatically hashed public string Password; + /// The agents starting location once logged in + /// Either "last", "home", or a string encoded URI + /// containing the simulator name and x/y/z coordinates e.g: uri:hooper&128&152&17 + /// public string Start; + /// A string containing the client software channel information + /// Second Life Release public string Channel; + /// The client software version information + /// The official viewer uses: Second Life Release n.n.n.n + /// where n is replaced with the current version of the viewer public string Version; + /// A string containing the platform information the agent is running on public string Platform; + /// A string hash of the network cards Mac Address public string MAC; + /// Unknown or deprecated public string ViewerDigest; + /// A string hash of the first disk drives ID used to identify this clients uniqueness public string ID0; + /// A string containing the viewers Software, this is not directly sent to the login server but + /// instead is used to generate the Version string public string UserAgent; + /// A string representing the software creator. This is not directly sent to the login server but + /// is used by the library to generate the Version information public string Author; + /// If true, this agent agrees to the Terms of Service of the grid its connecting to public string AgreeToTos; + /// Unknown public string ReadCritical; + /// An array of string sent to the login server to enable various options public string[] Options; } @@ -99,7 +128,7 @@ namespace OpenMetaverse } /// - /// + /// The decoded data returned from the login server after a successful login /// public struct LoginResponseData { @@ -130,6 +159,7 @@ namespace OpenMetaverse public string SeedCapability; public BuddyListEntry[] BuddyList; public int SecondsSinceEpoch; + public string UDPBlacklist; #region Inventory @@ -155,7 +185,6 @@ namespace OpenMetaverse public string AgentRegionAccess; public int AOTransition; public string InventoryHost; - public string UDPBlacklist; /// /// Parse LLSD Login Reply Data @@ -1044,7 +1073,7 @@ namespace OpenMetaverse private string InternalRawLoginReply = String.Empty; private Dictionary CallbackOptions = new Dictionary(); /// A list of packets obtained during the login process which networkmanager will log but not process - private List UDPBlacklist = new List(); + private readonly List UDPBlacklist = new List(); #endregion #region Public Methods @@ -1062,22 +1091,26 @@ namespace OpenMetaverse public LoginParams DefaultLoginParams(string firstName, string lastName, string password, string userAgent, string userVersion) { - List options = new List(); + List options = new List(15); options.Add("inventory-root"); options.Add("inventory-skeleton"); options.Add("inventory-lib-root"); options.Add("inventory-lib-owner"); options.Add("inventory-skel-lib"); + options.Add("initial-outfit"); options.Add("gestures"); options.Add("event_categories"); options.Add("event_notifications"); options.Add("classified_categories"); options.Add("buddy-list"); options.Add("ui-config"); + options.Add("tutorial_settings"); options.Add("login-flags"); options.Add("global-textures"); LoginParams loginParams = new LoginParams(); + if (Client == null) + throw new NullReferenceException("GridClient must be instantiated before calling DefaultLoginParams()"); loginParams.URI = Client.Settings.LOGIN_SERVER; loginParams.Timeout = Client.Settings.LOGIN_TIMEOUT; @@ -1337,6 +1370,7 @@ namespace OpenMetaverse loginXmlRpc["read_critical"] = true; loginXmlRpc["viewer_digest"] = loginParams.ViewerDigest; loginXmlRpc["id0"] = loginParams.ID0; + loginXmlRpc["last_exec_event"] = 0; // Create the options array ArrayList options = new ArrayList(); diff --git a/OpenMetaverse/Messages/LindenMessages.cs b/OpenMetaverse/Messages/LindenMessages.cs index 98544bed..c7608b22 100644 --- a/OpenMetaverse/Messages/LindenMessages.cs +++ b/OpenMetaverse/Messages/LindenMessages.cs @@ -74,7 +74,6 @@ namespace OpenMetaverse.Messages.Linden public void Deserialize(OSDMap map) { - Console.WriteLine("Deserializing TeleportFinish Message"); OSDArray array = (OSDArray)map["Info"]; OSDMap blockMap = (OSDMap)array[0]; diff --git a/Programs/WinGridProxy/Form1.Designer.cs b/Programs/WinGridProxy/Form1.Designer.cs index 723a0620..472045ab 100644 --- a/Programs/WinGridProxy/Form1.Designer.cs +++ b/Programs/WinGridProxy/Form1.Designer.cs @@ -37,7 +37,6 @@ this.textBoxProxyPort = new System.Windows.Forms.TextBox(); this.button1 = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); - this.textBoxProxyListenIP = new System.Windows.Forms.TextBox(); this.panelMainWindow = new System.Windows.Forms.Panel(); this.splitContainerSessionsTabs = new System.Windows.Forms.SplitContainer(); this.listViewSessions = new WinGridProxy.ListViewNoFlicker(); @@ -55,7 +54,6 @@ this.toolStripMenuItemRemoveAll = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItemRemoveSelected = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItemRemoveUnselected = new System.Windows.Forms.ToolStripMenuItem(); - this.removeToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); this.selectToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); this.contextMenuStripSelect = new System.Windows.Forms.ContextMenuStrip(this.components); this.allToolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem(); @@ -63,7 +61,6 @@ this.noneToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparatorSelectPacketProto = new System.Windows.Forms.ToolStripSeparator(); this.toolStripMenuItemSelectPacketName = new System.Windows.Forms.ToolStripMenuItem(); - this.selectToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparatorFilterPacketByName = new System.Windows.Forms.ToolStripSeparator(); this.enableDisableFilterByNameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator15 = new System.Windows.Forms.ToolStripSeparator(); @@ -76,6 +73,7 @@ this.orangeToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator17 = new System.Windows.Forms.ToolStripSeparator(); this.unmarkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.markToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator16 = new System.Windows.Forms.ToolStripSeparator(); this.findToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.imageList1 = new System.Windows.Forms.ImageList(this.components); @@ -142,7 +140,8 @@ this.button3 = new System.Windows.Forms.Button(); this.buttonInjectPacket = new System.Windows.Forms.Button(); this.richTextBoxInject = new System.Windows.Forms.RichTextBox(); - this.markToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.removeToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); + this.selectToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripLabelHexEditorRequest = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); @@ -223,6 +222,7 @@ this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator(); this.autoColorizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.colorDialog1 = new System.Windows.Forms.ColorDialog(); + this.comboBoxListenAddress = new System.Windows.Forms.ComboBox(); this.panelProxyConfig.SuspendLayout(); this.panelMainWindow.SuspendLayout(); this.splitContainerSessionsTabs.Panel1.SuspendLayout(); @@ -270,13 +270,13 @@ // // panelProxyConfig // + this.panelProxyConfig.Controls.Add(this.comboBoxListenAddress); this.panelProxyConfig.Controls.Add(this.comboBoxLoginURL); this.panelProxyConfig.Controls.Add(this.label3); this.panelProxyConfig.Controls.Add(this.label2); this.panelProxyConfig.Controls.Add(this.textBoxProxyPort); this.panelProxyConfig.Controls.Add(this.button1); this.panelProxyConfig.Controls.Add(this.label1); - this.panelProxyConfig.Controls.Add(this.textBoxProxyListenIP); this.panelProxyConfig.Location = new System.Drawing.Point(12, 28); this.panelProxyConfig.Name = "panelProxyConfig"; this.panelProxyConfig.Size = new System.Drawing.Size(1070, 32); @@ -290,7 +290,7 @@ "https://login.aditi.lindenlab.com/cgi-bin/login.cgi", "http://127.0.0.1:8002", "http://osgrid.org:8002"}); - this.comboBoxLoginURL.Location = new System.Drawing.Point(354, 6); + this.comboBoxLoginURL.Location = new System.Drawing.Point(393, 6); this.comboBoxLoginURL.Name = "comboBoxLoginURL"; this.comboBoxLoginURL.Size = new System.Drawing.Size(252, 21); this.comboBoxLoginURL.TabIndex = 6; @@ -299,7 +299,7 @@ // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(290, 9); + this.label3.Location = new System.Drawing.Point(329, 9); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(58, 13); this.label3.TabIndex = 5; @@ -316,7 +316,7 @@ // // textBoxProxyPort // - this.textBoxProxyPort.Location = new System.Drawing.Point(236, 6); + this.textBoxProxyPort.Location = new System.Drawing.Point(275, 6); this.textBoxProxyPort.Name = "textBoxProxyPort"; this.textBoxProxyPort.Size = new System.Drawing.Size(48, 20); this.textBoxProxyPort.TabIndex = 3; @@ -324,7 +324,7 @@ // // button1 // - this.button1.Location = new System.Drawing.Point(612, 4); + this.button1.Location = new System.Drawing.Point(651, 4); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(75, 23); this.button1.TabIndex = 2; @@ -335,20 +335,12 @@ // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(204, 9); + this.label1.Location = new System.Drawing.Point(243, 9); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(26, 13); this.label1.TabIndex = 1; this.label1.Text = "Port"; // - // textBoxProxyListenIP - // - this.textBoxProxyListenIP.Location = new System.Drawing.Point(98, 6); - this.textBoxProxyListenIP.Name = "textBoxProxyListenIP"; - this.textBoxProxyListenIP.Size = new System.Drawing.Size(100, 20); - this.textBoxProxyListenIP.TabIndex = 0; - this.textBoxProxyListenIP.Text = "127.0.0.1"; - // // panelMainWindow // this.panelMainWindow.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -446,7 +438,7 @@ this.toolStripSeparator16, this.findToolStripMenuItem1}); this.contextMenuStripSessions.Name = "contextMenuStripSessions"; - this.contextMenuStripSessions.Size = new System.Drawing.Size(180, 182); + this.contextMenuStripSessions.Size = new System.Drawing.Size(180, 160); this.contextMenuStripSessions.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStripSessions_Opening); // // toolStripMenuItemAutoScroll @@ -476,7 +468,7 @@ this.toolStripMenuItemRemoveSelected, this.toolStripMenuItemRemoveUnselected}); this.contextMenuStripRemove.Name = "contextMenuStripRemove"; - this.contextMenuStripRemove.OwnerItem = this.toolStripMenuSessionsRemove; + this.contextMenuStripRemove.OwnerItem = this.removeToolStripMenuItem2; this.contextMenuStripRemove.Size = new System.Drawing.Size(149, 70); // // toolStripMenuItemRemoveAll @@ -501,13 +493,6 @@ this.toolStripMenuItemRemoveUnselected.Text = "Unselected"; this.toolStripMenuItemRemoveUnselected.Click += new System.EventHandler(this.sessionRemoveUnselected_Click); // - // removeToolStripMenuItem2 - // - this.removeToolStripMenuItem2.DropDown = this.contextMenuStripRemove; - this.removeToolStripMenuItem2.Name = "removeToolStripMenuItem2"; - this.removeToolStripMenuItem2.Size = new System.Drawing.Size(143, 22); - this.removeToolStripMenuItem2.Text = "Remove"; - // // selectToolStripMenuItem2 // this.selectToolStripMenuItem2.DropDown = this.contextMenuStripSelect; @@ -524,7 +509,7 @@ this.toolStripSeparatorSelectPacketProto, this.toolStripMenuItemSelectPacketName}); this.contextMenuStripSelect.Name = "contextMenuStripSelect"; - this.contextMenuStripSelect.OwnerItem = this.selectToolStripMenuItem2; + this.contextMenuStripSelect.OwnerItem = this.selectToolStripMenuItem1; this.contextMenuStripSelect.Size = new System.Drawing.Size(167, 98); // // allToolStripMenuItem4 @@ -561,13 +546,6 @@ this.toolStripMenuItemSelectPacketName.Text = "All (Packet Type)"; this.toolStripMenuItemSelectPacketName.Click += new System.EventHandler(this.sessionSelectAllPacketType_Click); // - // selectToolStripMenuItem1 - // - this.selectToolStripMenuItem1.DropDown = this.contextMenuStripSelect; - this.selectToolStripMenuItem1.Name = "selectToolStripMenuItem1"; - this.selectToolStripMenuItem1.Size = new System.Drawing.Size(143, 22); - this.selectToolStripMenuItem1.Text = "Select"; - // // toolStripSeparatorFilterPacketByName // this.toolStripSeparatorFilterPacketByName.Name = "toolStripSeparatorFilterPacketByName"; @@ -606,7 +584,7 @@ this.toolStripSeparator17, this.unmarkToolStripMenuItem}); this.contextMenuStripMark.Name = "contextMenuStripMarkDropdown"; - this.contextMenuStripMark.OwnerItem = this.markToolStripMenuItem1; + this.contextMenuStripMark.OwnerItem = this.markToolStripMenuItem2; this.contextMenuStripMark.Size = new System.Drawing.Size(122, 142); // // redToolStripMenuItem2 @@ -656,6 +634,13 @@ this.unmarkToolStripMenuItem.Text = "Unmark"; this.unmarkToolStripMenuItem.Click += new System.EventHandler(this.sessionUnmarkSelected_Click); // + // markToolStripMenuItem1 + // + this.markToolStripMenuItem1.DropDown = this.contextMenuStripMark; + this.markToolStripMenuItem1.Name = "markToolStripMenuItem1"; + this.markToolStripMenuItem1.Size = new System.Drawing.Size(143, 22); + this.markToolStripMenuItem1.Text = "Mark"; + // // toolStripSeparator16 // this.toolStripSeparator16.Name = "toolStripSeparator16"; @@ -879,7 +864,7 @@ this.splitContainerFilters.Panel2.Controls.Add(this.checkBoxCheckAllMessages); this.splitContainerFilters.Panel2.Controls.Add(this.grpCapsFilters); this.splitContainerFilters.Size = new System.Drawing.Size(599, 390); - this.splitContainerFilters.SplitterDistance = 299; + this.splitContainerFilters.SplitterDistance = 298; this.splitContainerFilters.SplitterWidth = 5; this.splitContainerFilters.TabIndex = 0; // @@ -906,7 +891,7 @@ this.grpUDPFilters.Enabled = false; this.grpUDPFilters.Location = new System.Drawing.Point(3, 3); this.grpUDPFilters.Name = "grpUDPFilters"; - this.grpUDPFilters.Size = new System.Drawing.Size(293, 357); + this.grpUDPFilters.Size = new System.Drawing.Size(292, 357); this.grpUDPFilters.TabIndex = 0; this.grpUDPFilters.TabStop = false; this.grpUDPFilters.Text = "UDP Packets"; @@ -923,7 +908,7 @@ this.listViewPacketFilters.Location = new System.Drawing.Point(3, 16); this.listViewPacketFilters.MultiSelect = false; this.listViewPacketFilters.Name = "listViewPacketFilters"; - this.listViewPacketFilters.Size = new System.Drawing.Size(287, 338); + this.listViewPacketFilters.Size = new System.Drawing.Size(286, 338); this.listViewPacketFilters.Sorting = System.Windows.Forms.SortOrder.Ascending; this.listViewPacketFilters.TabIndex = 0; this.listViewPacketFilters.UseCompatibleStateImageBehavior = false; @@ -963,7 +948,7 @@ this.grpCapsFilters.Enabled = false; this.grpCapsFilters.Location = new System.Drawing.Point(3, 3); this.grpCapsFilters.Name = "grpCapsFilters"; - this.grpCapsFilters.Size = new System.Drawing.Size(289, 357); + this.grpCapsFilters.Size = new System.Drawing.Size(290, 357); this.grpCapsFilters.TabIndex = 1; this.grpCapsFilters.TabStop = false; this.grpCapsFilters.Text = "Capabilities Messages"; @@ -980,7 +965,7 @@ this.listViewMessageFilters.Location = new System.Drawing.Point(3, 16); this.listViewMessageFilters.MultiSelect = false; this.listViewMessageFilters.Name = "listViewMessageFilters"; - this.listViewMessageFilters.Size = new System.Drawing.Size(283, 338); + this.listViewMessageFilters.Size = new System.Drawing.Size(284, 338); this.listViewMessageFilters.Sorting = System.Windows.Forms.SortOrder.Ascending; this.listViewMessageFilters.TabIndex = 1; this.listViewMessageFilters.UseCompatibleStateImageBehavior = false; @@ -1076,7 +1061,7 @@ this.tabPageRawRequest.Location = new System.Drawing.Point(4, 26); this.tabPageRawRequest.Name = "tabPageRawRequest"; this.tabPageRawRequest.Padding = new System.Windows.Forms.Padding(3); - this.tabPageRawRequest.Size = new System.Drawing.Size(596, 149); + this.tabPageRawRequest.Size = new System.Drawing.Size(597, 149); this.tabPageRawRequest.TabIndex = 0; this.tabPageRawRequest.Text = "Raw"; this.tabPageRawRequest.UseVisualStyleBackColor = true; @@ -1088,7 +1073,7 @@ this.richTextBoxRawRequest.Location = new System.Drawing.Point(3, 3); this.richTextBoxRawRequest.Name = "richTextBoxRawRequest"; this.richTextBoxRawRequest.ShowSelectionMargin = true; - this.richTextBoxRawRequest.Size = new System.Drawing.Size(590, 143); + this.richTextBoxRawRequest.Size = new System.Drawing.Size(591, 143); this.richTextBoxRawRequest.TabIndex = 1; this.richTextBoxRawRequest.Text = ""; this.richTextBoxRawRequest.WordWrap = false; @@ -1100,7 +1085,7 @@ this.tabPageXMLRequest.Location = new System.Drawing.Point(4, 26); this.tabPageXMLRequest.Name = "tabPageXMLRequest"; this.tabPageXMLRequest.Padding = new System.Windows.Forms.Padding(3); - this.tabPageXMLRequest.Size = new System.Drawing.Size(596, 149); + this.tabPageXMLRequest.Size = new System.Drawing.Size(597, 149); this.tabPageXMLRequest.TabIndex = 1; this.tabPageXMLRequest.Text = "XML"; this.tabPageXMLRequest.UseVisualStyleBackColor = true; @@ -1110,7 +1095,7 @@ this.treeViewXMLRequest.Dock = System.Windows.Forms.DockStyle.Fill; this.treeViewXMLRequest.Location = new System.Drawing.Point(3, 3); this.treeViewXMLRequest.Name = "treeViewXMLRequest"; - this.treeViewXMLRequest.Size = new System.Drawing.Size(590, 143); + this.treeViewXMLRequest.Size = new System.Drawing.Size(591, 143); this.treeViewXMLRequest.TabIndex = 1; // // tabPageRequestJson @@ -1120,7 +1105,7 @@ this.tabPageRequestJson.Location = new System.Drawing.Point(4, 26); this.tabPageRequestJson.Name = "tabPageRequestJson"; this.tabPageRequestJson.Padding = new System.Windows.Forms.Padding(3); - this.tabPageRequestJson.Size = new System.Drawing.Size(596, 149); + this.tabPageRequestJson.Size = new System.Drawing.Size(597, 149); this.tabPageRequestJson.TabIndex = 3; this.tabPageRequestJson.Text = "Notation"; this.tabPageRequestJson.UseVisualStyleBackColor = true; @@ -1131,7 +1116,7 @@ this.richTextBoxNotationRequest.Location = new System.Drawing.Point(3, 3); this.richTextBoxNotationRequest.Name = "richTextBoxNotationRequest"; this.richTextBoxNotationRequest.ShowSelectionMargin = true; - this.richTextBoxNotationRequest.Size = new System.Drawing.Size(590, 143); + this.richTextBoxNotationRequest.Size = new System.Drawing.Size(591, 143); this.richTextBoxNotationRequest.TabIndex = 0; this.richTextBoxNotationRequest.Text = ""; // @@ -1142,7 +1127,7 @@ this.tabPageHexRequest.ImageIndex = 1; this.tabPageHexRequest.Location = new System.Drawing.Point(4, 26); this.tabPageHexRequest.Name = "tabPageHexRequest"; - this.tabPageHexRequest.Size = new System.Drawing.Size(596, 149); + this.tabPageHexRequest.Size = new System.Drawing.Size(597, 149); this.tabPageHexRequest.TabIndex = 2; this.tabPageHexRequest.Text = "Hex"; this.tabPageHexRequest.UseVisualStyleBackColor = true; @@ -1173,7 +1158,7 @@ this.hexBoxRequest.Location = new System.Drawing.Point(3, 3); this.hexBoxRequest.Name = "hexBoxRequest"; this.hexBoxRequest.ShadowSelectionColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(60)))), ((int)(((byte)(188)))), ((int)(((byte)(255))))); - this.hexBoxRequest.Size = new System.Drawing.Size(590, 120); + this.hexBoxRequest.Size = new System.Drawing.Size(591, 120); this.hexBoxRequest.StringViewVisible = true; this.hexBoxRequest.TabIndex = 2; this.hexBoxRequest.UseFixedBytesPerLine = true; @@ -1228,7 +1213,7 @@ this.tabPageInspectorRAWResponse.Location = new System.Drawing.Point(4, 26); this.tabPageInspectorRAWResponse.Name = "tabPageInspectorRAWResponse"; this.tabPageInspectorRAWResponse.Padding = new System.Windows.Forms.Padding(3); - this.tabPageInspectorRAWResponse.Size = new System.Drawing.Size(596, 182); + this.tabPageInspectorRAWResponse.Size = new System.Drawing.Size(597, 182); this.tabPageInspectorRAWResponse.TabIndex = 0; this.tabPageInspectorRAWResponse.Text = "Raw"; this.tabPageInspectorRAWResponse.UseVisualStyleBackColor = true; @@ -1240,7 +1225,7 @@ this.richTextBoxRawResponse.Location = new System.Drawing.Point(3, 3); this.richTextBoxRawResponse.Name = "richTextBoxRawResponse"; this.richTextBoxRawResponse.ShowSelectionMargin = true; - this.richTextBoxRawResponse.Size = new System.Drawing.Size(590, 176); + this.richTextBoxRawResponse.Size = new System.Drawing.Size(591, 176); this.richTextBoxRawResponse.TabIndex = 0; this.richTextBoxRawResponse.Text = ""; this.richTextBoxRawResponse.WordWrap = false; @@ -1252,7 +1237,7 @@ this.tabPageInspectorXMLResponse.Location = new System.Drawing.Point(4, 26); this.tabPageInspectorXMLResponse.Name = "tabPageInspectorXMLResponse"; this.tabPageInspectorXMLResponse.Padding = new System.Windows.Forms.Padding(3); - this.tabPageInspectorXMLResponse.Size = new System.Drawing.Size(596, 182); + this.tabPageInspectorXMLResponse.Size = new System.Drawing.Size(597, 182); this.tabPageInspectorXMLResponse.TabIndex = 1; this.tabPageInspectorXMLResponse.Text = "XML"; this.tabPageInspectorXMLResponse.UseVisualStyleBackColor = true; @@ -1262,7 +1247,7 @@ this.treeViewXmlResponse.Dock = System.Windows.Forms.DockStyle.Fill; this.treeViewXmlResponse.Location = new System.Drawing.Point(3, 3); this.treeViewXmlResponse.Name = "treeViewXmlResponse"; - this.treeViewXmlResponse.Size = new System.Drawing.Size(590, 176); + this.treeViewXmlResponse.Size = new System.Drawing.Size(591, 176); this.treeViewXmlResponse.TabIndex = 0; // // tabPageResponseJson @@ -1272,7 +1257,7 @@ this.tabPageResponseJson.Location = new System.Drawing.Point(4, 26); this.tabPageResponseJson.Name = "tabPageResponseJson"; this.tabPageResponseJson.Padding = new System.Windows.Forms.Padding(3); - this.tabPageResponseJson.Size = new System.Drawing.Size(596, 182); + this.tabPageResponseJson.Size = new System.Drawing.Size(597, 182); this.tabPageResponseJson.TabIndex = 5; this.tabPageResponseJson.Text = "Notation"; this.tabPageResponseJson.UseVisualStyleBackColor = true; @@ -1283,7 +1268,7 @@ this.richTextBoxNotationResponse.Location = new System.Drawing.Point(3, 3); this.richTextBoxNotationResponse.Name = "richTextBoxNotationResponse"; this.richTextBoxNotationResponse.ShowSelectionMargin = true; - this.richTextBoxNotationResponse.Size = new System.Drawing.Size(590, 176); + this.richTextBoxNotationResponse.Size = new System.Drawing.Size(591, 176); this.richTextBoxNotationResponse.TabIndex = 0; this.richTextBoxNotationResponse.Text = ""; // @@ -1295,7 +1280,7 @@ this.tabPageHexViewResponse.Location = new System.Drawing.Point(4, 26); this.tabPageHexViewResponse.Name = "tabPageHexViewResponse"; this.tabPageHexViewResponse.Padding = new System.Windows.Forms.Padding(3); - this.tabPageHexViewResponse.Size = new System.Drawing.Size(596, 182); + this.tabPageHexViewResponse.Size = new System.Drawing.Size(597, 182); this.tabPageHexViewResponse.TabIndex = 4; this.tabPageHexViewResponse.Text = "Hex"; this.tabPageHexViewResponse.UseVisualStyleBackColor = true; @@ -1306,7 +1291,7 @@ this.labelResponseHex}); this.statusStrip1.Location = new System.Drawing.Point(3, 157); this.statusStrip1.Name = "statusStrip1"; - this.statusStrip1.Size = new System.Drawing.Size(590, 22); + this.statusStrip1.Size = new System.Drawing.Size(591, 22); this.statusStrip1.TabIndex = 0; this.statusStrip1.Text = "statusStrip1"; // @@ -1325,7 +1310,7 @@ this.hexBoxResponse.Location = new System.Drawing.Point(3, 3); this.hexBoxResponse.Name = "hexBoxResponse"; this.hexBoxResponse.ShadowSelectionColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(60)))), ((int)(((byte)(188)))), ((int)(((byte)(255))))); - this.hexBoxResponse.Size = new System.Drawing.Size(590, 152); + this.hexBoxResponse.Size = new System.Drawing.Size(591, 152); this.hexBoxResponse.StringViewVisible = true; this.hexBoxResponse.TabIndex = 1; this.hexBoxResponse.UseFixedBytesPerLine = true; @@ -1405,12 +1390,19 @@ this.richTextBoxInject.Text = ""; this.richTextBoxInject.TextChanged += new System.EventHandler(this.richTextBoxInject_TextChanged); // - // markToolStripMenuItem1 + // removeToolStripMenuItem2 // - this.markToolStripMenuItem1.DropDown = this.contextMenuStripMark; - this.markToolStripMenuItem1.Name = "markToolStripMenuItem1"; - this.markToolStripMenuItem1.Size = new System.Drawing.Size(143, 22); - this.markToolStripMenuItem1.Text = "Mark"; + this.removeToolStripMenuItem2.DropDown = this.contextMenuStripRemove; + this.removeToolStripMenuItem2.Name = "removeToolStripMenuItem2"; + this.removeToolStripMenuItem2.Size = new System.Drawing.Size(143, 22); + this.removeToolStripMenuItem2.Text = "Remove"; + // + // selectToolStripMenuItem1 + // + this.selectToolStripMenuItem1.DropDown = this.contextMenuStripSelect; + this.selectToolStripMenuItem1.Name = "selectToolStripMenuItem1"; + this.selectToolStripMenuItem1.Size = new System.Drawing.Size(143, 22); + this.selectToolStripMenuItem1.Text = "Select"; // // toolStripLabelHexEditorRequest // @@ -2030,6 +2022,15 @@ this.autoColorizeToolStripMenuItem.Text = "Auto Colorize"; this.autoColorizeToolStripMenuItem.Click += new System.EventHandler(this.autoColorizeToolStripMenuItem_Click); // + // comboBoxListenAddress + // + this.comboBoxListenAddress.FormattingEnabled = true; + this.comboBoxListenAddress.Location = new System.Drawing.Point(98, 6); + this.comboBoxListenAddress.Name = "comboBoxListenAddress"; + this.comboBoxListenAddress.Size = new System.Drawing.Size(139, 21); + this.comboBoxListenAddress.TabIndex = 7; + this.comboBoxListenAddress.Text = "127.0.0.1"; + // // FormWinGridProxy // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -2110,7 +2111,6 @@ private System.Windows.Forms.TextBox textBoxProxyPort; private System.Windows.Forms.Button button1; private System.Windows.Forms.Label label1; - private System.Windows.Forms.TextBox textBoxProxyListenIP; private System.Windows.Forms.Panel panelMainWindow; private System.Windows.Forms.SplitContainer splitContainerSessionsTabs; private ListViewNoFlicker listViewSessions; @@ -2297,6 +2297,7 @@ private System.Windows.Forms.ToolStripMenuItem autoColorizeToolStripMenuItem; private System.Windows.Forms.ColorDialog colorDialog1; private System.Windows.Forms.ColumnHeader columnHeaderContentType; + private System.Windows.Forms.ComboBox comboBoxListenAddress; } } diff --git a/Programs/WinGridProxy/Form1.cs b/Programs/WinGridProxy/Form1.cs index 0ccde553..32b12373 100644 --- a/Programs/WinGridProxy/Form1.cs +++ b/Programs/WinGridProxy/Form1.cs @@ -30,7 +30,7 @@ using System.Net; using System.Collections; using System.Collections.Generic; using System.ComponentModel; -using System.Data; + using System.Drawing; using System.Text; using System.Windows.Forms; @@ -41,7 +41,6 @@ using OpenMetaverse; using OpenMetaverse.Packets; using OpenMetaverse.StructuredData; using OpenMetaverse.Interfaces; -using OpenMetaverse.Messages.Linden; using System.Xml; using Nwc.XmlRpc; @@ -51,34 +50,40 @@ namespace WinGridProxy { private static SettingsStore Store = new SettingsStore(); - private static bool IsProxyRunning = false; + private static bool IsProxyRunning; - private bool AutoScrollSessions = false; + private bool AutoScrollSessions; ProxyManager proxy; - private int PacketCounter = 0; + private int PacketCounter; - private int CapsInCounter = 0; - private int CapsInBytes = 0; - private int CapsOutCounter = 0; - private int CapsOutBytes = 0; + private int CapsInCounter; + private int CapsInBytes; + private int CapsOutCounter; + private int CapsOutBytes; - private int PacketsInCounter = 0; + private int PacketsInCounter; private int PacketsInBytes; - private int PacketsOutCounter = 0; + private int PacketsOutCounter; private int PacketsOutBytes; public FormWinGridProxy() { InitializeComponent(); - ProxyManager.OnPacketLog += new ProxyManager.PacketLogHandler(ProxyManager_OnPacketLog); - ProxyManager.OnMessageLog += new ProxyManager.MessageLogHandler(ProxyManager_OnMessageLog); - ProxyManager.OnLoginResponse += new ProxyManager.LoginLogHandler(ProxyManager_OnLoginResponse); - ProxyManager.OnCapabilityAdded += new ProxyManager.CapsAddedHandler(ProxyManager_OnCapabilityAdded); - ProxyManager.OnEventMessageLog += new ProxyManager.EventQueueMessageHandler(ProxyManager_OnEventMessageLog); + // populate the listen box with IPs + IPHostEntry iphostentry = Dns.GetHostByName(Dns.GetHostName()); + foreach(IPAddress address in iphostentry.AddressList) + comboBoxListenAddress.Items.Add(address.ToString()); + + + ProxyManager.OnPacketLog += ProxyManager_OnPacketLog; + ProxyManager.OnMessageLog += ProxyManager_OnMessageLog; + ProxyManager.OnLoginResponse += ProxyManager_OnLoginResponse; + ProxyManager.OnCapabilityAdded += ProxyManager_OnCapabilityAdded; + ProxyManager.OnEventMessageLog += ProxyManager_OnEventMessageLog; } #region Event Handlers for Messages/Packets @@ -296,9 +301,9 @@ namespace WinGridProxy if (button1.Text.StartsWith("Start") && IsProxyRunning.Equals(false)) { - proxy = new ProxyManager(textBoxProxyPort.Text, textBoxProxyListenIP.Text, comboBoxLoginURL.Text); + proxy = new ProxyManager(textBoxProxyPort.Text, comboBoxListenAddress.Text, comboBoxLoginURL.Text); // disable any gui elements - textBoxProxyListenIP.Enabled = textBoxProxyPort.Enabled = comboBoxLoginURL.Enabled = false; + comboBoxListenAddress.Enabled = textBoxProxyPort.Enabled = comboBoxLoginURL.Enabled = false; InitProxyFilters(); @@ -318,7 +323,7 @@ namespace WinGridProxy proxy.Stop(); grpUDPFilters.Enabled = grpCapsFilters.Enabled = IsProxyRunning = false; button1.Text = "Start Proxy"; - textBoxProxyListenIP.Enabled = textBoxProxyPort.Enabled = comboBoxLoginURL.Enabled = true; + comboBoxListenAddress.Enabled = textBoxProxyPort.Enabled = comboBoxLoginURL.Enabled = true; if (!enableStatisticsToolStripMenuItem.Checked && timer1.Enabled) timer1.Enabled = false; @@ -915,7 +920,7 @@ namespace WinGridProxy // an array of class objects else if (messageField.FieldType.IsArray) { - object messageObjectData = messageField.GetValue(message); + var messageObjectData = messageField.GetValue(message); result.AppendFormat("-- {0} --" + System.Environment.NewLine, messageField.FieldType.Name); foreach (object nestedArrayObject in messageObjectData as Array) { diff --git a/Programs/WinGridProxy/Form1.resx b/Programs/WinGridProxy/Form1.resx index 8a5feabb..01fe664c 100644 --- a/Programs/WinGridProxy/Form1.resx +++ b/Programs/WinGridProxy/Form1.resx @@ -120,15 +120,6 @@ 524, 17 - - 185, 54 - - - 17, 54 - - - 705, 17 - 309, 17 @@ -181,6 +172,15 @@ BQAD/wUACw== + + 185, 54 + + + 17, 54 + + + 705, 17 + 414, 17