Sign In Register

How can we help you today?

Start a new topic
Answered

".LogChallengeEventResponse","error" {"scriptData":"UNKNOWN"} when trying to set ScriptData to a request

 (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 :

  

GS: RECV:{"@class":".LogChallengeEventResponse","error":{"scriptData":"UNKNOWN"},"requestId":"635487375619308134_5","scriptData":null}

 


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

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

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.

Login to post a comment