Google_Service_Games_Scores_Resource

The "scores" collection of methods.

Defined (1)

The class is defined in the following location(s).

/includes/api-libs/Google/Service/Games.php  
  1. class Google_Service_Games_Scores_Resource extends Google_Service_Resource 
  2.  
  3. /** 
  4. * Get high scores, and optionally ranks, in leaderboards for the currently 
  5. * authenticated player. For a specific time span, leaderboardId can be set to 
  6. * ALL to retrieve data for all leaderboards in a given time span. NOTE: You 
  7. * cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in the same request; 
  8. * only one parameter may be set to 'ALL'. (scores.get) 
  9. * @param string $playerId A player ID. A value of me may be used in place of 
  10. * the authenticated player's ID. 
  11. * @param string $leaderboardId The ID of the leaderboard. Can be set to 'ALL' 
  12. * to retrieve data for all leaderboards for this application. 
  13. * @param string $timeSpan The time span for the scores and ranks you're 
  14. * requesting. 
  15. * @param array $optParams Optional parameters. 
  16. * @opt_param string includeRankType The types of ranks to return. If the 
  17. * parameter is omitted, no ranks will be returned. 
  18. * @opt_param string language The preferred language to use for strings returned 
  19. * by this method. 
  20. * @opt_param int maxResults The maximum number of leaderboard scores to return 
  21. * in the response. For any response, the actual number of leaderboard scores 
  22. * returned may be less than the specified maxResults. 
  23. * @opt_param string pageToken The token returned by the previous request. 
  24. * @return Google_Service_Games_PlayerLeaderboardScoreListResponse 
  25. */ 
  26. public function get($playerId, $leaderboardId, $timeSpan, $optParams = array()) 
  27. $params = array('playerId' => $playerId, 'leaderboardId' => $leaderboardId, 'timeSpan' => $timeSpan); 
  28. $params = array_merge($params, $optParams); 
  29. return $this->call('get', array($params), "Google_Service_Games_PlayerLeaderboardScoreListResponse"); 
  30.  
  31. /** 
  32. * Lists the scores in a leaderboard, starting from the top. (scores.listScores) 
  33. * @param string $leaderboardId The ID of the leaderboard. 
  34. * @param string $collection The collection of scores you're requesting. 
  35. * @param string $timeSpan The time span for the scores and ranks you're 
  36. * requesting. 
  37. * @param array $optParams Optional parameters. 
  38. * @opt_param string language The preferred language to use for strings returned 
  39. * by this method. 
  40. * @opt_param int maxResults The maximum number of leaderboard scores to return 
  41. * in the response. For any response, the actual number of leaderboard scores 
  42. * returned may be less than the specified maxResults. 
  43. * @opt_param string pageToken The token returned by the previous request. 
  44. * @return Google_Service_Games_LeaderboardScores 
  45. */ 
  46. public function listScores($leaderboardId, $collection, $timeSpan, $optParams = array()) 
  47. $params = array('leaderboardId' => $leaderboardId, 'collection' => $collection, 'timeSpan' => $timeSpan); 
  48. $params = array_merge($params, $optParams); 
  49. return $this->call('list', array($params), "Google_Service_Games_LeaderboardScores"); 
  50.  
  51. /** 
  52. * Lists the scores in a leaderboard around (and including) a player's score. 
  53. * (scores.listWindow) 
  54. * @param string $leaderboardId The ID of the leaderboard. 
  55. * @param string $collection The collection of scores you're requesting. 
  56. * @param string $timeSpan The time span for the scores and ranks you're 
  57. * requesting. 
  58. * @param array $optParams Optional parameters. 
  59. * @opt_param string language The preferred language to use for strings returned 
  60. * by this method. 
  61. * @opt_param bool returnTopIfAbsent True if the top scores should be returned 
  62. * when the player is not in the leaderboard. Defaults to true. 
  63. * @opt_param int resultsAbove The preferred number of scores to return above 
  64. * the player's score. More scores may be returned if the player is at the 
  65. * bottom of the leaderboard; fewer may be returned if the player is at the top. 
  66. * Must be less than or equal to maxResults. 
  67. * @opt_param int maxResults The maximum number of leaderboard scores to return 
  68. * in the response. For any response, the actual number of leaderboard scores 
  69. * returned may be less than the specified maxResults. 
  70. * @opt_param string pageToken The token returned by the previous request. 
  71. * @return Google_Service_Games_LeaderboardScores 
  72. */ 
  73. public function listWindow($leaderboardId, $collection, $timeSpan, $optParams = array()) 
  74. $params = array('leaderboardId' => $leaderboardId, 'collection' => $collection, 'timeSpan' => $timeSpan); 
  75. $params = array_merge($params, $optParams); 
  76. return $this->call('listWindow', array($params), "Google_Service_Games_LeaderboardScores"); 
  77.  
  78. /** 
  79. * Submits a score to the specified leaderboard. (scores.submit) 
  80. * @param string $leaderboardId The ID of the leaderboard. 
  81. * @param string $score The score you're submitting. The submitted score is 
  82. * ignored if it is worse than a previously submitted score, where worse depends 
  83. * on the leaderboard sort order. The meaning of the score value depends on the 
  84. * leaderboard format type. For fixed-point, the score represents the raw value. 
  85. * For time, the score represents elapsed time in milliseconds. For currency,  
  86. * the score represents a value in micro units. 
  87. * @param array $optParams Optional parameters. 
  88. * @opt_param string language The preferred language to use for strings returned 
  89. * by this method. 
  90. * @opt_param string scoreTag Additional information about the score you're 
  91. * submitting. Values must contain no more than 64 URI-safe characters as 
  92. * defined by section 2.3 of RFC 3986. 
  93. * @return Google_Service_Games_PlayerScoreResponse 
  94. */ 
  95. public function submit($leaderboardId, $score, $optParams = array()) 
  96. $params = array('leaderboardId' => $leaderboardId, 'score' => $score); 
  97. $params = array_merge($params, $optParams); 
  98. return $this->call('submit', array($params), "Google_Service_Games_PlayerScoreResponse"); 
  99.  
  100. /** 
  101. * Submits multiple scores to leaderboards. (scores.submitMultiple) 
  102. * @param Google_PlayerScoreSubmissionList $postBody 
  103. * @param array $optParams Optional parameters. 
  104. * @opt_param string language The preferred language to use for strings returned 
  105. * by this method. 
  106. * @return Google_Service_Games_PlayerScoreListResponse 
  107. */ 
  108. public function submitMultiple(Google_Service_Games_PlayerScoreSubmissionList $postBody, $optParams = array()) 
  109. $params = array('postBody' => $postBody); 
  110. $params = array_merge($params, $optParams); 
  111. return $this->call('submitMultiple', array($params), "Google_Service_Games_PlayerScoreListResponse");