Changed HandleHandshake to return the result of CheckMultiLogin instead of just true since it already returns true if it finds and kicks the current player.

master
Vincent 2014-12-08 00:16:09 -08:00
parent d8d3b9aec5
commit ed09e76023
1 changed files with 24 additions and 25 deletions

View File

@ -1790,6 +1790,8 @@ void cClientHandle::HandleKeepAlive(int a_KeepAliveID)
bool cClientHandle::CheckMultiLogin(void)
{
if (!(cRoot::Get()->GetServer()->IsAllowMultiLogin()))
{
std::list<AString> usernamesServer = cRoot::Get()->GetServer()->GetUsernames();
for (auto item : usernamesServer)
@ -1815,6 +1817,7 @@ bool cClientHandle::CheckMultiLogin(void)
Kick("A player of the username is already logged in");
return false;
}
}
return true;
}
@ -1834,12 +1837,8 @@ bool cClientHandle::HandleHandshake(const AString & a_Username)
}
}
if (!(cRoot::Get()->GetServer()->IsAllowMultiLogin()))
{
return CheckMultiLogin();
}
return true;
}