Fix network close events never getting called. Closes #381 #382

This commit is contained in:
Lex Manos 2014-03-15 18:16:27 -07:00
parent 244e39df0c
commit f632ea0c36

View file

@ -374,6 +374,14 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
@Override
public void close(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception
{
if (side == Side.CLIENT)
{
FMLCommonHandler.instance().bus().post(new FMLNetworkEvent.ClientDisconnectionFromServerEvent(manager));
}
else
{
FMLCommonHandler.instance().bus().post(new FMLNetworkEvent.ServerDisconnectionFromClientEvent(manager));
}
ctx.close(promise);
}