* 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:
XTZGZoReX
2010-08-08 05:25:45 +02:00
parent 93fc24ece9
commit 9083271a2f
97 changed files with 1354 additions and 1353 deletions
+2 -2
View File
@@ -223,7 +223,7 @@ void ObjectAccessor::RemoveCorpse(Corpse* corpse)
CellPair cell_pair = Trinity::ComputeCellPair(corpse->GetPositionX(), corpse->GetPositionY());
uint32 cell_id = (cell_pair.y_coord * TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;
objmgr.DeleteCorpseCellData(corpse->GetMapId(), cell_id, corpse->GetOwnerGUID());
sObjectMgr.DeleteCorpseCellData(corpse->GetMapId(), cell_id, corpse->GetOwnerGUID());
i_player2corpse.erase(iter);
}
@@ -244,7 +244,7 @@ void ObjectAccessor::AddCorpse(Corpse* corpse)
CellPair cell_pair = Trinity::ComputeCellPair(corpse->GetPositionX(), corpse->GetPositionY());
uint32 cell_id = (cell_pair.y_coord * TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;
objmgr.AddCorpseCellData(corpse->GetMapId(), cell_id, corpse->GetOwnerGUID(), corpse->GetInstanceId());
sObjectMgr.AddCorpseCellData(corpse->GetMapId(), cell_id, corpse->GetOwnerGUID(), corpse->GetInstanceId());
}
}
+22 -22
View File
@@ -480,7 +480,7 @@ struct SQLCreatureLoader : public SQLStorageLoaderBase<SQLCreatureLoader>
template<class D>
void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
{
dst = D(objmgr.GetScriptId(src));
dst = D(sObjectMgr.GetScriptId(src));
}
};
@@ -1230,7 +1230,7 @@ void ObjectMgr::LoadCreatures()
spawnMasks[i] |= (1 << k);
//TODO: remove this
//gameeventmgr.mGameEventCreatureGuids.resize(52*2-1);
//sGameEventMgr.mGameEventCreatureGuids.resize(52*2-1);
barGoLink bar(result->GetRowCount());
@@ -1353,14 +1353,14 @@ void ObjectMgr::LoadCreatures()
/*if (entry == 30739 || entry == 30740)
{
gameEvent = 51;
uint32 guid2 = objmgr.GenerateLowGuid(HIGHGUID_UNIT);
uint32 guid2 = sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT);
CreatureData& data2 = mCreatureDataMap[guid2];
data2 = data;
// data2.id = (entry == 32307 ? 32308 : 32307);
data2.id = (entry == 30739 ? 30740 : 30739);
data2.displayid = 0;
gameeventmgr.mGameEventCreatureGuids[51+51].push_back(guid);
gameeventmgr.mGameEventCreatureGuids[51+50].push_back(guid2);
sGameEventMgr.mGameEventCreatureGuids[51+51].push_back(guid);
sGameEventMgr.mGameEventCreatureGuids[51+50].push_back(guid2);
}*/
if (gameEvent == 0 && PoolId == 0) // if not this is to be managed by GameEvent System or Pool system
@@ -1498,7 +1498,7 @@ uint32 ObjectMgr::AddCreData(uint32 entry, uint32 /*team*/, uint32 mapId, float
return 0;
uint32 level = cInfo->minlevel == cInfo->maxlevel ? cInfo->minlevel : urand(cInfo->minlevel, cInfo->maxlevel); // Only used for extracting creature base stats
CreatureBaseStats const* stats = objmgr.GetCreatureBaseStats(level, cInfo->unit_class);
CreatureBaseStats const* stats = sObjectMgr.GetCreatureBaseStats(level, cInfo->unit_class);
uint32 guid = GenerateLowGuid(HIGHGUID_UNIT);
CreatureData& data = NewOrExistCreatureData(guid);
@@ -1941,7 +1941,7 @@ struct SQLItemLoader : public SQLStorageLoaderBase<SQLItemLoader>
template<class D>
void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
{
dst = D(objmgr.GetScriptId(src));
dst = D(sObjectMgr.GetScriptId(src));
}
};
@@ -3639,7 +3639,7 @@ void ObjectMgr::LoadGroups()
diff = 0; // default for both difficaly types
}
InstanceSave *save = sInstanceSaveManager.AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), Difficulty(diff), time_t(fields[5].GetUInt64()), fields[6].GetBool(), true);
InstanceSave *save = sInstanceSaveMgr.AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), Difficulty(diff), time_t(fields[5].GetUInt64()), fields[6].GetBool(), true);
group->BindToInstance(save, fields[3].GetBool(), true);
++count;
}while (result->NextRow());
@@ -4949,7 +4949,7 @@ void ObjectMgr::LoadSpellScriptNames()
if (allRanks)
{
if (spellmgr.GetFirstSpellInChain(spellId) != spellId)
if (sSpellMgr.GetFirstSpellInChain(spellId) != spellId)
{
sLog.outErrorDb("Scriptname:`%s` spell (spell_id:%d) is not first rank of spell.",scriptName,fields[0].GetInt32());
continue;
@@ -4957,7 +4957,7 @@ void ObjectMgr::LoadSpellScriptNames()
while(spellId)
{
mSpellScripts.insert(SpellScriptsMap::value_type(spellId, GetScriptId(scriptName)));
spellId = spellmgr.GetNextSpellInChain(spellId);
spellId = sSpellMgr.GetNextSpellInChain(spellId);
}
}
else
@@ -4994,7 +4994,7 @@ void ObjectMgr::ValidateSpellScripts()
{
bar.step();
sitr->first->Register();
if (!sitr->first->_Validate(spellEntry, objmgr.GetScriptName(sitr->second->second)))
if (!sitr->first->_Validate(spellEntry, sObjectMgr.GetScriptName(sitr->second->second)))
mSpellScripts.erase(sitr->second);
delete sitr->first;
}
@@ -5102,7 +5102,7 @@ struct SQLInstanceLoader : public SQLStorageLoaderBase<SQLInstanceLoader>
template<class D>
void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
{
dst = D(objmgr.GetScriptId(src));
dst = D(sObjectMgr.GetScriptId(src));
}
};
@@ -5605,7 +5605,7 @@ uint32 ObjectMgr::GetTaxiMountDisplayId(uint32 id, uint32 team, bool allowed_alt
}
}
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(mount_id);
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(mount_id);
if (minfo)
mount_id = minfo->modelid;
@@ -6056,7 +6056,7 @@ AreaTrigger const* ObjectMgr::GetGoBackTrigger(uint32 Map) const
if (mapEntry->IsDungeon())
{
const InstanceTemplate *iTemplate = objmgr.GetInstanceTemplate(Map);
const InstanceTemplate *iTemplate = sObjectMgr.GetInstanceTemplate(Map);
if (!iTemplate)
return NULL;
@@ -6337,7 +6337,7 @@ struct SQLGameObjectLoader : public SQLStorageLoaderBase<SQLGameObjectLoader>
template<class D>
void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
{
dst = D(objmgr.GetScriptId(src));
dst = D(sObjectMgr.GetScriptId(src));
}
};
@@ -8776,7 +8776,7 @@ void ObjectMgr::LoadDbScriptStrings()
// Functions for scripting access
uint32 GetAreaTriggerScriptId(uint32 trigger_id)
{
return objmgr.GetAreaTriggerScriptId(trigger_id);
return sObjectMgr.GetAreaTriggerScriptId(trigger_id);
}
bool LoadTrinityStrings(DatabaseType& db, char const* table,int32 start_value, int32 end_value)
@@ -8789,27 +8789,27 @@ bool LoadTrinityStrings(DatabaseType& db, char const* table,int32 start_value, i
return false;
}
return objmgr.LoadTrinityStrings(db,table,start_value,end_value);
return sObjectMgr.LoadTrinityStrings(db,table,start_value,end_value);
}
uint32 GetScriptId(const char *name)
{
return objmgr.GetScriptId(name);
return sObjectMgr.GetScriptId(name);
}
ObjectMgr::ScriptNameMap & GetScriptNames()
{
return objmgr.GetScriptNames();
return sObjectMgr.GetScriptNames();
}
GameObjectInfo const *GetGameObjectInfo(uint32 id)
{
return objmgr.GetGameObjectInfo(id);
return sObjectMgr.GetGameObjectInfo(id);
}
CreatureInfo const *GetCreatureInfo(uint32 id)
{
return objmgr.GetCreatureTemplate(id);
return sObjectMgr.GetCreatureTemplate(id);
}
CreatureInfo const* GetCreatureTemplateStore(uint32 entry)
@@ -8819,7 +8819,7 @@ CreatureInfo const* GetCreatureTemplateStore(uint32 entry)
Quest const* GetQuestTemplateStore(uint32 entry)
{
return objmgr.GetQuestTemplate(entry);
return sObjectMgr.GetQuestTemplate(entry);
}
uint64 ObjectMgr::GenerateGMTicketId()
+1 -1
View File
@@ -1095,7 +1095,7 @@ class ObjectMgr
};
#define objmgr (*ACE_Singleton<ObjectMgr, ACE_Null_Mutex>::instance())
#define sObjectMgr (*ACE_Singleton<ObjectMgr, ACE_Null_Mutex>::instance())
// scripting access functions
bool LoadTrinityStrings(DatabaseType& db, char const* table,int32 start_value = MAX_CREATURE_AI_TEXT_STRING_ID, int32 end_value = std::numeric_limits<int32>::min());