Fu*** offline mode users

This commit is contained in:
md_5 2013-05-12 16:09:21 +10:00
parent 688c42219c
commit beb0bf9836

View File

@ -136,6 +136,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection
return; return;
} }
// If offline mode and they are already on, don't allow connect
if ( !BungeeCord.getInstance().config.isOnlineMode() && bungee.getPlayer( handshake.username ) != null )
{
disconnect( bungee.getTranslation( "already_connected" ) );
return;
}
this.handshake = handshake; this.handshake = handshake;
ch.write( forgeMods ); ch.write( forgeMods );
ch.write( request = EncryptionUtil.encryptRequest() ); ch.write( request = EncryptionUtil.encryptRequest() );
@ -199,7 +206,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
ProxiedPlayer old = bungee.getPlayer( handshake.username ); ProxiedPlayer old = bungee.getPlayer( handshake.username );
if ( old != null ) if ( old != null )
{ {
old.disconnect( bungee.getTranslation( "already_connected") ); old.disconnect( bungee.getTranslation( "already_connected" ) );
} }
Callback<LoginEvent> complete = new Callback<LoginEvent>() Callback<LoginEvent> complete = new Callback<LoginEvent>()