调整ws错误消息显示,整理翻译文本

This commit is contained in:
MrZ626
2021-04-03 23:00:08 +08:00
parent 5fc3dff2d5
commit 7d325bd0db
9 changed files with 12 additions and 24 deletions

View File

@@ -53,11 +53,11 @@ end
--wsEvent
function NET.wsCloseMessage(message)
if message:sub(1,1)=="{"then
local mes=JSON.decode(message)
LOG.print(text.wsClose..mes.type,"warn")
local mes=JSON.decode(message)
if mes then
LOG.print(("%s [%s] %s"):format(text.wsClose,mes.type or"unknown type",mes.reason or""),"warn")
else
LOG.print(text.wsClose..type,"warn")
LOG.print(text.wsClose.."","warn")
end
end