mirror of
https://github.com/glest/glest-source.git
synced 2025-10-02 18:36:48 +02:00
- headless admin cannot start unless min authenticated players are connected
This commit is contained in:
@@ -850,7 +850,7 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) {
|
|||||||
|
|
||||||
int minHeadLessPlayersRequired = Config::getInstance().getInt("MinHeadlessPlayersRequired","2");
|
int minHeadLessPlayersRequired = Config::getInstance().getInt("MinHeadlessPlayersRequired","2");
|
||||||
if(networkMessageLaunch.getMessageType() == nmtLaunch &&
|
if(networkMessageLaunch.getMessageType() == nmtLaunch &&
|
||||||
this->serverInterface->getConnectedSlotCount() < minHeadLessPlayersRequired) {
|
this->serverInterface->getConnectedSlotCount(true) < minHeadLessPlayersRequired) {
|
||||||
Lang &lang= Lang::getInstance();
|
Lang &lang= Lang::getInstance();
|
||||||
const vector<string> languageList = this->serverInterface->getGameSettings()->getUniqueNetworkPlayerLanguages();
|
const vector<string> languageList = this->serverInterface->getGameSettings()->getUniqueNetworkPlayerLanguages();
|
||||||
for(unsigned int i = 0; i < languageList.size(); ++i) {
|
for(unsigned int i = 0; i < languageList.size(); ++i) {
|
||||||
|
@@ -563,12 +563,15 @@ int ServerInterface::getSlotCount() {
|
|||||||
return slotCount;
|
return slotCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ServerInterface::getConnectedSlotCount() {
|
int ServerInterface::getConnectedSlotCount(bool authenticated) {
|
||||||
int connectedSlotCount = 0;
|
int connectedSlotCount = 0;
|
||||||
for(int i= 0; exitServer == false && i < GameConstants::maxPlayers; ++i) {
|
for(int i= 0; exitServer == false && i < GameConstants::maxPlayers; ++i) {
|
||||||
MutexSafeWrapper safeMutexSlot(slotAccessorMutexes[i],CODE_AT_LINE_X(i));
|
MutexSafeWrapper safeMutexSlot(slotAccessorMutexes[i],CODE_AT_LINE_X(i));
|
||||||
if(slots[i] != NULL && slots[i]->isConnected() == true) {
|
if(slots[i] != NULL && slots[i]->isConnected() == true) {
|
||||||
++connectedSlotCount;
|
if(authenticated == false ||
|
||||||
|
(authenticated == true && slots[i]->getConnectHasHandshaked() == true)) {
|
||||||
|
++connectedSlotCount;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return connectedSlotCount;
|
return connectedSlotCount;
|
||||||
|
@@ -145,7 +145,7 @@ public:
|
|||||||
void removeSlot(int playerIndex, int lockedSlotIndex = -1);
|
void removeSlot(int playerIndex, int lockedSlotIndex = -1);
|
||||||
ConnectionSlot *getSlot(int playerIndex);
|
ConnectionSlot *getSlot(int playerIndex);
|
||||||
int getSlotCount();
|
int getSlotCount();
|
||||||
int getConnectedSlotCount();
|
int getConnectedSlotCount(bool authenticated);
|
||||||
|
|
||||||
int getOpenSlotCount();
|
int getOpenSlotCount();
|
||||||
bool launchGame(const GameSettings *gameSettings);
|
bool launchGame(const GameSettings *gameSettings);
|
||||||
|
Reference in New Issue
Block a user