SteamWar/BungeeCore
Archiviert
13
2

Merge pull request 'Improve Blocked Logging' (#426) from improve_blocked_logging into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #426
Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Lixfel 2022-08-29 14:35:48 +02:00
Commit e58fe20082

Datei anzeigen

@ -22,6 +22,7 @@ package de.steamwar.bungeecore.network;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.commands.TeamCommand; import de.steamwar.bungeecore.commands.TeamCommand;
import de.steamwar.bungeecore.listeners.BasicListener; import de.steamwar.bungeecore.listeners.BasicListener;
import de.steamwar.bungeecore.sql.SWException;
import de.steamwar.network.packets.NetworkPacket; import de.steamwar.network.packets.NetworkPacket;
import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.connection.Server; 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.net.InetSocketAddress;
import java.util.Arrays; import java.util.Arrays;
import java.util.Base64;
import java.util.List; import java.util.List;
import java.util.logging.Level;
public class NetworkReceiver extends BasicListener { public class NetworkReceiver extends BasicListener {
@ -41,7 +42,7 @@ public class NetworkReceiver extends BasicListener {
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
public void onPluginMessage(PluginMessageEvent event) { public void onPluginMessage(PluginMessageEvent event) {
if (blockedTags.contains(event.getTag()) && !TeamCommand.isLocalhost(((InetSocketAddress) event.getSender().getSocketAddress()).getAddress())) { 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); event.setCancelled(true);
return; return;
} }