【登录】修改服务器维护状态下,登录时的提示文字

dev_chengFeng
gaoxin 2021-08-09 14:10:54 +08:00
parent 8046913cef
commit ac8927f4e6
3 changed files with 21 additions and 8 deletions

View File

@ -204,5 +204,17 @@ function this:SendGetHttp(url, callback, _, _, failCB)
end, nil, nil, failCB)
end
-- 判断服务器状态是否可进入
function this.IsServerStateEnterable(state)
if not state then
return
end
if state ~= ServerStateDef.Fluency
and state ~= ServerStateDef.Congestion
and state ~= ServerStateDef.Full then
return false
end
return true
end
return this

View File

@ -699,9 +699,7 @@ function this.OnLoginClick()
return
end
-- 只要不是流畅,拥挤,爆满状态就不让登录
if LoginManager.state ~= ServerStateDef.Fluency
and LoginManager.state ~= ServerStateDef.Congestion
and LoginManager.state ~= ServerStateDef.Full then
if not LoginManager.IsServerStateEnterable(LoginManager.state) then
local function reServerCallback(str)
if str == nil then
return
@ -713,10 +711,8 @@ function this.OnLoginClick()
---selectServerPart
this.SetServerList(data)
-- 还是不可进状态则提示服务器维护中
if LoginManager.state ~= ServerStateDef.Fluency
and LoginManager.state ~= ServerStateDef.Congestion
and LoginManager.state ~= ServerStateDef.Full then
PopupTipPanel.ShowTip(Language[11142])
if not LoginManager.IsServerStateEnterable(LoginManager.state) then
PopupTipPanel.ShowTip("服务器还未开启哦,请道友稍后片刻,具体开服时间可见公告~")
RequestPanel.Hide()
else
-- 开始登录

View File

@ -72,7 +72,7 @@ function ServerListSelectPanel:SetServerList()
serverItem:SetValue(serverInfo, index)
serverItem:SetVisible(true)
serverItem.cloneObj:GetComponent("Button").onClick:AddListener(function()
if serverInfo.state == ServerStateDef.Maintenance then
if not LoginManager.IsServerStateEnterable(serverInfo.state) then
PopupTipPanel.ShowTip(Language[11142])
return
end
@ -125,6 +125,11 @@ end
function ServerListSelectPanel:QuickSeverClicked(gameObject, serverId)
Util.AddOnceClick(gameObject, function()
local serverInfo = self:GetServerInfo(serverId)
if not LoginManager.IsServerStateEnterable(serverInfo.state) then
PopupTipPanel.ShowTip(Language[11142])
return
end
if self.context.callback then
self.context.callback(self:GetServerIndex(serverId))
end