Skip to main content
Version: 5.7.0

RunPeerScriptAsync

Run a cloud script asynchronously in a peer app.

tip

The result of the script run can be observed via the portal page for Queued Jobs.

ServiceOperation
scriptRUN_PEER_SCRIPT_ASYNC

Method Parameters

ParameterDescription
scriptNameThe name of the script with its absolute path to be run.
scriptDataData to be sent to the script in json format.
peerIdentifies the peer app.

Usage

http://localhost:3000
string scriptName = "path/to/script1";
string scriptData = "{\"parm\":\"value\"}";
string peer = "serviceCode";
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.ScriptService.RunPeerScriptAsync(scriptName, scriptData, peer, successCallback, failureCallback);
JSON Response
{
"status": 200,
"data": {
"result": {},
"scriptName": "testScript",
"jobId": "48266b95-d197-464d-bb6b-da70aa1e22a9",
"runState": "Scheduled",
"description": null,
"gameId": "10170",
"runEndTime": 0,
"parameters": {
"testParm1": 1
},
"runStartTime": 0,
"scheduledStartTime": 1437576422378
}
}