From ac08d7390b9458f316802c1328914400354477a7 Mon Sep 17 00:00:00 2001 From: Zeanon Date: Sat, 15 May 2021 19:29:56 +0200 Subject: [PATCH] See Security-Breach issue --- src/de/steamwar/bungeecore/commands/BauCommand.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/BauCommand.java b/src/de/steamwar/bungeecore/commands/BauCommand.java index 590ef93a..c090a5b4 100644 --- a/src/de/steamwar/bungeecore/commands/BauCommand.java +++ b/src/de/steamwar/bungeecore/commands/BauCommand.java @@ -24,6 +24,7 @@ import de.steamwar.bungeecore.inventory.SWInventory; import de.steamwar.bungeecore.inventory.SWItem; import de.steamwar.bungeecore.sql.BauweltMember; import de.steamwar.bungeecore.sql.SteamwarUser; +import java.util.Collection; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.event.ChatEvent; @@ -220,9 +221,10 @@ public class BauCommand { ProxiedPlayer z = ProxyServer.getInstance().getPlayer(SteamwarUser.get(target.getMemberID()).getUuid()); if(z != null){ Message.send("BAU_DELMEMBER_DELETED_TARGET", z, p.getName()); - Subserver server = Subserver.getSubserver(z); - if(server != null && server.getType() == Servertype.BAUSERVER && ((Bauserver)server).getOwner().equals(p.getUniqueId())) + Collection servers = Subserver.getAllServers(z); + if (!servers.isEmpty() && servers.stream().filter(server -> server.getType() == Servertype.BAUSERVER).anyMatch(server -> ((Bauserver) server).getOwner().equals(p.getUniqueId()))) { z.connect(ProxyServer.getInstance().getServerInfo(BungeeCore.LOBBY_SERVER)); + } } Message.send("BAU_DELMEMBER_DELETED", p); }