* Some singleton renames for consistency:
accmgr -> AccountMgr objmgr -> ObjectMgr auctionmgr -> sAuctionMgr spellmgr -> sSpellMgr CreatureEAI_Mgr -> sEventAIMgr achievementmgr -> sAchievementMgr gameeventmgr -> sGameEventMgr sInstanceSaveManager -> sInstanceSaveMgr poolhandler -> sPoolMgr --HG-- branch : trunk
This commit is contained in:
@@ -46,7 +46,7 @@ namespace Trinity
|
||||
: i_msgtype(msgtype), i_textId(textId), i_source(source), i_args(args) {}
|
||||
void operator()(WorldPacket& data, int32 loc_idx)
|
||||
{
|
||||
char const* text = objmgr.GetTrinityString(i_textId,loc_idx);
|
||||
char const* text = sObjectMgr.GetTrinityString(i_textId,loc_idx);
|
||||
|
||||
if (i_args)
|
||||
{
|
||||
@@ -91,9 +91,9 @@ namespace Trinity
|
||||
: i_msgtype(msgtype), i_textId(textId), i_source(source), i_arg1(arg1), i_arg2(arg2) {}
|
||||
void operator()(WorldPacket& data, int32 loc_idx)
|
||||
{
|
||||
char const* text = objmgr.GetTrinityString(i_textId,loc_idx);
|
||||
char const* arg1str = i_arg1 ? objmgr.GetTrinityString(i_arg1,loc_idx) : "";
|
||||
char const* arg2str = i_arg2 ? objmgr.GetTrinityString(i_arg2,loc_idx) : "";
|
||||
char const* text = sObjectMgr.GetTrinityString(i_textId,loc_idx);
|
||||
char const* arg1str = i_arg1 ? sObjectMgr.GetTrinityString(i_arg1,loc_idx) : "";
|
||||
char const* arg2str = i_arg2 ? sObjectMgr.GetTrinityString(i_arg2,loc_idx) : "";
|
||||
|
||||
char str [2048];
|
||||
snprintf(str,2048,text, arg1str, arg2str);
|
||||
@@ -286,7 +286,7 @@ void Battleground::Update(uint32 diff)
|
||||
Creature *sh = NULL;
|
||||
for (std::vector<uint64>::const_iterator itr2 = (itr->second).begin(); itr2 != (itr->second).end(); ++itr2)
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(*itr2);
|
||||
Player *plr = sObjectMgr.GetPlayer(*itr2);
|
||||
if (!plr)
|
||||
continue;
|
||||
|
||||
@@ -317,7 +317,7 @@ void Battleground::Update(uint32 diff)
|
||||
{
|
||||
for (std::vector<uint64>::const_iterator itr = m_ResurrectQueue.begin(); itr != m_ResurrectQueue.end(); ++itr)
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(*itr);
|
||||
Player *plr = sObjectMgr.GetPlayer(*itr);
|
||||
if (!plr)
|
||||
continue;
|
||||
plr->ResurrectPlayer(1.0f);
|
||||
@@ -426,7 +426,7 @@ void Battleground::Update(uint32 diff)
|
||||
//TODO : add arena sound PlaySoundToAll(SOUND_ARENA_START);
|
||||
|
||||
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
|
||||
if (Player *plr = objmgr.GetPlayer(itr->first))
|
||||
if (Player *plr = sObjectMgr.GetPlayer(itr->first))
|
||||
{
|
||||
plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION);
|
||||
// remove auras with duration lower than 30s
|
||||
@@ -454,7 +454,7 @@ void Battleground::Update(uint32 diff)
|
||||
PlaySoundToAll(SOUND_BG_START);
|
||||
|
||||
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
|
||||
if (Player* plr = objmgr.GetPlayer(itr->first))
|
||||
if (Player* plr = sObjectMgr.GetPlayer(itr->first))
|
||||
plr->RemoveAurasDueToSpell(SPELL_PREPARATION);
|
||||
//Announce BG starting
|
||||
if (sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE))
|
||||
@@ -507,7 +507,7 @@ void Battleground::SendPacketToAll(WorldPacket *packet)
|
||||
{
|
||||
if (itr->second.OfflineRemoveTime)
|
||||
continue;
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||
if (plr)
|
||||
plr->GetSession()->SendPacket(packet);
|
||||
else
|
||||
@@ -521,7 +521,7 @@ void Battleground::SendPacketToTeam(uint32 TeamID, WorldPacket *packet, Player *
|
||||
{
|
||||
if (itr->second.OfflineRemoveTime)
|
||||
continue;
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("Battleground:SendPacketToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
||||
@@ -554,7 +554,7 @@ void Battleground::PlaySoundToTeam(uint32 SoundID, uint32 TeamID)
|
||||
{
|
||||
if (itr->second.OfflineRemoveTime)
|
||||
continue;
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||
|
||||
if (!plr)
|
||||
{
|
||||
@@ -579,7 +579,7 @@ void Battleground::CastSpellOnTeam(uint32 SpellID, uint32 TeamID)
|
||||
{
|
||||
if (itr->second.OfflineRemoveTime)
|
||||
continue;
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||
|
||||
if (!plr)
|
||||
{
|
||||
@@ -600,7 +600,7 @@ void Battleground::YellToAll(Creature* creature, const char* text, uint32 langua
|
||||
for (std::map<uint64, BattlegroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
{
|
||||
WorldPacket data(SMSG_MESSAGECHAT, 200);
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("Battleground: Player " UI64FMTD " not found!", itr->first);
|
||||
@@ -617,7 +617,7 @@ void Battleground::RewardHonorToTeam(uint32 Honor, uint32 TeamID)
|
||||
{
|
||||
if (itr->second.OfflineRemoveTime)
|
||||
continue;
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||
|
||||
if (!plr)
|
||||
{
|
||||
@@ -644,7 +644,7 @@ void Battleground::RewardReputationToTeam(uint32 faction_id, uint32 Reputation,
|
||||
{
|
||||
if (itr->second.OfflineRemoveTime)
|
||||
continue;
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||
|
||||
if (!plr)
|
||||
{
|
||||
@@ -713,8 +713,8 @@ void Battleground::EndBattleground(uint32 winner)
|
||||
// arena rating calculation
|
||||
if (isArena() && isRated())
|
||||
{
|
||||
winner_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(winner));
|
||||
loser_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(winner)));
|
||||
winner_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(winner));
|
||||
loser_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(winner)));
|
||||
if (winner_arena_team && loser_arena_team && winner_arena_team != loser_arena_team)
|
||||
{
|
||||
loser_rating = loser_arena_team->GetStats().rating;
|
||||
@@ -749,7 +749,7 @@ void Battleground::EndBattleground(uint32 winner)
|
||||
}
|
||||
continue;
|
||||
}
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("Battleground:EndBattleground Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
||||
@@ -902,7 +902,7 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
|
||||
|
||||
RemovePlayerFromResurrectQueue(guid);
|
||||
|
||||
Player *plr = objmgr.GetPlayer(guid);
|
||||
Player *plr = sObjectMgr.GetPlayer(guid);
|
||||
|
||||
// should remove spirit of redemption
|
||||
if (plr && plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
@@ -939,8 +939,8 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
|
||||
if (isRated() && GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
//left a rated match while the encounter was in progress, consider as loser
|
||||
ArenaTeam * winner_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
|
||||
ArenaTeam * loser_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(team));
|
||||
ArenaTeam * winner_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
|
||||
ArenaTeam * loser_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(team));
|
||||
if (winner_arena_team && loser_arena_team && winner_arena_team != loser_arena_team)
|
||||
loser_arena_team->MemberLost(plr,winner_arena_team->GetRating());
|
||||
}
|
||||
@@ -961,8 +961,8 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
|
||||
if (isRated() && GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
//left a rated match while the encounter was in progress, consider as loser
|
||||
ArenaTeam * others_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
|
||||
ArenaTeam * players_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(team));
|
||||
ArenaTeam * others_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
|
||||
ArenaTeam * players_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(team));
|
||||
if (others_arena_team && players_arena_team)
|
||||
players_arena_team->OfflineMemberLost(guid, others_arena_team->GetRating());
|
||||
}
|
||||
@@ -1336,7 +1336,7 @@ void Battleground::AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid
|
||||
{
|
||||
m_ReviveQueue[npc_guid].push_back(player_guid);
|
||||
|
||||
Player *plr = objmgr.GetPlayer(player_guid);
|
||||
Player *plr = sObjectMgr.GetPlayer(player_guid);
|
||||
if (!plr)
|
||||
return;
|
||||
|
||||
@@ -1353,7 +1353,7 @@ void Battleground::RemovePlayerFromResurrectQueue(uint64 player_guid)
|
||||
{
|
||||
(itr->second).erase(itr2);
|
||||
|
||||
Player *plr = objmgr.GetPlayer(player_guid);
|
||||
Player *plr = sObjectMgr.GetPlayer(player_guid);
|
||||
if (!plr)
|
||||
return;
|
||||
|
||||
@@ -1374,7 +1374,7 @@ bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float
|
||||
// and when loading it (in go::LoadFromDB()), a new guid would be assigned to the object, and a new object would be created
|
||||
// so we must create it specific for this instance
|
||||
GameObject * go = new GameObject;
|
||||
if (!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),entry, GetBgMap(),
|
||||
if (!go->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),entry, GetBgMap(),
|
||||
PHASEMASK_NORMAL, x,y,z,o,rotation0,rotation1,rotation2,rotation3,100,GO_STATE_READY))
|
||||
{
|
||||
sLog.outErrorDb("Gameobject template %u not found in database! Battleground not created!", entry);
|
||||
@@ -1387,7 +1387,7 @@ bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float
|
||||
|
||||
// without this, UseButtonOrDoor caused the crash, since it tried to get go info from godata
|
||||
// iirc that was changed, so adding to go data map is no longer required if that was the only function using godata from GameObject without checking if it existed
|
||||
GameObjectData& data = objmgr.NewGOData(guid);
|
||||
GameObjectData& data = sObjectMgr.NewGOData(guid);
|
||||
|
||||
data.id = entry;
|
||||
data.mapid = GetMapId();
|
||||
@@ -1498,7 +1498,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f
|
||||
return NULL;
|
||||
|
||||
Creature* pCreature = new Creature;
|
||||
if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, teamval, x, y, z, o))
|
||||
if (!pCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, teamval, x, y, z, o))
|
||||
{
|
||||
sLog.outError("Can't create creature entry: %u",entry);
|
||||
delete pCreature;
|
||||
@@ -1507,7 +1507,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f
|
||||
|
||||
pCreature->SetHomePosition(x, y, z, o);
|
||||
|
||||
CreatureInfo const *cinfo = objmgr.GetCreatureTemplate(entry);
|
||||
CreatureInfo const *cinfo = sObjectMgr.GetCreatureTemplate(entry);
|
||||
if (!cinfo)
|
||||
{
|
||||
sLog.outErrorDb("Battleground::AddCreature: entry %u does not exist.", entry);
|
||||
@@ -1539,7 +1539,7 @@ void Battleground::SpawnBGCreature(uint32 type, uint32 respawntime)
|
||||
{
|
||||
//obj->Respawn(); // bugged
|
||||
obj->SetRespawnTime(0);
|
||||
objmgr.SaveCreatureRespawnTime(obj->GetGUIDLow(), GetInstanceID(), 0);
|
||||
sObjectMgr.SaveCreatureRespawnTime(obj->GetGUIDLow(), GetInstanceID(), 0);
|
||||
map->Add(obj);
|
||||
}
|
||||
}
|
||||
@@ -1642,7 +1642,7 @@ void Battleground::PSendMessageToAll(int32 entry, ChatMsg type, Player const* so
|
||||
|
||||
void Battleground::SendWarningToAll(int32 entry, ...)
|
||||
{
|
||||
const char *format = objmgr.GetTrinityStringForDBCLocale(entry);
|
||||
const char *format = sObjectMgr.GetTrinityStringForDBCLocale(entry);
|
||||
va_list ap;
|
||||
char str [1024];
|
||||
va_start(ap, entry);
|
||||
@@ -1686,7 +1686,7 @@ void Battleground::EndNow()
|
||||
const char *Battleground::GetTrinityString(int32 entry)
|
||||
{
|
||||
// FIXME: now we have different DBC locales and need localized message for each target client
|
||||
return objmgr.GetTrinityStringForDBCLocale(entry);
|
||||
return sObjectMgr.GetTrinityStringForDBCLocale(entry);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1743,7 +1743,7 @@ void Battleground::HandleKillPlayer(Player *player, Player *killer)
|
||||
|
||||
for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||
|
||||
if (!plr || plr == killer)
|
||||
continue;
|
||||
@@ -1809,7 +1809,7 @@ uint32 Battleground::GetAlivePlayersCountByTeam(uint32 Team) const
|
||||
{
|
||||
if (itr->second.Team == Team)
|
||||
{
|
||||
Player * pl = objmgr.GetPlayer(itr->first);
|
||||
Player * pl = sObjectMgr.GetPlayer(itr->first);
|
||||
if (pl && pl->isAlive() && !pl->HasByteFlag(UNIT_FIELD_BYTES_2, 3, FORM_SPIRITOFREDEMPTION))
|
||||
++count;
|
||||
}
|
||||
@@ -1862,7 +1862,7 @@ void Battleground::SetBgRaid(uint32 TeamID, Group *bg_raid)
|
||||
|
||||
WorldSafeLocsEntry const* Battleground::GetClosestGraveYard(Player* player)
|
||||
{
|
||||
return objmgr.GetClosestGraveYard(player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), player->GetTeam());
|
||||
return sObjectMgr.GetClosestGraveYard(player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), player->GetTeam());
|
||||
}
|
||||
|
||||
bool Battleground::IsTeamScoreInRange(uint32 team, uint32 minScore, uint32 maxScore) const
|
||||
|
||||
Reference in New Issue
Block a user