--战队,即一些特殊玩法的队伍 local SpecialTeam_Model = {} local private = {} local EventSystem = require('Event/EventSystem') local team_war_operate_pb = require('Proto/team_war_operate_pb') local TeamShowPerNum = DataSheetManager.ConstData:GetDataByID("TeamShowPerNum").IntValue local TeamShowMax = DataSheetManager.ConstData:GetDataByID("TeamShowMax").IntValue local TeamListMax = DataSheetManager.ConstData:GetDataByID("TeamListMax").IntValue function SpecialTeam_Model.OnStartup() NetManager.RegisterMsgCB(MessageEnums.MessageTeamWarCreate, private.OnTeamWarCreateResp) NetManager.RegisterMsgCB(MessageEnums.MessageTeamWarApply, private.OnTeamWarApplyResp) NetManager.RegisterMsgCB(MessageEnums.MessageTeamWarApplyHandle, private.OnTeamWarApplyHandleResp) NetManager.RegisterMsgCB(MessageEnums.MessageTeamWarInvite, private.OnTeamWarInviteResp) NetManager.RegisterMsgCB(MessageEnums.MessageTeamWarInviteHandle, private.OnTeamWarInviteHandleResp) NetManager.RegisterMsgCB(MessageEnums.MessageTeamWarLeave, private.OnTeamWarLeaveResp) NetManager.RegisterMsgCB(MessageEnums.MessageTeamWarKickOutMember, private.OnTeamWarKickOutMemberResp) NetManager.RegisterMsgCB(MessageEnums.MessageTeamWarLeaderChange, private.OnTeamWarLeaderChangeResp) NetManager.RegisterMsgCB(MessageEnums.MessageTeamWarRecommendList, private.OnTeamWarRecommendListResp) NetManager.RegisterMsgCB(MessageEnums.MessageTeamWarGetAllServerTeamRank, private.TeamWarGetAllServerTeamRankResp) NetManager.RegisterMsgCB(MessageEnums.MessageTeamWarLineUp, nil) NetManager.RegisterMsgCB(MessageEnums.MessageG2CPushTeamWarKickOut, private.OnG2CPushTeamWarKickOut) NetManager.RegisterMsgCB(MessageEnums.MessageG2CPushTeamWarTeamLeaderChange, private.OnG2CPushTeamWarTeamLeaderChange) NetManager.RegisterMsgCB(MessageEnums.MessageG2CPushTeamWarTeamMemberInfoChanged, private.OnG2CPushTeamWarTeamMemberInfoChanged) NetManager.RegisterMsgCB(MessageEnums.MessageG2CPushTeamWarJoinTeam, private.OnG2CPushTeamWarJoinTeam) NetManager.RegisterMsgCB(MessageEnums.MessageG2CPushTeamWarTeamInfo, private.OnG2CPushTeamWarTeamInfo) NetManager.RegisterMsgCB(MessageEnums.MessageG2CPushTeamWarApplicantInfo, private.OnG2CPushTeamWarApplicantInfo) NetManager.RegisterMsgCB(MessageEnums.MessageG2CPushTeamWarRefusedApply, private.OnG2CPushTeamWarRefusedApply) NetManager.RegisterMsgCB(MessageEnums.MessageG2CPushTeamWarLeaveTeam, private.OnG2CPushTeamWarLeaveTeam) NetManager.RegisterMsgCB(MessageEnums.MessageG2CPushTeamWarInvited, private.OnG2CPushTeamWarInvited) NetManager.RegisterMsgCB(MessageEnums.MessageG2CPushTeamWarMemberStateChanged, private.OnG2CPushTeamWarMemberStateChanged) NetManager.RegisterMsgCB(MessageEnums.MessageG2CPushTeamWarTeamStateChanged, private.OnG2CPushTeamWarTeamStateChanged) private.curTeamType = -1 private.teamInfo = {} private.teamMemberInfo = {} private.inviteList = {} -- TeamInviterInfo private.applyTeamList = {} private.recommendTeamList = {} private.originServerRecommendTeamNum = 0 end --是否在玩法时间内 function SpecialTeam_Model.IsFunctionOpen() if SpecialTeam_Model.GetCurTeamType() == MDL.Unlock.FunctionType.HeroMatch3v3 then return MDL.HeroMatch3v3.IsShowHeroMatch3v3Entry() elseif SpecialTeam_Model.GetCurTeamType() == MDL.Unlock.FunctionType.TeamFairChampionship then return CTL.TeamFairChampionship.IsShowEntry() end return false end function SpecialTeam_Model.SetSpecialTeamType(teamType) private.curTeamType = teamType end --这里其实是战队的类型,目前关联动能id,HeroMatch3v3等,不改名字了 function SpecialTeam_Model.GetCurTeamType() return private.curTeamType end function SpecialTeam_Model.GetTeamLimitCountry() if SpecialTeam_Model.GetCurTeamType() == MDL.Unlock.FunctionType.HeroMatch3v3 then return MDL.HeroMatch3v3.GetCurCountryId() end return -1 end function SpecialTeam_Model.GetMyTeamId() return private.teamInfo.teamId end function SpecialTeam_Model.GetMyTeamName() return private.teamInfo.teamName end --我的战团是否有战绩 function SpecialTeam_Model.CheckHasRecord() if SpecialTeam_Model.HasTeam() then return private.teamInfo.hasRecord end return false end function SpecialTeam_Model.HasTeam() return string.isNilOrEmpty(SpecialTeam_Model.GetMyTeamId()) == false end function SpecialTeam_Model.GetMemberInfoById(memberId) for i, v in ipairs(private.teamMemberInfo) do if v.memberId == memberId then return v end end return nil end function SpecialTeam_Model.GetInviteList() return private.inviteList end function SpecialTeam_Model.GetMemberNumbers() return #private.teamMemberInfo or 0 end function SpecialTeam_Model.IsTeamFull() return SpecialTeam_Model.GetMemberNumbers() == 3 end function SpecialTeam_Model.GetRecommendTeamList() return private.recommendTeamList end function private.ChangeMemberState(memberId, state) local finded = false for i, v in ipairs(private.teamMemberInfo) do if v.memberId == memberId then v.state = state finded = true end end return finded end function SpecialTeam_Model.GetApplyTeamList() return private.applyTeamList end function SpecialTeam_Model.IsHasMemberApply() return #private.applyTeamList>0 end function SpecialTeam_Model.IsSelfLeader() local selfInfo = SpecialTeam_Model.GetMemberInfoById(BattleDataGetter.GetAcID()) if selfInfo then return selfInfo.type == MDL.Team.MemberType.Leader end return false end function SpecialTeam_Model.IsMemberInTeam(memberId) for i, v in ipairs(private.teamMemberInfo) do if v.memberId == memberId then return true end end return false end function private.GetApplyListIndexById(id) for i, v in ipairs(private.applyTeamList) do if v.applyPlayerId == id then return i - 1 end end return nil end function private.GetInviteListIndexById(id) for i, v in ipairs(private.inviteList) do if v.teamInfo.teamId == id then return i - 1 end end return nil end function private.AddTeamMember(memberInfo) table.insert(private.teamMemberInfo, memberInfo) if SpecialTeam_Model.IsTeamFull() then EventSystem.Dispatch(EventID.UI_SpecialTeam_FullTeam) end end function private.RemoveTeamMemberById(memberId) for i, v in ipairs(private.teamMemberInfo) do if v.memberId == memberId then table.remove(private.teamMemberInfo, i) break end end end function private.ChangeToLeader(leaderId) if #private.applyTeamList > 0 then table.clearArray(private.applyTeamList) CTL.SpecialTeam.OnApplyInfoHandle() end private.ChangeMemberType(leaderId, MDL.Team.MemberType.Leader) for i, v in ipairs(private.teamMemberInfo) do if v.memberId ~= leaderId then private.ChangeMemberType(v.memberId, MDL.Team.MemberType.Member) end end private.SortMemberOrder() end function private.ChangeMemberType(memberId, type) for i, v in ipairs(private.teamMemberInfo) do if v.memberId == memberId then v.type = type return true end end return false end function private.UpdateRecommendTeamList(teamList, ingoreLocal) local addCount = 0 for i, v in ipairs(teamList) do if ingoreLocal or not private.IsRecommendTeamListContains(v) then addCount = addCount + 1 table.insert(private.recommendTeamList, v) end end return addCount end function private.IsRecommendTeamListContains(teamInfo) for i, v in ipairs(private.recommendTeamList) do if v.teamId == teamInfo.teamId then return true end end return false end function private.SortMemberOrder() for i, v in ipairs(private.teamMemberInfo) do if v.type == MDL.Team.MemberType.Leader then local leader = table.remove(private.teamMemberInfo, i) table.insert(private.teamMemberInfo, 1, leader) end end end function private.ChangeMemberInfo(newInfo) for i, v in ipairs(private.teamMemberInfo) do if v.memberId == newInfo.memberId then private.teamMemberInfo[i] = newInfo return true end end return false end function SpecialTeam_Model.ReloadApplicantsInfo(applicantsInfo) for i, v in ipairs(applicantsInfo) do table.insert(private.applyTeamList, v) end end function SpecialTeam_Model.InitTeamInfo(teamInfo) private.SetTeamInfo(teamInfo, true) end function private.SetTeamInfo(teamInfo, isInit) private.teamInfo = {} table.clearArray(private.teamMemberInfo) if IsServerDataNotNil(teamInfo) then private.teamInfo = teamInfo for i, v in ipairs(teamInfo.members) do private.AddTeamMember(v) end --没必要排序,跟服务器约定队长肯定是在第一位的 --private.SortMemberOrder() table.clearArray(private.inviteList) CTL.SpecialTeam.OnInviteInfoHandle() if isInit == nil or isInit == false then CTL.SpecialTeam.TryJoinGroupChat(private.teamInfo.teamId) end CTL.SpecialTeam.NoticeGroupChatRed(true) end EventSystem.Dispatch(EventID.UI_SpecialTeam_TeamInfoChange) end function SpecialTeam_Model.ClearRecommendTeamList() table.clearArray(private.recommendTeamList) private.originServerRecommendTeamNum = 0 end function private.ClearTeamInfo() if private.teamInfo.teamId then CTL.SpecialTeam.ExitGroupChat(private.teamInfo.teamId) end private.teamInfo = {} table.clearArray(private.applyTeamList) SpecialTeam_Model.ClearRecommendTeamList() EventSystem.Dispatch(EventID.UI_SpecialTeam_LeaveTeam) CTL.SpecialTeam.NoticeGroupChatRed(false, true) end function SpecialTeam_Model.GetTeamInfo() return private.teamInfo end function SpecialTeam_Model.GetAllMembersInfo() return private.teamMemberInfo end function SpecialTeam_Model.IsTeamLeader(memberId) local memberInfo = SpecialTeam_Model.GetMemberInfoById(memberId) if memberInfo then return memberInfo.type == MDL.Team.MemberType.Leader end return false end function SpecialTeam_Model.GetTeamLeaderId() for i, v in ipairs(private.teamMemberInfo) do if v.type == MDL.Team.MemberType.Leader then return v.memberId end end return BattleDataGetter.GetAcID() end function SpecialTeam_Model.GetMemberNameById(memberId) for i, v in ipairs(private.teamMemberInfo) do if v.memberId == memberId then return v.playerShowInfo.name end end return nil end function private.PreprocessRequest(targetFunction) if MDL.Unlock.IsUnlock(targetFunction) == false then CTL.Tips.AddTipsMsg(Const_IDS.IDS_Formation_RelationShip_Closed) return false end return true end function SpecialTeam_Model.TeamWarCreateReq(teamName) local targetFunction = SpecialTeam_Model.GetCurTeamType() if private.PreprocessRequest(targetFunction) == false then return end local msg = team_war_operate_pb.TeamWarCreateReq() msg.targetFunction = targetFunction msg.name = teamName NetManager.SendMessage(MessageEnums.MessageTeamWarCreate, msg) end function private.OnTeamWarCreateResp(msgResp) if msgResp.Resp.Code == 0 then private.SetTeamInfo(msgResp.teamInfo) EventSystem.Dispatch(EventID.UI_SpecialTeam_CreateTeam) CTL.Tips.AddTipsMsg(string.FormatByIdsId(Const_IDS.IDS_HeroMatch3v3_CreateTeamOK, msgResp.teamInfo.teamName)) CTL.Sound.PlayGameSound("UI_joinarmy") CTL.SpecialTeam.ShutRecruitMsg(true, MDL.ChannelChat.ChannelCfgId.ZhaoMu) UIManager.CloseView(Const_UI_Lua.UIEnum.UISpecialTeamCreatePopUp) end end function SpecialTeam_Model.TeamWarApplyReq(teamId) local targetFunction = SpecialTeam_Model.GetCurTeamType() if private.PreprocessRequest(targetFunction) == false then return end local msg = team_war_operate_pb.TeamWarApplyReq() msg.targetFunction = targetFunction msg.teamId = teamId NetManager.SendMessage(MessageEnums.MessageTeamWarApply, msg) end function private.OnTeamWarApplyResp(msgResp) if msgResp.Resp.Code == 0 then CTL.Tips.AddTipsMsg(Const_IDS["IDS_HeroMatch3v3_ApplySuccess"]) end end function SpecialTeam_Model.TeamWarApplyHandleReq(playerId, isAgree) local targetFunction = SpecialTeam_Model.GetCurTeamType() if private.PreprocessRequest(targetFunction) == false then return end if SpecialTeam_Model.IsMemberInTeam(playerId) then local removeIndex = private.GetApplyListIndexById(playerId) if removeIndex then table.remove(private.applyTeamList, removeIndex + 1) CTL.SpecialTeam.OnApplyInfoHandle() end return end private.TeamWarApplyHandleReq(targetFunction, playerId, isAgree) end function private.TeamWarApplyHandleReq(targetFunction, playerId, isAgree) local msg = team_war_operate_pb.TeamWarApplyHandleReq() msg.targetFunction = targetFunction msg.playerId = playerId msg.isAgree = isAgree NetManager.SendMessage(MessageEnums.MessageTeamWarApplyHandle, msg) end function private.OnTeamWarApplyHandleResp(msgResp) local removeIndex = private.GetApplyListIndexById(msgResp.playerId) if removeIndex then table.remove(private.applyTeamList, removeIndex + 1) CTL.SpecialTeam.OnApplyInfoHandle() end end function SpecialTeam_Model.TeamWarInviteReq(invitedId) local targetFunction = SpecialTeam_Model.GetCurTeamType() if private.PreprocessRequest(targetFunction) == false then return end local msg = team_war_operate_pb.TeamWarInviteReq() msg.targetFunction = targetFunction msg.invitedId = invitedId NetManager.SendMessage(MessageEnums.MessageTeamWarInvite, msg) end function private.OnTeamWarInviteResp(msgResp) if msgResp.Resp.Code == 0 then CTL.Tips.AddTipsMsg(Const_IDS["IDS_TeamUI_ActiveInvitation_HaveBeenInvited"]) end end function SpecialTeam_Model.TeamWarInviteHandleReq(teamId, isAgree) local targetFunction = SpecialTeam_Model.GetCurTeamType() if private.PreprocessRequest(targetFunction) == false then return end private.TeamWarInviteHandleReq(targetFunction, teamId, isAgree) end function private.TeamWarInviteHandleReq(targetFunction, teamId, isAgree) local msg = team_war_operate_pb.TeamWarInviteHandleReq() msg.targetFunction = targetFunction msg.teamId = teamId msg.isAgree = isAgree NetManager.SendMessage(MessageEnums.MessageTeamWarInviteHandle, msg) end function private.OnTeamWarInviteHandleResp(msgResp) local removeIndex = private.GetInviteListIndexById(msgResp.teamId) if removeIndex then table.remove(private.inviteList, removeIndex + 1) CTL.SpecialTeam.OnInviteInfoHandle() end end function SpecialTeam_Model.TeamWarLeaveReq() local targetFunction = SpecialTeam_Model.GetCurTeamType() if private.PreprocessRequest(targetFunction) == false then return end local msg = team_war_operate_pb.TeamWarLeaveReq() msg.targetFunction = targetFunction NetManager.SendMessage(MessageEnums.MessageTeamWarLeave, msg) end function private.OnTeamWarLeaveResp(msgResp) if msgResp.Resp.Code == 0 then private.ClearTeamInfo() end end function SpecialTeam_Model.TeamWarKickOutMemberReq(memberId) local targetFunction = SpecialTeam_Model.GetCurTeamType() if private.PreprocessRequest(targetFunction) == false then return end local msg = team_war_operate_pb.TeamWarKickOutMemberReq() msg.targetFunction = targetFunction msg.memberId = memberId NetManager.SendMessage(MessageEnums.MessageTeamWarKickOutMember, msg) end function private.OnTeamWarKickOutMemberResp(msgResp) if msgResp.Resp.Code == 0 then local name = SpecialTeam_Model.GetMemberNameById(msgResp.memberId) CTL.Tips.AddTipsMsg(string.FormatByIdsId(Const_IDS.IDS_HeroMatch3v3_KickOutAlready1, name, SpecialTeam_Model.GetMyTeamName())) private.RemoveTeamMemberById(msgResp.memberId) EventSystem.Dispatch(EventID.UI_SpecialTeam_MemberInfoChange) end end function SpecialTeam_Model.TeamWarLeaderChangeReq(memberId) local targetFunction = SpecialTeam_Model.GetCurTeamType() if private.PreprocessRequest(targetFunction) == false then return end local msg = team_war_operate_pb.TeamWarLeaderChangeReq() msg.targetFunction = targetFunction msg.memberId = memberId NetManager.SendMessage(MessageEnums.MessageTeamWarLeaderChange, msg) end function private.OnTeamWarLeaderChangeResp(msgResp) if msgResp.Resp.Code == 0 then private.ChangeToLeader(msgResp.memberId) EventSystem.Dispatch(EventID.UI_SpecialTeam_MemberInfoChange) end end function SpecialTeam_Model.GetRecommendListReq() local targetFunction = SpecialTeam_Model.GetCurTeamType() if private.PreprocessRequest(targetFunction) == false then return end private.TeamWarRecommendListReq(targetFunction, private.originServerRecommendTeamNum, private.originServerRecommendTeamNum + TeamShowPerNum) end function SpecialTeam_Model.UpdateMyMembersInfo() local targetFunction = SpecialTeam_Model.GetCurTeamType() if private.PreprocessRequest(targetFunction) == false then return end private.TeamWarRecommendListReq(targetFunction, 0, 0) end function private.TeamWarRecommendListReq(targetFunction, beginIndex, endIndex) local msg = team_war_operate_pb.TeamWarRecommendListReq() msg.targetFunction = targetFunction msg.beginIndex = beginIndex msg.endIndex = endIndex NetManager.SendMessage(MessageEnums.MessageTeamWarRecommendList, msg) end function private.OnTeamWarRecommendListResp(msgResp) if msgResp.Resp.Code == 0 then local updateListNum = private.UpdateRecommendTeamList(msgResp.teamList) private.originServerRecommendTeamNum = private.originServerRecommendTeamNum + updateListNum EventSystem.Dispatch(EventID.UI_SpecialTeam_RecommendTeamListChange, msgResp.beginIndex) private.SetTeamInfo(msgResp.teamInfo) end end function SpecialTeam_Model.TeamWarGetAllServerTeamRankReq() local msg = team_war_operate_pb.TeamWarGetAllServerTeamRankReq() msg.targetFunction = SpecialTeam_Model.GetCurTeamType() msg.beginIndex = private.originServerRecommendTeamNum msg.endIndex = private.originServerRecommendTeamNum + TeamShowPerNum NetManager.SendMessage(MessageEnums.MessageTeamWarGetAllServerTeamRank, msg) end function private.TeamWarGetAllServerTeamRankResp(msgResp) if msgResp.Resp.Code == 0 then local updateListNum = private.UpdateRecommendTeamList(msgResp.teamList, true) private.originServerRecommendTeamNum = private.originServerRecommendTeamNum + updateListNum EventSystem.Dispatch(EventID.UI_SpecialTeam_RecommendTeamListChange, msgResp.beginIndex, msgResp.teamInfo, msgResp.lastTeamIdx, msgResp.lastTeamScore) end end function private.OnG2CPushTeamWarKickOut(msg) local teamName = SpecialTeam_Model.GetMyTeamName() if msg.memberId == BattleDataGetter.GetAcID() then CTL.Tips.AddTipsMsg(string.FormatByIdsId(Const_IDS.IDS_HeroMatch3v3_KickOutAlready2, teamName)) private.ClearTeamInfo() else local name = SpecialTeam_Model.GetMemberNameById(msg.memberId) CTL.Tips.AddTipsMsg(string.FormatByIdsId(Const_IDS.IDS_HeroMatch3v3_KickOutAlready1, name, teamName)) private.RemoveTeamMemberById(msg.memberId) EventSystem.Dispatch(EventID.UI_SpecialTeam_MemberInfoChange) end end function private.OnG2CPushTeamWarTeamLeaderChange(msg) private.ChangeToLeader(msg.memberId) if msg.memberId == BattleDataGetter.GetAcID() then CTL.Tips.AddTipsMsg(string.FormatByIdsId(Const_IDS.IDS_HeroMatch3v3_BecomedLeader2, SpecialTeam_Model.GetMyTeamName())) else local name = SpecialTeam_Model.GetMemberNameById(msg.memberId) CTL.Tips.AddTipsMsg(string.FormatByIdsId(Const_IDS.IDS_HeroMatch3v3_BecomedLeader1, name, SpecialTeam_Model.GetMyTeamName())) end EventSystem.Dispatch(EventID.UI_SpecialTeam_MemberInfoChange) end function private.OnG2CPushTeamWarTeamMemberInfoChanged(msg) for i, v in ipairs(msg.memberInfo) do private.ChangeMemberInfo(v) end EventSystem.Dispatch(EventID.UI_SpecialTeam_MemberInfoChange) end function private.OnG2CPushTeamWarJoinTeam(msg) private.AddTeamMember(msg.memberInfo) local name = msg.memberInfo.playerShowInfo.name CTL.Tips.AddTipsMsg(string.FormatByIdsId(Const_IDS.IDS_HeroMatch3v3_MemberJoinSuccess, name, SpecialTeam_Model.GetMyTeamName())) EventSystem.Dispatch(EventID.UI_SpecialTeam_MemberInfoChange) end --只在我第一次加入队伍的时候,给我推队伍的消息 function private.OnG2CPushTeamWarTeamInfo(msg) private.SetTeamInfo(msg.info) CTL.Tips.AddTipsMsg(string.FormatByIdsId(Const_IDS.IDS_HeroMatch3v3_JoinTeamSuccess, SpecialTeam_Model.GetMyTeamName())) EventSystem.Dispatch(EventID.UI_SpecialTeam_JoinTeam) end function private.OnG2CPushTeamWarApplicantInfo(msg) for _, v in ipairs(msg.applyInfo) do if #private.applyTeamList >= TeamListMax then return end if private.GetApplyListIndexById(v.applyPlayerId) == nil then table.insert(private.applyTeamList, v) end end CTL.SpecialTeam.OnApplyInfoHandle() end function private.OnG2CPushTeamWarRefusedApply(msg) logging.log(LTAG.LOG, "OnG2CPushTeamWarRefusedApply", msg.refusePlayerName) end function private.OnG2CPushTeamWarLeaveTeam(msg) local teamName = SpecialTeam_Model.GetMyTeamName() local name = SpecialTeam_Model.GetMemberNameById(msg.memberId) CTL.Tips.AddTipsMsg(string.FormatByIdsId(Const_IDS["IDS_HeroMatch3v3_QuitTeam3"], name, teamName)) if msg.memberId == BattleDataGetter.GetAcID() then private.ClearTeamInfo() else private.RemoveTeamMemberById(msg.memberId) EventSystem.Dispatch(EventID.UI_SpecialTeam_MemberInfoChange) end end function private.OnG2CPushTeamWarInvited(msg) for i, v in ipairs(msg.inviteInfo) do if #private.inviteList >= TeamListMax then return end if private.GetInviteListIndexById(v.teamInfo.teamId) == nil then table.insert(private.inviteList, v) end end CTL.SpecialTeam.OnInviteInfoHandle() end function private.OnG2CPushTeamWarMemberStateChanged(msg) private.ChangeMemberState(msg.memberId, msg.state) EventSystem.Dispatch(EventID.UI_SpecialTeam_MemberInfoChange) end function private.OnG2CPushTeamWarTeamStateChanged(msg) -- 刷新正在编辑布阵的玩家acid private.teamInfo.lineUpOpAcid = msg.lineUpOpAcid EventSystem.Dispatch(EventID.UI_SpecialTeam_FormationStateChange) if msg.dissolve then --队员收到队伍解散通知 local leaderName = SpecialTeam_Model.GetMemberNameById(SpecialTeam_Model.GetTeamLeaderId()) local teamName = SpecialTeam_Model.GetMyTeamName() CTL.Tips.AddTipsMsg(string.FormatByIdsId(Const_IDS.IDS_ERRORCODE_3498_InfoCode_HeroMatch3v3_TeamDismissed, teamName, leaderName)) private.ClearTeamInfo() end end function SpecialTeam_Model.ClearApplyTeamList() for i, v in ipairs(private.applyTeamList) do private.TeamWarApplyHandleReq(SpecialTeam_Model.GetCurTeamType(), v.applyPlayerId, false) end end function SpecialTeam_Model.ClearInviteList() for i, v in ipairs(private.inviteList) do private.TeamWarInviteHandleReq(SpecialTeam_Model.GetCurTeamType(), v.teamInfo.teamId, false) end end --赛季结束,清除所有信息 function SpecialTeam_Model.ClearAll() private.ClearTeamInfo() end --region ----------------- 布阵 ------------------------- function SpecialTeam_Model.TeamWarLineUpReq(isEditor) local msg = team_war_operate_pb.TeamWarLineUpReq() msg.LineUpBool = isEditor msg.targetFunction = SpecialTeam_Model.GetCurTeamType() NetManager.SendMessage(MessageEnums.MessageTeamWarLineUp, msg) end --endregion ----------------- 布阵 ------------------------- return SpecialTeam_Model