Add logPackets config option

This commit is contained in:
Melledy 2023-09-25 18:43:26 -07:00
parent 13ee657b89
commit 00fdc85ec4
2 changed files with 8 additions and 2 deletions

View File

@ -19,6 +19,8 @@ public class Config {
public String resourceDir = "./resources";
public String dataDir = "./data";
public boolean logPackets = false;
@Getter
public static class DatabaseInfo {

View File

@ -116,7 +116,9 @@ public class GameSession {
}
// Log packet
logPacket("RECV", opcode, data);
if (LunarRail.getConfig().logPackets) {
logPacket("RECV", opcode, data);
}
// Handle
getServer().getPacketHandler().handle(this, opcode, header, data);
@ -139,7 +141,9 @@ public class GameSession {
this.send(packet.build());
// Log
logPacket("SEND", packet.getOpcode(), packet.getData());
if (LunarRail.getConfig().logPackets) {
logPacket("SEND", packet.getOpcode(), packet.getData());
}
}
/**