[svn] * Use ObjectMgr/AccountMgr functions rather than DB queries. Source mangos
--HG-- branch : trunk
This commit is contained in:
1 parent
96d1c9f4d6
commit
389a9e3cea
4 files changed
+24
-28
No files matched your search
+4
-11
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user