- headless admin cannot start unless min authenticated players are connected

This commit is contained in:
Mark Vejvoda
2013-01-11 23:48:57 +00:00
parent 3df1df6155
commit 0f34a886c6
3 changed files with 7 additions and 4 deletions

View File

@@ -563,12 +563,15 @@ int ServerInterface::getSlotCount() {
return slotCount;
}
int ServerInterface::getConnectedSlotCount() {
int ServerInterface::getConnectedSlotCount(bool authenticated) {
int connectedSlotCount = 0;
for(int i= 0; exitServer == false && i < GameConstants::maxPlayers; ++i) {
MutexSafeWrapper safeMutexSlot(slotAccessorMutexes[i],CODE_AT_LINE_X(i));
if(slots[i] != NULL && slots[i]->isConnected() == true) {
++connectedSlotCount;
if(authenticated == false ||
(authenticated == true && slots[i]->getConnectHasHandshaked() == true)) {
++connectedSlotCount;
}
}
}
return connectedSlotCount;