local AccountManager = BaseClass("AccountManager")
local Setting = CS.GameEntry.Setting
local Localization = CS.GameEntry.Localization
local RolesInfo = require("DataCenter.AccountData.RolesInfo")
local __init = function(self)
  self.allAccount = {}
  self.param = {}
  self.bindReward = {}
  self.rolesList = {}
  self.serverList = {}
  self.maxServerId = 0
  self.openRolesListAfterBind = false
  self.gmServers = {}
  self.accountChangeBindExp = -1
  self.isBindingNewAccount = false
  self.oldEmailVerifyCode = ""
  self.isFromSwitchAccountView = false
  self.isGuideInitFinished = false
  self.hasShownLevelOneBattleMainView = false
  self.shumeiCreateAccountRiskLevel = nil
  self.mailVerifyCodeType = ""
  
  function self.FuncOnParkourBattleMainViewCreate()
    self:OnCreateParkourBattleMainView()
  end
  
  EventManager:GetInstance():AddListener(EventId.ParkourBattleMainViewCreated, self.FuncOnParkourBattleMainViewCreate)
  
  function self.FuncOnGuideInitFinish()
    self:OnGuideInitFinish()
  end
  
  EventManager:GetInstance():AddListener(EventId.GuideInitFinish, self.FuncOnGuideInitFinish)
end
local __delete = function(self)
  EventManager:GetInstance():RemoveListener(EventId.GuideInitFinish, self.FuncOnGuideInitFinish)
  EventManager:GetInstance():RemoveListener(EventId.ParkourBattleMainViewCreated, self.FuncOnParkourBattleMainViewCreate)
  self.allAccount = nil
  self.param = nil
  self.bindReward = nil
  self.rolesList = nil
  self.serverList = nil
  self.openRolesListAfterBind = false
  self.gmServers = nil
  self.accountChangeBindExp = -1
  self.isBindingNewAccount = false
  self.oldEmailVerifyCode = ""
  self.mailVerifyCodeType = nil
  self.shumeiCreateAccountRiskLevel = nil
  self.hasShownLevelOneBattleMainView = nil
  self.isGuideInitFinished = nil
end
local InitData = function(self, message)
  local gameCenterOn = LuaEntry.DataConfig:CheckSwitch("gamecenter_binding")
  Setting:SetBool("SettingKeys_GAMECENTER_ON", gameCenterOn)
  local user = message.user
  self:SetAccountChangeBindExp(message.accountChangeBindCd)
  self:InitAccountList()
  self:InitAccountBind(user)
end
local InitAccountBind = function(self, user)
  Setting:SetPrivateString(SettingKeys.GP_USERID, "")
  Setting:SetPrivateString(SettingKeys.FB_USERID, "")
  Setting:SetPrivateString(SettingKeys.GAME_ACCOUNT, "")
  if user == nil then
    return
  end
  Setting:SetPrivateInt(SettingKeys.ACCOUNT_STATUS, user.az_account_status)
  if user.email then
    Setting:SetPrivateString(SettingKeys.GAME_ACCOUNT, user.email)
    if user.bindFlag then
      Setting:SetPrivateString(SettingKeys.GAME_ACCOUNT, user.email)
      if self.param.pwd ~= "" and self.param.pwd ~= nil then
        Setting:SetPrivateString(SettingKeys.GAME_PWD, self.param.pwd)
      end
      self:AddSelfAccount()
    else
      Setting:SetPrivateString(SettingKeys.GAME_ACCOUNT, "")
      Setting:SetPrivateString(SettingKeys.GAME_PWD, "")
      Setting:SetPrivateInt(SettingKeys.ACCOUNT_STATUS, AccountBandState.UnBand)
    end
  end
  if CS.SDKManager.IS_Android() and user.googlePlay ~= nil then
    Setting:SetPrivateString(SettingKeys.GP_USERID, user.googlePlay)
  end
  if CS.SDKManager.IS_IPhonePlayer() and user.pfId then
    Setting:SetPrivateString(SettingKeys.GP_USERID, user.pfId)
  end
  if user.faceBook ~= nil then
    Setting:SetPrivateString(SettingKeys.FB_USERID, user.faceBook)
  end
