Browse Source

uh oh that breaks autologin

architectury 1.8.4
Agatha Lovelace 1 month ago
parent
commit
47f2ebcd98
  1. 11
      common/src/main/java/org/samo_lego/simpleauth/mixin/MixinServerLoginNetworkHandler.java
  2. 5
      common/src/main/java/org/samo_lego/simpleauth/storage/AuthConfig.java
  3. 1
      forge/src/main/java/org/samo_lego/simpleauth/SimpleAuthForge.java
  4. 2
      forge/src/main/java/org/samo_lego/simpleauth/event/AuthEventHandlerForge.java

11
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) {

5
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.

1
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)

2
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

Loading…
Cancel
Save