调整登录流程里弹出的信息

This commit is contained in:
MrZ_26
2022-09-29 18:36:19 +08:00
parent d259e05ca7
commit f41999c019
13 changed files with 37 additions and 47 deletions

View File

@@ -16,7 +16,7 @@
--Var leak check --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 --System Global Vars Declaration
local fs=love.filesystem local fs=love.filesystem
@@ -146,6 +146,7 @@ do--Z.setCursor
{'dCirc',8,8,7}, {'dCirc',8,8,7},
{'fCirc',8,8,3}, {'fCirc',8,8,3},
} }
local _
Z.setCursor(function(time,x,y) Z.setCursor(function(time,x,y)
if not SETTING.sysCursor then if not SETTING.sysCursor then
local R=math.floor((time+1)/2)%7+1 local R=math.floor((time+1)/2)%7+1

View File

@@ -114,17 +114,16 @@ return{
noUsername="Please enter your username", noUsername="Please enter your username",
wrongEmail="Invalid email address", wrongEmail="Invalid email address",
wrongCode="Invalid verification code",
noPassword="Please enter your password", noPassword="Please enter your password",
diffPassword="Passwords dont match", diffPassword="Passwords dont match",
registerRequestSent="A sign up request has been sent.", checkEmail="A sign up request has been sent.",
registerOK="Sign up successful!",
loginOK="You are now logged in!",
accessOK="Access granted",
wsFailed="WebSocket connection failed", wsFailed="WebSocket connection failed",
wsClose="WebSocket closed:", wsClose="WebSocket closed:",
netTimeout="Connection timed out", netTimeout="Connection timed out",
serverDown="Oops! Server is down", serverDown="Oops! Server is down",
requestFailed="Request failed",
onlinePlayerCount="Online", onlinePlayerCount="Online",
createRoomSuccessed="Room created", createRoomSuccessed="Room created",

View File

@@ -113,17 +113,16 @@ return{
noUsername="Por favor ingresa un nombre de usuario", noUsername="Por favor ingresa un nombre de usuario",
wrongEmail="Correo electrónico inválido", wrongEmail="Correo electrónico inválido",
-- wrongCode="Invalid verification code",
noPassword="Por favor ingresa la contraseña", noPassword="Por favor ingresa la contraseña",
diffPassword="Las contraseñas no coinciden", diffPassword="Las contraseñas no coinciden",
registerRequestSent="Petición de registro enviada con éxito", checkEmail="Petición de registro enviada con éxito",
registerOK="¡Registro exitoso!",
loginOK="¡Ingreso con éxito!",
accessOK="¡Autorizado exitoso!",
wsFailed="WebSocket conexión fallida", wsFailed="WebSocket conexión fallida",
wsClose="WebSocket cerrado:", wsClose="WebSocket cerrado:",
netTimeout="Tiempo de conexión agotado", netTimeout="Tiempo de conexión agotado",
-- serverDown="Oops! Server is down", -- serverDown="Oops! Server is down",
-- requestFailed="Request failed",
onlinePlayerCount="En línea", onlinePlayerCount="En línea",
createRoomSuccessed="¡Sala creada con éxito!", createRoomSuccessed="¡Sala creada con éxito!",

View File

@@ -104,17 +104,16 @@ return{
noUsername="Entrez votre nom d'utilisateur", noUsername="Entrez votre nom d'utilisateur",
wrongEmail="Mauvaise adresse email", wrongEmail="Mauvaise adresse email",
-- wrongCode="Invalid verification code",
noPassword="Entrez votre mot de passe", noPassword="Entrez votre mot de passe",
diffPassword="Les mots de passe ne se correspondent pas", diffPassword="Les mots de passe ne se correspondent pas",
-- registerRequestSent="Registration request sent", -- checkEmail="Registration request sent",
registerOK="Enregistré avec succès !",
loginOK="Connecté avec succès !",
accessOK="Autorisé avec succès !",
wsFailed="WebSocket connection échouée", wsFailed="WebSocket connection échouée",
-- wsClose="WebSocket Closed:", -- wsClose="WebSocket Closed:",
-- netTimeout="Network connection timeout", -- netTimeout="Network connection timeout",
-- serverDown="Oops! Server is down", -- serverDown="Oops! Server is down",
-- requestFailed="Request failed",
-- onlinePlayerCount="Online", -- onlinePlayerCount="Online",
createRoomSuccessed="Salon créé avec succès !", createRoomSuccessed="Salon créé avec succès !",

View File

@@ -115,17 +115,16 @@ return{
noUsername="Silahkan memasukan username Anda", noUsername="Silahkan memasukan username Anda",
wrongEmail="Alamat email tidak sah", wrongEmail="Alamat email tidak sah",
-- wrongCode="Invalid verification code",
noPassword="Silahkan memasukan kata sandi Anda", noPassword="Silahkan memasukan kata sandi Anda",
diffPassword="Kata sandi tidak sama", diffPassword="Kata sandi tidak sama",
registerRequestSent="Permintaan daftar telah terkirim.", checkEmail="Permintaan daftar telah terkirim.",
registerOK="Pendaftaran sukses!",
loginOK="Anda telah gabung!",
accessOK="Akses diberikan",
wsFailed="Koneksi websocket gagal", wsFailed="Koneksi websocket gagal",
wsClose="Websocket tertutup:", wsClose="Websocket tertutup:",
netTimeout="Koneksi waktu habis", netTimeout="Koneksi waktu habis",
-- serverDown="Oops! Server is down", -- serverDown="Oops! Server is down",
-- requestFailed="Request failed",
onlinePlayerCount="Online", onlinePlayerCount="Online",
createRoomSuccessed="Ruang terbuat", createRoomSuccessed="Ruang terbuat",

View File

@@ -115,17 +115,16 @@ return{
noUsername="ユーザーネームを入力してください!", noUsername="ユーザーネームを入力してください!",
wrongEmail="メールアドレスが無効です!", wrongEmail="メールアドレスが無効です!",
-- wrongCode="Invalid verification code",
noPassword="パスワードを入力してください!", noPassword="パスワードを入力してください!",
diffPassword="パスワードが一致しません!", diffPassword="パスワードが一致しません!",
registerRequestSent="Sign Upリクエストを送信しました!", checkEmail="Sign Upリクエストを送信しました!",
registerOK="サインアップ成功!",
loginOK="ログインしています!",
accessOK="アクセス権限を取得しました!",
wsFailed="ウェブソケットとの通信に失敗しました", wsFailed="ウェブソケットとの通信に失敗しました",
wsClose="ウェブソケットとの通信を終了:", wsClose="ウェブソケットとの通信を終了:",
netTimeout="接続がタイムアウトしました", netTimeout="接続がタイムアウトしました",
-- serverDown="Oops! Server is down", -- serverDown="Oops! Server is down",
-- requestFailed="Request failed",
onlinePlayerCount="オンライン人数", onlinePlayerCount="オンライン人数",
createRoomSuccessed="部屋を建てました", createRoomSuccessed="部屋を建てました",

View File

@@ -102,17 +102,16 @@ return{
noUsername="Insira seu nome de usuário", noUsername="Insira seu nome de usuário",
wrongEmail="Endereço de email errado", wrongEmail="Endereço de email errado",
-- wrongCode="Invalid verification code",
noPassword="Insira sua senha ", noPassword="Insira sua senha ",
diffPassword="Senhas não combinam", diffPassword="Senhas não combinam",
-- registerRequestSent="Registration request sent", -- checkEmail="Registration request sent",
registerOK="Registrado com sucesso!",
loginOK="Logado com sucesso!",
accessOK="Autorizado com sucesso!",
wsFailed="WebSocket falha na conexão", wsFailed="WebSocket falha na conexão",
wsClose="WebSocket closed:", wsClose="WebSocket closed:",
-- netTimeout="Network connection timeout", -- netTimeout="Network connection timeout",
-- serverDown="Oops! Server is down", -- serverDown="Oops! Server is down",
-- requestFailed="Request failed",
-- onlinePlayerCount="Online", -- onlinePlayerCount="Online",
-- createRoomSuccessed="Room successfully created!", -- createRoomSuccessed="Room successfully created!",

View File

@@ -113,18 +113,17 @@ return{
jsonError="json错误", jsonError="json错误",
noUsername="请填写用户名", noUsername="请填写用户名",
wrongEmail="邮箱格式错误", wrongEmail="无效邮箱地址",
wrongCode="无效验证码",
noPassword="请填写密码", noPassword="请填写密码",
diffPassword="两次密码不一致", diffPassword="两次密码不一致",
registerRequestSent="注册请求已发送", checkEmail="请查看邮箱验证码",
registerOK="注册成功!",
loginOK="登录成功",
accessOK="身份验证成功",
wsFailed="连接失败", wsFailed="连接失败",
wsClose="连接被断开:", wsClose="连接被断开:",
netTimeout="连接超时", netTimeout="连接超时",
serverDown="唉哟!服务器不在线", serverDown="唉哟!服务器不在线",
requestFailed="请求失败",
onlinePlayerCount="在线人数", onlinePlayerCount="在线人数",
createRoomSuccessed="创建房间成功!", createRoomSuccessed="创建房间成功!",

View File

@@ -114,17 +114,16 @@ return{
noUsername="Error.NoUsername();", noUsername="Error.NoUsername();",
wrongEmail="Error.WrongEmail();", wrongEmail="Error.WrongEmail();",
wrongCode="Error.WrongVerificationCode();",
noPassword="Error.NoPassword();", noPassword="Error.NoPassword();",
diffPassword="Error.DiffPassword();", diffPassword="Error.DiffPassword();",
registerRequestSent="register.RequestSent=true", checkEmail="register.RequestSent=true",
registerOK="register.Success=true",
loginOK="login.Success=true",
accessOK="Access.Granted=true",
wsFailed="Error.Websocket.Failed();", wsFailed="Error.Websocket.Failed();",
wsClose="Error.Websocket.Close=", wsClose="Error.Websocket.Close=",
netTimeout="Error.ConnectTimeOut();", netTimeout="Error.ConnectTimeOut();",
serverDown="Error.ServerDown();", serverDown="Error.ServerDown();",
requestFailed="Error.RequestFailed();",
onlinePlayerCount="OnlinePlayerCount", onlinePlayerCount="OnlinePlayerCount",
createRoomSuccessed="CreateRoom.Successs=true", createRoomSuccessed="CreateRoom.Successs=true",

View File

@@ -114,17 +114,16 @@ return{
noUsername="請輸入用戶名", noUsername="請輸入用戶名",
wrongEmail="無效的電郵地址", wrongEmail="無效的電郵地址",
wrongCode="無效的驗證碼",
noPassword="請輸入密碼", noPassword="請輸入密碼",
diffPassword="密碼不匹配", diffPassword="密碼不匹配",
registerRequestSent="已發送註冊請求", checkEmail="已發送註冊請求",
registerOK="註冊成功!",
loginOK="登錄成功",
accessOK="身份認證成功",
wsFailed="連接失敗", wsFailed="連接失敗",
wsClose="連接斷開:", wsClose="連接斷開:",
netTimeout="連接超時", netTimeout="連接超時",
serverDown="哎唷!服務器不在线", serverDown="哎唷!服務器不在线",
requestFailed="請求失敗",
onlinePlayerCount="在線用戶數", onlinePlayerCount="在線用戶數",
createRoomSuccessed="房間已創建!", createRoomSuccessed="房間已創建!",

View File

@@ -63,7 +63,7 @@ function NET.getCode(email)
if res.code==200 then if res.code==200 then
USER.email=email USER.email=email
SCN.fileDropped(2) SCN.fileDropped(2)
MES.new('info',"Please check your email",5) MES.new('info',text.checkEmail,5)
else else
MES.new('error',res.message,5) MES.new('error',res.message,5)
end end
@@ -140,7 +140,6 @@ function NET.setPW(code,pw)
if res then if res then
if res.code==200 then if res.code==200 then
USER.password=pw USER.password=pw
MES.new('info',"Password set! Now you can login",5)
SCN.back() SCN.back()
else else
MES.new('error',res.message,5) MES.new('error',res.message,5)
@@ -180,7 +179,7 @@ function NET.autoLogin()
WAIT.interrupt() WAIT.interrupt()
return return
else else
MES.new('warn',res.message,5) LOG("Access token expired")
end end
else else
WAIT.interrupt() WAIT.interrupt()
@@ -203,7 +202,7 @@ function NET.autoLogin()
WAIT.interrupt() WAIT.interrupt()
return return
else else
MES.new('warn',res.message,5) LOG("Refresh token expired")
end end
else else
WAIT.interrupt() WAIT.interrupt()
@@ -224,12 +223,11 @@ function NET.autoLogin()
USER.rToken=res.data.refreshToken USER.rToken=res.data.refreshToken
USER.aToken=res.data.accessToken USER.aToken=res.data.accessToken
NET.connectWS() NET.connectWS()
MES.new('info',"Login successed",5)
SCN.go('net_menu') SCN.go('net_menu')
WAIT.interrupt() WAIT.interrupt()
return return
else else
MES.new('warn',res.message,5) MES.new('warn',text.requestFailed)
end end
else else
WAIT.interrupt() WAIT.interrupt()
@@ -450,7 +448,7 @@ function NET.updateWS()
if res then if res then
-- print(("RECV ACT: $1 ($2)"):repD(res.action,res.type)) -- print(("RECV ACT: $1 ($2)"):repD(res.action,res.type))
if res.type=='Failed' then 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==1100 then-- TODO
elseif res.action==1101 then-- TODO elseif res.action==1101 then-- TODO
elseif res.action==1102 then-- TODO elseif res.action==1102 then-- TODO

View File

@@ -15,7 +15,7 @@ end
local function _codeLogin() local function _codeLogin()
code=WIDGET.active.code:getText():upper() code=WIDGET.active.code:getText():upper()
if #code~=8 then if #code~=8 then
MES.new('error',"Wrong code length") MES.new('error',text.wrongCode)
else else
NET.codeLogin(code) NET.codeLogin(code)
end end