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

The online session of this console on top of the session library, the base of HostpadRT and JoinpadRT. More...

#include <launchpadrt.h>

Inheritance diagram for LaunchpadRT:
Collaboration diagram for LaunchpadRT:

Public Types

enum  State {
  kStateFailed = -1 , kStateConnecting = 0 , kStateConnected = 1 , kStateWelcomed = 2 ,
  kStateSynced = 3
}
 Values of mState. More...
enum  Ready { kReadyNo = 0 , kReadyYes = 1 , kReadyLoading = 2 , kReadyLoaded = 3 }
 Values of NetLaunchpadPlayer::mReady. More...

Public Member Functions

 LaunchpadRT (MsgSink *pGame)
 Construct the session, stored in TheNetLaunchpad and TheLaunchpadRT.
 ~LaunchpadRT () override
 Stop the requests, and clear TheNetLaunchpad and TheLaunchpadRT.
void Cancel (MsgSink *pSink) override
 Exit the session with reason 0.
void Activate () override
 Mark the session active, and report this console ready when it can be.
void NotifyLoaded () override
 Report this console loaded.
int IsGuest () override
 Report mLocalId.
int GetPlayersVersion () override
 Report sPlayersVersion.
std::list< NetLaunchpadPlayer > * GetPlayers () override
 Report mPlayers.
virtual void ReportNow ()
 Vtable slot 12.
virtual void SetLocalId (int nId)
 Vtable slot 13.
virtual void AddClient (int nId)
 Vtable slot 14.
virtual void RemovePlayer (int nId)
 Vtable slot 15.
virtual float GetTime ()=0
 Vtable slot 16.
virtual void OnConnected ()=0
 Vtable slot 17.
virtual void PollPriv ()=0
 Vtable slot 18.
virtual void EndGame ()
 Vtable slot 19.
virtual void SendRating (int nRank)
 Vtable slot 20.
bool DispatchPriv (Message *pMsg) override
 Act on a packet of the session.
void SetReady (int nReady)
 Set the state of this console and send it to every console.
int Poll ()
 Service the session once per frame.
NetLaunchpadPlayer * FindPlayer (int nId)
 Find a player of the session.
NetLaunchpadPlayer * GetLocalPlayer ()
 Find the player of this console.
void AddPlayer (const NetLaunchpadPlayer &player)
 Insert a player before the first player with a higher colour.
void StartGame ()
 Start the song, and rate the start of a rated game as a loss of this console.
void DropRating (int nId)
 Rate a player who left as a loser, and drop every guest when the host left.
void RateGame (const std::vector< NetGameScore > &scores)
 Rate the players from the final scores of the game, and clear the rating.
void UpdateRating ()
 Rate the player of this console from mRatings and publish the rating.
void Exit (MsgSink *pSink, int nReason)
 End the game and start mExitTask.
int FindIdByAccount (int nAccountId)
 Find the identifier in the session of an account.
void Abort (int nReason)
 Exit the session for mGameSink.
void Send (Packet *pPacket)
 Encrypt a packet and send it to the consoles its receiver selects.
void Leave ()
 Leave the game and tell the other consoles.
void PlayersChanged ()
 Count a change of the players.
void CheckReady ()
 Report this console ready once the session is active and synced.
bool OnMsg (ClientStatusPkt *pPkt)
 Take the state of a player.
bool OnMsg (ClientRatingPkt *pPkt)
 Take the rating of a player.
bool OnMsg (LoadGamePkt *pPkt)
 Enter the game, and tell mGameSink to load the song.
bool OnMsg (StartGamePkt *pPkt)
 Take the time the song starts at and the seed of the game.
bool OnMsg (ClientAbortedPkt *pPkt)
 Drop a player who exited the game, and end the game when the host exited.
bool OnMsg (UpdateRanksPkt *pPkt)
 Take the ranks of the players.
