Added another requirement for Lobbies in ServerMonitor 1500 available slots

This commit is contained in:
Jonathan Williams 2014-07-19 13:54:27 -07:00
parent e6818c4c46
commit de5c0a77ef
2 changed files with 9 additions and 2 deletions

View File

@ -44,7 +44,7 @@ public class GroupStatusData
// Lobby joinable checking // Lobby joinable checking
if (existingServer.Motd.isEmpty() || existingServer.Motd.equals("")) if (existingServer.Motd.isEmpty() || existingServer.Motd.equals(""))
{ {
if (serverStatusData.MaxPlayers - serverStatusData.Players > 15) if (serverStatusData.MaxPlayers - serverStatusData.Players > 20)
_joinableCount--; _joinableCount--;
} }
else else
@ -66,7 +66,7 @@ public class GroupStatusData
// Lobby joinable checking // Lobby joinable checking
if (serverStatusData.Motd.isEmpty() || serverStatusData.Motd.equals("")) if (serverStatusData.Motd.isEmpty() || serverStatusData.Motd.equals(""))
{ {
if (serverStatusData.MaxPlayers - serverStatusData.Players > 15) if (serverStatusData.MaxPlayers - serverStatusData.Players > 20)
{ {
_joinableCount++; _joinableCount++;
} }

View File

@ -141,6 +141,13 @@ public class ServerMonitor
int serversToAdd = Math.max(serverGroup.RequiredTotalServers - groupStatus.getTotalServers(), serverGroup.RequiredJoinableServers - groupStatus.getJoinableCount()); int serversToAdd = Math.max(serverGroup.RequiredTotalServers - groupStatus.getTotalServers(), serverGroup.RequiredJoinableServers - groupStatus.getJoinableCount());
int serversToKill = (groupStatus.getTotalServers() > serverGroup.RequiredTotalServers && groupStatus.getJoinableCount() > serverGroup.RequiredJoinableServers) ? Math.min(groupStatus.getJoinableCount() - serverGroup.RequiredJoinableServers, groupStatus.EmptyServers.size()) : 0; int serversToKill = (groupStatus.getTotalServers() > serverGroup.RequiredTotalServers && groupStatus.getJoinableCount() > serverGroup.RequiredJoinableServers) ? Math.min(groupStatus.getJoinableCount() - serverGroup.RequiredJoinableServers, groupStatus.EmptyServers.size()) : 0;
// Minimum 1500 slot bufferzone
if (serverGroup.Name.equalsIgnoreCase("Lobby"))
{
if (groupStatus.MaxPlayers - groupStatus.Players < 1500)
serversToAdd = serverGroup.RequiredJoinableServers;
}
while (serversToAdd > 0) while (serversToAdd > 0)
{ {
int serverNum = groupStatus.getNextServerNumber(); int serverNum = groupStatus.getNextServerNumber();