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

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

#include <caughtphrasepacket.h>

Inheritance diagram for CaughtPhrasePacket:
Collaboration diagram for CaughtPhrasePacket:

Public Member Functions

 CaughtPhrasePacket ()
 Construct a packet with only the player reference and the Packet words set.
 CaughtPhrasePacket (Player *pPlayer, unsigned int nTr, int nB)
 Report a phrase caught by a player.
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, and a space to a diagnostic stream.
virtual void saveGuts (OBStream &stream) const
 Write the Packet words, the player's identifier, the track, the bar, and the Packet word at +0x0c again to a stream.
virtual void restoreGuts (IBStream &stream)
 Read the fields back in place 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

IDablePtr< Player > mPlayer
 The player the phrase goes to.
unsigned int mTr
 The track, labelled tr by PrintExtra().
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 0x009021b0. It has ToAllOtherGameSystemsPacket as its one base. The object is 0x24 bytes and its vtable is at 0x00814608. The payload comes from the copy constructor at 0x003f37b8. Clone() delegates to it. The four words Packet provides are declared there rather than here.

PrintExtra() labels +0x1c as tr and +0x20 as b, and writes the first through the unsigned integer inserter. The player reference at +0x14 is transferred but not printed.

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

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

Constructor & Destructor Documentation

◆ CaughtPhrasePacket() [1/2]

CaughtPhrasePacket::CaughtPhrasePacket ( )
inline

Construct a packet with only the player reference and the Packet words set.

Inline. New() expands it. A declaration is required because the class declares a second constructor.

◆ CaughtPhrasePacket() [2/2]

CaughtPhrasePacket::CaughtPhrasePacket ( Player * pPlayer,
unsigned int nTr,
int nB )
inline

Report a phrase caught by a player.

Inline, with no address of its own. PhraseMgr::SetPhraseOwner() at 0x001bafa8 expands it on its stack with the manager's word at +0x30 as the track and the mapped bar.

Parameters
pPlayerThe player who caught the phrase, or null.
nTrThe track.
nBThe bar.

Member Function Documentation

◆ New()

Message * CaughtPhrasePacket::New ( )
static

Produce a default-constructed packet on the heap.

The registry the translation unit at 0x003ed2e0 builds stores this address against g_nCaughtPhrasePacketType. Only the player reference is initialised beyond the Packet words.

Returns
The packet.
Ghidra address:
NTSC-U/C: 0x003e5200
Ghidra address:
PAL: 0x0041d498

◆ Clone()

virtual Message * CaughtPhrasePacket::Clone ( )
virtual

Produce a heap copy of this packet.

Returns
The copy.
Ghidra address:
NTSC-U/C: 0x003f04b8
Ghidra address:
PAL: 0x00428ac0

Implements Message.

◆ Type()

virtual int CaughtPhrasePacket::Type ( )
virtual

Report this packet's registered identity.

Returns
g_nCaughtPhrasePacketType.
Ghidra address:
NTSC-U/C: 0x003f0530
Ghidra address:
PAL: 0x00428b38

Implements Message.

◆ GetName()

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

Report this packet's class name.

Returns
The literal CaughtPhrasePacket.
Ghidra address:
NTSC-U/C: 0x003f0540
Ghidra address:
PAL: 0x00428b48

Implements Message.

◆ PrintExtra()

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

Write tr:, the track, b:, the bar, and a space to a diagnostic stream.

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

Reimplemented from Message.

◆ saveGuts()

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

Write the Packet words, the player's identifier, the track, the bar, and the Packet word at +0x0c again to a stream.

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

Reimplemented from Packet.

◆ restoreGuts()

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

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

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

Reimplemented from Packet.

Member Data Documentation

◆ mPlayer

IDablePtr<Player> CaughtPhrasePacket::mPlayer

The player the phrase goes to.

+0x14

PhraseMgr::OnCaughtPhrasePacket() at 0x001ba540 resolves it directly.

◆ mTr

unsigned int CaughtPhrasePacket::mTr

The track, labelled tr by PrintExtra().

+0x1c

PhraseMgr::OnCaughtPhrasePacket() compares it with the track the manager serves.

◆ mB

int CaughtPhrasePacket::mB

The phrase step, labelled b by PrintExtra().

+0x20

PhraseMgr::OnCaughtPhrasePacket() starts its walk of the chained steps there.


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