From fdea18bddf3a0b9b201f4582fdc6e9042e1c30d2 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 5 Feb 2015 21:11:27 +0300 Subject: [PATCH] Add README.MD --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..66a6afb --- /dev/null +++ b/README.md @@ -0,0 +1,55 @@ +# GameJolt.lua +Provides access to GameJolt's services for Lua-based projects. + +# Usage +Put the files from the repo into your app's folder. + +```lua +local GJ = require "gamejolt" + +GJ.init(gameID, gameKey) +GJ.authUser(username, usertoken) +GJ.openSession() + +-- your further manipulations +``` + +Haxe-styled interface for GameJolt module: + +```haxe +interface GameJolt { + static var isLoggedIn:Bool; + static function init(id:Int, key:String):Void; + // users + static function authUser(name:String, token:String):Bool; + static function fetchUserByName(name:String):UserInfo; + static function fetchUserByID(id:Int):UserInfo; + // sessions + static function openSession():Bool; + static function pingSession(active:Bool):Bool; + static function closeSession():Bool; + // data store + static function fetchData(key:String, ?isGlobal:Bool):Dynamic; + static function setData(key:String, data:Dynamic, ?isGlobal:Bool):Bool; + static function updateData(key:String, value:String, operation:String, ?isGlobal:Bool):String; + static function removeData(key:String, ?isGlobal:Bool):Bool; + static function fetchStorageKeys(?isGlobal:Bool):Array; + // trophies + static function giveTrophy(id:Int):Bool; + static function fetchTrophy(id:Int):TrophyInfo; + static function fetchTrophiesByStatus(achieved:Bool):Array; + static function fetchAllTrophies():Array; + // scores + static function addScore(score:Float, desc:String, ?tableID:Int, ?guestName:String, ?extraData:String):Bool; + static function fetchScores(limit:Int, ?tableID:Int):Array; + static function fetchTables():Array; +} +``` +Visit [docs](http://gamejolt.com/api/doc/game/) for more information. + +# Credits +GameJolt.lua is using kikito's [MD5](https://github.com/kikito/md5.lua) and [LuaSocket](http://w3.impa.br/~diego/software/luasocket/home.html). + +# License (MIT) +Copyright (c) 2015 insweater +This library is released under the [MIT](http://opensource.org/licenses/MIT) license.