end
local InitAccountList = function(self)
  self.allAccount = {}
  local strAccount = Setting:GetString(SettingKeys.ACCOUNT_LIST, "")
  if strAccount ~= nil and strAccount ~= "" then
    local list = string.split(strAccount, "|")
    if list ~= nil then
      for _, v in ipairs(list) do
        local one = AccountInfo.New()
        local ret = one:ParseFromString(v)
        if ret then
          self.allAccount[one.account] = one
        end
      end
    end
  end
end
local AddAccount = function(self, accountInfo)
  if accountInfo == nil then
    return
  end
  local one = self:GetAccount(accountInfo.account)
  if not accountInfo:IsEqual(one) then
    self.allAccount[accountInfo.account] = accountInfo
    self:WriteCache()
  end
end
local GetAccount = function(self, account)
  return self.allAccount[account]
end
local WriteCache = function(self)
  local strAccount = ""
  for _, v in pairs(self.allAccount) do
    if v.account ~= nil then
      if strAccount ~= "" then
        strAccount = strAccount .. "|"
      end
      strAccount = strAccount .. v:ToString()
    end
  end
  Setting:SetString(SettingKeys.ACCOUNT_LIST, strAccount)
end
local RemoveAccount = function(self, account)
  if self.allAccount[account] ~= nil then
    self.allAccount[account] = nil
    self:WriteCache()
  end
end
local AccountBindHandle = function(self, message)
  if message.errorCode == nil then
    Setting:SetPrivateString(SettingKeys.GAME_ACCOUNT, self.param.userName)
    local one = AccountInfo.New()
    one.account = self.param.userName
    one.name = LuaEntry.Player.name
    one.server = LuaEntry.Player:GetSelfServerId()
    one.pic = LuaEntry.Player.pic
    one.uid = LuaEntry.Player:GetUid()
    one.picVer = LuaEntry.Player.picVer
    self:AddAccount(one)
    if self.param.pwd ~= nil and self.param.pwd ~= "" then
      Setting:SetPrivateString(SettingKeys.GAME_PWD, self.param.pwd)
    end
    Setting:SetPrivateInt(SettingKeys.ACCOUNT_STATUS, AccountBandState.UnCheck)
    EventManager:GetInstance():Broadcast(EventId.AccountBindEvent)
    UIManager:GetInstance():OpenWindow(UIWindowNames.UIAccountVerify, self.param.userName, 2)
  else
    UIUtil.ShowTips(Localization:GetString(message.errorCode))
    if UIManager:GetInstance():IsWindowOpen(UIWindowNames.UICreateAccount) then
      EventManager:GetInstance():Broadcast(EventId.CreateAccountMailFail)
    end
  end
end
local ChangeBindAccountSuccess = function(self, message)
  UIManager:GetInstance():DestroyWindow(UIWindowNames.UIAccountVerify)
  UIUtil.ShowMessage(Localization:GetString("email_change_des_success"), 1, GameDialogDefine.CONFIRM, nil, nil, nil, nil, "email_change_title")
  DataCenter.AccountManager:SetIsBindingNewAccount(false)
  DataCenter.AccountManager:SetAccountChangeBindExp(tonumber(message.accountChangeBindCd))
  Setting:SetPrivateInt(SettingKeys.ACCOUNT_STATUS, AccountBandState.Band)
  local account = Setting:GetPrivateString(SettingKeys.GAME_ACCOUNT, "")
  if account ~= "" then
    self:RemoveAccount(account)
  end
  account = message.newEmail or ""
  Setting:SetPrivateString(SettingKeys.GAME_ACCOUNT, account)
  local one = AccountInfo.New()
  one.account = account
  one.name = LuaEntry.Player.name
  one.server = LuaEntry.Player:GetSelfServerId()
  one.pic = LuaEntry.Player.pic
  one.uid = LuaEntry.Player:GetUid()
  one.picVer = LuaEntry.Player.picVer
  self:AddAccount(one)
  EventManager:GetInstance():Broadcast(EventId.AccountBindOKEvent)
