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

#include "SessionScript.h"

Inheritance diagram for SessionScript:
ScriptObject

Public Member Functions

virtual void OnSessionUpdate (WorldSession *, uint32)
 This hook is called once per world tick for every session, from the world thread, right before the session processes its logout and warden checks.
 
virtual bool OnWardenCheckExpectedResult (WorldSession *, WardenCheck const &, std::vector< uint8 > &)
 This hook is called when Warden evaluates the client's answer to a MEM_CHECK or MPQ_CHECK, right before the answer is compared with the expected bytes.
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
std::string const & GetName () const
 
uint16 GetTotalAvailableHooks ()
 

Protected Member Functions

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

Detailed Description

Constructor & Destructor Documentation

◆ SessionScript()

SessionScript::SessionScript ( char const *  name,
std::vector< uint16 >  enabledHooks = std::vector<uint16>() 
)
protected
40{
41 // If empty - enable all available hooks.
42 if (enabledHooks.empty())
43 for (uint16 i = 0; i < SESSIONHOOK_END; ++i)
44 enabledHooks.emplace_back(i);
45
46 ScriptRegistry<SessionScript>::AddScript(this, std::move(enabledHooks));
47}
std::uint16_t uint16
Definition Define.h:108
@ SESSIONHOOK_END
Definition SessionScript.h:28
Definition ScriptObject.h:42
static void AddScript(TScript *const script, std::vector< uint16 > enabledHooks={})
Definition ScriptMgr.h:798

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

Member Function Documentation

◆ OnSessionUpdate()

virtual void SessionScript::OnSessionUpdate ( WorldSession *  ,
uint32   
)
inlinevirtual

This hook is called once per world tick for every session, from the world thread, right before the session processes its logout and warden checks.

Parameters
sessionContains information about the WorldSession
diffContains information about the diff time
44{ }

Referenced by ScriptMgr::OnSessionUpdate().

◆ OnWardenCheckExpectedResult()

virtual bool SessionScript::OnWardenCheckExpectedResult ( WorldSession *  ,
WardenCheck const &  ,
std::vector< uint8 > &   
)
inlinevirtual

This hook is called when Warden evaluates the client's answer to a MEM_CHECK or MPQ_CHECK, right before the answer is compared with the expected bytes.

A script may replace the expected bytes (warden_checks.result) for this session only, for example for a client build whose memory or files legitimately differ from the stock client.

Parameters
sessionContains information about the WorldSession
checkThe warden check being evaluated
expectedReceives the bytes the client must return: check.Length bytes for a MEM_CHECK, 20 (SHA1) for an MPQ_CHECK
Returns
true if expected was filled; the first script returning true wins
60 { return false; }

Referenced by ScriptMgr::OnWardenCheckExpectedResult().


The documentation for this class was generated from the following files: