servergame GetNumJoinsPerPlayer optimized

This commit is contained in:
Kai Philipp
2016-07-30 19:05:16 +02:00
parent 35f0521bbd
commit 4682b51e40
2 changed files with 5 additions and 5 deletions
+2 -3
View File
@@ -260,11 +260,10 @@ SessionManager::IsGuestAllowedToConnect(const std::string &clientAddress) const
int num = 0;
while (i != end) {
boost::shared_ptr<PlayerData> tmpPlayer(i->second->GetPlayerData());
if(tmpPlayer && tmpPlayer->GetRights() == PLAYER_RIGHTS_GUEST) {
if (tmpPlayer && tmpPlayer->GetRights() == PLAYER_RIGHTS_GUEST) {
num++;
if(i->second->GetClientAddr() == clientAddress) {
if (i->second->GetClientAddr() == clientAddress) {
// guest has same ip as another guest in lobby or
// number of guests in lobby >= SERVER_MAX_GUEST_USERS_LOBBY => not allowed
retVal = false;
break;
}