end
local SetParam = function(self, param)
  self.param = param
end
local AccountChangePasswordHandle = function(self, message)
  if message.errorCode == nil then
    Setting:SetPrivateString(SettingKeys.GAME_ACCOUNT, self.param.userName)
    local one = AccountInfo.New()
    one.account = self.param.userName
    one.name = LuaEntry.Player.name
    one.server = LuaEntry.Player:GetSelfServerId()
    one.pic = LuaEntry.Player.pic
    one.password = self.param.pwd
    one.uid = LuaEntry.Player:GetUid()
    one.picVer = LuaEntry.Player.picVer
    self:AddAccount(one)
    if self.param.pwd ~= nil and self.param.pwd ~= "" then
      Setting:SetPrivateString(SettingKeys.GAME_PWD, self.param.pwd)
    end
    Setting:SetPrivateInt(SettingKeys.ACCOUNT_STATUS, AccountBandState.UnBand)
    UIManager:GetInstance():OpenWindow(UIWindowNames.UIModifySuccess)
  else
    UIUtil.ShowTips(Localization:GetString(message.errorCode))
  end
end
local GetAllAccount = function(self)
  return self.allAccount
end
local AccountLoginHandle = function(self, message)
  local errorCode = message.errorCode
  if errorCode ~= nil then
    if errorCode == "E100200" then
      local userName = ""
      local userServerId = ""
      local reason = ""
      local bantime = 0
      if message.gameUserName ~= nil then
        userName = message.gameUserName
      end
      if message.serverId ~= nil then
        userServerId = message.serverId
      end
      if message.banMsgId ~= nil then
        reason = message.banMsgId
      end
      if message.banTime ~= nil then
        bantime = message.banTime
      end
    elseif errorCode == "280048" then
      if self.param.mail ~= nil then
        UIUtil.ShowTips(Localization:GetString("280048", self.param.mail))
      else
        UIUtil.ShowTips(Localization:GetString("280048", ""))
      end
    else
      UIUtil.ShowTipsId(errorCode)
    end
    return
  end
  local gameUid = message.gameUid
  if gameUid == nil or gameUid == "" then
    local status = message.status
    if status == nil then
      UIUtil.ShowMessage(Localization:GetString("280061"))
    elseif status == 1 then
      UIUtil.ShowTipsId(280112)
      EventManager:GetInstance():Broadcast(EventId.AccountBindOKEvent)
    elseif status == 2 then
      UIUtil.ShowTipsId(280081)
      EventManager:GetInstance():Broadcast(EventId.AccountBindOKEvent)
    end
    return
  end
  local loginKey = message.loginKey
  if message.accountArr then
    local accountArr = message.accountArr
    self.rolesList = {}
    for i = 1, #accountArr do
      local rolesInfo = RolesInfo.New()
      rolesInfo:Parse(accountArr[i])
      table.insert(self.rolesList, rolesInfo)
      rolesInfo.loginKey = loginKey
    end
    if message.type ~= nil then
      local type = message.type
      if type == 0 or type == 2 or type == 4 then
        UIManager:GetInstance():OpenWindow(UIWindowNames.UIRoles, {anim = true, hideTop = true}, 1)
      else
        EventManager:GetInstance():Broadcast(EventId.RolesRefresh)
      end
    end
  else
    UIManager:GetInstance():OpenWindow(UIWindowNames.UILoginConfirm, {anim = true}, message)
  end
end
local GetRolesList = function(self)
  return self.rolesList
