package aRegCommi; import java.io.FileInputStream; import java.io.IOException; import java.net.URL; import java.util.Arrays; import java.util.Scanner; import java.util.concurrent.atomic.AtomicBoolean; import org.jdom2.Document; import org.jdom2.JDOMException; import org.jdom2.input.SAXBuilder; import packets.Packets; import packets.RWable; import packets.server.NAMERESULT_Packet; import packets.server.PING_Packet; import util.SCry; import util.XMLAccount; import client.GameClientX; import client.info.GameConsts; public class ARegCommi { static { GameClientX.dontPrint = Arrays.asList(new Integer[] { Packets.MOVE, Packets.ALLYSHOOT, Packets.MOVE, Packets.UPDATE, Packets.UPDATEACK, Packets.NEW_TICK, Packets.PING, Packets.PONG, Packets.SHOOT, Packets.SHOOTACK, Packets.SHOOTMULTI, Packets.SHOW_EFFECT, Packets.NOTIFICATION, Packets.TEXT, Packets.GOTO, Packets.GOTOACK, Packets.PLAYSOUND, Packets.ACCOUNTLIST, Packets.INVRESULT, Packets.INVSWAP, Packets.TELEPORT, Packets.CREATE_SUCCESS, Packets.MAPINFO, Packets.HELLO, Packets.CREATE, Packets.CHOOSENAME, Packets.NAMERESULT }); } public static void main(String[] args) throws JDOMException, IOException { Scanner s = new Scanner(new FileInputStream("commiIn.txt")); System.out.println("Generating accounts."); while (s.hasNextLine()) { String l = s.nextLine(); String user = l.split("'")[1]; String pass = l.split("'")[3]; final String ign = user.split("@")[0]; final Object LOCK = new Object(); System.out.print(user + " " + pass + " " + ign + " - "); final AtomicBoolean ab = new AtomicBoolean(); URL u = new URL("https://realmofthemadgod.appspot.com/account/register?guid=" + SCry.createGuestGUID() + "&newGUID=" + user + "&newPassword=" + pass); SAXBuilder builder = new SAXBuilder(); Document doc = builder.build(u); if (doc.getRootElement().getName().equals("Success")) { System.out.print("Ok - "); } else { System.out.println(doc.getRootElement().getName() + " - " + doc.getRootElement().getText() + "."); continue; } try { GameClientX gcx = new GameClientX() { @Override public void doSocketLoop(RWable rw) throws IOException { super.doSocketLoop(rw); if (world != null && world.getUs() != null && world.getUs().objStatData != null && world.getUs().objStatData.getStatData(56) != null && world.getUs().objStatData.getStatData(56).numValue != 0) { this.disconnect(); // ok ab.set(true); System.out.println("Name ok."); synchronized(LOCK) { LOCK.notifyAll(); } } if (rw instanceof NAMERESULT_Packet) { this.disconnect(); // likely ok ab.set(true); System.out.println(rw.toString()); synchronized(LOCK) { LOCK.notifyAll(); } } else if (rw instanceof PING_Packet) { PING_Packet pp = (PING_Packet) rw; ab.set(false); System.out.println("FAIL, took too long."); if (pp.serial_ > 20) { this.disconnect(); // failed synchronized(LOCK) { LOCK.notifyAll(); } } } } }; gcx.connect("USEast2"); gcx.useAuthentication(user, pass); gcx.nameToChoose = ign; gcx.hello(GameConsts.Modes.VAULT); gcx.newChar(GameConsts.Characters.WIZARD); synchronized(LOCK) { LOCK.wait(); } } catch (Exception e) { // failed e.printStackTrace(); } XMLAccount xmla = new XMLAccount(user, pass); if (xmla.hasChosenName()) { System.out.println("All good."); } else { System.out.println("Name fail."); } } } }