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