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 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