ReadMatchHistory
Returns the match history of the given match.
Service | Operation |
---|---|
asyncMatch | READ_MATCH_HISTORY |
Method Parameters
Parameter | Description |
---|---|
ownerId | Match owner identifier |
matchId | Match identifier |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string ownerId = "internalPlayerId";
string matchId = "matchId";
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.ReadMatchHistory(ownerId, matchId, successCallback, failureCallback);
const char *ownerId = "internalPlayerId";
const char *matchId = "matchId";
_bc->getAsyncMatchService()->readMatchHistory(ownerId, matchId, this);
NSString *ownerId = @"internalPlayerId";
NSString *matchId = @"matchId";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc asyncMatchService] readMatchHistory:ownerId
matchId:matchId
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String ownerId = "internalPlayerId";
String matchId = "matchId";
this; // implements IServerCallback
_bc.getAsyncMatchService().readMatchHistory(ownerId, matchId, this);
public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
System.out.print(String.format("Failed | %d %d %s", statusCode, reasonCode, jsonError.toString()));
}
var ownerId = "internalPlayerId";
var matchId = "matchId";
_bc.asyncMatch.readMatchHistory(ownerId, matchId, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var ownerId = "internalPlayerId";
var matchId = "matchId";
ServerResponse result = await _bc.asyncMatchService.readMatchHistory(ownerId:ownerId, matchId:matchId);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var ownerId = "internalPlayerId";
var matchId = "matchId";
var asyncMatchProxy = bridge.getAsyncMatchServiceProxy();
var postResult = asyncMatchProxy.readMatchHistory(ownerId, matchId);
if (postResult.status == 200) {
// Success!
}
{
"service": "asyncMatch",
"operation": "READ_MATCH_HISTORY",
"data": {
"ownerId": "the-owner-id",
"matchId": "the-match-id"
}
}
JSON Response
{
"status": 200,
"data": {
"gameId": "14577",
"ownerId": "2bd32bc6-c2ec-4916-a1a8-02b7a38540ad",
"matchId": "1aac24b2-7976-4fd7-b7c6-44d32e6d26a4",
"turns": [
{
"playerId": "2bd32bc6-c2ec-4916-a1a8-02b7a38540ad",
"matchState": {
"color": "red"
},
"createdAt": 1442507319697
},
{
"playerId": "11c9324d-9ed1-416d-b124-5228c1efafac",
"matchState": {},
"createdAt": 1442507703667
}
]
}
}