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

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

#include <bumppacket.h>

Inheritance diagram for BumpPacket:
Collaboration diagram for BumpPacket:

Public Member Functions

 BumpPacket ()
 Construct a packet with only the player reference, the Packet words, and mResult set.
 BumpPacket (Player *pPlayer, int nBar, int nTrack)
 Report a bumper deployed 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 the player's address, bar , the bar, track , and the track to a diagnostic stream.
virtual void saveGuts (OBStream &stream) const
 Write the Packet words, the player's identifier, the bar, and the track to a stream.
virtual void restoreGuts (IBStream &stream)
 Read the Packet words, the player's identifier, the bar, and the track back in place.
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 bumping player.
int mBar
 The bar of the bump.
int mTrack
 The track the bump strikes.
int mResult = 0
 Non-zero once a receiver has acted on the packet.

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

PrintExtra() labels +0x1c as a bar and +0x20 as a track. mResult at +0x24 is zeroed by New() and is neither transferred nor printed.

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

Constructor & Destructor Documentation

◆ BumpPacket() [1/2]

BumpPacket::BumpPacket ( )
inline

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

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

◆ BumpPacket() [2/2]

BumpPacket::BumpPacket ( Player * pPlayer,
int nBar,
int nTrack )
inline

Report a bumper deployed by a player.

Inline, with no address of its own. BumpPowerup::Deploy() at 0x001c9de0 expands it on its stack after the ToAllOtherGameSystemsPacket words.

Parameters
pPlayerThe player who deployed the bumper, or null.
nBarThe bar.
nTrackThe track.

Member Function Documentation

◆ New()

Message * BumpPacket::New ( )
static

Produce a default-constructed packet on the heap.

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

Returns
The packet.
Ghidra address:
NTSC-U/C: 0x003e5410
Ghidra address:
PAL: 0x0041d6a8

◆ Clone()

virtual Message * BumpPacket::Clone ( )
virtual

Produce a heap copy of this packet.

Returns
The copy.
Ghidra address:
NTSC-U/C: 0x003f0e80
Ghidra address:
PAL: 0x00429488

Implements Message.

◆ Type()

virtual int BumpPacket::Type ( )
virtual

Report this packet's registered identity.

Returns
g_nBumpPacketType.
Ghidra address:
NTSC-U/C: 0x003f0ef8
Ghidra address:
PAL: 0x00429500

Implements Message.

◆ GetName()

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

Report this packet's class name.

Returns
The literal BumpPacket.
Ghidra address:
NTSC-U/C: 0x003f0f08
Ghidra address:
PAL: 0x00429510

Implements Message.

◆ PrintExtra()

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

Write the player's address, bar , the bar, track , and the track to a diagnostic stream.

The player is written through the pointer inserter, so the output is its address.

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

Reimplemented from Message.

◆ saveGuts()

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

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

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

Reimplemented from Packet.

◆ restoreGuts()

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

Read the Packet words, the player's identifier, the bar, and the track back in place.

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

Reimplemented from Packet.

Member Data Documentation

◆ mPlayer

IDablePtr<Player> BumpPacket::mPlayer

The bumping player.

TrackSelector::RebuildChannelGrid() resolves it. +0x14

◆ mBar

int BumpPacket::mBar

The bar of the bump.

TrackSelector::RebuildChannelGrid() scales it to ticks. +0x1c

◆ mTrack

int BumpPacket::mTrack

The track the bump strikes.

TrackSelector::RebuildChannelGrid() reads it. +0x20

◆ mResult

int BumpPacket::mResult = 0

Non-zero once a receiver has acted on the packet.

+0x24

Both constructors clear it. Public because BumpPowerup::Deploy() reads it back after sending, plays SND_DEPLOY_BUMPER when it is set, and the image has no accessor.


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