![]() |
CotC C# SDK for Unity
v1.4.0.1
Making social games is easy !
|
Scoring and leaderboard related functions.
Public Member Functions | |
GamerScores | Domain (string domain) |
Changes the domain affected by the next operations. You should typically use it this way: game.Scores.Domain("private").Post(...); More... | |
Promise< PagedList< Score > > | BestHighScores (string board, int count=10, int page=1) |
Fetch the score list for a given board. More... | |
Promise< NonpagedList< Score > > | ListFriendScores (string board) |
Fetch the score list for a given board, restricting to the scores made by the friends of the current user. More... | |
Promise< PagedList< Score > > | PagedCenteredScore (string board, int count=10) |
Fetch the score paged list around the player. More... | |
Promise< Dictionary< string, Score > > | ListUserBestScores () |
Retrieves the best scores of this gamer, on all board he has posted one score to. More... | |
Promise< int > | GetRank (long score, string board) |
Retrieves the rank that a given score would have on the leaderboard, without actually registering the score. More... | |
Promise< PostedGameScore > | Post (long score, string board, ScoreOrder order, string scoreInfo=null, bool forceSave=false) |
Post a score. More... | |
Promise< NonpagedList< Score > > | CenteredScore (string board, int count=10) |
Promise< PagedList< Score > > | List (string board, int limit=30, int offset=0) |
Promise<PagedList<Score> > CotcSdk.GamerScores.BestHighScores | ( | string | board, |
int | count = 10 , |
||
int | page = 1 |
||
) |
Fetch the score list for a given board.
board | The name of the board to fetch scores from. |
count | The maximum number of results to return per page. |
page | Number of the page to be fetched. After that, you may use the paged result handler to fetch pages nearby. |
GamerScores CotcSdk.GamerScores.Domain | ( | string | domain | ) |
Changes the domain affected by the next operations. You should typically use it this way: game.Scores.Domain("private").Post(...);
domain | Domain on which to scope the next operations. |
Promise<int> CotcSdk.GamerScores.GetRank | ( | long | score, |
string | board | ||
) |
Retrieves the rank that a given score would have on the leaderboard, without actually registering the score.
score | The score (numeric value) to check for ranking. |
board | The name of the board to check the ranking against. Should match the board where a score has already been posted. |
Promise<NonpagedList<Score> > CotcSdk.GamerScores.ListFriendScores | ( | string | board | ) |
Fetch the score list for a given board, restricting to the scores made by the friends of the current user.
board | The name of the board to fetch scores from. |
Retrieves the best scores of this gamer, on all board he has posted one score to.
Fetch the score paged list around the player.
board | The name of the board to fetch scores from. |
count | The maximum number of results to return per page. |
Promise<PostedGameScore> CotcSdk.GamerScores.Post | ( | long | score, |
string | board, | ||
ScoreOrder | order, | ||
string | scoreInfo = null , |
||
bool | forceSave = false |
||
) |
Post a score.
score | The score (numeric value) to record. |
board | The name of the board to post the score to. You may have as many boards as you like for your game, and scores are scoped between them. |
order | The order for this board. As board are not configured on the server, any client can create a board dynamically. This parameter serves as as a description for the board and is used only upon creation (that is, the first player posting to the named board). |
scoreInfo | An optional string used to describe the score made by the user. |
forceSave | When set to true, the score is saved even if its value is less than the past best score for this player. |