mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-15 06:45:04 +01:00
Add logPackets config option
This commit is contained in:
@@ -19,6 +19,8 @@ public class Config {
|
|||||||
|
|
||||||
public String resourceDir = "./resources";
|
public String resourceDir = "./resources";
|
||||||
public String dataDir = "./data";
|
public String dataDir = "./data";
|
||||||
|
|
||||||
|
public boolean logPackets = false;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
public static class DatabaseInfo {
|
public static class DatabaseInfo {
|
||||||
|
|||||||
@@ -116,7 +116,9 @@ public class GameSession {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Log packet
|
// Log packet
|
||||||
logPacket("RECV", opcode, data);
|
if (LunarRail.getConfig().logPackets) {
|
||||||
|
logPacket("RECV", opcode, data);
|
||||||
|
}
|
||||||
|
|
||||||
// Handle
|
// Handle
|
||||||
getServer().getPacketHandler().handle(this, opcode, header, data);
|
getServer().getPacketHandler().handle(this, opcode, header, data);
|
||||||
@@ -139,7 +141,9 @@ public class GameSession {
|
|||||||
this.send(packet.build());
|
this.send(packet.build());
|
||||||
|
|
||||||
// Log
|
// Log
|
||||||
logPacket("SEND", packet.getOpcode(), packet.getData());
|
if (LunarRail.getConfig().logPackets) {
|
||||||
|
logPacket("SEND", packet.getOpcode(), packet.getData());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user