From 860a13b340231daab79efe25485107cfb975c98c Mon Sep 17 00:00:00 2001 From: Daenks Date: Tue, 4 Aug 2015 09:57:15 -0500 Subject: [PATCH 01/10] Not working, controller class just started. Copying HandleAdminMessage code back to DebugUI funtion of the same name works fine. --- Meridian59.DebugUI/AdminController.cs | 77 +++ .../CustomDataGridColumns/TagColumn.cs | 13 + Meridian59.DebugUI/DebugForm.Designer.cs | 469 ++++++++++-------- Meridian59.DebugUI/DebugForm.cs | 70 +++ Meridian59.DebugUI/Events/EventArgs.cs | 3 + Meridian59.DebugUI/Meridian59.DebugUI.csproj | 16 +- Meridian59.DebugUI/ObjectEditor.Designer.cs | 85 ++++ Meridian59.DebugUI/ObjectEditor.cs | 21 + Meridian59.DebugUI/ObjectEditor.resx | 120 +++++ Meridian59.DebugUI/Properties/AssemblyInfo.cs | 4 +- .../Properties/Resources.Designer.cs | 2 +- .../Viewers/InventoryObjectView.Designer.cs | 12 + .../Viewers/InventoryObjectView.resx | 3 + 13 files changed, 670 insertions(+), 225 deletions(-) create mode 100644 Meridian59.DebugUI/AdminController.cs create mode 100644 Meridian59.DebugUI/CustomDataGridColumns/TagColumn.cs create mode 100644 Meridian59.DebugUI/ObjectEditor.Designer.cs create mode 100644 Meridian59.DebugUI/ObjectEditor.cs create mode 100644 Meridian59.DebugUI/ObjectEditor.resx diff --git a/Meridian59.DebugUI/AdminController.cs b/Meridian59.DebugUI/AdminController.cs new file mode 100644 index 00000000..341c3985 --- /dev/null +++ b/Meridian59.DebugUI/AdminController.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using Meridian59.Protocol.GameMessages; + +namespace Meridian59.DebugUI +{ + public class AdminController + { + + public AdminController() + { + + } + + public void HandleAdminMessage(AdminMessage Message) + { + //Look for object info + var regex = new Regex(@":< OBJECT (?\d*) is CLASS (?.*)"); + if (regex.IsMatch(Message.Message)) + { + var matches = regex.Matches(Message.Message); + if (matches.Count < 1) //We should only get one of these at a time + { + //txtAdminCommand.Text += "Error parsing object header\r\n"; + return; + } + AdminObject obj = null; + foreach (Match match in matches) //but i dont know how to just do if -match will research + { + //txtAdminOutput.Text += String.Format("Found Object {0} of class {1}\r\n", match.Groups["objectnumber"], + // match.Groups["classname"]); + obj = new AdminObject(match.Groups["classname"].ToString(), Convert.ToInt32(match.Groups["objectnumber"].ToString())); + } + + regex = new Regex(@": (?\w*)\s*=\s(?[\w$]*)\s(?\d*)"); + if (regex.IsMatch((Message.Message))) + { + List props = new List(); + matches = regex.Matches(Message.Message); + foreach (Match match in matches) + { + //txtAdminOutput.Text += String.Format("Property {0} with datatype {1} and value {2}\r\n",match.Groups["property"],match.Groups["datatype"],match.Groups["value"]); + props.Add(new AdminObjectProperty(match.Groups["property"].ToString(), match.Groups["datatype"].ToString(), match.Groups["value"].ToString())); + } + if (obj != null) + { + obj.SetProperties(props); + ObjectEditor oe = new ObjectEditor(obj); + oe.Show(); + } + + } + + } + else + { + //txtAdminOutput.Text += Message.Message; + } + /* +:< OBJECT 0 is CLASS System +: self = OBJECT 0 +: plTemp = $ 0 +: plRooms = LIST 49994 +: plUsers = LIST 65530 +: plUsers_logged_on = $ 0 +: plTreasure_types = LIST 58647 +: plSpells = LIST 56333 +: plSkills = LIST 56352 +: plItem_Attributes = LIST 57342 +: plItemAttTreasure = LIST 56382 +*/ + } + } +} diff --git a/Meridian59.DebugUI/CustomDataGridColumns/TagColumn.cs b/Meridian59.DebugUI/CustomDataGridColumns/TagColumn.cs new file mode 100644 index 00000000..ee61d241 --- /dev/null +++ b/Meridian59.DebugUI/CustomDataGridColumns/TagColumn.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace Meridian59.DebugUI.CustomDataGridColumns +{ + class TagCell : DataGridViewTextBoxCell + { + + } +} diff --git a/Meridian59.DebugUI/DebugForm.Designer.cs b/Meridian59.DebugUI/DebugForm.Designer.cs index 64bb2d28..65ab1910 100644 --- a/Meridian59.DebugUI/DebugForm.Designer.cs +++ b/Meridian59.DebugUI/DebugForm.Designer.cs @@ -31,30 +31,21 @@ private void InitializeComponent() { this.tabMain = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); - this.gamePacketViewer = new Meridian59.DebugUI.ListViewers.GamePacketViewer(); this.tabPage2 = new System.Windows.Forms.TabPage(); this.splitContainer8 = new System.Windows.Forms.SplitContainer(); this.splitContainer10 = new System.Windows.Forms.SplitContainer(); this.groupOnlinePlayers = new System.Windows.Forms.GroupBox(); - this.onlinePlayersView = new Meridian59.DebugUI.OnlinePlayersView(); this.splitContainer9 = new System.Windows.Forms.SplitContainer(); - this.roomInfoView = new Meridian59.DebugUI.Viewers.RoomInfoView(); this.splitContainer11 = new System.Windows.Forms.SplitContainer(); this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.lightShadingView = new Meridian59.DebugUI.Viewers.LightShadingView(); this.splitContainer12 = new System.Windows.Forms.SplitContainer(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.backgroundMusicView = new Meridian59.DebugUI.Viewers.BackgroundMusicView(); - this.backgroundOverlayView = new Meridian59.DebugUI.Viewers.BackgroundOverlayView(); this.tabPage3 = new System.Windows.Forms.TabPage(); - this.roomObjectsView1 = new Meridian59.DebugUI.RoomObjectsView(); this.tabPage4 = new System.Windows.Forms.TabPage(); - this.stringListViewer = new Meridian59.DebugUI.ListViewers.StringListViewer(); this.tabPage5 = new System.Windows.Forms.TabPage(); this.splitContainer4 = new System.Windows.Forms.SplitContainer(); this.btnRequestInventory = new System.Windows.Forms.Button(); this.splitContainer5 = new System.Windows.Forms.SplitContainer(); - this.inventoryObjectView = new Meridian59.DebugUI.InventoryObjectView(); this.groupBox3 = new System.Windows.Forms.GroupBox(); this.tabPage6 = new System.Windows.Forms.TabPage(); this.splitAvatarInfo = new System.Windows.Forms.SplitContainer(); @@ -64,38 +55,50 @@ private void InitializeComponent() this.btnRequestSkills = new System.Windows.Forms.Button(); this.tblAvarInfo = new System.Windows.Forms.TableLayoutPanel(); this.groupBox4 = new System.Windows.Forms.GroupBox(); - this.statsConditionView = new Meridian59.DebugUI.Viewers.StatsNumericView(); this.groupBox5 = new System.Windows.Forms.GroupBox(); - this.statsAttributesView = new Meridian59.DebugUI.Viewers.StatsNumericView(); this.groupBox6 = new System.Windows.Forms.GroupBox(); - this.statsSpellsView = new Meridian59.DebugUI.Viewers.StatsListView(); this.groupBox7 = new System.Windows.Forms.GroupBox(); - this.statsSkillsView = new Meridian59.DebugUI.Viewers.StatsListView(); this.tabPage8 = new System.Windows.Forms.TabPage(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.btnRequestRoomBuffs = new System.Windows.Forms.Button(); this.btnRequestPlayerBuffs = new System.Windows.Forms.Button(); this.splitContainer2 = new System.Windows.Forms.SplitContainer(); - this.roomBuffsView = new Meridian59.DebugUI.ObjectBaseView(); - this.avatarBuffsView = new Meridian59.DebugUI.ObjectBaseView(); this.tabPage9 = new System.Windows.Forms.TabPage(); - this.chatMessageViewer = new Meridian59.DebugUI.ListViewers.ServerChatMessageViewer(); this.tabPage10 = new System.Windows.Forms.TabPage(); this.tabPage11 = new System.Windows.Forms.TabPage(); this.splitContainer3 = new System.Windows.Forms.SplitContainer(); this.btnRequestSpellObjects = new System.Windows.Forms.Button(); - this.spellsView = new Meridian59.DebugUI.Viewers.SpellsView(); this.tabPage12 = new System.Windows.Forms.TabPage(); this.splitContainer6 = new System.Windows.Forms.SplitContainer(); - this.guildMemberListViewer = new Meridian59.DebugUI.ListViewers.GuildMemberListViewer(); this.splitContainer7 = new System.Windows.Forms.SplitContainer(); this.guildShieldsViewer = new System.Windows.Forms.ListBox(); this.btnDisbandGuild = new System.Windows.Forms.Button(); this.btnRequestGuildShields = new System.Windows.Forms.Button(); this.btnLeaveGuild = new System.Windows.Forms.Button(); - this.guildListViewer = new Meridian59.DebugUI.ListViewers.GuildListViewer(); + this.tabPage7 = new System.Windows.Forms.TabPage(); + this.txtAdminOutput = new System.Windows.Forms.TextBox(); + this.txtAdminCommand = new System.Windows.Forms.TextBox(); this.btnRequestSpells2 = new System.Windows.Forms.Button(); this.btnRequestSpells3 = new System.Windows.Forms.Button(); + this.gamePacketViewer = new Meridian59.DebugUI.ListViewers.GamePacketViewer(); + this.onlinePlayersView = new Meridian59.DebugUI.OnlinePlayersView(); + this.roomInfoView = new Meridian59.DebugUI.Viewers.RoomInfoView(); + this.lightShadingView = new Meridian59.DebugUI.Viewers.LightShadingView(); + this.backgroundMusicView = new Meridian59.DebugUI.Viewers.BackgroundMusicView(); + this.backgroundOverlayView = new Meridian59.DebugUI.Viewers.BackgroundOverlayView(); + this.roomObjectsView1 = new Meridian59.DebugUI.RoomObjectsView(); + this.stringListViewer = new Meridian59.DebugUI.ListViewers.StringListViewer(); + this.inventoryObjectView = new Meridian59.DebugUI.InventoryObjectView(); + this.statsConditionView = new Meridian59.DebugUI.Viewers.StatsNumericView(); + this.statsAttributesView = new Meridian59.DebugUI.Viewers.StatsNumericView(); + this.statsSpellsView = new Meridian59.DebugUI.Viewers.StatsListView(); + this.statsSkillsView = new Meridian59.DebugUI.Viewers.StatsListView(); + this.roomBuffsView = new Meridian59.DebugUI.ObjectBaseView(); + this.avatarBuffsView = new Meridian59.DebugUI.ObjectBaseView(); + this.chatMessageViewer = new Meridian59.DebugUI.ListViewers.ServerChatMessageViewer(); + this.spellsView = new Meridian59.DebugUI.Viewers.SpellsView(); + this.guildMemberListViewer = new Meridian59.DebugUI.ListViewers.GuildMemberListViewer(); + this.guildListViewer = new Meridian59.DebugUI.ListViewers.GuildListViewer(); this.objectBaseView1 = new Meridian59.DebugUI.ObjectBaseView(); this.tabMain.SuspendLayout(); this.tabPage1.SuspendLayout(); @@ -153,7 +156,6 @@ private void InitializeComponent() this.splitContainer2.Panel2.SuspendLayout(); this.splitContainer2.SuspendLayout(); this.tabPage9.SuspendLayout(); - this.tabPage10.SuspendLayout(); this.tabPage11.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit(); this.splitContainer3.Panel1.SuspendLayout(); @@ -168,10 +170,12 @@ private void InitializeComponent() this.splitContainer7.Panel1.SuspendLayout(); this.splitContainer7.Panel2.SuspendLayout(); this.splitContainer7.SuspendLayout(); + this.tabPage7.SuspendLayout(); this.SuspendLayout(); // // tabMain // + this.tabMain.Controls.Add(this.tabPage7); this.tabMain.Controls.Add(this.tabPage1); this.tabMain.Controls.Add(this.tabPage2); this.tabMain.Controls.Add(this.tabPage3); @@ -201,23 +205,13 @@ private void InitializeComponent() this.tabPage1.Text = "GamePackets"; this.tabPage1.UseVisualStyleBackColor = true; // - // gamePacketViewer - // - this.gamePacketViewer.Dock = System.Windows.Forms.DockStyle.Fill; - this.gamePacketViewer.Location = new System.Drawing.Point(3, 3); - this.gamePacketViewer.Name = "gamePacketViewer"; - this.gamePacketViewer.Size = new System.Drawing.Size(1220, 552); - this.gamePacketViewer.TabIndex = 0; - this.gamePacketViewer.PacketSend += new Meridian59.Protocol.Events.GameMessageEventHandler(this.gamePacketViewer_PacketSend); - this.gamePacketViewer.PacketLogChanged += new Meridian59.DebugUI.Events.PacketLogChangeEventHandler(this.gamePacketViewer_PacketLogChanged); - // // tabPage2 // this.tabPage2.Controls.Add(this.splitContainer8); this.tabPage2.Location = new System.Drawing.Point(4, 22); this.tabPage2.Name = "tabPage2"; this.tabPage2.Padding = new System.Windows.Forms.Padding(3); - this.tabPage2.Size = new System.Drawing.Size(1126, 558); + this.tabPage2.Size = new System.Drawing.Size(1226, 558); this.tabPage2.TabIndex = 1; this.tabPage2.Text = "OnlinePlayers / RoomInfo"; this.tabPage2.UseVisualStyleBackColor = true; @@ -236,7 +230,7 @@ private void InitializeComponent() // splitContainer8.Panel2 // this.splitContainer8.Panel2.Controls.Add(this.backgroundOverlayView); - this.splitContainer8.Size = new System.Drawing.Size(1120, 552); + this.splitContainer8.Size = new System.Drawing.Size(1220, 552); this.splitContainer8.SplitterDistance = 432; this.splitContainer8.TabIndex = 1; // @@ -253,8 +247,8 @@ private void InitializeComponent() // splitContainer10.Panel2 // this.splitContainer10.Panel2.Controls.Add(this.splitContainer9); - this.splitContainer10.Size = new System.Drawing.Size(1120, 432); - this.splitContainer10.SplitterDistance = 515; + this.splitContainer10.Size = new System.Drawing.Size(1220, 432); + this.splitContainer10.SplitterDistance = 560; this.splitContainer10.TabIndex = 0; // // groupOnlinePlayers @@ -263,19 +257,11 @@ private void InitializeComponent() this.groupOnlinePlayers.Dock = System.Windows.Forms.DockStyle.Fill; this.groupOnlinePlayers.Location = new System.Drawing.Point(0, 0); this.groupOnlinePlayers.Name = "groupOnlinePlayers"; - this.groupOnlinePlayers.Size = new System.Drawing.Size(515, 432); + this.groupOnlinePlayers.Size = new System.Drawing.Size(560, 432); this.groupOnlinePlayers.TabIndex = 1; this.groupOnlinePlayers.TabStop = false; this.groupOnlinePlayers.Text = "Online Players"; // - // onlinePlayersView - // - this.onlinePlayersView.Dock = System.Windows.Forms.DockStyle.Fill; - this.onlinePlayersView.Location = new System.Drawing.Point(3, 16); - this.onlinePlayersView.Name = "onlinePlayersView"; - this.onlinePlayersView.Size = new System.Drawing.Size(509, 413); - this.onlinePlayersView.TabIndex = 0; - // // splitContainer9 // this.splitContainer9.Dock = System.Windows.Forms.DockStyle.Fill; @@ -289,18 +275,10 @@ private void InitializeComponent() // splitContainer9.Panel2 // this.splitContainer9.Panel2.Controls.Add(this.splitContainer11); - this.splitContainer9.Size = new System.Drawing.Size(601, 432); - this.splitContainer9.SplitterDistance = 368; + this.splitContainer9.Size = new System.Drawing.Size(656, 432); + this.splitContainer9.SplitterDistance = 401; this.splitContainer9.TabIndex = 1; // - // roomInfoView - // - this.roomInfoView.Dock = System.Windows.Forms.DockStyle.Fill; - this.roomInfoView.Location = new System.Drawing.Point(0, 0); - this.roomInfoView.Name = "roomInfoView"; - this.roomInfoView.Size = new System.Drawing.Size(368, 432); - this.roomInfoView.TabIndex = 0; - // // splitContainer11 // this.splitContainer11.Dock = System.Windows.Forms.DockStyle.Fill; @@ -315,7 +293,7 @@ private void InitializeComponent() // splitContainer11.Panel2 // this.splitContainer11.Panel2.Controls.Add(this.splitContainer12); - this.splitContainer11.Size = new System.Drawing.Size(229, 432); + this.splitContainer11.Size = new System.Drawing.Size(251, 432); this.splitContainer11.SplitterDistance = 90; this.splitContainer11.TabIndex = 0; // @@ -325,19 +303,11 @@ private void InitializeComponent() this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; this.groupBox1.Location = new System.Drawing.Point(0, 0); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(229, 90); + this.groupBox1.Size = new System.Drawing.Size(251, 90); this.groupBox1.TabIndex = 0; this.groupBox1.TabStop = false; this.groupBox1.Text = "LightShading"; // - // lightShadingView - // - this.lightShadingView.Dock = System.Windows.Forms.DockStyle.Fill; - this.lightShadingView.Location = new System.Drawing.Point(3, 16); - this.lightShadingView.Name = "lightShadingView"; - this.lightShadingView.Size = new System.Drawing.Size(223, 71); - this.lightShadingView.TabIndex = 0; - // // splitContainer12 // this.splitContainer12.Dock = System.Windows.Forms.DockStyle.Fill; @@ -348,7 +318,7 @@ private void InitializeComponent() // splitContainer12.Panel1 // this.splitContainer12.Panel1.Controls.Add(this.groupBox2); - this.splitContainer12.Size = new System.Drawing.Size(229, 338); + this.splitContainer12.Size = new System.Drawing.Size(251, 338); this.splitContainer12.SplitterDistance = 78; this.splitContainer12.TabIndex = 0; // @@ -358,73 +328,40 @@ private void InitializeComponent() this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill; this.groupBox2.Location = new System.Drawing.Point(0, 0); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(229, 78); + this.groupBox2.Size = new System.Drawing.Size(251, 78); this.groupBox2.TabIndex = 0; this.groupBox2.TabStop = false; this.groupBox2.Text = "BackgroundMusic"; // - // backgroundMusicView - // - this.backgroundMusicView.Location = new System.Drawing.Point(6, 19); - this.backgroundMusicView.Name = "backgroundMusicView"; - this.backgroundMusicView.Size = new System.Drawing.Size(176, 67); - this.backgroundMusicView.TabIndex = 0; - // - // backgroundOverlayView - // - this.backgroundOverlayView.Dock = System.Windows.Forms.DockStyle.Fill; - this.backgroundOverlayView.Location = new System.Drawing.Point(0, 0); - this.backgroundOverlayView.Name = "backgroundOverlayView"; - this.backgroundOverlayView.Size = new System.Drawing.Size(1120, 116); - this.backgroundOverlayView.TabIndex = 0; - // // tabPage3 // this.tabPage3.Controls.Add(this.roomObjectsView1); this.tabPage3.Location = new System.Drawing.Point(4, 22); this.tabPage3.Name = "tabPage3"; this.tabPage3.Padding = new System.Windows.Forms.Padding(3); - this.tabPage3.Size = new System.Drawing.Size(1126, 558); + this.tabPage3.Size = new System.Drawing.Size(1226, 558); this.tabPage3.TabIndex = 2; this.tabPage3.Text = "RoomObjects"; this.tabPage3.UseVisualStyleBackColor = true; // - // roomObjectsView1 - // - this.roomObjectsView1.Dock = System.Windows.Forms.DockStyle.Fill; - this.roomObjectsView1.Location = new System.Drawing.Point(3, 3); - this.roomObjectsView1.Name = "roomObjectsView1"; - this.roomObjectsView1.Size = new System.Drawing.Size(1120, 552); - this.roomObjectsView1.TabIndex = 1; - // // tabPage4 // this.tabPage4.Controls.Add(this.stringListViewer); this.tabPage4.Location = new System.Drawing.Point(4, 22); this.tabPage4.Name = "tabPage4"; this.tabPage4.Padding = new System.Windows.Forms.Padding(3); - this.tabPage4.Size = new System.Drawing.Size(1126, 558); + this.tabPage4.Size = new System.Drawing.Size(1226, 558); this.tabPage4.TabIndex = 3; this.tabPage4.Text = "StringList"; this.tabPage4.UseVisualStyleBackColor = true; // - // stringListViewer - // - this.stringListViewer.Dock = System.Windows.Forms.DockStyle.Fill; - this.stringListViewer.Location = new System.Drawing.Point(3, 3); - this.stringListViewer.Name = "stringListViewer"; - this.stringListViewer.Size = new System.Drawing.Size(1120, 552); - this.stringListViewer.TabIndex = 0; - this.stringListViewer.TabStop = false; - this.stringListViewer.Text = "stringListViewer"; - // // tabPage5 // this.tabPage5.Controls.Add(this.splitContainer4); this.tabPage5.Location = new System.Drawing.Point(4, 22); this.tabPage5.Name = "tabPage5"; this.tabPage5.Padding = new System.Windows.Forms.Padding(3); - this.tabPage5.Size = new System.Drawing.Size(1126, 558); + this.tabPage5.Size = new System.Drawing.Size(1226, 558); this.tabPage5.TabIndex = 4; this.tabPage5.Text = "Inventory"; this.tabPage5.UseVisualStyleBackColor = true; @@ -443,7 +380,7 @@ private void InitializeComponent() // splitContainer4.Panel2 // this.splitContainer4.Panel2.Controls.Add(this.splitContainer5); - this.splitContainer4.Size = new System.Drawing.Size(1120, 552); + this.splitContainer4.Size = new System.Drawing.Size(1220, 552); this.splitContainer4.SplitterDistance = 31; this.splitContainer4.TabIndex = 1; // @@ -470,25 +407,16 @@ private void InitializeComponent() // splitContainer5.Panel2 // this.splitContainer5.Panel2.Controls.Add(this.groupBox3); - this.splitContainer5.Size = new System.Drawing.Size(1120, 517); - this.splitContainer5.SplitterDistance = 939; + this.splitContainer5.Size = new System.Drawing.Size(1220, 517); + this.splitContainer5.SplitterDistance = 1022; this.splitContainer5.TabIndex = 1; // - // inventoryObjectView - // - this.inventoryObjectView.Dock = System.Windows.Forms.DockStyle.Fill; - this.inventoryObjectView.Location = new System.Drawing.Point(0, 0); - this.inventoryObjectView.Name = "inventoryObjectView"; - this.inventoryObjectView.Size = new System.Drawing.Size(939, 517); - this.inventoryObjectView.TabIndex = 0; - this.inventoryObjectView.Title = "Objects"; - // // groupBox3 // this.groupBox3.Dock = System.Windows.Forms.DockStyle.Fill; this.groupBox3.Location = new System.Drawing.Point(0, 0); this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(177, 517); + this.groupBox3.Size = new System.Drawing.Size(194, 517); this.groupBox3.TabIndex = 2; this.groupBox3.TabStop = false; this.groupBox3.Text = "Equipped Item IDs"; @@ -499,7 +427,7 @@ private void InitializeComponent() this.tabPage6.Location = new System.Drawing.Point(4, 22); this.tabPage6.Name = "tabPage6"; this.tabPage6.Padding = new System.Windows.Forms.Padding(3); - this.tabPage6.Size = new System.Drawing.Size(1126, 558); + this.tabPage6.Size = new System.Drawing.Size(1226, 558); this.tabPage6.TabIndex = 5; this.tabPage6.Text = "Stats"; this.tabPage6.UseVisualStyleBackColor = true; @@ -523,7 +451,7 @@ private void InitializeComponent() // splitAvatarInfo.Panel2 // this.splitAvatarInfo.Panel2.Controls.Add(this.tblAvarInfo); - this.splitAvatarInfo.Size = new System.Drawing.Size(1120, 552); + this.splitAvatarInfo.Size = new System.Drawing.Size(1220, 552); this.splitAvatarInfo.SplitterDistance = 30; this.splitAvatarInfo.TabIndex = 5; // @@ -582,92 +510,60 @@ private void InitializeComponent() this.tblAvarInfo.RowCount = 2; this.tblAvarInfo.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tblAvarInfo.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tblAvarInfo.Size = new System.Drawing.Size(1120, 518); + this.tblAvarInfo.Size = new System.Drawing.Size(1220, 518); this.tblAvarInfo.TabIndex = 4; // // groupBox4 // this.groupBox4.Controls.Add(this.statsConditionView); this.groupBox4.Dock = System.Windows.Forms.DockStyle.Fill; - this.groupBox4.Location = new System.Drawing.Point(563, 3); + this.groupBox4.Location = new System.Drawing.Point(613, 3); this.groupBox4.Name = "groupBox4"; - this.groupBox4.Size = new System.Drawing.Size(554, 253); + this.groupBox4.Size = new System.Drawing.Size(604, 253); this.groupBox4.TabIndex = 4; this.groupBox4.TabStop = false; this.groupBox4.Text = "Condition"; // - // statsConditionView - // - this.statsConditionView.Dock = System.Windows.Forms.DockStyle.Fill; - this.statsConditionView.Location = new System.Drawing.Point(3, 16); - this.statsConditionView.Name = "statsConditionView"; - this.statsConditionView.Size = new System.Drawing.Size(548, 234); - this.statsConditionView.TabIndex = 0; - // // groupBox5 // this.groupBox5.Controls.Add(this.statsAttributesView); this.groupBox5.Dock = System.Windows.Forms.DockStyle.Fill; - this.groupBox5.Location = new System.Drawing.Point(563, 262); + this.groupBox5.Location = new System.Drawing.Point(613, 262); this.groupBox5.Name = "groupBox5"; - this.groupBox5.Size = new System.Drawing.Size(554, 253); + this.groupBox5.Size = new System.Drawing.Size(604, 253); this.groupBox5.TabIndex = 5; this.groupBox5.TabStop = false; this.groupBox5.Text = "Attributes"; // - // statsAttributesView - // - this.statsAttributesView.Dock = System.Windows.Forms.DockStyle.Fill; - this.statsAttributesView.Location = new System.Drawing.Point(3, 16); - this.statsAttributesView.Name = "statsAttributesView"; - this.statsAttributesView.Size = new System.Drawing.Size(548, 234); - this.statsAttributesView.TabIndex = 0; - // // groupBox6 // this.groupBox6.Controls.Add(this.statsSpellsView); this.groupBox6.Dock = System.Windows.Forms.DockStyle.Fill; this.groupBox6.Location = new System.Drawing.Point(3, 262); this.groupBox6.Name = "groupBox6"; - this.groupBox6.Size = new System.Drawing.Size(554, 253); + this.groupBox6.Size = new System.Drawing.Size(604, 253); this.groupBox6.TabIndex = 6; this.groupBox6.TabStop = false; this.groupBox6.Text = "Spells"; // - // statsSpellsView - // - this.statsSpellsView.Dock = System.Windows.Forms.DockStyle.Fill; - this.statsSpellsView.Location = new System.Drawing.Point(3, 16); - this.statsSpellsView.Name = "statsSpellsView"; - this.statsSpellsView.Size = new System.Drawing.Size(548, 234); - this.statsSpellsView.TabIndex = 0; - // // groupBox7 // this.groupBox7.Controls.Add(this.statsSkillsView); this.groupBox7.Dock = System.Windows.Forms.DockStyle.Fill; this.groupBox7.Location = new System.Drawing.Point(3, 3); this.groupBox7.Name = "groupBox7"; - this.groupBox7.Size = new System.Drawing.Size(554, 253); + this.groupBox7.Size = new System.Drawing.Size(604, 253); this.groupBox7.TabIndex = 7; this.groupBox7.TabStop = false; this.groupBox7.Text = "Skills"; // - // statsSkillsView - // - this.statsSkillsView.Dock = System.Windows.Forms.DockStyle.Fill; - this.statsSkillsView.Location = new System.Drawing.Point(3, 16); - this.statsSkillsView.Name = "statsSkillsView"; - this.statsSkillsView.Size = new System.Drawing.Size(548, 234); - this.statsSkillsView.TabIndex = 0; - // // tabPage8 // this.tabPage8.Controls.Add(this.splitContainer1); this.tabPage8.Location = new System.Drawing.Point(4, 22); this.tabPage8.Name = "tabPage8"; this.tabPage8.Padding = new System.Windows.Forms.Padding(3); - this.tabPage8.Size = new System.Drawing.Size(1126, 558); + this.tabPage8.Size = new System.Drawing.Size(1226, 558); this.tabPage8.TabIndex = 7; this.tabPage8.Text = "Buffs"; this.tabPage8.UseVisualStyleBackColor = true; @@ -689,7 +585,7 @@ private void InitializeComponent() // splitContainer1.Panel2 // this.splitContainer1.Panel2.Controls.Add(this.splitContainer2); - this.splitContainer1.Size = new System.Drawing.Size(1120, 552); + this.splitContainer1.Size = new System.Drawing.Size(1220, 552); this.splitContainer1.SplitterDistance = 31; this.splitContainer1.TabIndex = 0; // @@ -727,56 +623,30 @@ private void InitializeComponent() // splitContainer2.Panel2 // this.splitContainer2.Panel2.Controls.Add(this.avatarBuffsView); - this.splitContainer2.Size = new System.Drawing.Size(1120, 517); + this.splitContainer2.Size = new System.Drawing.Size(1220, 517); this.splitContainer2.SplitterDistance = 257; this.splitContainer2.TabIndex = 3; // - // roomBuffsView - // - this.roomBuffsView.Dock = System.Windows.Forms.DockStyle.Fill; - this.roomBuffsView.Location = new System.Drawing.Point(0, 0); - this.roomBuffsView.Name = "roomBuffsView"; - this.roomBuffsView.Size = new System.Drawing.Size(1120, 257); - this.roomBuffsView.TabIndex = 0; - this.roomBuffsView.Title = "RoomBuffs"; - // - // avatarBuffsView - // - this.avatarBuffsView.Dock = System.Windows.Forms.DockStyle.Fill; - this.avatarBuffsView.Location = new System.Drawing.Point(0, 0); - this.avatarBuffsView.Name = "avatarBuffsView"; - this.avatarBuffsView.Size = new System.Drawing.Size(1120, 256); - this.avatarBuffsView.TabIndex = 0; - this.avatarBuffsView.Title = "AvatarBuffs"; - // // tabPage9 // this.tabPage9.Controls.Add(this.chatMessageViewer); this.tabPage9.Location = new System.Drawing.Point(4, 22); this.tabPage9.Name = "tabPage9"; this.tabPage9.Padding = new System.Windows.Forms.Padding(3); - this.tabPage9.Size = new System.Drawing.Size(1126, 558); + this.tabPage9.Size = new System.Drawing.Size(1226, 558); this.tabPage9.TabIndex = 8; this.tabPage9.Text = "Chat"; this.tabPage9.UseVisualStyleBackColor = true; // - // chatMessageViewer - // - this.chatMessageViewer.Dock = System.Windows.Forms.DockStyle.Fill; - this.chatMessageViewer.Location = new System.Drawing.Point(3, 3); - this.chatMessageViewer.Name = "chatMessageViewer"; - this.chatMessageViewer.Size = new System.Drawing.Size(1120, 552); - this.chatMessageViewer.TabIndex = 0; - // // tabPage10 // this.tabPage10.Location = new System.Drawing.Point(4, 22); this.tabPage10.Name = "tabPage10"; this.tabPage10.Padding = new System.Windows.Forms.Padding(3); - this.tabPage10.Size = new System.Drawing.Size(1126, 558); + this.tabPage10.Size = new System.Drawing.Size(1226, 558); this.tabPage10.TabIndex = 9; this.tabPage10.Text = "Log"; - this.tabPage10.UseVisualStyleBackColor = true; + this.tabPage10.UseVisualStyleBackColor = true; // // tabPage11 // @@ -784,7 +654,7 @@ private void InitializeComponent() this.tabPage11.Location = new System.Drawing.Point(4, 22); this.tabPage11.Name = "tabPage11"; this.tabPage11.Padding = new System.Windows.Forms.Padding(3); - this.tabPage11.Size = new System.Drawing.Size(1126, 558); + this.tabPage11.Size = new System.Drawing.Size(1226, 558); this.tabPage11.TabIndex = 10; this.tabPage11.Text = "Spells"; this.tabPage11.UseVisualStyleBackColor = true; @@ -803,7 +673,7 @@ private void InitializeComponent() // splitContainer3.Panel2 // this.splitContainer3.Panel2.Controls.Add(this.spellsView); - this.splitContainer3.Size = new System.Drawing.Size(1120, 552); + this.splitContainer3.Size = new System.Drawing.Size(1220, 552); this.splitContainer3.SplitterDistance = 37; this.splitContainer3.TabIndex = 1; // @@ -817,21 +687,13 @@ private void InitializeComponent() this.btnRequestSpellObjects.UseVisualStyleBackColor = true; this.btnRequestSpellObjects.Click += new System.EventHandler(this.btnRequestSpellObjects_Click); // - // spellsView - // - this.spellsView.Dock = System.Windows.Forms.DockStyle.Fill; - this.spellsView.Location = new System.Drawing.Point(0, 0); - this.spellsView.Name = "spellsView"; - this.spellsView.Size = new System.Drawing.Size(1120, 511); - this.spellsView.TabIndex = 0; - // // tabPage12 // this.tabPage12.Controls.Add(this.splitContainer6); this.tabPage12.Location = new System.Drawing.Point(4, 22); this.tabPage12.Name = "tabPage12"; this.tabPage12.Padding = new System.Windows.Forms.Padding(3); - this.tabPage12.Size = new System.Drawing.Size(1126, 558); + this.tabPage12.Size = new System.Drawing.Size(1226, 558); this.tabPage12.TabIndex = 11; this.tabPage12.Text = "Guild"; this.tabPage12.UseVisualStyleBackColor = true; @@ -849,18 +711,10 @@ private void InitializeComponent() // splitContainer6.Panel2 // this.splitContainer6.Panel2.Controls.Add(this.splitContainer7); - this.splitContainer6.Size = new System.Drawing.Size(1120, 552); - this.splitContainer6.SplitterDistance = 459; + this.splitContainer6.Size = new System.Drawing.Size(1220, 552); + this.splitContainer6.SplitterDistance = 499; this.splitContainer6.TabIndex = 0; // - // guildMemberListViewer - // - this.guildMemberListViewer.Dock = System.Windows.Forms.DockStyle.Fill; - this.guildMemberListViewer.Location = new System.Drawing.Point(0, 0); - this.guildMemberListViewer.Name = "guildMemberListViewer"; - this.guildMemberListViewer.Size = new System.Drawing.Size(459, 552); - this.guildMemberListViewer.TabIndex = 0; - // // splitContainer7 // this.splitContainer7.Dock = System.Windows.Forms.DockStyle.Fill; @@ -878,7 +732,7 @@ private void InitializeComponent() // splitContainer7.Panel2 // this.splitContainer7.Panel2.Controls.Add(this.guildListViewer); - this.splitContainer7.Size = new System.Drawing.Size(657, 552); + this.splitContainer7.Size = new System.Drawing.Size(717, 552); this.splitContainer7.SplitterDistance = 153; this.splitContainer7.TabIndex = 4; // @@ -921,13 +775,34 @@ private void InitializeComponent() this.btnLeaveGuild.UseVisualStyleBackColor = true; this.btnLeaveGuild.Click += new System.EventHandler(this.btnLeaveGuild_Click); // - // guildListViewer + // tabPage7 // - this.guildListViewer.Dock = System.Windows.Forms.DockStyle.Fill; - this.guildListViewer.Location = new System.Drawing.Point(0, 0); - this.guildListViewer.Name = "guildListViewer"; - this.guildListViewer.Size = new System.Drawing.Size(657, 395); - this.guildListViewer.TabIndex = 0; + this.tabPage7.Controls.Add(this.txtAdminOutput); + this.tabPage7.Controls.Add(this.txtAdminCommand); + this.tabPage7.Location = new System.Drawing.Point(4, 22); + this.tabPage7.Name = "tabPage7"; + this.tabPage7.Size = new System.Drawing.Size(1226, 558); + this.tabPage7.TabIndex = 12; + this.tabPage7.Text = "AdminUI"; + this.tabPage7.UseVisualStyleBackColor = true; + // + // txtAdminOutput + // + this.txtAdminOutput.Location = new System.Drawing.Point(9, 42); + this.txtAdminOutput.Multiline = true; + this.txtAdminOutput.Name = "txtAdminOutput"; + this.txtAdminOutput.ReadOnly = true; + this.txtAdminOutput.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.txtAdminOutput.Size = new System.Drawing.Size(796, 380); + this.txtAdminOutput.TabIndex = 1; + // + // txtAdminCommand + // + this.txtAdminCommand.Location = new System.Drawing.Point(9, 16); + this.txtAdminCommand.Name = "txtAdminCommand"; + this.txtAdminCommand.Size = new System.Drawing.Size(796, 20); + this.txtAdminCommand.TabIndex = 0; + this.txtAdminCommand.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtAdminCommand_KeyDown); // // btnRequestSpells2 // @@ -947,6 +822,164 @@ private void InitializeComponent() this.btnRequestSpells3.Text = "Request SpellObjects"; this.btnRequestSpells3.UseVisualStyleBackColor = true; // + // gamePacketViewer + // + this.gamePacketViewer.Dock = System.Windows.Forms.DockStyle.Fill; + this.gamePacketViewer.Location = new System.Drawing.Point(3, 3); + this.gamePacketViewer.Name = "gamePacketViewer"; + this.gamePacketViewer.Size = new System.Drawing.Size(1220, 552); + this.gamePacketViewer.TabIndex = 0; + this.gamePacketViewer.PacketSend += new Meridian59.Protocol.Events.GameMessageEventHandler(this.gamePacketViewer_PacketSend); + this.gamePacketViewer.PacketLogChanged += new Meridian59.DebugUI.Events.PacketLogChangeEventHandler(this.gamePacketViewer_PacketLogChanged); + // + // onlinePlayersView + // + this.onlinePlayersView.Dock = System.Windows.Forms.DockStyle.Fill; + this.onlinePlayersView.Location = new System.Drawing.Point(3, 16); + this.onlinePlayersView.Name = "onlinePlayersView"; + this.onlinePlayersView.Size = new System.Drawing.Size(554, 413); + this.onlinePlayersView.TabIndex = 0; + // + // roomInfoView + // + this.roomInfoView.Dock = System.Windows.Forms.DockStyle.Fill; + this.roomInfoView.Location = new System.Drawing.Point(0, 0); + this.roomInfoView.Name = "roomInfoView"; + this.roomInfoView.Size = new System.Drawing.Size(401, 432); + this.roomInfoView.TabIndex = 0; + // + // lightShadingView + // + this.lightShadingView.Dock = System.Windows.Forms.DockStyle.Fill; + this.lightShadingView.Location = new System.Drawing.Point(3, 16); + this.lightShadingView.Name = "lightShadingView"; + this.lightShadingView.Size = new System.Drawing.Size(245, 71); + this.lightShadingView.TabIndex = 0; + // + // backgroundMusicView + // + this.backgroundMusicView.Location = new System.Drawing.Point(6, 19); + this.backgroundMusicView.Name = "backgroundMusicView"; + this.backgroundMusicView.Size = new System.Drawing.Size(176, 67); + this.backgroundMusicView.TabIndex = 0; + // + // backgroundOverlayView + // + this.backgroundOverlayView.Dock = System.Windows.Forms.DockStyle.Fill; + this.backgroundOverlayView.Location = new System.Drawing.Point(0, 0); + this.backgroundOverlayView.Name = "backgroundOverlayView"; + this.backgroundOverlayView.Size = new System.Drawing.Size(1220, 116); + this.backgroundOverlayView.TabIndex = 0; + // + // roomObjectsView1 + // + this.roomObjectsView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.roomObjectsView1.Location = new System.Drawing.Point(3, 3); + this.roomObjectsView1.Name = "roomObjectsView1"; + this.roomObjectsView1.Size = new System.Drawing.Size(1220, 552); + this.roomObjectsView1.TabIndex = 1; + // + // stringListViewer + // + this.stringListViewer.Dock = System.Windows.Forms.DockStyle.Fill; + this.stringListViewer.Location = new System.Drawing.Point(3, 3); + this.stringListViewer.Name = "stringListViewer"; + this.stringListViewer.Size = new System.Drawing.Size(1220, 552); + this.stringListViewer.TabIndex = 0; + this.stringListViewer.TabStop = false; + this.stringListViewer.Text = "stringListViewer"; + // + // inventoryObjectView + // + this.inventoryObjectView.Dock = System.Windows.Forms.DockStyle.Fill; + this.inventoryObjectView.Location = new System.Drawing.Point(0, 0); + this.inventoryObjectView.Name = "inventoryObjectView"; + this.inventoryObjectView.Size = new System.Drawing.Size(1022, 517); + this.inventoryObjectView.TabIndex = 0; + this.inventoryObjectView.Title = "Objects"; + // + // statsConditionView + // + this.statsConditionView.Dock = System.Windows.Forms.DockStyle.Fill; + this.statsConditionView.Location = new System.Drawing.Point(3, 16); + this.statsConditionView.Name = "statsConditionView"; + this.statsConditionView.Size = new System.Drawing.Size(598, 234); + this.statsConditionView.TabIndex = 0; + // + // statsAttributesView + // + this.statsAttributesView.Dock = System.Windows.Forms.DockStyle.Fill; + this.statsAttributesView.Location = new System.Drawing.Point(3, 16); + this.statsAttributesView.Name = "statsAttributesView"; + this.statsAttributesView.Size = new System.Drawing.Size(598, 234); + this.statsAttributesView.TabIndex = 0; + // + // statsSpellsView + // + this.statsSpellsView.Dock = System.Windows.Forms.DockStyle.Fill; + this.statsSpellsView.Location = new System.Drawing.Point(3, 16); + this.statsSpellsView.Name = "statsSpellsView"; + this.statsSpellsView.Size = new System.Drawing.Size(598, 234); + this.statsSpellsView.TabIndex = 0; + // + // statsSkillsView + // + this.statsSkillsView.Dock = System.Windows.Forms.DockStyle.Fill; + this.statsSkillsView.Location = new System.Drawing.Point(3, 16); + this.statsSkillsView.Name = "statsSkillsView"; + this.statsSkillsView.Size = new System.Drawing.Size(598, 234); + this.statsSkillsView.TabIndex = 0; + // + // roomBuffsView + // + this.roomBuffsView.Dock = System.Windows.Forms.DockStyle.Fill; + this.roomBuffsView.Location = new System.Drawing.Point(0, 0); + this.roomBuffsView.Name = "roomBuffsView"; + this.roomBuffsView.Size = new System.Drawing.Size(1220, 257); + this.roomBuffsView.TabIndex = 0; + this.roomBuffsView.Title = "RoomBuffs"; + // + // avatarBuffsView + // + this.avatarBuffsView.Dock = System.Windows.Forms.DockStyle.Fill; + this.avatarBuffsView.Location = new System.Drawing.Point(0, 0); + this.avatarBuffsView.Name = "avatarBuffsView"; + this.avatarBuffsView.Size = new System.Drawing.Size(1220, 256); + this.avatarBuffsView.TabIndex = 0; + this.avatarBuffsView.Title = "AvatarBuffs"; + // + // chatMessageViewer + // + this.chatMessageViewer.Dock = System.Windows.Forms.DockStyle.Fill; + this.chatMessageViewer.Location = new System.Drawing.Point(3, 3); + this.chatMessageViewer.Name = "chatMessageViewer"; + this.chatMessageViewer.Size = new System.Drawing.Size(1220, 552); + this.chatMessageViewer.TabIndex = 0; + // + // spellsView + // + this.spellsView.Dock = System.Windows.Forms.DockStyle.Fill; + this.spellsView.Location = new System.Drawing.Point(0, 0); + this.spellsView.Name = "spellsView"; + this.spellsView.Size = new System.Drawing.Size(1220, 511); + this.spellsView.TabIndex = 0; + // + // guildMemberListViewer + // + this.guildMemberListViewer.Dock = System.Windows.Forms.DockStyle.Fill; + this.guildMemberListViewer.Location = new System.Drawing.Point(0, 0); + this.guildMemberListViewer.Name = "guildMemberListViewer"; + this.guildMemberListViewer.Size = new System.Drawing.Size(499, 552); + this.guildMemberListViewer.TabIndex = 0; + // + // guildListViewer + // + this.guildListViewer.Dock = System.Windows.Forms.DockStyle.Fill; + this.guildListViewer.Location = new System.Drawing.Point(0, 0); + this.guildListViewer.Name = "guildListViewer"; + this.guildListViewer.Size = new System.Drawing.Size(717, 395); + this.guildListViewer.TabIndex = 0; + // // objectBaseView1 // this.objectBaseView1.Dock = System.Windows.Forms.DockStyle.Fill; @@ -1020,7 +1053,6 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); this.splitContainer2.ResumeLayout(false); this.tabPage9.ResumeLayout(false); - this.tabPage10.ResumeLayout(false); this.tabPage11.ResumeLayout(false); this.splitContainer3.Panel1.ResumeLayout(false); this.splitContainer3.Panel2.ResumeLayout(false); @@ -1035,6 +1067,8 @@ private void InitializeComponent() this.splitContainer7.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer7)).EndInit(); this.splitContainer7.ResumeLayout(false); + this.tabPage7.ResumeLayout(false); + this.tabPage7.PerformLayout(); this.ResumeLayout(false); } @@ -1109,5 +1143,8 @@ private void InitializeComponent() private System.Windows.Forms.GroupBox groupBox7; private Viewers.StatsListView statsSkillsView; private InventoryObjectView inventoryObjectView; + private System.Windows.Forms.TabPage tabPage7; + private System.Windows.Forms.TextBox txtAdminOutput; + private System.Windows.Forms.TextBox txtAdminCommand; } } \ No newline at end of file diff --git a/Meridian59.DebugUI/DebugForm.cs b/Meridian59.DebugUI/DebugForm.cs index 94a53a9e..631c20cc 100644 --- a/Meridian59.DebugUI/DebugForm.cs +++ b/Meridian59.DebugUI/DebugForm.cs @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License along with "Me */ using System; +using System.Collections.Generic; +using System.Text.RegularExpressions; using System.Windows.Forms; using Meridian59.Data; using Meridian59.DebugUI.Events; @@ -26,6 +28,8 @@ You should have received a copy of the GNU General Public License along with "Me namespace Meridian59.DebugUI { + + public partial class DebugForm : Form { public event GameMessageEventHandler PacketSend; @@ -77,12 +81,20 @@ public ResourceManager ResourceManager } } + public AdminController AdminController { get; set; } + public DebugForm() { InitializeComponent(); guildMemberListViewer.PacketSend += new GameMessageEventHandler(gamePacketViewer_PacketSend); guildListViewer.PacketSend += new GameMessageEventHandler(gamePacketViewer_PacketSend); + AdminController = new AdminController(); + } + + public void HandleAdminMessage(AdminMessage Message) + { + AdminController.HandleAdminMessage(Message); } private void gamePacketViewer_PacketSend(object sender, GameMessageEventArgs e) @@ -160,5 +172,63 @@ private void btnDisbandGuild_Click(object sender, EventArgs e) if (PacketSend != null) PacketSend(this, new GameMessageEventArgs(new UserCommandMessage(new UserCommandGuildDisband(), null))); } + + private void txtAdminCommand_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) + { + if (PacketSend != null) + PacketSend(this, new GameMessageEventArgs(new ReqAdminMessage(txtAdminCommand.Text))); + txtAdminCommand.Text = ""; + } + } + } + + /// + /// These things need to be moved + /// + + public class AdminObjectProperty + { + public string PropertyName { get; set; } + public string PropertyType { get; set; } + public string PropertyValue { get; set; } + + public AdminObjectProperty(string name, string type, string value) + { + PropertyName = name; + PropertyType = type; + PropertyValue = value; + } + } + + public class AdminObject + { + public List Properties { get; private set; } + public string ClassName { get; set; } + public int ObjectNumber { get; set; } + + public AdminObject(string classname, int objectnumber, List props = null) + { + ClassName = classname; + ObjectNumber = objectnumber; + if (props != null) + { + Properties = props; + } + else + { + Properties = new List(); + } + } + + //so later we can do thing upon property update + public void SetProperties(List properties) + { + Properties = properties; + } + } + + } diff --git a/Meridian59.DebugUI/Events/EventArgs.cs b/Meridian59.DebugUI/Events/EventArgs.cs index 041c7afd..59ecdaf7 100644 --- a/Meridian59.DebugUI/Events/EventArgs.cs +++ b/Meridian59.DebugUI/Events/EventArgs.cs @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License along with "Me */ using System; +using System.Windows.Forms; +using Meridian59.Protocol.GameMessages; namespace Meridian59.DebugUI.Events { @@ -53,4 +55,5 @@ public PacketLogChangeEventArgs(bool LogOutgoing, bool LogIncoming, bool LogPing this.LogPings = LogPings; } } + } diff --git a/Meridian59.DebugUI/Meridian59.DebugUI.csproj b/Meridian59.DebugUI/Meridian59.DebugUI.csproj index cf22ccf6..8e1a09c1 100644 --- a/Meridian59.DebugUI/Meridian59.DebugUI.csproj +++ b/Meridian59.DebugUI/Meridian59.DebugUI.csproj @@ -12,7 +12,8 @@ Meridian59.DebugUI v4.0 512 - Client + + true @@ -48,19 +49,22 @@ + + Component - + + Form - - MiniMapForm.cs + + ObjectEditor.cs UserControl @@ -191,8 +195,8 @@ DebugForm.cs - - MiniMapForm.cs + + ObjectEditor.cs BackgroundMusicView.cs diff --git a/Meridian59.DebugUI/ObjectEditor.Designer.cs b/Meridian59.DebugUI/ObjectEditor.Designer.cs new file mode 100644 index 00000000..3e400146 --- /dev/null +++ b/Meridian59.DebugUI/ObjectEditor.Designer.cs @@ -0,0 +1,85 @@ +namespace Meridian59.DebugUI +{ + partial class ObjectEditor + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.dataGridView1 = new System.Windows.Forms.DataGridView(); + this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); + this.SuspendLayout(); + // + // dataGridView1 + // + this.dataGridView1.AllowUserToAddRows = false; + this.dataGridView1.AllowUserToDeleteRows = false; + this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView1.Location = new System.Drawing.Point(0, 0); + this.dataGridView1.Name = "dataGridView1"; + this.dataGridView1.Size = new System.Drawing.Size(480, 400); + this.dataGridView1.TabIndex = 0; + // + // dataGridViewTextBoxColumn1 + // + this.dataGridViewTextBoxColumn1.HeaderText = "Property"; + this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1"; + this.dataGridViewTextBoxColumn1.ReadOnly = true; + // + // dataGridViewTextBoxColumn2 + // + this.dataGridViewTextBoxColumn2.HeaderText = "Type/Tag"; + this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; + // + // dataGridViewTextBoxColumn3 + // + this.dataGridViewTextBoxColumn3.HeaderText = "Value"; + this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3"; + // + // ObjectEditor + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(480, 400); + this.Controls.Add(this.dataGridView1); + this.Name = "ObjectEditor"; + this.Text = "ObjectEditor"; + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.DataGridView dataGridView1; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3; + } +} \ No newline at end of file diff --git a/Meridian59.DebugUI/ObjectEditor.cs b/Meridian59.DebugUI/ObjectEditor.cs new file mode 100644 index 00000000..6f1270b8 --- /dev/null +++ b/Meridian59.DebugUI/ObjectEditor.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace Meridian59.DebugUI +{ + public partial class ObjectEditor : Form + { + public ObjectEditor(AdminObject obj) + { + InitializeComponent(); + Text = String.Format("{0} {1}", obj.ObjectNumber, obj.ClassName); + dataGridView1.DataSource = obj.Properties; + } + } +} diff --git a/Meridian59.DebugUI/ObjectEditor.resx b/Meridian59.DebugUI/ObjectEditor.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/Meridian59.DebugUI/ObjectEditor.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Meridian59.DebugUI/Properties/AssemblyInfo.cs b/Meridian59.DebugUI/Properties/AssemblyInfo.cs index 558e1e66..a2050c85 100644 --- a/Meridian59.DebugUI/Properties/AssemblyInfo.cs +++ b/Meridian59.DebugUI/Properties/AssemblyInfo.cs @@ -15,5 +15,5 @@ [assembly: Guid("175ff980-037a-49ab-b948-ad58abd74716")] -[assembly: AssemblyVersion("1.2.2.1")] -[assembly: AssemblyFileVersion("1.2.2.1")] +[assembly: AssemblyVersion("1.2.2.3")] +[assembly: AssemblyFileVersion("1.2.2.3")] diff --git a/Meridian59.DebugUI/Properties/Resources.Designer.cs b/Meridian59.DebugUI/Properties/Resources.Designer.cs index 52961a12..eb64627b 100644 --- a/Meridian59.DebugUI/Properties/Resources.Designer.cs +++ b/Meridian59.DebugUI/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.18033 +// Laufzeitversion:4.0.30319.34014 // // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn // der Code erneut generiert wird. diff --git a/Meridian59.DebugUI/Viewers/InventoryObjectView.Designer.cs b/Meridian59.DebugUI/Viewers/InventoryObjectView.Designer.cs index 3d7f2075..78d38d18 100644 --- a/Meridian59.DebugUI/Viewers/InventoryObjectView.Designer.cs +++ b/Meridian59.DebugUI/Viewers/InventoryObjectView.Designer.cs @@ -62,6 +62,7 @@ private void InitializeComponent() this.colEffect = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colAnimation = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colIsInUse = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colNumOfSameName = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colAppearanceHash = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colName = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colOverlayFile = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -117,6 +118,7 @@ private void InitializeComponent() this.colEffect, this.colAnimation, this.colIsInUse, + this.colNumOfSameName, this.colAppearanceHash, this.colName, this.colOverlayFile}); @@ -394,6 +396,15 @@ private void InitializeComponent() this.colIsInUse.ReadOnly = true; this.colIsInUse.Width = 50; // + // colNumOfSameName + // + this.colNumOfSameName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; + this.colNumOfSameName.DataPropertyName = "NumOfSameName"; + this.colNumOfSameName.HeaderText = "NOSN"; + this.colNumOfSameName.Name = "colNumOfSameName"; + this.colNumOfSameName.ReadOnly = true; + this.colNumOfSameName.Width = 35; + // // colAppearanceHash // this.colAppearanceHash.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; @@ -485,6 +496,7 @@ private void InitializeComponent() private System.Windows.Forms.DataGridViewTextBoxColumn colEffect; private System.Windows.Forms.DataGridViewTextBoxColumn colAnimation; private System.Windows.Forms.DataGridViewTextBoxColumn colIsInUse; + private System.Windows.Forms.DataGridViewTextBoxColumn colNumOfSameName; private System.Windows.Forms.DataGridViewTextBoxColumn colAppearanceHash; private System.Windows.Forms.DataGridViewTextBoxColumn colName; private System.Windows.Forms.DataGridViewTextBoxColumn colOverlayFile; diff --git a/Meridian59.DebugUI/Viewers/InventoryObjectView.resx b/Meridian59.DebugUI/Viewers/InventoryObjectView.resx index d39cd354..9aa6c3e6 100644 --- a/Meridian59.DebugUI/Viewers/InventoryObjectView.resx +++ b/Meridian59.DebugUI/Viewers/InventoryObjectView.resx @@ -153,6 +153,9 @@ True + + True + True From 3912fd418222bda00c44e65183cafd9910549b84 Mon Sep 17 00:00:00 2001 From: Daenks Date: Sat, 8 Aug 2015 21:47:49 -0500 Subject: [PATCH 02/10] Applied ShaKrune's recommendations for appropriately using his data model. Working code state, can send admin commands via text console. "Show Object" command results sucessfully parsed and displayed. --- Meridian59.DebugUI/AdminController.cs | 78 +-------------------------- Meridian59.DebugUI/DebugForm.cs | 59 ++++---------------- Meridian59.DebugUI/ObjectEditor.cs | 1 + Meridian59/Data/DataController.cs | 57 ++++++++++++++++++++ Meridian59/Meridian59.csproj | 8 ++- 5 files changed, 77 insertions(+), 126 deletions(-) diff --git a/Meridian59.DebugUI/AdminController.cs b/Meridian59.DebugUI/AdminController.cs index 341c3985..5f282702 100644 --- a/Meridian59.DebugUI/AdminController.cs +++ b/Meridian59.DebugUI/AdminController.cs @@ -1,77 +1 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using Meridian59.Protocol.GameMessages; - -namespace Meridian59.DebugUI -{ - public class AdminController - { - - public AdminController() - { - - } - - public void HandleAdminMessage(AdminMessage Message) - { - //Look for object info - var regex = new Regex(@":< OBJECT (?\d*) is CLASS (?.*)"); - if (regex.IsMatch(Message.Message)) - { - var matches = regex.Matches(Message.Message); - if (matches.Count < 1) //We should only get one of these at a time - { - //txtAdminCommand.Text += "Error parsing object header\r\n"; - return; - } - AdminObject obj = null; - foreach (Match match in matches) //but i dont know how to just do if -match will research - { - //txtAdminOutput.Text += String.Format("Found Object {0} of class {1}\r\n", match.Groups["objectnumber"], - // match.Groups["classname"]); - obj = new AdminObject(match.Groups["classname"].ToString(), Convert.ToInt32(match.Groups["objectnumber"].ToString())); - } - - regex = new Regex(@": (?\w*)\s*=\s(?[\w$]*)\s(?\d*)"); - if (regex.IsMatch((Message.Message))) - { - List props = new List(); - matches = regex.Matches(Message.Message); - foreach (Match match in matches) - { - //txtAdminOutput.Text += String.Format("Property {0} with datatype {1} and value {2}\r\n",match.Groups["property"],match.Groups["datatype"],match.Groups["value"]); - props.Add(new AdminObjectProperty(match.Groups["property"].ToString(), match.Groups["datatype"].ToString(), match.Groups["value"].ToString())); - } - if (obj != null) - { - obj.SetProperties(props); - ObjectEditor oe = new ObjectEditor(obj); - oe.Show(); - } - - } - - } - else - { - //txtAdminOutput.Text += Message.Message; - } - /* -:< OBJECT 0 is CLASS System -: self = OBJECT 0 -: plTemp = $ 0 -: plRooms = LIST 49994 -: plUsers = LIST 65530 -: plUsers_logged_on = $ 0 -: plTreasure_types = LIST 58647 -: plSpells = LIST 56333 -: plSkills = LIST 56352 -: plItem_Attributes = LIST 57342 -: plItemAttTreasure = LIST 56382 -*/ - } - } -} + \ No newline at end of file diff --git a/Meridian59.DebugUI/DebugForm.cs b/Meridian59.DebugUI/DebugForm.cs index 631c20cc..5ab652f6 100644 --- a/Meridian59.DebugUI/DebugForm.cs +++ b/Meridian59.DebugUI/DebugForm.cs @@ -24,6 +24,7 @@ You should have received a copy of the GNU General Public License along with "Me using Meridian59.Protocol.GameMessages; using Meridian59.Common.Enums; using Meridian59.Data.Models; +using Meridian59.Data.Models.AdminData; using Meridian59.Files; namespace Meridian59.DebugUI @@ -67,6 +68,7 @@ public DataController DataController roomInfoView.DataSource = dataController.RoomInformation; lightShadingView.DataSource = dataController.LightShading; backgroundMusicView.DataSource = dataController.BackgroundMusic; + DataController.AdminData.WatchObjectAdded += AdminInfoOnWatchObjectAdded; } } @@ -81,20 +83,23 @@ public ResourceManager ResourceManager } } - public AdminController AdminController { get; set; } - public DebugForm() { InitializeComponent(); guildMemberListViewer.PacketSend += new GameMessageEventHandler(gamePacketViewer_PacketSend); guildListViewer.PacketSend += new GameMessageEventHandler(gamePacketViewer_PacketSend); - AdminController = new AdminController(); + } + + private void AdminInfoOnWatchObjectAdded(AdminWatchObjectEventHandlerArgs args) + { + ObjectEditor oe = new ObjectEditor(args.AdminObject); + oe.Show(); } public void HandleAdminMessage(AdminMessage Message) { - AdminController.HandleAdminMessage(Message); + } private void gamePacketViewer_PacketSend(object sender, GameMessageEventArgs e) @@ -184,51 +189,9 @@ private void txtAdminCommand_KeyDown(object sender, KeyEventArgs e) } } + - /// - /// These things need to be moved - /// - - public class AdminObjectProperty - { - public string PropertyName { get; set; } - public string PropertyType { get; set; } - public string PropertyValue { get; set; } - - public AdminObjectProperty(string name, string type, string value) - { - PropertyName = name; - PropertyType = type; - PropertyValue = value; - } - } - - public class AdminObject - { - public List Properties { get; private set; } - public string ClassName { get; set; } - public int ObjectNumber { get; set; } - - public AdminObject(string classname, int objectnumber, List props = null) - { - ClassName = classname; - ObjectNumber = objectnumber; - if (props != null) - { - Properties = props; - } - else - { - Properties = new List(); - } - } - - //so later we can do thing upon property update - public void SetProperties(List properties) - { - Properties = properties; - } - } + } diff --git a/Meridian59.DebugUI/ObjectEditor.cs b/Meridian59.DebugUI/ObjectEditor.cs index 6f1270b8..1a704984 100644 --- a/Meridian59.DebugUI/ObjectEditor.cs +++ b/Meridian59.DebugUI/ObjectEditor.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Text; using System.Windows.Forms; +using Meridian59.Data.Models.AdminData; namespace Meridian59.DebugUI { diff --git a/Meridian59/Data/DataController.cs b/Meridian59/Data/DataController.cs index 50adfb54..d7b089ea 100644 --- a/Meridian59/Data/DataController.cs +++ b/Meridian59/Data/DataController.cs @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License along with "Me using System.ComponentModel; using System.Collections.Generic; using System.Collections.Concurrent; +using System.Text.RegularExpressions; using Meridian59.Data.Models; using Meridian59.Data.Lists; using Meridian59.Protocol.GameMessages; @@ -26,6 +27,7 @@ You should have received a copy of the GNU General Public License along with "Me using Meridian59.Common.Enums; using Meridian59.Common.Constants; using Meridian59.Common.Interfaces; +using Meridian59.Data.Models.AdminData; using Meridian59.Files.ROO; // Switch FP precision based on architecture @@ -628,6 +630,8 @@ public UIMode UIMode } } } + + public AdminData AdminData { get; protected set; } #endregion #region Constructors @@ -688,6 +692,8 @@ public DataController() CharCreationInfo = new CharCreationInfo(); ObjectContents = new ObjectContents(); + AdminData = new AdminData(); + // some values ChatMessagesMaximum = 100; ChatCommandHistoryMaximum = 20; @@ -762,6 +768,7 @@ public void Invalidate() CharCreationInfo.Clear(true); ObjectContents.Clear(true); GuildShieldInfo.Clear(true); + AdminData.Clear(true); // reset values/references AvatarObject = null; @@ -1447,6 +1454,10 @@ public void HandleIncomingGameModeMessage(GameMessage Message) case MessageTypeGameMode.InvalidateData: // 228 HandleInvalidateData((InvalidateDataMessage)Message); break; + + case MessageTypeGameMode.Admin: + HandleAdminMessage((AdminMessage)Message); + break; } } @@ -1902,6 +1913,52 @@ protected void HandleMessage(MessageMessage Message) ChatMessages.Add(Message.Message); } + public void HandleAdminMessage(AdminMessage Message) + { + if (Message.Message.StartsWith(":< OBJECT")) + { + HandleAdminShowObjectMessage(Message); + } + } + + protected void HandleAdminShowObjectMessage(AdminMessage Message) + { + //Look for object info + var regex = new Regex(@":< OBJECT (?\d*) is CLASS (?.*)"); + if (regex.IsMatch(Message.Message)) + { + + + } + var matches = regex.Matches(Message.Message); + if (matches.Count < 1) //We should only get one of these at a time + { + return; + } + AdminObject obj = null; + foreach (Match match in matches) //but i dont know how to just do if -match will research + { + obj = new AdminObject(match.Groups["classname"].ToString(), Convert.ToInt32(match.Groups["objectnumber"].ToString())); + } + + regex = new Regex(@": (?\w*)\s*=\s(?[\w$]*)\s(?\d*)"); + if (regex.IsMatch((Message.Message))) + { + BaseList props = new BaseList(); + matches = regex.Matches(Message.Message); + foreach (Match match in matches) + { + props.Add(new AdminObjectProperty(match.Groups["property"].ToString(), match.Groups["datatype"].ToString(), match.Groups["value"].ToString())); + } + if (obj != null) + { + obj.SetProperties(props); + AdminData.WatchObject(obj); + } + + } + } + protected void HandleCharInfoNotOKMessage(CharInfoNotOkMessage Message) { // mark as not OK diff --git a/Meridian59/Meridian59.csproj b/Meridian59/Meridian59.csproj index d54d52e8..c62c2555 100644 --- a/Meridian59/Meridian59.csproj +++ b/Meridian59/Meridian59.csproj @@ -111,6 +111,7 @@ + @@ -322,6 +323,9 @@ + + + @@ -561,7 +565,9 @@ - + + +