mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 15:20:52 +01:00
Added debug.
This commit is contained in:
parent
ee5a97bbae
commit
a93ffbbbac
@ -4,11 +4,17 @@ import com.eu.habbo.messages.ServerMessage;
|
|||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.handler.codec.MessageToByteEncoder;
|
import io.netty.handler.codec.MessageToByteEncoder;
|
||||||
|
import io.netty.util.IllegalReferenceCountException;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class GameServerMessageEncoder extends MessageToByteEncoder<ServerMessage> {
|
public class GameServerMessageEncoder extends MessageToByteEncoder<ServerMessage> {
|
||||||
|
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(GameServerMessageEncoder.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void encode(ChannelHandlerContext ctx, ServerMessage message, ByteBuf out) {
|
protected void encode(ChannelHandlerContext ctx, ServerMessage message, ByteBuf out) {
|
||||||
|
try {
|
||||||
ByteBuf buf = message.get();
|
ByteBuf buf = message.get();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -17,6 +23,10 @@ public class GameServerMessageEncoder extends MessageToByteEncoder<ServerMessage
|
|||||||
// Release copied buffer.
|
// Release copied buffer.
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
} catch (IllegalReferenceCountException e) {
|
||||||
|
LOGGER.error("IllegalReferenceCountException happened for packet {}.", message.getHeader());
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user