Difference between revisions of "Gaming"

From GiderosMobile
Line 12: Line 12:
 
<li>Gaming.new("googleplay") -- Android</li>
 
<li>Gaming.new("googleplay") -- Android</li>
 
<li>Gaming.new("gamekit") -- iOS</li>
 
<li>Gaming.new("gamekit") -- iOS</li>
</ul>
+
</ul>{|-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
{|-
 
 
| style="width: 50%;"|
 
| style="width: 50%;"|
 
=== Methods ===
 
=== Methods ===
Line 126: Line 47:
 
| style="width: 50%;"|
 
| style="width: 50%;"|
 
=== Events ===
 
=== Events ===
[[Event.CONNECTED_TO_ROOM]]
+
[[Event.CONNECTED_TO_ROOM]]<br/>
[[Event.DATA_RECEIVED]]
+
[[Event.DATA_RECEIVED]]<br/>
[[Event.DISCONNECTED_FROM_ROOM]]
+
[[Event.DISCONNECTED_FROM_ROOM]]<br/>
[[Event.GAME_STARTED]]
+
[[Event.GAME_STARTED]]<br/>
[[Event.INVITATION_RECEIVED]]
+
[[Event.INVITATION_RECEIVED]]<br/>
[[Event.JOINED_ROOM]]
+
[[Event.JOINED_ROOM]]<br/>
[[Event.LEFT_ROOM]]
+
[[Event.LEFT_ROOM]]<br/>
[[Event.LOAD_ACHIEVEMENTS_COMPLETE]]
+
[[Event.LOAD_ACHIEVEMENTS_COMPLETE]]<br/>
[[Event.LOAD_ACHIEVEMENTS_ERROR]]
+
[[Event.LOAD_ACHIEVEMENTS_ERROR]]<br/>
[[Event.LOAD_SCORES_COMPLETE]]
+
[[Event.LOAD_SCORES_COMPLETE]]<br/>
[[Event.LOAD_SCORES_ERROR]]
+
[[Event.LOAD_SCORES_ERROR]]<br/>
[[Event.LOGIN_COMPLETE]]
+
[[Event.LOGIN_COMPLETE]]<br/>
[[Event.LOGIN_ERROR]]
+
[[Event.LOGIN_ERROR]]<br/>
[[Event.PEER_CONNECTED]]
+
[[Event.PEER_CONNECTED]]<br/>
[[Event.PEER_DECLINED]]
+
[[Event.PEER_DECLINED]]<br/>
[[Event.PEER_DISCONNECTED]]
+
[[Event.PEER_DISCONNECTED]]<br/>
[[Event.PEER_INVITED]]
+
[[Event.PEER_INVITED]]<br/>
[[Event.PEER_JOINED]]
+
[[Event.PEER_JOINED]]<br/>
[[Event.PEER_LEFT]]
+
[[Event.PEER_LEFT]]<br/>
[[Event.PLAYER_INFORMATION_COMPLETE]]
+
[[Event.PLAYER_INFORMATION_COMPLETE]]<br/>
[[Event.PLAYER_INFORMATION_ERROR]]
+
[[Event.PLAYER_INFORMATION_ERROR]]<br/>
[[Event.PLAYER_SCORE_COMPLETE]]
+
[[Event.PLAYER_SCORE_COMPLETE]]<br/>
[[Event.PLAYER_SCORE_ERROR]]
+
[[Event.PLAYER_SCORE_ERROR]]<br/>
[[Event.REPORT_ACHIEVEMENT_COMPLETE]]
+
[[Event.REPORT_ACHIEVEMENT_COMPLETE]]<br/>
[[Event.REPORT_ACHIEVEMENT_ERROR]]
+
[[Event.REPORT_ACHIEVEMENT_ERROR]]<br/>
[[Event.REPORT_SCORE_COMPLETE]]
+
[[Event.REPORT_SCORE_COMPLETE]]<br/>
[[Event.REPORT_SCORE_ERROR]]
+
[[Event.REPORT_SCORE_ERROR]]<br/>
[[Event.ROOM_AUTO_MATCHING]]
+
[[Event.ROOM_AUTO_MATCHING]]<br/>
[[Event.ROOM_CONNECTED]]
+
[[Event.ROOM_CONNECTED]]<br/>
[[Event.ROOM_CONNECTING]]
+
[[Event.ROOM_CONNECTING]]<br/>
[[Event.ROOM_CREATED]]
+
[[Event.ROOM_CREATED]]<br/>
[[Event.STATE_CONFLICT]]
+
[[Event.STATE_CONFLICT]]<br/>
[[Event.STATE_DELETED]]
+
[[Event.STATE_DELETED]]<br/>
[[Event.STATE_ERROR]]
+
[[Event.STATE_ERROR]]<br/>
[[Event.STATE_LOADED]]
+
[[Event.STATE_LOADED]]<br/>
 
=== Constants ===
 
=== Constants ===
[[Gaming.ALL_PLAYERS]]
+
[[Gaming.ALL_PLAYERS]]<br/>
[[Gaming.ALL_TIME]]
+
[[Gaming.ALL_TIME]]<br/>
[[Gaming.FRIENDS]]
+
[[Gaming.FRIENDS]]<br/>
[[Gaming.HIDDEN]]
+
[[Gaming.HIDDEN]]<br/>
[[Gaming.REVEALED]]
+
[[Gaming.REVEALED]]<br/>
[[Gaming.TODAY]]
+
[[Gaming.TODAY]]<br/>
[[Gaming.UNLOCKED]]
+
[[Gaming.UNLOCKED]]<br/>
[[Gaming.WEEK]]
+
[[Gaming.WEEK]]<br/>
 
|}
 
|}

