* Add support for different gmlevel's for different realms.

*
* Using the value -1 will add the same value for all realms.
* Make sure to apply the updates.
* Information regarding this patch will be posted on the database forums soon.
*
* Thanks to Sundark and the Ilixiuemu team(for original patch)

--HG--
branch : trunk
This commit is contained in:
p0wer
2009-12-21 21:08:29 -06:00
parent cad203e680
commit 7590479186
14 changed files with 158 additions and 41 deletions
+7 -2
View File
@@ -498,8 +498,13 @@ bool ChatHandler::HandleGMTicketAssignToCommand(const char* args)
}
uint64 tarGUID = objmgr.GetPlayerGUIDByName(targm.c_str());
uint64 accid = objmgr.GetPlayerAccountIdByGUID(tarGUID);
QueryResult *result = loginDatabase.PQuery("SELECT gmlevel FROM account WHERE id = '%u'", accid);
if(!tarGUID|| !result || result->Fetch()->GetUInt32() < SEC_MODERATOR)
QueryResult *result = loginDatabase.PQuery("SELECT gmlevel RealmID FROM account_access WHERE id = '%u'", accid);
Field * fields = result->Fetch();
uint32 gmlevel = fields[0].GetUInt32();
uint32 SecurityRealmID = fields[1].GetUInt32();
if(!tarGUID|| !result || gmlevel < SEC_MODERATOR || (SecurityRealmID != realmID && SecurityRealmID != -1))
{
SendSysMessage(LANG_COMMAND_TICKETASSIGNERROR_A);
return true;