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,6 +229,12 @@ 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);
if (side == Side.CLIENT)
{
manager.closeChannel(chatcomponenttext);
}
else
{
manager.scheduleOutboundPacket(new S40PacketDisconnect(chatcomponenttext), new GenericFutureListener<Future<?>>() manager.scheduleOutboundPacket(new S40PacketDisconnect(chatcomponenttext), new GenericFutureListener<Future<?>>()
{ {
@Override @Override
@ -237,6 +243,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
manager.closeChannel(chatcomponenttext); manager.closeChannel(chatcomponenttext);
} }
}); });
}
manager.channel().config().setAutoRead(false); manager.channel().config().setAutoRead(false);
} }