From 7a039b613915686aae5767779b274429b596a37e Mon Sep 17 00:00:00 2001 From: chenxi Date: Fri, 2 Jun 2023 11:14:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=96=AD=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/ui/ui_manager.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/lua/app/ui/ui_manager.lua b/lua/app/ui/ui_manager.lua index 6e82968f..232b2999 100644 --- a/lua/app/ui/ui_manager.lua +++ b/lua/app/ui/ui_manager.lua @@ -950,6 +950,37 @@ function UIManager:backToLoginWithoutLogout() Game:showLoginUI() end +-- 掉线提示处理 +function UIManager:showKickOut(msgData) + local content + local reason = NetManager:getKickOutReasonEnum(msgData.reason) + if reason == 0 then -- 服务器维护 + content = I18N:getGlobalText(I18N.GlobalConst.MAINTAIN) + elseif reason == 1 then -- 网络消息流控,也就是短时间内通信次数太多 + content = I18N:getGlobalText(I18N.GlobalConst.DISCONNECT_RELOGIN) + elseif reason == 2 then -- 封号 + content = I18N:getGlobalText(I18N.GlobalConst.FORBIDDEN) + elseif reason == 3 then -- 多点登录 + content = I18N:getGlobalText(I18N.GlobalConst.OTHER_LOGIN) + else + content = I18N:getGlobalText(I18N.GlobalConst.DISCONNECT_RELOGIN) + end + self.disconnectMsgBoxVisible = true + -- 被踢了的话就先断开连接再弹确认框 + NetManager:closeAndClear() + local params = { + content = content, + okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK), + okFunc = function() + self.disconnectMsgBoxVisible = false + ModuleManager.LoginManager:goToLoginScene() + end, + boxType = GConst.MESSAGE_BOX_TYPE.MB_OK, + top = true, + } + GFunc.showMessageBox(params) +end + -- 掉线提示处理 function UIManager:showDisconnect() self.disconnectMsgBoxVisible = true From 09fb4c1fb799a71398dcec0e4a9017882960d1dd Mon Sep 17 00:00:00 2001 From: chenxi Date: Fri, 2 Jun 2023 11:20:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=9A=84=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/common/sdk_manager.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/app/common/sdk_manager.lua b/lua/app/common/sdk_manager.lua index e3861481..0629481c 100644 --- a/lua/app/common/sdk_manager.lua +++ b/lua/app/common/sdk_manager.lua @@ -400,7 +400,7 @@ function SDKManager:login(callback, loginType) params = { type = "google", id = tostring(userId), - id_token = tostring(token) + token = tostring(token) } end if callback then