int GetWorldId () const
void SetWorldId (int nValue)
const rtNetConnectionInfo & GetConnectionInfo () const
void SetConnectionInfo (const rtNetConnectionInfo &info)
int GetConnection () const
void SetConnection (int nValue)
int GetLocalId () const
void SetLocalIdValue (int nValue)
int GetState () const
void SetState (int nValue)
int GetError () const
void SetError (int nValue)
MsgSink * GetGameSink () const
std::list< NetLaunchpadPlayer > & GetPlayersList ()
const std::vector< int > & GetClients () const
Public Member Functions inherited from NetLaunchpad
virtual void EndEdit ()
 Vtable slot 7.
virtual bool ShareRemix ()
 Vtable slot 8.
virtual int Launch ()
 Vtable slot 9.
virtual void BootPlayer (int nPlayer)
 Vtable slot 10.
virtual ~NetLaunchpad ()
 Vtable slot 11.
Public Member Functions inherited from MsgSink
void * operator new (size_t nSize)
 Allocate a sink from the pool heaps under the tag "MsgSink".
void operator delete (void *pBlock)
 Return a sink to the pool heaps.
virtual ~MsgSink ()
virtual bool Dispatch (Message *pMsg)
 Accept a message.
void * operator new (size_t size)
 Allocate from the main heap under the name MsgSink.
void operator delete (void *mem)
 Return memory to its heap.
virtual ~MsgSink ()
 Destroy the sink.
virtual bool Dispatch (Message *msg)
 Handle a message.

Static Public Member Functions

static int RegisterMessages ()
 Register the packets of the session with the session library.
static void SetMgclReady (int nReady)
 Set sMgclReady.
static int IsMgclReady ()
 Report sMgclReady.
static NetTask * GetNetTask ()
static void SetNetTask (NetTask *pTask)
static unsigned char DecodeByte (const char *pszText)
 Read a byte EncodeByte() wrote.
static void EncodeByte (char *pszText, unsigned char nByte)
 Write a byte as two characters and a terminator.
static int FindScore (const std::vector< NetGameScore > &scores, int nId)
 Report the score of a player in the final scores.
static int Receive (int nConnection, int nType, int nSender, rtDmeMessage *pMessage)
 Receive a message of the session, the handler rtDmeRegisterMessageHandler() registers.
static void OnNetConnect (int nConnection, int nReserved1, int nReserved2, int nStatus)
 Receive the result of NetHostTask and NetConnectTask, and finish sNetTask.
static void OnNetClientJoin (int nConnection, int nClient, const char *pszAddress)
 Note a console that connected to the session.
static void OnNetClientLeave (int nConnection, int nClient, const char *pszAddress)
 Remove a console that left the session.

Static Public Attributes

static constexpr int kHostId = 0
 The identifier of the host in the session.
static constexpr int kNoId = -2
 The identifier of a console that has none yet.
static constexpr int kNoWorld = -1
 The value of mWorldId and mConnection without a session.
static constexpr int kKeyChannel = 4
 The chat channel the session exchanges its key on.
static constexpr int kKeySize = 16
 The size of the key of the session in bytes.
static constexpr int kMaxClients = 5
 The consoles a session takes on the session library and the game server.
static constexpr int kGameHostPeerToPeer = 2
 The kind of host the session reports to the servers, a host among its peers.

Protected Attributes

int mWorldId
rtNetConnectionInfo mConnectionInfo
int mConnection
int mLocalId
int mState
int mError
MsgSink * mGameSink
NetMultiTask mConnectTask
NetMultiTask mExitTask
NetMultiTask mRankTask
PeriodicTask mPlayerReport
TaskList mTasks
std::list< NetLaunchpadPlayer > mPlayers
float mStartTime
int mSeed
int mActive
int mShareOnly
int mStarting
int mInGame
std::vector< int > mClients
std::vector< RatingStat > mRatings

Detailed Description

The online session of this console on top of the session library, the base of HostpadRT and JoinpadRT.

