Skip to content
Snippets Groups Projects
Commit 2967ef68 authored by dg's avatar dg
Browse files

fix player profiles sync

git-svn-id: http://svn.net-core.org/repos/t-engine4@982 51575b47-30f0-44d4-a5cc-537603b46e54
parent 0621acd4
No related branches found
No related tags found
No related merge requests found
......@@ -188,6 +188,7 @@ end
-----------------------------------------------------------------------
function _M:rpc(data)
print("[ONLINE PROFILE] rpc called", "http://te4.org/lua/profilesrpc.ws/"..data.action)
local body, status = http.request("http://te4.org/lua/profilesrpc.ws/"..data.action, "json="..url.escape(json.encode(data)))
if not body then return end
return json.decode(body)
......@@ -213,12 +214,12 @@ function _M:getConfigs(module)
if module == "generic" then
self.generic[field] = self.generic[field] or {}
self:loadData(f, self.generic[field])
self:saveGenericProfile(field, self.generic[field], nosync)
self:saveGenericProfile(field, self.generic[field], true)
else
self.modules[module] = self.modules[module] or {}
self.modules[module][field] = self.modules[module][field] or {}
self:loadData(f, self.modules[module][field])
self:saveModuleProfile(field, self.modules[module][field], module, nosync)
self:saveModuleProfile(field, self.modules[module][field], module, true)
end
end
end
......@@ -231,6 +232,7 @@ function _M:setConfigs(module, name, val)
local data = self:rpc{action="SetConfigs", login=self.login, hash=self.auth.hash, module=module, data={[name] = val}}
if not data then return end
print("[ONLINE PROFILE] saved ", module, name, val)
util.show_backtrace()
end
function _M:syncOnline(module)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment