- headless admin cannot start unless min authenticated players are connected
This commit is contained in:
parent
3df1df6155
commit
0f34a886c6
|
@ -850,7 +850,7 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) {
|
|||
|
||||
int minHeadLessPlayersRequired = Config::getInstance().getInt("MinHeadlessPlayersRequired","2");
|
||||
if(networkMessageLaunch.getMessageType() == nmtLaunch &&
|
||||
this->serverInterface->getConnectedSlotCount() < minHeadLessPlayersRequired) {
|
||||
this->serverInterface->getConnectedSlotCount(true) < minHeadLessPlayersRequired) {
|
||||
Lang &lang= Lang::getInstance();
|
||||
const vector<string> languageList = this->serverInterface->getGameSettings()->getUniqueNetworkPlayerLanguages();
|
||||
for(unsigned int i = 0; i < languageList.size(); ++i) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -145,7 +145,7 @@ public:
|
|||
void removeSlot(int playerIndex, int lockedSlotIndex = -1);
|
||||
ConnectionSlot *getSlot(int playerIndex);
|
||||
int getSlotCount();
|
||||
int getConnectedSlotCount();
|
||||
int getConnectedSlotCount(bool authenticated);
|
||||
|
||||
int getOpenSlotCount();
|
||||
bool launchGame(const GameSettings *gameSettings);
|
||||
|
|
Loading…
Reference in New Issue
Block a user