Minigames

From PSwiki
Jump to navigation Jump to search

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()