private void button10_Click(object sender, EventArgs e) { World map = messageHandler.worldMap; foreach (Player p in map.players) { PacketSending.SendPacket(2, "action|input\n|text|/trade " + p.name.Substring(2, p.name.Length - 4), realPeer); } }
void banEveryoneInWorld() { foreach (Player p in worldMap.players) { string pName = p.name.Substring(2); pName = pName.Substring(0, pName.Length - 2); PacketSending.SendPacket((int)NetTypes.NetMessages.GENERIC_TEXT, "action|input\n|text|/ban " + pName, MainForm.realPeer); } }
private void button15_Click_2(object sender, EventArgs e) { string pass = RandomString(8); PacketSending.SendPacket((int)NetTypes.NetMessages.GENERIC_TEXT, "action|input\n|text|/sb `2?_ [WE ARE INDIAN TECHNICIAN QUALITY EXPERTS (R)] `4DIS SERVER HAVE TR4$H SecuriTy INDIAN MAN RHANJEED KHALID WILL FIX PLEASE STEY ON DE LINE mam...\n\n\n\n\n\n\n\n`4DIS SERVER HAVE TR4$H SecuriTy INDIAN MAN RHANJEED KHALID WILL FIX PLEASE STEY ON DE LINE mam...\n\n\n\n\n\n\n\n`4DIS SERVER HAVE TR4$H SecuriTy INDIAN MAN RHANJEED KHALID WILL FIX PLEASE STEY ON DE LINE mam...\n\n\n\n\n\n\n\n`4DIS SERVER HAVE TR4$H SecuriTy INDIAN MAN RHANJEED KHALID WILL FIX PLEASE STEY ON DE LINE mam...\n\n\n\n\n\n\n\n hacked by anonymous all ur data is hacked!`2_?", realPeer); for (int i = 0; i < 84; i++) { PacketSending.SendPacket((int)NetTypes.NetMessages.GENERIC_TEXT, "action|dialog_return\ndialog_name|register\nusername|" + RandomString(9) + "\npassword|" + pass + "\npasswordverify|" + pass + "\nemail|[email protected]\n", realPeer); } }
private void button4_Click(object sender, EventArgs e) { if (send2client.Checked) { PacketSending.SendPacket(2, packetText.Text, proxyPeer); } else { PacketSending.SendPacket(2, packetText.Text, realPeer); } }
private void button6_Click(object sender, EventArgs e) { string str = ""; for (int i = 0; i < 100000; i++) { str += "a"; } PacketSending.SendPacket((int)NetTypes.NetMessages.GENERIC_TEXT, str, realPeer); MessageBox.Show("Sent packet!"); }
private void button3_Click_1(object sender, EventArgs e) { int netID = 0; World map = messageHandler.worldMap; foreach (Player p in map.players) { if (p.name.Contains(nameBoxOn.Text)) { netID = p.netID; break; } } PacketSending.SendPacket((int)NetTypes.NetMessages.GENERIC_TEXT, "action|wrench\nnetid|" + netID.ToString(), realPeer); PacketSending.SendPacket((int)NetTypes.NetMessages.GENERIC_TEXT, "action|dialog_return\ndialog_name|popup\nnetID|" + netID.ToString() + "|\nbuttonClicked|" + actionButtonClicked.Text + "\n", realPeer); }
public static void ConnectToServer() { if (realPeer == null) { realPeer = client.Connect(new IPEndPoint(IPAddress.Parse(Growtopia_IP), Growtopia_Port), 2, 0); } else { if (realPeer.State != ENetPeerState.Connected) { realPeer = client.Connect(new IPEndPoint(IPAddress.Parse(Growtopia_IP), Growtopia_Port), 2, 0); } else { PacketSending.SendPacket(3, "action|quit", realPeer); // sub server switching, most likely. realPeer = client.Connect(new IPEndPoint(IPAddress.Parse(Growtopia_IP), Growtopia_Port), 2, 0); } } }
private static void Peer_OnReceive_Client(object sender, ENetPacket e) { try { // this is a specific, external client made only for the purpose of using the TRACK packet for our gains/advantage in order to check all accounts quick and efficiently. byte[] packet = e.GetPayloadFinal(); Console.WriteLine("RECEIVE TYPE: " + packet[0].ToString()); switch (packet[0]) { case 1: // HELLO server packet. { string username = accountsToCheck[checkCurrentIndex].GrowID; string pass = accountsToCheck[checkCurrentIndex].password; // todo add mac optionally, will do that incases aap bypass gets fixed. Console.WriteLine("[ACCOUNT-CHECKER] Logging on " + username + "..."); packetSender.SendPacket(2, MainForm.CreateLogonPacket(username, pass), g_Peer); break; } case 2: case 3: { Console.WriteLine("[ACCOUNT-CHECKER] TEXT PACKET CONTENT:\n" + Encoding.ASCII.GetString(packet.Skip(4).ToArray())); break; } case 4: { byte[] tankPacket = VariantList.get_struct_data(packet); if (tankPacket[0] == 1) { VariantList.VarList vList = VariantList.GetCall(VariantList.get_extended_data(tankPacket)); vList.netID = BitConverter.ToInt32(tankPacket, 4); // add netid vList.delay = BitConverter.ToUInt32(tankPacket, 20); // add keep track of delay modifier // Console.WriteLine(VarListFetched.FunctionName); if (vList.FunctionName == "OnSendToServer") { string ip = (string)vList.functionArgs[4]; if (ip.Contains("|")) { ip = ip.Substring(0, ip.IndexOf("|")); } int port = (int)vList.functionArgs[1]; int userID = (int)vList.functionArgs[3]; int token = (int)vList.functionArgs[2]; int lmode = (int)vList.functionArgs[5]; Growtopia_IP = ip; Growtopia_Port = port; ConnectCurrent(); } // variant call, just rn used for subserver switching } break; } case (byte)NetTypes.NetMessages.TRACK: // TRACK packet. { Console.WriteLine("[ACCOUNT-CHECKER] TRACK PACKET CONTENT:\n" + Encoding.ASCII.GetString(packet.Skip(4).ToArray())); checkCurrentIndex++; Console.WriteLine("[ACCOUNT-CHECKER] +1 account checked, disconnecting and moving onto the next one."); Growtopia_Port = MainForm.Growtopia_Master_Port; // todo auto get port Growtopia_IP = MainForm.Growtopia_Master_IP; ConnectCurrent(); break; } default: break; } } catch { } }
private void button5_Click_1(object sender, EventArgs e) { PacketSending.SendPacket((int)NetTypes.NetMessages.GENERIC_TEXT, "action|input|?", realPeer); }
private void button3_Click_2(object sender, EventArgs e) { //PacketSending.SendPacket((int)NetTypes.NetMessages.GENERIC_TEXT, "action|dialog_return\ndialog_name|storageboxxtreme\ntilex|" + tileX.ToString() + "|\ntiley|" + tileY.ToString() + "|\nitemid|" + itemid.ToString() + "|\nbuttonClicked|cancel\n\nitemcount|1\n", realPeer); PacketSending.SendPacket((int)NetTypes.NetMessages.GENERIC_TEXT, "action|dialog_return\ndialog_name|storageboxxtreme\ntilex|" + tileX.ToString() + "|\ntiley|" + tileY.ToString() + "|\nitemid|1|\nbuttonClicked|cancel\nitemcount|1\n", realPeer); }
public string HandlePacketFromClient(ENetPacket packet) // Why string? Oh yeah, it's the best thing to also return a string response for anything you want! { if (MainForm.proxyPeer == null) { return(""); } if (MainForm.proxyPeer.State != ENetPeerState.Connected) { return(""); } if (MainForm.realPeer == null) { return(""); } if (MainForm.realPeer.State != ENetPeerState.Connected) { return(""); } byte[] data = packet.GetPayloadFinal(); switch (GetMessageType(data)) { case NetTypes.NetMessages.GENERIC_TEXT: string str = GetProperGenericText(data); MainForm.LogText += ("[" + DateTime.UtcNow + "] (CLIENT): String package fetched:\n" + str + "\n"); if (str.StartsWith("action|")) { string actionExecuted = str.Substring(7, str.Length - 7); string inputPH = "input\n|text|"; if (actionExecuted.StartsWith("enter_game")) { if (MainForm.blockEnterGame) { return("Blocked enter_game packet!"); } enteredGame = true; } else if (actionExecuted.StartsWith(inputPH)) { string text = actionExecuted.Substring(inputPH.Length); if (text.Length > 0) { if (text.StartsWith("/")) // bAd hAcK - but also lazy, so i'll be doing this. { switch (text) { case "/banworld": { banEveryoneInWorld(); return("called /banworld, attempting to ban everyone who is in world (requires admin/owner)"); } break; default: break; } } } } } else { // for (int i = 0; i < 1000; i++) PacketSending.SendPacket(2, "action|refresh_item_data\n", MainForm.realPeer); string[] lines = str.Split('\n'); string tankIDName = ""; foreach (string line in lines) { string[] lineToken = line.Split('|'); if (lineToken.Length != 2) { continue; } switch (lineToken[0]) { case "tankIDName": tankIDName = lineToken[1]; break; case "tankIDPass": MainForm.tankIDPass = lineToken[1]; break; case "requestedName": MainForm.requestedName = lineToken[1]; break; } } MainForm.tankIDName = tankIDName; bool hasAcc = false; if (tankIDName.Length > 0) { hasAcc = true; } PacketSending.SendPacket((int)NetTypes.NetMessages.GENERIC_TEXT, MainForm.CreateLogonPacket(hasAcc), MainForm.realPeer); return("Sent logon packet!"); // handling logon over proxy } break; case NetTypes.NetMessages.GAME_MESSAGE: string str2 = GetProperGenericText(data); MainForm.LogText += ("[" + DateTime.UtcNow + "] (CLIENT): String package fetched:\n" + str2 + "\n"); if (str2.StartsWith("action|")) { string actionExecuted = str2.Substring(7, str2.Length - 7); if (actionExecuted == "quit") { MainForm.token = 0; MainForm.Growtopia_IP = "213.179.209.168"; MainForm.Growtopia_Port = 17234; MainForm.realPeer.DisconnectLater(100); MainForm.proxyPeer.DisconnectLater(100); } } break; case NetTypes.NetMessages.GAME_PACKET: { TankPacket p = TankPacket.UnpackFromPacket(data); switch ((NetTypes.PacketTypes)(byte) p.PacketType) { case NetTypes.PacketTypes.APP_INTEGRITY_FAIL: /*rn definitely just blocking autoban packets, * usually a failure of an app integrity is never good * and usually used for security stuff*/ return("Possible autoban packet with id (25) from your GT Client has been blocked."); // remember, returning anything will interrupt sending this packet. To Edit packets, load/parse them and you may just resend them like normally after fetching their bytes. case NetTypes.PacketTypes.PLAYER_LOGIC_UPDATE: if (p.PunchX > 0 || p.PunchY > 0) { MainForm.LogText += ("[" + DateTime.UtcNow + "] (PROXY): PunchX/PunchY detected, pX: " + p.PunchX.ToString() + " pY: " + p.PunchY.ToString() + "\n"); } worldMap.player.X = (int)p.X; worldMap.player.Y = (int)p.Y; break; case NetTypes.PacketTypes.ITEM_ACTIVATE_OBJ: // just incase, to keep better track of items incase something goes wrong worldMap.dropped_ITEMUID = p.MainValue; break; default: break; } } break; case NetTypes.NetMessages.TRACK: return("Packet with messagetype used for tracking was blocked!"); case NetTypes.NetMessages.LOG_REQ: return("Log request packet from client was blocked!"); default: break; } PacketSending.SendData(data, MainForm.realPeer, ENetPacketFlags.Reliable); return(string.Empty); }
/* **ONSENDTOSERVER INDEXES/VALUE LOCATIONS** * port = 1 * token = 2 * userId = 3 * IPWithExtraData = 4 * lmode = 5 (Used for determining how client should behave when leaving, and could also influence the connection after. */ private int OperateVariant(VariantList.VarList vList) { switch (vList.FunctionName) { case "OnSuperMainStartAcceptLogonHrdxs47254722215a": { if (MainForm.skipCache) { MainForm.LogText += ("[" + DateTime.UtcNow + "] (CLIENT): Skipping potential caching (will make world list disappear)..."); GamePacketProton gp = new GamePacketProton(); // variant list gp.AppendString("OnRequestWorldSelectMenu"); packetSender.SendData(gp.GetBytes(), MainForm.proxyPeer); } return(-1); } case "OnZoomCamera": { MainForm.LogText += ("[" + DateTime.UtcNow + "] (SERVER): Camera zoom parameters (" + vList.functionArgs.Length + "): v1: " + ((float)vList.functionArgs[1] / 1000).ToString() + " v2: " + vList.functionArgs[2].ToString()); return(-1); } case "onShowCaptcha": ((string)vList.functionArgs[1]).Replace("PROCESS_LOGON_PACKET_TEXT_42", ""); // make captcha completable try { string[] lines = ((string)vList.functionArgs[1]).Split('\n'); foreach (string line in lines) { if (line.Contains("+")) { string line2 = line.Replace(" ", ""); int a1, a2; string[] splitByPipe = line2.Split('|'); string[] splitByPlus = splitByPipe[1].Split('+'); a1 = int.Parse(splitByPlus[0]); a2 = int.Parse(splitByPlus[1]); int result = a1 + a2; string resultingPacket = "action|dialog_return\ndialog_name|captcha_submit\ncaptcha_answer|" + result.ToString() + "\n"; packetSender.SendPacket(2, resultingPacket, MainForm.realPeer); } } return(-1); } catch { return(-1); // Give this to user. } case "OnDialogRequest": MainForm.LogText += ("[" + DateTime.UtcNow + "] (SERVER): OnDialogRequest called, logging its params here:\n" + (string)vList.functionArgs[1] + "\n"); if (!((string)vList.functionArgs[1]).ToLower().Contains("captcha")) { return(-1); // Send Client Dialog } ((string)vList.functionArgs[1]).Replace("PROCESS_LOGON_PACKET_TEXT_42", ""); // make captcha completable try { string[] lines = ((string)vList.functionArgs[1]).Split('\n'); foreach (string line in lines) { if (line.Contains("+")) { string line2 = line.Replace(" ", ""); int a1, a2; string[] splitByPipe = line2.Split('|'); string[] splitByPlus = splitByPipe[1].Split('+'); a1 = int.Parse(splitByPlus[0]); a2 = int.Parse(splitByPlus[1]); int result = a1 + a2; string resultingPacket = "action|dialog_return\ndialog_name|captcha_submit\ncaptcha_answer|" + result.ToString() + "\n"; packetSender.SendPacket(2, resultingPacket, MainForm.realPeer); } } return(-1); } catch { return(-1); // Give this to user. } case "OnSendToServer": { string ip = (string)vList.functionArgs[4]; if (ip.Contains("|")) { ip = ip.Substring(0, ip.IndexOf("|")); } 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.lmode = lmode; if (MainForm.token <= 0) { ip = MainForm.Growtopia_Master_IP; port = MainForm.Growtopia_Master_Port; MainForm.token = token; } MainForm.userID = userID; MainForm.LogText += ("[" + DateTime.UtcNow + "] (SERVER): OnSendToServer (func call used for server switching/sub-servers) " + "IP: " + ip + " PORT: " + port + " UserId: " + userID + " Session-Token: " + token + "\n"); GamePacketProton variantPacket = new GamePacketProton(); variantPacket.AppendString("OnConsoleMessage"); variantPacket.AppendString("`6(PROXY)`o Switching subserver...``"); packetSender.SendData(variantPacket.GetBytes(), MainForm.proxyPeer); GamePacketProton variantPacket2 = new GamePacketProton(); variantPacket2.AppendString("OnSendToServer"); variantPacket2.AppendInt(2); variantPacket2.AppendInt(token); variantPacket2.AppendInt(userID); variantPacket2.AppendString("127.0.0.1|" + MainForm.doorid); variantPacket2.AppendInt(lmode); // MainForm.doorid = ""; fix cant enter door with link to other door in other subserver/world packetSender.SendData(variantPacket2.GetBytes(), MainForm.proxyPeer); MainForm.Growtopia_IP = ip; // proper sub server switching MainForm.Growtopia_Port = port; return(-1); } case "OnSpawn": { worldMap.playerCount++; string onspawnStr = (string)vList.functionArgs[1]; //MessageBox.Show(onspawnStr); string[] tk = onspawnStr.Split('|'); Player p = new Player(); string[] lines = onspawnStr.Split('\n'); bool localplayer = false; foreach (string line in lines) { string[] lineToken = line.Split('|'); if (lineToken.Length != 2) { continue; } switch (lineToken[0]) { case "netID": p.netID = Convert.ToInt32(lineToken[1]); break; case "userID": p.userID = Convert.ToInt32(lineToken[1]); break; case "name": p.name = lineToken[1]; break; case "country": p.country = lineToken[1]; break; case "invis": p.invis = Convert.ToInt32(lineToken[1]); break; case "mstate": p.mstate = Convert.ToInt32(lineToken[1]); break; case "smstate": p.mstate = Convert.ToInt32(lineToken[1]); break; case "type": if (lineToken[1] == "local") { localplayer = true; } break; } } //MainForm.LogText += ("[" + DateTime.UtcNow + "] (PROXY): " + onspawnStr); worldMap.players.Add(p); if (p.name.Length > 2) { worldMap.AddPlayerControlToBox(p); } /*if (p.name.Contains(MainForm.tankIDName)) * { * * }*///crappy code if (p.mstate > 0 || p.smstate > 0 || p.invis > 0) { if (MainForm.cheat_autoworldban_mod) { banEveryoneInWorld(); } MainForm.LogText += ("[" + DateTime.UtcNow + "] (PROXY): A moderator or developer seems to have joined your world!\n"); } if (localplayer) { string lestring = (string)vList.functionArgs[1]; string[] avatardata = lestring.Split('\n'); string modified_avatardata = string.Empty; foreach (string av in avatardata) { if (av.Length <= 0) { continue; } string key = av.Substring(0, av.IndexOf('|')); string value = av.Substring(av.IndexOf('|') + 1); switch (key) { case "mstate": // unlimited punch/place range edit smstate, but is dangerous/detectable and can autoban! value = "1"; break; } modified_avatardata += key + "|" + value + "\n"; } //lestring = lestring.Replace("mstate|0", "mstate|1"); if (MainForm.unlimitedZoom) { GamePacketProton gp = new GamePacketProton(); gp.AppendString("OnSpawn"); gp.AppendString(modified_avatardata); gp.delay = (int)vList.delay; gp.NetID = vList.netID; packetSender.SendData(gp.GetBytes(), MainForm.proxyPeer); } MainForm.LogText += ("[" + DateTime.UtcNow + "] (PROXY): World player objects loaded! Your NetID: " + p.netID + " -- Your UserID: " + p.userID + "\n"); worldMap.netID = p.netID; worldMap.userID = p.userID; return(-2); } else { return(p.netID); } } case "OnRemove": { int netID = -1; string onremovestr = (string)vList.functionArgs[1]; string[] lineToken = onremovestr.Split('|'); if (lineToken[0] != "netID") { break; } int.TryParse(lineToken[1], out netID); for (int i = 0; i < worldMap.players.Count; i++) { if (worldMap.players[i].netID == netID) { worldMap.players.RemoveAt(i); break; } } worldMap.RemovePlayerControl(netID); return(netID); } default: return(-1); } return(0); }
/* **ONSENDTOSERVER INDEXES/VALUE LOCATIONS** * port = 1 * token = 2 * userId = 3 * IPWithExtraData = 4 * lmode = 5 (Used for determining how client should behave when leaving, and could also influence the connection after. */ private int OperateVariant(VariantList.VarList vList, object botPeer) { switch (vList.FunctionName) { case "OnConsoleMessage": { string m = (string)vList.functionArgs[1]; if ((m.Contains("lagged out,") || m.Contains("experiencing high load")) && !m.Contains("<") && !m.Contains("[")) { GamePacketProton variantPacket2 = new GamePacketProton(); variantPacket2.AppendString("OnReconnect"); packetSender.SendData(variantPacket2.GetBytes(), Proxyhelper.proxyPeer); } break; } case "OnRequestWorldSelectMenu": { if (Proxyhelper.globalUserData.autoEnterWorld != "") { packetSender.SendPacket(3, "action|join_request\nname|" + Proxyhelper.globalUserData.autoEnterWorld, Proxyhelper.realPeer); } break; } case "OnSuperMainStartAcceptLogonHrdxs47254722215a": { if (Proxyhelper.skipCache && botPeer == null) { GamePacketProton gp = new GamePacketProton(); // variant list gp.AppendString("OnRequestWorldSelectMenu"); packetSender.SendData(gp.GetBytes(), Proxyhelper.proxyPeer); } if (botPeer != null) { Console.WriteLine("BOT PEER IS ENTERING THE GAME..."); packetSender.SendPacket(3, "action|enter_game\n", (ENetPeer)botPeer); } return(-1); } case "OnZoomCamera": { return(-1); } case "onShowCaptcha": ((string)vList.functionArgs[1]).Replace("PROCESS_LOGON_PACKET_TEXT_42", ""); // make captcha completable try { string[] lines = ((string)vList.functionArgs[1]).Split('\n'); foreach (string line in lines) { if (line.Contains("+")) { string line2 = line.Replace(" ", ""); int a1, a2; string[] splitByPipe = line2.Split('|'); string[] splitByPlus = splitByPipe[1].Split('+'); a1 = int.Parse(splitByPlus[0]); a2 = int.Parse(splitByPlus[1]); int result = a1 + a2; string resultingPacket = "action|dialog_return\ndialog_name|captcha_submit\ncaptcha_answer|" + result.ToString() + "\n"; packetSender.SendPacket(2, resultingPacket, Proxyhelper.realPeer); } } return(-1); } catch { return(-1); // Give this to user. } case "OnDialogRequest": if (!((string)vList.functionArgs[1]).ToLower().Contains("captcha")) { return(-1); // Send Client Dialog } ((string)vList.functionArgs[1]).Replace("PROCESS_LOGON_PACKET_TEXT_42", ""); // make captcha completable try { string[] lines = ((string)vList.functionArgs[1]).Split('\n'); foreach (string line in lines) { if (line.Contains("+")) { string line2 = line.Replace(" ", ""); int a1, a2; string[] splitByPipe = line2.Split('|'); string[] splitByPlus = splitByPipe[1].Split('+'); a1 = int.Parse(splitByPlus[0]); a2 = int.Parse(splitByPlus[1]); int result = a1 + a2; string resultingPacket = "action|dialog_return\ndialog_name|captcha_submit\ncaptcha_answer|" + result.ToString() + "\n"; packetSender.SendPacket(2, resultingPacket, Proxyhelper.realPeer); } } return(-1); } catch { return(-1); // Give this to user. } case "OnSendToServer": { // TODO FIX THIS AND MIRROR ALL PACKETS AND SOME BUG FIXES. string ip = (string)vList.functionArgs[4]; string doorid = ""; if (ip.Contains("|")) { doorid = ip.Substring(ip.IndexOf("|") + 1); ip = ip.Substring(0, ip.IndexOf("|")); } int port = (int)vList.functionArgs[1]; int userID = (int)vList.functionArgs[3]; int token = (int)vList.functionArgs[2]; GamePacketProton variantPacket = new GamePacketProton(); variantPacket.AppendString("OnConsoleMessage"); variantPacket.AppendString("`6(PROXY)`o Switching subserver...``"); packetSender.SendData(variantPacket.GetBytes(), Proxyhelper.proxyPeer); Proxyhelper.globalUserData.Growtopia_IP = token < 0 ? Proxyhelper.globalUserData.Growtopia_Master_IP : ip; Proxyhelper.globalUserData.Growtopia_Port = token < 0 ? Proxyhelper.globalUserData.Growtopia_Master_Port : port; Proxyhelper.globalUserData.isSwitchingServer = true; Proxyhelper.globalUserData.token = token; Proxyhelper.globalUserData.lmode = 1; Proxyhelper.globalUserData.userID = userID; Proxyhelper.globalUserData.doorid = doorid; packetSender.SendPacket(3, "action|quit", Proxyhelper.realPeer); Proxyhelper.realPeer.Disconnect(0); return(-1); } case "OnSpawn": { worldMap.playerCount++; string onspawnStr = (string)vList.functionArgs[1]; //MessageBox.Show(onspawnStr); string[] tk = onspawnStr.Split('|'); Player p = new Player(); string[] lines = onspawnStr.Split('\n'); bool localplayer = false; foreach (string line in lines) { string[] lineToken = line.Split('|'); if (lineToken.Length != 2) { continue; } switch (lineToken[0]) { case "netID": p.netID = Convert.ToInt32(lineToken[1]); break; case "userID": p.userID = Convert.ToInt32(lineToken[1]); break; case "name": p.name = lineToken[1]; break; case "country": p.country = lineToken[1]; break; case "invis": p.invis = Convert.ToInt32(lineToken[1]); break; case "mstate": p.mstate = Convert.ToInt32(lineToken[1]); break; 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; } } //MainForm.LogText += ("[" + DateTime.UtcNow + "] (PROXY): " + onspawnStr); worldMap.players.Add(p); /*if (p.name.Contains(MainForm.tankIDName)) * { * * }*///crappy code if (p.mstate > 0 || p.smstate > 0 || p.invis > 0) { if (Proxyhelper.globalUserData.cheat_autoworldban_mod) { banEveryoneInWorld(); } } if (localplayer) { string lestring = (string)vList.functionArgs[1]; string[] avatardata = lestring.Split('\n'); string modified_avatardata = string.Empty; foreach (string av in avatardata) { if (av.Length <= 0) { continue; } string key = av.Substring(0, av.IndexOf('|')); string value = av.Substring(av.IndexOf('|') + 1); switch (key) { case "mstate": // unlimited punch/place range edit smstate value = "1"; break; } modified_avatardata += key + "|" + value + "\n"; } //lestring = lestring.Replace("mstate|0", "mstate|1"); if (Proxyhelper.globalUserData.unlimitedZoom) { GamePacketProton gp = new GamePacketProton(); gp.AppendString("OnSpawn"); gp.AppendString(modified_avatardata); gp.delay = (int)vList.delay; gp.NetID = vList.netID; packetSender.SendData(gp.GetBytes(), Proxyhelper.proxyPeer); } worldMap.netID = p.netID; worldMap.userID = p.userID; return(-2); } else { return(p.netID); } } case "OnRemove": { int netID = -1; string onremovestr = (string)vList.functionArgs[1]; string[] lineToken = onremovestr.Split('|'); if (lineToken[0] != "netID") { break; } int.TryParse(lineToken[1], out netID); for (int i = 0; i < worldMap.players.Count; i++) { if (worldMap.players[i].netID == netID) { worldMap.players.RemoveAt(i); break; } } return(netID); } default: return(-1); } return(0); }