From 47f2ebcd9827335e21b861537a6a16b036380f5c Mon Sep 17 00:00:00 2001 From: Agatha Lovelace Date: Thu, 23 Dec 2021 01:57:04 +0200 Subject: [PATCH] uh oh that breaks autologin --- .../mixin/MixinServerLoginNetworkHandler.java | 11 +++-------- .../org/samo_lego/simpleauth/storage/AuthConfig.java | 5 ----- .../org/samo_lego/simpleauth/SimpleAuthForge.java | 1 - .../simpleauth/event/AuthEventHandlerForge.java | 2 -- 4 files changed, 3 insertions(+), 16 deletions(-) diff --git a/common/src/main/java/org/samo_lego/simpleauth/mixin/MixinServerLoginNetworkHandler.java b/common/src/main/java/org/samo_lego/simpleauth/mixin/MixinServerLoginNetworkHandler.java index 398189e..c77663c 100644 --- a/common/src/main/java/org/samo_lego/simpleauth/mixin/MixinServerLoginNetworkHandler.java +++ b/common/src/main/java/org/samo_lego/simpleauth/mixin/MixinServerLoginNetworkHandler.java @@ -78,14 +78,9 @@ public abstract class MixinServerLoginNetworkHandler { // Player has a Mojang account httpsURLConnection.disconnect(); - if (!config.main.allowExistingNames) { - // Caches the request - mojangAccountNamesCache.add(playername); - } else { - state = ServerLoginNetworkHandler.State.READY_TO_ACCEPT; - this.profile = packet.getProfile(); - ci.cancel(); - } + // Caches the request + mojangAccountNamesCache.add(playername); + // Authentication continues in original method } else if(response == HttpURLConnection.HTTP_NO_CONTENT) { diff --git a/common/src/main/java/org/samo_lego/simpleauth/storage/AuthConfig.java b/common/src/main/java/org/samo_lego/simpleauth/storage/AuthConfig.java index 57180f5..58d2b2d 100644 --- a/common/src/main/java/org/samo_lego/simpleauth/storage/AuthConfig.java +++ b/common/src/main/java/org/samo_lego/simpleauth/storage/AuthConfig.java @@ -162,11 +162,6 @@ public class AuthConfig { */ public boolean premiumAutologin = false; - /* - * Whether to allow offline players with registered usernames to connect. - */ - public boolean allowExistingNames = false; - /** * Contains a list of lower case (!) player names * that should always be treated as offline. diff --git a/forge/src/main/java/org/samo_lego/simpleauth/SimpleAuthForge.java b/forge/src/main/java/org/samo_lego/simpleauth/SimpleAuthForge.java index b77c0ce..8bf5355 100644 --- a/forge/src/main/java/org/samo_lego/simpleauth/SimpleAuthForge.java +++ b/forge/src/main/java/org/samo_lego/simpleauth/SimpleAuthForge.java @@ -9,7 +9,6 @@ import net.minecraftforge.fml.common.Mod; import net.minecraftforge.event.server.ServerStoppedEvent; import net.minecraftforge.fml.loading.FMLPaths; -import org.samo_lego.simpleauth.SimpleAuth; import org.samo_lego.simpleauth.commands.*; @Mod(SimpleAuth.MOD_ID) diff --git a/forge/src/main/java/org/samo_lego/simpleauth/event/AuthEventHandlerForge.java b/forge/src/main/java/org/samo_lego/simpleauth/event/AuthEventHandlerForge.java index 5b6a9b3..036752e 100644 --- a/forge/src/main/java/org/samo_lego/simpleauth/event/AuthEventHandlerForge.java +++ b/forge/src/main/java/org/samo_lego/simpleauth/event/AuthEventHandlerForge.java @@ -11,8 +11,6 @@ import net.minecraftforge.fml.common.Mod; import static net.minecraftforge.eventbus.api.EventPriority.HIGHEST; import static org.samo_lego.simpleauth.SimpleAuth.MOD_ID; -import org.samo_lego.simpleauth.event.AuthEventHandler; - /** * This class will take care of actions players try to do, * and cancel them if they aren't authenticated