diff --git a/GrowbrewProxy/HTTPServer.cs b/GrowbrewProxy/HTTPServer.cs index 4a4a263..d435c06 100644 --- a/GrowbrewProxy/HTTPServer.cs +++ b/GrowbrewProxy/HTTPServer.cs @@ -1,4 +1,6 @@ -using System; +// thanks to iProgramInCpp#0489, most things are made by him in the GrowtopiaCustomClient, + +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/GrowbrewProxy/HandleMessages.cs b/GrowbrewProxy/HandleMessages.cs index 89191ad..f292b4b 100644 --- a/GrowbrewProxy/HandleMessages.cs +++ b/GrowbrewProxy/HandleMessages.cs @@ -72,6 +72,8 @@ private int OperateVariant(VariantList.VarList vList, object botPeer) variantPacket2.AppendString("OnReconnect"); packetSender.SendData(variantPacket2.GetBytes(), MainForm.proxyPeer); } + + break; } case "OnRequestWorldSelectMenu": @@ -84,6 +86,7 @@ private int OperateVariant(VariantList.VarList vList, object botPeer) } case "OnSuperMainStartAcceptLogonHrdxs47254722215a": { + if (MainForm.skipCache && botPeer == null) { MainForm.LogText += ("[" + DateTime.UtcNow + "] (CLIENT): Skipping potential caching (will make world list disappear)..."); @@ -174,8 +177,6 @@ private int OperateVariant(VariantList.VarList vList, object botPeer) int port = (int)vList.functionArgs[1]; int userID = (int)vList.functionArgs[3]; int token = (int)vList.functionArgs[2]; - int lmode = (int)vList.functionArgs[5]; - MainForm.LogText += ("[" + DateTime.UtcNow + "] (SERVER): OnSendToServer (func call used for server switching/sub-servers) " + "IP: " + @@ -192,11 +193,11 @@ private int OperateVariant(VariantList.VarList vList, object botPeer) MainForm.globalUserData.Growtopia_Port = token < 0 ? MainForm.globalUserData.Growtopia_Master_Port : port; MainForm.globalUserData.isSwitchingServer = true; MainForm.globalUserData.token = token; - MainForm.globalUserData.lmode = lmode; + MainForm.globalUserData.lmode = 1; MainForm.globalUserData.userID = userID; MainForm.globalUserData.doorid = doorid; - packetSender.SendPacket(3, "action|quit", MainForm.realPeer); + packetSender.SendPacket(3, "action|quit", MainForm.realPeer); MainForm.realPeer.Disconnect(0); return -1; @@ -239,6 +240,13 @@ private int OperateVariant(VariantList.VarList vList, object botPeer) case "smstate": p.mstate = Convert.ToInt32(lineToken[1]); break; + case "posXY": + if (lineToken.Length == 3) // exactly 3 not more not less + { + p.X = Convert.ToInt32(lineToken[1]); + p.Y = Convert.ToInt32(lineToken[2]); + } + break; case "type": if (lineToken[1] == "local") localplayer = true; break; @@ -277,7 +285,7 @@ private int OperateVariant(VariantList.VarList vList, object botPeer) switch (key) { - case "mstate": // unlimited punch/place range edit smstate, but is dangerous/detectable and can autoban! + case "mstate": // unlimited punch/place range edit smstate value = "1"; break; } @@ -371,6 +379,9 @@ bool IsBitSet(int b, int pos) { return (b & (1 << pos)) != 0; } + + + public string HandlePacketFromClient(ref ENetPeer peer, ENetPacket packet) // Why string? Oh yeah, it's the best thing to also return a string response for anything you want! { @@ -523,6 +534,11 @@ bool IsBitSet(int b, int pos) worldMap.player.X = (int)p.X; worldMap.player.Y = (int)p.Y; break; + case NetTypes.PacketTypes.PING_REPLY: + { + SpoofedPingReply(p); + return "Spoofed ping reply!"; + } case NetTypes.PacketTypes.TILE_CHANGE_REQ: respondToBotPeers = true; @@ -603,11 +619,13 @@ private void SpoofedPingReply(TankPacket tPacket) { if (worldMap == null) return; TankPacket p = new TankPacket(); + p.PacketType = (int)NetTypes.PacketTypes.PING_REPLY; p.PunchX = (int)1000.0f; p.PunchY = (int)250.0f; p.X = 64.0f; p.Y = 64.0f; - p.SecondaryNetID = (int)MainForm.HashBytes(BitConverter.GetBytes(tPacket.MainValue)); + p.MainValue = tPacket.MainValue; // GetTickCount() + p.SecondaryNetID = (int)MainForm.HashBytes(BitConverter.GetBytes(tPacket.MainValue)); // HashString of it // rest is 0 by default to not get detected by ac. packetSender.SendPacketRaw((int)NetTypes.NetMessages.GAME_PACKET, p.PackForSendingRaw(), MainForm.realPeer); @@ -623,12 +641,6 @@ public string HandlePacketFromServer(ref ENetPeer peer, ENetPacket packet) byte[] data = packet.Data.ToArray(); - //else - //{ - //return "_none_"; - //} - - NetTypes.NetMessages msgType = (NetTypes.NetMessages)data[0]; // more performance. switch (msgType) @@ -693,12 +705,16 @@ public string HandlePacketFromServer(ref ENetPeer peer, ENetPacket packet) } break; } - + case NetTypes.PacketTypes.INVENTORY_STATE: + { + if (!MainForm.globalUserData.dontSerializeInventory) + worldMap.player.SerializePlayerInventory(VariantList.get_extended_data(tankPacket)); + break; + } case NetTypes.PacketTypes.TILE_CHANGE_REQ: { TankPacket p = TankPacket.UnpackFromPacket(data); - // world tile map in proxy, by playingo :) if (worldMap == null) { MainForm.LogText += ("[" + DateTime.UtcNow + "] (PROXY): (ERROR) World map was null." + "\n"); @@ -748,12 +764,14 @@ public string HandlePacketFromServer(ref ENetPeer peer, ENetPacket packet) if (VarListFetched.FunctionName == "OnSendToServer") return "Server switching forced, not continuing as Proxy Client has to deal with this."; if (VarListFetched.FunctionName == "onShowCaptcha") return "Received captcha solving request, instantly bypassed it so it doesnt show up on client side."; if (VarListFetched.FunctionName == "OnDialogRequest" && ((string)VarListFetched.functionArgs[1]).ToLower().Contains("captcha")) return "Received captcha solving request, instantly bypassed it so it doesnt show up on client side."; + if (VarListFetched.FunctionName == "OnDialogRequest" && ((string)VarListFetched.functionArgs[1]).ToLower().Contains("gazette")) return "Received gazette, skipping it..."; if (VarListFetched.FunctionName == "OnSetPos" && MainForm.globalUserData.ignoreonsetpos && netID == worldMap.netID) return "Ignored position set by server, may corrupt doors but is used so it wont set back. (CAN BE BUGGY WITH SLOW CONNECTIONS)"; if (VarListFetched.FunctionName == "OnSpawn" && netID == -2) { if (MainForm.globalUserData.unlimitedZoom) return "Modified OnSpawn for unlimited zoom (mstate|1)"; // only doing unlimited zoom and not unlimited punch/place to be sure that no bans occur due to this. If you wish to use unlimited punching/placing as well, change the smstate in OperateVariant function instead. } + break; case NetTypes.PacketTypes.SET_CHARACTER_STATE: diff --git a/GrowbrewProxy/MainForm.Designer.cs b/GrowbrewProxy/MainForm.Designer.cs index d5c8f61..052b2b9 100644 --- a/GrowbrewProxy/MainForm.Designer.cs +++ b/GrowbrewProxy/MainForm.Designer.cs @@ -87,24 +87,25 @@ private void InitializeComponent() this.rgbSkinHack = new System.Windows.Forms.CheckBox(); this.internalextrapage = new System.Windows.Forms.TabPage(); this.spoofBox = new System.Windows.Forms.GroupBox(); + this.sidUpdate = new System.Windows.Forms.Button(); + this.setSID = new System.Windows.Forms.TextBox(); + this.ridUpdate = new System.Windows.Forms.Button(); + this.setRID = new System.Windows.Forms.TextBox(); this.label16 = new System.Windows.Forms.Label(); - this.textBox2 = new System.Windows.Forms.TextBox(); - this.button12 = new System.Windows.Forms.Button(); + this.setVersion = new System.Windows.Forms.TextBox(); + this.versionUpdate = new System.Windows.Forms.Button(); this.label7 = new System.Windows.Forms.Label(); this.setMac = new System.Windows.Forms.TextBox(); this.macUpdate = new System.Windows.Forms.Button(); this.tileX = new System.Windows.Forms.TextBox(); this.button19 = new System.Windows.Forms.Button(); - this.textBox3 = new System.Windows.Forms.TextBox(); this.textBox1 = new System.Windows.Forms.TextBox(); this.itemid = new System.Windows.Forms.TextBox(); this.tileY = new System.Windows.Forms.TextBox(); this.custom_collect_y = new System.Windows.Forms.TextBox(); this.custom_collect_x = new System.Windows.Forms.TextBox(); this.custom_collect_uid = new System.Windows.Forms.TextBox(); - this.button17 = new System.Windows.Forms.Button(); this.button15 = new System.Windows.Forms.Button(); - this.label18 = new System.Windows.Forms.Label(); this.button14 = new System.Windows.Forms.Button(); this.button3 = new System.Windows.Forms.Button(); this.label11 = new System.Windows.Forms.Label(); @@ -116,6 +117,7 @@ private void InitializeComponent() this.expllabel = new System.Windows.Forms.Label(); this.button1 = new System.Windows.Forms.Button(); this.configPage = new System.Windows.Forms.TabPage(); + this.dontSerializeInvBox = new System.Windows.Forms.CheckBox(); this.enableAutoReconnectBox = new System.Windows.Forms.CheckBox(); this.enableSilentReconnect = new System.Windows.Forms.CheckBox(); this.logallpackets = new System.Windows.Forms.CheckBox(); @@ -137,6 +139,15 @@ private void InitializeComponent() this.reapplyLockBtn = new System.Windows.Forms.Button(); this.broadcastIconStatus = new System.Windows.Forms.CheckBox(); this.checkBox8 = new System.Windows.Forms.CheckBox(); + this.cheatPage3 = new System.Windows.Forms.TabPage(); + this.label35 = new System.Windows.Forms.Label(); + this.patDelayUpDown = new System.Windows.Forms.NumericUpDown(); + this.label34 = new System.Windows.Forms.Label(); + this.patSizeUpDown = new System.Windows.Forms.NumericUpDown(); + this.spawnParticleBtn = new System.Windows.Forms.Button(); + this.patUpDown = new System.Windows.Forms.NumericUpDown(); + this.label18 = new System.Windows.Forms.Label(); + this.patTrackBar = new System.Windows.Forms.TrackBar(); this.extraPage = new System.Windows.Forms.TabPage(); this.reloadLogs = new System.Windows.Forms.Button(); this.entireLog = new System.Windows.Forms.RichTextBox(); @@ -169,6 +180,7 @@ private void InitializeComponent() this.label19 = new System.Windows.Forms.Label(); this.itemIDBox = new System.Windows.Forms.TextBox(); this.multibottingPage = new System.Windows.Forms.TabPage(); + this.bypass10PlayerCount = new System.Windows.Forms.CheckBox(); this.label32 = new System.Windows.Forms.Label(); this.button23 = new System.Windows.Forms.Button(); this.label31 = new System.Windows.Forms.Label(); @@ -187,6 +199,16 @@ private void InitializeComponent() this.spamStartStopBtn = new System.Windows.Forms.Button(); this.label12 = new System.Windows.Forms.Label(); this.spamtextBox = new System.Windows.Forms.TextBox(); + this.priceChecker = new System.Windows.Forms.TabPage(); + this.inventoryWealthCheckbox = new System.Windows.Forms.CheckBox(); + this.syncPricesBtn = new System.Windows.Forms.Button(); + this.loadingPricesLabel = new System.Windows.Forms.Label(); + this.inventoryWealthLabel = new System.Windows.Forms.Label(); + this.showAllPricesBox = new System.Windows.Forms.CheckBox(); + this.itemPricesBox = new System.Windows.Forms.RichTextBox(); + this.searchBtn = new System.Windows.Forms.Button(); + this.label37 = new System.Windows.Forms.Label(); + this.findPriceByNameBox = new System.Windows.Forms.TextBox(); this.playerLogicUpdate = new System.Windows.Forms.Timer(this.components); this.label14 = new System.Windows.Forms.Label(); this.spammerTimer = new System.Windows.Forms.Timer(this.components); @@ -195,6 +217,9 @@ private void InitializeComponent() this.label33 = new System.Windows.Forms.Label(); this.modifyIconStatusTimer = new System.Windows.Forms.Timer(this.components); this.annoyPlayers = new System.Windows.Forms.Timer(this.components); + this.ytlinklabel = new System.Windows.Forms.LinkLabel(); + this.linkLabel1 = new System.Windows.Forms.LinkLabel(); + this.skipGazetteBox = new System.Windows.Forms.CheckBox(); this.proxyPages.SuspendLayout(); this.proxyPage.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.portBox)).BeginInit(); @@ -206,12 +231,18 @@ private void InitializeComponent() this.configPage.SuspendLayout(); this.groupBox3.SuspendLayout(); this.cheatExtra2Page.SuspendLayout(); + this.cheatPage3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.patDelayUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.patSizeUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.patUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.patTrackBar)).BeginInit(); this.extraPage.SuspendLayout(); this.accountCheckerPage.SuspendLayout(); this.groupBox1.SuspendLayout(); this.autofarmPage.SuspendLayout(); this.multibottingPage.SuspendLayout(); this.groupBox2.SuspendLayout(); + this.priceChecker.SuspendLayout(); this.whitepanel.SuspendLayout(); this.SuspendLayout(); // @@ -287,6 +318,7 @@ private void InitializeComponent() this.proxyPages.Controls.Add(this.accountCheckerPage); this.proxyPages.Controls.Add(this.autofarmPage); this.proxyPages.Controls.Add(this.multibottingPage); + this.proxyPages.Controls.Add(this.priceChecker); this.proxyPages.Location = new System.Drawing.Point(-1, 0); this.proxyPages.Margin = new System.Windows.Forms.Padding(4); this.proxyPages.Name = "proxyPages"; @@ -331,9 +363,9 @@ private void InitializeComponent() this.accessLabel.AutoSize = true; this.accessLabel.Location = new System.Drawing.Point(276, 217); this.accessLabel.Name = "accessLabel"; - this.accessLabel.Size = new System.Drawing.Size(123, 20); + this.accessLabel.Size = new System.Drawing.Size(119, 20); this.accessLabel.TabIndex = 20; - this.accessLabel.Text = "Access: EXTREME"; + this.accessLabel.Text = "Access: DEFAULT"; this.accessLabel.Visible = false; // // button21 @@ -497,6 +529,7 @@ private void InitializeComponent() this.cheattabs.Controls.Add(this.internalextrapage); this.cheattabs.Controls.Add(this.configPage); this.cheattabs.Controls.Add(this.cheatExtra2Page); + this.cheattabs.Controls.Add(this.cheatPage3); this.cheattabs.Location = new System.Drawing.Point(0, 0); this.cheattabs.Margin = new System.Windows.Forms.Padding(4); this.cheattabs.Name = "cheattabs"; @@ -888,16 +921,13 @@ private void InitializeComponent() this.internalextrapage.Controls.Add(this.spoofBox); this.internalextrapage.Controls.Add(this.tileX); this.internalextrapage.Controls.Add(this.button19); - this.internalextrapage.Controls.Add(this.textBox3); this.internalextrapage.Controls.Add(this.textBox1); this.internalextrapage.Controls.Add(this.itemid); this.internalextrapage.Controls.Add(this.tileY); this.internalextrapage.Controls.Add(this.custom_collect_y); this.internalextrapage.Controls.Add(this.custom_collect_x); this.internalextrapage.Controls.Add(this.custom_collect_uid); - this.internalextrapage.Controls.Add(this.button17); this.internalextrapage.Controls.Add(this.button15); - this.internalextrapage.Controls.Add(this.label18); this.internalextrapage.Controls.Add(this.button14); this.internalextrapage.Controls.Add(this.button3); this.internalextrapage.Controls.Add(this.label11); @@ -920,55 +950,97 @@ private void InitializeComponent() // // spoofBox // + this.spoofBox.Controls.Add(this.sidUpdate); + this.spoofBox.Controls.Add(this.setSID); + this.spoofBox.Controls.Add(this.ridUpdate); + this.spoofBox.Controls.Add(this.setRID); this.spoofBox.Controls.Add(this.label16); - this.spoofBox.Controls.Add(this.textBox2); - this.spoofBox.Controls.Add(this.button12); + this.spoofBox.Controls.Add(this.setVersion); + this.spoofBox.Controls.Add(this.versionUpdate); this.spoofBox.Controls.Add(this.label7); this.spoofBox.Controls.Add(this.setMac); this.spoofBox.Controls.Add(this.macUpdate); - this.spoofBox.Location = new System.Drawing.Point(425, 39); + this.spoofBox.Location = new System.Drawing.Point(339, 39); this.spoofBox.Margin = new System.Windows.Forms.Padding(4); this.spoofBox.Name = "spoofBox"; this.spoofBox.Padding = new System.Windows.Forms.Padding(4); - this.spoofBox.Size = new System.Drawing.Size(237, 124); + this.spoofBox.Size = new System.Drawing.Size(323, 175); this.spoofBox.TabIndex = 37; this.spoofBox.TabStop = false; this.spoofBox.Text = "Spoofing"; // + // sidUpdate + // + this.sidUpdate.Location = new System.Drawing.Point(230, 142); + this.sidUpdate.Margin = new System.Windows.Forms.Padding(4); + this.sidUpdate.Name = "sidUpdate"; + this.sidUpdate.Size = new System.Drawing.Size(85, 28); + this.sidUpdate.TabIndex = 26; + this.sidUpdate.Text = "Apply"; + this.sidUpdate.UseVisualStyleBackColor = true; + this.sidUpdate.Click += new System.EventHandler(this.sidUpdate_Click); + // + // setSID + // + this.setSID.Location = new System.Drawing.Point(8, 145); + this.setSID.Name = "setSID"; + this.setSID.PlaceholderText = "Spoof WK/SID"; + this.setSID.Size = new System.Drawing.Size(216, 23); + this.setSID.TabIndex = 25; + // + // ridUpdate + // + this.ridUpdate.Location = new System.Drawing.Point(230, 114); + this.ridUpdate.Margin = new System.Windows.Forms.Padding(4); + this.ridUpdate.Name = "ridUpdate"; + this.ridUpdate.Size = new System.Drawing.Size(85, 28); + this.ridUpdate.TabIndex = 24; + this.ridUpdate.Text = "Apply"; + this.ridUpdate.UseVisualStyleBackColor = true; + this.ridUpdate.Click += new System.EventHandler(this.ridUpdate_Click); + // + // setRID + // + this.setRID.Location = new System.Drawing.Point(8, 117); + this.setRID.Name = "setRID"; + this.setRID.PlaceholderText = "Spoof RID"; + this.setRID.Size = new System.Drawing.Size(216, 23); + this.setRID.TabIndex = 23; + // // label16 // this.label16.AutoSize = true; - this.label16.Location = new System.Drawing.Point(4, 20); + this.label16.Location = new System.Drawing.Point(8, 20); this.label16.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label16.Name = "label16"; this.label16.Size = new System.Drawing.Size(162, 17); this.label16.TabIndex = 21; this.label16.Text = "spoof growtopia version:"; // - // textBox2 + // setVersion // - this.textBox2.Location = new System.Drawing.Point(8, 38); - this.textBox2.Margin = new System.Windows.Forms.Padding(4); - this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(91, 23); - this.textBox2.TabIndex = 20; - this.textBox2.Text = "4.20"; + this.setVersion.Location = new System.Drawing.Point(8, 41); + this.setVersion.Margin = new System.Windows.Forms.Padding(4); + this.setVersion.Name = "setVersion"; + this.setVersion.Size = new System.Drawing.Size(91, 23); + this.setVersion.TabIndex = 20; + this.setVersion.Text = "4.20"; // - // button12 + // versionUpdate // - this.button12.Location = new System.Drawing.Point(147, 36); - this.button12.Margin = new System.Windows.Forms.Padding(4); - this.button12.Name = "button12"; - this.button12.Size = new System.Drawing.Size(85, 28); - this.button12.TabIndex = 22; - this.button12.Text = "Apply"; - this.button12.UseVisualStyleBackColor = true; - this.button12.Click += new System.EventHandler(this.button12_Click); + this.versionUpdate.Location = new System.Drawing.Point(230, 38); + this.versionUpdate.Margin = new System.Windows.Forms.Padding(4); + this.versionUpdate.Name = "versionUpdate"; + this.versionUpdate.Size = new System.Drawing.Size(85, 28); + this.versionUpdate.TabIndex = 22; + this.versionUpdate.Text = "Apply"; + this.versionUpdate.UseVisualStyleBackColor = true; + this.versionUpdate.Click += new System.EventHandler(this.button12_Click); // // label7 // this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(4, 68); + this.label7.Location = new System.Drawing.Point(8, 69); this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(89, 17); @@ -986,7 +1058,7 @@ private void InitializeComponent() // // macUpdate // - this.macUpdate.Location = new System.Drawing.Point(147, 85); + this.macUpdate.Location = new System.Drawing.Point(230, 84); this.macUpdate.Margin = new System.Windows.Forms.Padding(4); this.macUpdate.Name = "macUpdate"; this.macUpdate.Size = new System.Drawing.Size(85, 28); @@ -1014,15 +1086,6 @@ private void InitializeComponent() this.button19.UseVisualStyleBackColor = true; this.button19.Click += new System.EventHandler(this.button19_Click); // - // textBox3 - // - this.textBox3.Location = new System.Drawing.Point(317, 39); - this.textBox3.Margin = new System.Windows.Forms.Padding(4); - this.textBox3.Name = "textBox3"; - this.textBox3.Size = new System.Drawing.Size(85, 23); - this.textBox3.TabIndex = 33; - this.textBox3.Visible = false; - // // textBox1 // this.textBox1.Location = new System.Drawing.Point(180, 191); @@ -1072,18 +1135,6 @@ private void InitializeComponent() this.custom_collect_uid.TabIndex = 1; this.custom_collect_uid.Text = "1"; // - // button17 - // - this.button17.Location = new System.Drawing.Point(12, 38); - this.button17.Margin = new System.Windows.Forms.Padding(4); - this.button17.Name = "button17"; - this.button17.Size = new System.Drawing.Size(297, 26); - this.button17.TabIndex = 32; - this.button17.Text = "Collect all items (uid starting from):"; - this.button17.UseVisualStyleBackColor = true; - this.button17.Visible = false; - this.button17.Click += new System.EventHandler(this.button17_Click); - // // button15 // this.button15.Location = new System.Drawing.Point(12, 103); @@ -1095,16 +1146,6 @@ private void InitializeComponent() this.button15.UseVisualStyleBackColor = true; this.button15.Click += new System.EventHandler(this.button15_Click_2); // - // label18 - // - this.label18.AutoSize = true; - this.label18.Location = new System.Drawing.Point(296, 167); - this.label18.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label18.Name = "label18"; - this.label18.Size = new System.Drawing.Size(370, 17); - this.label18.TabIndex = 28; - this.label18.Text = "for AAP Bypass, spoof mac address to 02:00:00:00:00:00"; - // // button14 // this.button14.Location = new System.Drawing.Point(448, 215); @@ -1210,6 +1251,8 @@ private void InitializeComponent() // // configPage // + this.configPage.Controls.Add(this.skipGazetteBox); + this.configPage.Controls.Add(this.dontSerializeInvBox); this.configPage.Controls.Add(this.enableAutoReconnectBox); this.configPage.Controls.Add(this.enableSilentReconnect); this.configPage.Controls.Add(this.logallpackets); @@ -1231,6 +1274,17 @@ private void InitializeComponent() this.configPage.Text = "Config"; this.configPage.UseVisualStyleBackColor = true; // + // dontSerializeInvBox + // + this.dontSerializeInvBox.AutoSize = true; + this.dontSerializeInvBox.Location = new System.Drawing.Point(273, 53); + this.dontSerializeInvBox.Name = "dontSerializeInvBox"; + this.dontSerializeInvBox.Size = new System.Drawing.Size(181, 21); + this.dontSerializeInvBox.TabIndex = 48; + this.dontSerializeInvBox.Text = "Don\'t serialize inventory"; + this.dontSerializeInvBox.UseVisualStyleBackColor = true; + this.dontSerializeInvBox.CheckedChanged += new System.EventHandler(this.dontSerializeInvBox_CheckedChanged); + // // enableAutoReconnectBox // this.enableAutoReconnectBox.AutoSize = true; @@ -1367,10 +1421,10 @@ private void InitializeComponent() this.checkBox7.Location = new System.Drawing.Point(7, 7); this.checkBox7.Margin = new System.Windows.Forms.Padding(4); this.checkBox7.Name = "checkBox7"; - this.checkBox7.Size = new System.Drawing.Size(561, 38); + this.checkBox7.Size = new System.Drawing.Size(524, 38); this.checkBox7.TabIndex = 36; - this.checkBox7.Text = "Disable advanced world loading in proxy [makes world entering/loading much faster" + - ", \r\nbut makes Magplant/Autofarm/Pickup range exploit practically unusable.]"; + this.checkBox7.Text = "Enable advanced world loading in proxy [makes world entering/loading slower, \r\nbu" + + "t must be turned on if using Autofarm/Pickup range]"; this.checkBox7.UseVisualStyleBackColor = true; this.checkBox7.CheckedChanged += new System.EventHandler(this.checkBox7_CheckedChanged); // @@ -1428,9 +1482,9 @@ private void InitializeComponent() this.annoyPlayerBox.AutoSize = true; this.annoyPlayerBox.Location = new System.Drawing.Point(8, 134); this.annoyPlayerBox.Name = "annoyPlayerBox"; - this.annoyPlayerBox.Size = new System.Drawing.Size(253, 24); + this.annoyPlayerBox.Size = new System.Drawing.Size(374, 24); this.annoyPlayerBox.TabIndex = 4; - this.annoyPlayerBox.Text = "Slime Spam Annoy Players (Burst)"; + this.annoyPlayerBox.Text = "Slime Spam Annoy Players (Burst) [PATCHED/FIXED]"; this.annoyPlayerBox.UseVisualStyleBackColor = true; this.annoyPlayerBox.CheckedChanged += new System.EventHandler(this.annoyPlayerBox_CheckedChanged); // @@ -1476,6 +1530,116 @@ private void InitializeComponent() this.checkBox8.UseVisualStyleBackColor = true; this.checkBox8.CheckedChanged += new System.EventHandler(this.checkBox8_CheckedChanged); // + // cheatPage3 + // + this.cheatPage3.Controls.Add(this.label35); + this.cheatPage3.Controls.Add(this.patDelayUpDown); + this.cheatPage3.Controls.Add(this.label34); + this.cheatPage3.Controls.Add(this.patSizeUpDown); + this.cheatPage3.Controls.Add(this.spawnParticleBtn); + this.cheatPage3.Controls.Add(this.patUpDown); + this.cheatPage3.Controls.Add(this.label18); + this.cheatPage3.Controls.Add(this.patTrackBar); + this.cheatPage3.Location = new System.Drawing.Point(4, 29); + this.cheatPage3.Name = "cheatPage3"; + this.cheatPage3.Padding = new System.Windows.Forms.Padding(3); + this.cheatPage3.Size = new System.Drawing.Size(669, 245); + this.cheatPage3.TabIndex = 5; + this.cheatPage3.Text = "Cheat Extra 3"; + this.cheatPage3.UseVisualStyleBackColor = true; + // + // label35 + // + this.label35.AutoSize = true; + this.label35.Location = new System.Drawing.Point(303, 15); + this.label35.Name = "label35"; + this.label35.Size = new System.Drawing.Size(50, 20); + this.label35.TabIndex = 7; + this.label35.Text = "Delay:"; + // + // patDelayUpDown + // + this.patDelayUpDown.Location = new System.Drawing.Point(367, 13); + this.patDelayUpDown.Maximum = new decimal(new int[] { + 99999999, + 0, + 0, + 0}); + this.patDelayUpDown.Minimum = new decimal(new int[] { + 1, + 0, + 0, + -2147483648}); + this.patDelayUpDown.Name = "patDelayUpDown"; + this.patDelayUpDown.Size = new System.Drawing.Size(71, 27); + this.patDelayUpDown.TabIndex = 6; + // + // label34 + // + this.label34.AutoSize = true; + this.label34.Location = new System.Drawing.Point(196, 15); + this.label34.Name = "label34"; + this.label34.Size = new System.Drawing.Size(39, 20); + this.label34.TabIndex = 5; + this.label34.Text = "Size:"; + // + // patSizeUpDown + // + this.patSizeUpDown.Location = new System.Drawing.Point(241, 13); + this.patSizeUpDown.Maximum = new decimal(new int[] { + 9999, + 0, + 0, + 0}); + this.patSizeUpDown.Minimum = new decimal(new int[] { + 1, + 0, + 0, + -2147483648}); + this.patSizeUpDown.Name = "patSizeUpDown"; + this.patSizeUpDown.Size = new System.Drawing.Size(56, 27); + this.patSizeUpDown.TabIndex = 4; + this.patSizeUpDown.Value = new decimal(new int[] { + 100, + 0, + 0, + 0}); + // + // spawnParticleBtn + // + this.spawnParticleBtn.Location = new System.Drawing.Point(24, 126); + this.spawnParticleBtn.Name = "spawnParticleBtn"; + this.spawnParticleBtn.Size = new System.Drawing.Size(118, 29); + this.spawnParticleBtn.TabIndex = 3; + this.spawnParticleBtn.Text = "Spawn (visual)"; + this.spawnParticleBtn.UseVisualStyleBackColor = true; + this.spawnParticleBtn.Click += new System.EventHandler(this.spawnParticleBtn_Click); + // + // patUpDown + // + this.patUpDown.Location = new System.Drawing.Point(140, 13); + this.patUpDown.Name = "patUpDown"; + this.patUpDown.Size = new System.Drawing.Size(50, 27); + this.patUpDown.TabIndex = 2; + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Location = new System.Drawing.Point(24, 15); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(110, 20); + this.label18.TabIndex = 1; + this.label18.Text = "Spawn particle:"; + // + // patTrackBar + // + this.patTrackBar.Location = new System.Drawing.Point(24, 46); + this.patTrackBar.Maximum = 600; + this.patTrackBar.Name = "patTrackBar"; + this.patTrackBar.Size = new System.Drawing.Size(622, 56); + this.patTrackBar.TabIndex = 0; + this.patTrackBar.ValueChanged += new System.EventHandler(this.patTrackBar_ValueChanged); + // // extraPage // this.extraPage.Controls.Add(this.reloadLogs); @@ -1848,6 +2012,7 @@ private void InitializeComponent() // // multibottingPage // + this.multibottingPage.Controls.Add(this.bypass10PlayerCount); this.multibottingPage.Controls.Add(this.label32); this.multibottingPage.Controls.Add(this.button23); this.multibottingPage.Controls.Add(this.label31); @@ -1869,20 +2034,30 @@ private void InitializeComponent() this.multibottingPage.Text = "Multibot"; this.multibottingPage.UseVisualStyleBackColor = true; // + // bypass10PlayerCount + // + this.bypass10PlayerCount.AutoSize = true; + this.bypass10PlayerCount.Location = new System.Drawing.Point(8, 39); + this.bypass10PlayerCount.Name = "bypass10PlayerCount"; + this.bypass10PlayerCount.Size = new System.Drawing.Size(384, 24); + this.bypass10PlayerCount.TabIndex = 24; + this.bypass10PlayerCount.Text = "Bypass Connection Count Limit (showcase 28/1/2021)"; + this.bypass10PlayerCount.UseVisualStyleBackColor = true; + this.bypass10PlayerCount.CheckedChanged += new System.EventHandler(this.checkBox11_CheckedChanged); + // // label32 // this.label32.AutoSize = true; this.label32.Location = new System.Drawing.Point(3, 165); this.label32.Name = "label32"; - this.label32.Size = new System.Drawing.Size(431, 60); + this.label32.Size = new System.Drawing.Size(390, 60); this.label32.TabIndex = 23; - this.label32.Text = "Available soon in Auto-CCS or Growbrew Proxy Extreme Edition\r\n(closed source, thi" + - "s open source one will have no effects,\r\nnor any code left behind to enable it, " + - "it\'s just a GUI placeholder)"; + this.label32.Text = "Available in Growbrew Proxy Extreme Edition only.\r\nUsing any of these buttons on " + + "open src will have no effect\r\n(except for Spammer)"; // // button23 // - this.button23.Location = new System.Drawing.Point(199, 2); + this.button23.Location = new System.Drawing.Point(209, 4); this.button23.Margin = new System.Windows.Forms.Padding(4); this.button23.Name = "button23"; this.button23.Size = new System.Drawing.Size(31, 28); @@ -1977,9 +2152,9 @@ private void InitializeComponent() this.label27.Location = new System.Drawing.Point(4, 258); this.label27.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label27.Name = "label27"; - this.label27.Size = new System.Drawing.Size(428, 20); + this.label27.Size = new System.Drawing.Size(228, 20); this.label27.TabIndex = 13; - this.label27.Text = "Made by playingo (aka DEERUX) crossbot/multibot still in beta."; + this.label27.Text = "Made by playingo (aka DEERUX)."; // // groupBox2 // @@ -2058,6 +2233,112 @@ private void InitializeComponent() this.spamtextBox.Size = new System.Drawing.Size(248, 45); this.spamtextBox.TabIndex = 1; // + // priceChecker + // + this.priceChecker.Controls.Add(this.inventoryWealthCheckbox); + this.priceChecker.Controls.Add(this.syncPricesBtn); + this.priceChecker.Controls.Add(this.loadingPricesLabel); + this.priceChecker.Controls.Add(this.inventoryWealthLabel); + this.priceChecker.Controls.Add(this.showAllPricesBox); + this.priceChecker.Controls.Add(this.itemPricesBox); + this.priceChecker.Controls.Add(this.searchBtn); + this.priceChecker.Controls.Add(this.label37); + this.priceChecker.Controls.Add(this.findPriceByNameBox); + this.priceChecker.Location = new System.Drawing.Point(4, 29); + this.priceChecker.Name = "priceChecker"; + this.priceChecker.Padding = new System.Windows.Forms.Padding(3); + this.priceChecker.Size = new System.Drawing.Size(684, 277); + this.priceChecker.TabIndex = 6; + this.priceChecker.Text = "Item Price Checker"; + this.priceChecker.UseVisualStyleBackColor = true; + // + // inventoryWealthCheckbox + // + this.inventoryWealthCheckbox.AutoSize = true; + this.inventoryWealthCheckbox.Location = new System.Drawing.Point(575, 37); + this.inventoryWealthCheckbox.Name = "inventoryWealthCheckbox"; + this.inventoryWealthCheckbox.Size = new System.Drawing.Size(92, 24); + this.inventoryWealthCheckbox.TabIndex = 8; + this.inventoryWealthCheckbox.Text = "Inventory"; + this.inventoryWealthCheckbox.UseVisualStyleBackColor = true; + this.inventoryWealthCheckbox.CheckedChanged += new System.EventHandler(this.inventoryWealthCheckbox_CheckedChanged); + // + // syncPricesBtn + // + this.syncPricesBtn.Location = new System.Drawing.Point(525, 238); + this.syncPricesBtn.Name = "syncPricesBtn"; + this.syncPricesBtn.Size = new System.Drawing.Size(148, 29); + this.syncPricesBtn.TabIndex = 7; + this.syncPricesBtn.Text = "Sync/Update prices"; + this.syncPricesBtn.UseVisualStyleBackColor = true; + this.syncPricesBtn.Click += new System.EventHandler(this.syncPricesBtn_Click); + // + // loadingPricesLabel + // + this.loadingPricesLabel.AutoSize = true; + this.loadingPricesLabel.Location = new System.Drawing.Point(612, 0); + this.loadingPricesLabel.Name = "loadingPricesLabel"; + this.loadingPricesLabel.Size = new System.Drawing.Size(72, 20); + this.loadingPricesLabel.TabIndex = 6; + this.loadingPricesLabel.Text = "Loading..."; + this.loadingPricesLabel.Visible = false; + // + // inventoryWealthLabel + // + this.inventoryWealthLabel.AutoSize = true; + this.inventoryWealthLabel.Location = new System.Drawing.Point(10, 242); + this.inventoryWealthLabel.Name = "inventoryWealthLabel"; + this.inventoryWealthLabel.Size = new System.Drawing.Size(454, 20); + this.inventoryWealthLabel.TabIndex = 5; + this.inventoryWealthLabel.Text = "Your inventory is worth (in WLS): ? (do a search with \'Inventory\' first)"; + // + // showAllPricesBox + // + this.showAllPricesBox.AutoSize = true; + this.showAllPricesBox.Location = new System.Drawing.Point(480, 37); + this.showAllPricesBox.Name = "showAllPricesBox"; + this.showAllPricesBox.Size = new System.Drawing.Size(89, 24); + this.showAllPricesBox.TabIndex = 4; + this.showAllPricesBox.Text = "Show All"; + this.showAllPricesBox.UseVisualStyleBackColor = true; + this.showAllPricesBox.CheckedChanged += new System.EventHandler(this.showAllPricesBox_CheckedChanged); + // + // itemPricesBox + // + this.itemPricesBox.Location = new System.Drawing.Point(10, 69); + this.itemPricesBox.Name = "itemPricesBox"; + this.itemPricesBox.ReadOnly = true; + this.itemPricesBox.Size = new System.Drawing.Size(663, 158); + this.itemPricesBox.TabIndex = 3; + this.itemPricesBox.Text = ""; + // + // searchBtn + // + this.searchBtn.Location = new System.Drawing.Point(400, 34); + this.searchBtn.Name = "searchBtn"; + this.searchBtn.Size = new System.Drawing.Size(74, 29); + this.searchBtn.TabIndex = 2; + this.searchBtn.Text = "Search"; + this.searchBtn.UseVisualStyleBackColor = true; + this.searchBtn.Click += new System.EventHandler(this.searchBtn_Click); + // + // label37 + // + this.label37.AutoSize = true; + this.label37.Location = new System.Drawing.Point(10, 12); + this.label37.Name = "label37"; + this.label37.Size = new System.Drawing.Size(86, 20); + this.label37.TabIndex = 1; + this.label37.Text = "Item Name:"; + // + // findPriceByNameBox + // + this.findPriceByNameBox.Location = new System.Drawing.Point(10, 35); + this.findPriceByNameBox.Name = "findPriceByNameBox"; + this.findPriceByNameBox.PlaceholderText = "Can be left empty if \'Inventory\' is ticked."; + this.findPriceByNameBox.Size = new System.Drawing.Size(368, 27); + this.findPriceByNameBox.TabIndex = 0; + // // playerLogicUpdate // this.playerLogicUpdate.Tick += new System.EventHandler(this.playerLogicUpdate_Tick); @@ -2082,12 +2363,12 @@ private void InitializeComponent() this.vLabel.AutoSize = true; this.vLabel.BackColor = System.Drawing.Color.Transparent; this.vLabel.Font = new System.Drawing.Font("Times New Roman", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.vLabel.Location = new System.Drawing.Point(3, 38); + this.vLabel.Location = new System.Drawing.Point(17, 38); this.vLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.vLabel.Name = "vLabel"; - this.vLabel.Size = new System.Drawing.Size(60, 21); + this.vLabel.Size = new System.Drawing.Size(46, 21); this.vLabel.TabIndex = 8; - this.vLabel.Text = "V2.2.1"; + this.vLabel.Text = "V2.3"; // // whitepanel // @@ -2102,7 +2383,7 @@ private void InitializeComponent() // label33 // this.label33.AutoSize = true; - this.label33.Location = new System.Drawing.Point(3, 325); + this.label33.Location = new System.Drawing.Point(7, 310); this.label33.Name = "label33"; this.label33.Size = new System.Drawing.Size(602, 40); this.label33.TabIndex = 11; @@ -2121,11 +2402,46 @@ private void InitializeComponent() this.annoyPlayers.Interval = 180; this.annoyPlayers.Tick += new System.EventHandler(this.annoyPlayers_Tick); // + // ytlinklabel + // + this.ytlinklabel.AutoSize = true; + this.ytlinklabel.Location = new System.Drawing.Point(7, 350); + this.ytlinklabel.Name = "ytlinklabel"; + this.ytlinklabel.Size = new System.Drawing.Size(256, 20); + this.ytlinklabel.TabIndex = 25; + this.ytlinklabel.TabStop = true; + this.ytlinklabel.Text = "Subscribe us on YouTube (growmmfi)"; + this.ytlinklabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.ytlinklabel_LinkClicked); + // + // linkLabel1 + // + this.linkLabel1.AutoSize = true; + this.linkLabel1.Location = new System.Drawing.Point(280, 350); + this.linkLabel1.Name = "linkLabel1"; + this.linkLabel1.Size = new System.Drawing.Size(117, 20); + this.linkLabel1.TabIndex = 26; + this.linkLabel1.TabStop = true; + this.linkLabel1.Text = "Join the discord!"; + this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); + // + // skipGazetteBox + // + this.skipGazetteBox.AutoSize = true; + this.skipGazetteBox.Location = new System.Drawing.Point(470, 39); + this.skipGazetteBox.Name = "skipGazetteBox"; + this.skipGazetteBox.Size = new System.Drawing.Size(111, 21); + this.skipGazetteBox.TabIndex = 49; + this.skipGazetteBox.Text = "Skip Gazette"; + this.skipGazetteBox.UseVisualStyleBackColor = true; + this.skipGazetteBox.CheckedChanged += new System.EventHandler(this.skipGazetteBox_CheckedChanged); + // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.ClientSize = new System.Drawing.Size(688, 374); + this.Controls.Add(this.linkLabel1); + this.Controls.Add(this.ytlinklabel); this.Controls.Add(this.label33); this.Controls.Add(this.whitepanel); this.Controls.Add(this.label14); @@ -2161,6 +2477,12 @@ private void InitializeComponent() this.groupBox3.PerformLayout(); this.cheatExtra2Page.ResumeLayout(false); this.cheatExtra2Page.PerformLayout(); + this.cheatPage3.ResumeLayout(false); + this.cheatPage3.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.patDelayUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.patSizeUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.patUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.patTrackBar)).EndInit(); this.extraPage.ResumeLayout(false); this.accountCheckerPage.ResumeLayout(false); this.accountCheckerPage.PerformLayout(); @@ -2172,6 +2494,8 @@ private void InitializeComponent() this.multibottingPage.PerformLayout(); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); + this.priceChecker.ResumeLayout(false); + this.priceChecker.PerformLayout(); this.whitepanel.ResumeLayout(false); this.whitepanel.PerformLayout(); this.ResumeLayout(false); @@ -2237,8 +2561,7 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox rgbSkinHack; private System.Windows.Forms.TabPage internalextrapage; private System.Windows.Forms.Button button19; - private System.Windows.Forms.TextBox textBox3; - private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.TextBox setVersion; private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.TextBox itemid; private System.Windows.Forms.TextBox tileY; @@ -2247,9 +2570,8 @@ private void InitializeComponent() private System.Windows.Forms.TextBox custom_collect_x; private System.Windows.Forms.TextBox custom_collect_uid; private System.Windows.Forms.Button button15; - private System.Windows.Forms.Label label18; private System.Windows.Forms.Button button14; - private System.Windows.Forms.Button button12; + private System.Windows.Forms.Button versionUpdate; private System.Windows.Forms.Label label16; private System.Windows.Forms.Button button3; private System.Windows.Forms.Label label11; @@ -2292,7 +2614,6 @@ private void InitializeComponent() private System.Windows.Forms.Label label21; private System.Windows.Forms.TextBox tileX; private System.Windows.Forms.GroupBox spoofBox; - private System.Windows.Forms.Button button17; private System.Windows.Forms.CheckBox checkBox2; private System.Windows.Forms.CheckBox ignoresetback; private System.Windows.Forms.TabPage multibottingPage; @@ -2346,6 +2667,34 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox enableAutoReconnectBox; private System.Windows.Forms.TextBox autoWorldTextBox; private System.Windows.Forms.CheckBox autoEnterWorldBox; + private System.Windows.Forms.Button sidUpdate; + private System.Windows.Forms.TextBox setSID; + internal System.Windows.Forms.Button ridUpdate; + private System.Windows.Forms.TextBox setRID; + private System.Windows.Forms.TabPage cheatPage3; + private System.Windows.Forms.Button spawnParticleBtn; + private System.Windows.Forms.NumericUpDown patUpDown; + private System.Windows.Forms.Label label18; + private System.Windows.Forms.TrackBar patTrackBar; + private System.Windows.Forms.NumericUpDown patDelayUpDown; + private System.Windows.Forms.Label label34; + private System.Windows.Forms.NumericUpDown patSizeUpDown; + private System.Windows.Forms.Label label35; + private System.Windows.Forms.TabPage priceChecker; + private System.Windows.Forms.Button searchBtn; + private System.Windows.Forms.Label label37; + private System.Windows.Forms.TextBox findPriceByNameBox; + private System.Windows.Forms.CheckBox bypass10PlayerCount; + private System.Windows.Forms.LinkLabel ytlinklabel; + private System.Windows.Forms.RichTextBox itemPricesBox; + private System.Windows.Forms.CheckBox showAllPricesBox; + private System.Windows.Forms.Label inventoryWealthLabel; + private System.Windows.Forms.LinkLabel linkLabel1; + private System.Windows.Forms.Label loadingPricesLabel; + private System.Windows.Forms.Button syncPricesBtn; + private System.Windows.Forms.CheckBox inventoryWealthCheckbox; + private System.Windows.Forms.CheckBox dontSerializeInvBox; + private System.Windows.Forms.CheckBox skipGazetteBox; } } diff --git a/GrowbrewProxy/MainForm.cs b/GrowbrewProxy/MainForm.cs index f021c8a..681b1d1 100644 --- a/GrowbrewProxy/MainForm.cs +++ b/GrowbrewProxy/MainForm.cs @@ -12,6 +12,7 @@ using System.Linq; using System.Net; using System.Net.Sockets; +using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; using System.Threading; @@ -93,6 +94,7 @@ public class UserData public bool isSwitchingServer = false; public bool blockEnterGame = false; public bool serializeWorldsAdvanced = true; + public bool bypass10PlayerMax = true; // internal variables => public string tankIDName = ""; @@ -121,6 +123,9 @@ public class UserData // CHEAT VARS/DEFS public string macc = "02:15:01:20:30:05"; public string doorid = ""; + public string rid = "", sid = ""; + + public bool ignoreonsetpos = false; public bool unlimitedZoom = false; public bool isFacingSwapped = false; @@ -130,6 +135,8 @@ public class UserData public bool awaitingReconnect = false; public bool enableAutoreconnect = false; public string autoEnterWorld = ""; + public bool dontSerializeInventory = false; + public bool skipGazette = false; } public static UserData globalUserData = new UserData(); @@ -305,14 +312,14 @@ public static string CreateLogonPacket(string customGrowID = "", string customPa p += "country|" + (globalUserData.country + "\n"); p += "hash|" + rand.Next(-777777776, 777777776).ToString() + "\n"; p += "mac|" + globalUserData.macc + "\n"; - p += "rid|" + GenerateRID() + "\n"; + p += ("rid|" + (globalUserData.rid == "" ? GenerateRID() : globalUserData.rid) + "\n"); if (requireAdditionalData) p += "user|" + (globalUserData.userID.ToString() + "\n"); if (requireAdditionalData) p += "token|" + (globalUserData.token.ToString() + "\n"); if (customUserID > 0) p += "user|" + (customUserID.ToString() + "\n"); if (customToken > 0) p += "token|" + (customToken.ToString() + "\n"); if (globalUserData.doorid != "" && doorID == "") p += "doorID|" + globalUserData.doorid + "\n"; else if (doorID != "") p += "doorID|" + doorID + "\n"; - p += "wk|" + GenerateUniqueWinKey() + "\n"; + p += ("wk|" + (globalUserData.sid == "" ? GenerateUniqueWinKey() : globalUserData.sid) + "\n"); p += "fz|1331849031"; Console.WriteLine(p); p += "zf|-1331849031"; @@ -716,6 +723,8 @@ private void MainForm_Load(object sender, EventArgs e) Environment.Exit(-1); } + PriceChecker.SetHTTPS(); + if (File.Exists("stored/config.gbrw")) { try @@ -756,7 +765,7 @@ private void MainForm_Load(object sender, EventArgs e) // hackernetwork is discontinued / servers shutdown, it was good to have it when the proxy was paid, now its abusive and just a big bug mess. - + patUpDown.Maximum = patTrackBar.Maximum; playerLogicUpdate.Start(); itemDB.SetupItemDefs(); @@ -1248,7 +1257,7 @@ private void checkBox6_CheckedChanged(object sender, EventArgs e) private void button12_Click(object sender, EventArgs e) { - globalUserData.game_version = textBox2.Text; + globalUserData.game_version = setVersion.Text; } private void proxyPage_Click(object sender, EventArgs e) @@ -1293,6 +1302,13 @@ private void button15_Click(object sender, EventArgs e) private void changelog_Click(object sender, EventArgs e) { MessageBox.Show("Growbrew Proxy Changelogs:\n" + + "\n2.3\n" + + "- Fix ping reply and random disconnects\n" + + "- Add Item Price Checker, go check it out :D\n" + + "- Added particle spawner (visual)\n" + + "- Misc fixes\n" + + "- Prepare internal, done research for android compilation\n" + + "- Extreme edition is for sale now again, contact me on discord DEERUX#1551.\n" + "\n2.2.1\n" + "- Upgrade to .NET 5 and C# 9.0\n" + "- extreme version will contain an entire bundle of tools for GT (android stealer, growalts, cross/multibotting), including our own gt internal.\n" + @@ -1329,10 +1345,6 @@ private void changelog_Click(object sender, EventArgs e) "- Fixed doorID with subserver switching and entering through door/portal will not link to correct door in other world\n" + "- Many more fixes from previous builds, and optimizations.\n" + "- Removed many left over parts for Hacker Network, as the servers closed, I decided to remove some client code to keep the code a little more clean.\n" + - "\n1.5.3\n--------------------------\n" + - "- Added usage of 2 channels instead of 1 (stability)\n" + - "- Removed Hacker Network, discontinued, won't ever add again\n" + - "- General bug fixes and changes done in earlier build versions, but didn't update the version before already\n" + "\nFull changelog in changelog.txt, too old versions wont be shown anymore. ~playingo/DEERUX"); } @@ -1364,7 +1376,7 @@ private void button15_Click_2(object sender, EventArgs e) void doTakeAll() { int startingfrom = 0; - int.TryParse(textBox3.Text, out startingfrom); + int.TryParse(setRID.Text, out startingfrom); for (int i = 0; i < 10000; i++) { @@ -1553,6 +1565,7 @@ private void doDropAllInventory() if (inventory.items == null) { Console.WriteLine("inventory.items was null!"); + return; } int ctr = 0; @@ -1947,6 +1960,206 @@ private void autoWorldTextBox_TextChanged(object sender, EventArgs e) } } + private void ridUpdate_Click(object sender, EventArgs e) + { + globalUserData.rid = setRID.Text; + } + + private void sidUpdate_Click(object sender, EventArgs e) + { + globalUserData.sid = setSID.Text; + } + + private void spawnParticleBtn_Click(object sender, EventArgs e) + { + TankPacket datx = new TankPacket(); + datx.PacketType = (int)NetTypes.PacketTypes.PARTICLE_EFF; + datx.X = messageHandler.worldMap.player.X; + datx.Y = messageHandler.worldMap.player.Y; + datx.YSpeed = (int)patUpDown.Value; + datx.XSpeed = (float)patSizeUpDown.Value; + datx.MainValue = (int)patDelayUpDown.Value; + messageHandler.packetSender.SendPacketRaw(4, datx.PackForSendingRaw(), MainForm.proxyPeer); + } + + private void patTrackBar_ValueChanged(object sender, EventArgs e) + { + patUpDown.Value = patTrackBar.Value; + + spawnParticleBtn.PerformClick(); + } + + + [StructLayout(LayoutKind.Explicit, Pack = 1, Size = 1)] + struct CharacterExtraMods + { + [FieldOffset(0)] public byte cancel; // they act as bits + [FieldOffset(0)] public byte dash; + [FieldOffset(0)] public byte jump; + } + + public static unsafe byte[] ConvertToBytes(T value) where T : unmanaged + { + byte* pointer = (byte*)&value; + + byte[] bytes = new byte[sizeof(T)]; + for (int i = 0; i < sizeof(T); i++) + { + bytes[i] = pointer[i]; + } + + return bytes; + } + + private void button12_Click_1(object sender, EventArgs e) + { + } + + private void UpdateItemPriceBox(bool showAll, bool doInv = false) + { + PriceChecker.ItemPriceList iPriceList = PriceChecker.GetItemPriceListFromUrl("http://168.119.93.204/"); // giving this away free for 1 month in opensrc / free version, but after that you will require to use paid. Constantly updated. + + string toDisplay = ""; + double invWealth = -1; + + PriceChecker.ItemPrice[] fetchedItems = null; + + if (!doInv) + { + fetchedItems = showAll ? iPriceList.itemPrices.ToArray() : iPriceList.FindByNameIgnoreCase(findPriceByNameBox.Text); + } + else + { + invWealth = 0; + Inventory inven = messageHandler.worldMap.player.inventory; + List invFetchedItems = new List(); + + if (inven.items != null) + { + foreach (InventoryItem invItem in inven.items) + { + //MessageBox.Show(invItem.itemID.ToString()); + string itemName = ItemDatabase.GetItemDef(invItem.itemID).itemName; + + invFetchedItems.AddRange(iPriceList.FindByNameIgnoreCase(itemName, true)); + } + } + fetchedItems = invFetchedItems.ToArray(); + } + + if (fetchedItems != null) + { + foreach (PriceChecker.ItemPrice iPrice in fetchedItems) + { + toDisplay += $"Item: '{iPrice.name}' with quantity: '{iPrice.quantity}' costs: '{iPrice.price} WLS'\n"; + + if (doInv) + invWealth += (iPrice.price / iPrice.quantity); + } + } + + if (itemPricesBox.InvokeRequired || loadingPricesLabel.InvokeRequired || inventoryWealthLabel.InvokeRequired) + { + Invoke(new Action(() => + { + loadingPricesLabel.Visible = false; + itemPricesBox.Text = toDisplay; + if (invWealth > -1) inventoryWealthLabel.Text = $"Your inventory is worth (rounded in WLS): {(int)Math.Round(invWealth)}"; + })); + } + else + { + loadingPricesLabel.Visible = false; + itemPricesBox.Text = toDisplay; + if (invWealth > -1) inventoryWealthLabel.Text = $"Your inventory is worth (rounded in WLS): {(int)Math.Round(invWealth)}"; + } + } + + private void searchBtn_Click(object sender, EventArgs e) + { + loadingPricesLabel.Visible = true; + Task.Run(() => UpdateItemPriceBox(showAllPricesBox.Checked, inventoryWealthCheckbox.Checked)); + } + + private void checkBox11_CheckedChanged(object sender, EventArgs e) + { + + } + + // credits stackoverflow + private void OpenUrl(string url) + { + try + { + Process.Start(url); + } + catch + { + // hack because of this: https://github.com/dotnet/corefx/issues/10361 + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + url = url.Replace("&", "^&"); + Process.Start(new ProcessStartInfo("cmd", $"/c start {url}") { CreateNoWindow = true }); + } + else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + Process.Start("xdg-open", url); + } + else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + { + Process.Start("open", url); + } + else + { + throw; + } + } + } + + private void ytlinklabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + OpenUrl("https://youtube.com/channel/UC0htMnKS9EGPlaeIkcVkxhw"); + } + + private void showAllPricesBox_CheckedChanged(object sender, EventArgs e) + { + + } + + private void syncPricesBtn_Click(object sender, EventArgs e) + { + if (!loadingPricesLabel.Visible) + { + string raw = PriceChecker.RefreshPrices("http://168.119.93.204/"); + PriceChecker.iPriceList = PriceChecker.ItemPriceList.Deserialize(raw); + MessageBox.Show("Updated item prices successfully!"); + } + else + { + MessageBox.Show("Items are currently loading internally, please try again when 'Loading...' is gone!"); + } + } + + private void dontSerializeInvBox_CheckedChanged(object sender, EventArgs e) + { + globalUserData.dontSerializeInventory = dontSerializeInvBox.Checked; + } + + private void inventoryWealthCheckbox_CheckedChanged(object sender, EventArgs e) + { + + } + + private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + + } + + private void skipGazetteBox_CheckedChanged(object sender, EventArgs e) + { + + } + void doAutofarm(int itemID, bool remote_mode = false, bool oneblockmode = false, bool selfblockstart = false) { bool isBg = ItemDatabase.isBackground(itemID); diff --git a/GrowbrewProxy/NetTypes.cs b/GrowbrewProxy/NetTypes.cs index 2c82676..534e60a 100644 --- a/GrowbrewProxy/NetTypes.cs +++ b/GrowbrewProxy/NetTypes.cs @@ -49,7 +49,15 @@ public enum PacketTypes PARTICLE_EFFECT_V2, ARROW_TO_ITEM, TILE_INDEX_SELECTION, - UPDATE_PLAYER_TRIBUTE + UPDATE_PLAYER_TRIBUTE, + PVE_UPDATE_MODE, + PVE_NPC, + PVP_CARD_BATTLE, + PVE_ATTACKED, + PVE_LOGIC_UPDATE, + PVE_BOSS, // not actually ingame, making a prediction though that it's related to some boss stuff or replaced with varlist call. + SET_EXTRA_MODS, + ON_STEP_ON_TILE_MOD }; public enum NetMessages diff --git a/GrowbrewProxy/PacketSending.cs b/GrowbrewProxy/PacketSending.cs index f762f33..2a055c8 100644 --- a/GrowbrewProxy/PacketSending.cs +++ b/GrowbrewProxy/PacketSending.cs @@ -23,7 +23,11 @@ public void SendData(byte[] data, ENetPeer peer, ENetPacketFlags flag = ENetPack } public void SendPacketRaw(int type, byte[] data, ENetPeer peer, ENetPacketFlags flag = ENetPacketFlags.Reliable) - { + { + if (peer == null) return; + if (peer.IsNull) return; + if (peer.State != ENetPeerState.Connected) return; + byte[] packetData = new byte[data.Length + 5]; Array.Copy(BitConverter.GetBytes(type), packetData, 4); Array.Copy(data, 0, packetData, 4, data.Length); diff --git a/GrowbrewProxy/PriceChecker.cs b/GrowbrewProxy/PriceChecker.cs new file mode 100644 index 0000000..46cdde4 --- /dev/null +++ b/GrowbrewProxy/PriceChecker.cs @@ -0,0 +1,152 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Text; +using System.Threading.Tasks; + +namespace GrowbrewProxy +{ + class PriceChecker + { + public const int SUPPORTED_COLUMNS = 3; // Increase this if there are more values available in the future. + public struct ItemPrice + { + public string name { get; set; } + public int quantity { get; set; } + public int price { get; set; } + + public ItemPrice(string name, int quantity, int price) + { + this.name = name; + this.quantity = quantity; + this.price = price; + } + } + + public class ItemPriceList + { + public List itemPrices = new List(); + + public string Serialize() + { + StringBuilder sb = new StringBuilder(); + sb.AppendLine(GetCount().ToString()); + + foreach (ItemPrice iprice in itemPrices) + { + sb.AppendJoin('|', iprice.name, iprice.quantity, iprice.price); + sb.AppendLine(); + } + + return sb.ToString(); + } + + public static ItemPriceList Deserialize(string rawText) + { + ItemPriceList iPriceList = new ItemPriceList(); + if (rawText != "") + { + + string[] lines = rawText.Split("\n"); + + if (lines.Length > 0) + { + int count = 0; + if (!int.TryParse(lines[0], out count)) + throw new Exception("Unable to serialize due to failure of retrieving available item count"); + + foreach (string line in lines) + { + string[] values = line.Split('|'); + + if (values.Length == SUPPORTED_COLUMNS) + iPriceList.Add(new ItemPrice(values[0], int.Parse(values[1]), int.Parse(values[2]))); + } + } + } + + return iPriceList; + } + + public ItemPrice[] FindByName(string name, bool exact = false) + { + List iprices = new List(); + foreach (ItemPrice iprice in itemPrices) + { + bool needAdd = exact ? name == iprice.name : iprice.name.StartsWith(name); + if (needAdd) + { + iprices.Add(iprice); + if (exact) break; // optimize + } + } + return iprices.ToArray(); + } + + public ItemPrice[] FindByNameIgnoreCase(string name, bool exact = false) + { + List iprices = new List(); + + string pNameLower = name.ToLower(); + foreach (ItemPrice iprice in itemPrices) + { + bool needAdd = exact ? name == iprice.name : iprice.name.StartsWith(name); + if (needAdd) + { + iprices.Add(iprice); + if (exact) break; // optimize + } + } + return iprices.ToArray(); + } + + public int GetCount() => itemPrices.Count; + public void Add(ItemPrice item) => itemPrices.Add(item); + + public bool Remove(ItemPrice item) => itemPrices.Remove(item); + } + + public static ItemPriceList iPriceList = null; // cache + + public static string RefreshPrices(string url) // Refresh only when it's needed, it's wasteful or laggy to do it everytime, so items are cached. + { + string content = ""; + using (var wc = new WebClient()) + { + try + { + content = wc.DownloadString(url); + } + catch (WebException) + { + return content; + // if its a different exception it should rather crash for the developer to debug it + } + } + return content; + } + + public static void SetHTTPS() + { + System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; + } + + public static ItemPriceList GetItemPriceListFromUrl(string url) // retrieves the full item price list + { + if (iPriceList == null) // Not in cache? Rebuild then, user has to do it's own implementation to choose when to refresh items, perhaps just a resync button? + { + string raw = RefreshPrices(url); + iPriceList = ItemPriceList.Deserialize(raw); + return iPriceList; + } + else if (iPriceList.GetCount() > 0) // the count shall not be zero either, however iPriceList wasn't null which it should so it's gonna throw an error. + { + return iPriceList; // return immediately. + } + + throw new Exception($"GetItemPriceListFromUrl({url}) failed for an unknown reason."); + } + } +} diff --git a/GrowbrewProxy/WorldAndPlayer.cs b/GrowbrewProxy/WorldAndPlayer.cs index 9408e1f..b0d13cc 100644 --- a/GrowbrewProxy/WorldAndPlayer.cs +++ b/GrowbrewProxy/WorldAndPlayer.cs @@ -493,7 +493,10 @@ private int Tile_Serialize(byte[] dataPassed, int loc) { try { - if (readPos >= dataPassed.Length) return -1; + if (readPos >= dataPassed.Length) { + MainForm.LogText += ("[" + DateTime.UtcNow + "] (PROXY): [" + currentWorld + "] readPos bigger than dataPassed.Length error during world serialization!\n"); + return -1; + } ushort fg = BitConverter.ToUInt16(dataPassed, readPos); readPos += 2; // sizeof short tiles[loc].fg = fg; ushort bg = BitConverter.ToUInt16(dataPassed, readPos); readPos += 2; @@ -571,7 +574,7 @@ public World LoadMap(byte[] packet) ResetAndInit(); // just incase, may be removed when disposing or in here, ill keep it like that tho. byte[] data = VariantList.get_extended_data(packet); // agh, maybe puublically declare and use then like that but too late, too lazy to refactor now. if (data.Length < 8192) return this; - if (data.Length > 200000) return this; // 200kb too big not gonna do that... + if (data.Length > 200000) return this; // 300kb too big not gonna do that... readPos += 6; short pLen = BitConverter.ToInt16(data, readPos); readPos += sizeof(short); // 2 @@ -597,7 +600,11 @@ public World LoadMap(byte[] packet) if (Tile_Serialize(data, i) != 0) break; } MainForm.LogText += ("[" + DateTime.UtcNow + "] (PROXY): [" + currentWorld + "]" + " Tiles properly serialized (without any errors): " + tilesProperlySerialized.ToString() + "\n"); - if (readPos >= data.Length) return this; + if (readPos >= data.Length) + { + MainForm.LogText += ("[" + DateTime.UtcNow + "] (PROXY): [" + currentWorld + "] readPos error during world serialization!\n"); + return this; + } //weather n dropped items: droppedItems.Clear(); dropped_ITEMUID = BitConverter.ToInt32(data, readPos); readPos += sizeof(int);