Please, say Me. How get Match Data in event scripts? I did is like this:
var matchID = Spark.getData().mid; Spark.getLog().debug(matchID); var participantsData = Spark.getData().pdata; Spark.getLog().debug(participantsData); var matchDetails = Spark.getMultiplayer().loadMatch(matchID); //Spark.getLog().debug(matchDetails);
I send RTSession.getSessionId() from Real Time Script to matchID this event script. But this does not always work. Please, healp me(
Are you trying to send this from a real time script ? If so you'll need to send a LogEventRequest from it to do this. In Cloud Code the above will work if you pass in a valid matchID through the mid attribute.
//get the match data var matchData = matchDetails.getMatchData()