From fa9bace294f3a28d1eee2fd048faaa830db41848 Mon Sep 17 00:00:00 2001 From: Melledy <121644117+Melledy@users.noreply.github.com> Date: Sun, 3 Dec 2023 19:38:40 -0800 Subject: [PATCH] Small fix to packet logging --- .../emu/lunarcore/server/game/GameSession.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/emu/lunarcore/server/game/GameSession.java b/src/main/java/emu/lunarcore/server/game/GameSession.java index 85887b7..445be66 100644 --- a/src/main/java/emu/lunarcore/server/game/GameSession.java +++ b/src/main/java/emu/lunarcore/server/game/GameSession.java @@ -170,15 +170,15 @@ public class GameSession { * @param cmdId */ public void send(int cmdId) { + // Get packet from the server's packet cache. This will allow us to reuse empty packets if needed. if (this.ukcp != null) { - // Get packet from the server's packet cache. This will allow us to reuse empty packets if needed. - this.ukcp.write(this.getServer().getPacketCache().getCachedPacket(cmdId)); - - // Log - if (LunarCore.getConfig().getLogOptions().packets) { - if (!(LunarCore.getConfig().getLogOptions().filterLoopingPackets && CmdIdUtils.LOOP_PACKETS.contains(cmdId))) { - logPacket("RECV", cmdId, Utils.EMPTY_BYTE_ARRAY); - } + this.ukcp.write(getServer().getPacketCache().getCachedPacket(cmdId)); + } + + // Log + if (LunarCore.getConfig().getLogOptions().packets) { + if (!(LunarCore.getConfig().getLogOptions().filterLoopingPackets && CmdIdUtils.LOOP_PACKETS.contains(cmdId))) { + logPacket("SEND", cmdId, Utils.EMPTY_BYTE_ARRAY); } } }