AzerothCore 3.3.5a
OpenSource WoW Emulator
|
The WardenPayloadMgr is responsible for maintaining custom payloads used by modules. More...
#include "WardenPayloadMgr.h"
Public Member Functions | |
WardenPayloadMgr () | |
uint16 | GetFreePayloadId () |
Finds a free payload id in WardenPayloadMgr::CachedChecks. More... | |
uint16 | RegisterPayload (const std::string &payload) |
Register a payload into cache and returns its payload id. More... | |
bool | RegisterPayload (std::string const &payload, uint16 payloadId, bool replace=false) |
Register a payload into cache with a custom id and returns the result. More... | |
bool | UnregisterPayload (uint16 payloadId) |
Unregister a payload from cache and return if successful. More... | |
WardenCheck * | GetPayloadById (uint16 payloadId) |
Get a payload by id from the WardenPayloadMgr::CachedChecks. More... | |
void | QueuePayload (uint16 payloadId, bool pushToFront=false) |
Queue the payload into the normal warden checks. More... | |
bool | DequeuePayload (uint16 payloadId) |
Dequeue the payload from the WardenPayloadMgr::QueuedPayloads queue. More... | |
void | ClearQueuedPayloads () |
Clear the payloads from the WardenPayloadMgr::QueuedPayloads queue. More... | |
uint32 | GetPayloadCountInQueue () |
Get the amount of payloads waiting in WardenPayloadMgr::QueuedPayloads. More... | |
std::list< uint16 > * | GetPayloadsInQueue () |
Get payloads waiting in WardenPayloadMgr::QueuedPayloads. More... | |
Public Attributes | |
std::list< uint16 > | QueuedPayloads |
The list of currently queued payload ids to be sent through Warden. More... | |
std::map< uint16, WardenCheck > | CachedChecks |
The cached payloads that are accessed by payload id. More... | |
Static Public Attributes | |
static uint16 constexpr | WardenPayloadOffsetMin = 5000 |
The minimum id available for custom payloads. More... | |
static uint16 constexpr | WardenPayloadOffsetMax = 9999 |
The maximum id available for custom payloads. More... | |
static uint32 constexpr | WardenPayloadCheckType = 139 |
The checktype used for warden payloads. More... | |
The WardenPayloadMgr is responsible for maintaining custom payloads used by modules.
This allows users to send custom lua payloads up to a size of 512 bytes to the game client. Some of the things you can achieve with this is:
Opening up many possiblilties for a patch-less custom server.
WardenPayloadMgr::WardenPayloadMgr | ( | ) |
void WardenPayloadMgr::ClearQueuedPayloads | ( | ) |
Clear the payloads from the WardenPayloadMgr::QueuedPayloads queue.
References QueuedPayloads.
bool WardenPayloadMgr::DequeuePayload | ( | uint16 | payloadId | ) |
Dequeue the payload from the WardenPayloadMgr::QueuedPayloads queue.
payloadId | The payloadId to be dequeued. |
References QueuedPayloads.
uint16 WardenPayloadMgr::GetFreePayloadId | ( | ) |
Finds a free payload id in WardenPayloadMgr::CachedChecks.
References CachedChecks, LOG_ERROR, WardenPayloadOffsetMax, and WardenPayloadOffsetMin.
Referenced by RegisterPayload().
WardenCheck * WardenPayloadMgr::GetPayloadById | ( | uint16 | payloadId | ) |
Get a payload by id from the WardenPayloadMgr::CachedChecks.
payloadId | The payload to fetched from WardenPayloadMgr::CachedChecks. |
References CachedChecks.
uint32 WardenPayloadMgr::GetPayloadCountInQueue | ( | ) |
Get the amount of payloads waiting in WardenPayloadMgr::QueuedPayloads.
References QueuedPayloads.
std::list< uint16 > * WardenPayloadMgr::GetPayloadsInQueue | ( | ) |
Get payloads waiting in WardenPayloadMgr::QueuedPayloads.
References QueuedPayloads.
void WardenPayloadMgr::QueuePayload | ( | uint16 | payloadId, |
bool | pushToFront = false |
||
) |
Queue the payload into the normal warden checks.
payloadId | The payloadId to be queued. |
pushToFront | If payload should be pushed to the front queue. |
References CachedChecks, LOG_ERROR, and QueuedPayloads.
uint16 WardenPayloadMgr::RegisterPayload | ( | const std::string & | payload | ) |
Register a payload into cache and returns its payload id.
payload | The payload to be stored in WardenPayloadMgr::CachedChecks. |
References GetFreePayloadId(), LOG_ERROR, and RegisterPayload().
Referenced by RegisterPayload().
bool WardenPayloadMgr::RegisterPayload | ( | std::string const & | payload, |
uint16 | payloadId, | ||
bool | replace = false |
||
) |
Register a payload into cache with a custom id and returns the result.
payload | The payload to be stored in WardenPayloadMgr::CachedChecks. |
payloadId | The payload id to be stored as the key in WardenPayloadMgr::CachedChecks. |
replace | Whether the key should replace an existing entry value. |
References ASSERT, CachedChecks, WardenCheck::CheckId, WardenCheck::IdStr, LOG_ERROR, WardenCheck::Str, Acore::StringFormat(), WardenCheck::Type, WardenPayloadCheckType, and WardenPayloadOffsetMin.
bool WardenPayloadMgr::UnregisterPayload | ( | uint16 | payloadId | ) |
Unregister a payload from cache and return if successful.
payloadId | The payload to removed from WardenPayloadMgr::CachedChecks. |
References CachedChecks.
std::map<uint16, WardenCheck> WardenPayloadMgr::CachedChecks |
The cached payloads that are accessed by payload id.
Referenced by GetFreePayloadId(), GetPayloadById(), WardenWin::HandleData(), QueuePayload(), RegisterPayload(), WardenWin::RequestChecks(), and UnregisterPayload().
std::list<uint16> WardenPayloadMgr::QueuedPayloads |
The list of currently queued payload ids to be sent through Warden.
Referenced by ClearQueuedPayloads(), DequeuePayload(), GetPayloadCountInQueue(), GetPayloadsInQueue(), QueuePayload(), and WardenWin::RequestChecks().
|
staticconstexpr |
The checktype used for warden payloads.
Referenced by RegisterPayload().
|
staticconstexpr |
The maximum id available for custom payloads.
Referenced by GetFreePayloadId().
|
staticconstexpr |
The minimum id available for custom payloads.
Referenced by GetCheckPacketSize(), GetFreePayloadId(), WardenWin::HandleData(), RegisterPayload(), and WardenWin::RequestChecks().