From beb0bf9836ba291bd30710d84df8c1ea64385aa4 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 12 May 2013 16:09:21 +1000 Subject: [PATCH] Fu*** offline mode users --- .../java/net/md_5/bungee/connection/InitialHandler.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java index c1c7fc551..385a68513 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java @@ -136,6 +136,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection 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; ch.write( forgeMods ); ch.write( request = EncryptionUtil.encryptRequest() ); @@ -199,7 +206,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection ProxiedPlayer old = bungee.getPlayer( handshake.username ); if ( old != null ) { - old.disconnect( bungee.getTranslation( "already_connected") ); + old.disconnect( bungee.getTranslation( "already_connected" ) ); } Callback complete = new Callback()