I am just creating a sandbox fantasygame in Unreal 4 using GameSparks as a backend. In my game the player should have the opportunity to create multiple characters. I created a custom event to invoke or rather request a list of character-data according from the nosql database. I already figured, that you can use the GSLogEventRequest to invoke the event on the server.
My question is:
How do you configure the response and also the sending of the response? Is there any code that I can use in Cloud Code? Does somebody have an example on how to setup a response for a custom event? Or at least an explanation? :-).
Best wishes
Nicolas
Best Answer
C
Customer Support
said
about 6 years ago
Hi Nicolas,
Responses in Cloud Code are set by configuring scriptData or scriptErrors.
Using Spark.setScriptData(key, value) in Cloud code is generally how you control the response being issued to the client based off of the inputs that have been received through Spark.getData.
You can also set errors via Spark.setScriptError.
This applies for all requests and responses on the platform. When you set data in the Cloud Code for a request, you can retrieve this set data in the response for that request, so no data is lost.
Hope this helps! Let me know if you'd like more details.
-Pádraig
1 Comment
Customer Support
said
about 6 years ago
Answer
Hi Nicolas,
Responses in Cloud Code are set by configuring scriptData or scriptErrors.
Using Spark.setScriptData(key, value) in Cloud code is generally how you control the response being issued to the client based off of the inputs that have been received through Spark.getData.
You can also set errors via Spark.setScriptError.
This applies for all requests and responses on the platform. When you set data in the Cloud Code for a request, you can retrieve this set data in the response for that request, so no data is lost.
Hope this helps! Let me know if you'd like more details.
Nicolas Fischöder
Dear support, dear community,
I am just creating a sandbox fantasygame in Unreal 4 using GameSparks as a backend. In my game the player should have the opportunity to create multiple characters. I created a custom event to invoke or rather request a list of character-data according from the nosql database. I already figured, that you can use the GSLogEventRequest to invoke the event on the server.
My question is:
How do you configure the response and also the sending of the response? Is there any code that I can use in Cloud Code? Does somebody have an example on how to setup a response for a custom event? Or at least an explanation? :-).
Best wishes
Nicolas
Hi Nicolas,
Responses in Cloud Code are set by configuring scriptData or scriptErrors.
Using Spark.setScriptData(key, value) in Cloud code is generally how you control the response being issued to the client based off of the inputs that have been received through Spark.getData.
You can also set errors via Spark.setScriptError.
This applies for all requests and responses on the platform. When you set data in the Cloud Code for a request, you can retrieve this set data in the response for that request, so no data is lost.
Hope this helps! Let me know if you'd like more details.
-Pádraig
Customer Support
Hi Nicolas,
Responses in Cloud Code are set by configuring scriptData or scriptErrors.
Using Spark.setScriptData(key, value) in Cloud code is generally how you control the response being issued to the client based off of the inputs that have been received through Spark.getData.
You can also set errors via Spark.setScriptError.
This applies for all requests and responses on the platform. When you set data in the Cloud Code for a request, you can retrieve this set data in the response for that request, so no data is lost.
Hope this helps! Let me know if you'd like more details.
-Pádraig
-
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