Planeshift
|
This class handles all queueing and invoking of timed events, such as combat, spells, NPC dialog responses, range weapons, or NPC respawning. More...
#include <eventmanager.h>
Public Member Functions | |
EventManager () | |
csTicks | ProcessEventQueue () |
Check Event Queue for scheduled events which are due. | |
void | Push (psGameEvent *event) |
Add new event to scheduler queue. | |
virtual void | Run () |
virtual void | SendMessageDelayed (MsgEntry *msg, csTicks msecDelay) |
Allows sending of a message not immediately, but after a short delay. | |
void | Stop () |
virtual | ~EventManager () |
Protected Member Functions | |
void | TrackEventTimes (csTicks timeTaken, MsgEntry *msg) |
Helper function to keep a running average of the last 50 events. | |
Protected Attributes | |
Heap< psGameEvent > | eventqueue |
csTicks | lastTick |
CS::Threading::Mutex | mutex |
Protects subscribers. | |
bool | stop |
A flag indicating the server is shutting down. |
This class handles all queueing and invoking of timed events, such as combat, spells, NPC dialog responses, range weapons, or NPC respawning.
It maintains a queue ordered by trigger time and is polled by the engine periodically to clear any queued events with trigger times less than the current ticks time.
Definition at line 40 of file eventmanager.h.
EventManager::EventManager | ( | ) |
virtual EventManager::~EventManager | ( | ) | [virtual] |
csTicks EventManager::ProcessEventQueue | ( | ) |
Check Event Queue for scheduled events which are due.
void EventManager::Push | ( | psGameEvent * | event | ) |
Add new event to scheduler queue.
virtual void EventManager::Run | ( | ) | [virtual] |
virtual void EventManager::SendMessageDelayed | ( | MsgEntry * | msg, |
csTicks | msecDelay | ||
) | [virtual] |
Allows sending of a message not immediately, but after a short delay.
void EventManager::Stop | ( | ) | [inline] |
Definition at line 62 of file eventmanager.h.
void EventManager::TrackEventTimes | ( | csTicks | timeTaken, |
MsgEntry * | msg | ||
) | [protected] |
Helper function to keep a running average of the last 50 events.
Heap<psGameEvent> EventManager::eventqueue [protected] |
Definition at line 44 of file eventmanager.h.
csTicks EventManager::lastTick [protected] |
Definition at line 46 of file eventmanager.h.
CS::Threading::Mutex EventManager::mutex [protected] |
bool EventManager::stop [protected] |
A flag indicating the server is shutting down.
Definition at line 49 of file eventmanager.h.