aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Accounts/AccountMgr.cpp
diff options
context:
space:
mode:
authorSpp <spp@jorge.gr>2011-09-08 18:32:52 +0200
committerSpp <spp@jorge.gr>2011-09-08 18:32:52 +0200
commitd46ef045a638903e8c388da0237763105ab761cc (patch)
tree480999ec80f92f10d1de3831f0aa1ce936e4356f /src/server/game/Accounts/AccountMgr.cpp
parent15d220639b93a58aae76d62047185259d8d3e24a (diff)
Fix a typo in 327fe7c than changed the logic of a function and simplify IsXXXAccount functions
Diffstat (limited to 'src/server/game/Accounts/AccountMgr.cpp')
-rwxr-xr-xsrc/server/game/Accounts/AccountMgr.cpp49
1 files changed, 5 insertions, 44 deletions
diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp
index c8870a82966..f2478ae4a6c 100755
--- a/src/server/game/Accounts/AccountMgr.cpp
+++ b/src/server/game/Accounts/AccountMgr.cpp
@@ -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