CotC C# SDK for Unity  v1.4.0.1
Making social games is easy !
Public Member Functions | List of all members

Description

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< PostedGameScorePost (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)
 

Member Function Documentation

◆ BestHighScores()

Promise<PagedList<Score> > CotcSdk.GamerScores.BestHighScores ( string  board,
int  count = 10,
int  page = 1 
)

Fetch the score list for a given board.

Returns
Promise resolved when the operation has completed. The attached value describes a list of scores, and provides pagination functionality.
Parameters
boardThe name of the board to fetch scores from.
countThe maximum number of results to return per page.
pageNumber of the page to be fetched. After that, you may use the paged result handler to fetch pages nearby.

◆ Domain()

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(...);

Parameters
domainDomain on which to scope the next operations.
Returns
This object for operation chaining.

◆ GetRank()

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.

Returns
Promise resolved when the operation has completed. The attached value contains the rank that the score would have (position in the board).
Parameters
scoreThe score (numeric value) to check for ranking.
boardThe name of the board to check the ranking against. Should match the board where a score has already been posted.

◆ ListFriendScores()

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.

Returns
Promise resolved when the operation has completed. The attached value describes a list of scores, without pagination functionality.
Parameters
boardThe name of the board to fetch scores from.

◆ ListUserBestScores()

Promise<Dictionary<string, Score> > CotcSdk.GamerScores.ListUserBestScores ( )

Retrieves the best scores of this gamer, on all board he has posted one score to.

Returns
Promise resolved when the operation has completed. The attached value contains information about the best scores of the user, indexed by board name. IMPORTANT: in the results, the gamer information is not provided. GamerInfo is always null.

◆ PagedCenteredScore()

Promise<PagedList<Score> > CotcSdk.GamerScores.PagedCenteredScore ( string  board,
int  count = 10 
)

Fetch the score paged list around the player.

Returns
Promise resolved when the operation has completed. The attached value describes a list of scores, with pagination functionality.
Parameters
boardThe name of the board to fetch scores from.
countThe maximum number of results to return per page.

◆ Post()

Promise<PostedGameScore> CotcSdk.GamerScores.Post ( long  score,
string  board,
ScoreOrder  order,
string  scoreInfo = null,
bool  forceSave = false 
)

Post a score.

Returns
Promise resolved when the operation has completed. The attached value contains the new rank of the player as well as whether the score was saved.
Parameters
scoreThe score (numeric value) to record.
boardThe 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.
orderThe 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).
scoreInfoAn optional string used to describe the score made by the user.
forceSaveWhen set to true, the score is saved even if its value is less than the past best score for this player.