The RTTI includes the class name and records MsgSink and NetLaunchpad as the bases. The NetLaunchpad part is at offset 0 with the vtable at 0x003d4770, and the MsgSink part is at offset 4 with the vtable at 0x003d4748. The object is 0x17c bytes. The constructor stores the instance in TheNetLaunchpad and TheLaunchpadRT.

The session runs three requests. mConnectTask connects to the session, mExitTask leaves it, and mRankTask asks for the ladder position of the player after a game. The players are listed in the order of their colours.

Member Enumeration Documentation

◆ State

Values of mState.

Enumerator
kStateFailed 

The host turned the console away, and mError tells why.

kStateConnecting 

The console has no identifier in the session yet.

kStateConnected 

The console has an identifier in the session.

kStateWelcomed 

The host accepted the console.

kStateSynced 

The console is ready to play.

◆ Ready

Values of NetLaunchpadPlayer::mReady.

Enumerator
kReadyNo 

The player is not ready.

kReadyYes 

The player is ready.

kReadyLoading 

The player loads the song.

kReadyLoaded 

The player loaded the song.

Constructor & Destructor Documentation

◆ LaunchpadRT()

LaunchpadRT::LaunchpadRT ( MsgSink * pGame)
explicit

Construct the session, stored in TheNetLaunchpad and TheLaunchpadRT.

The constructor gives the player report its task, registers the session for the chat of kKeyChannel, and adds the ladder position request to mRankTask.

Parameters
pGameThe sink that receives the messages of the session.
Ghidra address:
NTSC-U/C: 0x00254e08
Ghidra address:
PAL: 0x0025dd20

◆ ~LaunchpadRT()

LaunchpadRT::~LaunchpadRT ( )
override

Stop the requests, and clear TheNetLaunchpad and TheLaunchpadRT.

Ghidra address:
NTSC-U/C: 0x00255068
Ghidra address:
PAL: 0x0025df80

Member Function Documentation

◆ Cancel()

void LaunchpadRT::Cancel ( MsgSink * pSink)
overridevirtual

Exit the session with reason 0.

Parameters
pSinkThe sink that receives the end of the session.
Ghidra address:
NTSC-U/C: 0x002551e8
Ghidra address:
PAL: 0x0025e100

Implements NetLaunchpad.

◆ Activate()

void LaunchpadRT::Activate ( )
overridevirtual

Mark the session active, and report this console ready when it can be.

Ghidra address:
NTSC-U/C: 0x00255208
Ghidra address:
PAL: 0x0025e120

Implements NetLaunchpad.

◆ NotifyLoaded()

void LaunchpadRT::NotifyLoaded ( )
overridevirtual

Report this console loaded.

Ghidra address:
NTSC-U/C: 0x00255228
Ghidra address:
PAL: 0x0025e140

Implements NetLaunchpad.

◆ IsGuest()

int LaunchpadRT::IsGuest ( )
overridevirtual

Report mLocalId.

Returns
The identifier of this console in the session.
Ghidra address:
NTSC-U/C: 0x00255258
Ghidra address:
PAL: 0x0025e170

Implements NetLaunchpad.

◆ GetPlayersVersion()

int LaunchpadRT::GetPlayersVersion ( )
overridevirtual

Report sPlayersVersion.

Returns
The count.
Ghidra address:
NTSC-U/C: 0x00255260
Ghidra address:
PAL: 0x0025e178

Implements NetLaunchpad.

◆ GetPlayers()

std::list< NetLaunchpadPlayer > * LaunchpadRT::GetPlayers ( )
inlineoverridevirtual

Report mPlayers.

Inline.

Returns
The players.
Ghidra address:
NTSC-U/C: 0x00398d30
Ghidra address:
PAL: 0x004075b8

Implements NetLaunchpad.

◆ ReportNow()

virtual void LaunchpadRT::ReportNow ( )
virtual

Vtable slot 12.

Send the player report at the next poll.

The base does so only in a session. The name is inferred.

