log send packet
This commit is contained in:
@@ -31,7 +31,7 @@ public class PacketEncoder extends MessageToByteEncoder<SCPacket> {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void encode(ChannelHandlerContext ctx, SCPacket packet, ByteBuf out) throws Exception {
|
||||
protected void encode(ChannelHandlerContext ctx, SCPacket packet, ByteBuf out) {
|
||||
State state = ctx.channel().attr(ATTR_STATE).get();
|
||||
Integer id = state.getServerSidePacket(packet.getClass());
|
||||
if (id == null) {
|
||||
@@ -39,6 +39,8 @@ public class PacketEncoder extends MessageToByteEncoder<SCPacket> {
|
||||
return;
|
||||
}
|
||||
|
||||
log.debug("Send {}:{}", state, packet);
|
||||
|
||||
NetStream netStream = new ByteArrayOutputNetStream();
|
||||
packet.writeSelf(netStream);
|
||||
byte[] bytes = ((ByteArrayOutputNetStream) netStream).toByteArray();
|
||||
|
||||
Reference in New Issue
Block a user