SteamWar/BungeeCore
Archiviert
13
2

Remove external shutdown
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2023-08-31 13:39:39 +02:00
Ursprung cd044adc55
Commit e443235e34
2 geänderte Dateien mit 4 neuen und 17 gelöschten Zeilen

Datei anzeigen

@ -309,8 +309,6 @@ public class BungeeCore extends Plugin {
EVENT_MODE = config.getBoolean("eventmode"); EVENT_MODE = config.getBoolean("eventmode");
Broadcaster.setBroadCastMsgs(config.getStringList("broadcasts").toArray(new String[1])); Broadcaster.setBroadCastMsgs(config.getStringList("broadcasts").toArray(new String[1]));
PollSystem.init(config.getString("poll.question"), config.getStringList("poll.answers")); PollSystem.init(config.getString("poll.question"), config.getStringList("poll.answers"));
Persistent.setChatPrefix(CHAT_PREFIX);
Persistent.setLobbyServer(LOBBY_SERVER);
final Configuration servers = config.getSection("servers"); final Configuration servers = config.getSection("servers");
for(final String serverName : servers.getKeys()){ for(final String serverName : servers.getKeys()){

Datei anzeigen

@ -39,11 +39,13 @@ import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.PlayerDisconnectEvent; import net.md_5.bungee.api.event.PlayerDisconnectEvent;
import net.md_5.bungee.api.event.PostLoginEvent; import net.md_5.bungee.api.event.PostLoginEvent;
import net.md_5.bungee.api.event.ServerDisconnectEvent;
import net.md_5.bungee.api.event.ServerKickEvent; import net.md_5.bungee.api.event.ServerKickEvent;
import net.md_5.bungee.event.EventHandler; import net.md_5.bungee.event.EventHandler;
import java.util.*; import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.UUID;
public class ConnectionListener extends BasicListener { public class ConnectionListener extends BasicListener {
@ -153,17 +155,4 @@ public class ConnectionListener extends BasicListener {
Utils.playerModMap.remove(e.getPlayer().getUniqueId()); Utils.playerModMap.remove(e.getPlayer().getUniqueId());
ModCommand.playerFilterType.remove(e.getPlayer()); ModCommand.playerFilterType.remove(e.getPlayer());
} }
@EventHandler
public void onServerDisconnect(ServerDisconnectEvent e){
ServerInfo server = e.getTarget();
Subserver subserver = Subserver.getSubserver(server);
if(subserver == null)
return;
ProxiedPlayer player = e.getPlayer();
Collection<ProxiedPlayer> players = server.getPlayers();
if(players.isEmpty() || (players.size() == 1 && players.contains(player)))
ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), subserver::waitForTermination);
}
} }