Revision as of 09:12, 23 August 2018

Supported platforms: android, ios
Available since: Gideros 2012.09

Description


The `Gaming` class is defined in the module "gaming". Therefore, you need to call
`require("gaming")` before using it. Loading the Gaming module
also creates a global class `Gaming`.

Currently supports:

  • Gaming.new("googleplay") -- Android
  • Gaming.new("gamekit") -- iOS

{|-

| style="width: 50%;"|

Methods

Gaming.new -
Gaming:autoMatch -
Gaming:deleteState -
Gaming:getAllPlayers -
Gaming:getPlayerId -
Gaming:getPlayerInfo -
Gaming:getPlayerName -
Gaming:getPlayerPicture -
Gaming:getPlayerScore -
Gaming:incrementAchievement -
Gaming:invitePlayers -
Gaming:isLoggedIn -
Gaming:joinRoom -
Gaming:loadAchievements -
Gaming:loadPlayerCenteredScores -
Gaming:loadScores -
Gaming:loadState -
Gaming:login -
Gaming:logout -
Gaming:reportAchievement -
Gaming:reportScore -
Gaming:resolveState -
Gaming:revealAchievement -
Gaming:sendTo -
Gaming:sendToAll -
Gaming:showAchievements -
Gaming:showInvitations -
Gaming:showLeaderboard -
Gaming:showWaitingRoom -
Gaming:updateState -
| style="width: 50%;"|

Events

Event.CONNECTED_TO_ROOM
Event.DATA_RECEIVED
Event.DISCONNECTED_FROM_ROOM
Event.GAME_STARTED
Event.INVITATION_RECEIVED
Event.JOINED_ROOM
Event.LEFT_ROOM
Event.LOAD_ACHIEVEMENTS_COMPLETE
Event.LOAD_ACHIEVEMENTS_ERROR
Event.LOAD_SCORES_COMPLETE
Event.LOAD_SCORES_ERROR
Event.LOGIN_COMPLETE
Event.LOGIN_ERROR
Event.PEER_CONNECTED
Event.PEER_DECLINED
Event.PEER_DISCONNECTED
Event.PEER_INVITED
Event.PEER_JOINED
Event.PEER_LEFT
Event.PLAYER_INFORMATION_COMPLETE
Event.PLAYER_INFORMATION_ERROR
Event.PLAYER_SCORE_COMPLETE
Event.PLAYER_SCORE_ERROR
Event.REPORT_ACHIEVEMENT_COMPLETE
Event.REPORT_ACHIEVEMENT_ERROR
Event.REPORT_SCORE_COMPLETE
Event.REPORT_SCORE_ERROR
Event.ROOM_AUTO_MATCHING
Event.ROOM_CONNECTED
Event.ROOM_CONNECTING
Event.ROOM_CREATED
Event.STATE_CONFLICT
Event.STATE_DELETED
Event.STATE_ERROR
Event.STATE_LOADED

Constants

Gaming.ALL_PLAYERS
Gaming.ALL_TIME
Gaming.FRIENDS
Gaming.HIDDEN
Gaming.REVEALED
Gaming.TODAY
Gaming.UNLOCKED
Gaming.WEEK
|}