From 0cf8fc86af382e7b1b04898e0484de8e55555bd6 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sat, 17 Jun 2023 13:43:16 +0700 Subject: [PATCH] multi server lol idk why i improved this because this is unused --- .../chomens_bot/plugins/PacketSnifferPlugin.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/PacketSnifferPlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/PacketSnifferPlugin.java index 945bf07..82f0986 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/PacketSnifferPlugin.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/PacketSnifferPlugin.java @@ -11,6 +11,7 @@ import java.io.IOException; import java.io.OutputStreamWriter; import java.nio.charset.StandardCharsets; +// normally unused in the main instance of the bot public class PacketSnifferPlugin extends Bot.Listener { @Getter @Setter private boolean enabled = false; @@ -20,7 +21,16 @@ public class PacketSnifferPlugin extends Bot.Listener { if (!enabled) return; try { - writer = new OutputStreamWriter(new FileOutputStream("packets.log"), StandardCharsets.UTF_8); + writer = new OutputStreamWriter( + new FileOutputStream( + String.format( + "packets-%s-%s.log", + bot.options().host(), + bot.options().port() + ) + ), + StandardCharsets.UTF_8 + ); } catch (IOException e) { e.printStackTrace(); }