Planeshift
|
Provides a manager to facilitate subscriptions. More...
#include <msgmanager.h>
Public Types | |
typedef void(SubClass::* | FunctionPointer) (MsgEntry *, Client *) |
Public Member Functions | |
void | HandleMessage (MsgEntry *msg, Client *client) |
Transfers the message to the manager specific function. More... | |
void | Subscribe (FunctionPointer fpt, msgtype type, uint32_t flags=0x01) |
Subscribes this manager to a specific message type with a custom callback. More... | |
bool | Unsubscribe (msgtype type) |
Unsubscribes this manager from a specific message type. More... | |
bool | Unsubscribe (FunctionPointer handler, msgtype type) |
Unsubscribes a specific handler from a specific message type. More... | |
bool | UnsubscribeAll () |
Unsubscribes this manager from all message types. More... | |
virtual | ~MessageManager () |
Unsubscribes all messages then destroys this object. More... | |
![]() | |
csArray< csString > | DecodeCommandArea (Client *client, csString target) |
Decodes an area: expression. More... | |
gemObject * | FindObjectByString (const csString &str, gemActor *me) const |
Find the object we are referring to in str. More... | |
Client * | FindPlayerClient (const char *name) |
Finds Client* of character with given name. More... | |
virtual bool | Verify (MsgEntry *pMsg, unsigned int flags, Client *&client) |
Provides a manager to facilitate subscriptions.
Any server-side class that needs to be informed of incoming messages should derive from this class. To use, simply inherit from this class with the template name being your class name.
Definition at line 106 of file msgmanager.h.
typedef void(SubClass::* MessageManager< SubClass >::FunctionPointer) (MsgEntry *, Client *) |
Definition at line 109 of file msgmanager.h.
|
inlinevirtual |
Unsubscribes all messages then destroys this object.
Definition at line 112 of file msgmanager.h.
|
inlinevirtual |
Transfers the message to the manager specific function.
msg | Message that is forwarded to the manager's function |
client | Client that is forwarded to the manager's function |
Implements iNetSubscriber.
Definition at line 202 of file msgmanager.h.
|
inline |
Subscribes this manager to a specific message type with a custom callback.
Any time a message with the specified type (and flags are met) is received the specified function is called
fpt | The function to call |
type | The type of message to be notified of |
flags | to check Default: 0x01 |
Definition at line 126 of file msgmanager.h.
|
inline |
Unsubscribes this manager from a specific message type.
type | The type of message to unsubscribe from |
Definition at line 142 of file msgmanager.h.
|
inline |
Unsubscribes a specific handler from a specific message type.
handler | The handler to unsubscribe |
type | The type of message to unsubscribe from |
Definition at line 160 of file msgmanager.h.
|
inline |
Unsubscribes this manager from all message types.
Definition at line 186 of file msgmanager.h.