Add MaNGOS required changes

This commit is contained in:
Rochet2
2016-03-04 23:25:43 +02:00
parent 4892f86e43
commit 37eec855c5
2 changed files with 8 additions and 0 deletions

View File

@@ -153,8 +153,12 @@ namespace LuaGlobalFunctions
{ {
#ifdef TRINITY #ifdef TRINITY
boost::shared_lock<boost::shared_mutex> lock(*HashMapHolder<Player>::GetLock()); boost::shared_lock<boost::shared_mutex> lock(*HashMapHolder<Player>::GetLock());
#else
#ifdef MANGOS
ACE_READ_GUARD_RETURN(HashMapHolder<Player>::LockType, g, HashMapHolder<Player>::GetLock(), 0)
#else #else
HashMapHolder<Player>::ReadGuard g(HashMapHolder<Player>::GetLock()); HashMapHolder<Player>::ReadGuard g(HashMapHolder<Player>::GetLock());
#endif
#endif #endif
const HashMapHolder<Player>::MapType& m = eObjectAccessor()GetPlayers(); const HashMapHolder<Player>::MapType& m = eObjectAccessor()GetPlayers();
for (HashMapHolder<Player>::MapType::const_iterator it = m.begin(); it != m.end(); ++it) for (HashMapHolder<Player>::MapType::const_iterator it = m.begin(); it != m.end(); ++it)

View File

@@ -26,8 +26,12 @@ namespace LuaGuild
{ {
#ifdef TRINITY #ifdef TRINITY
boost::shared_lock<boost::shared_mutex> lock(*HashMapHolder<Player>::GetLock()); boost::shared_lock<boost::shared_mutex> lock(*HashMapHolder<Player>::GetLock());
#else
#ifdef MANGOS
ACE_READ_GUARD_RETURN(HashMapHolder<Player>::LockType, g, HashMapHolder<Player>::GetLock(), 0)
#else #else
HashMapHolder<Player>::ReadGuard g(HashMapHolder<Player>::GetLock()); HashMapHolder<Player>::ReadGuard g(HashMapHolder<Player>::GetLock());
#endif
#endif #endif
const HashMapHolder<Player>::MapType& m = eObjectAccessor()GetPlayers(); const HashMapHolder<Player>::MapType& m = eObjectAccessor()GetPlayers();
for (HashMapHolder<Player>::MapType::const_iterator it = m.begin(); it != m.end(); ++it) for (HashMapHolder<Player>::MapType::const_iterator it = m.begin(); it != m.end(); ++it)