Use log4j for monitored chr logger. Log all monitored to a dedicated file.

This commit is contained in:
P0nk
2021-12-21 21:07:18 +01:00
parent 507ab06721
commit 6c1a9465c0
10 changed files with 49 additions and 24 deletions

View File

@@ -1,11 +1,20 @@
package net.packet.logging;
import io.netty.buffer.Unpooled;
import net.opcodes.RecvOpcode;
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);
private static final Set<Short> ignoredDebugRecvPackets = Set.of(
(short) RecvOpcode.MOVE_PLAYER.getValue(), // 41
(short) RecvOpcode.HEAL_OVER_TIME.getValue(), // 89
(short) RecvOpcode.SPECIAL_MOVE.getValue(), // 91
(short) RecvOpcode.QUEST_ACTION.getValue(), // 107
(short) RecvOpcode.MOVE_PET.getValue(), // 167
(short) RecvOpcode.MOVE_LIFE.getValue(), // 188
(short) RecvOpcode.NPC_ACTION.getValue() // 197
);
public static short readFirstShort(byte[] bytes) {
return Unpooled.wrappedBuffer(bytes).readShortLE();