Add fetchUserByName, fetchUserByID
They're pretty equivalent.
This commit is contained in:
parent
99c4cd0a13
commit
32160d95d2
22
gamejolt.lua
22
gamejolt.lua
@ -52,6 +52,28 @@ function GJ.authUser(name, token)
|
||||
return s
|
||||
end
|
||||
|
||||
function GJ.fetchUserByName(name)
|
||||
local r = req("users/?username=" .. name, "keypair", false, false)
|
||||
|
||||
local t = {}
|
||||
parseKeypair(r, function(k, v)
|
||||
t[k] = v
|
||||
end)
|
||||
|
||||
return t
|
||||
end
|
||||
|
||||
function GJ.fetchUserByID(id)
|
||||
local r = req("users/?user_id=" .. id, "keypair", false, false)
|
||||
|
||||
local t = {}
|
||||
parseKeypair(r, function(k, v)
|
||||
t[k] = v
|
||||
end)
|
||||
|
||||
return t
|
||||
end
|
||||
|
||||
-- sessions
|
||||
function GJ.openSession()
|
||||
return string.find(req("sessions/open/?", "dump", true, true), "SUCCESS") ~= nil
|
||||
|
Reference in New Issue
Block a user