resonance 1.0.1
Loading...
Searching...
No Matches
GameChatPacket Class Reference

Network packet the game sends between game systems. More...

#include <gamechatpacket.h>

Inheritance diagram for GameChatPacket:
Collaboration diagram for GameChatPacket:

Public Member Functions

 GameChatPacket ()
 Construct a packet with two empty strings.
 GameChatPacket (const HxStr &sender, const HxStr &text)
 Construct a packet carrying two strings.
virtual Message * Clone ()
 Produce a heap copy of this packet.
virtual int Type ()
 Report this packet's registered identity.
virtual const char * GetName () const
 Report this packet's class name.
virtual void PrintExtra (std::ostream &stream) const
 Write both strings to a diagnostic stream, with nothing between them.
virtual void saveGuts (OBStream &stream) const
 Write the Packet words and then both strings to a stream.
virtual void restoreGuts (IBStream &stream)
 Read the Packet words and then both strings back from a stream.
HxStr GetSender ()
 Report the first string.
HxStr GetText ()
 Report the second string.
Public Member Functions inherited from ToAllOtherNetManagersPacket
 ToAllOtherNetManagersPacket ()
 Route the packet with the pair 2 and 0.
Public Member Functions inherited from Message
void * operator new (size_t nSize)
 Allocate a message from the tagged heap under the tag MSG.
void operator delete (void *pBlock)
 Release a message to the tagged heap under the tag MSG.
virtual ~Message ()
 Vtable slot 1.
std::ostream & Print (std::ostream &stream) const
 Write this message to a diagnostic stream as {GetName() PrintExtra()}.

Static Public Member Functions

static Message * New ()
 Produce a packet with two empty strings on the heap.
Static Public Member Functions inherited from Message
static Message * NewMessage (int nType)
 Produce a message of the identified class through the factory list.

Additional Inherited Members

Protected Member Functions inherited from Packet
 Packet (int nDestination, int nDestinationSystem)
 Set the two routing words and mark the remaining two as unset.
Protected Attributes inherited from Packet
int mDestination
int mDestinationSystem
int mClientId
 The client the packet concerns, or -1 until set.
int mTargetClientId
 A second client identifier, -1 until set.

Detailed Description

Network packet the game sends between game systems.

Its RTTI descriptor is at 0x008efd70. It has ToAllOtherNetManagersPacket as its one base. The object is 0x24 bytes and its vtable is at 0x00814338. The payload comes from the copy constructor at 0x003f3d88. Clone() delegates to it, and the payload accounts for the allocation exactly. The four words Packet provides are declared there rather than here.

Each string crosses the wire as a four-byte length followed by that many bytes of text with no terminator. saveGuts() and restoreGuts() have second emissions at 0x003e8720 and 0x003e8890.

The destructor at 0x003f1898 is compiler-generated and has no declaration here.

Constructor & Destructor Documentation

◆ GameChatPacket() [1/2]

GameChatPacket::GameChatPacket ( )
inline

Construct a packet with two empty strings.

Inline, with no address of its own. New() expands it.

◆ GameChatPacket() [2/2]

GameChatPacket::GameChatPacket ( const HxStr & sender,
const HxStr & text )

Construct a packet carrying two strings.

The image lists no caller. The title is inferred.

Parameters
senderThe string for mSender.
textThe string for mText.
Ghidra address:
NTSC-U/C: 0x003f1a28
Ghidra address:
PAL: 0x00429f20

Member Function Documentation

◆ New()

Message * GameChatPacket::New ( )
static

Produce a packet with two empty strings on the heap.

The registry the translation unit at 0x003ed2e0 builds stores this address against g_nGameChatPacketType.

Returns
The packet.
Ghidra address:
NTSC-U/C: 0x003e5478
Ghidra address:
PAL: 0x0041d710

◆ Clone()

virtual Message * GameChatPacket::Clone ( )
virtual

Produce a heap copy of this packet.

Returns
The copy.
Ghidra address:
NTSC-U/C: 0x003f1950
Ghidra address:
PAL: 0x00429e40

Implements Message.

◆ Type()

virtual int GameChatPacket::Type ( )
virtual

Report this packet's registered identity.

Returns
g_nGameChatPacketType.
Ghidra address:
NTSC-U/C: 0x003f19c8
Ghidra address:
PAL: 0x00429eb8

Implements Message.

◆ GetName()

virtual const char * GameChatPacket::GetName ( ) const
virtual

Report this packet's class name.

Returns
The literal GameChatPacket.
Ghidra address:
NTSC-U/C: 0x003f19d8
Ghidra address:
PAL: 0x00429ec8

Implements Message.

◆ PrintExtra()

virtual void GameChatPacket::PrintExtra ( std::ostream & stream) const
virtual

Write both strings to a diagnostic stream, with nothing between them.

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

Reimplemented from Message.

◆ saveGuts()

virtual void GameChatPacket::saveGuts ( OBStream & stream) const
virtual

Write the Packet words and then both strings to a stream.

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

Reimplemented from Packet.

◆ restoreGuts()

virtual void GameChatPacket::restoreGuts ( IBStream & stream)
virtual

Read the Packet words and then both strings back from a stream.

Each string is resized through HxStr::Alloc() to the length read and then filled in place.

Parameters
streamThe stream to read from.
Ghidra address:
NTSC-U/C: 0x003e85c8
Ghidra address:
PAL: 0x004208a8

Reimplemented from Packet.

◆ GetSender()

HxStr GameChatPacket::GetSender ( )

Report the first string.

The image lists no caller. The title is inferred.

Returns
A copy of mSender.
Ghidra address:
NTSC-U/C: 0x003f1ae0
Ghidra address:
PAL: 0x00429fe8

◆ GetText()

HxStr GameChatPacket::GetText ( )

Report the second string.

The image lists no caller. The title is inferred.

Returns
A copy of mText.
Ghidra address:
NTSC-U/C: 0x003f1b10
Ghidra address:
PAL: 0x0042a018

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