mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 15:16:24 +00:00
refactor(Core): rename namespaces and macros to acore (#2454)
This commit is contained in:
@@ -173,7 +173,7 @@ Unit* ObjectAccessor::FindUnit(uint64 guid)
|
||||
|
||||
Player* ObjectAccessor::FindPlayerByName(std::string const& name, bool checkInWorld)
|
||||
{
|
||||
/*TRINITY_READ_GUARD(HashMapHolder<Player>::LockType, *HashMapHolder<Player>::GetLock());
|
||||
/*ACORE_READ_GUARD(HashMapHolder<Player>::LockType, *HashMapHolder<Player>::GetLock());
|
||||
std::string nameStr = name;
|
||||
std::transform(nameStr.begin(), nameStr.end(), nameStr.begin(), ::tolower);
|
||||
HashMapHolder<Player>::MapType const& m = GetPlayers();
|
||||
@@ -200,7 +200,7 @@ Player* ObjectAccessor::FindPlayerByName(std::string const& name, bool checkInWo
|
||||
|
||||
void ObjectAccessor::SaveAllPlayers()
|
||||
{
|
||||
TRINITY_READ_GUARD(HashMapHolder<Player>::LockType, *HashMapHolder<Player>::GetLock());
|
||||
ACORE_READ_GUARD(HashMapHolder<Player>::LockType, *HashMapHolder<Player>::GetLock());
|
||||
HashMapHolder<Player>::MapType const& m = GetPlayers();
|
||||
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
itr->second->SaveToDB(false, false);
|
||||
@@ -208,7 +208,7 @@ void ObjectAccessor::SaveAllPlayers()
|
||||
|
||||
Corpse* ObjectAccessor::GetCorpseForPlayerGUID(uint64 guid)
|
||||
{
|
||||
TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
ACORE_READ_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
|
||||
Player2CorpsesMapType::iterator iter = i_player2corpse.find(guid);
|
||||
if (iter == i_player2corpse.end())
|
||||
@@ -225,7 +225,7 @@ void ObjectAccessor::RemoveCorpse(Corpse* corpse, bool final)
|
||||
|
||||
if (!final)
|
||||
{
|
||||
TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
ACORE_WRITE_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
Player2CorpsesMapType::iterator iter = i_player2corpse.find(corpse->GetOwnerGUID());
|
||||
if (iter == i_player2corpse.end())
|
||||
return;
|
||||
@@ -252,10 +252,10 @@ void ObjectAccessor::RemoveCorpse(Corpse* corpse, bool final)
|
||||
|
||||
// Critical section
|
||||
{
|
||||
TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
ACORE_WRITE_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
|
||||
// build mapid*cellid -> guid_set map
|
||||
CellCoord cellCoord = Trinity::ComputeCellCoord(corpse->GetPositionX(), corpse->GetPositionY());
|
||||
CellCoord cellCoord = acore::ComputeCellCoord(corpse->GetPositionX(), corpse->GetPositionY());
|
||||
sObjectMgr->DeleteCorpseCellData(corpse->GetMapId(), cellCoord.GetId(), GUID_LOPART(corpse->GetOwnerGUID()));
|
||||
}
|
||||
|
||||
@@ -268,20 +268,20 @@ void ObjectAccessor::AddCorpse(Corpse* corpse)
|
||||
|
||||
// Critical section
|
||||
{
|
||||
TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
ACORE_WRITE_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
|
||||
ASSERT(i_player2corpse.find(corpse->GetOwnerGUID()) == i_player2corpse.end());
|
||||
i_player2corpse[corpse->GetOwnerGUID()] = corpse;
|
||||
|
||||
// build mapid*cellid -> guid_set map
|
||||
CellCoord cellCoord = Trinity::ComputeCellCoord(corpse->GetPositionX(), corpse->GetPositionY());
|
||||
CellCoord cellCoord = acore::ComputeCellCoord(corpse->GetPositionX(), corpse->GetPositionY());
|
||||
sObjectMgr->AddCorpseCellData(corpse->GetMapId(), cellCoord.GetId(), GUID_LOPART(corpse->GetOwnerGUID()), corpse->GetInstanceId());
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectAccessor::AddCorpsesToGrid(GridCoord const& gridpair, GridType& grid, Map* map)
|
||||
{
|
||||
TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
ACORE_READ_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
|
||||
for (Player2CorpsesMapType::iterator iter = i_player2corpse.begin(); iter != i_player2corpse.end(); ++iter)
|
||||
{
|
||||
@@ -369,7 +369,7 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia
|
||||
}
|
||||
|
||||
// pussywizard: for deleting bones
|
||||
TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
ACORE_WRITE_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
i_playerBones.push_back(bones->GetGUID());
|
||||
}
|
||||
|
||||
@@ -396,7 +396,7 @@ void ObjectAccessor::RemoveOldCorpses()
|
||||
|
||||
// pussywizard: for deleting bones
|
||||
std::list<uint64>::iterator next2;
|
||||
TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
ACORE_WRITE_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
for (std::list<uint64>::iterator itr = i_playerBones.begin(); itr != i_playerBones.end(); itr = next2)
|
||||
{
|
||||
next2 = itr;
|
||||
@@ -429,13 +429,13 @@ void ObjectAccessor::RemoveOldCorpses()
|
||||
|
||||
void ObjectAccessor::AddDelayedCorpseAction(Corpse* corpse, uint8 action, uint32 mapId, uint32 instanceId)
|
||||
{
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, DelayedCorpseLock);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, DelayedCorpseLock);
|
||||
i_delayedCorpseActions.push_back(DelayedCorpseAction(corpse, action, mapId, instanceId));
|
||||
}
|
||||
|
||||
void ObjectAccessor::ProcessDelayedCorpseActions()
|
||||
{
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, DelayedCorpseLock);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, DelayedCorpseLock);
|
||||
for (std::list<DelayedCorpseAction>::iterator itr = i_delayedCorpseActions.begin(); itr != i_delayedCorpseActions.end(); ++itr)
|
||||
{
|
||||
DelayedCorpseAction a = (*itr);
|
||||
|
||||
Reference in New Issue
Block a user