From d14d7489116477fd88fd2be8a70d67667b41aff5 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Mon, 29 Aug 2022 14:33:34 +0200 Subject: [PATCH] Improve Blocked Logging --- src/de/steamwar/bungeecore/network/NetworkReceiver.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/de/steamwar/bungeecore/network/NetworkReceiver.java b/src/de/steamwar/bungeecore/network/NetworkReceiver.java index d3de8c8..f01bf44 100644 --- a/src/de/steamwar/bungeecore/network/NetworkReceiver.java +++ b/src/de/steamwar/bungeecore/network/NetworkReceiver.java @@ -22,6 +22,7 @@ package de.steamwar.bungeecore.network; import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.commands.TeamCommand; import de.steamwar.bungeecore.listeners.BasicListener; +import de.steamwar.bungeecore.sql.SWException; import de.steamwar.network.packets.NetworkPacket; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.connection.Server; @@ -31,8 +32,8 @@ import net.md_5.bungee.event.EventPriority; import java.net.InetSocketAddress; import java.util.Arrays; +import java.util.Base64; import java.util.List; -import java.util.logging.Level; public class NetworkReceiver extends BasicListener { @@ -41,7 +42,7 @@ public class NetworkReceiver extends BasicListener { @EventHandler(priority = EventPriority.HIGHEST) public void onPluginMessage(PluginMessageEvent event) { if (blockedTags.contains(event.getTag()) && !TeamCommand.isLocalhost(((InetSocketAddress) event.getSender().getSocketAddress()).getAddress())) { - BungeeCore.log(Level.SEVERE, ((InetSocketAddress) event.getSender().getSocketAddress()).getHostString() + " tried to send a plugin message with tag " + event.getTag()); + SWException.log("Bungee", ((InetSocketAddress) event.getSender().getSocketAddress()).getHostString() + " tried to send a plugin message with tag " + event.getTag(), Base64.getEncoder().encodeToString(event.getData())); event.setCancelled(true); return; }