Handles messages to be sent out, connects to server and send those.
More...
#include <clientmsghandler.h>
|
| ClientMsgHandler () |
|
bool | Connect (const char *server, int port) |
| This is a conveniance function that basically calls NetBase::Connect. More...
|
|
| DeclareGenericEventHandler (EventHandler, ClientMsgHandler,"planeshift.clientmsghandler") |
| Declare our event handler. More...
|
|
bool | DispatchQueue () |
| This function Publish all messages currently in the inbound message queue. More...
|
|
int | GetNextSequenceNumber (msgtype mtype) |
| Get the next sequence number to use for an ordered message. More...
|
|
bool | HandleEvent (iEvent &Event) |
| This function implementes the iEventHandler interface and is called whenever a subscribed event occurs. More...
|
|
bool | Initialize (NetBase *nb, iObjectRegistry *object_reg) |
| Initializes the Handler. More...
|
|
void | SendMessage (MsgEntry *msg) |
| Send outgoing messages, setting the clientnum automatically beforehand. More...
|
|
virtual | ~ClientMsgHandler () |
|
Public Member Functions inherited from MsgHandler |
void | AddToLocalQueue (MsgEntry *me) |
|
virtual void | Broadcast (MsgEntry *msg, broadcasttype scope=NetBase::BC_EVERYONEBUTSELF, int guildID=-1) |
| Send messages to many clients with one func call. More...
|
|
bool | Flush () |
| Flush the connected output queue. More...
|
|
csTicks | GetPing () |
|
bool | Initialize (NetBase *nb, int queuelen=500) |
| Initializes the Handler. More...
|
|
| MsgHandler () |
|
virtual void | Multicast (MsgEntry *msg, csArray< PublishDestination > &multi, uint32_t except, float range) |
| Sends the given message me to all the clients in the list. More...
|
|
void | Publish (MsgEntry *msg) |
| Distribute message to all subscribers. More...
|
|
virtual void | Subscribe (iNetSubscriber *subscriber, msgtype type, uint32_t flags=0x01) |
| Subscribes an iNetSubscriber to a specific message type. More...
|
|
virtual bool | Unsubscribe (iNetSubscriber *subscriber, msgtype type) |
| Unsubscribes a subscriber from a specific message type. More...
|
|
virtual bool | UnsubscribeAll (iNetSubscriber *subscriber) |
| Searches all message types and deletes any Subscription that has the specified subscriber. More...
|
|
virtual | ~MsgHandler () |
|
Handles messages to be sent out, connects to server and send those.
Definition at line 38 of file clientmsghandler.h.
ClientMsgHandler::ClientMsgHandler |
( |
| ) |
|
virtual ClientMsgHandler::~ClientMsgHandler |
( |
| ) |
|
|
virtual |
bool ClientMsgHandler::Connect |
( |
const char * |
server, |
|
|
int |
port |
|
) |
| |
This is a conveniance function that basically calls NetBase::Connect.
ClientMsgHandler::DeclareGenericEventHandler |
( |
EventHandler |
, |
|
|
ClientMsgHandler |
, |
|
|
"planeshift.clientmsghandler" |
|
|
) |
| |
Declare our event handler.
bool ClientMsgHandler::DispatchQueue |
( |
| ) |
|
This function Publish all messages currently in the inbound message queue.
int ClientMsgHandler::GetNextSequenceNumber |
( |
msgtype |
mtype | ) |
|
Get the next sequence number to use for an ordered message.
bool ClientMsgHandler::HandleEvent |
( |
iEvent & |
Event | ) |
|
This function implementes the iEventHandler interface and is called whenever a subscribed event occurs.
We use this to trap idle events and process the incoming queue during those times instead of running a separate thread.
bool ClientMsgHandler::Initialize |
( |
NetBase * |
nb, |
|
|
iObjectRegistry * |
object_reg |
|
) |
| |
void ClientMsgHandler::SendMessage |
( |
MsgEntry * |
msg | ) |
|
|
inlinevirtual |
Send outgoing messages, setting the clientnum automatically beforehand.
Reimplemented from MsgHandler.
Definition at line 56 of file clientmsghandler.h.
iObjectRegistry* ClientMsgHandler::object_reg |
|
protected |
csRef<EventHandler> ClientMsgHandler::scfiEventHandler |
The documentation for this class was generated from the following file: