Close #300 - cleaner disconnects when server is full
This commit is contained in:
parent
5f8e76c61c
commit
140830efe0
@ -109,7 +109,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
|||||||
}
|
}
|
||||||
|
|
||||||
int limit = BungeeCord.getInstance().config.getPlayerLimit();
|
int limit = BungeeCord.getInstance().config.getPlayerLimit();
|
||||||
Preconditions.checkState( limit <= 0 || bungee.getPlayers().size() < limit, "Server is full!" );
|
if ( limit > 0 && bungee.getPlayers().size() > limit )
|
||||||
|
{
|
||||||
|
disconnect( "Server is full!" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.handshake = handshake;
|
this.handshake = handshake;
|
||||||
ch.write( request = EncryptionUtil.encryptRequest() );
|
ch.write( request = EncryptionUtil.encryptRequest() );
|
||||||
|
Loading…
Reference in New Issue
Block a user