Subscribing to changes in the event leaderboards system
#
You can listen for changes in the event leaderboards system so that you can respond appropriately, such as updating the UI, by implementing the IObserver pattern, or use the SystemObserver<T> type which handles it for you.
1
2
3
4
5
vardisposer=SystemObserver<EventLeaderboardsSystem>.Create(eventLeaderboardsSystem,system=>{Instance.Logger.Info($"System updated.");// Update UI elements etc as necessary here...});
You can re-roll the cohort the user is in for a specific event leaderboard. A re-roll would occur when a user has previously joined an event leaderboard and claimed their reward but would now like to re-join again for another chance at claiming a reward, or to play against a different set of opponents.
You can fill an event leaderboard with dummy users and assign random scores to them for testing purposes.
This is intended for debugging use only.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
varleaderboardId="<leaderboardId>";vartargetCount=50;// Optional target cohort size to fill to, otherwise fill to the max cohort size.varminScore=1;varmaxScore=100;var@operator=ApiOperator.SET;varsubscoreMin=1;varsubscoreMax=100;// Fills cohort with debug playersawaiteventLeaderboardsSystem.DebugFillAsync(leaderboardId,targetCount);// Sets randomly generated scores between a range for other players (does not change the user's score)awaiteventLeaderboardsSystem.DebugRandomScoresAsync(leaderboardId,minScore,maxScore,@operator,subscoreMin,subscoreMax);