|
wavelength 1.0.0
|
The online session of a console that hosts it. More...
#include <hostpadrt.h>


Classes | |
| struct | ClientClr |
| The colour of a slot of the session and the player who holds it. More... | |
| class | ClientData |
| The rank and the rating of a player, from which the host ranks the players. More... | |
Public Member Functions | |
| HostpadRT (MsgSink *pScreen, MsgSink *pGame) | |
| Construct the session, draw its key, and start mConnectTask. | |
| ~HostpadRT () override | |
| Stop mShareTask and clear TheHostpadRT. | |
| void | EndEdit () override |
| Take the settings of the game again and publish them once the remix name is filtered. | |
| bool | ShareRemix () override |
| Share the remix of the game with the guests only. | |
| int | Launch () override |
| Load the song on every console once every player is ready. | |
| void | BootPlayer (int nPlayer) override |
| Ban a guest from the session and remove the guest. | |
| void | ReportNow () override |
| Send the reports to the game server at the next poll. | |
| void | SetLocalId (int nId) override |
| Take the identifier of this console and enter the host as the first player. | |
| void | AddClient (int nId) override |
| Welcome a console that connected, or turn it away. | |
| void | RemovePlayer (int nId) override |
| Free the colour of a player who left, and forget the player. | |
| float | GetTime () override |
| Report the clock of this console, the clock of the session. | |
| void | OnConnected () override |
| Report HostLaunchpadSuccessMsg to the sink of mConnectTask. | |
| void | PollPriv () override |
| Poll the reports and the share, and watch the connection to the game server. | |
| void | EndGame () override |
| Leave the game and send the reports. | |
| void | SendRating (int nRank) override |
| Send the rating of the host and note it in mClientData. | |
| bool | DispatchPriv (Message *pMsg) override |
| Act on a packet of the session, before LaunchpadRT does. | |
| void | SendGameParams () |
| Send the settings of the game to every console, and send the world report at the next poll. | |
| bool | StartShare (int nShareOnly) |
| Share the remix of the game with every guest once every player is ready. | |
| void | Kick (int nId, int nBan) |
| Remove a guest from the session, and ban the guest from the game server first. | |
| void | SendScores (const std::vector< NetGameScore > &scores) |
| Send the final scores to every console, rate the game, and leave it. | |
| void | PollStart () |
| Start the song once every console loaded it, and remove the consoles too slow to load. | |
| void | KickUnloaded () |
| Remove every guest that has not loaded the song. | |
| void | PollShare () |
| Send the next block of the remix once every guest acknowledged the last, and remove the guests too slow to. | |
| int | CanJoin () |
| Report whether the session takes another player. | |
| int | GetWorldStatus () |
| Report the state of the session for the game server. | |
| int | AssignColor (int nId) |
| Give a player the first free colour. | |
| void | FreeColor (int nId) |
| Free the colour of a player. | |
| void | SendRanks () |
| Rank the players by rating and send the ranks to every console. | |
| bool | OnMsg (ClientInfoPkt *pPkt) |
| Enter a console whose player arrived, or remove it when the session is full. | |
| bool | OnMsg (TimeRequestPkt *pPkt) |
| Answer the clock of the session. | |
| bool | OnMsg (DataAckPkt *pPkt) |
| Note a guest that received the last block of the remix. | |
| bool | OnMsg (ChatMsg *pMsg) |
| Send the key of the session to the account that requested it. | |
| bool | OnMsg (ClientRatingPkt *pPkt) |
| Take the rating of a player and send the ranks again. | |
| int | GetMgclConnected () const |
| void | SetMgclConnected (int nValue) |
| int | GetLost () const |
| const rtNetConnectionInfo & | GetServerInfo () const |
| void | SetServerInfo (const rtNetConnectionInfo &info) |
| const String & | GetSessionKey () const |
| void | SetSessionKey (const char *pszSessionKey) |
| NetGameParams & | GetParams () |
| const NetGameParams & | GetParams () const |
| NetMultiTask & | GetShareTask () |
| int | GetSharing () const |
| void | SetSharing (int nValue) |
| bool | OnMsg (ClientStatusPkt *pPkt) |
| Take the state 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. | |
| Public Member Functions inherited from LaunchpadRT | |
| 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. | |
| 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 | ~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 void | Create (MsgSink *pScreen, MsgSink *pGame) |
| Start hosting a session. | |
| Static Public Member Functions inherited from LaunchpadRT | |
| 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 | kMaxPlayers = 4 |
| The number of slots of a session. | |
| Static Public Attributes inherited from LaunchpadRT | |
| 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. | |
Additional Inherited Members | |
| Public Types inherited from LaunchpadRT | |
| 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... | |
| Protected Attributes inherited from LaunchpadRT | |
| 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 |
The online session of a console that hosts it.
The RTTI records the class as deriving from LaunchpadRT. The vtables are at 0x003d4698 and 0x003d4670, and the object is 0x328 bytes. The constructor stores the instance in TheHostpadRT. The host hands out the colours of the players, publishes the settings of the game, shares the remix of the game in blocks, and starts the song once every console loaded it.
Construct the session, draw its key, and start mConnectTask.
| pScreen | The screen that receives the result of the attempt. |
| pGame | The sink that receives the messages of the session. |
|
override |
Stop mShareTask and clear TheHostpadRT.
Start hosting a session.
| pScreen | The screen that receives the result of the attempt. |
| pGame | The sink that receives the messages of the session. |
|
overridevirtual |
Take the settings of the game again and publish them once the remix name is filtered.
Reimplemented from NetLaunchpad.
|
overridevirtual |
Share the remix of the game with the guests only.
Reimplemented from NetLaunchpad.
|
overridevirtual |
Load the song on every console once every player is ready.
A game of a saved remix first shares the remix.
Reimplemented from NetLaunchpad.
|
overridevirtual |
Ban a guest from the session and remove the guest.
| nPlayer | The guest. |
Reimplemented from NetLaunchpad.
|
overridevirtual |
Send the reports to the game server at the next poll.
Reimplemented from LaunchpadRT.
|
overridevirtual |
Take the identifier of this console and enter the host as the first player.
| nId | The identifier. |
Reimplemented from LaunchpadRT.
|
overridevirtual |
Welcome a console that connected, or turn it away.
| nId | The identifier of the console. |
Reimplemented from LaunchpadRT.
|
overridevirtual |
Free the colour of a player who left, and forget the player.
| nId | The player's identifier in the session. |
Reimplemented from LaunchpadRT.
|
overridevirtual |
Report the clock of this console, the clock of the session.
Implements LaunchpadRT.
|
overridevirtual |
Report HostLaunchpadSuccessMsg to the sink of mConnectTask.
Implements LaunchpadRT.
|
overridevirtual |
Poll the reports and the share, and watch the connection to the game server.
Implements LaunchpadRT.
|
overridevirtual |
Leave the game and send the reports.
Reimplemented from LaunchpadRT.
|
overridevirtual |
Send the rating of the host and note it in mClientData.
| nRank | The position of the host in the ranking. |
Reimplemented from LaunchpadRT.
|
overridevirtual |
Act on a packet of the session, before LaunchpadRT does.
| pMsg | The message. |
Implements MsgSink.
| void HostpadRT::SendGameParams | ( | ) |
Send the settings of the game to every console, and send the world report at the next poll.
The name is inferred.
| bool HostpadRT::StartShare | ( | int | nShareOnly | ) |
Share the remix of the game with every guest once every player is ready.
The name is inferred.
| nShareOnly | Non-zero when the remix is only shared, not played. |
| void HostpadRT::Kick | ( | int | nId, |
| int | nBan ) |
Remove a guest from the session, and ban the guest from the game server first.
The name is inferred.
| nId | The guest's identifier in the session. |
| nBan | Non-zero to ban the guest. |
| void HostpadRT::SendScores | ( | const std::vector< NetGameScore > & | scores | ) |
Send the final scores to every console, rate the game, and leave it.
The name is inferred.
| scores | The final score of each player. |
| void HostpadRT::PollStart | ( | ) |
Start the song once every console loaded it, and remove the consoles too slow to load.
The name is inferred.
| void HostpadRT::KickUnloaded | ( | ) |
Remove every guest that has not loaded the song.
The name is inferred.
| void HostpadRT::PollShare | ( | ) |
Send the next block of the remix once every guest acknowledged the last, and remove the guests too slow to.
The name is inferred.
| int HostpadRT::CanJoin | ( | ) |
Report whether the session takes another player.
The name is inferred.
| int HostpadRT::GetWorldStatus | ( | ) |
Report the state of the session for the game server.
The name is inferred.
| int HostpadRT::AssignColor | ( | int | nId | ) |
Give a player the first free colour.
The name is inferred.
| nId | The player's identifier in the session. |
| void HostpadRT::FreeColor | ( | int | nId | ) |
Free the colour of a player.
The name is inferred.
| nId | The player's identifier in the session. |
| void HostpadRT::SendRanks | ( | ) |
Rank the players by rating and send the ranks to every console.
The name is inferred.
| bool HostpadRT::OnMsg | ( | ClientInfoPkt * | pPkt | ) |
Enter a console whose player arrived, or remove it when the session is full.
| pPkt | The packet. |
| bool HostpadRT::OnMsg | ( | TimeRequestPkt * | pPkt | ) |
Answer the clock of the session.
| pPkt | The packet. |
| bool HostpadRT::OnMsg | ( | DataAckPkt * | pPkt | ) |
Note a guest that received the last block of the remix.
| pPkt | The packet. |
| bool HostpadRT::OnMsg | ( | ChatMsg * | pMsg | ) |
Send the key of the session to the account that requested it.
| pMsg | The message. |
| bool HostpadRT::OnMsg | ( | ClientRatingPkt * | pPkt | ) |
Take the rating of a player and send the ranks again.
| pPkt | The packet. |
|
inline |
|
inline |
| nValue | Non-zero while the game server library is connected. |
|
inline |
|
inline |
|
inline |
| info | The game server the authentication returned. |
|
inline |
|
inline |
| pszSessionKey | The key of the session on the game server. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| nValue | Non-zero while the remix is shared. |
| bool LaunchpadRT::OnMsg | ( | ClientStatusPkt * | pPkt | ) |
Take the state of a player.
| pPkt | The packet. |
| bool LaunchpadRT::OnMsg | ( | LoadGamePkt * | pPkt | ) |
Enter the game, and tell mGameSink to load the song.
| pPkt | The packet. |
| bool LaunchpadRT::OnMsg | ( | StartGamePkt * | pPkt | ) |
Take the time the song starts at and the seed of the game.
| pPkt | The packet. |
| bool LaunchpadRT::OnMsg | ( | ClientAbortedPkt * | pPkt | ) |
Drop a player who exited the game, and end the game when the host exited.
| pPkt | The packet. |
| bool LaunchpadRT::OnMsg | ( | UpdateRanksPkt * | pPkt | ) |
Take the ranks of the players.
| pPkt | The packet. |
|
staticconstexpr |
The number of slots of a session.