mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[10914] Remove ObjectLevelLockable inheritance in Map class + cleanup locks in Map code. Restore build after recent commits.
Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
parent
8f37314950
commit
f56e13966f
4 changed files with 124 additions and 133 deletions
|
|
@ -31,7 +31,6 @@
|
|||
#include "ObjectMgr.h"
|
||||
#include "World.h"
|
||||
#include "ScriptCalls.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "Group.h"
|
||||
#include "MapRefManager.h"
|
||||
#include "DBCEnums.h"
|
||||
|
|
@ -39,14 +38,6 @@
|
|||
#include "VMapFactory.h"
|
||||
#include "BattleGroundMgr.h"
|
||||
|
||||
struct ScriptAction
|
||||
{
|
||||
ObjectGuid sourceGuid;
|
||||
ObjectGuid targetGuid;
|
||||
ObjectGuid ownerGuid; // owner of source if source is item
|
||||
ScriptInfo const* script; // pointer to static script data
|
||||
};
|
||||
|
||||
Map::~Map()
|
||||
{
|
||||
ObjectAccessor::DelinkMap(this);
|
||||
|
|
@ -225,9 +216,6 @@ void Map::AddNotifier(Creature* obj, Cell const&, CellPair const&)
|
|||
void
|
||||
Map::EnsureGridCreated(const GridPair &p)
|
||||
{
|
||||
if(!getNGrid(p.x_coord, p.y_coord))
|
||||
{
|
||||
Guard guard(*this);
|
||||
if(!getNGrid(p.x_coord, p.y_coord))
|
||||
{
|
||||
setNGrid(new NGridType(p.x_coord*MAX_NUMBER_OF_GRIDS + p.y_coord, p.x_coord, p.y_coord, i_gridExpiry, sWorld.getConfig(CONFIG_BOOL_GRID_UNLOAD)),
|
||||
|
|
@ -245,7 +233,6 @@ Map::EnsureGridCreated(const GridPair &p)
|
|||
if(!m_bLoadedGrids[gx][gy])
|
||||
LoadMapAndVMap(gx,gy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1319,8 +1306,6 @@ bool InstanceMap::Add(Player *player)
|
|||
// GMs still can teleport player in instance.
|
||||
// Is it needed?
|
||||
|
||||
{
|
||||
Guard guard(*this);
|
||||
if (!CanEnter(player))
|
||||
return false;
|
||||
|
||||
|
|
@ -1429,7 +1414,6 @@ bool InstanceMap::Add(Player *player)
|
|||
m_unloadTimer = 0;
|
||||
m_resetAfterUnload = false;
|
||||
m_unloadWhenEmpty = false;
|
||||
}
|
||||
|
||||
// this will acquire the same mutex so it cannot be in the previous block
|
||||
Map::Add(player);
|
||||
|
|
@ -1649,13 +1633,12 @@ bool BattleGroundMap::CanEnter(Player * player)
|
|||
|
||||
bool BattleGroundMap::Add(Player * player)
|
||||
{
|
||||
{
|
||||
Guard guard(*this);
|
||||
if(!CanEnter(player))
|
||||
return false;
|
||||
|
||||
// reset instance validity, battleground maps do not homebind
|
||||
player->m_InstanceValid = true;
|
||||
}
|
||||
|
||||
return Map::Add(player);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
#include "GameSystem/GridRefManager.h"
|
||||
#include "MapRefManager.h"
|
||||
#include "Utilities/TypeList.h"
|
||||
#include "ScriptMgr.h"
|
||||
|
||||
#include <bitset>
|
||||
#include <list>
|
||||
|
|
@ -46,7 +47,6 @@ class InstanceData;
|
|||
class Group;
|
||||
class InstanceSave;
|
||||
struct ScriptInfo;
|
||||
struct ScriptAction;
|
||||
class BattleGround;
|
||||
class GridMap;
|
||||
|
||||
|
|
@ -80,7 +80,7 @@ enum LevelRequirementVsMode
|
|||
|
||||
#define MIN_UNLOAD_DELAY 1 // immediate unload
|
||||
|
||||
class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::ObjectLevelLockable<Map, ACE_Thread_Mutex>
|
||||
class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>
|
||||
{
|
||||
friend class MapReference;
|
||||
friend class ObjectGridLoader;
|
||||
|
|
@ -276,7 +276,6 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
|
|||
void SendObjectUpdates();
|
||||
std::set<Object *> i_objectsToClientUpdate;
|
||||
protected:
|
||||
typedef MaNGOS::ObjectLevelLockable<Map, ACE_Thread_Mutex>::Lock Guard;
|
||||
|
||||
MapEntry const* i_mapEntry;
|
||||
uint8 i_spawnMode;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "Common.h"
|
||||
#include "Policies/Singleton.h"
|
||||
#include "ObjectGuid.h"
|
||||
|
||||
enum eScriptCommand
|
||||
{
|
||||
|
|
@ -269,6 +270,14 @@ struct ScriptInfo
|
|||
}
|
||||
};
|
||||
|
||||
struct ScriptAction
|
||||
{
|
||||
ObjectGuid sourceGuid;
|
||||
ObjectGuid targetGuid;
|
||||
ObjectGuid ownerGuid; // owner of source if source is item
|
||||
ScriptInfo const* script; // pointer to static script data
|
||||
};
|
||||
|
||||
typedef std::multimap<uint32, ScriptInfo> ScriptMap;
|
||||
typedef std::map<uint32, ScriptMap > ScriptMapMap;
|
||||
extern ScriptMapMap sQuestEndScripts;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10913"
|
||||
#define REVISION_NR "10914"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue