Core: Get rid of dirty operator workaround for ACE_Singleton class implementation
--HG-- branch : trunk
This commit is contained in:
@@ -169,7 +169,7 @@ void Channel::Join(uint64 p, const char *pass)
|
||||
return;
|
||||
}
|
||||
|
||||
Player *plr = sObjectMgr.GetPlayer(p);
|
||||
Player *plr = sObjectMgr->GetPlayer(p);
|
||||
|
||||
if (plr)
|
||||
{
|
||||
@@ -231,7 +231,7 @@ void Channel::Leave(uint64 p, bool send)
|
||||
}
|
||||
else
|
||||
{
|
||||
Player *plr = sObjectMgr.GetPlayer(p);
|
||||
Player *plr = sObjectMgr->GetPlayer(p);
|
||||
|
||||
if (send)
|
||||
{
|
||||
@@ -274,7 +274,7 @@ void Channel::Leave(uint64 p, bool send)
|
||||
void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
|
||||
{
|
||||
AccountTypes sec = SEC_PLAYER;
|
||||
Player *gplr = sObjectMgr.GetPlayer(good);
|
||||
Player *gplr = sObjectMgr->GetPlayer(good);
|
||||
if (gplr)
|
||||
sec = gplr->GetSession()->GetSecurity();
|
||||
|
||||
@@ -292,7 +292,7 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
|
||||
}
|
||||
else
|
||||
{
|
||||
Player *bad = sObjectMgr.GetPlayer(badname);
|
||||
Player *bad = sObjectMgr->GetPlayer(badname);
|
||||
if (bad == NULL || !IsOn(bad->GetGUID()))
|
||||
{
|
||||
WorldPacket data;
|
||||
@@ -338,7 +338,7 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
|
||||
void Channel::UnBan(uint64 good, const char *badname)
|
||||
{
|
||||
uint32 sec = 0;
|
||||
Player *gplr = sObjectMgr.GetPlayer(good);
|
||||
Player *gplr = sObjectMgr->GetPlayer(good);
|
||||
if (gplr)
|
||||
sec = gplr->GetSession()->GetSecurity();
|
||||
|
||||
@@ -356,7 +356,7 @@ void Channel::UnBan(uint64 good, const char *badname)
|
||||
}
|
||||
else
|
||||
{
|
||||
Player *bad = sObjectMgr.GetPlayer(badname);
|
||||
Player *bad = sObjectMgr->GetPlayer(badname);
|
||||
if (bad == NULL || !IsBanned(bad->GetGUID()))
|
||||
{
|
||||
WorldPacket data;
|
||||
@@ -380,7 +380,7 @@ void Channel::Password(uint64 p, const char *pass)
|
||||
{
|
||||
std::string plName;
|
||||
uint32 sec = 0;
|
||||
Player *plr = sObjectMgr.GetPlayer(p);
|
||||
Player *plr = sObjectMgr->GetPlayer(p);
|
||||
if (plr)
|
||||
sec = plr->GetSession()->GetSecurity();
|
||||
|
||||
@@ -412,7 +412,7 @@ void Channel::Password(uint64 p, const char *pass)
|
||||
|
||||
void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
|
||||
{
|
||||
Player *plr = sObjectMgr.GetPlayer(p);
|
||||
Player *plr = sObjectMgr->GetPlayer(p);
|
||||
if (!plr)
|
||||
return;
|
||||
|
||||
@@ -432,7 +432,7 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
|
||||
}
|
||||
else
|
||||
{
|
||||
Player *newp = sObjectMgr.GetPlayer(p2n);
|
||||
Player *newp = sObjectMgr->GetPlayer(p2n);
|
||||
if (!newp)
|
||||
{
|
||||
WorldPacket data;
|
||||
@@ -480,7 +480,7 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
|
||||
|
||||
void Channel::SetOwner(uint64 p, const char *newname)
|
||||
{
|
||||
Player *plr = sObjectMgr.GetPlayer(p);
|
||||
Player *plr = sObjectMgr->GetPlayer(p);
|
||||
if (!plr)
|
||||
return;
|
||||
|
||||
@@ -502,7 +502,7 @@ void Channel::SetOwner(uint64 p, const char *newname)
|
||||
return;
|
||||
}
|
||||
|
||||
Player *newp = sObjectMgr.GetPlayer(newname);
|
||||
Player *newp = sObjectMgr->GetPlayer(newname);
|
||||
if (newp == NULL || !IsOn(newp->GetGUID()))
|
||||
{
|
||||
WorldPacket data;
|
||||
@@ -564,7 +564,7 @@ void Channel::List(Player* player)
|
||||
uint32 count = 0;
|
||||
for (PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
||||
{
|
||||
Player *plr = sObjectMgr.GetPlayer(i->first);
|
||||
Player *plr = sObjectMgr->GetPlayer(i->first);
|
||||
|
||||
// PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
|
||||
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
|
||||
@@ -586,7 +586,7 @@ void Channel::List(Player* player)
|
||||
void Channel::Announce(uint64 p)
|
||||
{
|
||||
uint32 sec = 0;
|
||||
Player *plr = sObjectMgr.GetPlayer(p);
|
||||
Player *plr = sObjectMgr->GetPlayer(p);
|
||||
if (plr)
|
||||
sec = plr->GetSession()->GetSecurity();
|
||||
|
||||
@@ -624,7 +624,7 @@ void Channel::Say(uint64 p, const char *what, uint32 lang)
|
||||
if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
|
||||
lang = LANG_UNIVERSAL;
|
||||
|
||||
Player *plr = sObjectMgr.GetPlayer(p);
|
||||
Player *plr = sObjectMgr->GetPlayer(p);
|
||||
|
||||
if (!IsOn(p))
|
||||
{
|
||||
@@ -667,7 +667,7 @@ void Channel::Invite(uint64 p, const char *newname)
|
||||
return;
|
||||
}
|
||||
|
||||
Player *newp = sObjectMgr.GetPlayer(newname);
|
||||
Player *newp = sObjectMgr->GetPlayer(newname);
|
||||
if (!newp)
|
||||
{
|
||||
WorldPacket data;
|
||||
@@ -684,7 +684,7 @@ void Channel::Invite(uint64 p, const char *newname)
|
||||
return;
|
||||
}
|
||||
|
||||
Player *plr = sObjectMgr.GetPlayer(p);
|
||||
Player *plr = sObjectMgr->GetPlayer(p);
|
||||
if (!plr)
|
||||
return;
|
||||
|
||||
@@ -750,7 +750,7 @@ void Channel::SendToAll(WorldPacket *data, uint64 p)
|
||||
{
|
||||
for (PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
||||
{
|
||||
Player *plr = sObjectMgr.GetPlayer(i->first);
|
||||
Player *plr = sObjectMgr->GetPlayer(i->first);
|
||||
if (plr)
|
||||
{
|
||||
if (!p || !plr->GetSocial()->HasIgnore(GUID_LOPART(p)))
|
||||
@@ -765,7 +765,7 @@ void Channel::SendToAllButOne(WorldPacket *data, uint64 who)
|
||||
{
|
||||
if (i->first != who)
|
||||
{
|
||||
Player *plr = sObjectMgr.GetPlayer(i->first);
|
||||
Player *plr = sObjectMgr->GetPlayer(i->first);
|
||||
if (plr)
|
||||
plr->GetSession()->SendPacket(data);
|
||||
}
|
||||
@@ -774,7 +774,7 @@ void Channel::SendToAllButOne(WorldPacket *data, uint64 who)
|
||||
|
||||
void Channel::SendToOne(WorldPacket *data, uint64 who)
|
||||
{
|
||||
Player *plr = sObjectMgr.GetPlayer(who);
|
||||
Player *plr = sObjectMgr->GetPlayer(who);
|
||||
if (plr)
|
||||
plr->GetSession()->SendPacket(data);
|
||||
}
|
||||
@@ -878,7 +878,7 @@ void Channel::MakeChannelOwner(WorldPacket *data)
|
||||
{
|
||||
std::string name = "";
|
||||
|
||||
if (!sObjectMgr.GetPlayerNameByGUID(m_ownerGUID, name) || name.empty())
|
||||
if (!sObjectMgr->GetPlayerNameByGUID(m_ownerGUID, name) || name.empty())
|
||||
name = "PLAYER_NOT_FOUND";
|
||||
|
||||
MakeNotifyPacket(data, CHAT_CHANNEL_OWNER_NOTICE);
|
||||
|
||||
@@ -452,7 +452,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
{
|
||||
// count total number of top-level commands
|
||||
size_t total = getCommandTableSize(commandTable);
|
||||
std::vector<ChatCommand*> const& dynamic = sScriptMgr.GetChatCommands();
|
||||
std::vector<ChatCommand*> const& dynamic = sScriptMgr->GetChatCommands();
|
||||
for (std::vector<ChatCommand*>::const_iterator it = dynamic.begin(); it != dynamic.end(); ++it)
|
||||
total += getCommandTableSize(*it);
|
||||
total += 1; // ending zero
|
||||
@@ -502,7 +502,7 @@ bool ChatHandler::HasLowerSecurity(Player* target, uint64 guid, bool strong)
|
||||
if (target)
|
||||
target_session = target->GetSession();
|
||||
else if (guid)
|
||||
target_account = sObjectMgr.GetPlayerAccountIdByGUID(guid);
|
||||
target_account = sObjectMgr->GetPlayerAccountIdByGUID(guid);
|
||||
|
||||
if (!target_session && !target_account)
|
||||
{
|
||||
@@ -529,7 +529,7 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac
|
||||
if (target)
|
||||
target_sec = target->GetSecurity();
|
||||
else if (target_account)
|
||||
target_sec = sAccountMgr.GetSecurity(target_account);
|
||||
target_sec = sAccountMgr->GetSecurity(target_account);
|
||||
else
|
||||
return true; // caller must report error for (target == NULL && target_account == 0)
|
||||
|
||||
@@ -1091,7 +1091,7 @@ valid examples:
|
||||
c = reader.peek();
|
||||
}
|
||||
|
||||
linkedQuest = sObjectMgr.GetQuestTemplate(questid);
|
||||
linkedQuest = sObjectMgr->GetQuestTemplate(questid);
|
||||
|
||||
if (!linkedQuest)
|
||||
{
|
||||
@@ -1262,7 +1262,7 @@ valid examples:
|
||||
if (linkedSpell->Attributes & SPELL_ATTR0_TRADESPELL)
|
||||
{
|
||||
// lookup skillid
|
||||
SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(linkedSpell->Id);
|
||||
SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(linkedSpell->Id);
|
||||
if (bounds.first == bounds.second)
|
||||
{
|
||||
return false;
|
||||
@@ -1309,7 +1309,7 @@ valid examples:
|
||||
{
|
||||
if (linkedQuest->GetTitle() != buffer)
|
||||
{
|
||||
QuestLocale const *ql = sObjectMgr.GetQuestLocale(linkedQuest->GetQuestId());
|
||||
QuestLocale const *ql = sObjectMgr->GetQuestLocale(linkedQuest->GetQuestId());
|
||||
|
||||
if (!ql)
|
||||
{
|
||||
@@ -1350,7 +1350,7 @@ valid examples:
|
||||
|
||||
if (expectedName != buffer)
|
||||
{
|
||||
ItemLocale const *il = sObjectMgr.GetItemLocale(linkedItem->ItemId);
|
||||
ItemLocale const *il = sObjectMgr->GetItemLocale(linkedItem->ItemId);
|
||||
|
||||
bool foundName = false;
|
||||
for (uint8 dbIndex = LOCALE_koKR; dbIndex < TOTAL_LOCALES; ++dbIndex)
|
||||
@@ -1606,7 +1606,7 @@ Player * ChatHandler::getSelectedPlayer()
|
||||
if (guid == 0)
|
||||
return m_session->GetPlayer();
|
||||
|
||||
return sObjectMgr.GetPlayer(guid);
|
||||
return sObjectMgr->GetPlayer(guid);
|
||||
}
|
||||
|
||||
Unit* ChatHandler::getSelectedUnit()
|
||||
@@ -1809,7 +1809,7 @@ GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid
|
||||
|
||||
GameObject* obj = pl->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid, entry, HIGHGUID_GAMEOBJECT));
|
||||
|
||||
if (!obj && sObjectMgr.GetGOData(lowguid)) // guid is DB guid of object
|
||||
if (!obj && sObjectMgr->GetGOData(lowguid)) // guid is DB guid of object
|
||||
{
|
||||
// search near player then
|
||||
CellPair p(Trinity::ComputeCellPair(pl->GetPositionX(), pl->GetPositionY()));
|
||||
@@ -1909,9 +1909,9 @@ GameTele const* ChatHandler::extractGameTeleFromLink(char* text)
|
||||
// id case (explicit or from shift link)
|
||||
if (cId[0] >= '0' || cId[0] >= '9')
|
||||
if (uint32 id = atoi(cId))
|
||||
return sObjectMgr.GetGameTele(id);
|
||||
return sObjectMgr->GetGameTele(id);
|
||||
|
||||
return sObjectMgr.GetGameTele(cId);
|
||||
return sObjectMgr->GetGameTele(cId);
|
||||
}
|
||||
|
||||
enum GuidLinkType
|
||||
@@ -1948,10 +1948,10 @@ uint64 ChatHandler::extractGuidFromLink(char* text)
|
||||
if (!normalizePlayerName(name))
|
||||
return 0;
|
||||
|
||||
if (Player* player = sObjectMgr.GetPlayer(name.c_str()))
|
||||
if (Player* player = sObjectMgr->GetPlayer(name.c_str()))
|
||||
return player->GetGUID();
|
||||
|
||||
if (uint64 guid = sObjectMgr.GetPlayerGUIDByName(name))
|
||||
if (uint64 guid = sObjectMgr->GetPlayerGUIDByName(name))
|
||||
return guid;
|
||||
|
||||
return 0;
|
||||
@@ -1960,7 +1960,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text)
|
||||
{
|
||||
uint32 lowguid = (uint32)atol(idS);
|
||||
|
||||
if (CreatureData const* data = sObjectMgr.GetCreatureData(lowguid))
|
||||
if (CreatureData const* data = sObjectMgr->GetCreatureData(lowguid))
|
||||
return MAKE_NEW_GUID(lowguid,data->id,HIGHGUID_UNIT);
|
||||
else
|
||||
return 0;
|
||||
@@ -1969,7 +1969,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text)
|
||||
{
|
||||
uint32 lowguid = (uint32)atol(idS);
|
||||
|
||||
if (GameObjectData const* data = sObjectMgr.GetGOData(lowguid))
|
||||
if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid))
|
||||
return MAKE_NEW_GUID(lowguid,data->id,HIGHGUID_GAMEOBJECT);
|
||||
else
|
||||
return 0;
|
||||
@@ -2006,14 +2006,14 @@ bool ChatHandler::extractPlayerTarget(char* args, Player** player, uint64* playe
|
||||
return false;
|
||||
}
|
||||
|
||||
Player* pl = sObjectMgr.GetPlayer(name.c_str());
|
||||
Player* pl = sObjectMgr->GetPlayer(name.c_str());
|
||||
|
||||
// if allowed player pointer
|
||||
if (player)
|
||||
*player = pl;
|
||||
|
||||
// if need guid value from DB (in name case for check player existence)
|
||||
uint64 guid = !pl && (player_guid || player_name) ? sObjectMgr.GetPlayerGUIDByName(name) : 0;
|
||||
uint64 guid = !pl && (player_guid || player_name) ? sObjectMgr->GetPlayerGUIDByName(name) : 0;
|
||||
|
||||
// if allowed player guid (if no then only online players allowed)
|
||||
if (player_guid)
|
||||
@@ -2099,7 +2099,7 @@ int ChatHandler::GetSessionDbLocaleIndex() const
|
||||
|
||||
const char *CliHandler::GetTrinityString(int32 entry) const
|
||||
{
|
||||
return sObjectMgr.GetTrinityStringForDBCLocale(entry);
|
||||
return sObjectMgr->GetTrinityStringForDBCLocale(entry);
|
||||
}
|
||||
|
||||
bool CliHandler::isAvailable(ChatCommand const& cmd) const
|
||||
@@ -2141,9 +2141,9 @@ bool ChatHandler::GetPlayerGroupAndGUIDByName(const char* cname, Player* &plr, G
|
||||
return false;
|
||||
}
|
||||
|
||||
plr = sObjectMgr.GetPlayer(name.c_str());
|
||||
plr = sObjectMgr->GetPlayer(name.c_str());
|
||||
if (offline)
|
||||
guid = sObjectMgr.GetPlayerGUIDByName(name.c_str());
|
||||
guid = sObjectMgr->GetPlayerGUIDByName(name.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2175,5 +2175,5 @@ LocaleConstant CliHandler::GetSessionDbcLocale() const
|
||||
|
||||
int CliHandler::GetSessionDbLocaleIndex() const
|
||||
{
|
||||
return sObjectMgr.GetDBCLocaleIndex();
|
||||
return sObjectMgr->GetDBCLocaleIndex();
|
||||
}
|
||||
|
||||
@@ -405,7 +405,7 @@ bool ChatHandler::HandleAppearCommand(const char* args)
|
||||
// if no bind exists, create a solo bind
|
||||
InstanceGroupBind *gBind = group ? group->GetBoundInstance(target) : NULL; // if no bind exists, create a solo bind
|
||||
if (!gBind)
|
||||
if (InstanceSave *save = sInstanceSaveMgr.GetInstanceSave(target->GetInstanceId()))
|
||||
if (InstanceSave *save = sInstanceSaveMgr->GetInstanceSave(target->GetInstanceId()))
|
||||
_player->BindToInstance(save, !save->CanReset());
|
||||
}
|
||||
|
||||
@@ -645,7 +645,7 @@ bool ChatHandler::HandleLookupTeleCommand(const char * args)
|
||||
uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
bool limitReached = false;
|
||||
|
||||
GameTeleMap const & teleMap = sObjectMgr.GetGameTeleMap();
|
||||
GameTeleMap const & teleMap = sObjectMgr->GetGameTeleMap();
|
||||
for (GameTeleMap::const_iterator itr = teleMap.begin(); itr != teleMap.end(); ++itr)
|
||||
{
|
||||
GameTele const* tele = &itr->second;
|
||||
|
||||
@@ -63,7 +63,7 @@ bool ChatHandler::HandleMuteCommand(const char* args)
|
||||
if (!extractPlayerTarget(nameStr,&target,&target_guid,&target_name))
|
||||
return false;
|
||||
|
||||
uint32 account_id = target ? target->GetSession()->GetAccountId() : sObjectMgr.GetPlayerAccountIdByGUID(target_guid);
|
||||
uint32 account_id = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(target_guid);
|
||||
|
||||
// find only player from same account if any
|
||||
if (!target)
|
||||
@@ -102,7 +102,7 @@ bool ChatHandler::HandleUnmuteCommand(const char* args)
|
||||
if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name))
|
||||
return false;
|
||||
|
||||
uint32 account_id = target ? target->GetSession()->GetAccountId() : sObjectMgr.GetPlayerAccountIdByGUID(target_guid);
|
||||
uint32 account_id = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(target_guid);
|
||||
|
||||
// find only player from same account if any
|
||||
if (!target)
|
||||
@@ -530,8 +530,8 @@ bool ChatHandler::HandleLookupEventCommand(const char* args)
|
||||
uint32 count = 0;
|
||||
uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
|
||||
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
|
||||
GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr.GetActiveEventList();
|
||||
GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
|
||||
GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr->GetActiveEventList();
|
||||
|
||||
for (uint32 id = 0; id < events.size(); ++id)
|
||||
{
|
||||
@@ -809,7 +809,7 @@ bool ChatHandler::HandleCreatePetCommand(const char* /*args*/)
|
||||
// prepare visual effect for levelup
|
||||
pet->SetUInt32Value(UNIT_FIELD_LEVEL,creatureTarget->getLevel()-1);
|
||||
|
||||
pet->GetCharmInfo()->SetPetNumber(sObjectMgr.GeneratePetNumber(), true);
|
||||
pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true);
|
||||
// this enables pet details window (Shift+P)
|
||||
pet->InitPetCreateSpells();
|
||||
pet->SetFullHealth();
|
||||
|
||||
@@ -159,7 +159,7 @@ bool ChatHandler::HandleUnLearnCommand(const char *args)
|
||||
}
|
||||
|
||||
if (allRanks)
|
||||
spell_id = sSpellMgr.GetFirstSpellInChain (spell_id);
|
||||
spell_id = sSpellMgr->GetFirstSpellInChain (spell_id);
|
||||
|
||||
if (target->HasSpell(spell_id))
|
||||
target->removeSpell(spell_id,false,!allRanks);
|
||||
@@ -769,7 +769,7 @@ bool ChatHandler::HandleLookupItemCommand(const char *args)
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
uint8 uloc_idx = uint8(loc_idx);
|
||||
if (ItemLocale const *il = sObjectMgr.GetItemLocale(pProto->ItemId))
|
||||
if (ItemLocale const *il = sObjectMgr->GetItemLocale(pProto->ItemId))
|
||||
{
|
||||
if (il->Name.size() > uloc_idx && !il->Name[uloc_idx].empty())
|
||||
{
|
||||
@@ -1050,7 +1050,7 @@ bool ChatHandler::HandleLookupSpellCommand(const char *args)
|
||||
|
||||
// unit32 used to prevent interpreting uint8 as char at output
|
||||
// find rank of learned spell for learning spell, or talent rank
|
||||
uint32 rank = talentCost ? talentCost : sSpellMgr.GetSpellRank(learn ? spellInfo->EffectTriggerSpell[0] : id);
|
||||
uint32 rank = talentCost ? talentCost : sSpellMgr->GetSpellRank(learn ? spellInfo->EffectTriggerSpell[0] : id);
|
||||
|
||||
// send spell in "id - [name, rank N] [talent] [passive] [learn] [known]" format
|
||||
std::ostringstream ss;
|
||||
@@ -1112,7 +1112,7 @@ bool ChatHandler::HandleLookupQuestCommand(const char *args)
|
||||
uint32 count = 0;
|
||||
uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
|
||||
ObjectMgr::QuestMap const& qTemplates = sObjectMgr.GetQuestTemplates();
|
||||
ObjectMgr::QuestMap const& qTemplates = sObjectMgr->GetQuestTemplates();
|
||||
for (ObjectMgr::QuestMap::const_iterator iter = qTemplates.begin(); iter != qTemplates.end(); ++iter)
|
||||
{
|
||||
Quest * qinfo = iter->second;
|
||||
@@ -1121,7 +1121,7 @@ bool ChatHandler::HandleLookupQuestCommand(const char *args)
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
uint8 uloc_idx = uint8(loc_idx);
|
||||
if (QuestLocale const *il = sObjectMgr.GetQuestLocale(qinfo->GetQuestId()))
|
||||
if (QuestLocale const *il = sObjectMgr->GetQuestLocale(qinfo->GetQuestId()))
|
||||
{
|
||||
if (il->Title.size() > uloc_idx && !il->Title[uloc_idx].empty())
|
||||
{
|
||||
@@ -1239,7 +1239,7 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args)
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
uint8 uloc_idx = uint8(loc_idx);
|
||||
if (CreatureLocale const *cl = sObjectMgr.GetCreatureLocale (id))
|
||||
if (CreatureLocale const *cl = sObjectMgr->GetCreatureLocale (id))
|
||||
{
|
||||
if (cl->Name.size() > uloc_idx && !cl->Name[uloc_idx].empty ())
|
||||
{
|
||||
@@ -1323,7 +1323,7 @@ bool ChatHandler::HandleLookupObjectCommand(const char *args)
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
uint8 uloc_idx = uint8(loc_idx);
|
||||
if (GameObjectLocale const *gl = sObjectMgr.GetGameObjectLocale(id))
|
||||
if (GameObjectLocale const *gl = sObjectMgr->GetGameObjectLocale(id))
|
||||
{
|
||||
if (gl->Name.size() > uloc_idx && !gl->Name[uloc_idx].empty())
|
||||
{
|
||||
@@ -1702,7 +1702,7 @@ bool ChatHandler::HandleGuildCreateCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
sObjectMgr.AddGuild (guild);
|
||||
sObjectMgr->AddGuild (guild);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1725,7 +1725,7 @@ bool ChatHandler::HandleGuildInviteCommand(const char *args)
|
||||
return false;
|
||||
|
||||
std::string glName = guildStr;
|
||||
Guild* targetGuild = sObjectMgr.GetGuildByName (glName);
|
||||
Guild* targetGuild = sObjectMgr->GetGuildByName (glName);
|
||||
if (!targetGuild)
|
||||
return false;
|
||||
|
||||
@@ -1745,7 +1745,7 @@ bool ChatHandler::HandleGuildUninviteCommand(const char *args)
|
||||
if (!glId)
|
||||
return false;
|
||||
|
||||
Guild* targetGuild = sObjectMgr.GetGuildById (glId);
|
||||
Guild* targetGuild = sObjectMgr->GetGuildById (glId);
|
||||
if (!targetGuild)
|
||||
return false;
|
||||
|
||||
@@ -1771,7 +1771,7 @@ bool ChatHandler::HandleGuildRankCommand(const char *args)
|
||||
if (!glId)
|
||||
return false;
|
||||
|
||||
Guild* targetGuild = sObjectMgr.GetGuildById (glId);
|
||||
Guild* targetGuild = sObjectMgr->GetGuildById (glId);
|
||||
if (!targetGuild)
|
||||
return false;
|
||||
|
||||
@@ -1790,7 +1790,7 @@ bool ChatHandler::HandleGuildDeleteCommand(const char *args)
|
||||
|
||||
std::string gld = guildStr;
|
||||
|
||||
Guild* targetGuild = sObjectMgr.GetGuildByName (gld);
|
||||
Guild* targetGuild = sObjectMgr->GetGuildByName (gld);
|
||||
if (!targetGuild)
|
||||
return false;
|
||||
|
||||
@@ -2050,7 +2050,7 @@ bool ChatHandler::HandleLinkGraveCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sObjectMgr.AddGraveYardLink(g_id,zoneId,g_team))
|
||||
if (sObjectMgr->AddGraveYardLink(g_id,zoneId,g_team))
|
||||
PSendSysMessage(LANG_COMMAND_GRAVEYARDLINKED, g_id,zoneId);
|
||||
else
|
||||
PSendSysMessage(LANG_COMMAND_GRAVEYARDALRLINKED, g_id,zoneId);
|
||||
@@ -2076,14 +2076,14 @@ bool ChatHandler::HandleNearGraveCommand(const char *args)
|
||||
Player* player = m_session->GetPlayer();
|
||||
uint32 zone_id = player->GetZoneId();
|
||||
|
||||
WorldSafeLocsEntry const* graveyard = sObjectMgr.GetClosestGraveYard(
|
||||
WorldSafeLocsEntry const* graveyard = sObjectMgr->GetClosestGraveYard(
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(),player->GetMapId(),g_team);
|
||||
|
||||
if (graveyard)
|
||||
{
|
||||
uint32 g_id = graveyard->ID;
|
||||
|
||||
GraveYardData const* data = sObjectMgr.FindGraveYardData(g_id,zone_id);
|
||||
GraveYardData const* data = sObjectMgr->FindGraveYardData(g_id,zone_id);
|
||||
if (!data)
|
||||
{
|
||||
PSendSysMessage(LANG_COMMAND_GRAVEYARDERROR,g_id);
|
||||
@@ -2387,10 +2387,10 @@ bool ChatHandler::HandleChangeWeather(const char *args)
|
||||
Player *player = m_session->GetPlayer();
|
||||
uint32 zoneid = player->GetZoneId();
|
||||
|
||||
Weather* wth = sWeatherMgr.FindWeather(zoneid);
|
||||
Weather* wth = sWeatherMgr->FindWeather(zoneid);
|
||||
|
||||
if (!wth)
|
||||
wth = sWeatherMgr.AddWeather(zoneid);
|
||||
wth = sWeatherMgr->AddWeather(zoneid);
|
||||
if (!wth)
|
||||
{
|
||||
SendSysMessage(LANG_NO_WEATHER);
|
||||
@@ -2551,7 +2551,7 @@ bool ChatHandler::HandleResetLevelCommand(const char * args)
|
||||
? sWorld.getIntConfig(CONFIG_START_PLAYER_LEVEL)
|
||||
: sWorld.getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
|
||||
|
||||
sScriptMgr.OnPlayerLevelChanged(target, start_level);
|
||||
sScriptMgr->OnPlayerLevelChanged(target, start_level);
|
||||
|
||||
target->_ApplyAllLevelScaleItemMods(false);
|
||||
target->SetLevel(start_level);
|
||||
@@ -3098,7 +3098,7 @@ bool ChatHandler::HandleBanInfoAccountCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 accountid = sAccountMgr.GetId(account_name);
|
||||
uint32 accountid = sAccountMgr->GetId(account_name);
|
||||
if (!accountid)
|
||||
{
|
||||
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
|
||||
@@ -3113,7 +3113,7 @@ bool ChatHandler::HandleBanInfoCharacterCommand(const char *args)
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
Player* target = sObjectMgr.GetPlayer(args);
|
||||
Player* target = sObjectMgr->GetPlayer(args);
|
||||
uint32 target_guid = 0;
|
||||
std::string name(args);
|
||||
|
||||
@@ -3372,7 +3372,7 @@ bool ChatHandler::HandleBanListHelper(QueryResult result)
|
||||
account_name = fields[1].GetString();
|
||||
// "character" case, name need extract from another DB
|
||||
else
|
||||
sAccountMgr.GetName (account_id,account_name);
|
||||
sAccountMgr->GetName (account_id,account_name);
|
||||
|
||||
// No SQL injection. id is uint32.
|
||||
QueryResult banInfo = LoginDatabase.PQuery("SELECT bandate,unbandate,bannedby,banreason FROM account_banned WHERE id = %u ORDER BY unbandate", account_id);
|
||||
@@ -3535,7 +3535,7 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 account_id = sAccountMgr.GetId(account_name);
|
||||
uint32 account_id = sAccountMgr->GetId(account_name);
|
||||
if (!account_id)
|
||||
{
|
||||
account_id = atoi(account); // use original string
|
||||
@@ -3547,7 +3547,7 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args)
|
||||
}
|
||||
}
|
||||
|
||||
if (!sAccountMgr.GetName(account_id,account_name))
|
||||
if (!sAccountMgr->GetName(account_id,account_name))
|
||||
{
|
||||
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
@@ -3591,7 +3591,7 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sObjectMgr.GetPlayerAccountIdByGUID(guid))
|
||||
if (sObjectMgr->GetPlayerAccountIdByGUID(guid))
|
||||
{
|
||||
PSendSysMessage(LANG_CHARACTER_GUID_IN_USE,guid);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -3650,10 +3650,10 @@ bool ChatHandler::HandlePDumpWriteCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
guid = sObjectMgr.GetPlayerGUIDByName(name);
|
||||
guid = sObjectMgr->GetPlayerGUIDByName(name);
|
||||
}
|
||||
|
||||
if (!sObjectMgr.GetPlayerAccountIdByGUID(guid))
|
||||
if (!sObjectMgr->GetPlayerAccountIdByGUID(guid))
|
||||
{
|
||||
PSendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -4148,11 +4148,11 @@ bool ChatHandler::HandleInstanceUnbindCommand(const char *args)
|
||||
|
||||
bool ChatHandler::HandleInstanceStatsCommand(const char* /*args*/)
|
||||
{
|
||||
PSendSysMessage("instances loaded: %d", sMapMgr.GetNumInstances());
|
||||
PSendSysMessage("players in instances: %d", sMapMgr.GetNumPlayersInInstances());
|
||||
PSendSysMessage("instance saves: %d", sInstanceSaveMgr.GetNumInstanceSaves());
|
||||
PSendSysMessage("players bound: %d", sInstanceSaveMgr.GetNumBoundPlayersTotal());
|
||||
PSendSysMessage("groups bound: %d", sInstanceSaveMgr.GetNumBoundGroupsTotal());
|
||||
PSendSysMessage("instances loaded: %d", sMapMgr->GetNumInstances());
|
||||
PSendSysMessage("players in instances: %d", sMapMgr->GetNumPlayersInInstances());
|
||||
PSendSysMessage("instance saves: %d", sInstanceSaveMgr->GetNumInstanceSaves());
|
||||
PSendSysMessage("players bound: %d", sInstanceSaveMgr->GetNumBoundPlayersTotal());
|
||||
PSendSysMessage("groups bound: %d", sInstanceSaveMgr->GetNumBoundGroupsTotal());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -4404,7 +4404,7 @@ bool ChatHandler::HandleSendMessageCommand(const char *args)
|
||||
|
||||
bool ChatHandler::HandleFlushArenaPointsCommand(const char * /*args*/)
|
||||
{
|
||||
sBattlegroundMgr.DistributeArenaPoints();
|
||||
sBattlegroundMgr->DistributeArenaPoints();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -4489,7 +4489,7 @@ bool ChatHandler::HandleFreezeCommand(const char *args)
|
||||
{
|
||||
name = TargetName;
|
||||
normalizePlayerName(name);
|
||||
player = sObjectMgr.GetPlayer(name.c_str()); //get player by name
|
||||
player = sObjectMgr->GetPlayer(name.c_str()); //get player by name
|
||||
}
|
||||
|
||||
if (!player)
|
||||
@@ -4554,7 +4554,7 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args)
|
||||
{
|
||||
name = TargetName;
|
||||
normalizePlayerName(name);
|
||||
player = sObjectMgr.GetPlayer(name.c_str()); //get player by name
|
||||
player = sObjectMgr->GetPlayer(name.c_str()); //get player by name
|
||||
}
|
||||
|
||||
//effect
|
||||
|
||||
@@ -39,7 +39,7 @@ std::string ChatHandler::PGetParseString(int32 entry, ...)
|
||||
bool ChatHandler::HandleGMTicketListCommand(const char* /*args*/)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETSHOWLIST);
|
||||
for (GmTicketList::iterator itr = sTicketMgr.m_GMTicketList.begin(); itr != sTicketMgr.m_GMTicketList.end(); ++itr)
|
||||
for (GmTicketList::iterator itr = sTicketMgr->m_GMTicketList.begin(); itr != sTicketMgr->m_GMTicketList.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->closed != 0 || (*itr)->completed)
|
||||
continue;
|
||||
@@ -50,7 +50,7 @@ bool ChatHandler::HandleGMTicketListCommand(const char* /*args*/)
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTAGECREATE, (secsToTimeString(time(NULL) - (*itr)->createtime, true, false)).c_str());
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTAGE, (secsToTimeString(time(NULL) - (*itr)->timestamp, true, false)).c_str());
|
||||
|
||||
if (sObjectMgr.GetPlayerNameByGUID((*itr)->assignedToGM, gmname))
|
||||
if (sObjectMgr->GetPlayerNameByGUID((*itr)->assignedToGM, gmname))
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str());
|
||||
|
||||
SendSysMessage(ss.str().c_str());
|
||||
@@ -61,9 +61,9 @@ bool ChatHandler::HandleGMTicketListCommand(const char* /*args*/)
|
||||
bool ChatHandler::HandleGMTicketListOnlineCommand(const char* /*args*/)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETSHOWONLINELIST);
|
||||
for (GmTicketList::iterator itr = sTicketMgr.m_GMTicketList.begin(); itr != sTicketMgr.m_GMTicketList.end(); ++itr)
|
||||
for (GmTicketList::iterator itr = sTicketMgr->m_GMTicketList.begin(); itr != sTicketMgr->m_GMTicketList.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->closed != 0 || (*itr)->completed || !sObjectMgr.GetPlayer((*itr)->playerGuid))
|
||||
if ((*itr)->closed != 0 || (*itr)->completed || !sObjectMgr->GetPlayer((*itr)->playerGuid))
|
||||
continue;
|
||||
|
||||
std::string gmname;
|
||||
@@ -72,7 +72,7 @@ bool ChatHandler::HandleGMTicketListOnlineCommand(const char* /*args*/)
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, (*itr)->name.c_str());
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTAGECREATE, (secsToTimeString(time(NULL) - (*itr)->createtime, true, false)).c_str());
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTAGE, (secsToTimeString(time(NULL) - (*itr)->timestamp, true, false)).c_str());
|
||||
if (sObjectMgr.GetPlayerNameByGUID((*itr)->assignedToGM, gmname))
|
||||
if (sObjectMgr->GetPlayerNameByGUID((*itr)->assignedToGM, gmname))
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str());
|
||||
SendSysMessage(ss.str().c_str());
|
||||
}
|
||||
@@ -82,7 +82,7 @@ bool ChatHandler::HandleGMTicketListOnlineCommand(const char* /*args*/)
|
||||
bool ChatHandler::HandleGMTicketListClosedCommand(const char* /*args*/)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETSHOWCLOSEDLIST);
|
||||
for (GmTicketList::iterator itr = sTicketMgr.m_GMTicketList.begin(); itr != sTicketMgr.m_GMTicketList.end(); ++itr)
|
||||
for (GmTicketList::iterator itr = sTicketMgr->m_GMTicketList.begin(); itr != sTicketMgr->m_GMTicketList.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->closed == 0)
|
||||
continue;
|
||||
@@ -93,7 +93,7 @@ bool ChatHandler::HandleGMTicketListClosedCommand(const char* /*args*/)
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, (*itr)->name.c_str());
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTAGECREATE, (secsToTimeString(time(NULL) - (*itr)->createtime, true, false)).c_str());
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTAGE, (secsToTimeString(time(NULL) - (*itr)->timestamp, true, false)).c_str());
|
||||
if (sObjectMgr.GetPlayerNameByGUID((*itr)->assignedToGM, gmname))
|
||||
if (sObjectMgr->GetPlayerNameByGUID((*itr)->assignedToGM, gmname))
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str());
|
||||
|
||||
SendSysMessage(ss.str().c_str());
|
||||
@@ -104,7 +104,7 @@ bool ChatHandler::HandleGMTicketListClosedCommand(const char* /*args*/)
|
||||
bool ChatHandler::HandleGMTicketListEscalatedCommand(const char* /*args*/)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETSHOWESCALATEDLIST);
|
||||
for (GmTicketList::iterator itr = sTicketMgr.m_GMTicketList.begin(); itr != sTicketMgr.m_GMTicketList.end(); ++itr)
|
||||
for (GmTicketList::iterator itr = sTicketMgr->m_GMTicketList.begin(); itr != sTicketMgr->m_GMTicketList.end(); ++itr)
|
||||
{
|
||||
if (!((*itr)->escalated == TICKET_IN_ESCALATION_QUEUE) || (*itr)->closed != 0)
|
||||
continue;
|
||||
@@ -126,7 +126,7 @@ bool ChatHandler::HandleGMTicketGetByIdCommand(const char* args)
|
||||
return false;
|
||||
|
||||
uint64 tguid = atoi(args);
|
||||
GM_Ticket *ticket = sTicketMgr.GetGMTicket(tguid);
|
||||
GM_Ticket *ticket = sTicketMgr->GetGMTicket(tguid);
|
||||
if (!ticket || ticket->closed != 0 || ticket->completed)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
|
||||
@@ -141,7 +141,7 @@ bool ChatHandler::HandleGMTicketGetByIdCommand(const char* args)
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTAGECREATE, (secsToTimeString(time(NULL) - ticket->createtime, true, false)).c_str());
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTAGE, (secsToTimeString(time(NULL) - ticket->timestamp, true, false)).c_str());
|
||||
|
||||
if (sObjectMgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname))
|
||||
if (sObjectMgr->GetPlayerNameByGUID(ticket->assignedToGM, gmname))
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str());
|
||||
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTMESSAGE, ticket->message.c_str());
|
||||
@@ -161,14 +161,14 @@ bool ChatHandler::HandleGMTicketGetByNameCommand(const char* args)
|
||||
std::string name = (char*)args;
|
||||
normalizePlayerName(name);
|
||||
|
||||
Player *plr = sObjectMgr.GetPlayer(name.c_str());
|
||||
Player *plr = sObjectMgr->GetPlayer(name.c_str());
|
||||
if (!plr)
|
||||
{
|
||||
SendSysMessage(LANG_NO_PLAYERS_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
GM_Ticket *ticket = sTicketMgr.GetGMTicketByPlayer(plr->GetGUID());
|
||||
GM_Ticket *ticket = sTicketMgr->GetGMTicketByPlayer(plr->GetGUID());
|
||||
if (!ticket)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
|
||||
@@ -183,7 +183,7 @@ bool ChatHandler::HandleGMTicketGetByNameCommand(const char* args)
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTAGECREATE, (secsToTimeString(time(NULL) - ticket->createtime, true, false)).c_str());
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTAGE, (secsToTimeString(time(NULL) - ticket->timestamp, true, false)).c_str());
|
||||
|
||||
if (sObjectMgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname))
|
||||
if (sObjectMgr->GetPlayerNameByGUID(ticket->assignedToGM, gmname))
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str());
|
||||
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTMESSAGE, ticket->message.c_str());
|
||||
@@ -202,7 +202,7 @@ bool ChatHandler::HandleGMTicketCloseByIdCommand(const char* args)
|
||||
return false;
|
||||
|
||||
uint64 tguid = atoi(args);
|
||||
GM_Ticket *ticket = sTicketMgr.GetGMTicket(tguid);
|
||||
GM_Ticket *ticket = sTicketMgr->GetGMTicket(tguid);
|
||||
if (!ticket || ticket->closed != 0 || ticket->completed)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
|
||||
@@ -220,8 +220,8 @@ bool ChatHandler::HandleGMTicketCloseByIdCommand(const char* args)
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, ticket->name.c_str());
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETCLOSED, m_session->GetPlayer()->GetName());
|
||||
SendGlobalGMSysMessage(ss.str().c_str());
|
||||
Player *plr = sObjectMgr.GetPlayer(ticket->playerGuid);
|
||||
sTicketMgr.RemoveGMTicket(ticket, m_session->GetPlayer()->GetGUID());
|
||||
Player *plr = sObjectMgr->GetPlayer(ticket->playerGuid);
|
||||
sTicketMgr->RemoveGMTicket(ticket, m_session->GetPlayer()->GetGUID());
|
||||
|
||||
if (!plr || !plr->IsInWorld())
|
||||
return true;
|
||||
@@ -231,7 +231,7 @@ bool ChatHandler::HandleGMTicketCloseByIdCommand(const char* args)
|
||||
deleteTicket << uint32(GMTICKET_RESPONSE_TICKET_DELETED);
|
||||
plr->GetSession()->SendPacket(&deleteTicket);
|
||||
|
||||
sTicketMgr.UpdateLastChange();
|
||||
sTicketMgr->UpdateLastChange();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ bool ChatHandler::HandleGMTicketAssignToCommand(const char* args)
|
||||
return false;
|
||||
|
||||
Player *cplr = m_session->GetPlayer();
|
||||
GM_Ticket *ticket = sTicketMgr.GetGMTicket(ticketGuid);
|
||||
GM_Ticket *ticket = sTicketMgr->GetGMTicket(ticketGuid);
|
||||
|
||||
if (!ticket || ticket->closed != 0)
|
||||
{
|
||||
@@ -260,9 +260,9 @@ bool ChatHandler::HandleGMTicketAssignToCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
uint64 tarGUID = sObjectMgr.GetPlayerGUIDByName(targm.c_str());
|
||||
uint64 accid = sObjectMgr.GetPlayerAccountIdByGUID(tarGUID);
|
||||
uint32 gmlevel = sAccountMgr.GetSecurity(accid, realmID);
|
||||
uint64 tarGUID = sObjectMgr->GetPlayerGUIDByName(targm.c_str());
|
||||
uint64 accid = sObjectMgr->GetPlayerAccountIdByGUID(tarGUID);
|
||||
uint32 gmlevel = sAccountMgr->GetSecurity(accid, realmID);
|
||||
|
||||
if (!tarGUID || gmlevel == SEC_PLAYER)
|
||||
{
|
||||
@@ -277,7 +277,7 @@ bool ChatHandler::HandleGMTicketAssignToCommand(const char* args)
|
||||
}
|
||||
|
||||
std::string gmname;
|
||||
sObjectMgr.GetPlayerNameByGUID(tarGUID, gmname);
|
||||
sObjectMgr->GetPlayerNameByGUID(tarGUID, gmname);
|
||||
if (ticket->assignedToGM != 0 && ticket->assignedToGM != cplr->GetGUID())
|
||||
{
|
||||
PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->guid, gmname.c_str());
|
||||
@@ -291,7 +291,7 @@ bool ChatHandler::HandleGMTicketAssignToCommand(const char* args)
|
||||
else if (ticket->escalated == TICKET_UNASSIGNED)
|
||||
ticket->escalated = TICKET_ASSIGNED;
|
||||
|
||||
sTicketMgr.AddOrUpdateGMTicket(*ticket);
|
||||
sTicketMgr->AddOrUpdateGMTicket(*ticket);
|
||||
|
||||
std::stringstream ss;
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTGUID, ticket->guid);
|
||||
@@ -299,7 +299,7 @@ bool ChatHandler::HandleGMTicketAssignToCommand(const char* args)
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str());
|
||||
SendGlobalGMSysMessage(ss.str().c_str());
|
||||
|
||||
sTicketMgr.UpdateLastChange();
|
||||
sTicketMgr->UpdateLastChange();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ bool ChatHandler::HandleGMTicketUnAssignCommand(const char* args)
|
||||
|
||||
uint64 ticketGuid = atoi(args);
|
||||
Player *cplr = m_session->GetPlayer();
|
||||
GM_Ticket *ticket = sTicketMgr.GetGMTicket(ticketGuid);
|
||||
GM_Ticket *ticket = sTicketMgr->GetGMTicket(ticketGuid);
|
||||
|
||||
if (!ticket|| ticket->closed != 0)
|
||||
{
|
||||
@@ -324,8 +324,8 @@ bool ChatHandler::HandleGMTicketUnAssignCommand(const char* args)
|
||||
}
|
||||
|
||||
std::string gmname;
|
||||
sObjectMgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname);
|
||||
Player *plr = sObjectMgr.GetPlayer(ticket->assignedToGM);
|
||||
sObjectMgr->GetPlayerNameByGUID(ticket->assignedToGM, gmname);
|
||||
Player *plr = sObjectMgr->GetPlayer(ticket->assignedToGM);
|
||||
if (plr && plr->IsInWorld() && plr->GetSession()->GetSecurity() > cplr->GetSession()->GetSecurity())
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETUNASSIGNSECURITY);
|
||||
@@ -341,8 +341,8 @@ bool ChatHandler::HandleGMTicketUnAssignCommand(const char* args)
|
||||
ticket->assignedToGM = 0;
|
||||
if (ticket->escalated != TICKET_UNASSIGNED && ticket->escalated != TICKET_IN_ESCALATION_QUEUE)
|
||||
ticket->escalated--;
|
||||
sTicketMgr.AddOrUpdateGMTicket(*ticket);
|
||||
sTicketMgr.UpdateLastChange();
|
||||
sTicketMgr->AddOrUpdateGMTicket(*ticket);
|
||||
sTicketMgr->UpdateLastChange();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -359,7 +359,7 @@ bool ChatHandler::HandleGMTicketCommentCommand(const char* args)
|
||||
return false;
|
||||
|
||||
Player *cplr = m_session->GetPlayer();
|
||||
GM_Ticket *ticket = sTicketMgr.GetGMTicket(ticketGuid);
|
||||
GM_Ticket *ticket = sTicketMgr->GetGMTicket(ticketGuid);
|
||||
|
||||
if (!ticket || ticket->closed != 0)
|
||||
{
|
||||
@@ -373,19 +373,19 @@ bool ChatHandler::HandleGMTicketCommentCommand(const char* args)
|
||||
}
|
||||
|
||||
std::string gmname;
|
||||
sObjectMgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname);
|
||||
sObjectMgr->GetPlayerNameByGUID(ticket->assignedToGM, gmname);
|
||||
ticket->comment = comment;
|
||||
sTicketMgr.AddOrUpdateGMTicket(*ticket);
|
||||
sTicketMgr->AddOrUpdateGMTicket(*ticket);
|
||||
std::stringstream ss;
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTGUID, ticket->guid);
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, ticket->name.c_str());
|
||||
|
||||
if (sObjectMgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname))
|
||||
if (sObjectMgr->GetPlayerNameByGUID(ticket->assignedToGM, gmname))
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str());
|
||||
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTADDCOMMENT, cplr->GetName(), ticket->comment.c_str());
|
||||
SendGlobalGMSysMessage(ss.str().c_str());
|
||||
sTicketMgr.UpdateLastChange();
|
||||
sTicketMgr->UpdateLastChange();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -394,7 +394,7 @@ bool ChatHandler::HandleGMTicketDeleteByIdCommand(const char* args)
|
||||
if (!*args)
|
||||
return false;
|
||||
uint64 ticketGuid = atoi(args);
|
||||
GM_Ticket *ticket = sTicketMgr.GetGMTicket(ticketGuid);
|
||||
GM_Ticket *ticket = sTicketMgr->GetGMTicket(ticketGuid);
|
||||
|
||||
if (!ticket)
|
||||
{
|
||||
@@ -412,8 +412,8 @@ bool ChatHandler::HandleGMTicketDeleteByIdCommand(const char* args)
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, ticket->name.c_str());
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETDELETED, m_session->GetPlayer()->GetName());
|
||||
SendGlobalGMSysMessage(ss.str().c_str());
|
||||
Player *plr = sObjectMgr.GetPlayer(ticket->playerGuid);
|
||||
sTicketMgr.RemoveGMTicket(ticket, -1, true); // we don't need to care about who deleted it...
|
||||
Player *plr = sObjectMgr->GetPlayer(ticket->playerGuid);
|
||||
sTicketMgr->RemoveGMTicket(ticket, -1, true); // we don't need to care about who deleted it...
|
||||
if (plr && plr->IsInWorld())
|
||||
{
|
||||
// Force abandon ticket
|
||||
@@ -423,14 +423,14 @@ bool ChatHandler::HandleGMTicketDeleteByIdCommand(const char* args)
|
||||
}
|
||||
|
||||
ticket = NULL;
|
||||
sTicketMgr.UpdateLastChange();
|
||||
sTicketMgr->UpdateLastChange();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleToggleGMTicketSystem(const char* /* args */)
|
||||
{
|
||||
sTicketMgr.SetStatus(!sTicketMgr.GetStatus());
|
||||
if(sTicketMgr.GetStatus())
|
||||
sTicketMgr->SetStatus(!sTicketMgr->GetStatus());
|
||||
if (sTicketMgr->GetStatus())
|
||||
PSendSysMessage(LANG_ALLOW_TICKETS);
|
||||
else
|
||||
PSendSysMessage(LANG_DISALLOW_TICKETS);
|
||||
@@ -444,7 +444,7 @@ bool ChatHandler::HandleGMTicketEscalateCommand(const char *args)
|
||||
return false;
|
||||
|
||||
uint64 tguid = atoi(args);
|
||||
GM_Ticket *ticket = sTicketMgr.GetGMTicket(tguid);
|
||||
GM_Ticket *ticket = sTicketMgr->GetGMTicket(tguid);
|
||||
if (!ticket || ticket->closed != 0 || ticket->completed || ticket->escalated != TICKET_UNASSIGNED)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
|
||||
@@ -453,10 +453,10 @@ bool ChatHandler::HandleGMTicketEscalateCommand(const char *args)
|
||||
|
||||
ticket->escalated = TICKET_IN_ESCALATION_QUEUE;
|
||||
|
||||
Player *plr = sObjectMgr.GetPlayer(ticket->playerGuid);
|
||||
Player *plr = sObjectMgr->GetPlayer(ticket->playerGuid);
|
||||
if (plr && plr->IsInWorld())
|
||||
plr->GetSession()->SendGMTicketGetTicket(GMTICKET_STATUS_HASTEXT, ticket->message.c_str(), ticket);
|
||||
sTicketMgr.UpdateLastChange();
|
||||
sTicketMgr->UpdateLastChange();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -466,17 +466,17 @@ bool ChatHandler::HandleGMTicketCompleteCommand(const char* args)
|
||||
return false;
|
||||
|
||||
uint64 tguid = atoi(args);
|
||||
GM_Ticket *ticket = sTicketMgr.GetGMTicket(tguid);
|
||||
GM_Ticket *ticket = sTicketMgr->GetGMTicket(tguid);
|
||||
if (!ticket || ticket->closed != 0 || ticket->completed)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
|
||||
return true;
|
||||
}
|
||||
|
||||
Player *plr = sObjectMgr.GetPlayer(ticket->playerGuid);
|
||||
Player *plr = sObjectMgr->GetPlayer(ticket->playerGuid);
|
||||
if (plr && plr->IsInWorld())
|
||||
plr->GetSession()->SendGMTicketResponse(ticket);
|
||||
sTicketMgr.UpdateLastChange();
|
||||
sTicketMgr->UpdateLastChange();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -492,7 +492,7 @@ bool ChatHandler::HandleGMTicketResponseAppendCommand(const char* args)
|
||||
if (!response)
|
||||
return false;
|
||||
|
||||
GM_Ticket *ticket = sTicketMgr.GetGMTicket(ticketGuid);
|
||||
GM_Ticket *ticket = sTicketMgr->GetGMTicket(ticketGuid);
|
||||
Player *cplr = m_session->GetPlayer();
|
||||
|
||||
if (!ticket || ticket->closed != 0)
|
||||
@@ -511,7 +511,7 @@ bool ChatHandler::HandleGMTicketResponseAppendCommand(const char* args)
|
||||
ss << ticket->response;
|
||||
ss << response;
|
||||
ticket->response = ss.str();
|
||||
sTicketMgr.AddOrUpdateGMTicket(*ticket);
|
||||
sTicketMgr->AddOrUpdateGMTicket(*ticket);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -527,7 +527,7 @@ bool ChatHandler::HandleGMTicketResponseAppendLnCommand(const char* args)
|
||||
if (!response)
|
||||
return false;
|
||||
|
||||
GM_Ticket *ticket = sTicketMgr.GetGMTicket(ticketGuid);
|
||||
GM_Ticket *ticket = sTicketMgr->GetGMTicket(ticketGuid);
|
||||
Player *cplr = m_session->GetPlayer();
|
||||
|
||||
if (!ticket || ticket->closed != 0)
|
||||
@@ -547,6 +547,6 @@ bool ChatHandler::HandleGMTicketResponseAppendLnCommand(const char* args)
|
||||
ss << response;
|
||||
ss << "\n";
|
||||
ticket->response = ss.str();
|
||||
sTicketMgr.AddOrUpdateGMTicket(*ticket);
|
||||
sTicketMgr->AddOrUpdateGMTicket(*ticket);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user