limted guest login - guest playerrights check done

This commit is contained in:
Kai Philipp
2016-06-18 15:42:38 +02:00
parent 935ec2ad92
commit cf280f0478
2 changed files with 13 additions and 14 deletions
+9 -10
View File
@@ -256,19 +256,18 @@ SessionManager::IsGuestConnectedMultiple(const std::string &clientAddress) const
SessionMap::const_iterator i = m_sessionMap.begin();
SessionMap::const_iterator end = m_sessionMap.end();
int j = 0;
while (i != end) {
// @XXX: comparing PlayerRights does not yet work (e.g. throws an exception)
//if ((*i).second->GetClientAddr() == clientAddress && (*i).second->GetPlayerData()->GetRights() == PLAYER_RIGHTS_GUEST) {
if ((*i).second->GetClientAddr() == clientAddress) {
j++;
}
boost::shared_ptr<PlayerData> tmpPlayer(i->second->GetPlayerData());
// @XXX: productive:
//if(tmpPlayer && tmpPlayer->GetRights() == PLAYER_RIGHTS_GUEST && i->second->GetClientAddr() == clientAddress){
// @XXX: debug:
// if(tmpPlayer && tmpPlayer->GetRights() == PLAYER_RIGHTS_NORMAL && i->second->GetClientAddr() == clientAddress){
if(tmpPlayer && tmpPlayer->GetRights() == PLAYER_RIGHTS_GUEST && i->second->GetClientAddr() == clientAddress){
retVal = true;
break;
}
++i;
}
if (j > 1) {
retVal = true;
}
return retVal;
}