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

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

#include <phrasepacket.h>

Inheritance diagram for PhrasePacket:
Collaboration diagram for PhrasePacket:

Public Member Functions

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 tr:, the track, b:, the bar, a space, and then the phrase, or [empty] without one, to a diagnostic stream.
virtual void saveGuts (OBStream &stream) const
 Write the Packet words, the track, the bar, the phrase, and the Packet word at +0x0c again to a stream.
virtual void restoreGuts (IBStream &stream)
 Read the fields back in the order saveGuts() wrote them.
Public Member Functions inherited from ToAllOtherGameSystemsPacket
 ToAllOtherGameSystemsPacket ()
 Route the packet with the pair 2 and 3.
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 default-constructed packet 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.

Public Attributes

unsigned int mTr
 The track, labelled tr by PrintExtra().
Phrase * mPhrase
 The phrase, or null to clear the step.
int mB
 The phrase step, labelled b by PrintExtra().

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 0x00902130. It has ToAllOtherGameSystemsPacket as its one base. The object is 0x20 bytes and its vtable is at 0x00814650. The payload comes from the copy constructor at 0x003f3760. Clone() delegates to it. The four words Packet provides are declared there rather than here.

PrintExtra() labels +0x14 as tr and +0x1c as b, and writes the first through the unsigned integer inserter. The phrase at +0x18 crosses the wire through the Phrase stream operators, which allocate a fresh phrase on the reading side, and the packet never releases it.

saveGuts() writes the Packet word at +0x0c a second time after the payload, and restoreGuts() reads it a second time to match.

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

Member Function Documentation

◆ New()

Message * PhrasePacket::New ( )
static

Produce a default-constructed packet on the heap.

The registry the translation unit at 0x003ed2e0 builds stores this address against g_nPhrasePacketType. The payload, the phrase pointer included, is left unset.

Returns
The packet.
Ghidra address:
NTSC-U/C: 0x003e51a8
Ghidra address:
PAL: 0x0041d440

◆ Clone()

virtual Message * PhrasePacket::Clone ( )
virtual

Produce a heap copy of this packet.

Returns
The copy.
Ghidra address:
NTSC-U/C: 0x003f0320
Ghidra address:
PAL: 0x00428928

Implements Message.

◆ Type()

virtual int PhrasePacket::Type ( )
virtual

Report this packet's registered identity.

Returns
g_nPhrasePacketType.
Ghidra address:
NTSC-U/C: 0x003f0398
Ghidra address:
PAL: 0x004289a0

Implements Message.

◆ GetName()

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

Report this packet's class name.

Returns
The literal PhrasePacket.
Ghidra address:
NTSC-U/C: 0x003f03a8
Ghidra address:
PAL: 0x004289b0

Implements Message.

◆ PrintExtra()

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

Write tr:, the track, b:, the bar, a space, and then the phrase, or [empty] without one, to a diagnostic stream.

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

Reimplemented from Message.

◆ saveGuts()

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

Write the Packet words, the track, the bar, the phrase, and the Packet word at +0x0c again to a stream.

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

Reimplemented from Packet.

◆ restoreGuts()

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

Read the fields back in the order saveGuts() wrote them.

The phrase is replaced with a freshly allocated one without releasing the previous pointer.

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

Reimplemented from Packet.

Member Data Documentation

◆ mTr

unsigned int PhrasePacket::mTr

The track, labelled tr by PrintExtra().

+0x14

PhraseMgr::OnPhrasePacket() at 0x001c0010 compares it with the track the manager serves.

◆ mPhrase

Phrase* PhrasePacket::mPhrase

The phrase, or null to clear the step.

+0x18

PhraseMgr::OnPhrasePacket() installs it.

◆ mB

int PhrasePacket::mB

The phrase step, labelled b by PrintExtra().

+0x1c

PhraseMgr::OnPhrasePacket() installs the phrase at it.


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