Skip to content

Commit

Permalink
Added support for leaderboards (#15)
Browse files Browse the repository at this point in the history
* Added leaderboard support

* Update api.yml
  • Loading branch information
britzl committed Mar 13, 2020
1 parent 6122747 commit 9982feb
Show file tree
Hide file tree
Showing 11 changed files with 2,045 additions and 118 deletions.
183 changes: 183 additions & 0 deletions docs/_data/api.yml
Expand Up @@ -599,6 +599,138 @@
end
```
#*****************************************************************************************************
# Achievement
#*****************************************************************************************************

- name: achievement_reveal
type: function

parameters:
- name: achievementId
type: string

#*****************************************************************************************************

- name: achievement_unlock
type: function

parameters:
- name: achievementId
type: string

#*****************************************************************************************************

- name: achievement_set
type: function

parameters:
- name: achievementId
type: string

parameters:
- name: value
type: string

#*****************************************************************************************************

- name: achievement_increment
type: function

parameters:
- name: achievementId
type: string

parameters:
- name: value
type: string

#*****************************************************************************************************

- name: achievement_show
type: function

#*****************************************************************************************************

- name: achievement_get
type: function


#*****************************************************************************************************
# Leaderboard
#*****************************************************************************************************

- name: leaderboard_submit_score
type: function

parameters:
- name: leaderboardId
type: string
- name: score
type: number

#*****************************************************************************************************

- name: leaderboard_get_top_scores
type: function

parameters:
- name: leaderboardId
type: string

- name: time_span
type: number

- name: collection
type: number

- name: max_results
type: number

#*****************************************************************************************************

- name: leaderboard_get_player_centered_scores
type: function

parameters:
- name: leaderboardId
type: string

- name: time_span
type: number

- name: collection
type: number

- name: max_results
type: number

#*****************************************************************************************************

- name: leaderboard_show
type: function

parameters:
- name: leaderboardId
type: string

#*****************************************************************************************************

- name: leaderboard_get_player_score
type: function

parameters:
- name: leaderboardId
type: string

- name: time_span
type: number

- name: collection
type: number

#*****************************************************************************************************
# Popup position
#*****************************************************************************************************

- name: POPUP_POS_TOP_LEFT
Expand Down Expand Up @@ -637,6 +769,10 @@
type: number
desc: The login popup position at the bottom-right corner.

#*****************************************************************************************************
# Snapshot constants
#*****************************************************************************************************

- name: RESOLUTION_POLICY_MANUAL
type: number
desc: Official [GPGS documentation](https://developers.google.com/android/reference/com/google/android/gms/games/SnapshotsClient.html#RESOLUTION_POLICY_MANUAL) for this constant
Expand All @@ -657,6 +793,29 @@
type: number
desc: Official [GPGS documentation](https://developers.google.com/android/reference/com/google/android/gms/games/SnapshotsClient.html#RESOLUTION_POLICY_HIGHEST_PROGRESS) for this constant

#*****************************************************************************************************
# Leaderboard constants
#*****************************************************************************************************

- name: TIME_SPAN_DAILY
type: number

- name: TIME_SPAN_WEEKLY
type: number

- name: TIME_SPAN_ALL_TIME
type: number

- name: COLLECTION_PUBLIC
type: number

- name: COLLECTION_SOCIAL
type: number

#*****************************************************************************************************
# Extension callback constants
#*****************************************************************************************************

- name: MSG_SIGN_IN
type: number
desc: The message type that GPGS sends when finishing the asynchronous operation
Expand All @@ -682,6 +841,22 @@
desc: The message type that GPGS sends when finishing the asynchronous operation
after calling `gpgs.snapshot_open()`

- name: MSG_GET_ACHIEVEMENTS
type: number

- name: MSG_GET_TOP_SCORES
type: number

- name: MSG_GET_PLAYER_CENTERED_SCORES
type: number

- name: MSG_GET_PLAYER_SCORE
type: number

#*****************************************************************************************************
# Status
#*****************************************************************************************************

- name: STATUS_SUCCESS
type: number
desc: An operation success.
Expand All @@ -700,6 +875,10 @@
desc: The result of the calling `gpgs.snapshot_open()` or 'gpgs.snapshot_resolve_conflict()' is a conflict.
You need to make decision on how to solve this conflict using 'gpgs.snapshot_resolve_conflict()'.

#*****************************************************************************************************
# Snapshot constants
#*****************************************************************************************************

- name: SNAPSHOT_CURRENT
type: number
desc: The second parameter for 'gpgs.snapshot_resolve_conflict()' method, which means that you want to choose
Expand All @@ -710,6 +889,10 @@
desc: The second parameter for 'gpgs.snapshot_resolve_conflict()' method, which means that you want to choose
the conflicting snapshot as a snapshot for conflict solving.

#*****************************************************************************************************
# Error constants
#*****************************************************************************************************

- name: ERROR_STATUS_SNAPSHOT_NOT_FOUND
type: number
desc: This constant is used in `message.error_status` table when `MSG_LOAD_SNAPSHOT` is `STATUS_FAILED`.
Expand Down

0 comments on commit 9982feb

Please sign in to comment.