调整登录流程里弹出的信息
This commit is contained in:
Submodule Zframework updated: 503bba44a4...4e40322930
3
main.lua
3
main.lua
@@ -16,7 +16,7 @@
|
||||
|
||||
|
||||
--Var leak check
|
||||
-- setmetatable(_G,{__newindex=function(self,k,v)print('>>'..k)print(debug.traceback():match("\n.-\n\t(.-): "))rawset(self,k,v)end})
|
||||
-- setmetatable(_G,{__newindex=function(self,k,v)print('>>'..k..string.rep(" ",26-#k),debug.traceback():match("\n.-\n\t(.-): "))rawset(self,k,v)end})
|
||||
|
||||
--System Global Vars Declaration
|
||||
local fs=love.filesystem
|
||||
@@ -146,6 +146,7 @@ do--Z.setCursor
|
||||
{'dCirc',8,8,7},
|
||||
{'fCirc',8,8,3},
|
||||
}
|
||||
local _
|
||||
Z.setCursor(function(time,x,y)
|
||||
if not SETTING.sysCursor then
|
||||
local R=math.floor((time+1)/2)%7+1
|
||||
|
||||
@@ -114,17 +114,16 @@ return{
|
||||
|
||||
noUsername="Please enter your username",
|
||||
wrongEmail="Invalid email address",
|
||||
wrongCode="Invalid verification code",
|
||||
noPassword="Please enter your password",
|
||||
diffPassword="Passwords don’t match",
|
||||
registerRequestSent="A sign up request has been sent.",
|
||||
registerOK="Sign up successful!",
|
||||
loginOK="You are now logged in!",
|
||||
accessOK="Access granted",
|
||||
checkEmail="A sign up request has been sent.",
|
||||
|
||||
wsFailed="WebSocket connection failed",
|
||||
wsClose="WebSocket closed:",
|
||||
netTimeout="Connection timed out",
|
||||
serverDown="Oops! Server is down",
|
||||
requestFailed="Request failed",
|
||||
|
||||
onlinePlayerCount="Online",
|
||||
createRoomSuccessed="Room created",
|
||||
|
||||
@@ -113,17 +113,16 @@ return{
|
||||
|
||||
noUsername="Por favor ingresa un nombre de usuario",
|
||||
wrongEmail="Correo electrónico inválido",
|
||||
-- wrongCode="Invalid verification code",
|
||||
noPassword="Por favor ingresa la contraseña",
|
||||
diffPassword="Las contraseñas no coinciden",
|
||||
registerRequestSent="Petición de registro enviada con éxito",
|
||||
registerOK="¡Registro exitoso!",
|
||||
loginOK="¡Ingreso con éxito!",
|
||||
accessOK="¡Autorizado exitoso!",
|
||||
checkEmail="Petición de registro enviada con éxito",
|
||||
|
||||
wsFailed="WebSocket conexión fallida",
|
||||
wsClose="WebSocket cerrado:",
|
||||
netTimeout="Tiempo de conexión agotado",
|
||||
-- serverDown="Oops! Server is down",
|
||||
-- requestFailed="Request failed",
|
||||
|
||||
onlinePlayerCount="En línea",
|
||||
createRoomSuccessed="¡Sala creada con éxito!",
|
||||
|
||||
@@ -104,17 +104,16 @@ return{
|
||||
|
||||
noUsername="Entrez votre nom d'utilisateur",
|
||||
wrongEmail="Mauvaise adresse email",
|
||||
-- wrongCode="Invalid verification code",
|
||||
noPassword="Entrez votre mot de passe",
|
||||
diffPassword="Les mots de passe ne se correspondent pas",
|
||||
-- registerRequestSent="Registration request sent",
|
||||
registerOK="Enregistré avec succès !",
|
||||
loginOK="Connecté avec succès !",
|
||||
accessOK="Autorisé avec succès !",
|
||||
-- checkEmail="Registration request sent",
|
||||
|
||||
wsFailed="WebSocket connection échouée",
|
||||
-- wsClose="WebSocket Closed:",
|
||||
-- netTimeout="Network connection timeout",
|
||||
-- serverDown="Oops! Server is down",
|
||||
-- requestFailed="Request failed",
|
||||
|
||||
-- onlinePlayerCount="Online",
|
||||
createRoomSuccessed="Salon créé avec succès !",
|
||||
|
||||
@@ -115,17 +115,16 @@ return{
|
||||
|
||||
noUsername="Silahkan memasukan username Anda",
|
||||
wrongEmail="Alamat email tidak sah",
|
||||
-- wrongCode="Invalid verification code",
|
||||
noPassword="Silahkan memasukan kata sandi Anda",
|
||||
diffPassword="Kata sandi tidak sama",
|
||||
registerRequestSent="Permintaan daftar telah terkirim.",
|
||||
registerOK="Pendaftaran sukses!",
|
||||
loginOK="Anda telah gabung!",
|
||||
accessOK="Akses diberikan",
|
||||
checkEmail="Permintaan daftar telah terkirim.",
|
||||
|
||||
wsFailed="Koneksi websocket gagal",
|
||||
wsClose="Websocket tertutup:",
|
||||
netTimeout="Koneksi waktu habis",
|
||||
-- serverDown="Oops! Server is down",
|
||||
-- requestFailed="Request failed",
|
||||
|
||||
onlinePlayerCount="Online",
|
||||
createRoomSuccessed="Ruang terbuat",
|
||||
|
||||
@@ -115,17 +115,16 @@ return{
|
||||
|
||||
noUsername="ユーザーネームを入力してください!",
|
||||
wrongEmail="メールアドレスが無効です!",
|
||||
-- wrongCode="Invalid verification code",
|
||||
noPassword="パスワードを入力してください!",
|
||||
diffPassword="パスワードが一致しません!",
|
||||
registerRequestSent="Sign Upリクエストを送信しました!",
|
||||
registerOK="サインアップ成功!",
|
||||
loginOK="ログインしています!",
|
||||
accessOK="アクセス権限を取得しました!",
|
||||
checkEmail="Sign Upリクエストを送信しました!",
|
||||
|
||||
wsFailed="ウェブソケットとの通信に失敗しました",
|
||||
wsClose="ウェブソケットとの通信を終了:",
|
||||
netTimeout="接続がタイムアウトしました",
|
||||
-- serverDown="Oops! Server is down",
|
||||
-- requestFailed="Request failed",
|
||||
|
||||
onlinePlayerCount="オンライン人数",
|
||||
createRoomSuccessed="部屋を建てました",
|
||||
|
||||
@@ -102,17 +102,16 @@ return{
|
||||
|
||||
noUsername="Insira seu nome de usuário",
|
||||
wrongEmail="Endereço de email errado",
|
||||
-- wrongCode="Invalid verification code",
|
||||
noPassword="Insira sua senha ",
|
||||
diffPassword="Senhas não combinam",
|
||||
-- registerRequestSent="Registration request sent",
|
||||
registerOK="Registrado com sucesso!",
|
||||
loginOK="Logado com sucesso!",
|
||||
accessOK="Autorizado com sucesso!",
|
||||
-- checkEmail="Registration request sent",
|
||||
|
||||
wsFailed="WebSocket falha na conexão",
|
||||
wsClose="WebSocket closed:",
|
||||
-- netTimeout="Network connection timeout",
|
||||
-- serverDown="Oops! Server is down",
|
||||
-- requestFailed="Request failed",
|
||||
|
||||
-- onlinePlayerCount="Online",
|
||||
-- createRoomSuccessed="Room successfully created!",
|
||||
|
||||
@@ -113,18 +113,17 @@ return{
|
||||
jsonError="json错误",
|
||||
|
||||
noUsername="请填写用户名",
|
||||
wrongEmail="邮箱格式错误",
|
||||
wrongEmail="无效邮箱地址",
|
||||
wrongCode="无效验证码",
|
||||
noPassword="请填写密码",
|
||||
diffPassword="两次密码不一致",
|
||||
registerRequestSent="注册请求已发送",
|
||||
registerOK="注册成功!",
|
||||
loginOK="登录成功",
|
||||
accessOK="身份验证成功",
|
||||
checkEmail="请查看邮箱验证码",
|
||||
|
||||
wsFailed="连接失败",
|
||||
wsClose="连接被断开:",
|
||||
netTimeout="连接超时",
|
||||
serverDown="唉哟!服务器不在线",
|
||||
requestFailed="请求失败",
|
||||
|
||||
onlinePlayerCount="在线人数",
|
||||
createRoomSuccessed="创建房间成功!",
|
||||
|
||||
@@ -114,17 +114,16 @@ return{
|
||||
|
||||
noUsername="Error.NoUsername();",
|
||||
wrongEmail="Error.WrongEmail();",
|
||||
wrongCode="Error.WrongVerificationCode();",
|
||||
noPassword="Error.NoPassword();",
|
||||
diffPassword="Error.DiffPassword();",
|
||||
registerRequestSent="register.RequestSent=true",
|
||||
registerOK="register.Success=true",
|
||||
loginOK="login.Success=true",
|
||||
accessOK="Access.Granted=true",
|
||||
checkEmail="register.RequestSent=true",
|
||||
|
||||
wsFailed="Error.Websocket.Failed();",
|
||||
wsClose="Error.Websocket.Close=",
|
||||
netTimeout="Error.ConnectTimeOut();",
|
||||
serverDown="Error.ServerDown();",
|
||||
requestFailed="Error.RequestFailed();",
|
||||
|
||||
onlinePlayerCount="OnlinePlayerCount",
|
||||
createRoomSuccessed="CreateRoom.Successs=true",
|
||||
|
||||
@@ -114,17 +114,16 @@ return{
|
||||
|
||||
noUsername="請輸入用戶名",
|
||||
wrongEmail="無效的電郵地址",
|
||||
wrongCode="無效的驗證碼",
|
||||
noPassword="請輸入密碼",
|
||||
diffPassword="密碼不匹配",
|
||||
registerRequestSent="已發送註冊請求",
|
||||
registerOK="註冊成功!",
|
||||
loginOK="登錄成功",
|
||||
accessOK="身份認證成功",
|
||||
checkEmail="已發送註冊請求",
|
||||
|
||||
wsFailed="連接失敗",
|
||||
wsClose="連接斷開:",
|
||||
netTimeout="連接超時",
|
||||
serverDown="哎唷!服務器不在线",
|
||||
requestFailed="請求失敗",
|
||||
|
||||
onlinePlayerCount="在線用戶數",
|
||||
createRoomSuccessed="房間已創建!",
|
||||
|
||||
@@ -63,7 +63,7 @@ function NET.getCode(email)
|
||||
if res.code==200 then
|
||||
USER.email=email
|
||||
SCN.fileDropped(2)
|
||||
MES.new('info',"Please check your email",5)
|
||||
MES.new('info',text.checkEmail,5)
|
||||
else
|
||||
MES.new('error',res.message,5)
|
||||
end
|
||||
@@ -140,7 +140,6 @@ function NET.setPW(code,pw)
|
||||
if res then
|
||||
if res.code==200 then
|
||||
USER.password=pw
|
||||
MES.new('info',"Password set! Now you can login",5)
|
||||
SCN.back()
|
||||
else
|
||||
MES.new('error',res.message,5)
|
||||
@@ -180,7 +179,7 @@ function NET.autoLogin()
|
||||
WAIT.interrupt()
|
||||
return
|
||||
else
|
||||
MES.new('warn',res.message,5)
|
||||
LOG("Access token expired")
|
||||
end
|
||||
else
|
||||
WAIT.interrupt()
|
||||
@@ -203,7 +202,7 @@ function NET.autoLogin()
|
||||
WAIT.interrupt()
|
||||
return
|
||||
else
|
||||
MES.new('warn',res.message,5)
|
||||
LOG("Refresh token expired")
|
||||
end
|
||||
else
|
||||
WAIT.interrupt()
|
||||
@@ -224,12 +223,11 @@ function NET.autoLogin()
|
||||
USER.rToken=res.data.refreshToken
|
||||
USER.aToken=res.data.accessToken
|
||||
NET.connectWS()
|
||||
MES.new('info',"Login successed",5)
|
||||
SCN.go('net_menu')
|
||||
WAIT.interrupt()
|
||||
return
|
||||
else
|
||||
MES.new('warn',res.message,5)
|
||||
MES.new('warn',text.requestFailed)
|
||||
end
|
||||
else
|
||||
WAIT.interrupt()
|
||||
@@ -450,7 +448,7 @@ function NET.updateWS()
|
||||
if res then
|
||||
-- print(("RECV ACT: $1 ($2)"):repD(res.action,res.type))
|
||||
if res.type=='Failed' then
|
||||
MES.new('warn',"Request failed: "..(res.reason or "/"))
|
||||
MES.new('warn',text.requestFailed..": "..(res.reason or "/"))
|
||||
elseif res.action==1100 then-- TODO
|
||||
elseif res.action==1101 then-- TODO
|
||||
elseif res.action==1102 then-- TODO
|
||||
|
||||
@@ -15,7 +15,7 @@ end
|
||||
local function _codeLogin()
|
||||
code=WIDGET.active.code:getText():upper()
|
||||
if #code~=8 then
|
||||
MES.new('error',"Wrong code length")
|
||||
MES.new('error',text.wrongCode)
|
||||
else
|
||||
NET.codeLogin(code)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user