Skip to main content
Version: 5.7.0

UpdateMatchStateCurrentTurn

Allows the current player to overwrite the matchState and the statistics, without completing the turn for the given match (does not add to match history).

ServiceOperation
asyncMatchUPDATE_MATCH_STATE_CURRENT_TURN

Method Parameters

ParameterDescription
ownerIdThe match owner id.
matchIdThe match id.
versionGame state version being updated, to ensure data integrity.
matchStateJSON object provided by the caller. Overwrites the 'matchState'.
statisticsOptional JSON object provided by the caller. Overwrites the 'statistics'.

Usage

http://localhost:3000
string ownerId = "the-owner-id";
string matchId = "the-match-id";
int version = 1;
string matchState = "{\"map\": \"level1\"}";
string statistics = "{\"statsName\": \"statValue\"}";

SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};

_bc.AsyncmatchService.UpdateMatchStateCurrentTurn(ownerId, matchId, version, matchState, statistics, successCallback, failureCallback);
JSON Response
{
"data": {
"gameId": "23782",
"ownerId": "37627832-0b5d-4e6f-9a8c-a91a6455a109",
"matchId": "8e03f28c-06d0-4f9f-83c8-089965e9501b",
"version": 2,
"status": {
"status": "PENDING",
"currentPlayer": "c5ecdbda-5f91-41a9-96aa-174f412f7657"
},
"summary": {
"Address": "South Africa"
},
"createdAt": 1709832525081,
"updatedAt": 1709833092604
},
"status": 200
}