Planeshift
Public Member Functions | Public Attributes | Protected Attributes

ClientMsgHandler Class Reference

#include <clientmsghandler.h>

List of all members.

Public Member Functions

 ClientMsgHandler ()
bool Connect (const char *server, int port)
 This is a conveniance function that basically calls NetBase::Connect.
 DeclareGenericEventHandler (EventHandler, ClientMsgHandler,"planeshift.clientmsghandler")
 Declare our event handler.
bool DispatchQueue ()
 This function Publish all messages currently in the inbound message queue.
int GetNextSequenceNumber (msgtype mtype)
 Get the next sequence number to use for an ordered message.
bool HandleEvent (iEvent &Event)
 This function implementes the iEventHandler interface and is called whenever a subscribed event occurs.
bool Initialize (NetBase *nb, iObjectRegistry *object_reg)
 Initializes the Handler.
void SendMessage (MsgEntry *msg)
 Send outgoing messages, setting the clientnum automatically beforehand.
virtual ~ClientMsgHandler ()

Public Attributes

csRef< EventHandler > scfiEventHandler

Protected Attributes

iObjectRegistry * object_reg
csHash< OrderedMessageChannel * > orderedMessages

Detailed Description

Definition at line 35 of file clientmsghandler.h.


Constructor & Destructor Documentation

ClientMsgHandler::ClientMsgHandler ( )
virtual ClientMsgHandler::~ClientMsgHandler ( ) [virtual]

Member Function Documentation

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 
)

Initializes the Handler.

void ClientMsgHandler::SendMessage ( MsgEntry msg) [inline, virtual]

Send outgoing messages, setting the clientnum automatically beforehand.

Reimplemented from MsgHandler.

Definition at line 53 of file clientmsghandler.h.


Member Data Documentation

iObjectRegistry* ClientMsgHandler::object_reg [protected]

Definition at line 77 of file clientmsghandler.h.

Definition at line 78 of file clientmsghandler.h.

Definition at line 74 of file clientmsghandler.h.


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