local Country_Model = {} local country_select_pb = require "Proto.country_select_pb" local country_operate_pb = require "Proto.country_operate_pb" local country_base_pb = require "Proto.country_base_pb" local country_salary_pb = require "Proto.country_salary_pb" local EventSystem = require('Event/EventSystem') local private = {} Country_Model.Stage = { SignUpBefore = 0, --//报名前 SignUp = 1, --//报名 SovereignChooseBefore = 2, --//君主选国开始到君主1选国 Sovereign1Choose = 3, --//君主1选国 Sovereign2Choose = 4, --//君主2选国 Sovereign3Choose = 5, --//君主3选国 SovereignChooseAfter = 6, --//君主3选国结束到君主4选国结束核心帮选国 CoreChoose = 7, --//核心帮选国 AdjustmentChoose = 8, --//增补调整 CountryBuild = 9, --//建国 CountryBuildPreBalance = 10, --建国预结算 CountryReset = 11, --//休赛期 } Country_Model.ViewStage = { SignUp = 1, --//报名 Sovereign1Choose = 2, --//君主选国 CoreChoose = 3, --//核心帮选国 CountryBuild = 4, --//建国 } Country_Model.CountryType = { None = 0, Wei = 1, Shu = 2, Wu = 3, Qun = 4, Han = 99, } Country_Model.AuthorityEnum = { CountryTitle = 1, -- 更改年号 CountryAnnouncement = 2, --更改宣言 CountryNotice = 3, -- 更改公告 CountryMail = 4, -- 国家通知 GuildAppoint1 = 5, -- 任命职位 GuildAppoint2 = 6, -- 分封势力 ShutUp = 7, --禁言 CountryAura = 8, -- 战意鼓舞 CountryBattle = 9, -- 身先士卒 EditChanganSiegeMembers = 10, --修改长安争夺战成员战场 ChanganSiegeBattleOrder = 11, --长安争夺战战斗内快捷发言 } Country_Model.CountryJob = { CountryKing = 1, CountryCommander1 = 11, CountryCommander2 = 12, CountryCommander3 = 21, CountryCommander4 = 22, CountryElite = 31, CountryElite2 = 44, CountryPopulace = 99, } Country_Model.CountryGuildTitle = { CountryKingGuild = 1, CountryLeadGuild = 11, -- 核心帮A CountryEliteGuild = 31, --精英帮 CountryPopulaceGuild = 99, --平民帮 } local ShowInfoType = { Default = 0, ReignTitle = 1, Declaration = 2, Notice = 3, } Country_Model.NationalRankType = { National = 0, Appointment = 1, Official = 2, Lvl = 3, Gs = 4, } ---选国时的信息 local selectCountryInfo = nil local viewStageTime = {} --建国后的基础信息 local foundCountryInfo = nil --下一次可以加入国家的时间 local nextJoinCountryTime = 0 --自己所在的国家信息 local myCountryInfo = nil --自己国家的分封信息 local enfeoffmentInfo = nil --自己国家的官员信息 local officialInfo = nil --当前操作改变职位的公会 local curChangeTitleData = nil local curJobId = nil local countDownTimer = nil local countrySeasonEndPreviewDay = DataSheetManager.ConstData:GetDataByID("CountrySeasonEndPreviewDay").IntValue local countrySign = nil local remainWorship = nil local statueBasicInfo = nil local remainMute = 0 local muteEndTime = 0 function Country_Model.OnStartup() --选国阶段的所有国家信息 NetManager.RegisterMsgCB(MessageEnums.MessageG2CCountrySelectInfo, private.OnPushCountryInfo) --当选国阶段状态变化时 服务器主动推送 NetManager.RegisterMsgCB(MessageEnums.MessageG2CCountrySwitchStage, private.OnSwitchStage) --纳贤 邀请和接收申请 公会加入自己的国家 NetManager.RegisterMsgCB(MessageEnums.MessageCountryGetInviteInfo, private.OnGetInviteInfoResp) --接受申请 NetManager.RegisterMsgCB(MessageEnums.MessageCountryAcceptApply, private.OnAcceptApplyResp) --邀请加入 NetManager.RegisterMsgCB(MessageEnums.MessageCountryInviteGuild, private.OnInviteGuildResp) --核心公会 投奔信息 NetManager.RegisterMsgCB(MessageEnums.MessageCountryGetApplyInfo, private.OnGetApplyInfoResp) --接受君主邀请 NetManager.RegisterMsgCB(MessageEnums.MessageCountryAcceptInvite, private.OnAcceptInviteResp) --申请加入 NetManager.RegisterMsgCB(MessageEnums.MessageCountryApply, private.OnApplyResp) --军团排行--报名期的排行 NetManager.RegisterMsgCB(MessageEnums.MessageCountryGetGuildRank, private.OnGetGuildRank) --投票信息 NetManager.RegisterMsgCB(MessageEnums.MessageCountryGetJoinVoteInfo, private.OnGetJoinVoteInfo) --投票 NetManager.RegisterMsgCB(MessageEnums.MessageCountryDoJoinVote, private.OnDoJoinVote) --推送纳贤界面信息刷新 NetManager.RegisterMsgCB(MessageEnums.MessageG2CRefreshInvite, private.OnG2CRefreshInvite) --推送投奔界面刷新 NetManager.RegisterMsgCB(MessageEnums.MessageG2CRefreshApply, private.OnG2CRefreshApply) --修改军团阶级 NetManager.RegisterMsgCB(MessageEnums.MessageCountryChangeGuildTitle, private.OnChangeGuildTitle) --建国后主界面信息 NetManager.RegisterMsgCB(MessageEnums.MessageCountryGetMainPanelInfo, private.OnGetMainPanelInfo) --修改国家展示信息 NetManager.RegisterMsgCB(MessageEnums.MessageCountrySetShowInfo, private.OnSetShowInfo) -- 国家通知 NetManager.RegisterMsgCB(MessageEnums.MessageCountryNotification, private.OnGetNotification) --捐献 NetManager.RegisterMsgCB(MessageEnums.MessageCountryDonate, private.OnCountryDonate) NetManager.RegisterMsgCB(MessageEnums.MessageCountryGetDonatePanelInfo, private.OnGetDonatePanelInfo) --国家事件记录 NetManager.RegisterMsgCB(MessageEnums.MessageCountryGetDynamicInfo, private.OnGetDynamicInfo) -- 获取本国势力信息 NetManager.RegisterMsgCB(MessageEnums.MessageCountryGetGuildInfo, private.OnGetGuildInfo) --搜索势力 NetManager.RegisterMsgCB(MessageEnums.MessageCountrySearchGuild, private.OnSearchGuild) NetManager.RegisterMsgCB(MessageEnums.MessageCountryGuildLeave, private.OnGuildLeave) NetManager.RegisterMsgCB(MessageEnums.MessageCountryGuildJoin, private.OnGuildJoin) NetManager.RegisterMsgCB(MessageEnums.MessageCountryGetTargetGuildInfo, private.OnGetTargetGuildInfo) NetManager.RegisterMsgCB(MessageEnums.MessageCountryGetEnfeoffmentPanelInfo, private.OnGetEnfeoffmentPanelInfo) NetManager.RegisterMsgCB(MessageEnums.MessageCountryGetOfficialPanelInfo, private.OnGetOfficialPanelInfo) NetManager.RegisterMsgCB(MessageEnums.MessageG2CRefreshCountryInfo, private.OnRefreshMyCountryInfo) --获得国民信息 NetManager.RegisterMsgCB(MessageEnums.MessageCountryGetNationalList, private.OnGetNationalList) NetManager.RegisterMsgCB(MessageEnums.MessageCountrySetOfficial, private.OnCountrySetOfficial) NetManager.RegisterMsgCB(MessageEnums.MessageCountrySearchNational, private.OnSearchNational) NetManager.RegisterMsgCB(MessageEnums.MessageG2CRefreshCountryOfficial, private.OnRefreshCountryOfficial) NetManager.RegisterMsgCB(MessageEnums.MessageG2CRefreshNotificationTimes, private.OnRefreshNotificationTimes) NetManager.RegisterMsgCB(MessageEnums.MessageG2CRefreshInviteAndApply, private.OnCoreGuildJoinCountry) NetManager.RegisterMsgCB(MessageEnums.MessageCountryGetSignInfo, private.OnCountryGetSignInfo) NetManager.RegisterMsgCB(MessageEnums.MessageCountrySign, private.OnCountrySign) NetManager.RegisterMsgCB(MessageEnums.MessageCountryWorshipStatue, private.OnCountryWorshipStatue) NetManager.RegisterMsgCB(MessageEnums.MessageG2CCountryGetStatue, private.OnCountryGetStatue) NetManager.RegisterMsgCB(MessageEnums.MessageG2CGuildLeaveCountry, private.OnGuildLeaveCountry) NetManager.RegisterMsgCB(MessageEnums.MessageCountrySalarySpoilsItemInfo, private.OnGetSalarySpoilsItemInfo) NetManager.RegisterMsgCB(MessageEnums.MessageCountrySalarySpoilsApplyInfo, private.OnSalarySpoilsApplyInfo) NetManager.RegisterMsgCB(MessageEnums.MessageCountrySalarySpoilsApply, private.OnSalarySpoilsApply) NetManager.RegisterMsgCB(MessageEnums.MessageCountrySalarySpoilsCancelApply, private.OnSalarySpoilsCancelApply) NetManager.RegisterMsgCB(MessageEnums.MessageCountrySalaryRecordInfo, private.OnSalaryRecordInfo) NetManager.RegisterMsgCB(MessageEnums.MessageCountrySalaryTreasureInfo, private.OnSalaryTreasureInfo) NetManager.RegisterMsgCB(MessageEnums.MessageCountrySalaryTreasureGiveList, private.OnSalaryTreasureGiveList) NetManager.RegisterMsgCB(MessageEnums.MessageCountrySalaryTreasureGive, private.OnSalaryTreasureGive) NetManager.RegisterMsgCB(MessageEnums.MessageCountrySalaryTreasureAllocationList, private.OnSalaryTreasureAllocationList) NetManager.RegisterMsgCB(MessageEnums.MessageCountrySalaryTreasureAllocation, private.OnCountrySalaryTreasureAllocation) NetManager.RegisterMsgCB(MessageEnums.MessageCountrySalaryBuy, private.OnCountrySalaryBuy) NetManager.RegisterMsgCB(MessageEnums.MessageG2CCountrySalaryGiveOut, private.OnCountrySalaryGiveOut) NetManager.RegisterMsgCB(MessageEnums.MessageCountryMute, private.OnCountryMuteResp) NetManager.RegisterMsgCB(MessageEnums.MessageCountryUnmute, private.OnCountryUnmuteResp) end --------数据接口 function Country_Model.GetCurStage() return selectCountryInfo and selectCountryInfo.stage end function Country_Model.GetSovereignGuildList() return selectCountryInfo and selectCountryInfo.sovereignGuildList end function Country_Model.GetCoreGuildList() return selectCountryInfo and selectCountryInfo.coreGuildList end function Country_Model.GetAllStageTime() return selectCountryInfo and selectCountryInfo.stageTime end function Country_Model.GetCurStateTime() return selectCountryInfo and selectCountryInfo.stageTime[selectCountryInfo.stage + 1] end function Country_Model.GetCurSelectStage() return selectCountryInfo and selectCountryInfo.sovereignStage end function Country_Model.GetSelectTime() return selectCountryInfo and selectCountryInfo.LordStageTime end function Country_Model.GetMyGuildInfo() return selectCountryInfo and selectCountryInfo.myGuildInfo end function Country_Model.GetAcceptGuildNum() return selectCountryInfo and selectCountryInfo.acceptGuildNum end function Country_Model.GetNextDominatingTime() local timeList = selectCountryInfo and selectCountryInfo.dominatingBalanceTime if timeList then for i,v in ipairs(timeList) do if v > UTL.Time.GetServerTimestamp() then return v end end end end function Country_Model.CanJoinActivity(timestamp) if selectCountryInfo then if timestamp >= selectCountryInfo.stageTime[Country_Model.Stage.CountryBuild + 1].stageStart and timestamp < selectCountryInfo.stageTime[Country_Model.Stage.CountryBuildPreBalance + 1].stageEnd then return true end end return false end function Country_Model.CheckVote() if not MDL.Guild.IsHasGuild() then CTL.Tips.AddTipsMsgAndPlaySound(Const_IDS.IDS_ERRORCODE_1319_InfoCode_Guild_PlayerNotInGuild) return false end local info = MDL.Country.GetMyGuildInfo() local curStage = MDL.Country.GetCurStage() local list = MDL.Country.GetSovereignGuildList() local allStageTime = MDL.Country.GetAllStageTime() local index = 0 for i, v in ipairs(list) do if v.guildId == info.guildId then index = i break end end if Country_Model.GetStageByViewIndex(index) == curStage then return true end CTL.Tips.AddTipsMsgAndPlaySound(Const_IDS.IDS_CountrySelection_MemberVoteEnd) return false end function Country_Model.MyIsSovereign() local myGuildInfo = Country_Model.GetMyGuildInfo() if myGuildInfo then return Country_Model.IsSovereign(myGuildInfo.guildId) end return false end function Country_Model.MyIsCore() local myGuildInfo = Country_Model.GetMyGuildInfo() if myGuildInfo then return Country_Model.IsIsCore(myGuildInfo.guildId) end return false end function Country_Model.IsSovereign(guildId) if guildId then local list = Country_Model.GetSovereignGuildList() for i, v in ipairs(list) do if v.guildId == guildId then return true end end end return false end function Country_Model.IsIsCore(guildId) if guildId then local list = Country_Model.GetCoreGuildList() for i, v in ipairs(list) do if v.guildId == guildId then return true end end end return false end function Country_Model.GetCoreGuildByCountry(country) local list = Country_Model.GetCoreGuildList() local result = {} for i, v in ipairs(list) do if v.country == country then table.insert(result, v) end end return result end function Country_Model.GetViewStageTime() return viewStageTime end function Country_Model.GetViewStage() local stage = Country_Model.GetCurStage() if Country_Model.Stage.SignUp == stage then return Country_Model.ViewStage.SignUp elseif Country_Model.Stage.SignUp < stage and stage <= Country_Model.Stage.SovereignChooseAfter then return Country_Model.ViewStage.Sovereign1Choose elseif Country_Model.Stage.CoreChoose == stage or stage == Country_Model.Stage.AdjustmentChoose then return Country_Model.ViewStage.CoreChoose else return Country_Model.ViewStage.CountryBuild end end function Country_Model.GetCountryInfo() return foundCountryInfo end function Country_Model.GetFoundCountryInfo(country) for i, v in ipairs(foundCountryInfo) do if v.countryID == country then return v end end end function Country_Model.GetCountryLeader(officialList) for i, v in ipairs(officialList) do if v.position == Country_Model.CountryJob.CountryKing then return v end end end function Country_Model.GetCountryOfficial(officialList, countryJob) local resultList = {} for i, v in ipairs(officialList) do if v.position == countryJob then table.insert(resultList, v) end end return resultList end function Country_Model.IsCountryLeader() local jobId = Country_Model.GetMyJobId() return jobId == Country_Model.CountryJob.CountryKing end function Country_Model.GetMyJobId() local info = Country_Model.GetMyCountryInfo() if info then for i, v in ipairs(info.officialList) do if v.showInfo.acid == BattleDataGetter.GetAcID() then return v.position end end end return curJobId or Country_Model.CountryJob.CountryPopulace end function Country_Model.JobHasPermission(jobId, permissionId) if jobId and jobId > 0 then if MDL.Guild.IsHasGuild() then local jobData = DataSheetManager.CountryJob:GetDataByID(jobId) for i, v in ipairs(jobData.JobID) do if v == permissionId then return true end end end end return false end --四个君主国对应的阶段分别是 3 4 5 6 所以index + 2 function Country_Model.GetStageByViewIndex(index) return index + 2 end function Country_Model.GetVoteNum() if MDL.Guild.IsHasGuild() then local jobTitle = MDL.Guild.GetMyGuildInfo().jobTitle local jobData = DataSheetManager.GuildJob:GetDataByID(jobTitle) return jobData.CountryVoteValue or 10 end return 0 end function Country_Model.GetVoteDataByCountry(list, country) for i, v in ipairs(list) do if v.country == country then return v end end return nil end function Country_Model.IsFoundCountry(country) local list = Country_Model.GetSovereignGuildList() for i, v in ipairs(list) do if v.country == country then return true end end return false end function Country_Model.GetSovereignGuildByCountry(country) local list = Country_Model.GetSovereignGuildList() for i, v in ipairs(list) do if v.country == country then return v end end return nil end function Country_Model.GetMyCountryInfo() return myCountryInfo end function Country_Model.GetMyCountryId() if myCountryInfo then return myCountryInfo.countryID end end function Country_Model.IsSameCountry(countryId) if countryId == nil or countryId == Country_Model.CountryType.None then return false end local myCountryId = Country_Model.GetMyCountryId() if myCountryId == nil or myCountryId == Country_Model.CountryType.None then return false end return countryId == myCountryId end function Country_Model.GetMaxCoreGuildNum() return DataSheetManager.ConstData:GetDataByID("CountryCoreGuildNum").IntValue end function Country_Model.GetEnfeoffmentInfo() return enfeoffmentInfo end function Country_Model.GetOfficialInfo() return officialInfo end function Country_Model.GetNextJoinCountryTime() return nextJoinCountryTime end function Country_Model.GetJobName(jobId) local jobData = DataSheetManager.CountryJob:GetDataByID(jobId) return jobData.Title_Table[myCountryInfo.countryID].JobName end --获取国家职位,不会返空,无国家用魏国的 function Country_Model.ForceGetJobName(jobId) if myCountryInfo then return Country_Model.GetJobName(jobId) end local jobData = DataSheetManager.CountryJob:GetDataByID(jobId) return jobData.Title_Table[Country_Model.CountryType.Wei].JobName end function Country_Model.GetJobColorName(jobId) local jobData = DataSheetManager.CountryJob:GetDataByID(jobId) local name = UIUtils.GetLocalizedTxt(Const_IDS[jobData.Title_Table[myCountryInfo.countryID].JobName]) local color = jobData.Title_Table[myCountryInfo.countryID].JobColor local color2 = jobData.Title_Table[myCountryInfo.countryID].JobColor2 if string.isNilOrEmpty(color2) then return UTL.Color.FormatTextByColor(color, name) else return UTL.Color.FormatGradient(color, color2, name) end end function Country_Model.GetJobImagePath(jobId) local jobData = DataSheetManager.CountryJob:GetDataByID(jobId) return jobData.Title_Table[myCountryInfo.countryID].JobPath end --此接口只能判断精英及精英以上 平民不在列表里 function Country_Model.CanChangeJob(targetAcid) local officialInfo = MDL.Country.GetOfficialInfo() local myOfficialInfo = nil local targetOfficialInfo = nil for i, v in ipairs(officialInfo.officialList) do if v.showInfo.acid == targetAcid then targetOfficialInfo = v elseif v.showInfo.acid == BattleDataGetter.GetAcID() then myOfficialInfo = v end end if myOfficialInfo and targetOfficialInfo then return Country_Model.CanChangeJobById(myOfficialInfo.position, targetOfficialInfo.position) elseif myOfficialInfo then return Country_Model.CanChangeJobById(myOfficialInfo.position, Country_Model.CountryJob.CountryPopulace) end end function Country_Model.GetGuildTitleName(titleId) local titleData = DataSheetManager.CountryGuildRank:GetDataByID(titleId) return Const_IDS[titleData.Title_Table[myCountryInfo.countryID].JobName] end function Country_Model.GetGuildTitleColorName(titleId) local titleData = DataSheetManager.CountryGuildRank:GetDataByID(titleId) local name = UIUtils.GetLocalizedTxt(Const_IDS[titleData.Title_Table[myCountryInfo.countryID].JobName]) local color = titleData.Title_Table[myCountryInfo.countryID].JobColor local color2 = titleData.Title_Table[myCountryInfo.countryID].JobColor2 if string.isNilOrEmpty(color2) then return UTL.Color.FormatTextByColor(color, name) else return UTL.Color.FormatGradient(color, color2, name) end end function Country_Model.GetGuildTitleImagePath(titleId) local titleData = DataSheetManager.CountryGuildRank:GetDataByID(titleId) return titleData.Title_Table[myCountryInfo.countryID].JobPath end function Country_Model.CanChangeJobById(sourceJobId, targetJobId) local jobData = DataSheetManager.CountryJob:GetDataByID(sourceJobId) for i, v in ipairs(jobData.AppointJobID) do if v == targetJobId then return true end end return false end --只有建国后有 建国前不算 function Country_Model.IsHasCountry() if MDL.Guild.IsHasGuild() then local curStage = MDL.Country.GetCurStage() if curStage and curStage >= MDL.Country.Stage.CountryBuild then local myFoundCountry = Country_Model.GetMyCountryInfo() if myFoundCountry == nil then return false end return myFoundCountry and myFoundCountry.countryID > 0 end end return false end function Country_Model.GetCountryTitle(title, countryId) if string.isNilOrEmpty(title) or string.match(title,"^IDS_") then local countryData = DataSheetManager.CountryBase:GetDataByID(countryId) return UIUtils.GetLocalizedTxt(Const_IDS[countryData.CountryReignTitle]) else return title end end --宣言 function Country_Model.GetCountryAnnouncement(announcement, countryId) if string.isNilOrEmpty(announcement) or string.match(announcement,"^IDS_") then local countryData = DataSheetManager.CountryBase:GetDataByID(countryId) return UIUtils.GetLocalizedTxt(Const_IDS[countryData.CountryAnnouncement]) else return announcement end end --公告 function Country_Model.GetCountryNotice(notice, countryId) if string.isNilOrEmpty(notice) or string.match(notice,"^IDS_") then local countryData = DataSheetManager.CountryBase:GetDataByID(countryId) return UIUtils.GetLocalizedTxt(Const_IDS[countryData.CountryNotice]) else return notice end end function Country_Model.GetClosePrediction() local curStage = Country_Model.GetCurStage() if curStage == Country_Model.Stage.CountryBuildPreBalance then local closeTime = Country_Model.GetAllStageTime()[Country_Model.Stage.CountryBuildPreBalance + 1] return closeTime.stageEnd - UTL.Time.GetServerTimestamp() end return 0 end function Country_Model.GetKingCountry() for i,v in ipairs(foundCountryInfo) do if v.isDominate then return v end end end function Country_Model.GetRemainWorship() return remainWorship end function Country_Model.GetStatueBasicInfo() return statueBasicInfo end function Country_Model.ResetJoinCountryTime() nextJoinCountryTime = 0 myCountryInfo = nil end function Country_Model.IsHasShutUp(targetCountryId, targetJobId) if MDL.Country.JobHasPermission(curJobId, MDL.Country.AuthorityEnum.ShutUp) then if targetCountryId > 0 and targetCountryId == Country_Model.GetMyCountryId() and targetJobId > 0 then local jobData = DataSheetManager.CountryJob:GetDataByID(curJobId) local targetJobData = DataSheetManager.CountryJob:GetDataByID(targetJobId) return targetJobData.Level < jobData.Level end end return false end function Country_Model.GetRemainMute() return remainMute end function Country_Model.GetMuteEndTime() return muteEndTime end function Country_Model.SetCountryPlayerChange(data) logging.log(LTAG.LOG, " SetCountryPlayerChange ",data) muteEndTime = data.MuteEndTime local isLeader = MDL.Guild.CheckLeader(1) if data.CountryID > 0 then curJobId = data.OfficialJob if Country_Model.GetMyCountryId() ~= data.CountryID then local countryData = DataSheetManager.CountryBase:GetDataByID(data.CountryID) if not isLeader then Country_Model.CountryGetMainPanelInfoReq() end end else if not isLeader then CTL.ChannelChat.ExitCountry() myCountryInfo = nil EventSystem.Dispatch(EventID.Country_GuildLeaveCountry) end end end ---------------- function Country_Model.C2GCountrySelectInfo() local msg = country_select_pb.C2GCountrySelectInfo() NetManager.SendMessage(MessageEnums.MessageC2GCountrySelectInfo, msg) end function Country_Model.CountryGetJoinVoteInfoReq() local msg = country_select_pb.CountryGetJoinVoteInfoReq() NetManager.SendMessage(MessageEnums.MessageCountryGetJoinVoteInfo, msg) end function Country_Model.CountryGetInviteInfoReq() local msg = country_select_pb.CountryGetInviteInfoReq() NetManager.SendMessage(MessageEnums.MessageCountryGetInviteInfo, msg) end function Country_Model.CountryGetGuildRankReq() local msg = country_select_pb.CountryGetGuildRankReq() NetManager.SendMessage(MessageEnums.MessageCountryGetGuildRank, msg) end function Country_Model.CountryInviteGuildReq(guildId) local msg = country_select_pb.CountryInviteGuildReq(guildId) msg.guildId = guildId NetManager.SendMessage(MessageEnums.MessageCountryInviteGuild, msg) end function Country_Model.CountryDoJoinVoteReq(country) if Country_Model.CheckVote() then local msg = country_select_pb.CountryDoJoinVoteReq() msg.country = country NetManager.SendMessage(MessageEnums.MessageCountryDoJoinVote, msg) end end function Country_Model.CountryAcceptApplyReq(guildId) local msg = country_select_pb.CountryAcceptApplyReq() msg.guildID = guildId NetManager.SendMessage(MessageEnums.MessageCountryAcceptApply, msg) end function Country_Model.CountryGetApplyInfoReq() local msg = country_select_pb.CountryGetApplyInfoReq() NetManager.SendMessage(MessageEnums.MessageCountryGetApplyInfo, msg) end function Country_Model.CountryApplyReq(country) local msg = country_select_pb.CountryApplyReq() msg.country = country NetManager.SendMessage(MessageEnums.MessageCountryApply, msg) end function Country_Model.CountryAcceptInviteReq(country) local msg = country_select_pb.CountryAcceptInviteReq() msg.acceptCountryID = country NetManager.SendMessage(MessageEnums.MessageCountryAcceptInvite, msg) end function Country_Model.CountrySetReignTitleReq(info) private.CountrySetShowInfoReq(ShowInfoType.ReignTitle, info) end function Country_Model.CountrySetNoticeReq(info) private.CountrySetShowInfoReq(ShowInfoType.Notice, info) end function Country_Model.CountrySetDeclarationReq(info) private.CountrySetShowInfoReq(ShowInfoType.Declaration, info) end function Country_Model.CountryGuildLeaveReq() local msg = country_operate_pb.CountryGuildLeaveReq() NetManager.SendMessage(MessageEnums.MessageCountryGuildLeave, msg) end function Country_Model.CountryGetMainPanelInfoReq() local msg = country_operate_pb.CountryGetMainPanelInfoReq() NetManager.SendMessage(MessageEnums.MessageCountryGetMainPanelInfo, msg) end function Country_Model.CountryGuildJoinReq(countryID, isRandJoin) local msg = country_operate_pb.CountryGuildJoinReq() msg.countryID = countryID msg.isRandJoin = isRandJoin NetManager.SendMessage(MessageEnums.MessageCountryGuildJoin, msg) end function Country_Model.CountryGetTargetGuildInfoReq(guildId) local msg = country_operate_pb.CountryGetTargetGuildInfoReq() msg.guildID = guildId NetManager.SendMessage(MessageEnums.MessageCountryGetTargetGuildInfo, msg) end function Country_Model.CountryGetDynamicInfoReq() local msg = country_operate_pb.CountryGetDynamicInfoReq() NetManager.SendMessage(MessageEnums.MessageCountryGetDynamicInfo, msg) end function Country_Model.CountryGetEnfeoffmentPanelInfoReq() local msg = country_operate_pb.CountryGetEnfeoffmentPanelInfoReq() NetManager.SendMessage(MessageEnums.MessageCountryGetEnfeoffmentPanelInfo, msg) end function Country_Model.CountryGetGuildInfoReq(index, isAppointment) local msg = country_operate_pb.CountryGetGuildInfoReq() msg.index = index msg.isAppointment = isAppointment or false NetManager.SendMessage(MessageEnums.MessageCountryGetGuildInfo, msg) end function Country_Model.CountryNotificationReq(title, content) local msg = country_operate_pb.CountryNotificationReq() msg.title = title msg.content = content NetManager.SendMessage(MessageEnums.MessageCountryNotification, msg) end function Country_Model.CountryChangeGuildTitleReq(guildId, titleId, index) local msg = country_operate_pb.CountryChangeGuildTitleReq() msg.guildID = guildId msg.title = titleId msg.index = index or 0 NetManager.SendMessage(MessageEnums.MessageCountryChangeGuildTitle, msg) curChangeTitleData = curChangeTitleData or {} curChangeTitleData.guildID = guildId curChangeTitleData.title = titleId end function Country_Model.CountryGetDonatePanelInfoReq() local msg = country_operate_pb.CountryGetDonatePanelInfoReq() NetManager.SendMessage(MessageEnums.MessageCountryGetDonatePanelInfo, msg) end function Country_Model.CountrySetOfficialReq(targetAcid, position, index) local msg = country_operate_pb.CountrySetOfficialReq() msg.targetAcid = targetAcid msg.position = position msg.index = index or 0 NetManager.SendMessage(MessageEnums.MessageCountrySetOfficial, msg) end function Country_Model.CountrySearchGuildReq(keyWord) local msg = country_operate_pb.CountrySearchGuildReq() msg.keyWord = keyWord NetManager.SendMessage(MessageEnums.MessageCountrySearchGuild, msg) end function Country_Model.CountrySearchNationalReq(keyWord) local msg = country_operate_pb.CountrySearchNationalReq() msg.keyword = keyWord NetManager.SendMessage(MessageEnums.MessageCountrySearchNational, msg) end function Country_Model.CountryDonateReq(donateId, donateNum) local msg = country_operate_pb.CountryDonateReq() local item = country_base_pb.DonateItem() item.DonateId = donateId item.DonateNum = donateNum table.insert(msg.item, item) msg.Times = donateNum NetManager.SendMessage(MessageEnums.MessageCountryDonate, msg) end function Country_Model.CountryGetOfficialPanelInfoReq() local msg = country_operate_pb.CountryGetOfficialPanelInfoReq() NetManager.SendMessage(MessageEnums.MessageCountryGetOfficialPanelInfo, msg) end function Country_Model.CountryGetNationalListReq(index, rankType, reverse) local msg = country_operate_pb.CountryGetNationalListReq() msg.index = index msg.rankType = rankType msg.Reverse = reverse or false NetManager.SendMessage(MessageEnums.MessageCountryGetNationalList, msg) end function Country_Model.CountryGetSignInfoReq() local msg = country_operate_pb.CountryGetSignInfoReq() NetManager.SendMessage(MessageEnums.MessageCountryGetSignInfo, msg) end function Country_Model.CountrySignReq(day) local msg = country_operate_pb.CountrySignReq() msg.Day = day NetManager.SendMessage(MessageEnums.MessageCountrySign, msg) end function Country_Model.CountryWorshipStatueReq() local msg = country_operate_pb.CountryWorshipStatueReq() NetManager.SendMessage(MessageEnums.MessageCountryWorshipStatue, msg) end function Country_Model.C2GCountryGetStatue() local msg = country_operate_pb.C2GCountryGetStatue() NetManager.SendMessage(MessageEnums.MessageC2GCountryGetStatue, msg) end function Country_Model.GetCountrySignData() return countrySign end function Country_Model.CountrySalarySpoilsItemInfoReq() local msg = country_salary_pb.CountrySalarySpoilsItemInfoReq() NetManager.SendMessage(MessageEnums.MessageCountrySalarySpoilsItemInfo, msg) end function Country_Model.CountrySalarySpoilsApplyInfoReq(id) local msg = country_salary_pb.CountrySalarySpoilsApplyInfoReq() msg.CountryRewardID = id NetManager.SendMessage(MessageEnums.MessageCountrySalarySpoilsApplyInfo, msg) end function Country_Model.CountrySalarySpoilsApplyReq(id) local msg = country_salary_pb.CountrySalarySpoilsApplyReq() msg.CountryRewardID = id NetManager.SendMessage(MessageEnums.MessageCountrySalarySpoilsApply, msg) end function Country_Model.CountrySalarySpoilsCancelApplyReq(id) local msg = country_salary_pb.CountrySalarySpoilsCancelApplyReq() msg.CountryRewardID = id NetManager.SendMessage(MessageEnums.MessageCountrySalarySpoilsCancelApply, msg) end function Country_Model.CountrySalaryTreasureInfoReq() local msg = country_salary_pb.CountrySalaryTreasureInfoReq() NetManager.SendMessage(MessageEnums.MessageCountrySalaryTreasureInfo, msg) end function Country_Model.CountrySalaryTreasureGiveListReq(id) local msg = country_salary_pb.CountrySalaryTreasureGiveListReq() msg.CountryRewardID = id NetManager.SendMessage(MessageEnums.MessageCountrySalaryTreasureGiveList, msg) end function Country_Model.CountrySalaryTreasureAllocationListReq(id) local msg = country_salary_pb.CountrySalaryTreasureAllocationListReq() msg.CountryRewardID = id NetManager.SendMessage(MessageEnums.MessageCountrySalaryTreasureAllocationList, msg) end function Country_Model.CountrySalaryTreasureGiveReq(id, guildIds) local msg = country_salary_pb.CountrySalaryTreasureGiveReq() msg.CountryRewardID = id --msg.GuildIDS = guildIds for i, v in ipairs(guildIds) do table.insert(msg.GuildIDS, v) end NetManager.SendMessage(MessageEnums.MessageCountrySalaryTreasureGive, msg) end function Country_Model.RecordRewardReq() private.CountrySalaryRecordInfoReq(1) end function Country_Model.RecordTreasureReq() private.CountrySalaryRecordInfoReq(2) end function private.CountrySalaryRecordInfoReq(eventType) local msg = country_salary_pb.CountrySalaryRecordInfoReq() msg.EventType = eventType NetManager.SendMessage(MessageEnums.MessageCountrySalaryRecordInfo, msg) end function Country_Model.CountrySalaryTreasureAllocationReq(id, playerAcids) local msg = country_salary_pb.CountrySalaryTreasureAllocationReq() msg.CountryRewardID = id for i, v in ipairs(playerAcids) do table.insert(msg.Acids, v) end NetManager.SendMessage(MessageEnums.MessageCountrySalaryTreasureAllocation, msg) end function Country_Model.CountrySalaryBuyReq(id, count) local msg = country_salary_pb.CountrySalaryBuyReq() msg.CountryRewardID = id msg.BuyNum = count NetManager.SendMessage(MessageEnums.MessageCountrySalaryBuy, msg) end function Country_Model.CountryMuteReq(id) local msg = country_operate_pb.CountryMuteReq() msg.Acid = id NetManager.SendMessage(MessageEnums.MessageCountryMute, msg) end function Country_Model.CountryUnmuteReq(id) local msg = country_operate_pb.CountryUnmuteReq() msg.Acid = id NetManager.SendMessage(MessageEnums.MessageCountryUnmute, msg) end function private.CountrySetShowInfoReq(infoType, info) local msg = country_operate_pb.CountrySetShowInfoReq() msg.infoType = infoType msg.info = info NetManager.SendMessage(MessageEnums.MessageCountrySetShowInfo, msg) end function private.OnPushCountryInfo(msg) local preStage = selectCountryInfo and selectCountryInfo.stage selectCountryInfo = msg private.SetViewStageTime() EventSystem.Dispatch(EventID.Country_RefreshSelectInfo) CTL.Country.OnRefreshCountryInfo(selectCountryInfo.stage, preStage) end function private.OnSwitchStage(msg) if UIManager.IsViewOpened(Const_UI_Lua.UIEnum.UICountryChooseView) then Country_Model.C2GCountrySelectInfo() else local preStage = selectCountryInfo.stage selectCountryInfo.stage = msg.stage CTL.Country.OnRefreshCountryInfo(selectCountryInfo.stage, preStage) end end function private.OnGetJoinVoteInfo(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnGetJoinVoteInfo, msg) end end function private.OnGetInviteInfoResp(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnGetInviteInfo, msg) end end function private.OnAcceptApplyResp(msg) if msg.Resp.Code == 0 then CTL.Tips.AddTipsMsg(Const_IDS.IDS_CountryRecruite_AgreeSendTip) end MDL.Country.C2GCountrySelectInfo() MDL.Country.CountryGetInviteInfoReq() end function private.OnInviteGuildResp(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnInviteGuild, msg.guildId) --已发出邀请 CTL.Tips.AddTipsMsg(Const_IDS.IDS_CountryRecruite_InviteSendTip) end end function private.OnGetApplyInfoResp(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnGetApplyInfo, msg) end end function private.OnAcceptInviteResp(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnAcceptInvite) MDL.Country.C2GCountrySelectInfo() end end function private.OnApplyResp(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnApplyResp) --已发出申请” CTL.Tips.AddTipsMsg(Const_IDS.IDS_CountryApply_ApplySendTip) end end function private.OnGetGuildRank(msg) EventSystem.Dispatch(EventID.Country_RefreshGuildRankInfo, msg) end function private.OnDoJoinVote(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnDoJoinVoteInfo, msg.voteInfo, MDL.Guild.CheckLeader(1)) CTL.Tips.AddTipsMsg(Const_IDS.IDS_CountrySelection_VoteSucceed) end end function private.OnG2CRefreshInvite(msg) EventSystem.Dispatch(EventID.Country_OnGetInviteInfo, msg) end function private.OnG2CRefreshApply(msg) EventSystem.Dispatch(EventID.Country_OnGetApplyInfo, msg) end function private.OnChangeGuildTitle(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnChangeGuildTitle, msg.guildInfo, curChangeTitleData) UIManager.CloseView(Const_UI_Lua.UIEnum.UICountryPopupGuildAppoint) CTL.Tips.AddTipsMsg(Const_IDS.IDS_Guild_CommonSucceed1) else MDL.Country.CountryGetMainPanelInfoReq() UIManager.CloseView(Const_UI_Lua.UIEnum.UICountryPopupGuildAppoint) end end function private.SetViewStageTime() local allStageTime = Country_Model.GetAllStageTime() viewStageTime[Country_Model.ViewStage.SignUp] = allStageTime[Country_Model.Stage.SignUp + 1] viewStageTime[Country_Model.ViewStage.Sovereign1Choose] = { stageStart = allStageTime[Country_Model.Stage.SovereignChooseBefore + 1].stageStart, stageEnd = allStageTime[Country_Model.Stage.SovereignChooseAfter + 1].stageEnd } viewStageTime[Country_Model.ViewStage.CoreChoose] = { stageStart = allStageTime[Country_Model.Stage.CoreChoose + 1].stageStart, stageEnd = allStageTime[Country_Model.Stage.AdjustmentChoose + 1].stageEnd } viewStageTime[Country_Model.ViewStage.CountryBuild] = allStageTime[Country_Model.Stage.CountryBuild + 1] end function private.OnSetShowInfo(msg) if msg.Resp.Code == 0 then CTL.Tips.AddTipsMsg(Const_IDS.IDS_Guild_CommonSucceed2) if msg.infoType == ShowInfoType.Declaration then CTL.Country.SendMsg(false, msg.info) elseif msg.infoType == ShowInfoType.Notice then CTL.Country.SendMsg(true, msg.info) end else MDL.Country.CountryGetMainPanelInfoReq() end end function private.OnGetNotification(msg) if msg.Resp.Code == 0 then CTL.Tips.AddTipsMsg(Const_IDS.IDS_GuildMail_Succeed1) end end function private.OnCountryDonate(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnGetDonatePanelInfo, msg) end end function private.OnGetDonatePanelInfo(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnGetDonatePanelInfo, msg) end end function private.OnGetDynamicInfo(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.UI_Country_DiaryRefresh, msg.dynamicInfoList) end end function private.OnGetGuildInfo(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnGetGuildInfo, msg.guildInfo, msg.totalLength) end end function private.OnSearchGuild(msg) if msg.Resp.Code == 0 then if #msg.guildInfo > 0 then EventSystem.Dispatch(EventID.Country_OnSearchGuild, msg.guildInfo) else CTL.Tips.AddTipsMsg(Const_IDS.IDS_GuildSearch_Fail1) end end end function private.OnGuildLeave(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.UI_CloseAndRecoverView, Const_UI_Lua.UIEnum.UICountryBase) myCountryInfo = nil nextJoinCountryTime = msg.nextJoinCountryTime CTL.ChannelChat.ExitCountry() end end function private.OnGuildJoin(msg) if msg.Resp.Code == 0 then CTL.Country.OnJoinCountry() MDL.ChannelChat.JoinCountryChannel(msg.countryID) CTL.Sound.PlayGameSound("UI_joinarmy") end end function private.OnGetMainPanelInfo(msg) logging.log(LTAG.LOG, " OnGetMainPanelInfo ", msg) if msg.Resp.Code == 0 then foundCountryInfo = msg.countryInfo for i, v in ipairs(foundCountryInfo) do if v.countryID == msg.myCountryID then myCountryInfo = v break end end curJobId = msg.myOfficialPos remainMute = msg.RemainMute nextJoinCountryTime = msg.nextJoinCountryTime --有trigger依赖国家,需要更新下Unlock MDL.Unlock.Update() EventSystem.Dispatch(EventID.Country_OnGetFoundCountry) MDL.ChannelChat.JoinCountryChannel(msg.myCountryID) end end function private.OnGetTargetGuildInfo(msg) if msg.Resp.Code == 0 then UIManager.OpenView(Const_UI_Lua.UIEnum.UICountryGuildInfoTips, msg) end end function private.OnGetEnfeoffmentPanelInfo(msg) if msg.Resp.Code == 0 then enfeoffmentInfo = msg EventSystem.Dispatch(EventID.Country_GetEnfeoffmentPanelInfo, msg) end end function private.OnGetOfficialPanelInfo(msg) if msg.Resp.Code == 0 then officialInfo = msg EventSystem.Dispatch(EventID.Country_OnGetOfficialPanelInfo, msg) end end function private.OnRefreshMyCountryInfo(msg) myCountryInfo = msg.myCountryInfo EventSystem.Dispatch(EventID.Country_OnUpdateMyCountry) end function private.OnGetNationalList(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnGetNationalList, msg.infoList, msg.totalLength, msg.onlineNum) end end function private.OnCountrySetOfficial(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnCountrySetOfficial, msg.info) UIManager.CloseView(Const_UI_Lua.UIEnum.UICountryPopupNationalAppoint) CTL.Tips.AddTipsMsg(Const_IDS.IDS_Guild_CommonSucceed1) else MDL.Country.CountryGetOfficialPanelInfoReq() UIManager.CloseView(Const_UI_Lua.UIEnum.UICountryPopupNationalAppoint) UIManager.CloseView(Const_UI_Lua.UIEnum.UICountryChangePosition) EventSystem.Dispatch(EventID.Country_OnMemberListRefreshList) end end function private.OnSearchNational(msg) if msg.Resp.Code == 0 then if #msg.infoList > 0 then EventSystem.Dispatch(EventID.Country_OnSearchOfficial, msg.infoList) else CTL.Tips.AddTipsMsg(Const_IDS.IDS_GuildSearch_Fail2) end end end function private.OnRefreshCountryOfficial(msg) local info = Country_Model.GetMyCountryInfo() if info then for i, v in ipairs(info.officialList) do if v.showInfo.acid == BattleDataGetter.GetAcID() then v.position = msg.newPosition break end end curJobId = msg.newPosition remainMute = msg.RemainMute EventSystem.Dispatch(EventID.Country_OnMyJobChange) end end function private.OnRefreshNotificationTimes(msg) myCountryInfo.notificationSendTimes = msg.SendTimes end function private.OnCoreGuildJoinCountry() if UIManager.IsViewOpened(Const_UI_Lua.UIEnum.UICountryChooseView) then MDL.Country.C2GCountrySelectInfo() end if UIManager.IsViewOpened(Const_UI_Lua.UIEnum.UICountryRecruitPanel) then MDL.Country.CountryGetInviteInfoReq() elseif UIManager.IsViewOpened(Const_UI_Lua.UIEnum.UICountryDefectedPanel) then MDL.Country.CountryGetApplyInfoReq() end end function private.OnCountryGetSignInfo(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_GetSignInfo, msg) countrySign = msg CTL.Country.RefreshRedPoint(countrySign) end end function private.OnCountrySign(msg) if msg.Resp.Code == 0 then CTL.Tips.AddTipsMsg(Const_IDS.IDS_AwardReceive_Success) EventSystem.Dispatch(EventID.Country_GetSignInfo, msg) countrySign = msg CTL.Country.RefreshRedPoint(countrySign) end end function private.OnCountryWorshipStatue(msg) if msg.Resp.Code == 0 then remainWorship = msg.RemainWorship CTL.Country.RefreshWorshipRedPoint() end end function private.OnCountryGetStatue(msg) remainWorship = msg.RemainWorship statueBasicInfo = msg.BasicInfo CTL.Country.OnCreateStatue() CTL.Country.RefreshWorshipRedPoint() EventSystem.Dispatch(EventID.Country_GetStatue) end function private.OnGuildLeaveCountry() CTL.Country.OnLeaveGuild() myCountryInfo = nil if selectCountryInfo and selectCountryInfo.myGuildInfo then selectCountryInfo.myGuildInfo.country = 0 end end function private.OnGetSalarySpoilsItemInfo(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnGetSalarySpoilsItemInfo, msg.SpoilsItemList) end end function private.OnSalarySpoilsApplyInfo(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnSalarySpoilsApplyInfo, msg.SpoilsApplyItemList) end end function private.OnSalarySpoilsApply(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnSalarySpoilsApplyInfo, msg.SpoilsApplyItemList, true, msg.MyApplyRank) CTL.Tips.AddTipsMsg(Const_IDS.IDS_Stockroom_ApplySucceed) end end function private.OnSalarySpoilsCancelApply(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnSalarySpoilsApplyInfo, msg.SpoilsApplyItemList, false) CTL.Tips.AddTipsMsg(Const_IDS.IDS_Stockroom_ApplyCancelSucceed) end end function private.OnSalaryTreasureInfo(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnSalaryTreasureInfo, msg) end end function private.OnSalaryTreasureGiveList(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnSalaryTreasureGiveList, msg) end end function private.OnSalaryTreasureAllocationList(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnSalaryTreasureAllocationList, msg) end end function private.OnSalaryTreasureGive(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnSalaryTreasureGiveList, msg) CTL.Tips.AddTipsMsg(Const_IDS.IDS_Guild_CommonSucceed1) MDL.Country.CountrySalaryTreasureInfoReq() MDL.Country.RecordTreasureReq() end UIManager.CloseView(Const_UI_Lua.UIEnum.UICountrySalarySend) end function private.OnSalaryRecordInfo(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnSalaryRecordInfo, msg) end end function private.OnCountrySalaryTreasureAllocation(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnSalaryTreasureAllocationList, msg) CTL.Tips.AddTipsMsg(Const_IDS.IDS_Guild_CommonSucceed1) MDL.Country.CountrySalaryTreasureInfoReq() MDL.Country.RecordTreasureReq() end UIManager.CloseView(Const_UI_Lua.UIEnum.UICountrySalarySend) end function private.OnCountrySalaryBuy(msg) if msg.Resp.Code == 0 then EventSystem.Dispatch(EventID.Country_OnCountrySalaryBuy) end end function private.OnCountrySalaryGiveOut(msg) EventSystem.Dispatch(EventID.Country_SalaryGiveOut) end function private.OnCountryMuteResp(msg) if msg.Resp.Code == 0 then remainMute = msg.RemainMute CTL.Tips.AddTipsMsg(Const_IDS.IDS_Guild_CommonSucceed1) end end function private.OnCountryUnmuteResp(msg) if msg.Resp.Code == 0 then CTL.Tips.AddTipsMsg(Const_IDS.IDS_Guild_CommonSucceed1) end end return Country_Model