Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL

9. Handling Multiple Devices and Network... > OpenFeint in a jiffy - Pg. 295

Chapter 9 Example: The following unlocks the specified achievement: gameNetwork.request( "unlockAchievement", "achievementId" ) The following sets a high score on the leaderboard: gameNetwork.request( "setHighScore", { leaderboardID="1234567", score=50, displayText="50 points" } ) The preceding function takes a table as the parameter with the following elements: leaderboardID : String. The ID of the OpenFeint leaderboard where the high score should be posted. score : Number. The new high score value to post to the specified leaderboard. displayText : String. An optional string to display in place of the numeric score specified by the value assigned to the score parameter. The following saves a blob of game data in the cloud, using OpenFeint's Network Save Card feature: gameNetwork.request( "uploadBlob", key, data ) The following downloads data saved previously saved uploadBlob: gameNetwork.request( "downloadBlob", key, listener ) -- listener for "completion" event with "blob" key set.