Difference between revisions of "Gaming"

From GiderosMobile
(removed language stuff)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
 
 
<!-- GIDEROSOBJ:Gaming -->
 
<!-- GIDEROSOBJ:Gaming -->
'''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]]<br/>
+
'''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]]<br/>
'''<translate>Available since</translate>:''' Gideros 2012.09<br/>
+
'''Available since:''' Gideros 2012.09<br/>
=== <translate>Description</translate> ===
+
 
<translate><br />
+
=== Description ===
The [[Special:MyLanguage/Gaming|Gaming]] class is defined in the module &quot;gaming&quot;. Therefore, you need to call<br />
+
The '''Gaming''' class currently supports:
''require(&quot;gaming&quot;)'' before using it. Loading the Gaming module <br />
+
*Gaming.new("googleplay") -- Android
also creates a global class [[Special:MyLanguage/Gaming|Gaming]]. <br />
+
*Gaming.new("gamekit") -- iOS
 +
<source lang="lua">
 +
require("gaming")
 +
</source>
 +
 
 +
Loading the '''gaming''' module also creates a global class '''Gaming'''.
  
<p><strong>Currently supports:</strong></p>
 
<ul>
 
<li>Gaming.new("googleplay") -- Android</li>
 
<li>Gaming.new("gamekit") -- iOS</li>
 
