重新启用注册菜单
This commit is contained in:
@@ -601,6 +601,7 @@ return{
|
|||||||
email="Email Address",
|
email="Email Address",
|
||||||
password="Password",
|
password="Password",
|
||||||
password2="Re-enter Password",
|
password2="Re-enter Password",
|
||||||
|
register="Register",
|
||||||
},
|
},
|
||||||
account={
|
account={
|
||||||
title="Account",
|
title="Account",
|
||||||
|
|||||||
@@ -512,6 +512,7 @@ return{
|
|||||||
email="E-mail",
|
email="E-mail",
|
||||||
password="Mot de passe",
|
password="Mot de passe",
|
||||||
password2="Confirmer le mot de passe",
|
password2="Confirmer le mot de passe",
|
||||||
|
register="Enregistrement",
|
||||||
},
|
},
|
||||||
account={
|
account={
|
||||||
title="Compte",
|
title="Compte",
|
||||||
|
|||||||
@@ -595,11 +595,12 @@ return{
|
|||||||
},
|
},
|
||||||
register={
|
register={
|
||||||
title="Registrar",
|
title="Registrar",
|
||||||
login="Registrar",
|
login="Log in",
|
||||||
username="Nome De Usuário",
|
username="Nome De Usuário",
|
||||||
email="Endereço De Email",
|
email="Endereço De Email",
|
||||||
password="Senha",
|
password="Senha",
|
||||||
password2="Entre Senha Novamente",
|
password2="Entre Senha Novamente",
|
||||||
|
register="Registrar",
|
||||||
},
|
},
|
||||||
account={
|
account={
|
||||||
title="Conta",
|
title="Conta",
|
||||||
|
|||||||
@@ -515,6 +515,7 @@ return{
|
|||||||
email="Correo Elec.",
|
email="Correo Elec.",
|
||||||
password="Contraseña",
|
password="Contraseña",
|
||||||
password2="Repetir Contr.",
|
password2="Repetir Contr.",
|
||||||
|
register="Registrarse",
|
||||||
},
|
},
|
||||||
account={
|
account={
|
||||||
title="Cuenta",
|
title="Cuenta",
|
||||||
|
|||||||
@@ -444,6 +444,7 @@ return{
|
|||||||
email="@",
|
email="@",
|
||||||
password="*",
|
password="*",
|
||||||
password2="*",
|
password2="*",
|
||||||
|
register="Sign up",
|
||||||
},
|
},
|
||||||
account={
|
account={
|
||||||
title="@_@",
|
title="@_@",
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ return{
|
|||||||
qq="QQ对线",
|
qq="QQ对线",
|
||||||
},
|
},
|
||||||
register={
|
register={
|
||||||
password2="你觉得应该填啥",
|
password2="你猜该填啥",
|
||||||
},
|
},
|
||||||
sound={
|
sound={
|
||||||
title="音效室",
|
title="音效室",
|
||||||
|
|||||||
@@ -599,6 +599,7 @@ return{
|
|||||||
email="邮箱",
|
email="邮箱",
|
||||||
password="密码",
|
password="密码",
|
||||||
password2="确认密码",
|
password2="确认密码",
|
||||||
|
register="注册",
|
||||||
},
|
},
|
||||||
account={
|
account={
|
||||||
title="账户",
|
title="账户",
|
||||||
|
|||||||
@@ -121,6 +121,18 @@ function NET.wsclose_stream()
|
|||||||
end
|
end
|
||||||
|
|
||||||
--Account
|
--Account
|
||||||
|
function NET.register(username,email,password)
|
||||||
|
if NET.lock("register")then
|
||||||
|
WS.send("app",JSON.encode{
|
||||||
|
action=2,
|
||||||
|
data={
|
||||||
|
username=username,
|
||||||
|
email=email,
|
||||||
|
password=password,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
function NET.pong(wsName,message)
|
function NET.pong(wsName,message)
|
||||||
WS.send(wsName,message,"pong")
|
WS.send(wsName,message,"pong")
|
||||||
end
|
end
|
||||||
@@ -245,12 +257,21 @@ function NET.updateWS_app()
|
|||||||
else
|
else
|
||||||
local res=_parse(message)
|
local res=_parse(message)
|
||||||
if res then
|
if res then
|
||||||
NET.connected=true
|
if res.type=="Connect"then
|
||||||
NET.allow_online=VERSION.code>=res.lowest
|
NET.connected=true
|
||||||
if VERSION.code<res.newestCode then
|
NET.allow_online=VERSION.code>=res.lowest
|
||||||
LOG.print(text.oldVersion:gsub("$1",res.newestName),180,COLOR.sky)
|
if VERSION.code<res.newestCode then
|
||||||
|
LOG.print(text.oldVersion:gsub("$1",res.newestName),180,COLOR.sky)
|
||||||
|
end
|
||||||
|
LOG.print(res.notice,300,COLOR.sky)
|
||||||
|
elseif res.action==0 then--Get new version info
|
||||||
|
--?
|
||||||
|
elseif res.action==1 then--Get notice
|
||||||
|
--?
|
||||||
|
elseif res.action==2 then--Register
|
||||||
|
LOG.print(res.data.message,300,COLOR.sky)
|
||||||
|
NET.unlock("register")
|
||||||
end
|
end
|
||||||
LOG.print(res.notice,300,COLOR.sky)
|
|
||||||
else
|
else
|
||||||
WS.alert("app")
|
WS.alert("app")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ local scene={}
|
|||||||
|
|
||||||
scene.widgetList={
|
scene.widgetList={
|
||||||
WIDGET.newText{name="title", x=80, y=50,font=70,align="L"},
|
WIDGET.newText{name="title", x=80, y=50,font=70,align="L"},
|
||||||
-- WIDGET.newButton{name="register",x=1140, y=100,w=170,h=80,color="green",code=function()SCN.swapTo("register","swipeR")end},
|
WIDGET.newButton{name="register", x=1140, y=100,w=170,h=80,color="lY",code=function()SCN.swapTo("register","swipeR")end},
|
||||||
WIDGET.newInputBox{name="email", x=380, y=200,w=500,h=60,regex="[0-9A-Za-z@._-]"},
|
WIDGET.newInputBox{name="email", x=380, y=200,w=500,h=60,regex="[0-9A-Za-z@._-]"},
|
||||||
WIDGET.newInputBox{name="password", x=380, y=300,w=626,h=60,secret=true,regex="[ -~]"},
|
WIDGET.newInputBox{name="password", x=380, y=300,w=626,h=60,secret=true,regex="[ -~]"},
|
||||||
WIDGET.newKey{name="login", x=1140, y=540,w=170,h=80,font=40,code=login},
|
WIDGET.newKey{name="login", x=1140, y=540,w=170,h=80,font=40,code=login},
|
||||||
|
|||||||
@@ -1,41 +1,30 @@
|
|||||||
local scene={}
|
local scene={}
|
||||||
|
|
||||||
function scene.keyDown(key)
|
local function register()
|
||||||
if key=="return"then
|
local username= WIDGET.active.username.value
|
||||||
local username= WIDGET.active.username.value
|
local email= WIDGET.active.email.value
|
||||||
local email= WIDGET.active.email.value
|
local password= WIDGET.active.password.value
|
||||||
local password= WIDGET.active.password.value
|
local password2=WIDGET.active.password2.value
|
||||||
local password2=WIDGET.active.password2.value
|
if #username==0 then
|
||||||
if #username==0 then
|
LOG.print(text.noUsername)return
|
||||||
LOG.print(text.noUsername)return
|
elseif not email:match("^[a-zA-Z0-9_]+@[a-zA-Z0-9_-]+%.[a-zA-Z0-9_]+$")then
|
||||||
elseif not email:match("^[a-zA-Z0-9_]+@[a-zA-Z0-9_-]+%.[a-zA-Z0-9_]+$")then
|
LOG.print(text.wrongEmail)return
|
||||||
LOG.print(text.wrongEmail)return
|
elseif #password==0 or #password2==0 then
|
||||||
elseif #password==0 or #password2==0 then
|
LOG.print(text.noPassword)return
|
||||||
LOG.print(text.noPassword)return
|
elseif password~=password2 then
|
||||||
elseif password~=password2 then
|
LOG.print(text.diffPassword)return
|
||||||
LOG.print(text.diffPassword)return
|
|
||||||
end
|
|
||||||
--[[
|
|
||||||
JSON.encode{
|
|
||||||
username=username,
|
|
||||||
email=email,
|
|
||||||
password=password,
|
|
||||||
}
|
|
||||||
]]
|
|
||||||
elseif key=="escape"then
|
|
||||||
SCN.back()
|
|
||||||
else
|
|
||||||
WIDGET.keyPressed(key)
|
|
||||||
end
|
end
|
||||||
|
NET.register(username,email,password)
|
||||||
end
|
end
|
||||||
|
|
||||||
scene.widgetList={
|
scene.widgetList={
|
||||||
WIDGET.newText{name="title", x=80, y=50,font=70,align="L"},
|
WIDGET.newText{name="title", x=80, y=50,font=70,align="L"},
|
||||||
WIDGET.newButton{name="login", x=1140, y=100,w=170,h=80,color="green",code=function()SCN.swapTo("login","swipeL")end},
|
WIDGET.newButton{name="login", x=1140, y=100,w=170,h=80,color="lY",code=function()SCN.swapTo("login","swipeL")end},
|
||||||
WIDGET.newInputBox{name="username", x=380, y=200,w=500,h=60,regex="[0-9A-Za-z_]"},
|
WIDGET.newInputBox{name="username", x=380, y=200,w=500,h=60,regex="[0-9A-Za-z_]"},
|
||||||
WIDGET.newInputBox{name="email", x=380, y=300,w=626,h=60,regex="[0-9A-Za-z@._-]"},
|
WIDGET.newInputBox{name="email", x=380, y=300,w=626,h=60,regex="[0-9A-Za-z@._-]"},
|
||||||
WIDGET.newInputBox{name="password", x=380, y=400,w=626,h=60,secret=true,regex="[ -~]"},
|
WIDGET.newInputBox{name="password", x=380, y=400,w=626,h=60,secret=true,regex="[ -~]"},
|
||||||
WIDGET.newInputBox{name="password2", x=380, y=500,w=626,h=60,secret=true,regex="[ -~]"},
|
WIDGET.newInputBox{name="password2",x=380, y=500,w=626,h=60,secret=true,regex="[ -~]"},
|
||||||
|
WIDGET.newKey{name="register", x=1140, y=540,w=170,h=80,font=40,code=register},
|
||||||
WIDGET.newButton{name="back", x=1140, y=640,w=170,h=80,font=40,code=backScene},
|
WIDGET.newButton{name="back", x=1140, y=640,w=170,h=80,font=40,code=backScene},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user