Fixed bug with Server monitor.
This commit is contained in:
parent
b056733ba1
commit
f2d1380478
@ -6,9 +6,11 @@ import java.util.List;
|
||||
|
||||
public class GroupStatusData
|
||||
{
|
||||
private int _serverNum = 0;
|
||||
private int _totalCount = 0;
|
||||
private int _joinableCount = 0;
|
||||
|
||||
private int _freeServerNum = 0;
|
||||
private int _freeTotalCount = 0;
|
||||
private int _freeJoinableCount = 0;
|
||||
|
||||
@ -135,22 +137,33 @@ public class GroupStatusData
|
||||
|
||||
public int getNextServerNumber(boolean free)
|
||||
{
|
||||
int startNumber = 1;
|
||||
if (free)
|
||||
_freeServerNum++;
|
||||
else
|
||||
_serverNum++;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (free)
|
||||
{
|
||||
if (!FreeServers.containsKey(startNumber))
|
||||
return startNumber;
|
||||
if (!FreeServers.containsKey(_freeServerNum))
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!Servers.containsKey(startNumber))
|
||||
return startNumber;
|
||||
if (!Servers.containsKey(_serverNum))
|
||||
break;
|
||||
}
|
||||
|
||||
startNumber++;
|
||||
if (free)
|
||||
_freeServerNum++;
|
||||
else
|
||||
_serverNum++;
|
||||
}
|
||||
|
||||
if (free)
|
||||
return _freeServerNum;
|
||||
else
|
||||
return _serverNum;
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ public class ServerMonitor
|
||||
|
||||
handleGroupChanges(dynamicServers, serverTracker, serverGroup, groupStatus, false);
|
||||
|
||||
if (serverGroup.GenerateFreeVersions && _count % 2 == 0)
|
||||
if (serverGroup.GenerateFreeVersions && _count % 6 == 0)
|
||||
{
|
||||
handleGroupChanges(dynamicServers, serverTracker, serverGroup, groupStatus, true);
|
||||
}
|
||||
@ -246,12 +246,12 @@ public class ServerMonitor
|
||||
break;
|
||||
}
|
||||
|
||||
if (serverTracker.containsKey(serverGroup.Prefix + "-" + serverNum))
|
||||
if (serverTracker.containsKey(serverGroup.Prefix + "-" + serverNum + (free ? "-FREE" : "")))
|
||||
System.out.println("[WAITING] On " + serverGroup.Prefix + "-" + serverNum + " to finish starting...");
|
||||
else
|
||||
{
|
||||
startServer(bestServer, serverGroup, serverNum, free);
|
||||
serverTracker.put(serverGroup.Prefix + "-" + serverNum, new AbstractMap.SimpleEntry<String, Long>(bestServer.Address, System.currentTimeMillis()));
|
||||
serverTracker.put(serverGroup.Prefix + "-" + serverNum + (free ? "-FREE" : ""), new AbstractMap.SimpleEntry<String, Long>(bestServer.Address, System.currentTimeMillis()));
|
||||
}
|
||||
|
||||
serversToAdd--;
|
||||
|
Loading…
Reference in New Issue
Block a user