Archiviert
1
0

Merge pull request 'Remove external shutdown' (#484) from no-external-shutdown into master

Reviewed-on: SteamWar/BungeeCore#484
Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Lixfel 2023-08-31 15:57:45 +02:00
Commit 19b12c0055
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);
}
} }