wavelength 1.0.0
Loading...
Searching...
No Matches
Message Class Referenceabstract

Base of every event the game passes between a MsgSource and a MsgSink. More...

#include <message.h>

Inheritance diagram for Message:

Public Member Functions

virtual ~Message ()
 Vtable slot 1.
virtual Message * Clone ()=0
 Produce a heap copy of this message.
virtual int Type ()=0
 Report this message's registered identity.
virtual const char * GetName () const =0
 Report this message's class name.
virtual void PrintExtra (PrnStream &stream) const
 Write this message's payload to a diagnostic stream.
virtual void saveGuts (BinStream &stream) const
 Write this message's payload to a stream.
virtual void restoreGuts (BinStream &stream)
 Read this message's payload from a stream.
virtual ~Message ()
virtual void Unused1 ()
 Not called by the control.
virtual int Type ()=0

Static Public Member Functions

static Message * NewMessage (int nType)
 Produce a message of the identified class through the factory list.

Detailed Description

Base of every event the game passes between a MsgSource and a MsgSink.

A message a MsgSource sends to its sinks.

Its RTTI descriptor is at 0x0086f638. It has no base and no data members. The compiler-generated vptr lands at offset 0 and every derived message adds its payload after it. The RTTI lists 124 derived classes, among them ScriptMsg, GemMsg, LeaveGameMsg, and Packet.

Every vtable in the family is eight entries, and the declaration order below reproduces the order after the compiler-generated slot 0. Each one was read off the concrete implementations rather than off the declaration: a scan of the derived tables found 80 classes that implement Clone(), Type(), and GetName(), while Packet and eight others inherit all three as pure and are therefore abstract themselves.

This class's own table is at 0x007ccbf8, which its destructor stores at offset 0. It has eight entries and a zero terminator at index 8, with slots 2, 3, and 4 addressing the pure-virtual stub. MsgSink's table follows it immediately at 0x007ccc40.

Slots 5, 6, and 7 all address a two-instruction jr ra stub in this class, at 0x001051f0, 0x001051f8, and 0x00105200. Every translation unit that destroys a message emits its own copy of all three stubs after its copy of the destructor, which is a second measurement of the count.

The three pure virtuals follow one pattern per class. LeaveGameMsg at 0x00812078 and GemMsg at 0x00812588 are the two worked examples cited below.

A concrete message also supplies a static New() that returns a default-constructed instance on the heap, and the translation unit at 0x003d9818 registers 92 of them against the identity Type() reports. Each registration constructs one file-scope object of a 4-byte class with the identity word immediately below it, passing the identity and the factory to the MessageFactory constructor, which inserts the pair into a sorted vector and stores nothing in the object.

The control never constructs a message, so no vtable or RTTI of one is in it. Only the third virtual function, which reports the type, is called; the first two are inferred.

Constructor & Destructor Documentation

◆ ~Message() [1/2]

virtual Message::~Message ( )
virtual

Vtable slot 1.

The body is empty.

Ghidra address:
NTSC-U/C: 0x00334820
Ghidra address:
PAL: 0x003a1dd0

◆ ~Message() [2/2]

virtual Message::~Message ( )
inlinevirtual

Member Function Documentation

◆ Clone()

virtual Message * Message::Clone ( )
pure virtual

Produce a heap copy of this message.

An implementation allocates the derived size against the tag MSG, installs its own vtable, and copies its payload word by word. GemMsg's copies 0x18 bytes and LeaveGameMsg's copies only the vptr, because that class has no payload. MsgQueue stores the result and its destructor deletes every stored message, so the queue owns the copies.

Returns
The copy.

Implemented in ArbiterPacket, BootPkt, BumperPacket, CapturePacket, ChangePasswordResultMsg, ChatMsg, ClientAbortedPkt, ClientInfoPkt, ClientRatingPkt, ClientStatusPkt, CreateAccountResultMsg, CripplerPacket, DataAckPkt, DataBlockPkt, DeleteAccountResultMsg, EditGemPacket, EraseBarPacket, EraseSectionPacket, FileListMsg, FinalScorePacket, FindPlayerMsg, FreestyleBumpPacket, FreestylePacket, FXPacket, GameEndedMsg, GameOverPkt, GameParamsPkt, GameParamsUpdateMsg, HostLaunchpadSuccessMsg, InetCheckConnectionResultMsg, InetConfigsResultMsg, InetConnectResultMsg, InetConnectStatusMsg, InetDisconnectResultMsg, InetDNSLookupResultMsg, JoinChatroomResultMsg, JoinFailedPkt, JoinLaunchpadSuccessMsg, JoypadAnalogStickMsg, JoypadConnectionMsg, JoypadInputMsg, KeyboardKeyMsg, LaunchpadAbortedMsg, LoadGameMsg, LoadGamePkt, LobbyChatroomsMsg, LobbyConnectionLostMsg, LobbyConnectResultMsg, LobbyDisconnectResultMsg, LobbyLaunchpadsMsg, LobbyPlayersMsg, LoginResultMsg, MultiplierPacket, MuteVocalsPacket, PlayerAbortedMsg, PlayerRankMsg, PlayerUpdatePacket, PreviewPacket, RemixDownloadMsg, RemixerUpdatePacket, RepoRemixesMsg, RepoRemixStatusMsg, SectionChangePacket, ShareRemixBeginMsg, ShareRemixPkt, ShareRemixProgressMsg, SlowdownPacket, StartGameMsg, StartGamePkt, TimeRequestPkt, TimeResponsePkt, UIComponentFocusChangeMsg, UIComponentSelectMsg, UIComponentSelectStartMsg, UIScreenChangeMsg, UITextEntryCompleteMsg, UITextEntryInvalidMsg, UITransitionCompleteMsg, UpdateRanksPkt, and WelcomePkt.

