AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
WorldScript Class Reference

#include "WorldScript.h"

Inheritance diagram for WorldScript:
ScriptObject

Public Member Functions

virtual void OnOpenStateChange (bool)
 
virtual void OnAfterConfigLoad (bool)
 
virtual void OnLoadCustomDatabaseTable ()
 
virtual void OnBeforeConfigLoad (bool)
 
virtual void OnMotdChange (std::string &, LocaleConstant &)
 
virtual void OnShutdownInitiate (ShutdownExitCode, ShutdownMask)
 
virtual void OnShutdownCancel ()
 
virtual void OnUpdate (uint32)
 
virtual void OnStartup ()
 
virtual void OnShutdown ()
 
virtual void OnAfterUnloadAllMaps ()
 Called after all maps are unloaded from core. More...
 
virtual void OnBeforeFinalizePlayerWorldSession (uint32 &)
 This hook runs before finalizing the player world session. Can be also used to mutate the cache version of the Client. More...
 
virtual void OnBeforeWorldInitialized ()
 This hook runs after all scripts loading and before itialized. More...
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
uint16 GetTotalAvailableHooks ()
 

Protected Member Functions

 WorldScript (const char *name, std::vector< uint16 > enabledHooks=std::vector< uint16 >())
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name, uint16 totalAvailableHooks=0)
 
virtual ~ScriptObject ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ WorldScript()

WorldScript::WorldScript ( const char *  name,
std::vector< uint16 enabledHooks = std::vector<uint16>() 
)
protected
89{
90 // If empty - enable all available hooks.
91 if (enabledHooks.empty())
92 for (uint16 i = 0; i < WORLDHOOK_END; ++i)
93 enabledHooks.emplace_back(i);
94
95 ScriptRegistry<WorldScript>::AddScript(this, std::move(enabledHooks));
96}
std::uint16_t uint16
Definition: Define.h:108
@ WORLDHOOK_END
Definition: WorldScript.h:40
static void AddScript(TScript *const script, std::vector< uint16 > enabledHooks={})
Definition: ScriptMgr.h:738
Definition: ScriptObject.h:43

References ScriptRegistry< TScript >::AddScript(), and WORLDHOOK_END.

Member Function Documentation

◆ OnAfterConfigLoad()

virtual void WorldScript::OnAfterConfigLoad ( bool  )
inlinevirtual
53{ }

◆ OnAfterUnloadAllMaps()

virtual void WorldScript::OnAfterUnloadAllMaps ( )
inlinevirtual

Called after all maps are unloaded from core.

82{ }

◆ OnBeforeConfigLoad()

virtual void WorldScript::OnBeforeConfigLoad ( bool  )
inlinevirtual
59{ }

◆ OnBeforeFinalizePlayerWorldSession()

virtual void WorldScript::OnBeforeFinalizePlayerWorldSession ( uint32 )
inlinevirtual

This hook runs before finalizing the player world session. Can be also used to mutate the cache version of the Client.

Parameters
versionThe cache version that we will be sending to the Client.
89{ }

◆ OnBeforeWorldInitialized()

virtual void WorldScript::OnBeforeWorldInitialized ( )
inlinevirtual

This hook runs after all scripts loading and before itialized.

94{ }

◆ OnLoadCustomDatabaseTable()

virtual void WorldScript::OnLoadCustomDatabaseTable ( )
inlinevirtual
56{ }

◆ OnMotdChange()

virtual void WorldScript::OnMotdChange ( std::string &  ,
LocaleConstant  
)
inlinevirtual
62{ }

◆ OnOpenStateChange()

virtual void WorldScript::OnOpenStateChange ( bool  )
inlinevirtual
50{ }

◆ OnShutdown()

virtual void WorldScript::OnShutdown ( )
inlinevirtual
77{ }

◆ OnShutdownCancel()

virtual void WorldScript::OnShutdownCancel ( )
inlinevirtual
68{ }

◆ OnShutdownInitiate()

virtual void WorldScript::OnShutdownInitiate ( ShutdownExitCode  ,
ShutdownMask   
)
inlinevirtual
65{ }

◆ OnStartup()

virtual void WorldScript::OnStartup ( )
inlinevirtual
74{ }

◆ OnUpdate()

virtual void WorldScript::OnUpdate ( uint32  )
inlinevirtual
71{ }