Ghidra address:
NTSC-U/C: 0x00255770
Ghidra address:
PAL: 0x0025e688

Reimplemented in HostpadRT.

◆ SetLocalId()

virtual void LaunchpadRT::SetLocalId ( int nId)
virtual

Vtable slot 13.

Take the identifier of this console in the session.

The name is inferred.

Parameters
nIdThe identifier.
Ghidra address:
NTSC-U/C: 0x002557a0
Ghidra address:
PAL: 0x0025e6b8

Reimplemented in HostpadRT.

◆ AddClient()

virtual void LaunchpadRT::AddClient ( int nId)
virtual

Vtable slot 14.

Note a console that connected to the session.

The base sends the console the player of this console once this console is welcomed. The name is inferred.

Parameters
nIdThe identifier of the console.
Ghidra address:
NTSC-U/C: 0x002557b0
Ghidra address:
PAL: 0x0025e6c8

Reimplemented in HostpadRT.

◆ RemovePlayer()

virtual void LaunchpadRT::RemovePlayer ( int nId)
virtual

Vtable slot 15.

Remove a player who left, and drop the player from the rating.

Parameters
nIdThe player's identifier in the session.
Ghidra address:
NTSC-U/C: 0x002558f8
Ghidra address:
PAL: 0x0025e810

Reimplemented in HostpadRT, and JoinpadRT.

◆ GetTime()

virtual float LaunchpadRT::GetTime ( )
pure virtual

Vtable slot 16.

Report the clock of the session.

The name is inferred.

Returns
The time in milliseconds.

Implemented in HostpadRT, and JoinpadRT.

◆ OnConnected()

virtual void LaunchpadRT::OnConnected ( )
pure virtual

Vtable slot 17.

Report the success of mConnectTask to its sink.

The name is inferred.

Implemented in HostpadRT, and JoinpadRT.

◆ PollPriv()

virtual void LaunchpadRT::PollPriv ( )
pure virtual

Vtable slot 18.

Service the derived class once per Poll().

The name is inferred.

Implemented in HostpadRT, and JoinpadRT.

◆ EndGame()

virtual void LaunchpadRT::EndGame ( )
virtual

Vtable slot 19.

Leave the game of the session and return to the launchpad.

The base closes the transport, clears the rating, marks this console not ready, and starts mRankTask. The name is inferred.

Ghidra address:
NTSC-U/C: 0x002566c0
Ghidra address:
PAL: 0x0025f5c8

Reimplemented in HostpadRT.

◆ SendRating()

virtual void LaunchpadRT::SendRating ( int nRank)
virtual

Vtable slot 20.

Send the rating of this console to the other consoles.

The name is inferred.

Parameters
nRankThe position of the player in the ranking.
Ghidra address:
NTSC-U/C: 0x002552f8
Ghidra address:
PAL: 0x0025e210

Reimplemented in HostpadRT.

◆ DispatchPriv()

bool LaunchpadRT::DispatchPriv ( Message * pMsg)
overridevirtual

Act on a packet of the session.

Parameters
pMsgThe message.
Returns
The result of the handler, false for every handler here.
Ghidra address:
NTSC-U/C: 0x00256ac8
Ghidra address:
PAL: 0x0025f9d0

Implements MsgSink.

◆ SetReady()

void LaunchpadRT::SetReady ( int nReady)

Set the state of this console and send it to every console.

The name is inferred.

Parameters
nReadyOne of Ready.
Ghidra address:
NTSC-U/C: 0x00255270
Ghidra address:
PAL: 0x0025e188

◆ Poll()

int LaunchpadRT::Poll ( )

Service the session once per frame.

The routine polls the requests, sends the player of this console to the consoles that connected, and starts the song once its time comes.

Returns
1 once mExitTask finished and the session should be deleted, otherwise 0.
Ghidra address:
NTSC-U/C: 0x002553a0
Ghidra address:
PAL: 0x0025e2b8

◆ FindPlayer()

NetLaunchpadPlayer * LaunchpadRT::FindPlayer ( int nId)

