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:
@@ -20,6 +20,8 @@ public class Config {
|
||||
public String resourceDir = "./resources";
|
||||
public String dataDir = "./data";
|
||||
|
||||
public boolean logPackets = false;
|
||||
|
||||
@Getter
|
||||
public static class DatabaseInfo {
|
||||
public String uri = "mongodb://localhost:27017";
|
||||
|
||||
@@ -116,7 +116,9 @@ public class GameSession {
|
||||
}
|
||||
|
||||
// Log packet
|
||||
if (LunarRail.getConfig().logPackets) {
|
||||
logPacket("RECV", opcode, data);
|
||||
}
|
||||
|
||||
// Handle
|
||||
getServer().getPacketHandler().handle(this, opcode, header, data);
|
||||
@@ -139,8 +141,10 @@ public class GameSession {
|
||||
this.send(packet.build());
|
||||
|
||||
// Log
|
||||
if (LunarRail.getConfig().logPackets) {
|
||||
logPacket("SEND", packet.getOpcode(), packet.getData());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a empty packet with the specified cmd id.
|
||||
|
||||
Reference in New Issue
Block a user