diff options
author | PandaNinjas <admin@malwarefight.gq> | 2023-02-09 19:33:00 -0800 |
---|---|---|
committer | PandaNinjas <admin@malwarefight.gq> | 2023-02-09 19:33:00 -0800 |
commit | ca54d9316d01040823815462f65f810c91143c04 (patch) | |
tree | 5f51658e7b36527b30ec422fe3822bd7940b95c2 /src/main/java/gq/malwarefight/tokenapp/Main.java | |
parent | 661d40251d6f8f98497aa61f5ea2e3c67f8e9190 (diff) | |
download | NoSession-ca54d9316d01040823815462f65f810c91143c04.tar.gz NoSession-ca54d9316d01040823815462f65f810c91143c04.tar.bz2 NoSession-ca54d9316d01040823815462f65f810c91143c04.zip |
Google code style but with 4 spaces instead of 2
Diffstat (limited to 'src/main/java/gq/malwarefight/tokenapp/Main.java')
-rw-r--r-- | src/main/java/gq/malwarefight/tokenapp/Main.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main/java/gq/malwarefight/tokenapp/Main.java b/src/main/java/gq/malwarefight/tokenapp/Main.java index ecea1f3..96b9cb3 100644 --- a/src/main/java/gq/malwarefight/tokenapp/Main.java +++ b/src/main/java/gq/malwarefight/tokenapp/Main.java @@ -14,6 +14,7 @@ import java.net.*; import java.util.UUID; public class Main { + public static final int BASE_PORT = 47777; public static YggdrasilMinecraftSessionService sessionService = null; public static YggdrasilAuthenticationService authenticationService = null; @@ -21,18 +22,17 @@ public class Main { public static void setup() throws IOException { String token = Utils.readString(System.in, '\n'); - System.out.println(token); - YggdrasilAuthenticationService yas = new YggdrasilAuthenticationService(Proxy.NO_PROXY, token); + YggdrasilAuthenticationService yas = new YggdrasilAuthenticationService(Proxy.NO_PROXY, + token); authenticationService = yas; sessionService = (YggdrasilMinecraftSessionService) yas.createMinecraftSessionService(); - HttpsURLConnection httpsURLConnection = (HttpsURLConnection) (new URL("https://api.minecraftservices.com/minecraft/profile").openConnection()); + HttpsURLConnection httpsURLConnection = (HttpsURLConnection) (new URL( + "https://api.minecraftservices.com/minecraft/profile").openConnection()); httpsURLConnection.setRequestProperty("Authorization", "Bearer " + token); String response = Utils.readString(httpsURLConnection.getInputStream(), null); JsonObject jsonObject = new JsonParser().parse(response).getAsJsonObject(); UUID id = UUID.fromString( - jsonObject.get("id").getAsString().replaceFirst( - "(\\p{XDigit}{8})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}+)", "$1-$2-$3-$4-$5" - ) + Utils.normalizeUUID(jsonObject.get("id").getAsString()) ); String name = jsonObject.get("name").getAsString(); gameProfile = new GameProfile(id, name); @@ -52,7 +52,8 @@ public class Main { //noinspection resource sock = new ServerSocket(i, 50, InetAddress.getLoopbackAddress()); break; - } catch (Exception ignored) {} + } catch (Exception ignored) { + } } if (sock == null) { System.err.println("Could not bind to any valid port"); |