Leaderboard Plugin Functions
Get Available Leaderboards
Retrieves a list of leaderboards based on the provided parameters.
- Unity3D
- API
- TypeScript
var leaderboards = await ServiceHub.Services.Leaderboard.GetLeaderboards(new GetLeaderboardsParams
{
label = null,
skip = 0,
limit = 0
});
curl --location 'https://link.dynamicpixels.dev/game/[CLIENT_ID]/api/table/services/leaderboard?label=[LABEL-OPTIONAL]&skip=[SKIP]&limit=[LIMIT]' \
--header 'Authorization: Bearer [TOKEN FROM AUTH LEVEL]
DynamicPixels.Services.Leaderboards.GetLeaderboards(): Promise<Leaderboard[]>
Get Users Scores
Obtains scores for individual users as specified by the input parameters.
- Unity3D
- API
- TypeScript
var scores = await ServiceHub.Services.Leaderboard.GetUsersScores<GetScoresParams, UserScore>(new GetScoresParams
{
Leaderboardid = 0,
skip = 0,
limit = 0,
returnUserScore = false,
Conditions = new Eq("field", "value").ToQuery()
});
curl --location 'https://link.dynamicpixels.dev/game/[CLIENT_ID]/api/table/services/leaderboard/user/[LEADERBOARD ID]?skip=[SKIP]&limit=[LIMIT]' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer [TOKEN FROM AUTH LEVEL]
--data '{
"conditions": { [TABLE CONDITION] },
"return_me": true
}
'
DynamicPixels.Services.Leaderboards.GetUsersScores(input: GetScoresParams): Promise<UserScore[]>
Get Parties Scores
Fetches scores for different parties (e.g., teams or groups) according to the given parameters.
- Unity3D
- API
- TypeScript
var scores = await ServiceHub.Services.Leaderboard.GetPartiesScores<GetScoresParams, PartyScore>(new GetScoresParams
{
Leaderboardid = 0,
skip = 0,
limit = 0,
returnUserScore = false,
Conditions = new Eq("field", "value").ToQuery()
});
curl --location 'https://link.dynamicpixels.dev/game/[CLIENT_ID]/api/table/services/leaderboard/party/[LEADERBOARD ID]?skip=[SKIP]&limit=[LIMIT]' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer [TOKEN FROM AUTH LEVEL]
--data '{
"conditions": { [TABLE CONDITION] },
"return_me": true
}
'
DynamicPixels.Services.Leaderboards.GetPartiesScores(input: GetScoresParams): Promise<PartyScore[]>
Get Friends Scores
Gathers scores specifically for friends of the current user.
- Unity3D
- API
- TypeScript
var scores = await ServiceHub.Services.Leaderboard.GetFriendsScores(new GetFriendsScoresParams
{
LeaderboardId = 0,
Skip = 0,
Limit = 0
});
curl --location 'https://link.dynamicpixels.dev/game/[CLIENT_ID]/api/table/services/leaderboard/[LEADERBOARD ID]/friends?skip=[SKIP]&limit=[LIMIT]' \
--header 'Authorization: Bearer [TOKEN FROM AUTH LEVEL]
'
DynamicPixels.Services.Leaderboards.GetFriendsScores(input: GetMyFriendsScoresParams): Promise<UserScore[]>
Get My Score
Retrieves the score of the current user based on the input parameters.
- Unity3D
- API
- TypeScript
var score = await ServiceHub.Services.Leaderboard.GetMyScore<GetCurrentUserScoreParams, UserScore>(new GetCurrentUserScoreParams
{
LeaderboardId = 0,
Conditions = new Eq("field", "value").ToQuery()
});
curl --location 'https://link.dynamicpixels.dev/game/[CLIENT_ID]/api/table/services/leaderboard/[LEADERBOARD ID]/me' \
--header 'Authorization: Bearer [TOKEN FROM AUTH LEVEL]
'
DynamicPixels.Services.Leaderboards.GetMyScore(input: GetMyScoreParams): Promise<UserScore>
Submit New Score
Submits a user's score and returns the result.
- Unity3D
- API
- TypeScript
var score = await ServiceHub.Services.Leaderboard.SubmitScore<SubmitScoreParams, UserScore>(
new SubmitScoreParams
{
LeaderboardId = 0,
Score = 0,
OtherData = new Dictionary<string, dynamic>(),
PartyId = 0,
UniqueBy = "extended_field"
});
curl --location 'https://link.dynamicpixels.dev/game/[CLIENT_ID]/api/table/services/leaderboard/[LEADERBOARD ID]' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer [TOKEN FROM AUTH LEVEL]
--data '{
"score": [ SCORE ],
"party_Id": [ PARTY ID ]
"other_data": {
"[FIELD]": [VALUE]
}
}'
'
DynamicPixels.Services.Leaderboards.SubmitScore(input: SubmitScoreParams): Promise<Score>