Save table to file
This commit is contained in:
@@ -299,6 +299,15 @@ for i=1,25 do
|
||||
STAT.spin[i]={0,0,0,0,0,0,0}
|
||||
end
|
||||
|
||||
NETWORK={
|
||||
id=nil,
|
||||
username=nil,
|
||||
motto=nil,
|
||||
avatar=nil,
|
||||
auth_token=nil,
|
||||
access_token=nil
|
||||
}
|
||||
|
||||
keyMap={
|
||||
{"left","right","x","z","c","up","down","space","tab","r"},{},
|
||||
--Keyboard
|
||||
|
||||
@@ -156,8 +156,10 @@ function Tick.httpREQ_login(data)
|
||||
local success,content=json.decode(response.body)
|
||||
if success then
|
||||
LOG.print(text.loginSuccessed..": "..content.message)
|
||||
-- TODO: save {content.token} to storage and a global variable
|
||||
-- TODO: save {content.id} to a global variable
|
||||
NETWORK.id=content.id
|
||||
NETWORK.username=content.username
|
||||
NETWORK.auth_token=content.auth_token
|
||||
FILE.saveNetwork()
|
||||
else
|
||||
LOG.print(text.jsonError,"warn")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user