public static Portal getPortalByID(int id) { IEnumerator enumerator; try { enumerator = curPortals.GetEnumerator(); while (enumerator.MoveNext()) { Portal current = (Portal)enumerator.Current; if (current.getID() == id) { return(current); } } } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } return(null); }
public static void setAllPortals(ArrayList portals) { IEnumerator enumerator; removeAllPortals(); try { enumerator = portals.GetEnumerator(); while (enumerator.MoveNext()) { Portal current = (Portal)enumerator.Current; curPortals.Add(current); initConnection.sendPacket("0|p|" + Conversions.ToString(current.getID()) + "|1|0|" + Conversions.ToString(current.getPosX()) + "|" + Conversions.ToString(current.getPosY())); } } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } }
public static void packetHandler(string packet) { string[] strArray = packet.Split(new char[] { '|' }); if (strArray[0] == "LOGIN") { setupClientWindow(); setupHero(Module1.mainDir + "hero.dll"); setupMoreClient(); } if (strArray[0] == "SEL") { mainFunctions.log("Selected ship: " + strArray[1]); DOShip expression = mainFunctions.getShipByID(Conversions.ToInteger(strArray[1])); if (Information.IsNothing(expression)) { NPCShip ship2 = mainFunctions.getNPCByID(Conversions.ToInteger(strArray[1])); sendPacket("0|N|" + Conversions.ToString(ship2.getUserID()) + "|" + Conversions.ToString(ship2.getShipType()) + "|" + Conversions.ToString(ship2.getHP()) + "|" + Conversions.ToString(ship2.getMaxHP()) + "|" + Conversions.ToString(ship2.getSHD()) + "|" + Conversions.ToString(ship2.getMaxSHD()) + "|0"); } else { sendPacket("0|N|" + Conversions.ToString(expression.getUserID()) + "|" + Conversions.ToString(expression.getShipType()) + "|" + Conversions.ToString(expression.getHP()) + "|" + Conversions.ToString(expression.getMaxHP()) + "|" + Conversions.ToString(expression.getSHD()) + "|" + Conversions.ToString(expression.getMaxSHD()) + "|" + Conversions.ToString(expression.getCloaked())); } } if (strArray[0] == "a") { mainFunctions.log("Attacking ship: " + strArray[1]); if (Information.IsNothing(mainFunctions.getShipByID(Conversions.ToInteger(strArray[1])))) { NPCShip ship4 = mainFunctions.getNPCByID(Conversions.ToInteger(strArray[1])); Attack_Module.attackingNPC(Conversions.ToInteger(strArray[1])); } Module1.mainHero.setLaserAttacking(true); } if (strArray[0] == "1") { Module1.mainHero.setPosX(Conversions.ToInteger(strArray[1])); Module1.mainHero.setPosY(Conversions.ToInteger(strArray[2])); } if (strArray[0] == "u") { Module1.mainHero.setAmmoType(Conversions.ToInteger(strArray[1])); mainFunctions.log("Hero's ammo is now: " + Conversions.ToString(Module1.mainHero.getAmmoType())); } if (strArray[0] == "G") { Module1.mainHero.setLaserAttacking(false); } if (strArray[0] == "S") { if (strArray[1] == "SMB") { if (sbombCooldown) { mainFunctions.log("wait... sbmb cooling..."); return; } sendPacket("0|n|SMB|" + Conversions.ToString(Module1.mainHero.getID())); Mine_Module.heroSbombd(Module1.mainHero.getPosX(), Module1.mainHero.getPosY()); mainFunctions.log("Hero set off Sbomb..."); } else if (strArray[1] == "ISH") { if (instaCooldown) { mainFunctions.log("Wait... Insta cooling..."); return; } sendPacket("0|n|ISH|" + Conversions.ToString(Module1.mainHero.getID())); if (heroInsta) { return; } new Thread(new ThreadStart(Mine_Module.heroInstad)).Start(); mainFunctions.log("Hero set off Insta Shield..."); } else if (strArray[1] == "EMP") { if (empCooldown) { mainFunctions.log("Wait... EMP cooling..."); return; } sendPacket("0|n|EMP|" + Conversions.ToString(Module1.mainHero.getID())); if (heroEMP) { return; } new Thread(new ThreadStart(Mine_Module.heroEMPd)).Start(); mainFunctions.log("Hero set off EMP..."); } } if (strArray[0] == "d") { Module1.mainHero.setRocketType(Conversions.ToInteger(strArray[1])); mainFunctions.log("Hero's rocket ammo is now: " + strArray[1]); } if (strArray[0] == "l") { } if (strArray[0] == "j") { Portal portal = Portal_Module.getCurPortal(Module1.mainHero.getPosX(), Module1.mainHero.getPosY()); if (!Information.IsNothing(portal)) { heroJumping = true; sendPacket("0|U|99|" + Conversions.ToString(portal.getID())); mainFunctions.log("Sent jumping thingy..."); Thread.Sleep(0xbb8); mainFunctions.log("Jump should be done now..."); Module1.mainHero.setMapID(Portal_Module.getNewMap(portal.getID())); Vector vector = Portal_Module.getHeroPos(portal.getID()); Module1.mainHero.setPosX((int)Math.Round(vector.x)); Module1.mainHero.setPosY((int)Math.Round(vector.y)); string text = "0|I|" + Conversions.ToString(Module1.mainHero.getID()) + "|" + Module1.mainHero.getUsername() + "|" + Conversions.ToString(Module1.mainHero.getShipID()) + "|" + Conversions.ToString(Module1.mainHero.getSpeed()) + "|" + Conversions.ToString(Module1.mainHero.getShield()) + "|" + Conversions.ToString(Module1.mainHero.getMaxShield()) + "|" + Conversions.ToString(Module1.mainHero.getHP()) + "|" + Conversions.ToString(Module1.mainHero.getMaxHP()) + "|" + Conversions.ToString(Module1.mainHero.getCargo()) + "|" + Conversions.ToString(Module1.mainHero.getMaxCargo()) + "|" + Conversions.ToString(Module1.mainHero.getPosX()) + "|" + Conversions.ToString(Module1.mainHero.getPosY()) + "|" + Conversions.ToString(Module1.mainHero.getMapID()) + "|" + Conversions.ToString(Module1.mainHero.getCompany()) + "|" + Conversions.ToString(Module1.mainHero.getClanID()) + "|" + Conversions.ToString(Module1.mainHero.getMaxLaserAmmo()) + "|" + Conversions.ToString(Module1.mainHero.getMaxRocketAmmo()) + "|" + Conversions.ToString(Module1.mainHero.getExpansionID()) + "|" + Conversions.ToString(Convert.ToInt32(Module1.mainHero.getPremium())) + "|" + Conversions.ToString(Module1.mainHero.getExperience()) + "|" + Conversions.ToString(Module1.mainHero.getHonor()) + "|" + Conversions.ToString(Module1.mainHero.getLevel()) + "|" + Conversions.ToString(Module1.mainHero.getCredits()) + "|" + Conversions.ToString(Module1.mainHero.getUridium()) + "|" + Conversions.ToString(Module1.mainHero.getJackpot()) + "|" + Conversions.ToString(Module1.mainHero.getAdmin()) + "|" + Module1.mainHero.getClan() + "|" + Conversions.ToString(Module1.mainHero.getGalaxyGatesDone()) + "|" + Conversions.ToString(Convert.ToInt32(Module1.mainHero.getCloaked())) + "|0"; MyProject.Computer.FileSystem.WriteAllText(@"C:\DO_Hacks\hero.dll", text, false); string str = Conversions.ToString(Module1.mainHero.getLaserAmmo1()) + "|" + Conversions.ToString(Module1.mainHero.getLaserAmmo2()) + "|" + Conversions.ToString(Module1.mainHero.getLaserAmmo3()) + "|" + Conversions.ToString(Module1.mainHero.getLaserAmmo4()) + "|" + Conversions.ToString(Module1.mainHero.getLaserAmmo5()) + "|" + Conversions.ToString(Module1.mainHero.getLaserAmmo6()); MyProject.Computer.FileSystem.WriteAllText(@"C:\DO_Hacks\hero_laserammo.dll", str, false); string str2 = Conversions.ToString(Module1.mainHero.getRocketAmmo1()) + "|" + Conversions.ToString(Module1.mainHero.getRocketAmmo2()) + "|" + Conversions.ToString(Module1.mainHero.getRocketAmmo3()) + "|" + Conversions.ToString(Module1.mainHero.getRocketAmmo4()) + "|" + Conversions.ToString(Module1.mainHero.getRocketAmmo5()) + "|0|0|" + Conversions.ToString(Module1.mainHero.getRocketAmmo6()) + "|" + Conversions.ToString(Module1.mainHero.getRocketAmmo7()) + "|" + Conversions.ToString(Module1.mainHero.getRocketAmmo8()) + "|" + Conversions.ToString(Module1.mainHero.getRocketAmmo9()) + "|0|0|0"; MyProject.Computer.FileSystem.WriteAllText(@"C:\DO_Hacks\hero_rocketammo.dll", str2, false); mainFunctions.log("Saved Hero..."); setupHero(Module1.mainDir + "hero.dll"); setupMoreClient(); heroJumping = false; } else { mainFunctions.log("not close enough to portal..."); } } }