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

Packet that reports a local player's track, score, and catching state to the other consoles. More...

#include <playerupdatepacket.h>

Inheritance diagram for PlayerUpdatePacket:
Collaboration diagram for PlayerUpdatePacket:

Public Member Functions

 ~PlayerUpdatePacket () override=default
 Destroy the object.
 PlayerUpdatePacket ()
 Construct a packet with no track and no score.
 PlayerUpdatePacket (int nTrack, int nPoints, bool bCatching, int nVersion)
 Construct a packet with every field set.
void * operator new (size_t nSize)
 Allocate a packet, billed to the class name.
void operator delete (void *pBlock)
 Release a packet.
Message * Clone () override
 Produce a heap copy of this packet.
int Type () override
 Report this packet's registered identity.
const char * GetName () const override
 Report this packet's class name.
void PrintExtra (PrnStream &stream) const override
 Print the track, the score, the catching state, and the version.
void saveGuts (BinStream &stream) const override
 Write the fields packed into one word.
void restoreGuts (BinStream &stream) override
 Read the word saveGuts() writes back into the fields.
int GetCatching () const
int GetPoints () const
int GetTrack () const
int GetVersion () const
Public Member Functions inherited from ExternalPacket
 ExternalPacket (unsigned char nFlags=0, int nReceiver=kAllPeers)
 Construct a packet from an unset sender.
int Route () override
 Report that a received packet goes to the sink of TheNetTransport.
Public Member Functions inherited from Packet
unsigned char GetFlags () const
int GetReceiver () const
int GetSender () const
void SetSender (int nSender)
Public Member Functions inherited from Message
virtual ~Message ()
 Vtable slot 1.
virtual ~Message ()
virtual void Unused1 ()
 Not called by the control.

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.

Additional Inherited Members

Public Types inherited from Packet
enum  RouteFlag { kRouteTransport = 1 , kRouteLaunchpad = 2 }
 Bits of Route(). More...
Static Public Attributes inherited from Packet
static constexpr int kUnset = -2
 Value of mSender and mReceiver that marks the member as unset.
static constexpr int kAllPeers = -1
 Value of mReceiver that addresses every peer.
static constexpr unsigned char kFlagOrdered = 1
 Bit of mFlags that LaunchpadRT::Send() turns into the second delivery bit of the session library.
static constexpr unsigned char kFlagGuaranteed = 2
 Bit of mFlags that NetTransport::Send() turns into its guaranteed delivery bit.
Protected Member Functions inherited from Packet
 Packet (unsigned char nFlags, int nReceiver)
 Construct a packet from an unset sender.

Detailed Description

Packet that reports a local player's track, score, and catching state to the other consoles.

The RTTI records the class as deriving from ExternalPacket. LocalPlayer::Broadcast() sends one in the game and duel rule sets, and each one includes the next value of LocalPlayer::sPlayerUpdateVersion. The members Clone(), Type(), and GetName() are inline.

Constructor & Destructor Documentation

◆ ~PlayerUpdatePacket()

PlayerUpdatePacket::~PlayerUpdatePacket ( )
overridedefault

Destroy the object.

Ghidra address:
NTSC-U/C: 0x0033dcd0
Ghidra address:
PAL: 0x003ab208

◆ PlayerUpdatePacket() [1/2]

PlayerUpdatePacket::PlayerUpdatePacket ( )
inline

Construct a packet with no track and no score.

Inline. New() expands it.

◆ PlayerUpdatePacket() [2/2]

PlayerUpdatePacket::PlayerUpdatePacket ( int nTrack,
int nPoints,
bool bCatching,
int nVersion )
inline

Construct a packet with every field set.

Inline. LocalPlayer::Broadcast() expands it on its stack.

Parameters
nTrackThe index of the player's track.
nPointsThe player's score.
bCatchingThe player's catching state.
nVersionThe update's sequence number.

Member Function Documentation

◆ New()

Message * PlayerUpdatePacket::New ( )
static

Produce a default-constructed packet on the heap.

Returns
The packet.
Ghidra address:
NTSC-U/C: 0x00122eb8
Ghidra address:
PAL: 0x00124638

◆ operator new()

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

Allocate a packet, billed to the class name.

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

◆ operator delete()

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

Release a packet.

Parameters
pBlockThe block.

◆ Clone()

Message * PlayerUpdatePacket::Clone ( )
inlineoverridevirtual

Produce a heap copy of this packet.

Returns
The copy.
Ghidra address:
NTSC-U/C: 0x0033dd70
Ghidra address:
PAL: 0x003ab2a8

Implements Message.

◆ Type()

int PlayerUpdatePacket::Type ( )
inlineoverridevirtual

Report this packet's registered identity.

Returns
g_nPlayerUpdatePacketType.
Ghidra address:
NTSC-U/C: 0x0033ddf8
Ghidra address:
PAL: 0x003ab330

Implements Message.

◆ GetName()

const char * PlayerUpdatePacket::GetName ( ) const
inlineoverridevirtual

Report this packet's class name.

Returns
The literal PlayerUpdatePacket.
Ghidra address:
NTSC-U/C: 0x0033de08
Ghidra address:
PAL: 0x003ab340

Implements Message.

◆ PrintExtra()

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

Print the track, the score, the catching state, and the version.

Parameters
streamThe stream to print to.
Ghidra address:
NTSC-U/C: 0x0012e2c8
Ghidra address:
PAL: 0x0012faa0

Reimplemented from Packet.

◆ saveGuts()

void PlayerUpdatePacket::saveGuts ( BinStream & stream) const
overridevirtual

Write the fields packed into one word.

The track takes the low three bits, the score the next fourteen, the catching state one bit, and the version the next fourteen.

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

Reimplemented from Message.

◆ restoreGuts()

void PlayerUpdatePacket::restoreGuts ( BinStream & stream)
overridevirtual

Read the word saveGuts() writes back into the fields.

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

Reimplemented from Message.

◆ GetCatching()

int PlayerUpdatePacket::GetCatching ( ) const
inline
Returns
The player's catching state.

◆ GetPoints()

int PlayerUpdatePacket::GetPoints ( ) const
inline
Returns
The player's score.

◆ GetTrack()

int PlayerUpdatePacket::GetTrack ( ) const
inline
Returns
The index of the player's track.

◆ GetVersion()

int PlayerUpdatePacket::GetVersion ( ) const
inline
Returns
The update's sequence number.

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