</ul></translate>
 
 
{|-
 
{|-
 
| style="width: 50%; vertical-align:top;"|
 
| style="width: 50%; vertical-align:top;"|
=== <translate>Methods</translate> ===
+
=== Methods ===
[[Special:MyLanguage/Gaming.new|Gaming.new]] ''instanciate the Gaming plugin'' <br/><!-- GIDEROSMTD:Gaming.new(backend) instanciate the Gaming plugin -->
+
[[Gaming.new]] ''instanciate the Gaming plugin'' <br/><!--GIDEROSMTD:Gaming.new(backend) instanciate the Gaming plugin-->
[[Special:MyLanguage/Gaming:autoMatch|Gaming:autoMatch]] <br/><!-- GIDEROSMTD:Gaming:autoMatch() -->
+
[[Gaming:autoMatch]] <br/><!--GIDEROSMTD:Gaming:autoMatch()-->
[[Special:MyLanguage/Gaming:deleteState|Gaming:deleteState]] ''remove the specified save/state'' <br/><!-- GIDEROSMTD:Gaming:deleteState(key) remove the specified save/state -->
+
[[Gaming:deleteState]] ''remove the specified save/state'' <br/><!--GIDEROSMTD:Gaming:deleteState(key) remove the specified save/state-->
[[Special:MyLanguage/Gaming:getAllPlayers|Gaming:getAllPlayers]] <br/><!-- GIDEROSMTD:Gaming:getAllPlayers() -->
+
[[Gaming:getAllPlayers]] <br/><!--GIDEROSMTD:Gaming:getAllPlayers()-->
[[Special:MyLanguage/Gaming:getPlayerId|Gaming:getPlayerId]] ''Get the id of current player'' <br/><!-- GIDEROSMTD:Gaming:getPlayerId() Get the id of current player -->
+
[[Gaming:getPlayerId]] ''Get the id of current player'' <br/><!--GIDEROSMTD:Gaming:getPlayerId() Get the id of current player-->
[[Special:MyLanguage/Gaming:getPlayerInfo|Gaming:getPlayerInfo]] <br/><!-- GIDEROSMTD:Gaming:getPlayerInfo() -->
+
[[Gaming:getPlayerInfo]] <br/><!--GIDEROSMTD:Gaming:getPlayerInfo()-->
[[Special:MyLanguage/Gaming:getPlayerName|Gaming:getPlayerName]] ''Get the name of current player'' <br/><!-- GIDEROSMTD:Gaming:getPlayerName() Get the name of current player -->
+
[[Gaming:getPlayerName]] ''Get the name of current player'' <br/><!--GIDEROSMTD:Gaming:getPlayerName() Get the name of current player-->
[[Special:MyLanguage/Gaming:getPlayerPicture|Gaming:getPlayerPicture]] ''Get the profile picture of current player'' <br/><!-- GIDEROSMTD:Gaming:getPlayerPicture() Get the profile picture of current player -->
+
[[Gaming:getPlayerPicture]] ''Get the profile picture of current player'' <br/><!--GIDEROSMTD:Gaming:getPlayerPicture() Get the profile picture of current player-->
[[Special:MyLanguage/Gaming:getPlayerScore|Gaming:getPlayerScore]] ''Get the score of current player'' <br/><!-- GIDEROSMTD:Gaming:getPlayerScore() Get the score of current player -->
+
[[Gaming:getPlayerScore]] ''Get the score of current player'' <br/><!--GIDEROSMTD:Gaming:getPlayerScore() Get the score of current player-->
[[Special:MyLanguage/Gaming:incrementAchievement|Gaming:incrementAchievement]] ''Increment the progress toward an achievement'' <br/><!-- GIDEROSMTD:Gaming:incrementAchievement(achievementId,numSteps,immediate) Increment the progress toward an achievement -->
+
[[Gaming:incrementAchievement]] ''Increment the progress toward an achievement'' <br/><!--GIDEROSMTD:Gaming:incrementAchievement(achievementId,numSteps,immediate) Increment the progress toward an achievement-->
[[Special:MyLanguage/Gaming:invitePlayers|Gaming:invitePlayers]] <br/><!-- GIDEROSMTD:Gaming:invitePlayers() -->
+
[[Gaming:invitePlayers]] <br/><!--GIDEROSMTD:Gaming:invitePlayers()-->
[[Special:MyLanguage/Gaming:isLoggedIn|Gaming:isLoggedIn]] ''Returns the login state in Gaming service'' <br/><!-- GIDEROSMTD:Gaming:isLoggedIn() Returns the login state in Gaming service -->
+
[[Gaming:isLoggedIn]] ''Returns the login state in Gaming service'' <br/><!--GIDEROSMTD:Gaming:isLoggedIn() Returns the login state in Gaming service-->
[[Special:MyLanguage/Gaming:joinRoom|Gaming:joinRoom]] <br/><!-- GIDEROSMTD:Gaming:joinRoom() -->
+
[[Gaming:joinRoom]] <br/><!--GIDEROSMTD:Gaming:joinRoom()-->
[[Special:MyLanguage/Gaming:loadAchievements|Gaming:loadAchievements]] ''Load all achievements'' <br/><!-- GIDEROSMTD:Gaming:loadAchievements() Load all achievements -->
+
[[Gaming:loadAchievements]] ''Load all achievements'' <br/><!--GIDEROSMTD:Gaming:loadAchievements() Load all achievements-->
[[Special:MyLanguage/Gaming:loadPlayerCenteredScores|Gaming:loadPlayerCenteredScores]] ''Load a leaderboard cenetered on the player'' <br/><!-- GIDEROSMTD:Gaming:loadPlayerCenteredScores(leaderboardId,timeSpan,collection,maxEntries) Load a leaderboard cenetered on the player -->
+
[[Gaming:loadPlayerCenteredScores]] ''Load a leaderboard cenetered on the player'' <br/><!--GIDEROSMTD:Gaming:loadPlayerCenteredScores(leaderboardId,timeSpan,collection,maxEntries) Load a leaderboard centered on the player-->
[[Special:MyLanguage/Gaming:loadScores|Gaming:loadScores]] ''Load a leaderboard'' <br/><!-- GIDEROSMTD:Gaming:loadScores(leaderboardId,timeSpan,collection,maxEntries) Load a leaderboard -->
+
[[Gaming:loadScores]] ''Load a leaderboard'' <br/><!--GIDEROSMTD:Gaming:loadScores(leaderboardId,timeSpan,collection,maxEntries) Load a leaderboard-->
[[Special:MyLanguage/Gaming:loadState|Gaming:loadState]] ''Load a save/state'' <br/><!-- GIDEROSMTD:Gaming:loadState(key) Load a save/state -->
+
[[Gaming:loadState]] ''Load a save/state'' <br/><!--GIDEROSMTD:Gaming:loadState(key) Load a save/state-->
[[Special:MyLanguage/Gaming:login|Gaming:login]] ''Log in the Gaming service'' <br/><!-- GIDEROSMTD:Gaming:login() Log in the Gaming service -->
+
[[Gaming:login]] ''Log in the Gaming service'' <br/><!--GIDEROSMTD:Gaming:login() Log in the Gaming service-->
[[Special:MyLanguage/Gaming:logout|Gaming:logout]] ''Log out of the gaming service'' <br/><!-- GIDEROSMTD:Gaming:logout() Log out of the gaming service -->
+
[[Gaming:logout]] ''Log out of the gaming service'' <br/><!--GIDEROSMTD:Gaming:logout() Log out of the gaming service-->
[[Special:MyLanguage/Gaming:reportAchievement|Gaming:reportAchievement]] ''Report an achievement progress'' <br/><!-- GIDEROSMTD:Gaming:reportAchievement(achievementId,numSteps,immediate) Report an achievement progress -->
+
[[Gaming:reportAchievement]] ''Report an achievement progress'' <br/><!--GIDEROSMTD:Gaming:reportAchievement(achievementId,numSteps,immediate) Report an achievement progress-->
[[Special:MyLanguage/Gaming:reportScore|Gaming:reportScore]] ''Report a new score'' <br/><!-- GIDEROSMTD:Gaming:reportScore(leaderboardId,score,immediate) Report a new score -->
+
[[Gaming:reportScore]] ''Report a new score'' <br/><!--GIDEROSMTD:Gaming:reportScore(leaderboardId,score,immediate) Report a new score-->
[[Special:MyLanguage/Gaming:resolveState|Gaming:resolveState]] ''Resolve a save/state conflict'' <br/><!-- GIDEROSMTD:Gaming:resolveState(key,version,data) Resolve a save/state conflict -->
+
[[Gaming:resolveState]] ''Resolve a save/state conflict'' <br/><!--GIDEROSMTD:Gaming:resolveState(key,version,data) Resolve a save/state conflict-->
[[Special:MyLanguage/Gaming:revealAchievement|Gaming:revealAchievement]] ''Reveal an achievement'' <br/><!-- GIDEROSMTD:Gaming:revealAchievement(achievementId,immediate) Reveal an achievement -->
+
[[Gaming:revealAchievement]] ''Reveal an achievement'' <br/><!--GIDEROSMTD:Gaming:revealAchievement(achievementId,immediate) Reveal an achievement-->
[[Special:MyLanguage/Gaming:sendTo|Gaming:sendTo]] <br/><!-- GIDEROSMTD:Gaming:sendTo() -->
+
[[Gaming:sendTo]] <br/><!--GIDEROSMTD:Gaming:sendTo()-->
[[Special:MyLanguage/Gaming:sendToAll|Gaming:sendToAll]] <br/><!-- GIDEROSMTD:Gaming:sendToAll() -->
+
[[Gaming:sendToAll]] <br/><!--GIDEROSMTD:Gaming:sendToAll()-->
[[Special:MyLanguage/Gaming:showAchievements|Gaming:showAchievements]]  ''Show the achievements'' <br/><!-- GIDEROSMTD:Gaming:showAchievements() Show the achievements -->
+
[[Gaming:showAchievements]]  ''Show the achievements'' <br/><!--GIDEROSMTD:Gaming:showAchievements() Show the achievements-->
[[Special:MyLanguage/Gaming:showInvitations|Gaming:showInvitations]] <br/><!-- GIDEROSMTD:Gaming:showInvitations() -->
+
[[Gaming:showInvitations]] <br/><!--GIDEROSMTD:Gaming:showInvitations()-->
[[Special:MyLanguage/Gaming:showLeaderboard|Gaming:showLeaderboard]] ''Show a leaderboard'' <br/><!-- GIDEROSMTD:Gaming:showLeaderboard(leaderboardId) Show a leaderboard -->
+
[[Gaming:showLeaderboard]] ''Show a leaderboard'' <br/><!--GIDEROSMTD:Gaming:showLeaderboard(leaderboardId) Show a leaderboard-->
[[Special:MyLanguage/Gaming:showWaitingRoom|Gaming:showWaitingRoom]] ''Display the waiting room'' <br/><!-- GIDEROSMTD:Gaming:showWaitingRoom() Display the waiting room -->
+
[[Gaming:showWaitingRoom]] ''Display the waiting room'' <br/><!--GIDEROSMTD:Gaming:showWaitingRoom() Display the waiting room-->
[[Special:MyLanguage/Gaming:updateState|Gaming:updateState]] ''Updates a save/state'' <br/><!-- GIDEROSMTD:Gaming:updateState(key,data,immediate) Updates a save/state -->
+
[[Gaming:updateState]] ''Updates a save/state'' <br/><!--GIDEROSMTD:Gaming:updateState(key,data,immediate) Updates a save/state-->
| style="width: 50%; vertical-align:top;"|
 
  
=== <translate>Events</translate> ===
+
|style="width: 50%; vertical-align:top;"|
[[Special:MyLanguage/Event.CONNECTED_TO_ROOM|Event.CONNECTED_TO_ROOM]]<br/><!-- GIDEROSEVT:Event.CONNECTED_TO_ROOM conntectedToRoom-->
+
=== Events ===
[[Special:MyLanguage/Event.DATA_RECEIVED|Event.DATA_RECEIVED]]<br/><!-- GIDEROSEVT:Event.DATA_RECEIVED dataReceived-->
+
[[Event.CONNECTED_TO_ROOM]]<br/><!--GIDEROSEVT:Event.CONNECTED_TO_ROOM conntectedToRoom-->
[[Special:MyLanguage/Event.DISCONNECTED_FROM_ROOM|Event.DISCONNECTED_FROM_ROOM]]<br/><!-- GIDEROSEVT:Event.DISCONNECTED_FROM_ROOM disconntectedFromRoom-->
+
[[Event.DATA_RECEIVED]]<br/><!--GIDEROSEVT:Event.DATA_RECEIVED dataReceived-->
[[Special:MyLanguage/Event.GAME_STARTED|Event.GAME_STARTED]]<br/><!-- GIDEROSEVT:Event.GAME_STARTED gameStarted-->
+
[[Event.DISCONNECTED_FROM_ROOM]]<br/><!--GIDEROSEVT:Event.DISCONNECTED_FROM_ROOM disconntectedFromRoom-->
[[Special:MyLanguage/Event.INVITATION_RECEIVED|Event.INVITATION_RECEIVED]]<br/><!-- GIDEROSEVT:Event.INVITATION_RECEIVED invitationReceived-->
+
[[Event.GAME_STARTED]]<br/><!--GIDEROSEVT:Event.GAME_STARTED gameStarted-->
[[Special:MyLanguage/Event.JOINED_ROOM|Event.JOINED_ROOM]]<br/><!-- GIDEROSEVT:Event.JOINED_ROOM joinedRoom-->
+
[[Event.INVITATION_RECEIVED]]<br/><!--GIDEROSEVT:Event.INVITATION_RECEIVED invitationReceived-->
[[Special:MyLanguage/Event.LEFT_ROOM|Event.LEFT_ROOM]]<br/><!-- GIDEROSEVT:Event.LEFT_ROOM leftRoom-->
+
[[Event.JOINED_ROOM]]<br/><!--GIDEROSEVT:Event.JOINED_ROOM joinedRoom-->
[[Special:MyLanguage/Event.LOAD_ACHIEVEMENTS_COMPLETE|Event.LOAD_ACHIEVEMENTS_COMPLETE]]<br/><!-- GIDEROSEVT:Event.LOAD_ACHIEVEMENTS_COMPLETE loadAchievementsComplete-->
+
[[Event.LEFT_ROOM]]<br/><!--GIDEROSEVT:Event.LEFT_ROOM leftRoom-->
[[Special:MyLanguage/Event.LOAD_ACHIEVEMENTS_ERROR|Event.LOAD_ACHIEVEMENTS_ERROR]]<br/><!-- GIDEROSEVT:Event.LOAD_ACHIEVEMENTS_ERROR loadAchievementsError-->
+
[[Event.LOAD_ACHIEVEMENTS_COMPLETE]]<br/><!--GIDEROSEVT:Event.LOAD_ACHIEVEMENTS_COMPLETE loadAchievementsComplete-->
[[Special:MyLanguage/Event.LOAD_SCORES_COMPLETE|Event.LOAD_SCORES_COMPLETE]]<br/><!-- GIDEROSEVT:Event.LOAD_SCORES_COMPLETE loadScoresComplete-->
+
[[Event.LOAD_ACHIEVEMENTS_ERROR]]<br/><!--GIDEROSEVT:Event.LOAD_ACHIEVEMENTS_ERROR loadAchievementsError-->
[[Special:MyLanguage/Event.LOAD_SCORES_ERROR|Event.LOAD_SCORES_ERROR]]<br/><!-- GIDEROSEVT:Event.LOAD_SCORES_ERROR loadScoresComplete-->
+
[[Event.LOAD_SCORES_COMPLETE]]<br/><!--GIDEROSEVT:Event.LOAD_SCORES_COMPLETE loadScoresComplete-->
[[Special:MyLanguage/Event.LOGIN_COMPLETE|Event.LOGIN_COMPLETE]]<br/><!-- GIDEROSEVT:Event.LOGIN_COMPLETE loginComplete-->
+
[[Event.LOAD_SCORES_ERROR]]<br/><!--GIDEROSEVT:Event.LOAD_SCORES_ERROR loadScoresComplete-->
[[Special:MyLanguage/Event.LOGIN_ERROR|Event.LOGIN_ERROR]]<br/><!-- GIDEROSEVT:Event.LOGIN_ERROR loginError-->
+
[[Event.LOGIN_COMPLETE]]<br/><!--GIDEROSEVT:Event.LOGIN_COMPLETE loginComplete-->
[[Special:MyLanguage/Event.PEER_CONNECTED|Event.PEER_CONNECTED]]<br/><!-- GIDEROSEVT:Event.PEER_CONNECTED peerConnected-->
+
[[Event.LOGIN_ERROR]]<br/><!--GIDEROSEVT:Event.LOGIN_ERROR loginError-->
[[Special:MyLanguage/Event.PEER_DECLINED|Event.PEER_DECLINED]]<br/><!-- GIDEROSEVT:Event.PEER_DECLINED peerDeclined-->
+
[[Event.PEER_CONNECTED]]<br/><!--GIDEROSEVT:Event.PEER_CONNECTED peerConnected-->
[[Special:MyLanguage/Event.PEER_DISCONNECTED|Event.PEER_DISCONNECTED]]<br/><!-- GIDEROSEVT:Event.PEER_DISCONNECTED peerDisconnected-->
+
[[Event.PEER_DECLINED]]<br/><!--GIDEROSEVT:Event.PEER_DECLINED peerDeclined-->
[[Special:MyLanguage/Event.PEER_INVITED|Event.PEER_INVITED]]<br/><!-- GIDEROSEVT:Event.PEER_INVITED peerInvited-->
+
[[Event.PEER_DISCONNECTED]]<br/><!--GIDEROSEVT:Event.PEER_DISCONNECTED peerDisconnected-->
[[Special:MyLanguage/Event.PEER_JOINED|Event.PEER_JOINED]]<br/><!-- GIDEROSEVT:Event.PEER_JOINED peerJoined-->
+
[[Event.PEER_INVITED]]<br/><!--GIDEROSEVT:Event.PEER_INVITED peerInvited-->
[[Special:MyLanguage/Event.PEER_LEFT|Event.PEER_LEFT]]<br/><!-- GIDEROSEVT:Event.PEER_LEFT peerLeft-->
+
[[Event.PEER_JOINED]]<br/><!--GIDEROSEVT:Event.PEER_JOINED peerJoined-->
[[Special:MyLanguage/Event.PLAYER_INFORMATION_COMPLETE|Event.PLAYER_INFORMATION_COMPLETE]]<br/><!-- GIDEROSEVT:Event.PLAYER_INFORMATION_COMPLETE playerInformationComplete-->
+
[[Event.PEER_LEFT]]<br/><!--GIDEROSEVT:Event.PEER_LEFT peerLeft-->
[[Special:MyLanguage/Event.PLAYER_INFORMATION_ERROR|Event.PLAYER_INFORMATION_ERROR]]<br/><!-- GIDEROSEVT:Event.PLAYER_INFORMATION_ERROR playerInformationError-->
+
[[Event.PLAYER_INFORMATION_COMPLETE]]<br/><!--GIDEROSEVT:Event.PLAYER_INFORMATION_COMPLETE playerInformationComplete-->
[[Special:MyLanguage/Event.PLAYER_SCORE_COMPLETE|Event.PLAYER_SCORE_COMPLETE]]<br/><!-- GIDEROSEVT:Event.PLAYER_SCORE_COMPLETE playerScoreComplete-->
+
[[Event.PLAYER_INFORMATION_ERROR]]<br/><!--GIDEROSEVT:Event.PLAYER_INFORMATION_ERROR playerInformationError-->
[[Special:MyLanguage/Event.PLAYER_SCORE_ERROR|Event.PLAYER_SCORE_ERROR]]<br/><!-- GIDEROSEVT:Event.PLAYER_SCORE_ERROR playerScoreError-->
+
[[Event.PLAYER_SCORE_COMPLETE]]<br/><!--GIDEROSEVT:Event.PLAYER_SCORE_COMPLETE playerScoreComplete-->
[[Special:MyLanguage/Event.REPORT_ACHIEVEMENT_COMPLETE|Event.REPORT_ACHIEVEMENT_COMPLETE]]<br/><!-- GIDEROSEVT:Event.REPORT_ACHIEVEMENT_COMPLETE reportAchievementComplete-->
+
[[Event.PLAYER_SCORE_ERROR]]<br/><!--GIDEROSEVT:Event.PLAYER_SCORE_ERROR playerScoreError-->
[[Special:MyLanguage/Event.REPORT_ACHIEVEMENT_ERROR|Event.REPORT_ACHIEVEMENT_ERROR]]<br/><!-- GIDEROSEVT:Event.REPORT_ACHIEVEMENT_ERROR reportAchievementError-->
+
[[Event.REPORT_ACHIEVEMENT_COMPLETE]]<br/><!--GIDEROSEVT:Event.REPORT_ACHIEVEMENT_COMPLETE reportAchievementComplete-->
[[Special:MyLanguage/Event.REPORT_SCORE_COMPLETE|Event.REPORT_SCORE_COMPLETE]]<br/><!-- GIDEROSEVT:Event.REPORT_SCORE_COMPLETE reportScoreComplete-->
+
[[Event.REPORT_ACHIEVEMENT_ERROR]]<br/><!--GIDEROSEVT:Event.REPORT_ACHIEVEMENT_ERROR reportAchievementError-->
[[Special:MyLanguage/Event.REPORT_SCORE_ERROR|Event.REPORT_SCORE_ERROR]]<br/><!-- GIDEROSEVT:Event.REPORT_SCORE_ERROR reportScoreError-->
+
[[Event.REPORT_SCORE_COMPLETE]]<br/><!--GIDEROSEVT:Event.REPORT_SCORE_COMPLETE reportScoreComplete-->
[[Special:MyLanguage/Event.ROOM_AUTO_MATCHING|Event.ROOM_AUTO_MATCHING]]<br/><!-- GIDEROSEVT:Event.ROOM_AUTO_MATCHING roomAutoMatching-->
+
[[Event.REPORT_SCORE_ERROR]]<br/><!--GIDEROSEVT:Event.REPORT_SCORE_ERROR reportScoreError-->
[[Special:MyLanguage/Event.ROOM_CONNECTED|Event.ROOM_CONNECTED]]<br/><!-- GIDEROSEVT:Event.ROOM_CONNECTED roomConnected-->
+
[[Event.ROOM_AUTO_MATCHING]]<br/><!--GIDEROSEVT:Event.ROOM_AUTO_MATCHING roomAutoMatching-->
[[Special:MyLanguage/Event.ROOM_CONNECTING|Event.ROOM_CONNECTING]]<br/><!-- GIDEROSEVT:Event.ROOM_CONNECTING roomConnecting-->
+
[[Event.ROOM_CONNECTED]]<br/><!--GIDEROSEVT:Event.ROOM_CONNECTED roomConnected-->
[[Special:MyLanguage/Event.ROOM_CREATED|Event.ROOM_CREATED]]<br/><!-- GIDEROSEVT:Event.ROOM_CREATED roomCreated-->
+
[[Event.ROOM_CONNECTING]]<br/><!--GIDEROSEVT:Event.ROOM_CONNECTING roomConnecting-->
[[Special:MyLanguage/Event.STATE_CONFLICT|Event.STATE_CONFLICT]]<br/><!-- GIDEROSEVT:Event.STATE_CONFLICT stateConflict-->
+
[[Event.ROOM_CREATED]]<br/><!--GIDEROSEVT:Event.ROOM_CREATED roomCreated-->
[[Special:MyLanguage/Event.STATE_DELETED|Event.STATE_DELETED]]<br/><!-- GIDEROSEVT:Event.STATE_DELETED stateDeleted-->
+
[[Event.STATE_CONFLICT]]<br/><!--GIDEROSEVT:Event.STATE_CONFLICT stateConflict-->
[[Special:MyLanguage/Event.STATE_ERROR|Event.STATE_ERROR]]<br/><!-- GIDEROSEVT:Event.STATE_ERROR stateError-->
+
[[Event.STATE_DELETED]]<br/><!--GIDEROSEVT:Event.STATE_DELETED stateDeleted-->
[[Special:MyLanguage/Event.STATE_LOADED|Event.STATE_LOADED]]<br/><!-- GIDEROSEVT:Event.STATE_LOADED stateLoaded-->
+
[[Event.STATE_ERROR]]<br/><!--GIDEROSEVT:Event.STATE_ERROR stateError-->
=== <translate>Constants</translate> ===
+
[[Event.STATE_LOADED]]<br/><!--GIDEROSEVT:Event.STATE_LOADED stateLoaded-->
[[Special:MyLanguage/Gaming.ALL_PLAYERS|Gaming.ALL_PLAYERS]]<br/><!-- GIDEROSCST:Gaming.ALL_PLAYERS 1-->
+
=== Constants ===
[[Special:MyLanguage/Gaming.ALL_TIME|Gaming.ALL_TIME]]<br/><!-- GIDEROSCST:Gaming.ALL_TIME 2-->
+
[[Gaming.ALL_PLAYERS]]<br/><!--GIDEROSCST:Gaming.ALL_PLAYERS 1-->
[[Special:MyLanguage/Gaming.FRIENDS|Gaming.FRIENDS]]<br/><!-- GIDEROSCST:Gaming.FRIENDS 0-->
+
[[Gaming.ALL_TIME]]<br/><!--GIDEROSCST:Gaming.ALL_TIME 2-->
[[Special:MyLanguage/Gaming.HIDDEN|Gaming.HIDDEN]]<br/><!-- GIDEROSCST:Gaming.HIDDEN 2-->
+
[[Gaming.FRIENDS]]<br/><!--GIDEROSCST:Gaming.FRIENDS 0-->
[[Special:MyLanguage/Gaming.REVEALED|Gaming.REVEALED]]<br/><!-- GIDEROSCST:Gaming.REVEALED 1-->
+
[[Gaming.HIDDEN]]<br/><!--GIDEROSCST:Gaming.HIDDEN 2-->
[[Special:MyLanguage/Gaming.TODAY|Gaming.TODAY]]<br/><!-- GIDEROSCST:Gaming.TODAY 0-->
+
[[Gaming.REVEALED]]<br/><!--GIDEROSCST:Gaming.REVEALED 1-->
[[Special:MyLanguage/Gaming.UNLOCKED|Gaming.UNLOCKED]]<br/><!-- GIDEROSCST:Gaming.UNLOCKED 0-->
+
[[Gaming.TODAY]]<br/><!--GIDEROSCST:Gaming.TODAY 0-->
[[Special:MyLanguage/Gaming.WEEK|Gaming.WEEK]]<br/><!-- GIDEROSCST:Gaming.WEEK 1-->
+
[[Gaming.UNLOCKED]]<br/><!--GIDEROSCST:Gaming.UNLOCKED 0-->
 +
[[Gaming.WEEK]]<br/><!--GIDEROSCST:Gaming.WEEK 1-->
 
|}
 
|}
  
 
{{GIDEROS IMPORTANT LINKS}}
 
