Added PlayerTracker to Mineplexer

Changed how max players is displayed in Mineplexer

Added a cut-off of 900 players for each bungee in BungeeRotator, minimum of two records.
This commit is contained in:
Jonathan Williams 2014-11-05 14:40:40 -08:00
parent 1a09c14642
commit ecad60eee3
3 changed files with 9 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import mineplex.bungee.lobbyBalancer.LobbyBalancer;
import mineplex.bungee.motd.MotdManager;
import mineplex.bungee.playerCount.PlayerCount;
import mineplex.bungee.playerStats.PlayerStats;
import mineplex.bungee.playerTracker.PlayerTracker;
import mineplex.bungee.status.InternetStatus;
import net.md_5.bungee.api.plugin.Plugin;
@ -18,5 +19,6 @@ public class Mineplexer extends Plugin
new FileUpdater(this);
new PlayerStats(this);
new InternetStatus(this);
new PlayerTracker(this);
}
}

View File

@ -45,6 +45,6 @@ public class PlayerCount implements Listener, Runnable
{
net.md_5.bungee.api.ServerPing serverPing = event.getResponse();
event.setResponse(new net.md_5.bungee.api.ServerPing(serverPing.getVersion(), new Players(_totalMaxPlayers, _totalPlayers, null), serverPing.getDescription(), serverPing.getFaviconObject()));
event.setResponse(new net.md_5.bungee.api.ServerPing(serverPing.getVersion(), new Players(_totalPlayers + 1, _totalPlayers, null), serverPing.getDescription(), serverPing.getFaviconObject()));
}
}

View File

@ -45,11 +45,17 @@ public class BungeeRotator
{
if (usServers.size() < maxRecordCount && server.US)
{
if (usServers.size() >= 2 && server.Players > 900)
continue;
System.out.println("SELECTED " + server.Address + " " + (server.US ? "us" : "eu") + " " + server.Players + "/" + server.MaxPlayers);
usServers.add(server.Address);
}
else if (euServers.size() < maxRecordCount && !server.US)
{
if (euServers.size() >= 2 && server.Players > 900)
continue;
System.out.println("SELECTED " + server.Address + " " + (server.US ? "us" : "eu") + " " + server.Players + "/" + server.MaxPlayers);
euServers.add(server.Address);
}