HI everyone Want to present you first patch from planned by me and mangos dev team map system changes. We plan to add around 4 patches, which will offer different performance improvements and modifications to the core. In the end there will be a multithreading patch, based on Derex' mtmaps, but offering much more scalability
What does this patch do:
1) Improves server performance by caching all world objects' map locations. This affects around 216(!) code places from grid loading to different location checks, e.g. IsInWater() etc.
2) from now on you cannot explicitly call for SetMapId()/SetINstanceId() to manipulate object's mapId information. Use WorldObject::SetMap() instead.
3) All redundant calls to MapManager::CreateMap()/GetBaseMap() were replaced by WorldObject::GetMap() calls! This was done to improve code performance.
Attention! Due to conversation with Wyk3d MapManager::CreateMap() was left as is, but MapManager::GetBaseMap() renamed to MapManager::CreateBaseMap(). Even if you have patches which compile with this patch, I insist that you changed ALL MapManager::CreateMap()/GetBaseMap() calls to WorldObject::GetMap() ! Or post them here so I can help you make them compatible with future changes...
For example:
Old code:
pObj->SetRespawnTime(GetSpellDuration(GetSpellProto())/1000); m_target->AddGameObject(pObj);
[b]MapManager::Instance().CreateMap(pObj->GetMapId(), pObj)[/b]->Add(pObj);
New code:
pObj->SetRespawnTime(GetSpellDuration(GetSpellProto())/1000); m_target->AddGameObject(pObj);
[b]m_target->GetMap()[/b]->Add(pObj);
patch 1.14 http://filebeam.com/986887c9755f9cc0744c09ba6d47c986
patch 1.13 rev 8158: http://filebeam.com/eae0aae3ce42022a8cb573d5465d74a0
patch 1.10 rev 8103: http://filebeam.com/e38571440a68a8bc5361235dfbd866c6
patch 1.10 rev 8099: http://filebeam.com/774bf88af37cb0c2e7edb354d2b731e4
patch 1.10: http://filebeam.com/e30967cbd6a613751407b9c464521179
patch 1.09: http://filebeam.com/1424f8f721c70e2cdcafb553a4b0f092
Patch 1.08: http://filebeam.com/e030772048e2a21a947148cd2adfb431
Patch 1.07: http://filebeam.com/1349b226379bead1b97c09b9a6db2e39
Patch 1.06: http://filebeam.com/ead5afdf126daf180797233119b41146
Patch 1.05: http://filebeam.com/3f9c1afdb03690eeff5179449fed8ccf