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