Minigames: Difference between revisions

From PSwiki
Jump to navigation Jump to search
Created page with "All minigames use GameboardsTable to define the basics of the game. Minigamemanager is called by the client to initiate a game with the following server-side methods MiniGameManager::HandleStartGameRequest() psMiniGameSession::AddPlayer() psMiniGameSession::SendInitialMGSetup() GetPSController()->ReceiveMGInitialBoardSetup() Then the client receives the request in PlayerController and displays the minigame window, and differs by game ty..."
 
Line 20: Line 20:
     UpsGameBoard::UpdateBoard()
     UpsGameBoard::UpdateBoard()
       UpsGameBoard::SetupBoard()
       UpsGameBoard::SetupBoard()
Then when the client executes a move, this happens
  CLIENT: UpsGameTile::NativeOnDrop()
  CLIENT:  UpsGameBoard::DropPiece()
  SERVER: playercontroller::HandleGameUpdate()
  SERVER:    MiniGameManager::HandleGameUpdate()
  SERVER:      psMiniGameSession::Update()
  SERVER:        psMiniGameSession::Broadcast()
  SERVER:          psMiniGameSession::Send()
  CLIENT: ReceiveMGBoardMessage()

Revision as of 23:25, 21 December 2022

All minigames use GameboardsTable to define the basics of the game.

Minigamemanager is called by the client to initiate a game with the following server-side methods

 MiniGameManager::HandleStartGameRequest()
      psMiniGameSession::AddPlayer()
        psMiniGameSession::SendInitialMGSetup()
          GetPSController()->ReceiveMGInitialBoardSetup()

Then the client receives the request in PlayerController and displays the minigame window, and differs by game type (see below)

Available minigame types

Dice cup game

Has GameboardsTable.gameType = "dicecup"

Board game

Has GameboardsTable.gameType = "gameboard"

Client side we call

UpsGameBoard::HandleMessage()
   UpsGameBoard::UpdateBoard()
      UpsGameBoard::SetupBoard()

Then when the client executes a move, this happens

 CLIENT: UpsGameTile::NativeOnDrop()
 CLIENT:   UpsGameBoard::DropPiece()
 SERVER: playercontroller::HandleGameUpdate()
 SERVER:    MiniGameManager::HandleGameUpdate()
 SERVER:      psMiniGameSession::Update()
 SERVER:        psMiniGameSession::Broadcast()
 SERVER:          psMiniGameSession::Send()
 CLIENT: ReceiveMGBoardMessage()