diff options
Diffstat (limited to 'src/main/java/gq/malwarefight/tokenapp/Main.java')
-rw-r--r-- | src/main/java/gq/malwarefight/tokenapp/Main.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/main/java/gq/malwarefight/tokenapp/Main.java b/src/main/java/gq/malwarefight/tokenapp/Main.java index 750ae83..66afad1 100644 --- a/src/main/java/gq/malwarefight/tokenapp/Main.java +++ b/src/main/java/gq/malwarefight/tokenapp/Main.java @@ -15,7 +15,7 @@ import java.util.UUID; public class Main { public static final int BASE_PORT = 47777; - public static volatile boolean running = true; + public static long ID; public static YggdrasilMinecraftSessionService sessionService = null; public static YggdrasilAuthenticationService authenticationService = null; public static GameProfile gameProfile = null; @@ -40,6 +40,7 @@ public class Main { } public static void main(String[] args) { + ID = Long.parseLong(args[0]); try { setup(); } catch (Exception e) { @@ -49,25 +50,22 @@ public class Main { ServerSocket sock = null; for (int i = BASE_PORT; i < BASE_PORT + 10; i++) { try { - System.out.println(i); //noinspection resource sock = new ServerSocket(i, 50, InetAddress.getLoopbackAddress()); - System.out.println(i); break; - } catch (Exception ignored) { - } + } catch (Exception ignored) {} } if (sock == null) { System.err.println("Could not bind to any valid port"); System.exit(1); } - while (running) { + while (true) { try { Socket connection = sock.accept(); Thread t = new SocketThread(connection); t.start(); } catch (IOException ignored) { - running = false; + System.exit(0); } } } |