Minigames: Difference between revisions

From PSwiki
Jump to navigation Jump to search
No edit summary
 
Line 30: Line 30:
   SERVER:          psMiniGameSession::Send()
   SERVER:          psMiniGameSession::Send()
   CLIENT: ReceiveMGBoardMessage()
   CLIENT: ReceiveMGBoardMessage()
  CLIENT: UpsGameBoard::HandleMessage()
  CLIENT: UpsGameBoard::UpdateBoard()

Latest revision as of 23:43, 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()
 CLIENT: UpsGameBoard::HandleMessage()
 CLIENT: UpsGameBoard::UpdateBoard()