I wrote some cloud code for ChallengeEvent. and I create a request in another cloud script using SparkRequests.
I'm facing two issues here.
1. As I couldn't find documentation on SparkRequests, I tried few ways.
var challengeEventRequest = new SparkRequests.LogCha
var challengeEventRequest = new SparkRequests.LogChallengeEventRequest();
challengeEventRequest.challengeInstanceId = instanceId;
challengeEventRequest.eventKey = eventName;
if(ASYNC_CHALLENGE_EVENT_ATTRIBUTE_KEY === eventAttributeName)
{
challengeEventRequest.SCORES_PER_TURN_ATTRIBUTE = JSON.stringify(scriptInfo);
}
//Send the request.
var response = challengeEventRequest.Send();
In above code, I saved my challenge event keys in a module and fetching the values from there. But I'm getting a runtime error because Its not taking the expected key for challenge event attribute.
The later statement actually breaking my code's modularity. Please let me know if any possible solution in this aspect.
2. SparkRequests call is not going through the cloud code for request and responses I created. This I see is very much important for issuing requests in cloud code. Im sure I might be missing something in this aspect. Please help me out.
Ayyappa R
Hi,
I wrote some cloud code for ChallengeEvent. and I create a request in another cloud script using SparkRequests.
I'm facing two issues here.
1. As I couldn't find documentation on SparkRequests, I tried few ways.
var challengeEventRequest = new SparkRequests.LogCha
In above code, I saved my challenge event keys in a module and fetching the values from there. But I'm getting a runtime error because Its not taking the expected key for challenge event attribute.
How can i write some thing like this.
challengeEventRequest.eventAttributeName= JSON.stringify(scriptInfo);
instead of
challengeEventRequest.SCORES_PER_TURN_ATTRIBUTE = JSON.stringify(scriptInfo);
The later statement actually breaking my code's modularity. Please let me know if any possible solution in this aspect.
2. SparkRequests call is not going through the cloud code for request and responses I created. This I see is very much important for issuing requests in cloud code. Im sure I might be missing something in this aspect. Please help me out.
Thanks.
Answer for first question SparkRequests Doc
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstAyyappa R
Second problem I mentioned in above question was answered here - Cloud Code execution not possible from cloud scripts to avoid infinite loop.
I wish GameSparks answers if any solutions available for 1st point.
Ayyappa R
Answer for first question SparkRequests Doc
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics