Archived
0

debug: packet id in hex

This commit is contained in:
2018-06-17 15:04:01 +03:00
parent 42ce61fa9c
commit 8ac011f8f6

View File

@@ -43,12 +43,14 @@ public class PacketDecoder extends ByteToMessageDecoder {
int rb = in.readableBytes();
int packetId = netStream.readVarInt();
log.debug("Packet id: {}", packetId);
String hexPacketId = Integer.toHexString(packetId).toUpperCase();
if (hexPacketId.length() == 1) hexPacketId = "0" + hexPacketId;
log.debug("Packet id: 0x{}", hexPacketId);
rb = rb - in.readableBytes();
Class<? extends CSPacket> packetClass = state.getClientSidePacket(packetId);
if (packetClass == null) {
log.warn("Unknown packet: {}:{}", state.name(), packetId);
log.warn("Unknown packet: {}:0x{}", state.name(), hexPacketId);
in.skipBytes(packetSize - rb);
} else {
netStream.setDataSize(packetSize - rb);