1
0

created callback in Root and changed CheckMultiLogin() to use the DoWithPlayer function at Root instead of World.

This commit is contained in:
Vincent 2014-12-08 00:57:46 -08:00
parent 6de07d4a39
commit e28cc876c4
2 changed files with 9 additions and 2 deletions

View File

@ -1807,7 +1807,7 @@ bool cClientHandle::CheckMultiLogin(const AString & a_Username)
} }
} Callback; } Callback;
if (cRoot::Get()->GetDefaultWorld()->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

@ -651,7 +651,14 @@ bool cRoot::DoWithPlayerByUUID(const AString & a_PlayerUUID, cPlayerListCallback
bool cRoot::DoWithPlayer(const AString & a_PlayerName, cPlayerListCallback & a_Callback) bool cRoot::DoWithPlayer(const AString & a_PlayerName, cPlayerListCallback & a_Callback)
{ {
for (WorldMap::iterator itr = m_WorldsByName.begin(); itr != m_WorldsByName.end(); itr++)
{
if (itr->second->DoWithPlayer(a_PlayerName, a_Callback))
{
return true;
}
}
return false;
} }