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

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

#include <updatescorepacket.h>

Inheritance diagram for UpdateScorePacket:
Collaboration diagram for UpdateScorePacket:

Public Member Functions

 UpdateScorePacket ()
 Construct a packet with only the Packet words set.
 UpdateScorePacket (int nPlayerId, int nScoreDelta)
 Report a change to a player's score.
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 payload to a diagnostic stream.
virtual void saveGuts (OBStream &stream) const
 Write the packet to a stream.
virtual void restoreGuts (IBStream &stream)
 Read the packet back from a stream.
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

int mPlayerId
 The identifier of the scoring player.
int mScoreDelta
 The points to add.

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 0x008efcc0. It has ToAllOtherGameSystemsPacket as its one base. The object is 0x1c bytes and its vtable is at 0x008145c0. The payload comes from the copy constructor at 0x003f3818. Clone() delegates to it. The offsets and widths are recovered, but the purpose of each field is not. The four words Packet provides are declared there rather than here.

Its vtable has eight entries and a zero terminator at index 8. Slots 5, 6, and 7 are all its own overrides. Both transfer members open by expanding the Packet pair inline rather than calling it, which every one of the twenty overriding packet classes does identically.

PrintExtra() labels the two members pid: and score-delta:. The builds in two Player routines at 0x0012f904 and 0x0012fa6c store the player's identifier from its +0x20 and the amount added, which settles both names.

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

Constructor & Destructor Documentation

◆ UpdateScorePacket() [1/2]

UpdateScorePacket::UpdateScorePacket ( )
inline

Construct a packet with only the Packet words set.

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

◆ UpdateScorePacket() [2/2]

UpdateScorePacket::UpdateScorePacket ( int nPlayerId,
int nScoreDelta )
inline

Report a change to a player's score.

Inline, with no address of its own. The two Player routines at 0x0012f808 and 0x0012f970 expand it on their stacks after the ToAllOtherGameSystemsPacket words.

Parameters
nPlayerIdThe player's identifier.
nScoreDeltaThe amount added to the score.

Member Function Documentation

◆ New()

Message * UpdateScorePacket::New ( )
static

Produce a default-constructed packet on the heap.

The registry the translation unit at 0x003ed2e0 builds stores this address against g_nUpdateScorePacketType. Only the Packet words are initialised.

Returns
The packet.
Ghidra address:
NTSC-U/C: 0x003e5268
Ghidra address:
PAL: 0x0041d500

◆ Clone()

virtual Message * UpdateScorePacket::Clone ( )
virtual

Produce a heap copy of this packet.

Returns
The copy.
Ghidra address:
NTSC-U/C: 0x003f06c0
Ghidra address:
PAL: 0x00428cc8

Implements Message.

◆ Type()

virtual int UpdateScorePacket::Type ( )
virtual

Report this packet's registered identity.

Returns
g_nUpdateScorePacketType.
Ghidra address:
NTSC-U/C: 0x003f0738
Ghidra address:
PAL: 0x00428d40

Implements Message.

◆ GetName()

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

Report this packet's class name.

Returns
The literal UpdateScorePacket.
Ghidra address:
NTSC-U/C: 0x003f0748
Ghidra address:
PAL: 0x00428d50

Implements Message.

◆ PrintExtra()

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

Write the payload to a diagnostic stream.

Slot 5. The literals are at 0x00814240 and 0x00814248.

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

Reimplemented from Message.

◆ saveGuts()

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

Write the packet to a stream.

Slot 6.

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

Reimplemented from Packet.

◆ restoreGuts()

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

Read the packet back from a stream.

Slot 7. Both members are filled in place rather than through a local.

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

Reimplemented from Packet.

Member Data Documentation

◆ mPlayerId

int UpdateScorePacket::mPlayerId

The identifier of the scoring player.

Player::DispatchPriv() reads it. +0x14

◆ mScoreDelta

int UpdateScorePacket::mScoreDelta

The points to add.

Player::DispatchPriv() reads it. +0x18


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