mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 22:37:02 +00:00
[11455] Use ObjectGuid in HashMapHolder
This commit is contained in:
parent
b647835469
commit
51031c2d24
8 changed files with 42 additions and 40 deletions
|
|
@ -88,8 +88,8 @@ ObjectAccessor::FindPlayerByName(const char *name)
|
|||
{
|
||||
HashMapHolder<Player>::ReadGuard g(HashMapHolder<Player>::GetLock());
|
||||
HashMapHolder<Player>::MapType& m = sObjectAccessor.GetPlayers();
|
||||
for(HashMapHolder<Player>::MapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
if(iter->second->IsInWorld() && ( ::strcmp(name, iter->second->GetName()) == 0 ))
|
||||
for (HashMapHolder<Player>::MapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
if (iter->second->IsInWorld() && ( ::strcmp(name, iter->second->GetName()) == 0 ))
|
||||
return iter->second;
|
||||
|
||||
return NULL;
|
||||
|
|
@ -100,7 +100,7 @@ ObjectAccessor::SaveAllPlayers()
|
|||
{
|
||||
HashMapHolder<Player>::ReadGuard g(HashMapHolder<Player>::GetLock());
|
||||
HashMapHolder<Player>::MapType& m = sObjectAccessor.GetPlayers();
|
||||
for(HashMapHolder<Player>::MapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
for (HashMapHolder<Player>::MapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
itr->second->SaveToDB();
|
||||
}
|
||||
|
||||
|
|
@ -270,7 +270,7 @@ void ObjectAccessor::RemoveOldCorpses()
|
|||
|
||||
/// Define the static member of HashMapHolder
|
||||
|
||||
template <class T> UNORDERED_MAP< uint64, T* > HashMapHolder<T>::m_objectMap;
|
||||
template <class T> typename HashMapHolder<T>::MapType HashMapHolder<T>::m_objectMap;
|
||||
template <class T> ACE_RW_Thread_Mutex HashMapHolder<T>::i_lock;
|
||||
|
||||
/// Global definitions for the hashmap storage
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue