Core/GameEngine/Login/Launch.cs
@@ -6,15 +6,18 @@ using System.Collections.Generic; using System.IO; public class Launch : MonoBehaviour { static LaunchStage m_CurrentStage = LaunchStage.None; static public LaunchStage currentStage { get { return m_CurrentStage; } } static float m_Progress = 0f; static public float progress { static public float progress { get { return m_Progress; } set { set { if (m_Progress != value) { m_Progress = value; @@ -68,9 +71,12 @@ IEnumerator Co_Lanuch() { #if !UNITY_EDITOR while (!SDKUtility.Instance.InitFinished) if (VersionConfig.Get().versionAuthority == VersionAuthority.Release) { yield return null; while (!SDKUtility.Instance.InitFinished) { yield return null; } } #endif var cpu = 2; Fight/Actor/AI/HeroAI_KillUntilDie.cs
@@ -151,7 +151,7 @@ // 确定要使用的技能 // 是否存在预设定的技能 if (m_FirstSkill != -1) if (m_FirstSkill > 0) { _skill = _hero.SkillMgr.Get(m_FirstSkill); } Fight/Actor/UserInputHandler.cs
@@ -152,6 +152,21 @@ { if (_hero.IsRun()) { if ((StatusMgr.IsValid() && StatusMgr.Instance.CanMove(PlayerDatas.Instance.PlayerId))) { if (!_hero.IsRushing && !GA_Hero.s_MapSwitching) { float _distance = MathUtility.DistanceSqrtXZ(_hero.PrevPos, _hero.Pos); if (_distance > 0.25f) { _hero.PrevPos = _hero.Pos; } Send_CB409_tagCMPyMove(0); } } if (_hero.State == E_ActorState.AutoRun) { _hero.StopPathFind(); Fight/GameActor/GA_Hero.cs
@@ -720,12 +720,9 @@ Behaviour.StartKillUntilDieAI(); if (aiHandler.IsAuto()) if (OnUserClickSkill != null) { if (OnUserClickSkill != null) { OnUserClickSkill(0); } OnUserClickSkill(0); } } Fight/PreFightMission.cs
@@ -65,6 +65,14 @@ public byte status; } private enum E_AfterAttackType { None, RefreshRock, } private E_AfterAttackType m_AfterAttackType; public Dictionary<uint, Mission> s_MissionDict = new Dictionary<uint, Mission>(); public Dictionary<uint, List<int>> missionNpcDict = new Dictionary<uint, List<int>>(); @@ -182,6 +190,9 @@ public void Start() { NewGuideModel _model = ModelCenter.Instance.GetModel<NewGuideModel>(); _model.arrowScale = 1; IsHeroCanCastSkill = false; Transform _temp = null; _temp = WindowCenter.Instance.uiRoot.baseCanvas.Find("MainInterfaceWin/CopyOfThePanel/TopRightTip"); @@ -366,6 +377,7 @@ return; } WindowCenter.Instance.Close<NewGuideWin>(); WindowCenter.Instance.Close<GuideMessageWin>(); needCreate1002 = true; @@ -423,6 +435,23 @@ m_MoveToEffect = SFXPlayUtility.Instance.Play(1052, PlayerDatas.Instance.hero.Root); FaceTargetXZ _f = m_MoveToEffect.gameObject.AddComponent<FaceTargetXZ>(); _f.target = m_FuncNpc.Root; SnxxzGame.Instance.StartCoroutine(WaitForGoToNpc(_pos)); } private IEnumerator WaitForGoToNpc(Vector3 pos) { GA_Hero _hero = PlayerDatas.Instance.hero; while (true) { if (_hero.IsIdle()) { break; } yield return null; } PlayerDatas.Instance.hero.MoveToPosition(pos); } private void HandlerMission(uint missionId) @@ -616,10 +645,11 @@ _temp.localScale = Vector3.one; NewGuideModel _model = ModelCenter.Instance.GetModel<NewGuideModel>(); _model.showMask = false; _model.content = "返回向师兄回复"; _model.content = ""; _model.componentPath = "NormalCanvas/TreasureSelectWin/Btn_Back"; _model.size = new Vector2(92, 81); _model.direction = 2; _model.arrowScale = 2; _model.pressedClose = false; _model.clickClosed = true; _model.onClose = null; @@ -862,36 +892,18 @@ m_UIEffect = EffectMgr.Instance.PlayUIEffect(1096, 4500, _temp, true); NewGuideModel _model2 = ModelCenter.Instance.GetModel<NewGuideModel>(); _model2.showMask = true; _model2.showMask = false; _model2.content = "连续按图标\r\n使用<color=#00ff00>普通攻击</color>"; _model2.componentPath = "BaseCanvas/MainInterfaceWin/SkillButtonTip/Pivot/CastSkillTip/AttackBtn"; _model2.size = new Vector2(178, 178); _model2.direction = 0; _model2.pressedClose = true; _model2.clickClosed = true; _model2.onClose = () => { // 打开小提示窗口 GuideMessageModel _model = ModelCenter.Instance.GetModel<GuideMessageModel>(); _model.content = "清除前方<color=#00ff00>所有敌人</color>"; _model.duration = -1; _model2.pressedClose = false; _model2.clickClosed = false; WindowCenter.Instance.Open<GuideMessageWin>(); m_AfterAttackType = E_AfterAttackType.RefreshRock; GA_Hero.OnUserClickSkill += OnCastSkill; if (m_UIEffect) { EffectMgr.Instance.RecyleUIEffect(m_UIEffect.effect, m_UIEffect.gameObject); m_UIEffect = null; } Refresh_1001(); // 显示头像区域 _temp = WindowCenter.Instance.uiRoot.baseCanvas.Find("MainInterfaceWin/HeadPortraitTip"); _temp.localScale = Vector3.one; updateAI = true; }; _model2.onClose = null; WindowCenter.Instance.Open<NewGuideWin>(); }); @@ -1039,6 +1051,18 @@ m_SimpleTransfer = CreateTransfer(); } NewGuideModel _model2 = ModelCenter.Instance.GetModel<NewGuideModel>(); _model2.showMask = false; _model2.content = "使用普通攻击\r\n破坏<color=#00ff00>栅栏</color>"; _model2.componentPath = "BaseCanvas/MainInterfaceWin/SkillButtonTip/Pivot/CastSkillTip/AttackBtn"; _model2.size = new Vector2(178, 178); _model2.direction = 0; _model2.pressedClose = false; _model2.clickClosed = false; _model2.onClose = null; WindowCenter.Instance.Open<NewGuideWin>(); SnxxzGame.Instance.StartCoroutine(DelayCloseNewGuideWin(3f)); Transform _temp = WindowCenter.Instance.uiRoot.baseCanvas.Find("MainInterfaceWin/TaskAndTeamTip/TaskListTip"); _temp.gameObject.SetActive(false); _temp = WindowCenter.Instance.uiRoot.baseCanvas.Find("MainInterfaceWin/TaskSwithButton"); @@ -1050,17 +1074,6 @@ m_SimpleTransfer.Init(-1, _pos, false, null, () => { NewGuideModel _model2 = ModelCenter.Instance.GetModel<NewGuideModel>(); _model2.showMask = false; _model2.content = "使用普通攻击\r\n破坏<color=#00ff00>栅栏</color>"; _model2.componentPath = "BaseCanvas/MainInterfaceWin/SkillButtonTip/Pivot/CastSkillTip/AttackBtn"; _model2.size = new Vector2(178, 178); _model2.direction = 0; _model2.pressedClose = false; _model2.clickClosed = true; _model2.onClose = null; WindowCenter.Instance.Open<NewGuideWin>(); HeroBehaviour.onCastSkill += OnCastSkill; _pos = new Vector3(124.65f, 51.494f, 33.01f); @@ -1109,9 +1122,48 @@ GameObjectPoolManager.Instance.UnLoadNPC(1000); } private IEnumerator DelayCloseNewGuideWin(float time) { float _time = Time.realtimeSinceStartup; while (Time.realtimeSinceStartup - _time < time) { yield return null; } WindowCenter.Instance.Close<NewGuideWin>(); } private void OnCastSkill(int skillID) { GA_Hero.OnUserClickSkill -= OnCastSkill; if (m_AfterAttackType == E_AfterAttackType.RefreshRock) { // 打开小提示窗口 GuideMessageModel _model = ModelCenter.Instance.GetModel<GuideMessageModel>(); _model.content = "清除前方<color=#00ff00>所有敌人</color>"; _model.duration = -1; WindowCenter.Instance.Open<GuideMessageWin>(); if (m_UIEffect) { EffectMgr.Instance.RecyleUIEffect(m_UIEffect.effect, m_UIEffect.gameObject); m_UIEffect = null; } Refresh_1001(); // 显示头像区域 Transform _temp = WindowCenter.Instance.uiRoot.baseCanvas.Find("MainInterfaceWin/HeadPortraitTip"); _temp.localScale = Vector3.one; updateAI = true; m_AfterAttackType = E_AfterAttackType.None; return; } if (WindowCenter.Instance.CheckOpen<NewGuideWin>()) { WindowCenter.Instance.Close<NewGuideWin>(); Fight/Stage/MapEditor/NewGuideModel.cs
@@ -21,6 +21,7 @@ /// 说明文字及箭头的方向, 0123 上下左右 /// </summary> public byte direction; public float arrowScale = 1f; public override void Init() { Fight/Stage/MapEditor/NewGuideWin.cs
@@ -49,8 +49,17 @@ holdImage.cell = _model.size; rtSelectFrame.sizeDelta = _model.size + new Vector2(15, 15); if (string.IsNullOrEmpty(_model.content)) { rtContent.gameObject.SetActive(false); } else { rtContent.gameObject.SetActive(true); } txtContent.text = _model.content; m_PressClose = _model.pressedClose; rtArrow.localScale = Vector3.one * _model.arrowScale; container.gameObject.SetActive(_model.showMask); if (_model.onClose != null) @@ -115,25 +124,25 @@ { _arrowPosition = rtSelectFrame.anchoredPosition + new Vector2(0, rtSelectFrame.sizeDelta.y * .5f + 20f); _contentPosition = _arrowPosition + new Vector2(0, rtArrow.sizeDelta.y * .5f + rtContent.sizeDelta.y * .5f + 5); _rotation = Vector3.zero; _rotation = new Vector3(0, 0, 90); } else if (m_Direction == 1)// 下 { _arrowPosition = rtSelectFrame.anchoredPosition + new Vector2(0, -rtSelectFrame.sizeDelta.y * .5f - 20f); _contentPosition = _arrowPosition + new Vector2(0, -rtArrow.sizeDelta.y * .5f - rtContent.sizeDelta.y * .5f - 5); _rotation = new Vector3(0, 0, 180); _rotation = new Vector3(0, 0, 270); } else if (m_Direction == 2)// 左 { _arrowPosition = rtSelectFrame.anchoredPosition + new Vector2(-rtSelectFrame.sizeDelta.x * .5f - 20f, 0); _contentPosition = _arrowPosition + new Vector2(-rtArrow.sizeDelta.x * .5f - rtContent.sizeDelta.x * .5f - 5, 0); _rotation = new Vector3(0, 0, 90); _rotation = new Vector3(0, 0, 180); } else if (m_Direction == 3)// 右 { _arrowPosition = rtSelectFrame.anchoredPosition + new Vector2(rtSelectFrame.sizeDelta.x * .5f + 20f, 0); _contentPosition = _arrowPosition + new Vector2(rtArrow.sizeDelta.x * .5f + rtContent.sizeDelta.x * .5f + 5, 0); _rotation = new Vector3(0, 0, 270); _rotation = Vector3.zero; } rtArrow.anchoredPosition = _arrowPosition; System/Activity/ActivityModel.cs
@@ -136,6 +136,10 @@ { mainStage = false; activityNotifies.Clear(); if (WindowCenter.Instance.CheckOpen<ActivityNotifyWin>()) { WindowCenter.Instance.CloseImmediately<ActivityNotifyWin>(); } } } } System/Activity/ActivityNotifyWin.cs
@@ -50,7 +50,10 @@ protected override void OnAfterOpen() { if (model.activityNotifies.Count <= 0) { CloseImmediately(); } } protected override void OnPreClose() System/Compose/New/ComposeEquipWin.cs
@@ -112,7 +112,6 @@ DTCA814_tagMCMakeItemAnswer.MakeItemAnswerEvent += OnComposeAnswer; UIEventTrigger.Get(helpBtn.gameObject).OnDown = OnClickHelpBtn; UIEventTrigger.Get(helpBtn.gameObject).OnUp = OnDownUp; selectModel.haveSelectItemRefresh += RefreshComposeSuccessRate; successRate = 0; composeWinModel.funcType = ComposeFuncType.Equip; firstTypeDict = composeWinModel.GetFirstTypeModel(); @@ -136,7 +135,6 @@ { selectModel.selectEquipEvent -= RefreshSelectItem; DTCA814_tagMCMakeItemAnswer.MakeItemAnswerEvent -= OnComposeAnswer; selectModel.haveSelectItemRefresh -= RefreshComposeSuccessRate; } protected override void OnAfterClose() @@ -289,8 +287,8 @@ if (preThirdType != curThirdType) { preThirdType = curThirdType; curComposeEquipIndex = -1; } curComposeEquipIndex = -1; CreateCell(); selectModel.ClearSelectModel(); } @@ -300,21 +298,38 @@ if (thirdTypelist == null) return; ChangeUIState(false, true, false); equipTypeLineCellCtrl.Refresh(); int line = thirdTypelist.Count / 3; if(thirdTypelist.Count % 3 > 0) if(thirdTypelist.Count > 1) { line += 1; ChangeUIState(false, true, false); equipTypeLineCellCtrl.Refresh(); int line = thirdTypelist.Count / 3; if (thirdTypelist.Count % 3 > 0) { line += 1; } int i = 0; for (i = 0; i < line; i++) { equipTypeLineCellCtrl.AddCell(ScrollerDataType.Header, i); } equipTypeLineCellCtrl.Restart(); } int i = 0; for(i = 0; i < line; i++) else { equipTypeLineCellCtrl.AddCell(ScrollerDataType.Header,i); if(thirdTypelist.Count > 0) { ItemCompoundConfig tagItemCompound = thirdTypelist[0]; ClickEquipTypeCell(tagItemCompound, 0); RefreshUI(tagItemCompound); } } equipTypeLineCellCtrl.Restart(); if(curComposeEquipIndex != -1) { ItemCompoundConfig tagItemCompound = thirdTypelist[curComposeEquipIndex]; ClickEquipTypeCell(tagItemCompound, curComposeEquipIndex); } } private void RefreshEquipTypeLineCell(ScrollerDataType type, CellView cell) @@ -336,10 +351,6 @@ icon.SetSprite(tagChinItem.IconKey); bgIcon.SetItemBackGround(tagChinItem.ItemColor); nameText.text = GeneralConfig.Instance.equipPlaceNameDict[tagChinItem.EquipPlace]; if (index == curComposeEquipIndex) { ClickEquipTypeCell(tagItemCompound, index); } cellBtn.RemoveAllListeners(); cellBtn.AddListener(()=> { ClickEquipTypeCell(tagItemCompound,index); @@ -637,15 +648,10 @@ public void RefreshComposeSuccessRate() { Dictionary<int, ItemModel> unfixedSelectItemDict = selectModel.GetHaveUnfixedSelectItem(); successRate = 0; if (unfixedSelectItemDict != null && compoundModel != null) if (compoundModel != null) { if (unfixedSelectItemDict.Count >= compoundModel.unfixedItemCount) { successRate = compoundModel.successRate; } successRate = compoundModel.successRate; } successRateText.text = Language.Get("HallowsWin_Success", StringUtility.Contact(successRate / 100, "%")); } System/FairyAu/FairyAuTaskWin.cs
@@ -129,6 +129,11 @@ private void OnPlayerDie() { CloseImmediately(); if (!WindowCenter.Instance.CheckOpen<MainInterfaceWin>()) { WindowCenter.Instance.Open<MainInterfaceWin>(); } } #endregion void ReceiveButton()//领取奖励 System/FairylandCeremony/CeremonyOutOfPrintWin.cs
@@ -12,7 +12,7 @@ [SerializeField] Text secondNameText; [SerializeField] Text thirdNameText; [SerializeField] Text remainTimeText; [SerializeField] List<UIEffect> rankEffectlist = new List<UIEffect>(); [SerializeField] List<CommonItemBaisc> firstItemlist = new List<CommonItemBaisc>(); [SerializeField] List<CommonItemBaisc> secondItemlist = new List<CommonItemBaisc>(); [SerializeField] List<CommonItemBaisc> thirdItemlist = new List<CommonItemBaisc>(); @@ -83,19 +83,42 @@ if (list.Count > 0) { firstNameText.text = list[0].Name1; SetRankEffect(0,(int)list[0].ID); } if (list.Count > 1) { secondNameText.text = list[1].Name1; SetRankEffect(1, (int)list[1].ID); } if (list.Count > 2) { thirdNameText.text = list[2].Name1; SetRankEffect(2, (int)list[2].ID); } } } private void SetRankEffect(int rank,int playerId) { for(int i = 0; i < rankEffectlist.Count; i++) { if(rank == i && playerId == PlayerDatas.Instance.baseData.PlayerID) { if(!rankEffectlist[i].IsPlaying) { rankEffectlist[i].Play(); } } else { if (rankEffectlist[i].IsPlaying) { rankEffectlist[i].Stop(); } } } } private void RefreshSecond() System/FairylandCeremony/FairylandCeremonyModel.cs
@@ -10,7 +10,7 @@ public ReceiveState receiveState { get; private set; } Dictionary<CeremonyType, Dictionary<int, List<int>>> typeLvDict = new Dictionary<CeremonyType, Dictionary<int, List<int>>>(); Dictionary<int, List<AwardItem>> rechargeAwardDict = new Dictionary<int, List<AwardItem>>(); Dictionary<int, int> fireDict = new Dictionary<int, int>(); public Dictionary<int, int> fireDict = new Dictionary<int, int>(); List<AllPeoplePartyConfig> allPeoples = new List<AllPeoplePartyConfig>(); List<AllPeoplePartyAwardConfig> allPeopleAwards = new List<AllPeoplePartyAwardConfig>(); Dictionary<int, Dictionary<int, List<AwardItem>>> jobToHiAwardDict = new Dictionary<int, Dictionary<int, List<AwardItem>>>(); System/KnapSack/Logic/BoxGetItemWin.cs
@@ -4,6 +4,7 @@ using UnityEngine; using UnityEngine.UI; using DG.Tweening; using TableConfig; namespace Snxxz.UI { @@ -16,6 +17,7 @@ [SerializeField] Button useBtn; [SerializeField] Text useBtnText; [SerializeField] Text getCoinsText; [SerializeField] UIEffect fireEffect; PlayerPackModel _playerPack; PlayerPackModel playerPack @@ -40,6 +42,7 @@ return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>()); } } FairylandCeremonyModel ceremonyModel { get { return ModelCenter.Instance.GetModel<FairylandCeremonyModel>(); } } [SerializeField] float scaleTime = 0.3f; @@ -122,6 +125,27 @@ { getCoinsText.gameObject.SetActive(false); } foreach(var key in ceremonyModel.fireDict.Keys) { StoreConfig storeConfig = ConfigManager.Instance.GetTemplate<StoreConfig>(ceremonyModel.fireDict[key]); if(storeConfig != null) { if(storeConfig.ItemID == BoxModel.itemId) { if (!fireEffect.IsPlaying) { fireEffect.Play(); return; } } } } if (fireEffect.IsPlaying) { fireEffect.Stop(); } } private void RefreshUI(PackType type, int index, int id) System/MainInterfacePanel/PlayerTaskDatas.cs
@@ -461,7 +461,10 @@ void TaskClassification(int _taskID, int MissionState)//任务分类(主线任务,支线任务) { if (!allMissionDict.ContainsKey(_taskID)) { return; } TaskTypenum type = (TaskTypenum)allMissionDict[_taskID].Type; switch (type) { @@ -805,7 +808,7 @@ dic.Add(info.DictKey, (int)info.DictValue); } } } public void RequestGetTaskAward(string _answer) @@ -878,13 +881,16 @@ if (allMissionDict.ContainsKey(_taskID)) { allMissionDict.Remove(_taskID); _DicTaskInformation.Remove(_taskID); if (_DicTaskInformation.ContainsKey(_taskID)) { _DicTaskInformation.Remove(_taskID); } } TaskTypeDeletion(_taskID); if (Event_TaskToDelete != null) { Event_TaskToDelete(_taskID); } } bool _bool = false; string _conversationA = null; @@ -1367,7 +1373,7 @@ public enum TaskStatus//任务状态 { None=-5,//没有 None = -5,//没有 Normal = 0,//正常任务(绿) TreasureCardLevel = 1,//法宝卡级(红) CardLevel = 2,//等级卡级(红) @@ -1455,8 +1461,8 @@ { return; } if ((taskID == BOUNTYTASK && MissionState == 1 && !BountyMotionBool && TaskAllocation.Instance.ForRingAllNumber()!=10) || (taskID == FAIRYAUTASK && MissionState == 1 && !FairyAuBool && TaskAllocation.Instance.FairyAuAllNumber()==70)) if ((taskID == BOUNTYTASK && MissionState == 1 && !BountyMotionBool && TaskAllocation.Instance.ForRingAllNumber() != 10) || (taskID == FAIRYAUTASK && MissionState == 1 && !FairyAuBool && TaskAllocation.Instance.FairyAuAllNumber() == 70)) { var mapModel = ModelCenter.Instance.GetModel<MapModel>(); var point = mapModel.GetRecommendHangPoint(); System/MainInterfacePanel/SideMission.cs
@@ -89,7 +89,17 @@ { sideMissionTitleBtton.PitchOnImage.SetActive(false); } sideMissionTitleBtton.TitleName.text= ConfigManager.Instance.GetTemplate<TASKINFOConfig>(taskmodel.SideQuestsDic[TaskId].Name).show_writing;//任务名 var taskname = taskmodel.SideQuestsDic[TaskId].Name; if (ConfigManager.Instance.GetTemplate<TASKINFOConfig>(taskname) == null) { DesignDebug.LogError("TASKINFO任务表格没有获取到该任务名称"+ taskname); return; } sideMissionTitleBtton.TitleName.text= ConfigManager.Instance.GetTemplate<TASKINFOConfig>(taskname).show_writing;//任务名 if (!taskmodel.SideQuestsDic.ContainsKey(TaskId)) { return; } sideMissionTitleBtton.Text_RamusState.text = GegionalTaskStatus(taskmodel.SideQuestsDic[TaskId].MissionState); sideMissionTitleBtton.SideMissionTitleBtton1.RemoveAllListeners(); sideMissionTitleBtton.SideMissionTitleBtton1.AddListener(()=> @@ -105,6 +115,10 @@ void Information(int taskID) { if (!taskmodel.SideQuestsDic.ContainsKey(taskID)) { return; } _Text_TaskName.text = ConfigManager.Instance.GetTemplate<TASKINFOConfig>(taskmodel.SideQuestsDic[taskID].Name).show_writing;//任务名 _Text_TaskDescribe.text = ConfigManager.Instance.GetTemplate<TASKINFOConfig>(taskmodel.SideQuestsDic[taskID].Desclist).show_writing;//任务描述 string strINfor = taskmodel.SideQuestsDic[taskID].InforList; System/MainInterfacePanel/TaskWin.cs
@@ -85,7 +85,11 @@ private void OnPlayerDie() { Close(); CloseImmediately(); if (!WindowCenter.Instance.CheckOpen<MainInterfaceWin>()) { WindowCenter.Instance.Open<MainInterfaceWin>(); } } protected override void OnAfterClose() System/Realm/RealmProgressBehaviour.cs
@@ -102,8 +102,8 @@ break; } } m_SpecialProperty.DisplayUpper(config.specialProperty, config.AddAttrNum[index]); m_HurtRemind.text = UIHelper.ReplaceNewLine(Language.Get("RealmSuppressHurt", config.Name, (float)model.realmSuppressHurt / 1000)); m_SpecialProperty.DisplayColon(config.specialProperty, config.AddAttrNum[index]); m_HurtRemind.text = UIHelper.ReplaceNewLine(Language.Get("RealmSuppressHurt", UIHelper.GetTextColorByItemColor(config.Quality, config.Name), (float)model.realmSuppressHurt / 1000)); } } System/Role/PropertyBehaviour.cs
@@ -32,6 +32,17 @@ config.ISPercentage == 1 ? "%" : string.Empty); } } public void DisplayColon(int _property, int _value) { var config = ConfigManager.Instance.GetTemplate<PlayerPropertyConfig>(_property); if (config != null) { m_PropertyName.text = StringUtility.Contact(config.Name, ":"); m_PropertyValue.text = StringUtility.Contact("+", UIHelper.ReplaceLargeNum(UIHelper.ReplacePercentage(_value, config.ISPercentage)), config.ISPercentage == 1 ? "%" : string.Empty); } } } } System/SystemSetting/ActivitiesPushMgr.cs
@@ -3,19 +3,28 @@ using System.Collections.Generic; using System.Linq; using System.Text; using TableConfig; namespace Snxxz.UI { public class ActivitiesPushMgr : Model,IBeforePlayerDataInitialize,IAfterPlayerDataInitialize,IPlayerLoginOk { public const int WholePeopleMountRank = 2090001; //全民冲榜坐骑榜 public const int WholePeopleMountRankEnd = 2090002; //全民冲榜坐骑榜截止 public const int WholePeopleRankStart = 2091000; //全民冲榜开始 public const int WholePeopleRankEnd = 20910000; //全民冲榜截止 ImpactRankModel impactRank { get { return ModelCenter.Instance.GetModel<ImpactRankModel>(); } } private List<int> rankTypelist = new List<int>(); public override void Init() { List<OSCBillRankAwardConfig> configs = ConfigManager.Instance.GetAllValues<OSCBillRankAwardConfig>(); for(int i = 0; i < configs.Count; i++) { if(!rankTypelist.Contains(configs[i].RangListType)) { rankTypelist.Add(configs[i].RangListType); } } } public void OnBeforePlayerDataInitialize() @@ -30,8 +39,8 @@ public void OnPlayerLoginOk() { SetMountRankPushInfo(); SetMountRankEndPushInfo(); SetRankStartPushInfo(); SetRankEndPushInfo(); GlobalTimeEvent.Instance.minuteEvent -= RefreshMinuteTime; GlobalTimeEvent.Instance.minuteEvent += RefreshMinuteTime; OpenServerActivityCenter.Instance.openServerActivityStateChange -= RefreshOpenServerState; @@ -46,49 +55,63 @@ private void RefreshMinuteTime() { RemovePushByTime(PushInfoType.MountRankStart,11); RemovePushByTime(PushInfoType.MountRankEnd,23); RemovePushByTime(PushInfoType.RankStart,11); RemovePushByTime(PushInfoType.RankEnd,23); } private void RefreshOpenServerState() { SetMountRankPushInfo(); SetMountRankEndPushInfo(); SetRankStartPushInfo(); SetRankEndPushInfo(); } private void SetMountRankPushInfo() private void SetRankStartPushInfo() { if(impactRank.IsActivityClose(2)) for(int i = 0; i <rankTypelist.Count; i++) { RemovePushInfo(WholePeopleMountRank); return; } int day = impactRank.GetOpenDay(2); int remainHour = 11 - TimeUtility.ServerNow.Hour; int remainMinute = 0 - TimeUtility.ServerNow.Minute; int remainSecond = day * 24 * 60 * 60 + remainHour * 60 * 60 + remainMinute * 60; if(remainSecond > 0) { GetPushJsonData(WholePeopleMountRank, remainSecond,Language.Get("SetUpPrivate106"),Language.Get("SetUpPrivate107")); int rankStartId = WholePeopleRankStart + rankTypelist[i]; if (impactRank.IsActivityClose(rankTypelist[i])) { RemovePushInfo(rankStartId); } else { int day = impactRank.GetOpenDay(rankTypelist[i]); int remainHour = 11 - TimeUtility.ServerNow.Hour; int remainMinute = 0 - TimeUtility.ServerNow.Minute; int remainSecond = day * 24 * 60 * 60 + remainHour * 60 * 60 + remainMinute * 60; if (remainSecond > 0) { PlayerRankData.RankType rankType = impactRank.GetRankType(rankTypelist[i]); string rankName = StringUtility.Contact("OSCBillRankTitle_", rankType); SendPushInfo(GetPushJsonData(rankStartId, remainSecond, Language.Get("SetUpPrivate106"), Language.Get("SetUpPrivate107", rankName))); } } } } private void SetMountRankEndPushInfo() private void SetRankEndPushInfo() { if (impactRank.IsActivityClose(2)) for(int i = 0; i < rankTypelist.Count; i++) { RemovePushInfo(WholePeopleMountRankEnd); return; } int day = impactRank.GetSurplusDay(2); int remainHour = 23 - TimeUtility.ServerNow.Hour; int remainMinute = 0 - TimeUtility.ServerNow.Minute; int remainSecond = (day - 1) * 24 * 60 * 60 + remainHour * 60 * 60 + remainMinute * 60; if (remainSecond > 0) { GetPushJsonData(WholePeopleMountRankEnd, remainSecond, Language.Get("SetUpPrivate106"), Language.Get("SetUpPrivate108")); int rankEndId = WholePeopleRankEnd + rankTypelist[i]; if (impactRank.IsActivityClose(rankTypelist[i])) { RemovePushInfo(rankEndId); } else { int day = impactRank.GetSurplusDay(rankTypelist[i]); int remainHour = 23 - TimeUtility.ServerNow.Hour; int remainMinute = 0 - TimeUtility.ServerNow.Minute; int remainSecond = (day - 1) * 24 * 60 * 60 + remainHour * 60 * 60 + remainMinute * 60; if (remainSecond > 0) { PlayerRankData.RankType rankType = impactRank.GetRankType(rankTypelist[i]); string rankName = StringUtility.Contact("OSCBillRankTitle_", rankType); SendPushInfo(GetPushJsonData(rankEndId, remainSecond, Language.Get("SetUpPrivate106"), Language.Get("SetUpPrivate108", rankName))); } } } } @@ -99,31 +122,39 @@ int remainSecond = remainHour * 60 * 60 + remainMinute * 60; switch (type) { case PushInfoType.MountRankStart: if (impactRank.IsActivityClose(2)) case PushInfoType.RankStart: for (int i = 0; i < rankTypelist.Count; i++) { RemovePushInfo(WholePeopleMountRank); } else { int day = impactRank.GetOpenDay(2); if(day <= 0 && remainSecond <= 120) int rankStartId = WholePeopleRankStart + rankTypelist[i]; if (impactRank.IsActivityClose(rankTypelist[i])) { RemovePushInfo(WholePeopleMountRank); RemovePushInfo(rankStartId); } else { int day = impactRank.GetOpenDay(rankTypelist[i]); if (day <= 0 && remainSecond <= 120) { RemovePushInfo(rankStartId); } } } break; case PushInfoType.MountRankEnd: if (impactRank.IsActivityClose(2)) case PushInfoType.RankEnd: for (int i = 0; i < rankTypelist.Count; i++) { RemovePushInfo(WholePeopleMountRankEnd); } else { int day = impactRank.GetSurplusDay(2); if (day <= 1 && remainSecond <= 120) int rankEndId = WholePeopleRankEnd + rankTypelist[i]; if (impactRank.IsActivityClose(rankTypelist[i])) { RemovePushInfo(WholePeopleMountRankEnd); RemovePushInfo(rankEndId); } else { int day = impactRank.GetSurplusDay(rankTypelist[i]); if (day <= 1 && remainSecond <= 120) { RemovePushInfo(rankEndId); } } } break; @@ -133,6 +164,11 @@ public void RemovePushInfo(int pushId) { SDKUtility.Instance.GeTui_RemoveLocalMessage(pushId.ToString()); } public void SendPushInfo(JsonData data) { SDKUtility.Instance.GeTui_SendLocalMessage(data); } public JsonData GetPushJsonData(int pushId,int pushtime,string title,string content) @@ -154,8 +190,8 @@ public enum PushInfoType { MountRankStart, MountRankEnd, RankStart, RankEnd, } } }