check the player's server before really connecting

otherwise the player will be kicked with the message "Logged in from another location" if the target server is the current server
This commit is contained in:
weaondara 2013-04-02 02:13:29 +03:00
parent d067662967
commit 68712ab854

View File

@ -121,6 +121,10 @@ public final class UserConnection implements ProxiedPlayer
ServerConnectEvent event = new ServerConnectEvent( this, info );
ProxyServer.getInstance().getPluginManager().callEvent( event );
final ServerInfo target = event.getTarget(); // Update in case the event changed target
if ( getServer() != null && getServer().getInfo() == target )
{
return;
}
new Bootstrap()
.channel( NioSocketChannel.class )
.group( BungeeCord.getInstance().eventLoops )