Proper replacement for #701, closes #691

This commit is contained in:
md_5 2013-11-05 18:16:33 +11:00
parent 14371a1a8c
commit 8e390b5714
2 changed files with 7 additions and 2 deletions

View File

@ -255,11 +255,16 @@ public final class UserConnection implements ProxiedPlayer
@Override
public synchronized void disconnect(String reason)
{
disconnect0( Util.stupify( reason ) );
}
public synchronized void disconnect0(String reason)
{
if ( ch.getHandle().isActive() )
{
bungee.getLogger().log( Level.INFO, "[" + getName() + "] disconnected with: " + reason );
unsafe().sendPacket( new Kick( Util.stupify( reason ) ) );
unsafe().sendPacket( new Kick(reason) );
ch.close();
if ( server != null )
{

View File

@ -342,7 +342,7 @@ public class DownstreamBridge extends PacketHandler
con.connectNow( event.getCancelServer() );
} else
{
con.disconnect( bungee.getTranslation( "server_kick" ) + event.getKickReason() );
con.disconnect0( "[" + Util.stupify( bungee.getTranslation( "server_kick" ) ) + "," + event.getKickReason() + "]" ); // TODO: Json concat util method
}
server.setObsolete( true );
throw new CancelSendSignal();