diff options
| author | KingPin <none@none> | 2008-10-21 19:07:16 -0500 |
|---|---|---|
| committer | KingPin <none@none> | 2008-10-21 19:07:16 -0500 |
| commit | 389a9e3cea196275e13f4eb66ef99fb631607631 (patch) | |
| tree | 1fd3f0fe6b8c6fe61a46a095fa44231cdb8441fb /src/game/Level3.cpp | |
| parent | 96d1c9f4d6194bb5ebc26e12df5d2ee92a0a8032 (diff) | |
[svn] * Use ObjectMgr/AccountMgr functions rather than DB queries. Source mangos
--HG--
branch : trunk
Diffstat (limited to 'src/game/Level3.cpp')
| -rw-r--r-- | src/game/Level3.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index bf25943ea46..64021b3708b 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -4824,25 +4824,18 @@ bool ChatHandler::HandleBanInfoCommand(const char* args) return false; } - loginDatabase.escape_string(nameOrIP); - QueryResult *result = CharacterDatabase.PQuery("SELECT account FROM characters WHERE name = '%s'", nameOrIP.c_str()); - if (!result) + accountid = objmgr.GetPlayerAccountIdByPlayerName (nameOrIP); + if (!accountid) { PSendSysMessage(LANG_BANINFO_NOCHARACTER); return true; } - fields = result->Fetch(); - accountid = fields[0].GetUInt32(); - delete result; - result = loginDatabase.PQuery("SELECT username FROM account WHERE id = '%u'", accountid); - if (!result) + + if (!accmgr.GetName (accountid,accountname)) { PSendSysMessage(LANG_BANINFO_NOCHARACTER); return true; } - fields = result->Fetch(); - accountname = fields[0].GetCppString(); - delete result; } else return false; |