◆ Type() [1/2]

virtual int Message::Type ( )
pure virtual

Report this message's registered identity.

An implementation returns one word from the per-class identity table that spans 0x006d01ac through 0x006d035c. A sink compares the result against the identity it listens for, which is what ScriptSink::DispatchPriv() does against 0x006d024c. The read has no side effect, so the call MsgQueue::DispatchPriv() makes and discards has none either.

Returns
The identity.

Implemented in ArbiterPacket, BootPkt, BumperPacket, CapturePacket, ChangePasswordResultMsg, ChatMsg, ClientAbortedPkt, ClientInfoPkt, ClientRatingPkt, ClientStatusPkt, CreateAccountResultMsg, CripplerPacket, DataAckPkt, DataBlockPkt, DeleteAccountResultMsg, EditGemPacket, EraseBarPacket, EraseSectionPacket, FileListMsg, FinalScorePacket, FindPlayerMsg, FreestyleBumpPacket, FreestylePacket, FXPacket, GameEndedMsg, GameOverPkt, GameParamsPkt, GameParamsUpdateMsg, HostLaunchpadSuccessMsg, InetCheckConnectionResultMsg, InetConfigsResultMsg, InetConnectResultMsg, InetConnectStatusMsg, InetDisconnectResultMsg, InetDNSLookupResultMsg, JoinChatroomResultMsg, JoinFailedPkt, JoinLaunchpadSuccessMsg, JoypadAnalogStickMsg, JoypadButtonMsg, JoypadConnectionMsg, JoypadInputMsg, KeyboardKeyMsg, LaunchpadAbortedMsg, LoadGameMsg, LoadGamePkt, LobbyChatroomsMsg, LobbyConnectionLostMsg, LobbyConnectResultMsg, LobbyDisconnectResultMsg, LobbyLaunchpadsMsg, LobbyPlayersMsg, LoginResultMsg, MultiplierPacket, MuteVocalsPacket, PlayerAbortedMsg, PlayerRankMsg, PlayerUpdatePacket, PreviewPacket, RemixDownloadMsg, RemixerUpdatePacket, RepoRemixesMsg, RepoRemixStatusMsg, SectionChangePacket, ShareRemixBeginMsg, ShareRemixPkt, ShareRemixProgressMsg, SlowdownPacket, StartGameMsg, StartGamePkt, TimeRequestPkt, TimeResponsePkt, UIComponentFocusChangeMsg, UIComponentSelectMsg, UIComponentSelectStartMsg, UIScreenChangeMsg, UITextEntryCompleteMsg, UITextEntryInvalidMsg, UITransitionCompleteMsg, UpdateRanksPkt, and WelcomePkt.

◆ GetName()

virtual const char * Message::GetName ( ) const
pure virtual

Report this message's class name.

An implementation returns its own name as a string literal. LeaveGameMsg returns LeaveGameMsg from 0x008116a8 and GemMsg returns GemMsg from 0x00811570.

Returns
The name.

Implemented in ArbiterPacket, BootPkt, BumperPacket, CapturePacket, ChangePasswordResultMsg, ChatMsg, ClientAbortedPkt, ClientInfoPkt, ClientRatingPkt, ClientStatusPkt, CreateAccountResultMsg, CripplerPacket, DataAckPkt, DataBlockPkt, DeleteAccountResultMsg, EditGemPacket, EraseBarPacket, EraseSectionPacket, FileListMsg, FinalScorePacket, FindPlayerMsg, FreestyleBumpPacket, FreestylePacket, FXPacket, GameEndedMsg, GameOverPkt, GameParamsPkt, GameParamsUpdateMsg, HostLaunchpadSuccessMsg, InetCheckConnectionResultMsg, InetConfigsResultMsg, InetConnectResultMsg, InetConnectStatusMsg, InetDisconnectResultMsg, InetDNSLookupResultMsg, JoinChatroomResultMsg, JoinFailedPkt, JoinLaunchpadSuccessMsg, JoypadAnalogStickMsg, JoypadConnectionMsg, JoypadInputMsg, KeyboardKeyMsg, LaunchpadAbortedMsg, LoadGameMsg, LoadGamePkt, LobbyChatroomsMsg, LobbyConnectionLostMsg, LobbyConnectResultMsg, LobbyDisconnectResultMsg, LobbyLaunchpadsMsg, LobbyPlayersMsg, LoginResultMsg, MultiplierPacket, MuteVocalsPacket, PlayerAbortedMsg, PlayerRankMsg, PlayerUpdatePacket, PreviewPacket, RemixDownloadMsg, RemixerUpdatePacket, RepoRemixesMsg, RepoRemixStatusMsg, SectionChangePacket, ShareRemixBeginMsg, ShareRemixPkt, ShareRemixProgressMsg, SlowdownPacket, StartGameMsg, StartGamePkt, TimeRequestPkt, TimeResponsePkt, UIComponentFocusChangeMsg, UIComponentSelectMsg, UIComponentSelectStartMsg, UIScreenChangeMsg, UITextEntryCompleteMsg, UITextEntryInvalidMsg, UITransitionCompleteMsg, UpdateRanksPkt, and WelcomePkt.

