Event Leaderboards #

Read more about the Event Leaderboards system in Hiro here.

Get an event leaderboard #

Get a specified event leaderboard defined for the game.

1
2
3
4
5
var request = Hiro.EventLeaderboardGet.new()
request.id = "leaderboard_1"

var event_leaderboard = await hiro.eventLeaderboardGet(session, request)
print(event_leaderboard)

Update event leaderboard record #

Update an event leaderboard record for a user.

1
2
3
4
5
6
7
var request = Hiro.EventLeaderboardUpdate.new()
request.id = "leaderboard_1"
request.score = 100
request.subscore = 10

var event_leaderboard = await hiro.eventLeaderboardUpdate(session, request)
print(event_leaderboard)

Claim event leaderboard reward #

Claim an event leaderboard reward for a user.

1
2
3
4
5
var request = Hiro.EventLeaderboardClaim.new()
request.id = "leaderboard_1"

var event_leaderboard = await hiro.eventLeaderboardClaim(session, request)
print(event_leaderboard)

Roll a new cohort #

Roll a new cohort for the specified event leaderboard.

1
2
3
4
5
var request = Hiro.EventLeaderboardRoll.new()
request.id = "leaderboard_1"

var event_leaderboard = await hiro.eventLeaderboardRoll(session, request)
print(event_leaderboard)

Debugging an event leaderboard #

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
15
16
17
18
var fill_request = Hiro.EventLeaderboardDebugFillRequest.new()
fill_request.id = "leaderboard_1"
fill_request.target_count = 50  # Optional target cohort size to fill to, otherwise fill to the max cohort size.

var scores_request = Hiro.EventLeaderboardDebugRandomScoresRequest.new()
scores_request.id = "leaderboard_1"
scores_request.min = "1"
scores_request.max = "100"
scores_request.subscore_min = "1"
scores_request.subscore_max = "100"

# Fills cohort with debug players
var fill_leaderboard = await hiro.eventLeaderboardDebugFill(session, fill_request)
print(fill_leaderboard)

# Sets randomly generated scores between a range for other players (does not change the user's score)
var scores_leaderboard = await hiro.eventLeaderboardDebugRandomScores(session, scores_request)
print(scores_leaderboard)