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

A player's identity and settings. More...

#include <playerinfo.h>

Public Member Functions

 PlayerInfo ()
 Construct an empty identity.
 PlayerInfo (unsigned nPlayerId, const HxStr &colorName, const FreqAppearance &appearance, int nTrack)
 Construct an identity from its parts.
virtual ~PlayerInfo ()
 Release the vector, the appearance, and the name.
virtual void Print (std::ostream &stream) const
 Write the identity to a diagnostic stream.
virtual void Save (OBStream &stream) const
 Write the identity to a stream.
virtual void Load (IBStream &stream)
 Read the identity back from a stream.

Detailed Description

A player's identity and settings.

Its RTTI descriptor is at 0x0086f738. It has no base. The compiler places the vptr after the data at +0x3c, and the class is 0x40 bytes. Its vtable at 0x007d2820 has five entries and a zero terminator at index 5, the type function, the destructor, and the three members below.

The layout comes from the copy constructor at 0x0010baa0 and the destructor together. The copy constructor copies every member in order, and the destructor releases the vector, the appearance, and the string buffer in reverse declaration order. The vector at +0x30 is deep-copied through the allocator and a memmove, which is what establishes that the class owns its elements. The element type is not recovered, and int stands in for it. Every member is private, because the only readers outside the class are the three members below.

That copy constructor is the compiler-generated one and is therefore not declared here. It copies all eight members in exact declaration order with no logic of its own, and it sits at 0x0010baa0 while every hand-written member of the class sits in the 0x00133xxx and 0x00135xxx runs, which places it in a different translation unit.

mOriginalId is the one member that none of Print(), Save(), or Load() touches. Only the four-argument constructor writes it.

Two network packets embed one of these, SCPlayerJoinedPacket and ToAllNetManagersPacket. The image has no caller of the four-argument constructor. Every name below past the identifier, colour, and appearance is inferred from its type and its initial value alone. The first three follow the parameter order of Player's constructor and the plid and clr labels the join packets print.

Constructor & Destructor Documentation

◆ PlayerInfo() [1/2]

PlayerInfo::PlayerInfo ( )
inline

Construct an empty identity.

Only the name, the appearance, and the vector are initialised. The integer members are left as the storage holds them.

Inline. The address is its uncalled out-of-line copy.

Ghidra address:
NTSC-U/C: 0x00135d48
Ghidra address:
PAL: 0x001365d8

◆ PlayerInfo() [2/2]

PlayerInfo::PlayerInfo ( unsigned nPlayerId,
const HxStr & colorName,
const FreqAppearance & appearance,
int nTrack )
inline

Construct an identity from its parts.

mActive starts at 1 and mReady at 0, and mOriginalId receives the same value as mPlayerId.

Inline. The address is its uncalled out-of-line copy.

Parameters
nPlayerIdThe identifier stored in mPlayerId and mOriginalId.
colorNameThe colour name stored in mColorName.
appearanceThe appearance to copy.
nTrackThe value stored in mTrack.
Ghidra address:
NTSC-U/C: 0x00135dd0
Ghidra address:
PAL: 0x00136678

◆ ~PlayerInfo()

virtual PlayerInfo::~PlayerInfo ( )
virtual

Release the vector, the appearance, and the name.

Ghidra address:
NTSC-U/C: 0x00135e98
Ghidra address:
PAL: 0x00136750

Member Function Documentation

◆ Print()

virtual void PlayerInfo::Print ( std::ostream & stream) const
virtual

Write the identity to a diagnostic stream.

Slot 2. The output opens with the literal {AppPlayerInfo: , which is the one place in the image that writes a name for this class outside its RTTI.

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

◆ Save()

virtual void PlayerInfo::Save ( OBStream & stream) const
virtual

Write the identity to a stream.

Slot 3.

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

◆ Load()

virtual void PlayerInfo::Load ( IBStream & stream)
virtual

Read the identity back from a stream.

Slot 4. The members come back in the order Save() wrote them.

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

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