Planeshift
psChatMessage Class Reference

Message sent with chat info. More...

#include <messages.h>

Public Member Functions

const char * GetTypeText ()
 Translate type code into words. More...
 
 psChatMessage (uint32_t cnum, EID actorid, const char *person, const char *other, const char *chatMessage, uint8_t type, bool translate, uint16_t channelID=0)
 This function creates a PS Message struct given a chat text to send out. More...
 
 psChatMessage (MsgEntry *message)
 This constructor receives a PS Message struct and cracks it apart to provide more easily usable fields. More...
 
 PSF_DECLARE_MSG_FACTORY ()
 
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

EID actor
 Keeps the eid of the originator client for chat bubbles. More...
 
uint16_t channelID
 
uint8_t iChatType
 type of message this is More...
 
csString sOther
 Name of the other person involved in this chat message (used only with some chat types) More...
 
csString sPerson
 name of person this chat message comes from More...
 
csString sText
 the text the message contains More...
 
bool translate
 is the text supposed to be translated by psLocalization on target 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

Message sent with chat info.

Definition at line 808 of file messages.h.

Constructor & Destructor Documentation

psChatMessage::psChatMessage ( uint32_t  cnum,
EID  actorid,
const char *  person,
const char *  other,
const char *  chatMessage,
uint8_t  type,
bool  translate,
uint16_t  channelID = 0 
)

This function creates a PS Message struct given a chat text to send out.

This would be used for outgoing, new message creation

psChatMessage::psChatMessage ( MsgEntry message)

This constructor receives a PS Message struct and cracks it apart to provide more easily usable fields.

It is intended for use on incoming messages.

Member Function Documentation

const char* psChatMessage::GetTypeText ( )

Translate type code into words.

Could be multilingual in future.

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

Converts 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

EID psChatMessage::actor

Keeps the eid of the originator client for chat bubbles.

Definition at line 833 of file messages.h.

uint16_t psChatMessage::channelID

Definition at line 835 of file messages.h.

uint8_t psChatMessage::iChatType

type of message this is

Definition at line 812 of file messages.h.

csString psChatMessage::sOther

Name of the other person involved in this chat message (used only with some chat types)

This string is included in the net message only when needed and currently only the CHAT_ADVISOR message type uses it. Modify both constructors if you want to use it with other chat message types.

Definition at line 824 of file messages.h.

csString psChatMessage::sPerson

name of person this chat message comes from

Definition at line 815 of file messages.h.

csString psChatMessage::sText

the text the message contains

Definition at line 827 of file messages.h.

bool psChatMessage::translate

is the text supposed to be translated by psLocalization on target client ?

Definition at line 830 of file messages.h.


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