TurnBasedMatches: takeTurn

Requires authorization

Commit the results of a player turn. Try it now.

Request

HTTP request

PUT https://www.googleapis.com/games/v1/turnbasedmatches/matchId/turn

Parameters

Parameter name Value Description
Path parameters
matchId string The ID of the match.
Optional query parameters
consistencyToken long The last-seen mutation timestamp.
language string The preferred language to use for strings returned by this method.

Authorization

This request requires authorization with the following scope (read more about authentication and authorization).

Scope
https://www.googleapis.com/auth/games

Request body

In the request body, supply data with the following structure:

{
  "kind": "games#turnBasedMatchTurn",
  "data": {
    "kind": "games#turnBasedMatchDataRequest",
    "data": bytes
  },
  "pendingParticipantId": string,
  "matchVersion": integer,
  "results": [
    {
      "kind": "games#participantResult",
      "participantId": string,
      "result": string,
      "placing": integer
    }
  ]
}
Property name Value Description Notes
kind string Uniquely identifies the type of this resource. Value is always the fixed string games#turnBasedMatchTurn.
data nested object The shared game state data after the turn is over.
data.kind string Uniquely identifies the type of this resource. Value is always the fixed string games#turnBasedMatchDataRequest.
data.data bytes The byte representation of the data (limited to 128 kB), as a Base64-encoded string with the URL_SAFE encoding option.
pendingParticipantId string The ID of the participant who should take their turn next. May be set to the current player's participant ID to update match state without changing the turn. If not set, the match will wait for other player(s) to join via automatching; this is only valid if automatch criteria is set on the match with remaining slots for automatched players.
matchVersion integer The version of this match: an increasing counter, used to avoid out-of-date updates to the match.
results[] list The match results for the participants in the match.
results[].kind string Uniquely identifies the type of this resource. Value is always the fixed string games#participantResult.
results[].participantId string The ID of the participant.
results[].result string The result of the participant for this match.
Possible values are:
  • "MATCH_RESULT_WIN" - The participant won the match.
  • "MATCH_RESULT_LOSS" - The participant lost the match.
  • "MATCH_RESULT_TIE" - The participant tied the match.
  • "MATCH_RESULT_NONE" - There was no winner for the match (nobody wins or loses this kind of game.)
  • "MATCH_RESULT_DISCONNECT" - The participant disconnected / left during the match.
  • "MATCH_RESULT_DISAGREED" - Different clients reported different results for this participant.


Acceptable values are:
  • "MATCH_RESULT_DISAGREED"
  • "MATCH_RESULT_DISCONNECT"
  • "MATCH_RESULT_LOSS"
  • "MATCH_RESULT_NONE"
  • "MATCH_RESULT_TIE"
  • "MATCH_RESULT_WIN"
results[].placing integer The placement or ranking of the participant in the match results; a number from one to the number of participants in the match. Multiple participants may have the same placing value in case of a type.

Response

If successful, this method returns a TurnBasedMatches resource in the response body.

Try it!

Use the APIs Explorer below to call this method on live data and see the response.

Enviar comentarios sobre…

Play Games Services for Web
Play Games Services for Web