SteamWar/BungeeCore
Archiviert
13
2

Add better Fail massage than standard bungee

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2020-04-30 13:18:50 +02:00
Ursprung 6fb4866a4e
Commit 861d87e259

Datei anzeigen

@ -18,6 +18,7 @@ import java.io.File;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
public class TablistManager extends BasicListener {
@ -78,37 +79,41 @@ public class TablistManager extends BasicListener {
}
private synchronized void updateCustomTablist(){
calcHeader();
try{
calcHeader();
//Calculate server-player-map
playerMap.clear();
for(ProxiedPlayer player : ProxyServer.getInstance().getPlayers()){
ServerInfo server = player.getServer().getInfo();
String serverName = server.getName();
if(serverName.equals("Developer"))
continue;
//Calculate server-player-map
playerMap.clear();
for(ProxiedPlayer player : ProxyServer.getInstance().getPlayers()){
ServerInfo server = player.getServer().getInfo();
String serverName = server.getName();
if(serverName.equals("Developer"))
continue;
Subserver subserver = Subserver.getSubserver(server);
List<ProxiedPlayer> players;
if(subserver != null && subserver.getType() == Servertype.BAUSERVER){
players = playerMap.getOrDefault("Bau", new ArrayList<>());
players.add(player);
playerMap.putIfAbsent("Bau", players);
}else{
players = playerMap.getOrDefault(serverName, new ArrayList<>());
players.add(player);
playerMap.putIfAbsent(serverName, players);
Subserver subserver = Subserver.getSubserver(server);
List<ProxiedPlayer> players;
if(subserver != null && subserver.getType() == Servertype.BAUSERVER){
players = playerMap.getOrDefault("Bau", new ArrayList<>());
players.add(player);
playerMap.putIfAbsent("Bau", players);
}else{
players = playerMap.getOrDefault(serverName, new ArrayList<>());
players.add(player);
playerMap.putIfAbsent(serverName, players);
}
}
playerMap.forEach((server, players) -> players.sort((proxiedPlayer, t1) -> proxiedPlayer.getName().compareToIgnoreCase(t1.getName())));
//Set size
calculateSize();
for(Tablist tablist : tablists.values())
tablist.refresh();
seconds++;
}catch(NullPointerException e){
ProxyServer.getInstance().getLogger().log(Level.SEVERE, "NPE", e);
}
playerMap.forEach((server, players) -> players.sort((proxiedPlayer, t1) -> proxiedPlayer.getName().compareToIgnoreCase(t1.getName())));
//Set size
calculateSize();
for(Tablist tablist : tablists.values())
tablist.refresh();
seconds++;
}
@EventHandler