-
Notifications
You must be signed in to change notification settings - Fork 4
/
reference.html
193 lines (187 loc) · 6.13 KB
/
reference.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<h1>Plugin Reference API</h1>
<style>
.ios{
color: green;
}
</style>
<h2>Methods</h2>
<p><strong>Methods and properties that are supported by both Android ans iOS are marked as <span class='ios'>green</span></strong></p>
<ul>
<li class='ios'>googleplay:login() --login</li>
<li class='ios'>googleplay:logout() --logout</li>
<li>googleplay:showSettings() --show settings screen</li>
<li class='ios'>googleplay:showLeaderboard(leaderboardId) --show leaderboard screen</li>
<li class='ios'>googleplay:reportScore(leaderboardId, score [,immediate]) --post score to service</li>
<li class='ios'>googleplay:showAchievements() --show achievements screen</li>
<li class='ios'>googleplay:reportAchievement(achId [, numSteps, immediate]) --achievement unlocked or progressed by specified amount of steps of total defined steps</li>
<li class='ios'>googleplay:loadAchievements() --retrieve all defined achievemenets</li>
<li class='ios'>googleplay:loadScores(leaderboardId [,timespan, participants, maxResults]) --retrieve all scores for specific leaderboard ina specific timespan for specific participans</li>
<li class='ios'>googleplay:loadPlayerCenteredScores(leaderboardId [,timespan, participants, maxResults]) --retrieve all scores for specific leaderboard ina specific timespan for specific participans</li>
<li>googleplay:autoMatch(minPlayers, maxPlayers) --create a quick game between randomly selected players</li>
<li>googleplay:invitePlayers(minPlayers, maxPlayers) --allow user to invite players to a game</li>
<li>googleplay:joinRoom(invitationId) --joins the game you've been invited to</li>
<li>googleplay:showInvitations() --show screen for managing invitations</li>
<li>googleplay:showWaitingRoom(minPlayers) --show waiting room before the game with the list of players</li>
<li>googleplay:sendTo(playerId, data, isReliable) --send data to specific user by id</li>
<li>googleplay:sendToAll(data, isReliable) -- send to all users</li>
<li class='ios'>googleplay:getPlayerName() --get your current user name</li>
<li class='ios'>googleplay:getPlayerId() --get your current user id</li>
<li class='ios'>googleplay:getPlayerScore() --dispatches PLAYER_SCORE_COMPLETE event</li>
<li>googleplay:getAllPlayers() --retrieve information (id and name) for all users involved in game</li>
<li class='ios'>googleplay:loadState(key) --load app state from slot key from the cloud</li>
<li class='ios'>googleplay:updateState(key, data[, immediate]) --update app state for slot key with data bool immediate if it needs to be saved immediately</li>
<li class='ios'>googleplay:deleteState(key) --delete app state for slot key</li>
<li class='ios'>googleplay:resolveState(key, version, data) --resolve state conflict for slot key with version and data</li>
</ul>
<h2>Properties</h2>
<ul>
<li class='ios'>GooglePlay.UNLOCKED --achievement state unlocked</li>
<li class='ios'>GooglePlay.REVEALED --achievement state available to user</li>
<li class='ios'>GooglePlay.HIDDEN --achievement state unknown to user </li>
</ul>
<ul>
<li class='ios'>GooglePlay.ALL_TIME --leaderboard timespan all time</li>
<li class='ios'>GooglePlay.WEEK --leaderboard timespan week</li>
<li class='ios'>GooglePlay.TODAY --leaderboard timespan today</li>
</ul>
<ul>
<li class='ios'>GooglePlay.FRIENDS --leaderboard participants</li>
<li class='ios'>GooglePlay.ALL_PLAYERS --leaderboard participants</li>
</ul>
<h2>Events</h2>
<h3>Game Events</h3>
<ul>
<li>Event.DATA_RECEIVED
<ul>
<li>event.sender</li>
<li>event.data</li>
</ul>
</li>
<li>Event.GAME_STARTED</li>
<li class='ios'>Event.REPORT_ACHIEVEMENT_COMPLETE
<ul>
<li class='ios'>event.achievementId</li>
</ul>
</li>
<li class='ios'>Event.LOAD_ACHIEVEMENTS_COMPLETE
<ul>
<li class='ios'>event.achievements</li>
<li class='ios'>event.achievements[].id</li>
<li class='ios'>event.achievements[].name</li>
<li class='ios'>event.achievements[].description</li>
<li class='ios'>event.achievements[].status</li>
<li class='ios'>event.achievements[].currentSteps</li>
<li class='ios'>event.achievements[].totalSteps</li>
<li class='ios'>event.achievements[].lastUpdate</li>
</ul>
</li>
<li class='ios'>Event.REPORT_SCORE_COMPLETE</li>
<li class='ios'>Event.LOAD_SCORES_COMPLETE
<ul>
<li class='ios'>event.name</li>
<li class='ios'>event.leaderboardId</li>
<li class='ios'>event.scores</li>
<li class='ios'>event.scores[].name</li>
<li class='ios'>event.scores[].timestamp</li>
<li class='ios'>event.scores[].score</li>
<li class='ios'>event.scores[].rank</li>
<li class='ios'>event.scores[].playerId</li>
</ul>
<li class='ios'>Event.PLAYER_SCORE_COMPLETE
<ul>
<li class='ios'>event.rank</li>
<li class='ios'>event.score</li>
<li class='ios'>event.timestamp</li>
</ul>
</li>
</ul>
<h3>Autorization Events</h3>
<ul>
<li class='ios'>Event.LOGIN_ERROR</li>
<li class='ios'>Event.LOGIN_COMPLETE</li>
</ul>
<h3>Cloud Events</h3>
<ul>
<li class='ios'>Event.STATE_LOADED
<ul>
<li class='ios'>event.key</li>
<li class='ios'>event.isFresh</li>
<li class='ios'>event.data</li>
</ul>
</li>
<li class='ios'>Event.STATE_ERROR
<ul>
<li class='ios'>event.key</li>
</ul>
</li>
<li class='ios'>Event.STATE_CONFLICT
<ul>
<li class='ios'>event.key</li>
<li class='ios'>event.version</li>
<li class='ios'>event.localData</li>
<li class='ios'>event.serverData</li>
</ul>
</li>
<li class='ios'>Event.STATE_DELETED
<ul>
<li class='ios'>event.key</li>
</ul>
</li>
</ul>
<h3>Room Events</h3>
<ul>
<li>Event.DISCONNECTED_FROM_ROOM
<ul>
<li>event.roomId</li>
</ul>
</li>
<li>Event.ROOM_CREATED
<ul>
<li>event.roomId</li>
</ul>
</li>
<li>Event.LEFT_ROOM
<ul>
<li>event.roomId</li>
</ul>
</li>
<li>Event.ROOM_CONNECTED
<ul>
<li>event.roomId</li>
</ul>
</li>
<li>Event.CONNECTED_TO_ROOM
<ul>
<li>event.roomId</li>
</ul>
</li>
<li>Event.ROOM_CONNECTING
<ul>
<li>event.roomId</li>
</ul>
</li>
<li>Event.ROOM_AUTO_MATCHING
<ul>
<li>event.roomId</li>
</ul>
</li>
<li>Event.JOINED_ROOM
<ul>
<li>event.roomId</li>
</ul>
</li>
<li>Event.INVITATION_RECEIVED
<ul>
<li>event.invitationId (can be used to connect to room)</li>
</ul>
</li>
</ul>
<h3>Peer Events</h3>
<ul>
<li>Event.PEER_INVITED</li>
<li>Event.PEER_JOINED</li>
<li>Event.PEER_DISCONNECTED</li>
<li>Event.PEER_CONNECTED</li>
<li>Event.PEER_LEFT</li>
<li>Event.PEER_DECLINED</li>
</ul>