Find a player of the session.

Parameters
nIdThe player's identifier in the session.
Returns
The player, or null.
Ghidra address:
NTSC-U/C: 0x002559f0
Ghidra address:
PAL: 0x0025e908

◆ GetLocalPlayer()

NetLaunchpadPlayer * LaunchpadRT::GetLocalPlayer ( )

Find the player of this console.

Returns
The player, or null.
Ghidra address:
NTSC-U/C: 0x00255a40
Ghidra address:
PAL: 0x0025e958

◆ AddPlayer()

void LaunchpadRT::AddPlayer ( const NetLaunchpadPlayer & player)

Insert a player before the first player with a higher colour.

Parameters
playerThe player.
Ghidra address:
NTSC-U/C: 0x00255a60
Ghidra address:
PAL: 0x0025e978

◆ StartGame()

void LaunchpadRT::StartGame ( )

Start the song, and rate the start of a rated game as a loss of this console.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x00255c58
Ghidra address:
PAL: 0x0025eb70

◆ DropRating()

void LaunchpadRT::DropRating ( int nId)

Rate a player who left as a loser, and drop every guest when the host left.

The name is inferred.

Parameters
nIdThe player's identifier in the session.
Ghidra address:
NTSC-U/C: 0x00255ec0
Ghidra address:
PAL: 0x0025edd8

◆ RateGame()

void LaunchpadRT::RateGame ( const std::vector< NetGameScore > & scores)

Rate the players from the final scores of the game, and clear the rating.

The name is inferred.

Parameters
scoresThe final score of each player.
Ghidra address:
NTSC-U/C: 0x00256010
Ghidra address:
PAL: 0x0025ef28

◆ UpdateRating()

void LaunchpadRT::UpdateRating ( )

Rate the player of this console from mRatings and publish the rating.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x00256120
Ghidra address:
PAL: 0x0025f038

◆ Exit()

void LaunchpadRT::Exit ( MsgSink * pSink,
int nReason )

End the game and start mExitTask.

The name is inferred.

Parameters
pSinkThe sink that receives the end of the session.
nReasonA LaunchpadAbortedMsg::Reason, or 0.
Ghidra address:
NTSC-U/C: 0x00256178
Ghidra address:
PAL: 0x0025f090

◆ FindIdByAccount()

int LaunchpadRT::FindIdByAccount ( int nAccountId)

Find the identifier in the session of an account.

The name is inferred.

Parameters
nAccountIdThe account.
Returns
The identifier, or kNoId.
Ghidra address:
NTSC-U/C: 0x00256290
Ghidra address:
PAL: 0x0025f1a8

◆ Abort()

void LaunchpadRT::Abort ( int nReason)

Exit the session for mGameSink.

The name is inferred.

Parameters
nReasonA LaunchpadAbortedMsg::Reason.
Ghidra address:
NTSC-U/C: 0x002562d0
Ghidra address:
PAL: 0x0025f1e8

◆ Send()

void LaunchpadRT::Send ( Packet * pPacket)

Encrypt a packet and send it to the consoles its receiver selects.

Parameters
pPacketThe packet.
Ghidra address:
NTSC-U/C: 0x002562f0
Ghidra address:
PAL: 0x0025f208

◆ Leave()

void LaunchpadRT::Leave ( )

Leave the game and tell the other consoles.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x002565d8
Ghidra address:
PAL: 0x0025f4e0

◆ PlayersChanged()

void LaunchpadRT::PlayersChanged ( )

Count a change of the players.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x00256650
Ghidra address:
PAL: 0x0025f558

◆ CheckReady()

void LaunchpadRT::CheckReady ( )

Report this console ready once the session is active and synced.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x00256668
Ghidra address:
PAL: 0x0025f570

◆ OnMsg() [1/6]

bool LaunchpadRT::OnMsg ( ClientStatusPkt * pPkt)

Take the state of a player.

