From 7725bdd3ed4b54d8f211ad035c18e8d657217179 Mon Sep 17 00:00:00 2001 From: insweater Date: Thu, 5 Feb 2015 18:32:01 +0300 Subject: [PATCH] Add setData --- gamejolt.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gamejolt.lua b/gamejolt.lua index 07167ed..6fdcd91 100644 --- a/gamejolt.lua +++ b/gamejolt.lua @@ -99,4 +99,11 @@ function GJ.fetchData(key, isGlobal) return string.sub(d, string.find(d, "\n"), string.len(d)) end +function GJ.setData(key, data, isGlobal) + local pu, pt = true, true + if isGlobal then pu, pt = false, false end + + return string.find(req("data-store/set/?key=" .. key .. "&data=" .. tostring(data), "dump", pu, pt), "SUCCESS") ~= nil +end + return GJ \ No newline at end of file