I do not like how, but I did
Before updating the leaderboard, I get the rank using GetLeaderboardEntriesRequest, and after I send it along with the update of Leaderboard
I answered for Cloud code
var Scoresplayer = Spark.getData().Score;
var Levelplayer=Spark.getData().Level;
var requestLB = new SparkRequest.SocialLeaderboardDataRequest();
var responseLB = requestLB.Send();
var requestData = new SparkRequest.LeaderboardDataRespnse();
var responseData = requestData.Send();
var ScoreData = responseData.Score;
var scriptDataLB = responseLB.scriptData;
var scriptDataDB = responseData.scriptData;
var SendPlayerLevel = requestLB.Send().Level;
var SendPlayerScore = requestLB.Send().Score;
var requestmyData = {"SendPlayerLevel":SendPlayerLevel,"SendPlayerScore":SendPlayerScore };
function setRequestData(){ var data = Spark.getData()["requesmyData"]; Spark.setScriptData("scriptData",requestmyData); }
function getRequestData(){
var data =Spark.getData()["scriptData"]["requestmyData"];
return data;
}
Denis Bogdanov
Hello!
"Sorry for my English"
Tell me how to get and set the last rank?
When updating the leaderboard, with a high score, you can get "rankDetails" and the field "globalTo". How to get this information without a high score
Or, you need to sort the leaderboard list and get that value yourself, but how to set it in LeaderboardData ?
So then I could do this:
Sorry for my English