end
local ChangeAccountSecondOKCallback = function(self, message)
  local uid = message.gameUid
  Setting:SetString(SettingKeys.GAME_UID, uid)
  Setting:SetPrivateString(SettingKeys.GAME_ACCOUNT, self.param.userName)
  Setting:SetPrivateInt(SettingKeys.ACCOUNT_STATUS, AccountBandState.Band)
  Setting:SetString(SettingKeys.SERVER_IP, message.ip)
  Setting:SetInt(SettingKeys.SERVER_PORT, message.port)
  Setting:SetString(SettingKeys.SERVER_ZONE, message.zone)
  SFSNetwork.SendMessage(MsgDefines.UserCleanPost)
end
local AccountChangeMailHandle = function(self, message)
  if message.errorCode == nil then
    Setting:SetPrivateString(SettingKeys.GAME_ACCOUNT, self.param.newEmail)
    local one = AccountInfo.New()
    one.account = self.param.newEmail
    one.name = LuaEntry.Player.name
    one.server = LuaEntry.Player:GetSelfServerId()
    one.pic = LuaEntry.Player.pic
    one.password = self.param.pwd
    one.uid = LuaEntry.Player:GetUid()
    one.picVer = LuaEntry.Player.picVer
    self:AddAccount(one)
    if self.param.pwd ~= nil and self.param.pwd ~= "" then
      Setting:SetPrivateString(SettingKeys.GAME_PWD, self.param.pwd)
    end
    Setting:SetPrivateInt(SettingKeys.ACCOUNT_STATUS, AccountBandState.UnBand)
    EventManager:GetInstance():Broadcast(EventId.AccountChangeMailEvent)
    UIManager:GetInstance():OpenWindow(UIWindowNames.UIBindSendMail, self.param.newEmail)
  else
    UIUtil.ShowTips(Localization:GetString(message.errorCode))
  end
end
local PushAccountChangePwdHandle = function(self, message)
  Setting:SetPrivateInt(SettingKeys.ACCOUNT_STATUS, AccountBandState.UnCheck)
  EventManager:GetInstance():Broadcast(EventId.AccountBindOKEvent)
end
local PushAccountFirmedHandle = function(self, message)
  Setting:SetPrivateInt(SettingKeys.ACCOUNT_STATUS, AccountBandState.Band)
  if CS.SDKManager.IS_UNITY_IOS() and CS.StringUtils.VersionCompare(CS.GameEntry.Sdk.Version, "1.0.263") >= 0 then
    local account = Setting:GetPrivateString(SettingKeys.GAME_ACCOUNT, "")
    if account ~= nil and account ~= "" and self:IsGoogleEmail(account) then
      CS.GameEntry.Sdk:AnalyticsAccountEmail(account)
    end
  end
  EventManager:GetInstance():Broadcast(EventId.AccountBindOKEvent)
  UIManager:GetInstance():DestroyWindow(UIWindowNames.UIAccountVerify)
  local closeCallBack
  if self.openRolesListAfterBind then
    function closeCallBack()
      UIManager:GetInstance():OpenWindow(UIWindowNames.UIRoles, {anim = true, hideTop = true}, 0)
    end
  end
  UIManager:GetInstance():OpenWindow(UIWindowNames.UIBindSuccess, BindSuccessType.BindAccount, message.reward ~= nil, closeCallBack)
end
local IsGoogleEmail = function(self, account)
  local domain = account:match("@(.*)")
  if domain == "gmail.com" or domain == "googlemail.com" then
    return true
  else
    return false
  end
end
local AddSelfAccount = function(self)
  local Player = LuaEntry.Player
  if Player ~= nil then
    local account = Setting:GetPrivateString(SettingKeys.GAME_ACCOUNT, "")
    local pwd = Setting:GetPrivateString(SettingKeys.GAME_PWD, "")
    if account ~= "" and pwd ~= "" then
      local one = AccountInfo.New()
      one.account = account
      one.name = Player.name
      one.server = Player:GetSelfServerId()
      one.pic = Player.pic
      one.password = pwd
      one.uid = LuaEntry.Player:GetUid()
      one.picVer = LuaEntry.Player.picVer
      self:AddAccount(one)
    end
  end
