Planeshift
psFactionMessage Class Reference

Faction Message to get faction info from the server. More...

#include <messages.h>

Classes

struct  FactionPair
 

Public Types

enum  { MSG_FULL_LIST, MSG_UPDATE }
 The different commands that this message can be. More...
 

Public Member Functions

void AddFaction (csString factionName, int rating)
 Adds a faction to the list to deliver. More...
 
void BuildMsg ()
 Build the messasge to prepare for it to be sent. More...
 
 PSF_DECLARE_MSG_FACTORY ()
 
 psFactionMessage (int cnum, int cmd)
 Construct the faction message. More...
 
 psFactionMessage (MsgEntry *message)
 Parse incoming messages. More...
 
virtual csString ToString (NetBase::AccessPointers *accessPointers)
 Converts 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

int client
 The command type of message. More...
 
int cmd
 
csPDelArray< FactionPairfactionInfo
 Destination client. 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

Faction Message to get faction info from the server.

This is used to either get the full faction information or any updated faction info.

Definition at line 5827 of file messages.h.

Member Enumeration Documentation

anonymous enum

The different commands that this message can be.

Enumerator
MSG_FULL_LIST 
MSG_UPDATE 

Definition at line 5838 of file messages.h.

Constructor & Destructor Documentation

psFactionMessage::psFactionMessage ( int  cnum,
int  cmd 
)

Construct the faction message.

Parameters
cnumThe client destination for the message.
cmdWhat the data inside will be. [ MSG_FULL_LIST | MSG_UPDATE ]
psFactionMessage::psFactionMessage ( MsgEntry message)

Parse incoming messages.

Member Function Documentation

void psFactionMessage::AddFaction ( csString  factionName,
int  rating 
)

Adds a faction to the list to deliver.

Parameters
factionNameThe name of the faction.
ratingThe rating with that faction.
void psFactionMessage::BuildMsg ( )

Build the messasge to prepare for it to be sent.

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

Converts the message into human readable string.

Used when a message is Logged. Every message should implement a version of this function that print all data that was decoded when the message was initiated from a NetEntry. See psDRMessage::ToString for an example.

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

Implements psMessageCracker.

Member Data Documentation

int psFactionMessage::client

The command type of message.

Definition at line 5866 of file messages.h.

int psFactionMessage::cmd

Definition at line 5865 of file messages.h.

csPDelArray<FactionPair> psFactionMessage::factionInfo

Destination client.

Definition at line 5867 of file messages.h.


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