** Cleanup in ObjectAccessor/HashMapHolder:

* Correctly lock the HashMapHolder on access.
* Use ObjectAccessor wrappers (GetPlayers, GetCreatures, GetGameObjects) instead of raw HashMapHolder<Type>::GetContainer.
* General code style cleanup.

--HG--
branch : trunk
This commit is contained in:
XTZGZoReX
2010-03-13 16:17:25 +01:00
parent 76afec204d
commit f8c5b9a4a7
6 changed files with 154 additions and 179 deletions
+2 -2
View File
@@ -32,7 +32,7 @@ static void AttemptJoin(Player* _player)
if(!_player->m_lookingForGroup.canAutoJoin() || _player->GetGroup())
return;
//TODO: Guard Player Map
ObjectAccessor::Guard guard(*HashMapHolder<Player>::GetLock());
HashMapHolder<Player>::MapType const& players = ObjectAccessor::Instance().GetPlayers();
for (HashMapHolder<Player>::MapType::const_iterator iter = players.begin(); iter != players.end(); ++iter)
{
@@ -92,7 +92,7 @@ static void AttemptAddMore(Player* _player)
if(!_player->m_lookingForGroup.more.canAutoJoin())
return;
//TODO: Guard Player map
ObjectAccessor::Guard guard(*HashMapHolder<Player>::GetLock());
HashMapHolder<Player>::MapType const& players = ObjectAccessor::Instance().GetPlayers();
for (HashMapHolder<Player>::MapType::const_iterator iter = players.begin(); iter != players.end(); ++iter)
{