local HeroMatch3v3_Model = {} local private = {} local EventSystem = require('Event/EventSystem') local hero_match_3v3_opt_pb = require "Proto.hero_match_3v3_opt_pb" local hero_match_1v1_pb = require "Proto.hero_match_1v1_pb" local WORSHIP_COUNT_BYDAY = DataSheetManager.ConstData:GetDataByID("HeroMatch3v3SeeTime").IntValue local chat_pb = require("Proto/chat_pb") local CONST_INTERVAL_GETPLAYER = 60 local _townHomeRPTimerHandle = nil -- 刷新可比赛阶段红点 定时器句柄 HeroMatch3v3_Model.WinColor = "ffe13c" HeroMatch3v3_Model.Enum_State = { Ready = 1, -- 准备阶段 Battle = 2, -- 战斗阶段 Matching = 3, -- 匹配阶段 Finish = 4, -- 今日活动结束 } HeroMatch3v3_Model.Enum_BigStage = { Advance = 1, -- 报名阶段 Screening = 2, -- 筛选赛阶段 Rank = 3, -- 排名赛阶段 Finals = 4, -- 决赛阶段 Display = 5, -- 展示阶段 } --任务状态枚举 HeroMatch3v3_Model.Stage = { Default = 0, Join = 1100, -- 报名阶段 Filtration_1 = 1200, -- 筛选赛第一天 Filtration_2 = 1300, -- 筛选赛第二天 ShowHero = 1400, -- 展示期 match_2T1 = 1500, -- 冠军赛 match_4T2 = 1600, -- 4进2 match_8T4 = 1700, -- 8进4 match_16T8 = 1800, -- 16进8 match_32T16 = 1900, -- 30进16 match_64T32 = 2000, -- 64进32 -- 未来可能扩展赛程 } HeroMatch3v3_Model.Enum_GroupState = { Prepare = hero_match_1v1_pb.Prepare, -- 准备阶段 Battle = hero_match_1v1_pb.Battle, -- 战斗阶段 Finish = hero_match_1v1_pb.Finish, -- 战斗结束 } HeroMatch3v3_Model.IsOpenMainPanel = false -- 在玩法开启时间内打开过界面 local function GuessingSort(guessingA, guessingB) return guessingA.guessCfg.SortId < guessingB.guessCfg.SortId end function HeroMatch3v3_Model.OnStartup() private.MatchAllInfo = {} -- 赛季总数据 private.MyMatchInfo = {} -- 自己的参赛数据,在不同阶段需要判断自己是否进入了当前赛程 private.HeroMatch3v3Info = {} -- 缓存当前排位赛的所有赛程信息,后续查看过往比赛信息从这里取数据 private.MatchGuessingInfo = {} -- 所有竞猜信息 private.MatchAllPlayerInfo = {} -- 64强玩家信息 private.lastStageID = 0 private.getAllPlayerInfoTimestamp = 0 private.worshipRewardCount = 0 private.watchWarRequestOffset = 0 private.WatchWarInfo = {} private.WatchRewardCondition = nil -- 奖励状态 private.WatchBattleChatCount = 0 -- 发送弹幕数量 private.CurCountryId = 0 -- 当前赛季国别 EventSystem.Regist(EventID.SyncUnfairTeamPVP_BattleResult, private.SendBattleResult) EventSystem.Regist(EventID.FunctionUnlockUpdate, private.RefreshUnLockFunc) EventSystem.Regist(EventID.WatchBattle_LevelStop, private.OnWatchBattleOver) NetManager.RegisterMsgCB(MessageEnums.MessageGetStatueList3V3, private.OnGetStatueList) -- 获取雕像列表 NetManager.RegisterMsgCB(MessageEnums.MessageGetWorShipReward3V3, private.GetWorShipRewardResp) -- 领取膜拜后奖励 NetManager.RegisterMsgCB(MessageEnums.MessageG2CPushUpdateStatueList3V3, private.OnTryGetStatueList) -- 更新雕像信息 NetManager.RegisterMsgCB(MessageEnums.MessageG2CPushHeroMatchSuccess3V3, private.G2CPushHeroMatchSuccess) -- 匹配成功对阵信息推送 NetManager.RegisterMsgCB(MessageEnums.MessageG2CPushHeroMatchBattleResult3V3, private.G2CPushHeroMatchBattleResult) -- 对战结算协议 NetManager.RegisterMsgCB(MessageEnums.MessageG2CPushHeroMatchPlayerInfo3V3, private.G2CPushHeroMatchPlayerInfo) -- 推送玩家个人信息 NetManager.RegisterMsgCB(MessageEnums.MessageG2CPushHeroMatchStageChange3V3, private.G2CPushHeroMatchStageChange) -- 推送阶段变更信息 NetManager.RegisterMsgCB(MessageEnums.MessageHeroMatchOpen3V3, private.HeroMatchOpenResponse) -- 获取玩法信息 NetManager.RegisterMsgCB(MessageEnums.MessageHeroMatchQuizBet3V3, private.HeroMatchQuizBetResponse) -- 竞猜押注 NetManager.RegisterMsgCB(MessageEnums.MessageHeroMatchBattleBet3V3, private.HeroMatchBattleBetResponse) -- 战斗押注 NetManager.RegisterMsgCB(MessageEnums.MessageHeroMatchGetAllQuizInfo3V3, private.HeroMatchGetAllQuizInfoResponse) -- 获取竞猜信息 NetManager.RegisterMsgCB(MessageEnums.MessageHeroMatchGetAllPlayerInfo3V3, private.HeroMatchGetAllPlayerInfoResponse) -- 请求64强玩家信息 NetManager.RegisterMsgCB(MessageEnums.MessageGetHeroMatchTeamSimpleInfo, private.GetHeroMatchTeamSimpleInfoResponse) -- 请求64强玩家信息 EventSystem.Regist(EventID.AcquireSystemRedAfterUnlock, private.OnEnterWorldPostprocess) end function private.RefreshUnLockFunc(funcID, isUnlock) if funcID == MDL.Unlock.FunctionType.HeroMatch3v3 then if not isUnlock then private.ActiveEndCloseViewFunc() end end end function private.ActiveEndCloseViewFunc() UIManager.CloseView(Const_UI_Lua.UIEnum.UIWarzoneList) UIManager.CloseView(Const_UI_Lua.UIEnum.UICommonNoteView) UIManager.CloseView(Const_UI_Lua.UIEnum.UIHeroMatch3v3Store) EventSystem.Dispatch(EventID.UI_HeroMatch3v3_CloseView) if MDL.SpecialTeam.GetCurTeamType() == MDL.Unlock.FunctionType.HeroMatch3v3 then CTL.SpecialTeam.OnFuncIdClose() end end --region ******************* 外界获取数据接口 ******************* function HeroMatch3v3_Model.IsCurActivityInOpenTime() if HeroMatch3v3_Model.GetCurMatchTimeID() == 0 then return false end local MatchTime = DataSheetManager.TeamMatchTime:GetDataByID(HeroMatch3v3_Model.GetCurMatchTimeID()) return private.MatchAllInfo.curTitle >= MDL.HeroMatch3v3.Enum_BigStage.Screening and private.MatchAllInfo.curTitle <= MDL.HeroMatch3v3.Enum_BigStage.Finals and UTL.Time.IsServerInOpeningTime(MatchTime.StartTime, MatchTime.EndTime) end ---@return boolean 活动是否开启 function HeroMatch3v3_Model.IsShowHeroMatch3v3Entry() return MDL.Unlock.IsUnlock(MDL.Unlock.FunctionType.HeroMatch3v3) and private.MatchAllInfo.seasonId > 0 and UTL.Time.GetServerTimestamp() - private.MatchAllInfo.startTm >= 5 * UTL.Time.TotalSecondsOneMinute end function HeroMatch3v3_Model.GetCurStoreTabID() return private.MatchAllInfo.storeId end ---@return table 活动总信息 function HeroMatch3v3_Model.GetHeroMatch3v3AllInfo() return private.MatchAllInfo end ---@return enum 当前赛程大阶段编号 function HeroMatch3v3_Model.GetCurMatchTimeID() return private.MatchAllInfo.curTitle or 0 end ---@return enum 当前赛程阶段ID function HeroMatch3v3_Model.GetCurStageID() return private.MatchAllInfo.curStage or 0 end ---@return number 当前赛季编号 function HeroMatch3v3_Model.GetCurSeasonID() return private.MatchAllInfo.seasonId or 0 end ---@return table 当前比赛个人参赛信息 function HeroMatch3v3_Model.GetMyMatchInfo() return private.MyMatchInfo end ---@return 指定比赛阶段对战信息 function HeroMatch3v3_Model.GetMatchStageInfo(stageId) return private.HeroMatch3v3Info[stageId] end ---@return 当前赛季国别 function HeroMatch3v3_Model.GetCurCountryId() return private.CurCountryId end ---@return 自己当前最高阶段 function HeroMatch3v3_Model.GetMyHighestStage() -- 0是参与过程中还未结束,-1表示没参加活动 local bestStage = private.MyMatchInfo.myStage or -1 if bestStage == 0 then if private.MatchAllInfo.curStage == MDL.HeroMatch3v3.Stage.match_2T1 then return MDL.HeroMatch3v3.Stage.match_4T2 else return private.MatchAllInfo.curStage end else return bestStage end end ---@return int 返回大战区分组ID function HeroMatch3v3_Model.GetActivityWarZoneGroupID() return private.MatchAllInfo.groupId end ---@public number 获取膜拜剩余次数 function HeroMatch3v3_Model.GetCurDayWorshipCount() return WORSHIP_COUNT_BYDAY - private.worshipRewardCount end ---@return table 获取话题竞猜数据 function HeroMatch3v3_Model.GetHeroMatch3v3GuessingInfo() local guessingInfo = {} for _, guessCfg in DataSheetManager.TeamMatchTalkGuess:GetEnumerator() do for _, guessServer in pairs(private.MatchGuessingInfo) do if guessServer.questionId == guessCfg.ID then table.insert(guessingInfo, { serverInfo = guessServer, guessCfg = guessCfg }) break end end end table.sort(guessingInfo, GuessingSort) return guessingInfo end ---@return ipairs 商城展示商品 function HeroMatch3v3_Model.GetStoreGoodsEnumerator() local goods = {} local tabID = HeroMatch3v3_Model.GetCurStoreTabID() for _, v in MDL.OperationActivity.StoreGoodsData:GetEnumerator() do if v.TabID == tabID then table.insert(goods, v) end end return ipairs(goods) end ---@return table 检查是否竞猜了该选手 function HeroMatch3v3_Model.CheckIsGuessByGroupID_TeamID(groupId, teamId) for k, v in ipairs(private.MyMatchInfo.betInfo) do if v.groupId == groupId and v.betAcid == teamId then return true end end return false end ---@return table 获取玩家头像信息 function HeroMatch3v3_Model.GetPlayerInfoByACID(acid) if acid ~= "" then return private.MatchAllPlayerInfo[acid] end return nil end ---@return table 检查是否处在比赛阶段 function HeroMatch3v3_Model.CheckIsBattleStage() local curMatchTimeID = HeroMatch3v3_Model.GetCurMatchTimeID() return HeroMatch3v3_Model.IsShowHeroMatch3v3Entry() and curMatchTimeID > HeroMatch3v3_Model.Enum_BigStage.Advance and curMatchTimeID < HeroMatch3v3_Model.Enum_BigStage.Display end ---@return number 活动开启后,获取距离活动结束的时间 function HeroMatch3v3_Model.GetTimeToClose() local MatchTime = DataSheetManager.TeamMatchTime:GetDataByID(HeroMatch3v3_Model.GetCurMatchTimeID()) local closeTime = 0 local offsetTime = UTL.Time.GetServerIntervalTimeByTimeId(MatchTime.EndTime) if offsetTime > 0 then if closeTime == 0 then closeTime = offsetTime elseif closeTime > offsetTime then closeTime = offsetTime end end return closeTime end ---@return number 自己所在的分组 function HeroMatch3v3_Model.GetMyGroupAndIndex(stageID) local groupNum = 1 for group, groupInfo in ipairs(private.HeroMatch3v3Info[stageID].groupInfos) do for _, teamInfo in ipairs(groupInfo.teamInfos) do if teamInfo.teamId == MDL.SpecialTeam.GetMyTeamId() then local groupCount = #private.HeroMatch3v3Info[stageID].groupInfos / 4 groupNum = math.ceil(group / groupCount) break end end end return groupNum end --endregion ******************* 外界获取数据接口 ******************* --region ******************* 交互协议 **************************** function private.SetMatchInfo(info, myInfo) if myInfo then logging.log(LTAG.LOG, "[gyy ]推送个人信息 : ", myInfo) private.MyMatchInfo = myInfo end if info then private.CurCountryId = info.countryId[1] private.MatchAllInfo = info private.InitDelayOpenEntryTimer() if info.stageInfos then for _, matchInfo in ipairs(info.stageInfos) do --logging.log(LTAG.LOG, "[gyy ]比赛各阶段详细信息 : ", matchInfo) private.HeroMatch3v3Info[matchInfo.stageId] = matchInfo end end if private.MatchAllInfo.seasonId == 0 then private.ActiveEndCloseViewFunc() elseif private.MatchAllInfo.seasonId>0 then MDL.SpecialTeam.SetSpecialTeamType(MDL.Unlock.FunctionType.HeroMatch3v3) end end EventSystem.Dispatch(EventID.UI_HeroMatch3v3_RefreshInfo) end function private.InitDelayOpenEntryTimer() if private.delayOpenEntryTimer then return end local time = private.MatchAllInfo.startTm + 5 * UTL.Time.TotalSecondsOneMinute - UTL.Time.GetServerTimestamp() + 1 if time > 0 then private.delayOpenEntryTimer = TimerUtil.Interval(function() private.delayOpenEntryTimer = nil EventSystem.Dispatch(EventID.UI_HeroMatch3v3_RefreshInfo) end, time, 1) end end ---@public 登录推送比赛数据 function HeroMatch3v3_Model.SyncHeroMatch3v3Info(msgResp) if msgResp then private.SetMatchInfo(msgResp, nil) -- 红点 if HeroMatch3v3_Model.GetCurMatchTimeID() >= MDL.HeroMatch3v3.Enum_BigStage.Screening and HeroMatch3v3_Model.GetCurMatchTimeID() <= MDL.HeroMatch3v3.Enum_BigStage.Finals then local MatchTime = DataSheetManager.TeamMatchTime:GetDataByID(HeroMatch3v3_Model.GetCurMatchTimeID()) if UTL.Time.IsServerInOpeningTime(MatchTime.StartTime, MatchTime.EndTime) then CTL.RedPoint.AddRedPoint(CTL.RedPoint.RedPointKey.HeroMatch3v3_Login) end _townHomeRPTimerHandle = TimerUtil.Interval(private.UpdateTownHomeRP, 1, 1) HeroMatch3v3_Model.HeroMatchOpenRequest() HeroMatch3v3_Model.TryGetAllPlayerInfo() end end end ---@public 推送阶段变更推送 function private.G2CPushHeroMatchStageChange(msgResp) if msgResp and msgResp.info.seasonId > 0 then private.SetMatchInfo(msgResp.info, nil) if private.lastStageID > 0 and BattleDataGetter.CheckCurLevelType(LuaConst.LevelType.CrossHeroMatchTown3V3) then if private.HeroMatch3v3Info[private.lastStageID] and private.HeroMatch3v3Info[private.lastStageID].state == 4 then CTL.HeroMatch3v3.OpenHeroMatch3v3MainView() HeroMatch3v3_Model.TryGetAllPlayerInfo() end end private.lastStageID = private.MatchAllInfo.curStage CTL.HeroMatch3v3.RefreshWorshipRed() private.TryGetServerName() elseif msgResp.info.seasonId == 0 then private.MatchAllInfo.seasonId = 0 private.ActiveEndCloseViewFunc() EventSystem.Dispatch(EventID.UI_HeroMatch3v3_RefreshInfo) end end ---@public 推送个人信息 function private.G2CPushHeroMatchPlayerInfo(msgResp) if msgResp then private.SetMatchInfo(nil, msgResp.myInfo) end end ---@public 登陆更新膜拜信息 function HeroMatch3v3_Model.SyncHeroMatchWorshipInfo(msgResp) if msgResp.rewardCount then private.worshipRewardCount = msgResp.rewardCount CTL.HeroMatch3v3.RefreshWorshipRed() end end ---@private 推送匹配成功对阵信息 function private.G2CPushHeroMatchSuccess(msgResp) UIManager.OpenView(Const_UI_Lua.UIEnum.UIHeroMatch3v3MatchPanel, msgResp) end ---@private 结算协议推送 function private.G2CPushHeroMatchBattleResult(msgResp) if BattleDataGetter.IsInLevelWatchBattle() and not BattleDataGetter.HadStopLevel() then private.watchBattleSummary = msgResp else private.OnG2CPushHeroMatchBattleResult(msgResp) end end function private.OnG2CPushHeroMatchBattleResult(msgResp) private.cacheBattleSummary = msgResp if msgResp.winnerCampId < 0 then -- 当前比赛轮空 private.ShowFilterRewardsPanel(msgResp.Rewards) else CTL.HomeMain.CloseOpenView() EventSystem.Regist(EventID.UI_HeroMatch3v3_OnShowBattleSummary, private.ShowBattleResult) if #msgResp.Rewards > 0 then private.ShowFilterRewardsPanel(msgResp.Rewards) else private.ShowBattleResult() end end end function private.ShowBattleResult() EventSystem.UnRegist(EventID.UI_HeroMatch3v3_OnShowBattleSummary, private.ShowBattleResult) local result = private.cacheBattleSummary UIManager.OpenView(Const_UI_Lua.UIEnum.UIHeroMatch3v3Summary, result) private.cacheBattleSummary = nil end function private.ShowFilterRewardsPanel(rewardList) UIManager.OpenView( Const_UI_Lua.UIEnum.UIRewardGainPanel, { tipsIDS = "IDS_HeroMatch3v3_RewardTips", topContentIDS = "IDS_HeroMatch3v3_JoinReward", duration = 3, itemList = rewardList } ) end ---@public 请求全部比赛信息 function HeroMatch3v3_Model.HeroMatchOpenRequest() local msg = hero_match_3v3_opt_pb.HeroMatchOpen3V3Req() NetManager.SendMessage(MessageEnums.MessageHeroMatchOpen3V3, msg) end function private.HeroMatchOpenResponse(msgResp) if msgResp.Resp.Code == 0 then private.SetMatchInfo(msgResp.info.info, msgResp.info.myInfo) end end --考虑到64强数据量比较大,做个优化: --60s内只能请求一次 function HeroMatch3v3_Model.TryGetAllPlayerInfo() if private.MatchAllInfo.curTitle <= HeroMatch3v3_Model.Enum_BigStage.Screening then return false end if table.getDictCount(private.MatchAllPlayerInfo) == 0 or UTL.Time.GetServerTimestamp() - private.getAllPlayerInfoTimestamp >= CONST_INTERVAL_GETPLAYER then private.HeroMatchGetAllPlayerInfoRequest() return true end return false end ---@public 请求64强玩家信息 function private.HeroMatchGetAllPlayerInfoRequest() private.getAllPlayerInfoTimestamp = UTL.Time.GetServerTimestamp() local msg = hero_match_3v3_opt_pb.HeroMatchGetAllPlayerInfo3V3Req() NetManager.SendMessage(MessageEnums.MessageHeroMatchGetAllPlayerInfo3V3, msg) end function private.HeroMatchGetAllPlayerInfoResponse(msgResp) for k, v in ipairs(msgResp.infos) do private.MatchAllPlayerInfo[v.acid] = v.showInfo end logging.log(LTAG.LOG, "HeroMatchGetAllPlayerInfoResponse", private.MatchAllPlayerInfo) EventSystem.Dispatch(EventID.UI_HeroMatch3v3_RefreshPlayerInfo) end function HeroMatch3v3_Model.GetHeroMatchTeamSimpleInfoRequest(teamId) local msg = hero_match_3v3_opt_pb.GetHeroMatchTeamSimpleInfoReq() msg.teamId = teamId NetManager.SendMessage(MessageEnums.MessageGetHeroMatchTeamSimpleInfo, msg) end function private.GetHeroMatchTeamSimpleInfoResponse(msgResp) if msgResp.Resp.Code == 0 then UIManager.OpenView(Const_UI_Lua.UIEnum.UIHeroMatch3v3TeamInfo, msgResp.teamInfo) end end ---@public 膜拜奖励完成领奖 function HeroMatch3v3_Model.GetWorShipRewardReq() local msg = hero_match_3v3_opt_pb.GetWorShipReward3V3Req() NetManager.SendMessage(MessageEnums.MessageGetWorShipReward3V3, msg) end function private.GetWorShipRewardResp(msgResp) if msgResp.Resp.Code == 0 then -- 膜拜成功 发送喊话 CTL.ChannelChat.SendTextMsg( UIUtils.GetLocalizedTxt(Const_IDS["IDS_HeroMatch3v3_SeeWord"]), MDL.ChannelChat.GetChannelIdByCfgID(MDL.ChannelChat.ChannelCfgId.Current), nil, chat_pb.Room ) end end --请求获取雕像列表 function HeroMatch3v3_Model.GetStatueReq() local msg = hero_match_3v3_opt_pb.GetWorShipReward3V3Req() NetManager.SendMessage(MessageEnums.MessageGetStatueList3V3, msg) end --获得到雕像列表 function private.OnGetStatueList(msgResp) if msgResp.Resp.Code == 0 then CTL.HeroMatch3v3.RefreshStatueList(msgResp.BasicInfo, msgResp.canWorship) end end -- 服务器让我向它请求列表 function private.OnTryGetStatueList(msgResp) local curLevelID = BattleDataGetter.GetLevelID() local statueData = CTL.HeroMatch3v3.GetStatueConfig(curLevelID) if statueData then -- 删除旧的雕像 CTL.HeroMatch3v3.ClearStatues(true) if msgResp.opt == 1 then -- 拉取最新雕像 HeroMatch3v3_Model.GetStatueReq() end end end --region ********************** 竞猜协议 ***************** ---@public 请求全部竞猜题目信息 function HeroMatch3v3_Model.HeroMatchGetAllQuizInfoRequest() local msg = hero_match_3v3_opt_pb.HeroMatchGetAllQuizInfo3V3Req() NetManager.SendMessage(MessageEnums.MessageHeroMatchGetAllQuizInfo3V3, msg) end ---@public 请求全部竞猜题目信息 function private.HeroMatchGetAllQuizInfoResponse(msgResp) --logging.log(LTAG.LOG, "请求全部竞猜题目信息 : ", msgResp) for k, v in ipairs(msgResp.quizInfo) do private.MatchGuessingInfo[v.questionId] = v end EventSystem.Dispatch(EventID.UI_HeroMatch3v3_RefreshGuessing) end ---@public 胜负押注 function HeroMatch3v3_Model.HeroMatchBattleBetRequest(stageId, groupId, betAcid) local msg = hero_match_3v3_opt_pb.HeroMatchBattleBet3V3Req() msg.stageId = stageId msg.groupId = groupId msg.betAcid = betAcid NetManager.SendMessage(MessageEnums.MessageHeroMatchBattleBet3V3, msg) end ---@public 胜负押注 function private.HeroMatchBattleBetResponse(msgResp) --logging.log(LTAG.LOG, "胜负押注 : ", msgResp.myInfo) if msgResp.Resp.Code == 0 then private.SetMatchInfo(nil, msgResp.myInfo) end end ---@public 竞猜押注 function HeroMatch3v3_Model.HeroMatchQuizBetRequest(questionId, optionId, betNum) local msg = hero_match_3v3_opt_pb.HeroMatchQuizBet3V3Req() msg.questionId = questionId msg.optionId = optionId msg.betNum = betNum NetManager.SendMessage(MessageEnums.MessageHeroMatchQuizBet3V3, msg) end ---@public 竞猜押注 function private.HeroMatchQuizBetResponse(msgResp) --logging.log(LTAG.LOG, "竞猜押注 : ", msgResp) for k, v in ipairs(msgResp.quizInfo) do private.MatchGuessingInfo[v.questionId] = v end EventSystem.Dispatch(EventID.UI_HeroMatch3v3_RefreshGuessing) end --endregion ********************** 竞猜协议 ***************** --endregion ******************* 交互协议 **************************** function private.SendBattleResult(msg) NetManager.SendMessage(MessageEnums.MessageC2GUploadHeroMatchBattleResult3V3, msg) end function private.OnWatchBattleOver(isClickExitBtn) if BattleDataGetter.CheckCurLevelType(LuaConst.LevelType.SyncUnfairTeamPVP) then if private.watchBattleSummary then private.OnG2CPushHeroMatchBattleResult(private.watchBattleSummary) private.watchBattleSummary = nil else if not isClickExitBtn then -- 是否是按下退出按钮退出 。处理case:关卡结束时不是玩家点击退出而是自然看完且未收到服务器的战斗结果,此时不能被卡在关卡内要主动离开。 EventSystem.Dispatch(EventID.Level_SendRoleLeaveFuben, true) end end end end function private.UpdateTownHomeRP() if _townHomeRPTimerHandle then TimerUtil.Remove(_townHomeRPTimerHandle) _townHomeRPTimerHandle = nil end local curMatchTimeID = MDL.HeroMatch3v3.GetCurMatchTimeID() if curMatchTimeID >= MDL.HeroMatch3v3.Enum_BigStage.Screening and curMatchTimeID <= MDL.HeroMatch3v3.Enum_BigStage.Finals then local MatchTime = DataSheetManager.TeamMatchTime:GetDataByID(curMatchTimeID) if UTL.Time.IsServerInOpeningTime(MatchTime.StartTime, MatchTime.EndTime) then if not MDL.HeroMatch3v3.IsOpenMainPanel then CTL.RedPoint.AddRedPoint(CTL.RedPoint.RedPointKey.HeroMatch3v3_Login) end _townHomeRPTimerHandle = TimerUtil.Interval(private.UpdateTownHomeRP, UTL.Time.GetServerIntervalTimeByTimeId(MatchTime.StartTime) + UTL.Time.TotalSecondsOneDay, 1) else _townHomeRPTimerHandle = TimerUtil.Interval(private.UpdateTownHomeRP, UTL.Time.GetServerIntervalTimeByTimeId(MatchTime.StartTime), 1) end end end function HeroMatch3v3_Model.OnEnterWorldPostprocess() if HeroMatch3v3_Model.IsShowHeroMatch3v3Entry() then private.TryGetServerName() end end function private.TryGetServerName() if private.hasGetCrossServerName then return end MDL.CrossServer.GetZoneGroupInfoReq(MDL.CrossServer.CrossServerZoneGroupType[LuaConst.ActivityType.HeroMatch3v3]) private.hasGetCrossServerName = true end return HeroMatch3v3_Model