Sign In Register

How can we help you today?

Start a new topic
Solved

Basic scheduler usage

Hello.

I am trying to make a basic scheduler, that I need to call from ChallengeEvent


This is how I use it:

var playMoveTimeJson = Spark.getProperties().getProperty("PLAY_MOVE_TIME");
var playMoveTime = playMoveTimeJson.time;
var currentPlayerId = messageToSend["currentPlayerId"];

var kickPlayerData = {
     "currentChallenge" : currentChallenge,
     "kickPlayer" : currentPlayerId
};

var sparkScheduler = Spark.getScheduler();
sparkScheduler.inSeconds("KickPlayer", playMoveTime, kickPlayerData, "kick_player_data");
 

       

And this is the response I get from the server.

  

{"@class":".GameSparksErrorResponse","error":{"message":"Can't find a codec for class com.gamesparks.scripting.impl.SparkChallengeImpl. (challengeEvent/SendPlayerMove.js#46)"},"message":"Can't find a codec for class com.gamesparks.scripting.impl.SparkChallengeImpl. (challengeEvent/SendPlayerMove.js#46)","requestId":"636567384847030000_2"}

  

What am I doing wrong here?

1 Comment

Sorry for calling false alarms. This issue was showing up when I was trying to read currentChallenge variable.

I solved it, Thanks.

Login to post a comment