LOGIN变量移至NET内
This commit is contained in:
2
main.lua
2
main.lua
@@ -23,9 +23,9 @@ SAVEDIR=fs.getSaveDirectory()
|
|||||||
--Global Vars & Settings
|
--Global Vars & Settings
|
||||||
LOADED=false
|
LOADED=false
|
||||||
DAILYLAUNCH=false
|
DAILYLAUNCH=false
|
||||||
LOGIN=false
|
|
||||||
EDITING=""
|
EDITING=""
|
||||||
NET={
|
NET={
|
||||||
|
login=false,
|
||||||
allow_online=false,
|
allow_online=false,
|
||||||
}
|
}
|
||||||
ERRDATA={}
|
ERRDATA={}
|
||||||
|
|||||||
@@ -1068,7 +1068,7 @@ do
|
|||||||
--[[
|
--[[
|
||||||
register:
|
register:
|
||||||
if response.message=="OK"then
|
if response.message=="OK"then
|
||||||
LOGIN=true
|
NET.login=true
|
||||||
USER.name=res.name
|
USER.name=res.name
|
||||||
USER.id=res.id
|
USER.id=res.id
|
||||||
USER.motto=res.motto
|
USER.motto=res.motto
|
||||||
@@ -1167,7 +1167,7 @@ do
|
|||||||
local res=JSON.decode(message)
|
local res=JSON.decode(message)
|
||||||
if not res then return end
|
if not res then return end
|
||||||
if res.message=="Connected"then
|
if res.message=="Connected"then
|
||||||
LOGIN=true
|
NET.login=true
|
||||||
if res.id then
|
if res.id then
|
||||||
USER.id=res.id
|
USER.id=res.id
|
||||||
USER.authToken=res.authToken
|
USER.authToken=res.authToken
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ function scene.keyDown(key)
|
|||||||
end
|
end
|
||||||
elseif key=="a"then
|
elseif key=="a"then
|
||||||
if testButton(3)then
|
if testButton(3)then
|
||||||
if LOGIN then
|
if NET.login then
|
||||||
if not NET.allow_online then
|
if not NET.allow_online then
|
||||||
TEXT.show(text.needUpdate,640,450,60,"flicker")
|
TEXT.show(text.needUpdate,640,450,60,"flicker")
|
||||||
SFX.play("finesseError")
|
SFX.play("finesseError")
|
||||||
|
|||||||
Reference in New Issue
Block a user