1
0

Fixed indent problems and added return definitions to CheckMultiLogin().

Changed from IsAllowMultiLogin() to DoesAllowMultiLogin().
Fixed CheckMultiLogin() to not run to the end without returning a value.
This commit is contained in:
Vincent 2014-12-09 03:06:25 -08:00
parent e9a27db028
commit 4b08ca261b
3 changed files with 8 additions and 7 deletions

View File

@ -1799,8 +1799,8 @@ bool cClientHandle::CheckMultiLogin(const AString & a_Username)
// Check if the player is waiting to be transferred to the World. // Check if the player is waiting to be transferred to the World.
if (cRoot::Get()->GetServer()->IsPlayerInQueue(a_Username)) if (cRoot::Get()->GetServer()->IsPlayerInQueue(a_Username))
{ {
Kick("A player of the username is already logged in"); Kick("A player of the username is already logged in");
return false; return false;
} }
class cCallback : class cCallback :
@ -1816,8 +1816,8 @@ bool cClientHandle::CheckMultiLogin(const AString & a_Username)
if (cRoot::Get()->DoWithPlayer(a_Username, Callback)) if (cRoot::Get()->DoWithPlayer(a_Username, Callback))
{ {
Kick("A player of the username is already logged in"); Kick("A player of the username is already logged in");
return false;
} }
return false;
} }

View File

@ -280,7 +280,8 @@ public:
void HandleEntityLeaveBed (int a_EntityID); void HandleEntityLeaveBed (int a_EntityID);
void HandleEntitySprinting (int a_EntityID, bool a_IsSprinting); void HandleEntitySprinting (int a_EntityID, bool a_IsSprinting);
/** Kicks the current player if the same username is already logged in. */ /** Kicks the current player if the same username is already logged in.
Returns false if a player has been kicked, true otherwise. */
bool CheckMultiLogin(const AString & a_Username); bool CheckMultiLogin(const AString & a_Username);
/** Called when the protocol handshake has been received (for protocol versions that support it; /** Called when the protocol handshake has been received (for protocol versions that support it;

View File

@ -68,12 +68,12 @@ public: // tolua_export
void SetMaxPlayers(int a_MaxPlayers) { m_MaxPlayers = a_MaxPlayers; } void SetMaxPlayers(int a_MaxPlayers) { m_MaxPlayers = a_MaxPlayers; }
/** Check if the player is queued to be transferred to a World. /** Check if the player is queued to be transferred to a World.
Returns true is Player is found in queue. */ Returns true is Player is found in queue. */
bool IsPlayerInQueue(AString a_Username); bool IsPlayerInQueue(AString a_Username);
/** Can login more than once with same username. /** Can login more than once with same username.
Returns false if it is not allowed, true otherwise. */ Returns false if it is not allowed, true otherwise. */
bool IsAllowMultiLogin(void) { return m_bAllowMultiLogin; } bool DoesAllowMultiLogin(void) { return m_bAllowMultiLogin; }
// Hardcore mode or not: // Hardcore mode or not:
bool IsHardcore(void) const { return m_bIsHardcore; } bool IsHardcore(void) const { return m_bIsHardcore; }