wavelength 1.0.0
Loading...
Searching...
No Matches
ChatMsg Class Reference

Message with one line of chat between the consoles of an online session or lobby. More...

#include <chatmsg.h>

Inheritance diagram for ChatMsg:
Collaboration diagram for ChatMsg:

Public Member Functions

 ChatMsg (int nAccountId, int nPlayer, const char *pszText, const char *pszSender)
 Construct a line.
void * operator new (size_t nSize)
 Allocate a message, billed to the class name.
void operator delete (void *pBlock)
 Release a message.
Message * Clone () override
 Produce a heap copy of this message.
int Type () override
 Report this message's registered identity.
const char * GetName () const override
 Report this message's class name.
void PrintExtra (PrnStream &stream) const override
 Write the channel and the text.
int GetAccountId () const
int GetPlayer () const
const char * GetSender () const
const char * GetText () const
Public Member Functions inherited from Message
virtual ~Message ()
 Vtable slot 1.
virtual void saveGuts (BinStream &stream) const
 Write this message's payload to a stream.
virtual void restoreGuts (BinStream &stream)
 Read this message's payload from a stream.
virtual ~Message ()
virtual void Unused1 ()
 Not called by the control.

Static Public Member Functions

static void AddHandler (int nChannel, MsgSink *pHandler)
 Register the sink that receives the chat of a channel.
static void RemoveSink (int nChannel)
 Forget the sink of a channel.
static bool Send (int nChannel, int nRecipient, const char *pszText, int nEcho)
 Send a line of chat.
static void SendPrivate (int nChannel, int nAccountId, const char *pszText)
 Send a line of chat to one account only.
static void ClearPartialMessages ()
 Discard the lines whose remaining parts have not arrived.
static void OnLobbyChat (int nConnection, int nType, int nSize, const rtMediusChatMessage *pMessage)
 Deliver a line of chat from the lobby server to the sink of its channel.
Static Public Member Functions inherited from Message
static Message * NewMessage (int nType)
 Produce a message of the identified class through the factory list.

Detailed Description

Message with one line of chat between the consoles of an online session or lobby.

The RTTI records the class as deriving from Message, and its vtable is at 0x003d58c8. The class also keeps the sink of each channel, and joins the lines that arrive from the lobby server in parts.

Constructor & Destructor Documentation

◆ ChatMsg()

ChatMsg::ChatMsg ( int nAccountId,
int nPlayer,
const char * pszText,
const char * pszSender )
inline

Construct a line.

Inline.

Parameters
nAccountIdThe sender's account identifier.
nPlayerThe sender's identifier in the session, or -2 for none.
pszTextThe text.
pszSenderThe sender's name.

Member Function Documentation

◆ operator new()

void * ChatMsg::operator new ( size_t nSize)
inline

Allocate a message, billed to the class name.

Parameters
nSizeThe object size the compiler supplies.
Returns
The block.

◆ operator delete()

void ChatMsg::operator delete ( void * pBlock)
inline

Release a message.

Parameters
pBlockThe block.

◆ Clone()

Message * ChatMsg::Clone ( )
inlineoverridevirtual

Produce a heap copy of this message.

Returns
The copy.

Implements Message.

◆ Type()

int ChatMsg::Type ( )
inlineoverridevirtual

Report this message's registered identity.

Returns
g_nChatMsgType.

Implements Message.

◆ GetName()

const char * ChatMsg::GetName ( ) const
inlineoverridevirtual

Report this message's class name.

Returns
The literal ChatMsg.

Implements Message.

◆ AddHandler()

void ChatMsg::AddHandler ( int nChannel,
MsgSink * pHandler )
static

Register the sink that receives the chat of a channel.

The type information of the registry identifies the pointer type as ChatHandler. A panel passes itself, and the sink receives each line through Dispatch().

Parameters
nChannelThe channel.
pHandlerThe sink.
Ghidra address:
NTSC-U/C: 0x00252220
Ghidra address:
PAL: 0x0025abc8

◆ RemoveSink()

void ChatMsg::RemoveSink ( int nChannel)
static

Forget the sink of a channel.

The name is inferred.

Parameters
nChannelThe channel.
Ghidra address:
NTSC-U/C: 0x00252408
Ghidra address:
PAL: 0x0025adb0

◆ Send()

bool ChatMsg::Send ( int nChannel,
int nRecipient,
const char * pszText,
int nEcho )
static

Send a line of chat.

The names of the parameters are inferred.

Parameters
nChannelThe channel, 2 for the notices of the session.
nRecipientThe recipient, 0 for every console.
pszTextThe text.
nEchoNon-zero to show the line on this console too.
Returns
Whether the line was sent.
Ghidra address:
NTSC-U/C: 0x00252658
Ghidra address:
PAL: 0x0025b000

◆ SendPrivate()

void ChatMsg::SendPrivate ( int nChannel,
int nAccountId,
const char * pszText )
static

Send a line of chat to one account only.

The online session exchanges its key through the line. The name is inferred.

Parameters
nChannelThe channel.
nAccountIdThe account that receives the line.
pszTextThe text.
Ghidra address:
NTSC-U/C: 0x00252580
Ghidra address:
PAL: 0x0025af28

◆ ClearPartialMessages()

void ChatMsg::ClearPartialMessages ( )
static

Discard the lines whose remaining parts have not arrived.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x00252d58
Ghidra address:
PAL: 0x0025b700

◆ OnLobbyChat()

void ChatMsg::OnLobbyChat ( int nConnection,
int nType,
int nSize,
const rtMediusChatMessage * pMessage )
static

Deliver a line of chat from the lobby server to the sink of its channel.

The lobby client calls the member. The name is inferred.

Parameters
nConnectionThe connection.
nTypeThe kind of response.
nSizeThe size of the line.
pMessageThe line.
Ghidra address:
NTSC-U/C: 0x00252dd0
Ghidra address:
PAL: 0x0025b778

◆ PrintExtra()

void ChatMsg::PrintExtra ( PrnStream & stream) const
overridevirtual

Write the channel and the text.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x002691b8
Ghidra address:
PAL: 0x00272dc0

Reimplemented from Message.

◆ GetAccountId()

int ChatMsg::GetAccountId ( ) const
inline
Returns
The sender's account identifier.

◆ GetPlayer()

int ChatMsg::GetPlayer ( ) const
inline
Returns
The sender's identifier in the session, or -2 for none.

◆ GetSender()

const char * ChatMsg::GetSender ( ) const
inline
Returns
The sender's name.

◆ GetText()

const char * ChatMsg::GetText ( ) const
inline
Returns
The text.

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