Difference between revisions of "Gaming"

From GiderosMobile
(removed language stuff)
m
 
(2 intermediate revisions by one other user not shown)
Line 8: Line 8:
 
*Gaming.new("googleplay") -- Android
 
*Gaming.new("googleplay") -- Android
 
*Gaming.new("gamekit") -- iOS
 
*Gaming.new("gamekit") -- iOS
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
require("gaming")
 
require("gaming")
</source>
+
</syntaxhighlight>
  
 
Loading the '''gaming''' module also creates a global class '''Gaming'''.
 
Loading the '''gaming''' module also creates a global class '''Gaming'''.
Line 17: Line 17:
 
| style="width: 50%; vertical-align:top;"|
 
| style="width: 50%; vertical-align:top;"|
 
=== Methods ===
 
=== Methods ===
[[Gaming.new]] ''instanciate the Gaming plugin'' <br/><!--GIDEROSMTD:Gaming.new(backend) instanciate the Gaming plugin-->
+
[[Gaming.new]] ''instantiate the Gaming plugin''<br/><!--GIDEROSMTD:Gaming.new(backend) instantiate the Gaming plugin-->
 
[[Gaming:autoMatch]] <br/><!--GIDEROSMTD:Gaming:autoMatch()-->
 
[[Gaming:autoMatch]] <br/><!--GIDEROSMTD:Gaming:autoMatch()-->
[[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-->
 
[[Gaming:getAllPlayers]] <br/><!--GIDEROSMTD:Gaming:getAllPlayers()-->
 
[[Gaming:getAllPlayers]] <br/><!--GIDEROSMTD:Gaming:getAllPlayers()-->
[[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-->
 
[[Gaming:getPlayerInfo]] <br/><!--GIDEROSMTD:Gaming:getPlayerInfo()-->
 
[[Gaming:getPlayerInfo]] <br/><!--GIDEROSMTD:Gaming:getPlayerInfo()-->
[[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-->
[[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-->
[[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-->
[[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-->
 
[[Gaming:invitePlayers]] <br/><!--GIDEROSMTD:Gaming:invitePlayers()-->
 
[[Gaming:invitePlayers]] <br/><!--GIDEROSMTD:Gaming:invitePlayers()-->
[[Gaming:isLoggedIn]] ''Returns the login state in Gaming service'' <br/><!--GIDEROSMTD:Gaming:isLoggedIn() Returns the login state in Gaming service-->
+
[[Gaming:isLoggedIn]] ''return the login state in Gaming service''<br/><!--GIDEROSMTD:Gaming:isLoggedIn() return the login state in Gaming service-->
 
[[Gaming:joinRoom]] <br/><!--GIDEROSMTD:Gaming:joinRoom()-->
 
[[Gaming:joinRoom]] <br/><!--GIDEROSMTD:Gaming:joinRoom()-->
[[Gaming:loadAchievements]] ''Load all achievements'' <br/><!--GIDEROSMTD:Gaming:loadAchievements() Load all achievements-->
+
[[Gaming:loadAchievements]] ''load all achievements''<br/><!--GIDEROSMTD:Gaming:loadAchievements() load all achievements-->
[[Gaming:loadPlayerCenteredScores]] ''Load a leaderboard cenetered on the player'' <br/><!--GIDEROSMTD:Gaming:loadPlayerCenteredScores(leaderboardId,timeSpan,collection,maxEntries) Load a leaderboard centered on the player-->
+
[[Gaming:loadPlayerCenteredScores]] ''load a leaderboard centered on the player''<br/><!--GIDEROSMTD:Gaming:loadPlayerCenteredScores(leaderboardId,timeSpan,collection,maxEntries) load a leaderboard centered on the player-->
[[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-->
[[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-->
[[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-->
[[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-->
[[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-->
[[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-->
[[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-->
[[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-->
 
[[Gaming:sendTo]] <br/><!--GIDEROSMTD:Gaming:sendTo()-->
 
[[Gaming:sendTo]] <br/><!--GIDEROSMTD:Gaming:sendTo()-->
 
[[Gaming:sendToAll]] <br/><!--GIDEROSMTD:Gaming:sendToAll()-->
 
[[Gaming:sendToAll]] <br/><!--GIDEROSMTD:Gaming:sendToAll()-->
[[Gaming:showAchievements]]  ''Show the achievements'' <br/><!--GIDEROSMTD:Gaming:showAchievements() Show the achievements-->
+
[[Gaming:showAchievements]]  ''show the achievements''<br/><!--GIDEROSMTD:Gaming:showAchievements() show the achievements-->
 
[[Gaming:showInvitations]] <br/><!--GIDEROSMTD:Gaming:showInvitations()-->
 
[[Gaming:showInvitations]] <br/><!--GIDEROSMTD:Gaming:showInvitations()-->
[[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-->
[[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-->
[[Gaming:updateState]] ''Updates a save/state'' <br/><!--GIDEROSMTD:Gaming:updateState(key,data,immediate) Updates a save/state-->
+
[[Gaming:updateState]] ''update a save/state''<br/><!--GIDEROSMTD:Gaming:updateState(key,data,immediate) update a save/state-->
  
 
|style="width: 50%; vertical-align:top;"|
 
|style="width: 50%; vertical-align:top;"|

Latest revision as of 22:42, 7 December 2023

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 instantiate 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 return the login state in Gaming service
Gaming:joinRoom
Gaming:loadAchievements load all achievements
Gaming:loadPlayerCenteredScores load a leaderboard centered 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 update 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