How to I alter the challenge list in ListChallengeResponse?
R
Rich Joslin
started a topic
about 7 years ago
I'd like to intercept the list of challenges that ListChallengeResponse sends to the client using Cloud Code, and then add the name of the next player to each challenge before it gets sent back to the client.
I understand how to add Cloud Script to ListChallengeResponse, but I don't know the classes to use to inspect/alter the response values already created.
Best Answer
R
Rich Joslin
said
about 7 years ago
I understand I can add more data in the separate ScriptData element, but I was hoping I could directly add to a property in the challenge object being returned.
But I did discover that the "Challenged" array already holds the information I was looking for (opponents usernames etc), so that solves my immediate problem anyway.
I understand I can add more data in the separate ScriptData element, but I was hoping I could directly add to a property in the challenge object being returned.
But I did discover that the "Challenged" array already holds the information I was looking for (opponents usernames etc), so that solves my immediate problem anyway.
Customer Support
said
about 7 years ago
Hey Rich,
You could send extra script-data back in the ListChallengeResponse cloud code, just as you would in any other event...
Rich Joslin
I'd like to intercept the list of challenges that ListChallengeResponse sends to the client using Cloud Code, and then add the name of the next player to each challenge before it gets sent back to the client.
I understand how to add Cloud Script to ListChallengeResponse, but I don't know the classes to use to inspect/alter the response values already created.
I understand I can add more data in the separate ScriptData element, but I was hoping I could directly add to a property in the challenge object being returned.
But I did discover that the "Challenged" array already holds the information I was looking for (opponents usernames etc), so that solves my immediate problem anyway.
- Oldest First
- Popular
- Newest First
Sorted by Newest FirstRich Joslin
I understand I can add more data in the separate ScriptData element, but I was hoping I could directly add to a property in the challenge object being returned.
But I did discover that the "Challenged" array already holds the information I was looking for (opponents usernames etc), so that solves my immediate problem anyway.
Customer Support
Hey Rich,
You could send extra script-data back in the ListChallengeResponse cloud code, just as you would in any other event...
Spark.setScriptData("extra", playerName);
Does this work?
Sean
-
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