Access to GameJolt's opportunities for all your lovely Lua projects.
This repository has been archived on 2024-09-19. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Pablo Mayobre d1b8131693 Escape especial characters
Format URL and data values to escape especial character where needed
2015-02-09 01:19:02 -03:00
gamejolt Escape especial characters 2015-02-09 01:19:02 -03:00
.gitattributes :octocat: Added .gitattributes & .gitignore files 2015-02-05 17:01:53 +03:00
.gitignore :octocat: Added .gitattributes & .gitignore files 2015-02-05 17:01:53 +03:00
README.md Update README.md 2015-02-06 15:12:41 +03:00

GameJolt.lua

Provides access to GameJolt's services for Lua-based projects.

Usage

Put the files from the repo into your app's folder.

local GJ = require "gamejolt"

GJ.init(gameID, gameKey)
GJ.authUser(username, usertoken)
GJ.openSession()

-- your further manipulations

Haxe-styled interface for GameJolt module:

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<String>;
	// trophies
	static function giveTrophy(id:Int):Bool;
	static function fetchTrophy(id:Int):TrophyInfo;
	static function fetchTrophiesByStatus(achieved:Bool):Array<TrophyInfo>;
	static function fetchAllTrophies():Array<TrophyInfo>;
	// scores
	static function addScore(score:Float, desc:String, ?tableID:Int, ?guestName:String, ?extraData:String):Bool;
	static function fetchScores(limit:Int, ?tableID:Int):Array<ScoreInfo>;
	static function fetchTables():Array<TableInfo>;
}

Visit wiki / docs for more information.

Credits

GameJolt.lua is using kikito's MD5 and LuaSocket.

License (MIT)

Copyright (c) 2015 insweater This library is released under the MIT license.