添加服务器返回的错误信息语言文本

This commit is contained in:
MrZ_26
2022-10-24 18:39:27 +08:00
parent b668fa4750
commit 04559efaca
10 changed files with 453 additions and 112 deletions

View File

@@ -106,20 +106,68 @@ return{
Techrater={-- Server's warn/error messages
-- TODO
-- Server's warn/error messages
Techrater={
internalError="Internal error",
databaseError="Database error",
invalidFormat="Invalid format",
invalidArguments="Invalid arguments",
tooFrequent="Too frequent",
notAvailable="Not available",
noPermission="No permission",
roomNotFound="Room not found",
-- Controllers
WebSocket={
invalidConnection="Invalid connection",
invalidAction="Invalid action",
playerNotFound="Player not found",
connectionFailed="Connection failed",
},
-- Filters
CheckPermission={
playerNotFound="Player not found",
},
-- Plugins
ConnectionManager={
playerInvalid="Player invalid",
playerNotFound="Player not found",
connectionReplaced="Connection replaced",
},
NoticeManager={
noticeNotFound="Notice not found",
},
PlayerManager={
invalidCode="Invalid code",
invalidEmail="Invalid email",
invalidAccessToken="Invalid access token",
playerNotFound="Player not found",
noPassword="No password",
invalidEmailPass="Invalid email or password",
emailExists="Email exists",
invalidRefreshToken="Invalid refresh token",
emailSendError="Email send error",
},
-- Strategies
PlayerRole={
invalidRole="Invalid role",
invalidTarget="Invalid target",
},
PlayerType={
invalidType="Invalid type",
roomFull="Room full",
},
RoomJoin={
wrongPassword="Wrong password",
},
},
tooFrequently="Request too frequently",
tooFrequent="Request too frequently",
roomPasswordChanged="Room password changed",
getNoticeFail="Failed to fetch announcements",
oldVersion="Version $1 is now available",
needUpdate="Newer version required!",
versionNotMatch="Versions do not match!",
notFinished="Coming soon!",
jsonError="JSON error",
noUsername="Please enter your username",
wrongEmail="Invalid email address",
wrongCode="Invalid verification code",
@@ -140,12 +188,7 @@ return{
joinRoom="$1 has entered the room.",
leaveRoom="$1 has left the room.",
ready="Ready",
connStream="Connecting",
waitStream="Waiting",
spectating="Spectating",
chatRemain="Online",
chatStart="------Beginning of log------",
chatHistory="------New messages below------",

View File

@@ -105,20 +105,68 @@ return{
Techrater={-- Server's warn/error messages
-- TODO
-- Server's warn/error messages
Techrater={
-- internalError="Internal error",
-- databaseError="Database error",
-- invalidFormat="Invalid format",
-- invalidArguments="Invalid arguments",
-- tooFrequent="Too frequent",
-- notAvailable="Not available",
-- noPermission="No permission",
-- roomNotFound="Room not found",
-- Controllers
WebSocket={
-- invalidConnection="Invalid connection",
-- invalidAction="Invalid action",
-- playerNotFound="Player not found",
-- connectionFailed="Connection failed",
},
-- Filters
CheckPermission={
-- playerNotFound="Player not found",
},
-- Plugins
ConnectionManager={
-- playerInvalid="Player invalid",
-- playerNotFound="Player not found",
-- connectionReplaced="Connection replaced",
},
NoticeManager={
-- noticeNotFound="Notice not found",
},
PlayerManager={
-- invalidCode="Invalid code",
-- invalidEmail="Invalid email",
-- invalidAccessToken="Invalid access token",
-- playerNotFound="Player not found",
-- noPassword="No password",
-- invalidEmailPass="Invalid email or password",
-- emailExists="Email exists",
-- invalidRefreshToken="Invalid refresh token",
-- emailSendError="Email send error",
},
-- Strategies
PlayerRole={
-- invalidRole="Invalid role",
-- invalidTarget="Invalid target",
},
PlayerType={
-- invalidType="Invalid type",
-- roomFull="Room full",
},
RoomJoin={
-- wrongPassword="Wrong password",
},
},
-- tooFrequently="Request too frequently",
-- tooFrequent="Request too frequently",
-- roomPasswordChanged="Room password changed",
getNoticeFail="Error al buscar novedades.",
oldVersion="¡Está disponible la nueva versión $1!",
needUpdate="¡Nueva versión requerida!",
versionNotMatch="¡Las versiones no coinciden!",
notFinished="Próximamente",
jsonError="Error en Json",
noUsername="Por favor ingresa un nombre de usuario",
wrongEmail="Correo electrónico inválido",
-- wrongCode="Invalid verification code",
@@ -139,12 +187,7 @@ return{
joinRoom="$1 entró a la sala.",
leaveRoom="$1 salió de la sala.",
ready="LISTO",
connStream="CONECTANDO",
waitStream="ESPERANDO",
spectating="Espectando",
chatRemain="Usuarios en línea:",
chatStart="------Comienzo del historial------",
chatHistory="------Nuevos mensajes------",

View File

@@ -96,20 +96,69 @@ return{
Techrater={-- Server's warn/error messages
-- TODO
-- Server's warn/error messages
Techrater={
-- internalError="Internal error",
-- databaseError="Database error",
-- invalidFormat="Invalid format",
-- invalidArguments="Invalid arguments",
-- tooFrequent="Too frequent",
-- notAvailable="Not available",
-- noPermission="No permission",
-- roomNotFound="Room not found",
-- Controllers
WebSocket={
-- invalidConnection="Invalid connection",
-- invalidAction="Invalid action",
-- playerNotFound="Player not found",
-- connectionFailed="Connection failed",
},
-- Filters
CheckPermission={
-- playerNotFound="Player not found",
},
-- Plugins
ConnectionManager={
-- playerInvalid="Player invalid",
-- playerNotFound="Player not found",
-- connectionReplaced="Connection replaced",
},
NoticeManager={
-- noticeNotFound="Notice not found",
},
PlayerManager={
-- invalidCode="Invalid code",
-- invalidEmail="Invalid email",
-- invalidAccessToken="Invalid access token",
-- playerNotFound="Player not found",
-- noPassword="No password",
-- invalidEmailPass="Invalid email or password",
-- emailExists="Email exists",
-- invalidRefreshToken="Invalid refresh token",
-- emailSendError="Email send error",
},
-- Strategies
PlayerRole={
-- invalidRole="Invalid role",
-- invalidTarget="Invalid target",
},
PlayerType={
-- invalidType="Invalid type",
-- roomFull="Room full",
},
RoomJoin={
-- wrongPassword="Wrong password",
},
},
-- tooFrequently="Request too frequently",
-- tooFrequent="Request too frequently",
-- roomPasswordChanged="Room password changed",
getNoticeFail="Echec de l'obtention de la notice",
oldVersion="La version $1 est disponible !",
-- versionNotMatch="Version do not match!",
-- needUpdate="Newer version required!",
-- notFinished="Coming soon!",
jsonError="Erreur json",
noUsername="Entrez votre nom d'utilisateur",
wrongEmail="Mauvaise adresse email",
-- wrongCode="Invalid verification code",
@@ -133,9 +182,6 @@ return{
-- connStream="CONNECTING",
-- waitStream="WAITING",
-- spectating="Spectating",
chatRemain="En ligne : ",
chatStart="--------Début des logs--------",
chatHistory="-Nouveaux messages en dessous-",

View File

@@ -107,20 +107,68 @@ return{
Techrater={-- Server's warn/error messages
-- TODO
-- Server's warn/error messages
Techrater={
-- internalError="Internal error",
-- databaseError="Database error",
-- invalidFormat="Invalid format",
-- invalidArguments="Invalid arguments",
-- tooFrequent="Too frequent",
-- notAvailable="Not available",
-- noPermission="No permission",
-- roomNotFound="Room not found",
-- Controllers
WebSocket={
-- invalidConnection="Invalid connection",
-- invalidAction="Invalid action",
-- playerNotFound="Player not found",
-- connectionFailed="Connection failed",
},
-- Filters
CheckPermission={
-- playerNotFound="Player not found",
},
-- Plugins
ConnectionManager={
-- playerInvalid="Player invalid",
-- playerNotFound="Player not found",
-- connectionReplaced="Connection replaced",
},
NoticeManager={
-- noticeNotFound="Notice not found",
},
PlayerManager={
-- invalidCode="Invalid code",
-- invalidEmail="Invalid email",
-- invalidAccessToken="Invalid access token",
-- playerNotFound="Player not found",
-- noPassword="No password",
-- invalidEmailPass="Invalid email or password",
-- emailExists="Email exists",
-- invalidRefreshToken="Invalid refresh token",
-- emailSendError="Email send error",
},
-- Strategies
PlayerRole={
-- invalidRole="Invalid role",
-- invalidTarget="Invalid target",
},
PlayerType={
-- invalidType="Invalid type",
-- roomFull="Room full",
},
RoomJoin={
-- wrongPassword="Wrong password",
},
},
-- tooFrequently="Request too frequently",
-- tooFrequent="Request too frequently",
-- roomPasswordChanged="Room password changed",
getNoticeFail="Gagal mengambil pengumuman-pengumuman",
oldVersion="Versi $1 sekarang tersedia",
needUpdate="Butuh versi lebih baru!",
versionNotMatch="Versi tidak sama!",
notFinished="Segera akan datang!",
jsonError="Eror JSON",
noUsername="Silahkan memasukan username Anda",
wrongEmail="Alamat email tidak sah",
-- wrongCode="Invalid verification code",
@@ -141,12 +189,7 @@ return{
joinRoom="$1 telah memasuki ruangan.",
leaveRoom="$1 telah keluar dari ruangan.",
ready="Siap",
connStream="Memuat",
waitStream="Menunggu",
spectating="Menonton",
chatRemain="Online",
chatStart="------Awal percakapan------",
chatHistory="------Pesan-pesan baru di bawah ini------",

View File

@@ -107,20 +107,68 @@ return{
Techrater={-- Server's warn/error messages
-- TODO
-- Server's warn/error messages
Techrater={
-- internalError="Internal error",
-- databaseError="Database error",
-- invalidFormat="Invalid format",
-- invalidArguments="Invalid arguments",
-- tooFrequent="Too frequent",
-- notAvailable="Not available",
-- noPermission="No permission",
-- roomNotFound="Room not found",
-- Controllers
WebSocket={
-- invalidConnection="Invalid connection",
-- invalidAction="Invalid action",
-- playerNotFound="Player not found",
-- connectionFailed="Connection failed",
},
-- Filters
CheckPermission={
-- playerNotFound="Player not found",
},
-- Plugins
ConnectionManager={
-- playerInvalid="Player invalid",
-- playerNotFound="Player not found",
-- connectionReplaced="Connection replaced",
},
NoticeManager={
-- noticeNotFound="Notice not found",
},
PlayerManager={
-- invalidCode="Invalid code",
-- invalidEmail="Invalid email",
-- invalidAccessToken="Invalid access token",
-- playerNotFound="Player not found",
-- noPassword="No password",
-- invalidEmailPass="Invalid email or password",
-- emailExists="Email exists",
-- invalidRefreshToken="Invalid refresh token",
-- emailSendError="Email send error",
},
-- Strategies
PlayerRole={
-- invalidRole="Invalid role",
-- invalidTarget="Invalid target",
},
PlayerType={
-- invalidType="Invalid type",
-- roomFull="Room full",
},
RoomJoin={
-- wrongPassword="Wrong password",
},
},
-- tooFrequently="Request too frequently",
-- tooFrequent="Request too frequently",
-- roomPasswordChanged="Room password changed",
getNoticeFail="お知らせ情報を取得できませんでした",
oldVersion="バージョン$1のダウンロードが可能になりました",
needUpdate="最新バージョンに更新してください",
versionNotMatch="バージョンが一致しません",
notFinished="未完成ですので、ご期待ください",
jsonError="JSONエラー",
noUsername="ユーザーネームを入力してください!",
wrongEmail="メールアドレスが無効です!",
-- wrongCode="Invalid verification code",
@@ -141,12 +189,7 @@ return{
joinRoom="$1 が入室しました",
leaveRoom="$1 が退出しました",
ready="準備OK",
connStream="接続中……",
waitStream="待機中……",
spectating="観戦中",
chatRemain="オンライン",
chatStart="------チャットの先頭------",
chatHistory="------新しいメッセージ------",

View File

@@ -94,20 +94,68 @@ return{
Techrater={-- Server's warn/error messages
-- TODO
},
-- Server's warn/error messages
Techrater={
-- internalError="Internal error",
-- databaseError="Database error",
-- invalidFormat="Invalid format",
-- invalidArguments="Invalid arguments",
-- tooFrequent="Too frequent",
-- notAvailable="Not available",
-- noPermission="No permission",
-- roomNotFound="Room not found",
-- tooFrequently="Request too frequently",
-- Controllers
WebSocket={
-- invalidConnection="Invalid connection",
-- invalidAction="Invalid action",
-- playerNotFound="Player not found",
-- connectionFailed="Connection failed",
},
-- Filters
CheckPermission={
-- playerNotFound="Player not found",
},
-- Plugins
ConnectionManager={
-- playerInvalid="Player invalid",
-- playerNotFound="Player not found",
-- connectionReplaced="Connection replaced",
},
NoticeManager={
-- noticeNotFound="Notice not found",
},
PlayerManager={
-- invalidCode="Invalid code",
-- invalidEmail="Invalid email",
-- invalidAccessToken="Invalid access token",
-- playerNotFound="Player not found",
-- noPassword="No password",
-- invalidEmailPass="Invalid email or password",
-- emailExists="Email exists",
-- invalidRefreshToken="Invalid refresh token",
-- emailSendError="Email send error",
},
-- Strategies
PlayerRole={
-- invalidRole="Invalid role",
-- invalidTarget="Invalid target",
},
PlayerType={
-- invalidType="Invalid type",
-- roomFull="Room full",
},
RoomJoin={
-- wrongPassword="Wrong password",
},
},
-- tooFrequent="Request too frequently",
-- roomPasswordChanged="Room password changed",
getNoticeFail="Não conseguiu ter anúncios",
oldVersion="Versão $1 esta disponível agora!",
-- versionNotMatch="Version do not match!",
-- needUpdate="Newer version required!",
-- notFinished="Coming soon!",
jsonError="Json error",
noUsername="Insira seu nome de usuário",
wrongEmail="Endereço de email errado",
-- wrongCode="Invalid verification code",
@@ -131,9 +179,6 @@ return{
-- connStream="CONNECTING",
-- waitStream="WAITING",
-- spectating="Spectating",
chatRemain="Online",
chatStart="------Começo do log------",
chatHistory="------Novas mensagens abaixo------",

View File

@@ -106,20 +106,68 @@ return{
Techrater={-- Server's warn/error messages
-- TODO
-- Server's warn/error messages
Techrater={
internalError="内部错误",
databaseError="数据库错误",
invalidFormat="json格式无效",
invalidArguments="参数无效",
tooFrequent="请求太频繁",
notAvailable="无效请求",
noPermission="没有权限",
roomNotFound="找不到房间",
-- Controllers
WebSocket={
invalidConnection="无效连接",
invalidAction="无效操作",
playerNotFound="找不到玩家",
connectionFailed="连接失败",
},
-- Filters
CheckPermission={
playerNotFound="找不到玩家",
},
-- Plugins
ConnectionManager={
playerInvalid="无效玩家",
playerNotFound="找不到玩家",
connectionReplaced="连接已更换",
},
NoticeManager={
noticeNotFound="找不到公告",
},
PlayerManager={
invalidCode="无效验证码",
invalidEmail="无效邮箱",
invalidAccessToken="访问令牌无效",
playerNotFound="找不到玩家",
noPassword="无密码",
invalidEmailPass="邮箱或密码无效",
emailExists="邮箱存在",
invalidRefreshToken="刷新令牌无效",
emailSendError="邮箱发送错误",
},
-- Strategies
PlayerRole={
invalidRole="无效角色",
invalidTarget="无效目标",
},
PlayerType={
invalidType="无效类型",
roomFull="房间已满",
},
RoomJoin={
wrongPassword="密码错误",
},
},
tooFrequently="操作太频繁",
tooFrequent="操作太频繁",
roomPasswordChanged="房间密码已更改",
getNoticeFail="拉取公告失败",
oldVersion="最新版本$1可以下载了",
needUpdate="请更新游戏!",
versionNotMatch="版本不一致!",
notFinished="暂未完成,敬请期待!",
jsonError="json错误",
noUsername="请填写用户名",
wrongEmail="无效邮箱地址",
wrongCode="无效验证码",
@@ -140,12 +188,7 @@ return{
joinRoom="$1 进入房间",
leaveRoom="$1 离开房间",
ready="各就各位!",
connStream="正在连接",
waitStream="等待其他人连接",
spectating="观战中",
chatRemain="人数:",
chatStart="------消息的开头------",
chatHistory="------以上是历史消息------",

View File

@@ -106,20 +106,15 @@ return{
Techrater={-- Server's warn/error messages
-- TODO
},
-- Server's warn/error messages
Techrater={},
tooFrequently="Error.requestTooFrequently();",
tooFrequent="Error.requesttooFrequent();",
roomPasswordChanged="Info.roomPwChanged();",
getNoticeFail="Error.FetchAnnouncement();",
oldVersion="Version.New($1);",
needUpdate="Version.NeedUpdate();",
versionNotMatch="Version.NotMatch();",
notFinished="ComingSoon();",
jsonError="Error.JSON();",
noUsername="Error.NoUsername();",
wrongEmail="Error.WrongEmail();",
wrongCode="Error.WrongVerificationCode();",
@@ -140,12 +135,7 @@ return{
joinRoom="Room.Join($1);",
leaveRoom="Room.Leave($1);",
ready="Ready();",
connStream="Stream.Connecting();",
waitStream="Stream.Waiting();",
spectating="Room.Spectating();",
chatRemain="Online=",
chatStart="#!Log.Beginning();",
chatHistory="#!NewMassagesBelow();",

View File

@@ -106,26 +106,74 @@ return{
Techrater={-- Server's warn/error messages
-- TODO
-- Server's warn/error messages
Techrater={
internalError="內部錯誤",
databaseError="資料庫錯誤",
invalidFormat="json格式無效",
invalidArguments="參數無效",
tooFrequent="請求太頻繁",
notAvailable="無效請求",
noPermission="沒有許可權",
roomNotFound="找不到房間",
-- Controllers
WebSocket={
invalidConnection="無效連接",
invalidAction="無效操作",
playerNotFound="找不到玩家",
connectionFailed="連接失敗",
},
-- Filters
CheckPermission={
playerNotFound="找不到玩家",
},
-- Plugins
ConnectionManager={
playerInvalid="無效玩家",
playerNotFound="找不到玩家",
connectionReplaced="連接已更換",
},
NoticeManager={
noticeNotFound="找不到公告",
},
PlayerManager={
invalidCode="無效驗證碼",
invalidEmail="無效郵箱",
invalidAccessToken="訪問權杖無效",
playerNotFound="找不到玩家",
noPassword="無密碼",
invalidEmailPass="郵箱或密碼無效",
emailExists="郵箱存在",
invalidRefreshToken="重繪權杖無效",
emailSendError="郵箱發送錯誤",
},
-- Strategies
PlayerRole={
invalidRole="無效角色",
invalidTarget="無效目標",
},
PlayerType={
invalidType="無效類型",
roomFull="房間已滿",
},
RoomJoin={
wrongPassword="密碼錯誤",
},
},
tooFrequently="操作太頻繁",
tooFrequent="操作太頻繁",
roomPasswordChanged="房間密碼已更改",
getNoticeFail="無法獲取公告",
oldVersion="版本 $1 現已推出",
needUpdate="請更新遊戲!",
versionNotMatch="版本不匹配",
notFinished="即將推出!",
jsonError="JSON錯誤",
noUsername="請輸入用戶名",
wrongEmail="無效的電郵地址",
wrongCode="無效的驗證碼",
noPassword="請輸入密碼",
diffPassword="密碼不匹配",
checkEmail="已發送註冊請求",
checkEmail="請查看郵件驗證碼",
wsFailed="連接失敗: $1",
wsClose="連接斷開: $1",
@@ -140,12 +188,7 @@ return{
joinRoom="$1 進入房間",
leaveRoom="$1 離開房間",
ready="準備!",
connStream="正在連接……",
waitStream="等待其他用戶連接……",
spectating="旁觀中",
chatRemain="用戶數:",
chatStart="------訊息開始------",
chatHistory="------以上為歷史訊息------",

View File

@@ -60,7 +60,7 @@ local function parseError(pathStr)
LOG(pathStr)
if type(pathStr)~='string' then
MES.new('error',"<"..tostring(pathStr)..">",5)
elseif pathStr:find("[^0-9a-z.]") then
elseif pathStr:find("[^0-9a-zA-Z.]") then
MES.new('error',"["..pathStr.."]",5)
else
local mesPath=STRING.split(pathStr,'.')
@@ -73,20 +73,22 @@ local function parseError(pathStr)
if type(curText)~='table' then break end
curText=curText[mesPath[i]]
end
if not curText then
curText=text.Techrater[mesPath[#mesPath]]
end
if type(curText)=='table' then
if availableErrorTextType[curText[1]] and type(curText[2])=='string' and type(curText[3])=='number' then
MES.new(curText[1],curText[2],math.min(curText[3],5))
else
MES.new('error',"["..pathStr.."]",5)
return
end
elseif type(curText)=='string' then
if #curText>0 then
MES.new('warn',curText,5)
return
end
else
MES.new('error',"["..pathStr.."]",5)
end
MES.new('warn',"["..pathStr.."]",5)
end
end
local function getMsg(request,timeout)
@@ -465,7 +467,7 @@ end
-- Room
function NET.room_chat(msg,rid)
if not TASK.lock('chatLimit',1.626) then
MES.new('warn',"Talk too fast")
MES.new('warn',text.tooFrequent)
elseif #msg>0 then
wsSend(1300,{
message=msg,
@@ -475,7 +477,7 @@ function NET.room_chat(msg,rid)
end
end
function NET.room_create(data)
if not TASK.lock('createRoom',10) then MES.new('warn',text.tooFrequently) return end
if not TASK.lock('createRoom',10) then MES.new('warn',text.tooFrequent) return end
TABLE.coverR(data,NET.roomState)
WAIT{timeout=12}
wsSend(actMap.room_create,data)