SteamWar/BungeeCore
Archiviert
13
2

Fix concurrency, fix cast
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2022-06-14 08:56:09 +02:00
Ursprung 98079a2331
Commit 571fa8c7d1

Datei anzeigen

@ -41,7 +41,7 @@ public class NetworkReceiver extends BasicListener {
public static ServerInfo sender; public static ServerInfo sender;
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
public void onPluginMessage(PluginMessageEvent event) { public synchronized void onPluginMessage(PluginMessageEvent event) {
if (blockedTags.contains(event.getTag()) && !allowedAddresses.contains(((InetSocketAddress) event.getSender().getSocketAddress()).getHostString())) { if (blockedTags.contains(event.getTag()) && !allowedAddresses.contains(((InetSocketAddress) event.getSender().getSocketAddress()).getHostString())) {
BungeeCore.log(Level.SEVERE, ((InetSocketAddress) event.getSender().getSocketAddress()).getHostString() + " tried to send a plugin message with tag " + event.getTag()); BungeeCore.log(Level.SEVERE, ((InetSocketAddress) event.getSender().getSocketAddress()).getHostString() + " tried to send a plugin message with tag " + event.getTag());
event.setCancelled(true); event.setCancelled(true);
@ -54,7 +54,7 @@ public class NetworkReceiver extends BasicListener {
if(!(event.getSender() instanceof Server)) if(!(event.getSender() instanceof Server))
return; return;
sender = (ServerInfo) event.getSender(); sender = ((Server) event.getSender()).getInfo();
NetworkPacket.handle(event.getData()); NetworkPacket.handle(event.getData());
sender = null; sender = null;
} }