Skip to main content
Version: 5.7.0

SubmitTurn

Submits a turn for the given match.

ServiceOperation
asyncMatchSUBMIT_TURN

Method Parameters

ParameterDescription
ownerIdMatch owner identifier
matchIdMatch identifier
versionGame state version to ensure turns are submitted once and in order
jsonMatchStateJSON object provided by the caller
pushNotificationMessageOptional push notification message to send to the other party. Refer to the Push Notification functions for the syntax required.
nextPlayerOptionally, force the next player player to be a specific player
jsonSummaryOptional JSON object defining what the other player will see as a summary of the game when listing their games
jsonStatisticsOptional JSON object provided by the caller

Usage

http://localhost:3000
string ownerId = "internalPlayerId";
string matchId = "matchId";
string jsonMatchState = "{}";
string pushNotificationMessage = "You have been entered into an async-match!";
string nextPlayer = "player2Id";
string jsonSummary = "{\"Address\":\"South Africa\"}";
string jsonStatistics = "{\"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.SubmitTurn(ownerId, matchId, version, jsonMatchState, pushNotificationMessage, nextPlayer, jsonSummary, jsonStatistics, successCallback, failureCallback);
JSON Response
{
"data" : {
"createdAt" : 1449737412088,
"gameId" : "102345",
"matchId" : "af876cc7-1dd1-4fbe-959d-a9awdsab9a1c",
"ownerId" : "c76009c3-ea92-41c5-8560-e1dwasc07ce6b",
"players" : [
{
"pictureUrl" : null,
"playerId" : "c76009c3-ea92-41c5-8560-e1dwasc07ce6b",
"playerName" : "UserA_CPP_96764398",
"summaryFriendData": null
},
{
"pictureUrl" : null,
"playerId" : "3bb9dwasdd-9c9a-454f-ae17-9703a66973c8",
"playerName" : "UserB_CPP_80148460",
"summaryFriendData": null
}
],
"status" : {
"currentPlayer" : "3bb9dwasdd-9c9a-454f-ae17-9703a66973c8",
"status" : "PENDING"
},
"summary" : {
"map" : "level01"
},
"updatedAt" : 1449737412092,
"version" : 1
},
"status" : 200
}