Fix network disconnect with message on the client side in NetworkDispatcher.

This commit is contained in:
Lex Manos 2014-05-09 13:23:24 -07:00
parent 6b82a4fed8
commit 123f5919ba

View file

@ -229,14 +229,21 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
private void kickWithMessage(String message) private void kickWithMessage(String message)
{ {
final ChatComponentText chatcomponenttext = new ChatComponentText(message); final ChatComponentText chatcomponenttext = new ChatComponentText(message);
manager.scheduleOutboundPacket(new S40PacketDisconnect(chatcomponenttext), new GenericFutureListener<Future<?>>() if (side == Side.CLIENT)
{ {
@Override manager.closeChannel(chatcomponenttext);
public void operationComplete(Future<?> result) }
else
{
manager.scheduleOutboundPacket(new S40PacketDisconnect(chatcomponenttext), new GenericFutureListener<Future<?>>()
{ {
manager.closeChannel(chatcomponenttext); @Override
} public void operationComplete(Future<?> result)
}); {
manager.closeChannel(chatcomponenttext);
}
});
}
manager.channel().config().setAutoRead(false); manager.channel().config().setAutoRead(false);
} }