diff options
| author | Spp- <spp@jorge.gr> | 2011-09-08 15:11:55 +0200 |
|---|---|---|
| committer | Spp- <spp@jorge.gr> | 2011-09-08 15:11:55 +0200 |
| commit | 327fe7c24776d73499f07a91be65b752b03bb838 (patch) | |
| tree | 23664a2a7aaf3435221e1f3da5008b5178453af0 /src/server/game/Accounts/AccountMgr.cpp | |
| parent | d5cbc973730b2d52644c2090e000ef6f096b8c44 (diff) | |
Core: Define helper functions to know if an account is Player, Moderator, GM, Admin or Console
Diffstat (limited to 'src/server/game/Accounts/AccountMgr.cpp')
| -rwxr-xr-x | src/server/game/Accounts/AccountMgr.cpp | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index 0dac657e6f3..5a6c5da38be 100755 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -220,4 +220,70 @@ std::string CalculateShaPassHash(std::string& name, std::string& password) return encoded; } +bool IsPlayerAccount(uint32 gmlevel) +{ + switch (gmlevel) + { + case SEC_CONSOLE: + case SEC_ADMINISTRATOR: + case SEC_GAMEMASTER: + case SEC_MODERATOR: + return false; + default: + return true; + } +} + +bool IsModeratorAccount(uint32 gmlevel) +{ + switch (gmlevel) + { + case SEC_CONSOLE: + case SEC_ADMINISTRATOR: + case SEC_GAMEMASTER: + case SEC_MODERATOR: + return true; + default: + return false; + } +} + +bool IsGMAccount(uint32 gmlevel) +{ + switch (gmlevel) + { + case SEC_CONSOLE: + case SEC_ADMINISTRATOR: + case SEC_GAMEMASTER: + return true; + default: + return false; + } +} + +bool IsAdminAccount(uint32 gmlevel) +{ + switch (gmlevel) + { + case SEC_CONSOLE: + case SEC_ADMINISTRATOR: + case SEC_MODERATOR: + case SEC_PLAYER: + return true; + default: + return false; + } +} + +bool IsConsoleAccount(uint32 gmlevel) +{ + switch (gmlevel) + { + case SEC_CONSOLE: + return true; + default: + return false; + } +} + } // Namespace AccountMgr |
