mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-13 05:44:36 +01:00
Update base packet class again
This commit is contained in:
@@ -146,7 +146,7 @@ public class GameSession {
|
||||
|
||||
public void send(BasePacket packet) {
|
||||
// Test
|
||||
if (packet.getOpcode() <= 0) {
|
||||
if (packet.getCmdId() <= 0) {
|
||||
LunarCore.getLogger().warn("Tried to send packet with missing cmd id!");
|
||||
return;
|
||||
}
|
||||
@@ -156,11 +156,11 @@ public class GameSession {
|
||||
|
||||
// Log
|
||||
if (LunarCore.getConfig().getLogOptions().packets) {
|
||||
if (LunarCore.getConfig().getLogOptions().filterLoopingPackets && CmdIdUtils.LOOP_PACKETS.contains(packet.getOpcode())) {
|
||||
if (LunarCore.getConfig().getLogOptions().filterLoopingPackets && CmdIdUtils.LOOP_PACKETS.contains(packet.getCmdId())) {
|
||||
return;
|
||||
}
|
||||
|
||||
logPacket("SEND", packet.getOpcode(), packet.getData());
|
||||
logPacket("SEND", packet.getCmdId(), packet.getData());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ public class BasePacket {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public void setOpcode(int opcode) {
|
||||
this.cmdId = opcode;
|
||||
public void setCmdId(int cmdId) {
|
||||
this.cmdId = cmdId;
|
||||
}
|
||||
|
||||
public void setData(byte[] data) {
|
||||
|
||||
Reference in New Issue
Block a user