Fixing handleDisconnection() #9

This commit is contained in:
samo_lego 2020-07-06 10:40:32 +02:00
parent f6b1ea8147
commit 4db0578cf7
3 changed files with 4 additions and 6 deletions

View File

@ -3,11 +3,11 @@ org.gradle.jvmargs=-Xmx1G
# Fabric properties
minecraft_version=1.16.1
yarn_mappings=1.16.1+build.17
loader_version=0.8.8+build.202
yarn_mappings=1.16.1+build.20
loader_version=0.8.9+build.203
#Fabric api
fabric_version=0.14.0+build.371-1.16
fabric_version=0.14.1+build.372-1.16
# Mod Properties
mod_version = 1.4.6

View File

@ -206,7 +206,7 @@ public class SimpleAuth implements DedicatedServerModInitializer {
timer.schedule(new TimerTask() {
@Override
public void run() {
if(!SimpleAuth.isAuthenticated(player)) // Kicking player if not authenticated
if(!SimpleAuth.isAuthenticated(player) && player.networkHandler.getConnection().isOpen()) // Kicking player if not authenticated
player.networkHandler.disconnect(new LiteralText(SimpleAuth.config.lang.timeExpired));
}
}, SimpleAuth.config.main.delay * 1000);

View File

@ -35,8 +35,6 @@ public class AuthEventHandler {
return new LiteralText(config.lang.notAuthenticated);
}
private static Text successfulPortalRescue = new LiteralText(config.lang.successfulPortalRescue);
// Player pre-join
// Returns text as a reason for disconnect or null to pass
public static LiteralText checkCanPlayerJoinServer(SocketAddress socketAddress, GameProfile profile, PlayerManager manager) {