This commit is contained in:
xiekaidong 2023-06-02 11:53:57 +08:00
commit 12f51be781
2 changed files with 32 additions and 1 deletions

View File

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

View File

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