** 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:
1 parent
76afec204d
commit
f8c5b9a4a7
6 files changed
+154
-179
No files matched your search
+3
-3
@@ -165,9 +165,9 @@ bool ChatHandler::HandleGMListIngameCommand(const char* /*args*/)
|
||||
{
|
||||
bool first = true;
|
||||
|
||||
HashMapHolder<Player>::MapType &m = HashMapHolder<Player>::GetContainer();
|
||||
HashMapHolder<Player>::MapType::const_iterator itr = m.begin();
|
||||
for (; itr != m.end(); ++itr)
|
||||
ObjectAccessor::Guard guard(*HashMapHolder<Player>::GetLock());
|
||||
HashMapHolder<Player>::MapType &m = ObjectAccessor::Instance().GetPlayers();
|
||||
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
AccountTypes itr_sec = itr->second->GetSession()->GetSecurity();
|
||||
if ((itr->second->isGameMaster() || (itr_sec > SEC_PLAYER && itr_sec <= sWorld.getConfig(CONFIG_GM_LEVEL_IN_GM_LIST))) &&
|
||||
|
||||
Reference in new issue
Block a user