Fix a typo in 327fe7c than changed the logic of a function and simplify IsXXXAccount functions

This commit is contained in:
Spp
2011-09-08 18:32:52 +02:00
parent 15d220639b
commit d46ef045a6
2 changed files with 6 additions and 45 deletions
+5 -44
View File
@@ -222,66 +222,27 @@ std::string CalculateShaPassHash(std::string& name, std::string& password)
bool IsPlayerAccount(uint32 gmlevel)
{
switch (gmlevel)
{
case SEC_CONSOLE:
case SEC_ADMINISTRATOR:
case SEC_GAMEMASTER:
case SEC_MODERATOR:
return false;
default:
return true;
}
return gmlevel = SEC_PLAYER;
}
bool IsModeratorAccount(uint32 gmlevel)
{
switch (gmlevel)
{
case SEC_CONSOLE:
case SEC_ADMINISTRATOR:
case SEC_GAMEMASTER:
case SEC_MODERATOR:
return true;
default:
return false;
}
return gmlevel >= SEC_MODERATOR && gmlevel <= SEC_CONSOLE;
}
bool IsGMAccount(uint32 gmlevel)
{
switch (gmlevel)
{
case SEC_CONSOLE:
case SEC_ADMINISTRATOR:
case SEC_GAMEMASTER:
return true;
default:
return false;
}
return gmlevel >= SEC_GAMEMASTER && gmlevel <= SEC_CONSOLE;
}
bool IsAdminAccount(uint32 gmlevel)
{
switch (gmlevel)
{
case SEC_CONSOLE:
case SEC_ADMINISTRATOR:
return true;
default:
return false;
}
return gmlevel >= SEC_ADMINISTRATOR && gmlevel <= SEC_CONSOLE;
}
bool IsConsoleAccount(uint32 gmlevel)
{
switch (gmlevel)
{
case SEC_CONSOLE:
return true;
default:
return false;
}
return gmlevel = SEC_CONSOLE;
}
} // Namespace AccountMgr