Check the user had authenticated before handling disconnect

This commit is contained in:
rtm516 2023-04-26 19:01:05 +01:00
parent 0e5db578e9
commit 94a636ad3f
No known key found for this signature in database
GPG key ID: 331715B8B007C67A
2 changed files with 4 additions and 3 deletions

View file

@ -63,8 +63,10 @@ public class PacketHandler extends UpstreamPacketHandler {
@Override
public void onDisconnect(String reason) {
geyserConnect.logger().info(Utils.displayName(session) + " has disconnected (" + reason + ")");
ServerManager.unloadServers(session);
if (session.getAuthData() != null) {
geyserConnect.logger().info(Utils.displayName(session) + " has disconnected (" + reason + ")");
ServerManager.unloadServers(session);
}
}
@Override

View file

@ -95,7 +95,6 @@ public class UIHandler {
.label(message)
.resultHandler((customForm, customFormResponseFormResponseResult) -> {
sendMainMenu();
// this.sendToServer(new Server("test.geysermc.org", 25565));
})
.build());
} else {