end
local GetAccountBindState = function(self)
  local account = Setting:GetPrivateString(SettingKeys.GAME_ACCOUNT, "")
  if account ~= nil and account ~= "" then
    local status = Setting:GetPrivateInt(SettingKeys.ACCOUNT_STATUS, 0)
    return status
  end
  local gpAccount = Setting:GetPrivateString(SettingKeys.GP_USERID, "")
  if not string.IsNullOrEmpty(gpAccount) then
    local status = AccountBandState.Band
    return status
  end
  return AccountBandState.UnBand
end
local GetAccountBindType = function(self)
  local account = Setting:GetPrivateString(SettingKeys.GAME_ACCOUNT, "")
  if not string.IsNullOrEmpty(account) then
    return AccountBandType.Mail
  end
  local gpAccount = Setting:GetPrivateString(SettingKeys.GP_USERID, "")
  if not string.IsNullOrEmpty(gpAccount) then
    return AccountBandType.GooglePlay
  end
end
local OnHandleNewGame = function(self)
  local state = self:GetAccountBindState()
  if state == AccountBandState.Band then
    UIManager:GetInstance():OpenWindow(UIWindowNames.UIRoles, {anim = true, hideTop = true}, 0)
    return
  end
  local openWindow = function()
    UIManager:GetInstance():OpenWindow(UIWindowNames.UISettingAccount, {anim = true, hideTop = true}, nil, true)
  end
  UIUtil.ShowMessage(Localization:GetString("280097"), 1, GameDialogDefine.CONFIRM, "", openWindow, false, false, "", true)
  return
end
local AccountForgetPasswordHandle = function(self, message)
  if message.errorCode ~= nil then
    UIUtil.ShowTipsId(208207)
    return
  end
  EventManager:GetInstance():Broadcast(EventId.AccountCheckSuccess)
end
local SaveBindAccountReward = function(self, message)
  if next(message.reward) then
    self.bindReward = message.reward
  end
end
local GetBindAccountReward = function(self)
  return self.bindReward
end
local AccountGetAllServerHandle = function(self, message)
  if message.type ~= nil then
    local type = message.type
    if message.servers then
      local list = message.servers
      table.sort(list, function(a, b)
        if a.id < b.id then
          return true
        end
        return false
      end)
      if type == 0 then
        if 0 >= self.maxServerId then
          self.serverList = {}
          self.maxServerId = message.maxServerId
          local num = LuaEntry.DataConfig:TryGetNum("server_population", "k3", 10)
          local count = math.ceil(self.maxServerId / num)
          for i = 1, count do
            local param = {}
            param.minNum = 1 + (i - 1) * num
            param.maxNum = math.min(i * num, self.maxServerId)
            param.serverList = {}
            param.serverIndex = i - 1
            self.serverList[i - 1] = param
          end
        end
        if self.serverList[-1] == nil then
          local param = {}
          param.minNum = 0
          param.maxNum = 0
          param.serverList = list
          param.serverIndex = -1
          self.serverList[-1] = param
        else
          self.serverList[-1].serverList = list
        end
        if message.gmServers then
          if self.serverList[-2] == nil then
            local param = {}
            param.serverList = list
            param.serverIndex = -2
            self.serverList[-2] = param
          else
            self.serverList[-2].serverList = self.gmServers
          end
        else
          self.serverList[-2] = nil
        end
        self.gmServers = message.gmServers
      else
        local page = message.page
        if page ~= nil and self.serverList[page] ~= nil then
          self.serverList[page].serverList = list
        end
      end
      EventManager:GetInstance():Broadcast(EventId.ServerListRefresh)
    end
  end
end
local GetServerListByIndex = function(self, index)
  if self.serverList[index] ~= nil then
    return self.serverList[index].serverList
  end
  return ""
end
local GetServerTabData = function(self)
  local list = {}
  for k, v in pairs(self.serverList) do
    if 0 <= k then
      local param = {}
      param.index = k
      param.minNum = v.minNum
      param.maxNum = v.maxNum
      table.insert(list, param)
    end
  end
  table.sort(list, function(a, b)
    return a.index > b.index
  end)
  local firstParam = {}
  firstParam.index = -1
  table.insert(list, 1, firstParam)
  if self.serverList and self.serverList[-2] and not table.IsNullOrEmpty(self.serverList[-2].serverList) then
    local gmServer = {}
    gmServer.index = -2
    table.insert(list, 1, gmServer)
  end
  return list
end
local SetAfterBindOpenRolesList = function(self, state)
  self.openRolesListAfterBind = state
end
local ResetAfterBindOpenRolesList = function(self)
  self.openRolesListAfterBind = false
end
local SetAccountChangeBindExp = function(self, accountChangeBindExp)
  self.accountChangeBindExp = accountChangeBindExp or 0
end
local GetAccountChangeBindExp = function(self)
  return self.accountChangeBindExp
end
local SetIsBindingNewAccount = function(self, isBinding)
  self.isBindingNewAccount = isBinding
end
local GetIsBindingNewAccount = function(self)
  return self.isBindingNewAccount
end
local SetOldEmailVerifyCode = function(self, verifyCode)
  self.oldEmailVerifyCode = verifyCode
end
local GetOldEmailVerifyCode = function(self)
  return self.oldEmailVerifyCode
end
local GoogleCancelBindRefresh = function(self)
  Setting:SetString("tmpGooglePlay_uid", "")
  Setting:SetString("tmpGooglePlayName", "")
  Setting:SetPrivateString(SettingKeys.GP_USERID, "")
  Setting:SetPrivateString(SettingKeys.GP_USERNAME, "")
  EventManager:GetInstance():Broadcast(EventId.MSG_USER_BIND_OK)
  UIUtil.ShowMessage(Localization:GetString("email_unbind_des_success"), 1, GameDialogDefine.CONFIRM, nil, nil, nil, nil, "email_unbind_title")
end
local SetIsFromSwitchAccountView = function(self, state)
  self.isFromSwitchAccountView = state
end
local GetIsFromSwitchAccountView = function(self)
  return self.isFromSwitchAccountView
end

function AccountManager:OnCreateParkourBattleMainView()
  if DataCenter.LWGuideManager:GetCurGuideId() == GuideState.LevelOne then
    self.hasShownLevelOneBattleMainView = true
  end
end

function AccountManager:OnGuideInitFinish()
  self.isGuideInitFinished = true
end

function AccountManager:IsShumeiCreateAccountRisk()
  if not CS.ShumeiSdkManager.Instance.IsFunctionOpen then
    return false
  end
  return self.shumeiCreateAccountRiskLevel == 1 or self.shumeiCreateAccountRiskLevel == 2
end

function AccountManager:TriggerShumeiCreateAccountBan()
  local FuncOpenBanView = function()
    UIManager:GetInstance():OpenWindow(UIWindowNames.UIAccountBan, {anim = true}, self.shumeiCreateAccountRiskLevel, AccountBanViewShowType.ShumeiCreateAccountRisk)
  end
  if not self:IsShumeiCreateAccountRisk() then
    return
  end
  local isOn = CS.ClientSwitch.IsOn(CS.ClientSwitch.ENABLE_SHUMEI_CREATE_ACCOUNT_RISK_BAN)
  if DataCenter.LWGuideManager:GetCurGuideId() == GuideState.LevelOne then
    if self.hasShownLevelOneBattleMainView then
      if isOn then
        FuncOpenBanView()
      end
      PostEventLog.Track(PostEventLog.Defines.ShumeiCreateAccountRiskBan, {
        emulator_baned = "popup_after"
      })
      PostEventLog.Track("s_shu_mei_create_role_ban", {
        s_para1 = "shumei_null_or_emulator"
      })
    else
    end
  else
    if isOn then
      FuncOpenBanView()
    end
    PostEventLog.Track(PostEventLog.Defines.ShumeiCreateAccountRiskBan, {emulator_baned = "popup"})
  end
