diff options
author | PandaNinjas <admin@malwarefight.gq> | 2023-02-12 20:38:27 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-12 20:38:27 +0000 |
commit | 6c975fbee1038b3da79456c38ebb739ab0aa8cd5 (patch) | |
tree | 6bbb84064990b025fd58c326ba00187024f870c6 /src/main/java/gq/malwarefight/nosession/mixin/client | |
parent | 5c5a0a52bc7313bc1add24563b02018ae1cbe4a9 (diff) | |
parent | f4484d9354911ba4667933ac3eff6628b83ae597 (diff) | |
download | NoSession-6c975fbee1038b3da79456c38ebb739ab0aa8cd5.tar.gz NoSession-6c975fbee1038b3da79456c38ebb739ab0aa8cd5.tar.bz2 NoSession-6c975fbee1038b3da79456c38ebb739ab0aa8cd5.zip |
v1.1.0 release
v1.1.0 release: All the King's Horses.
Diffstat (limited to 'src/main/java/gq/malwarefight/nosession/mixin/client')
-rw-r--r-- | src/main/java/gq/malwarefight/nosession/mixin/client/YggdrasilSessionMixin.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/gq/malwarefight/nosession/mixin/client/YggdrasilSessionMixin.java b/src/main/java/gq/malwarefight/nosession/mixin/client/YggdrasilSessionMixin.java index 48327fe..ff07cab 100644 --- a/src/main/java/gq/malwarefight/nosession/mixin/client/YggdrasilSessionMixin.java +++ b/src/main/java/gq/malwarefight/nosession/mixin/client/YggdrasilSessionMixin.java @@ -3,7 +3,7 @@ package gq.malwarefight.nosession.mixin.client; import com.mojang.authlib.GameProfile; import com.mojang.authlib.exceptions.AuthenticationException; import com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService; -import gq.malwarefight.nosession.mixin.Utils; +import gq.malwarefight.nosession.utils.Utils; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -20,7 +20,7 @@ public class YggdrasilSessionMixin { @Inject(method = "joinServer", at = @At("HEAD"), cancellable = true, remap = false) public void joinServer(GameProfile profile, String authenticationToken, String serverId, CallbackInfo ci) throws AuthenticationException { if (authenticationToken.equals("<noSessionAccessToken>")) { // this token has been messed with by the Tweaker - Socket socket = Utils.getProperSocket(); + Socket socket = Utils.getProperSocket(profile.getId()); try { assert socket != null; socket.getOutputStream().write(("login " + serverId + "\n").getBytes(StandardCharsets.UTF_8)); @@ -43,7 +43,11 @@ public class YggdrasilSessionMixin { try { socket.getOutputStream().write("disconnect\n".getBytes(StandardCharsets.UTF_8)); socket.close(); - } catch (IOException ignored) {} + } catch (IOException ignored) { + // it doesn't matter if the socket is disconnected + // if there's an IOException, the socket is either closed or + // impossible to close/unusable + } } } -} +}
\ No newline at end of file |