Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
cd044adc55
Commit
e443235e34
@ -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()){
|
||||||
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren