debug: packet id as hex
This commit is contained in:
@@ -40,7 +40,7 @@ public class ProtocolDecoder extends ByteToMessageDecoder {
|
|||||||
int packetId = netByteBuf.readVarInt();
|
int packetId = netByteBuf.readVarInt();
|
||||||
Class<? extends ClientSidePacket> packetClass = state.getClientSidePacketById(packetId);
|
Class<? extends ClientSidePacket> packetClass = state.getClientSidePacketById(packetId);
|
||||||
if (packetClass == null) {
|
if (packetClass == null) {
|
||||||
log.warn("Unkown packet: State {} ; Id {}", state, packetId);
|
log.warn("Unkown packet: State {} ; Id 0x{}", state, packetIdAsHexcode(packetId));
|
||||||
|
|
||||||
if (readUnknownPackets) {
|
if (readUnknownPackets) {
|
||||||
UnknownPacket unknownPacket = new UnknownPacket(state, packetId, netByteBuf.readableBytes());
|
UnknownPacket unknownPacket = new UnknownPacket(state, packetId, netByteBuf.readableBytes());
|
||||||
@@ -55,4 +55,11 @@ public class ProtocolDecoder extends ByteToMessageDecoder {
|
|||||||
out.add(packet);
|
out.add(packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String packetIdAsHexcode(int packetId) {
|
||||||
|
String hexPacketId = Integer.toHexString(packetId).toUpperCase();
|
||||||
|
if (hexPacketId.length() == 1) hexPacketId = "0" + hexPacketId;
|
||||||
|
|
||||||
|
return hexPacketId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user