class Scores extends Resource (View source)

The "scores" collection of methods.

Typical usage is:

 $gamesService = new Google\Service\Games(...);
 $scores = $gamesService->scores;

Methods

get(string $playerId, string $leaderboardId, string $timeSpan, array $optParams = [])

Get high scores, and optionally ranks, in leaderboards for the currently authenticated player. For a specific time span, leaderboardId can be set to ALL to retrieve data for all leaderboards in a given time span. `NOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in the same request; only one parameter may be set to 'ALL'. (scores.get)

listScores(string $leaderboardId, string $collection, string $timeSpan, array $optParams = [])

Lists the scores in a leaderboard, starting from the top. (scores.listScores)

listWindow(string $leaderboardId, string $collection, string $timeSpan, array $optParams = [])

Lists the scores in a leaderboard around (and including) a player's score.

submit(string $leaderboardId, string $score, array $optParams = [])

Submits a score to the specified leaderboard. (scores.submit)

submitMultiple(PlayerScoreSubmissionList $postBody, array $optParams = [])

Submits multiple scores to leaderboards. (scores.submitMultiple)

Details

PlayerLeaderboardScoreListResponse get(string $playerId, string $leaderboardId, string $timeSpan, array $optParams = [])

Get high scores, and optionally ranks, in leaderboards for the currently authenticated player. For a specific time span, leaderboardId can be set to ALL to retrieve data for all leaderboards in a given time span. `NOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in the same request; only one parameter may be set to 'ALL'. (scores.get)

Parameters

string $playerId

A player ID. A value of me may be used in place of the authenticated player's ID.

string $leaderboardId

The ID of the leaderboard. Can be set to 'ALL' to retrieve data for all leaderboards for this application.

string $timeSpan

The time span for the scores and ranks you're requesting.

array $optParams

Optional parameters.

Return Value

PlayerLeaderboardScoreListResponse

Exceptions

Exception

LeaderboardScores listScores(string $leaderboardId, string $collection, string $timeSpan, array $optParams = [])

Lists the scores in a leaderboard, starting from the top. (scores.listScores)

Parameters

string $leaderboardId

The ID of the leaderboard.

string $collection

The collection of scores you're requesting.

string $timeSpan

Required. The time span for the scores and ranks you're requesting.

array $optParams

Optional parameters.

Return Value

LeaderboardScores

Exceptions

Exception

LeaderboardScores listWindow(string $leaderboardId, string $collection, string $timeSpan, array $optParams = [])

Lists the scores in a leaderboard around (and including) a player's score.

(scores.listWindow)

Parameters

string $leaderboardId

The ID of the leaderboard.

string $collection

The collection of scores you're requesting.

string $timeSpan

Required. The time span for the scores and ranks you're requesting.

array $optParams

Optional parameters.

Return Value

LeaderboardScores

Exceptions

Exception

PlayerScoreResponse submit(string $leaderboardId, string $score, array $optParams = [])

Submits a score to the specified leaderboard. (scores.submit)

Parameters

string $leaderboardId

The ID of the leaderboard.

string $score

Required. The score you're submitting. The submitted score is ignored if it is worse than a previously submitted score, where worse depends on the leaderboard sort order. The meaning of the score value depends on the leaderboard format type. For fixed-point, the score represents the raw value. For time, the score represents elapsed time in milliseconds. For currency, the score represents a value in micro units.

array $optParams

Optional parameters.

Return Value

PlayerScoreResponse

Exceptions

Exception

PlayerScoreListResponse submitMultiple(PlayerScoreSubmissionList $postBody, array $optParams = [])

Submits multiple scores to leaderboards. (scores.submitMultiple)

Parameters

PlayerScoreSubmissionList $postBody
array $optParams

Optional parameters.

Return Value

PlayerScoreListResponse

Exceptions

Exception