Parameters
pPktThe packet.
Returns
False.
Ghidra address:
NTSC-U/C: 0x00256760
Ghidra address:
PAL: 0x0025f668

◆ OnMsg() [2/6]

bool LaunchpadRT::OnMsg ( ClientRatingPkt * pPkt)

Take the rating of a player.

Parameters
pPktThe packet.
Returns
False.
Ghidra address:
NTSC-U/C: 0x002567b0
Ghidra address:
PAL: 0x0025f6b8

◆ OnMsg() [3/6]

bool LaunchpadRT::OnMsg ( LoadGamePkt * pPkt)

Enter the game, and tell mGameSink to load the song.

Parameters
pPktThe packet.
Returns
False.
Ghidra address:
NTSC-U/C: 0x00256830
Ghidra address:
PAL: 0x0025f738

◆ OnMsg() [4/6]

bool LaunchpadRT::OnMsg ( StartGamePkt * pPkt)

Take the time the song starts at and the seed of the game.

Parameters
pPktThe packet.
Returns
False.
Ghidra address:
NTSC-U/C: 0x002568b8
Ghidra address:
PAL: 0x0025f7c0

◆ OnMsg() [5/6]

bool LaunchpadRT::OnMsg ( ClientAbortedPkt * pPkt)

Drop a player who exited the game, and end the game when the host exited.

Parameters
pPktThe packet.
Returns
False.
Ghidra address:
NTSC-U/C: 0x00256940
Ghidra address:
PAL: 0x0025f848

◆ OnMsg() [6/6]

bool LaunchpadRT::OnMsg ( UpdateRanksPkt * pPkt)

Take the ranks of the players.

Parameters
pPktThe packet.
Returns
False.
Ghidra address:
NTSC-U/C: 0x00256a48
Ghidra address:
PAL: 0x0025f950

◆ RegisterMessages()

int LaunchpadRT::RegisterMessages ( )
static

Register the packets of the session with the session library.

The name is inferred.

Returns
0, or an error code of the library.
Ghidra address:
NTSC-U/C: 0x00254c90
Ghidra address:
PAL: 0x0025dba8

◆ SetMgclReady()

void LaunchpadRT::SetMgclReady ( int nReady)
static

Set sMgclReady.

The name is inferred.

Parameters
nReadyNon-zero once the game server library is ready.
Ghidra address:
NTSC-U/C: 0x00254ce0
Ghidra address:
PAL: 0x0025dbf8

◆ IsMgclReady()

int LaunchpadRT::IsMgclReady ( )
static

Report sMgclReady.

The name is inferred.

Returns
Non-zero once the game server library is ready.
Ghidra address:
NTSC-U/C: 0x00254cf0
Ghidra address:
PAL: 0x0025dc08

◆ GetNetTask()

NetTask * LaunchpadRT::GetNetTask ( )
inlinestatic
Returns
The NetHostTask or NetConnectTask that waits for OnNetConnect(), or null.

◆ SetNetTask()

void LaunchpadRT::SetNetTask ( NetTask * pTask)
inlinestatic
Parameters
pTaskThe NetHostTask or NetConnectTask that waits for OnNetConnect(), or null.

◆ DecodeByte()

unsigned char LaunchpadRT::DecodeByte ( const char * pszText)
static

Read a byte EncodeByte() wrote.

Each character is a digit offset from '0' by one half of the byte. The name is inferred.

Parameters
pszTextThe two characters.
Returns
The byte.
Ghidra address:
NTSC-U/C: 0x00254d00
Ghidra address:
PAL: 0x0025dc18

◆ EncodeByte()

void LaunchpadRT::EncodeByte ( char * pszText,
unsigned char nByte )
static

Write a byte as two characters and a terminator.

The name is inferred.

Parameters
pszTextReceives the three characters.
nByteThe byte.
Ghidra address:
NTSC-U/C: 0x00254d20
Ghidra address:
PAL: 0x0025dc38

◆ FindScore()

