- headless admin cannot launch a game unless there are at least two players connected

This commit is contained in:
Mark Vejvoda
2012-07-07 05:35:25 +00:00
parent b5b2c623fe
commit 490ba7e824
4 changed files with 49 additions and 10 deletions

View File

@@ -523,11 +523,22 @@ bool ServerInterface::hasClientConnection() {
return result;
}
int ServerInterface::getSlotCount() {
int slotCount = 0;
for(int i= 0; exitServer == false && i < GameConstants::maxPlayers; ++i) {
MutexSafeWrapper safeMutexSlot(slotAccessorMutexes[i],CODE_AT_LINE_X(i));
if(slots[i] != NULL) {
++slotCount;
}
}
return slotCount;
}
int ServerInterface::getConnectedSlotCount() {
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) {
if(slots[i] != NULL && slots[i]->isConnected() == true) {
++connectedSlotCount;
}
}