Planeshift
psCreationChoiceMsg Class Reference

A general message class for sending a character creation choice. More...

#include <charmessages.h>

Public Member Functions

void AddChoice (int id, const char *name, const char *description, int area, int cost)
 Add a new choice the the message payload. More...
 
void ConstructMessage ()
 Resize the message to the right size. More...
 
 psCreationChoiceMsg (int listener)
 Create a new message destined for server. More...
 
 psCreationChoiceMsg (MsgEntry *me)
 Crack open the message and get any data in the message. More...
 
 psCreationChoiceMsg (int clientTo, int totalChoices, int listener)
 Create a new message that will be list of choices. More...
 
 PSF_DECLARE_MSG_FACTORY ()
 
virtual csString ToString (NetBase::AccessPointers *accessPointers)
 Convert the message into human readable string. More...
 
- Public Member Functions inherited from psMessageCracker
void FireEvent ()
 Publishes the message to the local program. More...
 
virtual csString GetMessageTypeName () const =0
 Gets the name of the message type. More...
 
void Multicast (csArray< PublishDestination > &multi, uint32_t except, float range)
 Multicasts the message to all current connections. More...
 
 psMessageCracker ()
 
void SendMessage ()
 Sends the message to the client/server. More...
 
virtual ~psMessageCracker ()
 

Public Attributes

csArray< CreationChoicechoices
 Holds a list of all the choices in this message. More...
 
- Public Attributes inherited from psMessageCracker
int filterNumber
 
csRef< MsgEntrymsg
 
bool valid
 

Additional Inherited Members

- Static Public Attributes inherited from psMessageCracker
static MsgHandlermsghandler
 

Detailed Description

A general message class for sending a character creation choice.

Since all the choices fit this profile we have a shared message type to send a choice. They are seperated by using different listener's so subscribers can listen for different types of choice requests.

This can be a single choice or a list of choices.

Definition at line 241 of file charmessages.h.

Constructor & Destructor Documentation

psCreationChoiceMsg::psCreationChoiceMsg ( int  listener)

Create a new message destined for server.

Parameters
listenerthe subscribers that should get this message.
psCreationChoiceMsg::psCreationChoiceMsg ( MsgEntry me)

Crack open the message and get any data in the message.

psCreationChoiceMsg::psCreationChoiceMsg ( int  clientTo,
int  totalChoices,
int  listener 
)

Create a new message that will be list of choices.

This should only really be done by the server.

Parameters
clientTothe destination of this message.
totalChoicesThe total number of choices that this message will carry.
listenerThe subscribers that should get this message.

Member Function Documentation

void psCreationChoiceMsg::AddChoice ( int  id,
const char *  name,
const char *  description,
int  area,
int  cost 
)

Add a new choice the the message payload.

Parameters
idThe unique ID for this choice ( the database id in this case )
nameThe name of this choice.
descriptionThe description of this creation choice.
areaThe Creation area for this choice. Should be one of the CreationAreas enums.
costThe CP cost of the choice.
void psCreationChoiceMsg::ConstructMessage ( )

Resize the message to the right size.

psCreationChoiceMsg::PSF_DECLARE_MSG_FACTORY ( )
virtual csString psCreationChoiceMsg::ToString ( NetBase::AccessPointers accessPointers)
virtual

Convert the message into human readable string.

Parameters
accessPointersA struct to a number of access pointers.
Returns
Return a human readable string for the message.

Implements psMessageCracker.

Member Data Documentation

csArray<CreationChoice> psCreationChoiceMsg::choices

Holds a list of all the choices in this message.

Definition at line 288 of file charmessages.h.


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