Fix a typo in 327fe7c than changed the logic of a function and simplify IsXXXAccount functions
This commit is contained in:
@@ -222,66 +222,27 @@ std::string CalculateShaPassHash(std::string& name, std::string& password)
|
|||||||
|
|
||||||
bool IsPlayerAccount(uint32 gmlevel)
|
bool IsPlayerAccount(uint32 gmlevel)
|
||||||
{
|
{
|
||||||
switch (gmlevel)
|
return gmlevel = SEC_PLAYER;
|
||||||
{
|
|
||||||
case SEC_CONSOLE:
|
|
||||||
case SEC_ADMINISTRATOR:
|
|
||||||
case SEC_GAMEMASTER:
|
|
||||||
case SEC_MODERATOR:
|
|
||||||
return false;
|
|
||||||
default:
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsModeratorAccount(uint32 gmlevel)
|
bool IsModeratorAccount(uint32 gmlevel)
|
||||||
{
|
{
|
||||||
switch (gmlevel)
|
return gmlevel >= SEC_MODERATOR && gmlevel <= SEC_CONSOLE;
|
||||||
{
|
|
||||||
case SEC_CONSOLE:
|
|
||||||
case SEC_ADMINISTRATOR:
|
|
||||||
case SEC_GAMEMASTER:
|
|
||||||
case SEC_MODERATOR:
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsGMAccount(uint32 gmlevel)
|
bool IsGMAccount(uint32 gmlevel)
|
||||||
{
|
{
|
||||||
switch (gmlevel)
|
return gmlevel >= SEC_GAMEMASTER && gmlevel <= SEC_CONSOLE;
|
||||||
{
|
|
||||||
case SEC_CONSOLE:
|
|
||||||
case SEC_ADMINISTRATOR:
|
|
||||||
case SEC_GAMEMASTER:
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsAdminAccount(uint32 gmlevel)
|
bool IsAdminAccount(uint32 gmlevel)
|
||||||
{
|
{
|
||||||
switch (gmlevel)
|
return gmlevel >= SEC_ADMINISTRATOR && gmlevel <= SEC_CONSOLE;
|
||||||
{
|
|
||||||
case SEC_CONSOLE:
|
|
||||||
case SEC_ADMINISTRATOR:
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsConsoleAccount(uint32 gmlevel)
|
bool IsConsoleAccount(uint32 gmlevel)
|
||||||
{
|
{
|
||||||
switch (gmlevel)
|
return gmlevel = SEC_CONSOLE;
|
||||||
{
|
|
||||||
case SEC_CONSOLE:
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // Namespace AccountMgr
|
} // Namespace AccountMgr
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ public:
|
|||||||
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
|
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||||
{
|
{
|
||||||
AccountTypes itr_sec = itr->second->GetSession()->GetSecurity();
|
AccountTypes itr_sec = itr->second->GetSession()->GetSecurity();
|
||||||
if ((itr->second->isGameMaster() || !AccountMgr::IsPlayerAccount((itr_sec) && itr_sec <= AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_GM_LIST)))) &&
|
if ((itr->second->isGameMaster() || (!AccountMgr::IsPlayerAccount(itr_sec) && itr_sec <= AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_GM_LIST)))) &&
|
||||||
(!handler->GetSession() || itr->second->IsVisibleGloballyFor(handler->GetSession()->GetPlayer())))
|
(!handler->GetSession() || itr->second->IsVisibleGloballyFor(handler->GetSession()->GetPlayer())))
|
||||||
{
|
{
|
||||||
if (first)
|
if (first)
|
||||||
|
|||||||
Reference in New Issue
Block a user