mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[8789] Rename several singleton macros to use more consistent names.
* objmgr -> sObjectMgr * spellmgr -> sSpellMgr * WaypointMgr -> sWaypointMgr * poolhandler -> sPoolMgr * objaccessor -> sObjectAccessor * mapmgr -> sMapMgr * sInstanceSaveManager -> sInstanceSaveMgr * ticketmgr -> sTicketMgr * CreatureEAI_Mgr -> sEventAIMgr * auctionmgr -> sAuctionMgr * achievementmgr -> sAchievementMgr
This commit is contained in:
parent
539072fcbd
commit
0734adb746
84 changed files with 1113 additions and 1113 deletions
|
|
@ -258,9 +258,9 @@ void GameObject::Update(uint32 /*p_time*/)
|
|||
return;
|
||||
}
|
||||
// respawn timer
|
||||
uint16 poolid = poolhandler.IsPartOfAPool(GetGUIDLow(), TYPEID_GAMEOBJECT);
|
||||
uint16 poolid = sPoolMgr.IsPartOfAPool(GetGUIDLow(), TYPEID_GAMEOBJECT);
|
||||
if (poolid)
|
||||
poolhandler.UpdatePool(poolid, GetGUIDLow(), TYPEID_GAMEOBJECT);
|
||||
sPoolMgr.UpdatePool(poolid, GetGUIDLow(), TYPEID_GAMEOBJECT);
|
||||
else
|
||||
GetMap()->Add(this);
|
||||
break;
|
||||
|
|
@ -473,9 +473,9 @@ void GameObject::Delete()
|
|||
SetGoState(GO_STATE_READY);
|
||||
SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags);
|
||||
|
||||
uint16 poolid = poolhandler.IsPartOfAPool(GetGUIDLow(), TYPEID_GAMEOBJECT);
|
||||
uint16 poolid = sPoolMgr.IsPartOfAPool(GetGUIDLow(), TYPEID_GAMEOBJECT);
|
||||
if (poolid)
|
||||
poolhandler.UpdatePool(poolid, GetGUIDLow(), TYPEID_GAMEOBJECT);
|
||||
sPoolMgr.UpdatePool(poolid, GetGUIDLow(), TYPEID_GAMEOBJECT);
|
||||
else
|
||||
AddObjectToRemoveList();
|
||||
}
|
||||
|
|
@ -497,7 +497,7 @@ void GameObject::SaveToDB()
|
|||
{
|
||||
// this should only be used when the gameobject has already been loaded
|
||||
// preferably after adding to map, because mapid may not be valid otherwise
|
||||
GameObjectData const *data = objmgr.GetGOData(m_DBTableGuid);
|
||||
GameObjectData const *data = sObjectMgr.GetGOData(m_DBTableGuid);
|
||||
if(!data)
|
||||
{
|
||||
sLog.outError("GameObject::SaveToDB failed, cannot get gameobject data!");
|
||||
|
|
@ -517,7 +517,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
|||
if (!m_DBTableGuid)
|
||||
m_DBTableGuid = GetGUIDLow();
|
||||
// update in loaded data (changing data only in this place)
|
||||
GameObjectData& data = objmgr.NewGOData(m_DBTableGuid);
|
||||
GameObjectData& data = sObjectMgr.NewGOData(m_DBTableGuid);
|
||||
|
||||
// data->guid = guid don't must be update at save
|
||||
data.id = GetEntry();
|
||||
|
|
@ -564,7 +564,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
|||
|
||||
bool GameObject::LoadFromDB(uint32 guid, Map *map)
|
||||
{
|
||||
GameObjectData const* data = objmgr.GetGOData(guid);
|
||||
GameObjectData const* data = sObjectMgr.GetGOData(guid);
|
||||
|
||||
if( !data )
|
||||
{
|
||||
|
|
@ -589,7 +589,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
|
|||
GOState go_state = data->go_state;
|
||||
|
||||
m_DBTableGuid = guid;
|
||||
if (map->GetInstanceId() != 0) guid = objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT);
|
||||
if (map->GetInstanceId() != 0) guid = sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT);
|
||||
|
||||
if (!Create(guid,entry, map, phaseMask, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state) )
|
||||
return false;
|
||||
|
|
@ -607,13 +607,13 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
|
|||
{
|
||||
m_spawnedByDefault = true;
|
||||
m_respawnDelayTime = data->spawntimesecs;
|
||||
m_respawnTime = objmgr.GetGORespawnTime(m_DBTableGuid, map->GetInstanceId());
|
||||
m_respawnTime = sObjectMgr.GetGORespawnTime(m_DBTableGuid, map->GetInstanceId());
|
||||
|
||||
// ready to respawn
|
||||
if(m_respawnTime && m_respawnTime <= time(NULL))
|
||||
{
|
||||
m_respawnTime = 0;
|
||||
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -629,8 +629,8 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
|
|||
|
||||
void GameObject::DeleteFromDB()
|
||||
{
|
||||
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
objmgr.DeleteGOData(m_DBTableGuid);
|
||||
sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
sObjectMgr.DeleteGOData(m_DBTableGuid);
|
||||
WorldDatabase.PExecuteLog("DELETE FROM gameobject WHERE guid = '%u'", m_DBTableGuid);
|
||||
WorldDatabase.PExecuteLog("DELETE FROM game_event_gameobject WHERE guid = '%u'", m_DBTableGuid);
|
||||
WorldDatabase.PExecuteLog("DELETE FROM gameobject_battleground WHERE guid = '%u'", m_DBTableGuid);
|
||||
|
|
@ -646,7 +646,7 @@ GameObjectInfo const *GameObject::GetGOInfo() const
|
|||
/*********************************************************/
|
||||
bool GameObject::hasQuest(uint32 quest_id) const
|
||||
{
|
||||
QuestRelations const& qr = objmgr.mGOQuestRelations;
|
||||
QuestRelations const& qr = sObjectMgr.mGOQuestRelations;
|
||||
for(QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
|
||||
{
|
||||
if(itr->second==quest_id)
|
||||
|
|
@ -657,7 +657,7 @@ bool GameObject::hasQuest(uint32 quest_id) const
|
|||
|
||||
bool GameObject::hasInvolvedQuest(uint32 quest_id) const
|
||||
{
|
||||
QuestRelations const& qr = objmgr.mGOQuestInvolvedRelations;
|
||||
QuestRelations const& qr = sObjectMgr.mGOQuestInvolvedRelations;
|
||||
for(QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
|
||||
{
|
||||
if(itr->second==quest_id)
|
||||
|
|
@ -682,7 +682,7 @@ Unit* GameObject::GetOwner() const
|
|||
void GameObject::SaveRespawnTime()
|
||||
{
|
||||
if(m_respawnTime > time(NULL) && m_spawnedByDefault)
|
||||
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);
|
||||
sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);
|
||||
}
|
||||
|
||||
bool GameObject::isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const
|
||||
|
|
@ -725,13 +725,13 @@ void GameObject::Respawn()
|
|||
if(m_spawnedByDefault && m_respawnTime > 0)
|
||||
{
|
||||
m_respawnTime = time(NULL);
|
||||
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
}
|
||||
}
|
||||
|
||||
bool GameObject::ActivateToQuest( Player *pTarget)const
|
||||
{
|
||||
if(!objmgr.IsGameObjectForQuests(GetEntry()))
|
||||
if(!sObjectMgr.IsGameObjectForQuests(GetEntry()))
|
||||
return false;
|
||||
|
||||
switch(GetGoType())
|
||||
|
|
@ -1012,9 +1012,9 @@ void GameObject::Use(Unit* user)
|
|||
uint32 zone, subzone;
|
||||
GetZoneAndAreaId(zone,subzone);
|
||||
|
||||
int32 zone_skill = objmgr.GetFishingBaseSkillLevel( subzone );
|
||||
int32 zone_skill = sObjectMgr.GetFishingBaseSkillLevel( subzone );
|
||||
if(!zone_skill)
|
||||
zone_skill = objmgr.GetFishingBaseSkillLevel( zone );
|
||||
zone_skill = sObjectMgr.GetFishingBaseSkillLevel( zone );
|
||||
|
||||
//provide error, no fishable zone or area should be 0
|
||||
if(!zone_skill)
|
||||
|
|
@ -1293,7 +1293,7 @@ const char* GameObject::GetNameForLocaleIdx(int32 loc_idx) const
|
|||
{
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
GameObjectLocale const *cl = objmgr.GetGameObjectLocale(GetEntry());
|
||||
GameObjectLocale const *cl = sObjectMgr.GetGameObjectLocale(GetEntry());
|
||||
if (cl)
|
||||
{
|
||||
if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue