1
0

Changed CheckMultiLogin() to not have main body wrapped in an if statement.

Added in indent to cPlayerListCallBack in cCallback class inside CheckMultiLogin().
Added doxy-comment for DoWithPlayer().
Changed comments on IsPlayerInQueue() and IsAllowMultiLogin() to doxy-comments.
This commit is contained in:
Vincent
2014-12-08 14:33:59 -08:00
parent e28cc876c4
commit 12c012fa01
4 changed files with 31 additions and 24 deletions

View File

@@ -1790,31 +1790,34 @@ void cClientHandle::HandleKeepAlive(int a_KeepAliveID)
bool cClientHandle::CheckMultiLogin(const AString & a_Username)
{
if (!(cRoot::Get()->GetServer()->IsAllowMultiLogin()))
// If the multilogin is allowed, skip this check entirely:
if ((cRoot::Get()->GetServer()->IsAllowMultiLogin()))
{
if (cRoot::Get()->GetServer()->IsPlayerInQueue(a_Username))
{
Kick("A player of the username is already logged in");
return false;
}
class cCallback :
public cPlayerListCallback
{
virtual bool Item(cPlayer * a_Player) override
{
return true;
}
} Callback;
if (cRoot::Get()->DoWithPlayer(a_Username, Callback))
{
Kick("A player of the username is already logged in");
return false;
}
return true;
}
return true;
// Check if the player is waiting to be transferred to the World.
if (cRoot::Get()->GetServer()->IsPlayerInQueue(a_Username))
{
Kick("A player of the username is already logged in");
return false;
}
class cCallback :
public cPlayerListCallback
{
virtual bool Item(cPlayer * a_Player) override
{
return true;
}
} Callback;
// Check if the player is in any World.
if (cRoot::Get()->DoWithPlayer(a_Username, Callback))
{
Kick("A player of the username is already logged in");
return false;
}
}