{{GIDEROS IMPORTANT LINKS}}

Revision as of 20:23, 1 April 2021

Supported platforms: Platform android.pngPlatform ios.png
Available since: Gideros 2012.09

Description

The Gaming class currently supports:

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

Loading the gaming module also creates a global class Gaming.

Methods

Gaming.new instanciate the Gaming plugin
Gaming:autoMatch
Gaming:deleteState remove the specified save/state
Gaming:getAllPlayers
Gaming:getPlayerId Get the id of current player
Gaming:getPlayerInfo
Gaming:getPlayerName Get the name of current player
Gaming:getPlayerPicture Get the profile picture of current player
Gaming:getPlayerScore Get the score of current player
Gaming:incrementAchievement Increment the progress toward an achievement
Gaming:invitePlayers
Gaming:isLoggedIn Returns the login state in Gaming service
Gaming:joinRoom
Gaming:loadAchievements Load all achievements
Gaming:loadPlayerCenteredScores Load a leaderboard cenetered on the player
Gaming:loadScores Load a leaderboard
Gaming:loadState Load a save/state
Gaming:login Log in the Gaming service
Gaming:logout Log out of the gaming service
Gaming:reportAchievement Report an achievement progress
Gaming:reportScore Report a new score
Gaming:resolveState Resolve a save/state conflict
Gaming:revealAchievement Reveal an achievement
Gaming:sendTo
Gaming:sendToAll
Gaming:showAchievements Show the achievements
Gaming:showInvitations
Gaming:showLeaderboard Show a leaderboard
Gaming:showWaitingRoom Display the waiting room
Gaming:updateState Updates a save/state

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