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.
parent
d8d3b9aec5
commit
ed09e76023
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue