维护公告
This commit is contained in:
parent
e402550d92
commit
fb671ca1af
@ -381,6 +381,7 @@ function SDKManager:getServerList(callback)
|
|||||||
bundle_id = Platform:getIdentifier(),
|
bundle_id = Platform:getIdentifier(),
|
||||||
version = Platform:getClientVersion(),
|
version = Platform:getClientVersion(),
|
||||||
device_id = DeviceHelper:getDeviceId(),
|
device_id = DeviceHelper:getDeviceId(),
|
||||||
|
language = I18N:getLanguageAndArea(),
|
||||||
env = "release",-- 暂时写死
|
env = "release",-- 暂时写死
|
||||||
}
|
}
|
||||||
local loginCenterUrl = CS.BF.BFPlatform.GetLoginCenterURL()
|
local loginCenterUrl = CS.BF.BFPlatform.GetLoginCenterURL()
|
||||||
|
|||||||
@ -16,8 +16,12 @@ function LoginManager:showTestLoginUI()
|
|||||||
UIManager:showUI("app/module/login/test_login_ui")
|
UIManager:showUI("app/module/login/test_login_ui")
|
||||||
end
|
end
|
||||||
|
|
||||||
function LoginManager:showMaintenanceNoticeUI()
|
function LoginManager:showMaintenanceNoticeUI(content, openTime)
|
||||||
UIManager:showUI("app/module/login/maintenance_notice_ui")
|
local params = {
|
||||||
|
content = content,
|
||||||
|
openTime = openTime,
|
||||||
|
}
|
||||||
|
UIManager:showUI("app/module/login/maintenance_notice_ui", params)
|
||||||
end
|
end
|
||||||
|
|
||||||
---- 登录界面资源加载完毕后调用
|
---- 登录界面资源加载完毕后调用
|
||||||
@ -232,18 +236,6 @@ function LoginManager:removeAllLoginData()
|
|||||||
self.retryTimes = 0
|
self.retryTimes = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
function LoginManager:showServerNotOpenMessage()
|
|
||||||
local params = {
|
|
||||||
content = I18N:getGlobalText(I18N.GlobalConst.SERVER_MAINTAINED),
|
|
||||||
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
|
|
||||||
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
|
|
||||||
okFunc = function()
|
|
||||||
self:checkServerOpen()
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
GFunc.showMessageBox(params)
|
|
||||||
end
|
|
||||||
|
|
||||||
function LoginManager:getIsNeedHotUpdate()
|
function LoginManager:getIsNeedHotUpdate()
|
||||||
local serverVersion = self.versionInfo.version
|
local serverVersion = self.versionInfo.version
|
||||||
local clientVersion = CS.BF.BFMain.Instance.GameLaunchMgr:GetCurrentVersion()
|
local clientVersion = CS.BF.BFMain.Instance.GameLaunchMgr:GetCurrentVersion()
|
||||||
@ -286,10 +278,10 @@ function LoginManager:getIsclientLessThanMinVersion()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function LoginManager:checkServerOpen()
|
function LoginManager:checkServerOpen()
|
||||||
local serverOpenTime = tonumber(self.versionInfo.open_time or 0)
|
local serverOpenTime = tonumber(self.versionInfo.open_at or 0)
|
||||||
local clientTime = os.time()*1000
|
local clientTime = Time:getServerTime()*1000
|
||||||
if clientTime < serverOpenTime then -- 未开服
|
if clientTime < serverOpenTime then -- 未开服
|
||||||
self:showServerNotOpenMessage()
|
self:showMaintenanceNoticeUI(self.versionInfo.notice, serverOpenTime)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -314,7 +306,7 @@ function LoginManager:checkServerOpen()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function LoginManager:getServerList(callback)
|
function LoginManager:getServerList()
|
||||||
if self.accountLoginSuccess then
|
if self.accountLoginSuccess then
|
||||||
if self.authSid then
|
if self.authSid then
|
||||||
self:unscheduleGlobal(self.authSid)
|
self:unscheduleGlobal(self.authSid)
|
||||||
@ -359,8 +351,11 @@ function LoginManager:getServerList(callback)
|
|||||||
self.authSid = nil
|
self.authSid = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local serverTime = (jsonData.now or 0)
|
||||||
|
if serverTime > 0 then
|
||||||
|
Time:updateServerTime(serverTime)
|
||||||
|
end
|
||||||
self.versionInfo = jsonData
|
self.versionInfo = jsonData
|
||||||
Logger.printTable(jsonData)
|
|
||||||
self:checkServerOpen()
|
self:checkServerOpen()
|
||||||
else
|
else
|
||||||
-- BIReport:postRequestVersionFailed(self.loginCenterUrl, (os.clock() - self.connectStartTimes)*1000, self.retryTimes - 1)
|
-- BIReport:postRequestVersionFailed(self.loginCenterUrl, (os.clock() - self.connectStartTimes)*1000, self.retryTimes - 1)
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
local MaintenanceNoticeUI = class("MaintenanceNoticeUI", BaseUI)
|
local MaintenanceNoticeUI = class("MaintenanceNoticeUI", BaseUI)
|
||||||
|
|
||||||
function MaintenanceNoticeUI:ctor()
|
function MaintenanceNoticeUI:ctor(params)
|
||||||
|
self.content = params and params.content
|
||||||
|
self.openTime = params and params.openTime or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
function MaintenanceNoticeUI:getPrefabPath()
|
function MaintenanceNoticeUI:getPrefabPath()
|
||||||
@ -9,6 +11,24 @@ end
|
|||||||
|
|
||||||
function MaintenanceNoticeUI:onLoadRootComplete()
|
function MaintenanceNoticeUI:onLoadRootComplete()
|
||||||
local uiMap = self.root:genAllChildren()
|
local uiMap = self.root:genAllChildren()
|
||||||
|
uiMap["maintenance_notice_ui.bg.title_bg.title_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.NOTICE_TITLE))
|
||||||
|
if self.content == nil or self.content == "" then
|
||||||
|
uiMap["maintenance_notice_ui.bg.img_2.content_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.MAINTENANCE_NOTICE_DEFAULT))
|
||||||
|
else
|
||||||
|
uiMap["maintenance_notice_ui.bg.img_2.content_tx"]:setText(self.content)
|
||||||
|
end
|
||||||
|
uiMap["maintenance_notice_ui.bg.ok_btn"]:addClickListener(function()
|
||||||
|
local clientTime = Time:getServerTime()*1000
|
||||||
|
if clientTime >= self.openTime then
|
||||||
|
self:closeUI()
|
||||||
|
self:getServerList()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
uiMap["maintenance_notice_ui.bg.ok_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK))
|
||||||
|
end
|
||||||
|
|
||||||
|
function MaintenanceNoticeUI:getServerList()
|
||||||
|
ModuleManager.LoginManager:getServerList()
|
||||||
end
|
end
|
||||||
|
|
||||||
return MaintenanceNoticeUI
|
return MaintenanceNoticeUI
|
||||||
Loading…
x
Reference in New Issue
Block a user