end

function AccountManager:OnPushShumeiExceptionLevel(message)
  if message == nil then
    Logger.LogWarning("ShumeiExceptionLevel message is nil")
    return
  end
  self.shumeiCreateAccountRiskLevel = message.creat_account_rick_level
  if self:IsShumeiCreateAccountRisk() then
    Logger.LogInfo("ShumeiExceptionLevel creat_account_rick_level is 1")
  end
  if not self.isGuideInitFinished then
    Logger.LogWarning("ShumeiExceptionLevel pushed when guide not init")
    return
  end
  self:TriggerShumeiCreateAccountBan()
end

function AccountManager:SetMailVerifyCodeType(oType)
  self.mailVerifyCodeType = oType
end

function AccountManager:GetMailVerifyCodeType()
  return self.mailVerifyCodeType
end

function AccountManager:IsDeviceMgrOpen()
  return LuaEntry.DataConfig:CheckSwitch("unbind_device")
end

function AccountManager:IsDoubleVerifyOpen()
  return LuaEntry.DataConfig:CheckSwitch("second_device_factor")
end

AccountManager.__init = __init
AccountManager.__delete = __delete
AccountManager.InitData = InitData
AccountManager.InitAccountBind = InitAccountBind
AccountManager.InitAccountList = InitAccountList
AccountManager.AddAccount = AddAccount
AccountManager.RemoveAccount = RemoveAccount
AccountManager.GetAccount = GetAccount
AccountManager.WriteCache = WriteCache
AccountManager.SetParam = SetParam
AccountManager.AccountBindHandle = AccountBindHandle
AccountManager.AccountChangePasswordHandle = AccountChangePasswordHandle
AccountManager.GetAllAccount = GetAllAccount
AccountManager.AccountLoginHandle = AccountLoginHandle
AccountManager.ChangeAccountSecondOKCallback = ChangeAccountSecondOKCallback
AccountManager.AccountChangeMailHandle = AccountChangeMailHandle
AccountManager.PushAccountChangePwdHandle = PushAccountChangePwdHandle
AccountManager.PushAccountFirmedHandle = PushAccountFirmedHandle
AccountManager.IsGoogleEmail = IsGoogleEmail
AccountManager.AddSelfAccount = AddSelfAccount
AccountManager.GetAccountBindState = GetAccountBindState
AccountManager.OnHandleNewGame = OnHandleNewGame
AccountManager.AccountForgetPasswordHandle = AccountForgetPasswordHandle
AccountManager.SaveBindAccountReward = SaveBindAccountReward
AccountManager.GetBindAccountReward = GetBindAccountReward
AccountManager.GetRolesList = GetRolesList
AccountManager.AccountGetAllServerHandle = AccountGetAllServerHandle
AccountManager.GetServerListByIndex = GetServerListByIndex
AccountManager.GetServerTabData = GetServerTabData
AccountManager.GetAccountBindType = GetAccountBindType
AccountManager.SetAfterBindOpenRolesList = SetAfterBindOpenRolesList
AccountManager.ResetAfterBindOpenRolesList = ResetAfterBindOpenRolesList
AccountManager.SetAccountChangeBindExp = SetAccountChangeBindExp
AccountManager.GetAccountChangeBindExp = GetAccountChangeBindExp
AccountManager.SetIsBindingNewAccount = SetIsBindingNewAccount
AccountManager.GetIsBindingNewAccount = GetIsBindingNewAccount
AccountManager.SetOldEmailVerifyCode = SetOldEmailVerifyCode
AccountManager.GetOldEmailVerifyCode = GetOldEmailVerifyCode
AccountManager.ChangeBindAccountSuccess = ChangeBindAccountSuccess
AccountManager.GoogleCancelBindRefresh = GoogleCancelBindRefresh
AccountManager.GetIsFromSwitchAccountView = GetIsFromSwitchAccountView
AccountManager.SetIsFromSwitchAccountView = SetIsFromSwitchAccountView
return AccountManager
