{
ChannelBuffer apocalypse = (ChannelBuffer) event.getSource();
if(apocalypse.readableBytes()>=4)
{
int cmd = apocalypse.readInt();
ZombieCommands command = ZombieCommands.CommandsEnum.fromInt(cmd);
if(command == ZombieCommands.APOCALYPSE)
{
System.out.println("Cancelling " + type + " timer due to apocalypse");
service.shutdown();
e.getChannel().close();
}
}
}
}
if(message instanceof ChannelBuffer)
{
ChannelBuffer apocalypse = (ChannelBuffer) message;
if(apocalypse.readableBytes()>=4)
{
int cmd = apocalypse.readInt();
ZombieCommands command = ZombieCommands.CommandsEnum.fromInt(cmd);
if(command == ZombieCommands.APOCALYPSE)
{
System.out.println("Cancelling " + type + " timer");
service.shutdown();
e.getChannel().close();