int LaunchpadRT::FindScore ( const std::vector< NetGameScore > & scores,
int nId )
static

Report the score of a player in the final scores.

The name is inferred.

Parameters
scoresThe final score of each player.
nIdThe player's identifier in the session.
Returns
The score, or 0 when the player has none.
Ghidra address:
NTSC-U/C: 0x00255fd0
Ghidra address:
PAL: 0x0025eee8

◆ GetWorldId()

int LaunchpadRT::GetWorldId ( ) const
inline
Returns
The session on the game server, or kNoWorld.

◆ SetWorldId()

void LaunchpadRT::SetWorldId ( int nValue)
inline
Parameters
nValueThe session on the game server, or kNoWorld.

◆ GetConnectionInfo()

const rtNetConnectionInfo & LaunchpadRT::GetConnectionInfo ( ) const
inline
Returns
The connection to the session.

◆ SetConnectionInfo()

void LaunchpadRT::SetConnectionInfo ( const rtNetConnectionInfo & info)
inline
Parameters
infoThe connection to the session.

◆ GetConnection()

int LaunchpadRT::GetConnection ( ) const
inline
Returns
The connection of the session library, or -1.

◆ SetConnection()

void LaunchpadRT::SetConnection ( int nValue)
inline
Parameters
nValueThe connection of the session library, or -1.

◆ GetLocalId()

int LaunchpadRT::GetLocalId ( ) const
inline
Returns
The identifier of this console, or kNoId.

◆ SetLocalIdValue()

void LaunchpadRT::SetLocalIdValue ( int nValue)
inline
Parameters
nValueThe identifier of this console, or kNoId.

◆ GetState()

int LaunchpadRT::GetState ( ) const
inline
Returns
One of State.

◆ SetState()

void LaunchpadRT::SetState ( int nValue)
inline
Parameters
nValueOne of State.

◆ GetError()

int LaunchpadRT::GetError ( ) const
inline
Returns
Why the host turned the console away.

◆ SetError()

void LaunchpadRT::SetError ( int nValue)
inline
Parameters
nValueWhy the host turned the console away.

◆ GetGameSink()

MsgSink * LaunchpadRT::GetGameSink ( ) const
inline
Returns
The sink that receives the messages of the session. Borrowed.

◆ GetPlayersList()

std::list< NetLaunchpadPlayer > & LaunchpadRT::GetPlayersList ( )
inline
Returns
The players, in the order of their colours.

◆ GetClients()

const std::vector< int > & LaunchpadRT::GetClients ( ) const
inline
Returns
The consoles AddClient() noted.

◆ Receive()

int LaunchpadRT::Receive ( int nConnection,
int nType,
int nSender,
rtDmeMessage * pMessage )
static

Receive a message of the session, the handler rtDmeRegisterMessageHandler() registers.

The routine decrypts the message, reads the packet, and passes it to the receivers its Packet::Route() selects.

Parameters
nConnectionThe connection.
nTypeThe registered type.
nSenderThe peer that sent the message.
pMessageThe message.
Returns
The number of bytes consumed, the length and 2.
Ghidra address:
NTSC-U/C: 0x00256440
Ghidra address:
PAL: 0x0025f348

◆ OnNetConnect()

void LaunchpadRT::OnNetConnect ( int nConnection,
int nReserved1,
int nReserved2,
int nStatus )
static

Receive the result of NetHostTask and NetConnectTask, and finish sNetTask.

The routine takes the identifier of this console from the session library. The host must have identifier kHostId and a guest must not. The name is inferred.

Parameters
nConnectionThe connection.
nReserved1Not read.
nReserved2Not read.
nStatus0 for success, otherwise an error of the library.
Ghidra address:
NTSC-U/C: 0x0025bd68
Ghidra address:
PAL: 0x00264dc0

◆ OnNetClientJoin()

void LaunchpadRT::OnNetClientJoin ( int nConnection,
int nClient,
const char * pszAddress )
static

Note a console that connected to the session.

