I've been playing with this for a couple of hours and I guess it's ready-ready to be released.
Lua GameJolt API Github
Have fun.

Cheers, Max.
GameJolt automatically passes username and token into Java, Silverlight, Flash and Unity apps.Davidobot wrote:I'm not too familiar with GameJolt. Do the games usually ask for the username and usertoken of a player for achievements, or are those somehow detected while downloading or something?
I got this to work, already made an Issue in the Issue Tracker with two solutions, anyway I'm posting it here too.ManInBlackSweater wrote: Also there's a Quick Play that downloads your game and tries to pass user info into your game.
Let's see if we can catch this data in Lua.
Code: Select all
love.load = function (args) --Note the args here, this are the aguments passed through the console
data = {}
GJ = require "gamejoltlua"
GJ.init("myid", "mykey")
for k,v in pairs(args) do
local a = v:match("^gjapi_(.*)")
if a then
key, value = a:match("^(.-)=(.-)$")
data[key] = value
end
end
GJ.authUser(data.username,data.token)
GJ.openSession()
end
Code: Select all
data = {}
GJ = require "gamejoltlua"
GJ.init("myid", "mykey")
local a = love.system.getOS() == "Windows" and "\\" or "/"
local f = io.open(love.filesystem.getWorkingDirectory()..a.."gjapi-credentials.txt")
if f then
data.username = f:read()
data.token = f:read()
end
GJ.authUser(data.username,data.token)
GJ.openSession()
Users browsing this forum: No registered users and 2 guests