◆ PrintExtra()

virtual void Message::PrintExtra ( PrnStream & stream) const
virtual

◆ saveGuts()

virtual void Message::saveGuts ( BinStream & stream) const
virtual

Write this message's payload to a stream.

Vtable slot 6. The default does nothing. The packets of an online session override the pair of slots 6 and 7, which is therefore the wire format.

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

Reimplemented in ArbiterPacket, BootPkt, BumperPacket, CapturePacket, ClientInfoPkt, ClientRatingPkt, ClientStatusPkt, CripplerPacket, DataBlockPkt, EditGemPacket, EraseBarPacket, EraseSectionPacket, FinalScorePacket, FreestyleBumpPacket, FreestylePacket, FXPacket, GameOverPkt, GameParamsPkt, JoinFailedPkt, MuteVocalsPacket, PlayerUpdatePacket, PreviewPacket, RemixerUpdatePacket, SectionChangePacket, ShareRemixPkt, StartGamePkt, TimeRequestPkt, TimeResponsePkt, UpdateRanksPkt, and WelcomePkt.

◆ restoreGuts()

virtual void Message::restoreGuts ( BinStream & stream)
virtual

◆ NewMessage()

Message * Message::NewMessage ( int nType)
static

Produce a message of the identified class through the factory list.

The list is searched with a binary search on the identity, and a hit calls the factory a MessageFactory registered.

Parameters
nTypeThe identity to construct for.
Returns
The new message, or null when the identity is unregistered.
Ghidra address:
NTSC-U/C: 0x0029cfb0
Ghidra address:
PAL: 0x002a6c78

◆ Unused1()

virtual void Message::Unused1 ( )
inlinevirtual

Not called by the control.

◆ Type() [2/2]

virtual int Message::Type ( )
pure virtual
Returns
The type of the message.

Implemented in ArbiterPacket, BootPkt, BumperPacket, CapturePacket, ChangePasswordResultMsg, ChatMsg, ClientAbortedPkt, ClientInfoPkt, ClientRatingPkt, ClientStatusPkt, CreateAccountResultMsg, CripplerPacket, DataAckPkt, DataBlockPkt, DeleteAccountResultMsg, EditGemPacket, EraseBarPacket, EraseSectionPacket, FileListMsg, FinalScorePacket, FindPlayerMsg, FreestyleBumpPacket, FreestylePacket, FXPacket, GameEndedMsg, GameOverPkt, GameParamsPkt, GameParamsUpdateMsg, HostLaunchpadSuccessMsg, InetCheckConnectionResultMsg, InetConfigsResultMsg, InetConnectResultMsg, InetConnectStatusMsg, InetDisconnectResultMsg, InetDNSLookupResultMsg, JoinChatroomResultMsg, JoinFailedPkt, JoinLaunchpadSuccessMsg, JoypadAnalogStickMsg, JoypadButtonMsg, JoypadConnectionMsg, JoypadInputMsg, KeyboardKeyMsg, LaunchpadAbortedMsg, LoadGameMsg, LoadGamePkt, LobbyChatroomsMsg, LobbyConnectionLostMsg, LobbyConnectResultMsg, LobbyDisconnectResultMsg, LobbyLaunchpadsMsg, LobbyPlayersMsg, LoginResultMsg, MultiplierPacket, MuteVocalsPacket, PlayerAbortedMsg, PlayerRankMsg, PlayerUpdatePacket, PreviewPacket, RemixDownloadMsg, RemixerUpdatePacket, RepoRemixesMsg, RepoRemixStatusMsg, SectionChangePacket, ShareRemixBeginMsg, ShareRemixPkt, ShareRemixProgressMsg, SlowdownPacket, StartGameMsg, StartGamePkt, TimeRequestPkt, TimeResponsePkt, UIComponentFocusChangeMsg, UIComponentSelectMsg, UIComponentSelectStartMsg, UIScreenChangeMsg, UITextEntryCompleteMsg, UITextEntryInvalidMsg, UITransitionCompleteMsg, UpdateRanksPkt, and WelcomePkt.


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