The name is inferred.

Parameters
nConnectionThe connection.
nClientThe identifier of the console.
pszAddressThe address of the console. Not read.
Ghidra address:
NTSC-U/C: 0x0025be58
Ghidra address:
PAL: 0x00264eb0

◆ OnNetClientLeave()

void LaunchpadRT::OnNetClientLeave ( int nConnection,
int nClient,
const char * pszAddress )
static

Remove a console that left the session.

The name is inferred.

Parameters
nConnectionThe connection.
nClientThe identifier of the console.
pszAddressThe address the departure was reported for. Not read.
Ghidra address:
NTSC-U/C: 0x0025be90
Ghidra address:
PAL: 0x00264ee8

Member Data Documentation

◆ kHostId

int LaunchpadRT::kHostId = 0
staticconstexpr

The identifier of the host in the session.

◆ kNoId

int LaunchpadRT::kNoId = -2
staticconstexpr

The identifier of a console that has none yet.

◆ kNoWorld

int LaunchpadRT::kNoWorld = -1
staticconstexpr

The value of mWorldId and mConnection without a session.

◆ kKeyChannel

int LaunchpadRT::kKeyChannel = 4
staticconstexpr

The chat channel the session exchanges its key on.

◆ kKeySize

int LaunchpadRT::kKeySize = 16
staticconstexpr

The size of the key of the session in bytes.

◆ kMaxClients

int LaunchpadRT::kMaxClients = 5
staticconstexpr

The consoles a session takes on the session library and the game server.

◆ kGameHostPeerToPeer

int LaunchpadRT::kGameHostPeerToPeer = 2
staticconstexpr

The kind of host the session reports to the servers, a host among its peers.

◆ mWorldId

int LaunchpadRT::mWorldId
protected

The session on the game server, or kNoWorld.

◆ mConnectionInfo

rtNetConnectionInfo LaunchpadRT::mConnectionInfo
protected

The connection to the session.

◆ mConnection

int LaunchpadRT::mConnection
protected

The connection of the session library, or -1.

◆ mLocalId

int LaunchpadRT::mLocalId
protected

The identifier of this console, or kNoId.

◆ mState

int LaunchpadRT::mState
protected

One of State.

◆ mError

int LaunchpadRT::mError
protected

Why the host turned the console away.

◆ mGameSink

MsgSink* LaunchpadRT::mGameSink
protected

The sink that receives the session's messages. Borrowed.

◆ mConnectTask

NetMultiTask LaunchpadRT::mConnectTask
protected

The request that connects to the session.

◆ mExitTask

NetMultiTask LaunchpadRT::mExitTask
protected

The request that exits the session.

◆ mRankTask

NetMultiTask LaunchpadRT::mRankTask
protected

The request for the ladder position after a game.

◆ mPlayerReport

PeriodicTask LaunchpadRT::mPlayerReport
protected

The report of the player to the game server.

◆ mTasks

TaskList LaunchpadRT::mTasks
protected

Further requests that run side by side.

◆ mPlayers

std::list<NetLaunchpadPlayer> LaunchpadRT::mPlayers
protected

The players, in the order of their colours.

◆ mStartTime

float LaunchpadRT::mStartTime
protected

The clock of the session the song starts at.

◆ mSeed

int LaunchpadRT::mSeed
protected

The seed of the game.

◆ mActive

int LaunchpadRT::mActive
protected

Non-zero once Activate() ran.

◆ mShareOnly

int LaunchpadRT::mShareOnly
protected

The share-only flag of the remix of the game.

◆ mStarting

int LaunchpadRT::mStarting
protected

Non-zero while the song is about to start.

◆ mInGame

int LaunchpadRT::mInGame
protected

Non-zero during the game.

◆ mClients

std::vector<int> LaunchpadRT::mClients
protected

The consoles AddClient() noted.

◆ mRatings

std::vector<RatingStat> LaunchpadRT::mRatings
protected

The rating of the game, while it runs.


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