".LogChallengeEventResponse","error" {"scriptData":"UNKNOWN"} when trying to set ScriptData to a request
O
Ovidiu Buligan
started a topic
over 7 years ago
(Using Unity)
The general question is how do I attach script data in client and access it in cloud code ? Reverse scenario works (attaching scriptData in cloud code and accessing in client )
I am trying to attach a scriptData to my custom LogChallengeEventRequest_MYEVENT and if I attach it i get a response of :
In the Challenge Event cloud code (not LogEventRequest_MYEVENT) i only want to send some custom messages to the players with code like the following
var challenge = Spark.getChallenge(Spark.data.challengeId);
var playerIds = challenge.getAcceptedPlayerIds();
Spark.sendMessageByIdWithoutPush({"MYEVENT_ATTR":Spark.data.MYATTREVENT,
"CUSTOM_DATA": Spark.getScriptData("customData")}
,playerIds)
I am attaching the custom data with the following client code :
var reqData = new Dictionary<string,object> ();
reqData.Add ("CUSTOM_DATA", challengeId);
...
.SetScriptData(new GameSparks.Core.GSRequestData(reqData))
My CUSTOM_DATA is not an attribute of the event (I could make it and solve my problem) but I am asking how can One use script data from client to server?
Also a side question, is there a cloud code method that does Spark.sendMessageByIdWithoutPush() without inserting the message into the playerMessages collections ? (so just as a means for sending volatile events from cloud to challenged clients)
Best Answer
C
Customer Support
said
over 7 years ago
Hi Ovidiu, you'd have to set up an event with CUSTOM_DATA as an attribute as LogEvent/LogChallengeEvent requests do not accept arbitrary scriptData.
Messages will always go into playerMessages, there's no way to stop them form doing so.
1 Comment
Customer Support
said
over 7 years ago
Answer
Hi Ovidiu, you'd have to set up an event with CUSTOM_DATA as an attribute as LogEvent/LogChallengeEvent requests do not accept arbitrary scriptData.
Messages will always go into playerMessages, there's no way to stop them form doing so.
Ovidiu Buligan
(Using Unity)
The general question is how do I attach script data in client and access it in cloud code ? Reverse scenario works (attaching scriptData in cloud code and accessing in client )
I am trying to attach a scriptData to my custom LogChallengeEventRequest_MYEVENT and if I attach it i get a response of :
In the Challenge Event cloud code (not LogEventRequest_MYEVENT) i only want to send some custom messages to the players with code like the following
I am attaching the custom data with the following client code :
My CUSTOM_DATA is not an attribute of the event (I could make it and solve my problem) but I am asking how can One use script data from client to server?
Also a side question, is there a cloud code method that does Spark.sendMessageByIdWithoutPush() without inserting the message into the playerMessages collections ? (so just as a means for sending volatile events from cloud to challenged clients)
Hi Ovidiu, you'd have to set up an event with CUSTOM_DATA as an attribute as LogEvent/LogChallengeEvent requests do not accept arbitrary scriptData.
Messages will always go into playerMessages, there's no way to stop them form doing so.
Customer Support
Hi Ovidiu, you'd have to set up an event with CUSTOM_DATA as an attribute as LogEvent/LogChallengeEvent requests do not accept arbitrary scriptData.
Messages will always go into playerMessages, there's no way to stop them form doing so.
-
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