varleaderboardId="level1";varsubmission={score:100};varrecord=awaitclient.writeLeaderboardRecord(session,leaderboardId,submission);console.log("New record username %o and score %o",record.username,record.score);
Client
1
2
3
4
conststringleaderboardId="level1";constlongscore=100L;varr=awaitclient.WriteLeaderboardRecordAsync(session,leaderboardId,score);System.Console.WriteLine("New record for '{0}' score '{1}'",r.Username,r.Score);
Client
1
2
3
4
5
6
7
8
9
autosuccessCallback=[](constNLeaderboardRecord&record){std::cout<<"New record with score "<<record.score<<std::endl;};stringleaderboardId="level1";int64_tscore=100;client->writeLeaderboardRecord(session,leaderboardId,score,opt::nullopt,opt::nullopt,successCallback);
Client
1
2
3
4
finalStringleaderboard="level1";longscore=100L;LeaderboardRecordr=client.writeLeaderboardRecord(session,leaderboard,score);System.out.format("New record for %s score %s",r.getUsername(),r.getScore());
Client
1
2
3
4
5
6
7
varleaderboard_id="level1"varscore=100varrecord:NakamaAPI.ApiLeaderboardRecord=yield(client.write_leaderboard_record_async(session,leaderboard_id,score),"completed")ifrecord.is_exception():print("An error occurred: %s"%record)returnprint("New record username %s and score %s"%[record.username,record.score])
varleaderboardId="level1";varsubmission={score:100};varrecord=awaitclient.writeLeaderboardRecord(session,leaderboardId,submission);console.log("New record username %o and score %o",record.username,record.score);
Client
1
2
3
4
conststringleaderboard="level1";constlongscore=100L;varr=awaitclient.WriteLeaderboardRecordAsync(session,leaderboard,score);System.Console.WriteLine("New record for '{0}' score '{1}'",r.Username,r.Score);
Client
1
2
3
4
5
6
7
8
9
autosuccessCallback=[](constNLeaderboardRecord&record){std::cout<<"New record with score "<<record.score<<std::endl;};stringleaderboardId="level1";int64_tscore=100;client->writeLeaderboardRecord(session,leaderboardId,score,opt::nullopt,opt::nullopt,successCallback);
Client
1
2
3
4
finalStringleaderboard="level1";longscore=100L;LeaderboardRecordr=client.writeLeaderboardRecord(session,leaderboard,score);System.out.format("New record for %s score %d",r.getUsername(),r.getScore());
Client
1
2
3
4
5
6
7
varleaderboard_id="level1"varscore=100varrecord:NakamaAPI.ApiLeaderboardRecord=yield(client.write_leaderboard_record_async(session,leaderboard_id,score),"completed")ifrecord.is_exception():print("An error occurred: %s"%record)returnprint("New record username %s and score %s"%[record.username,record.score])
curl -X GET "http://127.0.0.1:7350/v2/leaderboard/<leaderboardId>"\
-H 'Authorization: Bearer <session token>'
Client
1
2
3
4
5
varleaderboardId="level1";varresult=awaitclient.listLeaderboardRecords(session,leaderboardId);result.records.forEach(function(record){console.log("Record username %o and score %o",record.username,record.score);});
Client
1
2
3
4
5
6
conststringleaderboardId="level1";varresult=awaitclient.ListLeaderboardRecordsAsync(session,leaderboardId);foreach(varrinresult.Records){System.Console.WriteLine("Record for '{0}' score '{1}'",r.Username,r.Score);}
Client
1
2
3
4
5
6
7
8
9
10
11
autosuccessCallback=[](NLeaderboardRecordListPtrrecordsList){for(auto&record:recordsList->records){std::cout<<"Record username "<<record.username<<" and score "<<record.score<<std::endl;}};stringleaderboardId="level1";client->listLeaderboardRecords(session,leaderboardId,{},opt::nullopt,opt::nullopt,successCallback);
Client
1
2
3
4
5
finalStringleaderboard="level1";LeaderboardRecordListrecords=client.listLeaderboardRecords(session,leaderboard);for(LeaderboardRecordrecord:records.getRecordsList()){System.out.format("Record for %s score %d",record.getUsername(),record.getScore());}
Client
1
2
3
4
5
6
7
8
varleaderboard_id="level1"varresult:NakamaAPI.ApiLeaderboardRecordList=yield(client.list_leaderboard_records_async(session,leaderboard_id),"completed")ifresult.is_exception():print("An error occurred: %s"%result)returnforrinresult.records:varrecord:NakamaAPI.ApiLeaderboardRecord=rprint("Record username %s and score %s"%[record.username,record.score])
curl -X GET "http://127.0.0.1:7350/v2/leaderboard/<leaderboardId>?cursor=<next_cursor>"\
-H 'Authorization: Bearer <session token>'
Client
1
2
3
4
5
6
7
8
9
10
11
12
13
14
varleaderboardId="level1";varresult=awaitclient.listLeaderboardRecords(session,leaderboardId);result.records.forEach(function(record){console.log("Record username %o and score %o",record.username,record.score);});// If there are more results get next page.
if(result.next_cursor){result=awaitclient.listLeaderboardRecords(session,leaderboardId,null,null,result.next_cursor);result.records.forEach(function(record){console.log("Record username %o and score %o",record.username,record.score);});}
Client
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
conststringleaderboardId="level1";varresult=awaitclient.ListLeaderboardRecordsAsync(session,leaderboardId);foreach(varrinresult.Records){System.Console.WriteLine("Record for '{0}' score '{1}'",r.Username,r.Score);}// If there are more results get next page.if(result.NextCursor!=null){varc=result.NextCursor;result=awaitclient.ListLeaderboardRecordsAsync(session,leaderboardId,null,100,c);foreach(varrinresult.Records){System.Console.WriteLine("Record for '{0}' score '{1}'",r.Username,r.Score);}}
autosuccessCallback=[this](NLeaderboardRecordListPtrrecordsList){for(auto&record:recordsList->records){std::cout<<"Record username "<<record.username<<" and score "<<record.score<<std::endl;}if(!recordsList->nextCursor.empty()){autosuccessCallback=[this](NLeaderboardRecordListPtrrecordsList){for(auto&record:recordsList->records){std::cout<<"Record username "<<record.username<<" and score "<<record.score<<std::endl;}};stringleaderboardId="level1";client->listLeaderboardRecords(session,leaderboardId,{},opt::nullopt,recordsList->nextCursor,successCallback);}};stringleaderboardId="level1";client->listLeaderboardRecords(session,leaderboardId,{},opt::nullopt,opt::nullopt,successCallback);
Client
1
2
3
4
5
6
7
8
9
10
11
12
13
14
finalStringleaderboard="level1";LeaderboardRecordListrecords=client.listLeaderboardRecords(session,leaderboard);for(LeaderboardRecordrecord:records.getRecordsList()){System.out.format("Record for %s score %d",record.getUsername(),record.getScore());}// If there are more results get next page.if(records.getCursor()!=null){varc=result.NextCursor;records=client.listLeaderboardRecords(session,leaderboard,null,100,records.getNextCursor());for(LeaderboardRecordrecord:records.getRecordsList()){System.out.format("Record for %s score %d",record.getUsername(),record.getScore());}}
Client
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
varleaderboard_id="level1"varresult:NakamaAPI.ApiLeaderboardRecordList=yield(client.list_leaderboard_records_async(session,leaderboard_id,null,null,100),"completed")ifresult.is_exception():print("An error occurred: %s"%result)returnforrinresult.records:varrecord:NakamaAPI.ApiLeaderboardRecord=rprint("Record username %s and score %s"%[record.username,record.score])ifresult.next_cursor:result=yield(client.list_leaderboard_records_async(session,leaderboard_id,null,null,100,result.next_cursor),"completed")ifresult.is_exception():print("An error occurred: %s"%result)returnforrinresult.records:varrecord:NakamaAPI.ApiLeaderboardRecord=rprint("Record username %s and score %s"%[record.username,record.score])
curl -X GET "http://127.0.0.1:7350/v2/leaderboard/<leaderboardId>?overrideExpiry=604800"\
-H 'Authorization: Bearer <session token>'
Client
1
2
3
4
5
6
varleaderboardId="<leaderboardId>";varoverrideExpiry=604800;varresult=awaitclient.listLeaderboardRecords(session,leaderboardId,overrideExpiry);result.records.forEach(function(record){console.log("Record username %o and score %o expired on %o",record.username,record.score,record.expiryTime);});
Client
1
2
3
4
5
6
7
conststringleaderboardId="<leaderboardId>";constint64overrideExpiry=604800;varresult=awaitclient.ListLeaderboardRecordsAsync(session,leaderboardId,overrideExpiry);foreach(varrinresult.Records){System.Console.WriteLine("Record for '{0}' and score '{1}' expired on '{2}'",r.Username,r.Score,r.ExpiryTime);}
Client
1
2
3
4
5
6
7
8
9
10
11
12
autosuccessCallback=[](NLeaderboardRecordListPtrrecordsList){for(auto&record:recordsList->records){std::cout<<"Record username "<<record.username<<" and score "<<record.score<<" expired on "<<record.expiryTime<<std::endl;}};stringleaderboardId="<leaderboardId>";intoverrideExpiry=604800;client->listLeaderboardRecords(session,leaderboardId,overrideExpiry,{},opt::nullopt,opt::nullopt,successCallback);
Client
1
2
3
4
5
6
finalStringleaderboard="<leaderboardId>";finalLongoverrideExpiry=604800;LeaderboardRecordListrecords=client.listLeaderboardRecords(session,leaderboard,overrideExpiry).get();for(LeaderboardRecordrecord:records.getRecordsList()){System.out.format("Record for %s score %d",record.getUsername(),record.getScore());}
Client
1
2
3
4
5
6
7
8
9
varleaderboard_id="<leaderboardId>"varoverride_expiry=604800varresult:NakamaAPI.ApiLeaderboardRecordList=yield(client.list_leaderboard_records_async(session,leaderboard_id,override_expiry),"completed")ifresult.is_exception():print("An error occurred: %s"%result)returnforrinresult.records:varrecord:NakamaAPI.ApiLeaderboardRecord=rprint("Record username %s and score %s expired on %s"%[record.username,record.score,record.expiry_time])
stringleaderboardId="level1";stringownerId="some user ID";int32_tlimit=100;client->listLeaderboardRecordsAroundOwner(session,leaderboardId,ownerId,limit,successCallback);