[11139] Use for Creature/GameObject local per-map guids

* Creature/GameObject guid generators moved to Map
* For avoid wrong not converted cases generic function in ObjectMgr has been replaced by
  specilized guid generation function like sObjectMgr.GeneratePlayerLowGuid().
  This let catch all cases that need update in custom code or scripts.
* Drop many ObjectAcessor.h now dead code. This is also make mangos more thread safe.
* Restore one more time unix build broken in prev. commits.

Note: many cases when something not wotk in instance but work in continents
possible magicly start work after this commit. For example, some gm commands.
From large systems that need more chnages for start work in full power in instances
can be referecned pool/gamevent system. Last need just small hacks drop changes but
in will addded in independent commit.
This commit is contained in:
VladimirMangos 2011-02-12 08:48:32 +03:00
parent 9a8a74c2ad
commit cf685da47a
29 changed files with 69 additions and 138 deletions

View file

@ -141,6 +141,9 @@ template uint32 IdGenerator<uint32>::Generate();
template uint64 IdGenerator<uint64>::Generate();
ObjectMgr::ObjectMgr() :
m_CreatureFirstGuid(1),
m_GameObjectFirstGuid(1),
m_ArenaTeamIds("Arena team ids"),
m_AuctionIds("Auction ids"),
m_EquipmentSetIds("Equipment set ids"),
@ -5602,7 +5605,7 @@ void ObjectMgr::SetHighestGuids()
result = WorldDatabase.Query( "SELECT MAX(guid) FROM creature" );
if( result )
{
m_CreatureGuids.Set((*result)[0].GetUInt32()+1);
m_CreatureFirstGuid = (*result)[0].GetUInt32()+1;
delete result;
}
@ -5631,7 +5634,7 @@ void ObjectMgr::SetHighestGuids()
result = WorldDatabase.Query("SELECT MAX(guid) FROM gameobject" );
if( result )
{
m_GameobjectGuids.Set((*result)[0].GetUInt32()+1);
m_CreatureFirstGuid = (*result)[0].GetUInt32()+1;
delete result;
}
@ -5685,30 +5688,6 @@ void ObjectMgr::SetHighestGuids()
}
}
uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh)
{
switch(guidhigh)
{
case HIGHGUID_ITEM:
return m_ItemGuids.Generate();
case HIGHGUID_UNIT:
return m_CreatureGuids.Generate();
case HIGHGUID_PLAYER:
return m_CharGuids.Generate();
case HIGHGUID_GAMEOBJECT:
return m_GameobjectGuids.Generate();
case HIGHGUID_CORPSE:
return m_CorpseGuids.Generate();
case HIGHGUID_INSTANCE:
return m_InstanceGuids.Generate();
default:
MANGOS_ASSERT(0);
}
MANGOS_ASSERT(0);
return 0;
}
void ObjectMgr::LoadGameObjectLocales()
{
mGameObjectLocaleMap.clear(); // need for reload case