Log packets in dedicated handlers instead of in encoder/decoder

This commit is contained in:
P0nk
2021-07-18 14:09:39 +02:00
parent ab03dd3109
commit 11e83522d6
9 changed files with 139 additions and 73 deletions

View File

@@ -0,0 +1,17 @@
package net.packet.logging;
import io.netty.buffer.Unpooled;
import java.util.Set;
public class LoggingUtil {
private static final Set<Short> ignoredDebugRecvPackets = Set.of((short) 167, (short) 197, (short) 89, (short) 91, (short) 41, (short) 188, (short) 107);
public static short readFirstShort(byte[] bytes) {
return Unpooled.wrappedBuffer(bytes).readShortLE();
}
public static boolean isIgnoredRecvPacket(short opcode) {
return ignoredDebugRecvPackets.contains(opcode);
}
}