|
wavelength 1.0.0
|
Base of every event the game passes between a MsgSource and a MsgSink. More...
#include <message.h>

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. | |
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.
|
virtual |
Vtable slot 1.
The body is empty.
|
inlinevirtual |
|
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.
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.
|
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.
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.
|
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.
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.
|
virtual |
Write this message's payload to a diagnostic stream.
Vtable slot 5. The default writes nothing. Every translation unit that destroys a message emits its own copy of the empty body. The address below is the first copy.
| stream | The stream to write to. |
Reimplemented in ArbiterPacket, BootPkt, BumperPacket, ChangePasswordResultMsg, ChatMsg, ClientInfoPkt, ClientRatingPkt, ClientStatusPkt, CreateAccountResultMsg, DataBlockPkt, DeleteAccountResultMsg, FindPlayerMsg, FreestyleBumpPacket, FreestylePacket, FXPacket, GameEndedMsg, GameOverPkt, GameParamsPkt, GameParamsUpdateMsg, HostLaunchpadSuccessMsg, InetConfigsResultMsg, InetConnectResultMsg, InetConnectStatusMsg, InetDNSLookupResultMsg, JoinChatroomResultMsg, JoinFailedPkt, JoinLaunchpadSuccessMsg, JoypadAnalogStickMsg, JoypadConnectionMsg, JoypadInputMsg, KeyboardKeyMsg, LaunchpadAbortedMsg, LobbyChatroomsMsg, LobbyConnectResultMsg, LobbyLaunchpadsMsg, LobbyPlayersMsg, LoginResultMsg, MuteVocalsPacket, Packet, PlayerAbortedMsg, PlayerRankMsg, PlayerUpdatePacket, RemixerUpdatePacket, RepoRemixesMsg, RepoRemixStatusMsg, ShareRemixBeginMsg, ShareRemixPkt, ShareRemixProgressMsg, StartGameMsg, StartGamePkt, TimeRequestPkt, TimeResponsePkt, UIComponentFocusChangeMsg, UIComponentSelectMsg, UIComponentSelectStartMsg, UIScreenChangeMsg, UITextEntryCompleteMsg, UITextEntryInvalidMsg, UITransitionCompleteMsg, UpdateRanksPkt, and WelcomePkt.
|
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.
| stream | The stream to write to. |
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.
|
virtual |
Read this message's payload from a stream.
Vtable slot 7. The default does nothing.
| stream | The stream to read from. |
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.
|
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.
| nType | The identity to construct for. |
|
inlinevirtual |
Not called by the control.
|
pure virtual |
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.