60 lines
1.8 KiB
Lua
60 lines
1.8 KiB
Lua
---@class LoginManager : BaseModule
|
|
local LoginManager = class("LoginManager", BaseModule)
|
|
|
|
LoginManager.TRY_LOGIN_TIME = 5
|
|
LoginManager.SERVER_LIST = {}
|
|
LoginManager.selectIndex = 0
|
|
|
|
function LoginManager:showLoginUI()
|
|
if not Platform:getIsPublishChannel() then
|
|
self:showTestLoginUI()
|
|
return
|
|
end
|
|
UIManager:showUI("app/module/login/login_ui")
|
|
end
|
|
|
|
function LoginManager:showTestLoginUI()
|
|
UIManager:showUI("app/module/login/test_login_ui")
|
|
end
|
|
|
|
---- 登录界面资源加载完毕后调用
|
|
function LoginManager:loginGame()
|
|
BIReport:postAdjustSimpleTrackEvent("modt3z", {})
|
|
ModuleManager.MaincityManager:firstEnterMainCity()
|
|
end
|
|
|
|
function LoginManager:goToLoginScene()
|
|
ModuleManager.BattleManager:clearOnExitScene()
|
|
NetManager:closeAndClear()
|
|
UIManager:backToLoginWithoutLogout()
|
|
DataManager:clear()
|
|
end
|
|
|
|
function LoginManager:getClientInfo()
|
|
local clientInfo = {}
|
|
local bundleId = Platform:getIdentifier()
|
|
local version = Platform:getClientVersion()
|
|
local device = DeviceHelper:getDeviceModel()
|
|
local deviceId = DeviceHelper:getDeviceId()
|
|
local deviceOS = DeviceHelper:getOSVersion()
|
|
local platform = Platform:getPlatform()
|
|
local accountType = SDKManager.LOGIN_TYPE[LocalData:getInt(LocalData.KEYS.SDK_LOGIN_TYPE, SDKManager.BF_LOGIN_TYPE.GUEST)]
|
|
local ip = LocalData:getLastLoginIp()
|
|
local networkType = DeviceHelper:getNetworkType()
|
|
local language = I18N:getLanguageAndArea()
|
|
local timezone = SDKManager:getTimeZone()
|
|
clientInfo.bundle_id = bundleId
|
|
clientInfo.version = version
|
|
clientInfo.device = device
|
|
clientInfo.device_id = deviceId
|
|
clientInfo.os_version = deviceOS
|
|
clientInfo.platform = platform
|
|
clientInfo.account_type = accountType
|
|
clientInfo.ip = ip
|
|
clientInfo.network_type = networkType
|
|
clientInfo.language = language
|
|
clientInfo.timezone = timezone
|
|
return clientInfo
|
|
end
|
|
|
|
return LoginManager |