I have made a successful integration in my Unity game with GameSparks, however, i find the documentation limited:
The game currently posts new records to the leadderboards fine, however after posting a new score I want to know the new rank of the player. This comes from an asynchronous message NewHighScoreMessage, but I do not know how to retrieve this.
I guess the concrete question is, how to retrieve the new player rank after submitting his score to the leaderboard?
best regards
Best Answer
C
Customer Support
said
almost 7 years ago
Hi Miguel,
You can achieve this in Cloud Code by accessing leaderboard entries for a player.
var entries = Spark.getLeaderboards().getLeaderboard(shortCode).getEntriesFromPlayer(playerId, count);
This will return a SparkLeaderboardCursor, over which you can iterate and locate a specific entry. These methods are explained in the documentation here
You can achieve this in Cloud Code by accessing leaderboard entries for a player.
var entries = Spark.getLeaderboards().getLeaderboard(shortCode).getEntriesFromPlayer(playerId, count);
This will return a SparkLeaderboardCursor, over which you can iterate and locate a specific entry. These methods are explained in the documentation here
Miguel Angel Cortes Sosa
Hi,
I have made a successful integration in my Unity game with GameSparks, however, i find the documentation limited:
The game currently posts new records to the leadderboards fine, however after posting a new score I want to know the new rank of the player. This comes from an asynchronous message NewHighScoreMessage, but I do not know how to retrieve this.
I guess the concrete question is, how to retrieve the new player rank after submitting his score to the leaderboard?
best regards
Hi Miguel,
You can achieve this in Cloud Code by accessing leaderboard entries for a player.
var entries = Spark.getLeaderboards().getLeaderboard(shortCode).getEntriesFromPlayer(playerId, count);
This will return a SparkLeaderboardCursor, over which you can iterate and locate a specific entry. These methods are explained in the documentation here
Thanks,
Liam
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Hi Miguel,
You can achieve this in Cloud Code by accessing leaderboard entries for a player.
var entries = Spark.getLeaderboards().getLeaderboard(shortCode).getEntriesFromPlayer(playerId, count);
This will return a SparkLeaderboardCursor, over which you can iterate and locate a specific entry. These methods are explained in the documentation here
Thanks,
Liam
Miguel Angel Cortes Sosa
thanks I will try that tonight
-
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