mirror of
https://github.com/mangosfour/server.git
synced 2025-12-28 04:37:04 +00:00
[11259] Move scheduled scripts counter to ScriptMgr
Also cleanup forward declarations.
This commit is contained in:
parent
dee6d712c4
commit
a6d155fc54
9 changed files with 33 additions and 33 deletions
|
|
@ -23,6 +23,7 @@
|
|||
#include "Policies/Singleton.h"
|
||||
#include "ObjectGuid.h"
|
||||
#include "DBCEnums.h"
|
||||
#include "ace/Atomic_Op.h"
|
||||
|
||||
struct AreaTriggerEntry;
|
||||
class Aura;
|
||||
|
|
@ -297,6 +298,7 @@ struct ScriptAction
|
|||
|
||||
typedef std::multimap<uint32, ScriptInfo> ScriptMap;
|
||||
typedef std::map<uint32, ScriptMap > ScriptMapMap;
|
||||
|
||||
extern ScriptMapMap sQuestEndScripts;
|
||||
extern ScriptMapMap sQuestStartScripts;
|
||||
extern ScriptMapMap sSpellScripts;
|
||||
|
|
@ -343,6 +345,11 @@ class ScriptMgr
|
|||
void UnloadScriptLibrary();
|
||||
bool IsScriptLibraryLoaded() const { return m_hScriptLib != NULL; }
|
||||
|
||||
uint32 IncreaseScheduledScriptsCount() { return (uint32)++m_scheduledScripts; }
|
||||
uint32 DecreaseScheduledScriptCount() { return (uint32)--m_scheduledScripts; }
|
||||
uint32 DecreaseScheduledScriptCount(size_t count) { return (uint32)(m_scheduledScripts -= count); }
|
||||
bool IsScriptScheduled() const { return m_scheduledScripts > 0; }
|
||||
|
||||
CreatureAI* GetCreatureAI(Creature* pCreature);
|
||||
InstanceData* CreateInstanceData(Map* pMap);
|
||||
|
||||
|
|
@ -387,6 +394,9 @@ class ScriptMgr
|
|||
ScriptNameMap m_scriptNames;
|
||||
MANGOS_LIBRARY_HANDLE m_hScriptLib;
|
||||
|
||||
//atomic op counter for active scripts amount
|
||||
ACE_Atomic_Op<ACE_Thread_Mutex, long> m_scheduledScripts;
|
||||
|
||||
void (MANGOS_IMPORT* m_pOnInitScriptLibrary)();
|
||||
void (MANGOS_IMPORT* m_pOnFreeScriptLibrary)();
|
||||
const char* (MANGOS_IMPORT* m_pGetScriptLibraryVersion)();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue