diff options
author | XTZGZoReX <none@none> | 2010-01-23 22:24:41 +0100 |
---|---|---|
committer | XTZGZoReX <none@none> | 2010-01-23 22:24:41 +0100 |
commit | 9f00ca3eb884399479009ae5d5a1224c047d0650 (patch) | |
tree | 1ba2681bb2ca1c7e4ad9b4334f1b725d222b44ed /src/game/Object.cpp | |
parent | fe07518bafe3f0a52630ce09ee5742453f2f6801 (diff) |
* Remove CellLock class and all cell-level thread locking.
** It was wasting CPU power as cell-level locking is not needed.
** Our multithreading is on map-level, not cell-level.
** CellLock was just a 'proxy' between Cell and CellPair and in some cases carried redundant data.
** Some minor cleanup in Cell::Visit/Map::Visit.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Object.cpp')
-rw-r--r-- | src/game/Object.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 7433113f051..c875f17fd9a 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1546,8 +1546,7 @@ void WorldObject::MonsterSay(int32 textId, uint32 language, uint64 TargetGuid) Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build); Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this,sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY),say_do); TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker); - CellLock<GridReadGuard> cell_lock(cell, p); - cell_lock->Visit(cell_lock, message, *GetMap(), *this, sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY)); + cell.Visit(p, message, *GetMap(), *this, sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY)); } void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid) @@ -1562,8 +1561,7 @@ void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid) Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build); Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this,sWorld.getConfig(CONFIG_LISTEN_RANGE_YELL),say_do); TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker); - CellLock<GridReadGuard> cell_lock(cell, p); - cell_lock->Visit(cell_lock, message, *GetMap(), *this, sWorld.getConfig(CONFIG_LISTEN_RANGE_YELL)); + cell.Visit(p, message, *GetMap(), *this, sWorld.getConfig(CONFIG_LISTEN_RANGE_YELL)); } void WorldObject::MonsterYellToZone(int32 textId, uint32 language, uint64 TargetGuid) @@ -1591,8 +1589,7 @@ void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossE Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build); Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this,sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),say_do); TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker); - CellLock<GridReadGuard> cell_lock(cell, p); - cell_lock->Visit(cell_lock, message, *GetMap(), *this, sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); + cell.Visit(p, message, *GetMap(), *this, sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); } void WorldObject::MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisper) @@ -1984,8 +1981,7 @@ void WorldObject::GetGameObjectListWithEntryInGrid(std::list<GameObject*>& lList Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInRange> searcher(this, lList, check); TypeContainerVisitor<Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInRange>, GridTypeMapContainer> visitor(searcher); - CellLock<GridReadGuard> cell_lock(cell, pair); - cell_lock->Visit(cell_lock, visitor, *(this->GetMap())); + cell.Visit(pair, visitor, *(this->GetMap())); } void WorldObject::GetCreatureListWithEntryInGrid(std::list<Creature*>& lList, uint32 uiEntry, float fMaxSearchRange) @@ -1999,8 +1995,7 @@ void WorldObject::GetCreatureListWithEntryInGrid(std::list<Creature*>& lList, ui Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(this, lList, check); TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> visitor(searcher); - CellLock<GridReadGuard> cell_lock(cell, pair); - cell_lock->Visit(cell_lock, visitor, *(this->GetMap())); + cell.Visit(pair, visitor, *(this->GetMap())); } /* |