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

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

#include <trackselectpacket.h>

Inheritance diagram for TrackSelectPacket:
Collaboration diagram for TrackSelectPacket:

Public Member Functions

 TrackSelectPacket ()
 Construct a packet with the position at kTickInfinity and no player.
 TrackSelectPacket (Sch::Tick position, Player *pPlayer, int nTrack, int nPlace)
 Report a player's track selection to the other game systems.
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 the position, a space, the player, track:, the track, place:, and the place to a diagnostic stream.
virtual void saveGuts (OBStream &stream) const
 Write the Packet words, the position, the player's identifier, the track, and the place 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

Sch::Tick mPosition
 The song position of the selection.
IDablePtr< Player > mPlayer
 The player that selected.
int mTrack
 The selected track.
int mPlace
 The place on the track.

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

The member at +0x14 is a Sch::Tick. PrintExtra() hands it to Sch::Tick::Print(), and New() initialises it to kTickInfinity. The transfer through the emission at 0x004acf28 alone could not distinguish it from a CmdID. PrintExtra() writes the player at +0x18 through Player::Print() and labels +0x20 as track and +0x24 as place.

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

Constructor & Destructor Documentation

◆ TrackSelectPacket() [1/2]

TrackSelectPacket::TrackSelectPacket ( )
inline

Construct a packet with the position at kTickInfinity and no player.

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

◆ TrackSelectPacket() [2/2]

TrackSelectPacket::TrackSelectPacket ( Sch::Tick position,
Player * pPlayer,
int nTrack,
int nPlace )
inline

Report a player's track selection to the other game systems.

Inline, with no address of its own. LocalPlayer's track-select handler expands it on its stack at 0x0011e9f8.

Parameters
positionThe song position of the selection.
pPlayerThe selecting player.
nTrackThe selected track.
nPlaceThe player's place on the track.

Member Function Documentation

◆ New()

Message * TrackSelectPacket::New ( )
static

Produce a default-constructed packet on the heap.

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

Returns
The packet.
Ghidra address:
NTSC-U/C: 0x003e52c0
Ghidra address:
PAL: 0x0041d558

◆ Clone()

virtual Message * TrackSelectPacket::Clone ( )
virtual

Produce a heap copy of this packet.

Returns
The copy.
Ghidra address:
NTSC-U/C: 0x003f0848
Ghidra address:
PAL: 0x00428e50

Implements Message.

◆ Type()

virtual int TrackSelectPacket::Type ( )
virtual

Report this packet's registered identity.

Returns
g_nTrackSelectPacketType.
Ghidra address:
NTSC-U/C: 0x003f08c0
Ghidra address:
PAL: 0x00428ec8

Implements Message.

◆ GetName()

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

Report this packet's class name.

Returns
The literal TrackSelectPacket.
Ghidra address:
NTSC-U/C: 0x003f08d0
Ghidra address:
PAL: 0x00428ed8

Implements Message.

◆ PrintExtra()

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

Write the position, a space, the player, track:, the track, place:, and the place to a diagnostic stream.

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

Reimplemented from Message.

◆ saveGuts()

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

Write the Packet words, the position, the player's identifier, the track, and the place to a stream.

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

Reimplemented from Packet.

◆ restoreGuts()

virtual void TrackSelectPacket::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: 0x003e7330
Ghidra address:
PAL: 0x0041f610

Reimplemented from Packet.

Member Data Documentation

◆ mPosition

Sch::Tick TrackSelectPacket::mPosition

The song position of the selection.

NetPlayer's handler at 0x00122f78 reads it. +0x14

◆ mPlayer

IDablePtr<Player> TrackSelectPacket::mPlayer

The player that selected.

NetPlayer's handler at 0x00122f78 resolves it. +0x18

◆ mTrack

int TrackSelectPacket::mTrack

The selected track.

NetPlayer's handler at 0x00122f78 reads it. +0x20

◆ mPlace

int TrackSelectPacket::mPlace

The place on the track.

NetPlayer's handler at 0x00122f78 reads it. +0x24


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