Skip to main content

cut_for_deal

Function cut_for_deal 

Source
pub async fn cut_for_deal(
    server_state: ServerState,
    user_id: UserId,
    game_id: GameId,
) -> Result<(), ServerError>
Expand description

Performs the “cut for deal” action for a user in a specific game.

This function represents the step where a user cuts the deck to determine the dealer for the game. It updates the server state accordingly.

§Parameters

  • server_state: The shared server state containing the game and database.
  • user_id: The ID of the user performing the cut.
  • game_id: The ID of the game in which the cut is performed.

§Returns

Returns Ok(()) on success. Returns a ServerError if the action is forbidden, the game is not found, or another internal error occurs.