Core/GameEngine/Model/Config/DungeonInspireConfig.cs
@@ -1,6 +1,6 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Saturday, January 06, 2018 // [ Date ]: Friday, September 14, 2018 //-------------------------------------------------------- using UnityEngine; @@ -11,11 +11,11 @@ public partial class DungeonInspireConfig : ConfigBase { public int ID { get ; private set ; } public int DataMapId { get ; private set ; } public int InspireType { get ; private set ; } public int InspireCount { get ; private set ; } public int MoneyCount { get ; private set ; } public int ID { get ; private set ; } public int DataMapId { get ; private set ; } public int InspireType { get ; private set ; } public int InspireCount { get ; private set ; } public string MoneyCount { get ; private set; } public override string getKey() { @@ -25,15 +25,15 @@ public override void Parse() { try { ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; DataMapId=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; InspireType=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; InspireCount=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; MoneyCount=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; DataMapId=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; InspireType=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; InspireCount=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; MoneyCount = rawContents[4].Trim(); } catch (Exception ex) { Core/GameEngine/Model/Config/DungeonInspireConfig.cs.meta
@@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 413d3284263320648a52a0009e3d125f timeCreated: 1515213550 timeCreated: 1536909479 licenseType: Pro MonoImporter: serializedVersion: 2 Core/GameEngine/Model/Player/Character/PlayerBaseData.cs
@@ -62,10 +62,8 @@ public int BasicsDefense;//基础防御 public int BasicsScoreAHit;//基础命中 public int BasicsDodge;//基础闪避 public long treasurePotentialSp { get { public long treasurePotentialSp { get { return ExAttr8 * (long)100000000 + ExAttr7; } } @@ -76,7 +74,7 @@ { AccID = _serverInfo.AccID; PlayerID = _serverInfo.PlayerID; PlayerName = _serverInfo.PlayerName.Trim(); PlayerName = _serverInfo.PlayerName.Trim().Replace(" ", ""); AccState = _serverInfo.AccState; GMLevel = _serverInfo.GMLevel; Sex = _serverInfo.Sex; @@ -87,7 +85,7 @@ ExpPoint = _serverInfo.ExpPoint; TotalExp = _serverInfo.TotalExp; Family = _serverInfo.Family; FamilyName = _serverInfo.FamilyName.Trim(); FamilyName = _serverInfo.FamilyName.Trim().Replace(" ", ""); Gold = _serverInfo.Gold; GoldPaper = _serverInfo.GoldPaper; Silver = _serverInfo.Silver; Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA30A_tagMCFBEncourageInfo.cs
@@ -21,7 +21,10 @@ base.Done(vNetPack); HA30A_tagMCFBEncourageInfo vNetData = vNetPack as HA30A_tagMCFBEncourageInfo; model.UpdateInspireLevel(vNetData.Cnt1, vNetData.Cnt2); for (int i = 0; i < vNetData.Cnt; i++) { model.UpdateInspireLevel(vNetData.InfoList[i].MoneyType, vNetData.InfoList[i].EncourageCnt); } } } Core/NetworkPackage/ServerPack/HA3_Function/HA30A_tagMCFBEncourageInfo.cs
@@ -4,16 +4,26 @@ //A3 0A 副本鼓舞信息通知 #tagMCFBEncourageInfo public class HA30A_tagMCFBEncourageInfo : GameNetPackBasic { public byte Cnt1; // 当前铜钱鼓舞次数 public byte Cnt2; // 当前仙玉鼓舞次数 public byte Cnt; // public tagMCFBEncourageCnt[] InfoList; // 次数信息 public HA30A_tagMCFBEncourageInfo () { _cmd = (ushort)0xA30A; } public override void ReadFromBytes (byte[] vBytes) { TransBytes (out Cnt1, vBytes, NetDataType.BYTE); TransBytes (out Cnt2, vBytes, NetDataType.BYTE); TransBytes (out Cnt, vBytes, NetDataType.BYTE); InfoList = new tagMCFBEncourageCnt[Cnt]; for (int i = 0; i < Cnt; i ++) { InfoList[i] = new tagMCFBEncourageCnt(); TransBytes (out InfoList[i].MoneyType, vBytes, NetDataType.BYTE); TransBytes (out InfoList[i].EncourageCnt, vBytes, NetDataType.BYTE); } } public struct tagMCFBEncourageCnt { public byte MoneyType; // 金钱类型 public byte EncourageCnt; // 当前鼓舞次数 } } System/Chat/ChatCtrl.cs
@@ -677,7 +677,7 @@ #region 组队邀请 private const string INVITE_IDENTIFY = "<i>"; private static Regex InviteRegex = new Regex(@INVITE_IDENTIFY, RegexOptions.Singleline); public static Regex InviteRegex = new Regex(@INVITE_IDENTIFY, RegexOptions.Singleline); public void SendInvite(string msg) { SendChatInfo(ChatInfoType.World, StringUtility.Contact(msg, INVITE_IDENTIFY)); @@ -798,6 +798,7 @@ #endregion #region 好友私聊 public static Regex KillRegex = new Regex(@KILL_IDENTIFY, RegexOptions.Singleline); public const string KILL_IDENTIFY = "<k>"; public void SendFriendChat(string msg, int player) { System/Dungeon/DungeonFairyLandWin.cs
@@ -121,9 +121,9 @@ private void DungeonEncourageEvent() { var lv = model.dungeonCoinInspireCount + model.dungeonJadeInspireCount; targetTextList[3].text = lv == 0 ? StringUtility.Contact(Language.Get("FairyLand_Func3"), ":", Language.Get("FairyLand_Func4")) : StringUtility.Contact(Language.Get("FairyLand_Func3"), ":<color=#00ff00>", lv * model.dungeonInspireUper, "%</color>"); var level = model.GetDungeonInspireLevel(); targetTextList[3].text = level == 0 ? StringUtility.Contact(Language.Get("FairyLand_Func3"), ":", Language.Get("FairyLand_Func4")) : StringUtility.Contact(Language.Get("FairyLand_Func3"), ":<color=#00ff00>", level * model.GetDungeonInspireUpper(31080), "%</color>"); } private void UpdateBuf() System/Dungeon/DungeonInspireBehaviour.cs
@@ -43,7 +43,7 @@ } for (int i = 0; i < _list.Count; i++) { if (_list[i].InspireType == 1) if (_list[i].InspireType == 3) { m_CoinConfig = _list[i]; break; @@ -54,13 +54,13 @@ private void UpdateDugeonInspireLv() { var mapId = model.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID); var lv = model.dungeonJadeInspireCount + model.dungeonCoinInspireCount; m_Waggle = m_CoinConfig != null && model.dungeonCoinInspireCount < m_CoinConfig.InspireCount && lv < model.GetInspireMaxCount(mapId); var level = model.GetDungeonInspireLevel(); m_Waggle = m_CoinConfig != null && model.GetDungeonInspireLevel(3) < m_CoinConfig.InspireCount && level < model.GetInspireMaxCount(mapId); if (m_InspireProgress != null) { m_InspireProgress.gameObject.SetActive(PlayerDatas.Instance.baseData.MapID == DemonJarModel.DEMONJAR_MAPID); m_InspireProgress.text = StringUtility.Contact(lv * 10, "%"); m_InspireProgress.text = StringUtility.Contact(level * 10, "%"); } if (!m_Waggle) { @@ -100,7 +100,7 @@ private void OnInspireBtn() { if ((model.dungeonCoinInspireCount + model.dungeonJadeInspireCount) >= model.GetInspireMaxCount(PlayerDatas.Instance.baseData.MapID)) if ((model.GetDungeonInspireLevel()) >= model.GetInspireMaxCount(PlayerDatas.Instance.baseData.MapID)) { SysNotifyMgr.Instance.ShowTip("Xjmj_InspireMaxLevel"); return; System/Dungeon/DungeonInspireWin.cs
@@ -15,25 +15,17 @@ public class DungeonInspireWin : Window { [SerializeField] Button coinInspireBtn; [SerializeField] GameObject coinInspireMark; [SerializeField] Button fairyInspireBtn; [SerializeField] GameObject fairyInspireMark; [SerializeField] Text coinInspireInfoText; [SerializeField] Text fairyInspireInfoText; [SerializeField] Text m_InpsireLvTxt; [SerializeField] Button confirmBtn; [SerializeField] Button cancelBtn; [SerializeField] Button m_CloseBtn; [SerializeField] Button m_CoinInspire; [SerializeField] RectTransform m_CoinInspireCheck; [SerializeField] Button m_FairyInspire; [SerializeField] RectTransform m_FairyInspireCheck; [SerializeField] Text m_CoinCost; [SerializeField] Text m_FairyCost; [SerializeField] Text m_InspireLevel; [SerializeField] Text m_Remind; [SerializeField] Button m_Confirm; [SerializeField] Button m_Cancel; [SerializeField] Button m_Close; DungeonModel m_Model; DungeonModel model @@ -44,10 +36,10 @@ } } private bool isCoinInspire = false; private bool isFairyInspire = false; private DungeonInspireConfig coinInspireCfg = null; private DungeonInspireConfig fairyInspireCfg = null; private bool coinInspire = false; private bool fairyInspire = false; private DungeonInspireConfig coinInspireConfig = null; private DungeonInspireConfig fairyInspireConfig = null; #region Built-in protected override void BindController() { @@ -55,11 +47,11 @@ protected override void AddListeners() { coinInspireBtn.onClick.AddListener(OnCoinInspire); fairyInspireBtn.onClick.AddListener(OnFairyInspire); confirmBtn.onClick.AddListener(OnConfirmBtn); cancelBtn.onClick.AddListener(OnCancelBtn); m_CloseBtn.onClick.AddListener(CloseClick); m_CoinInspire.onClick.AddListener(CoinInspire); m_FairyInspire.onClick.AddListener(FairyInspire); m_Confirm.onClick.AddListener(Confirm); m_Cancel.onClick.AddListener(Cancel); m_Close.onClick.AddListener(CloseClick); } protected override void OnPreOpen() @@ -69,25 +61,30 @@ { return; } coinInspireCfg = null; fairyInspireCfg = null; coinInspireConfig = null; fairyInspireConfig = null; for (int i = 0; i < _list.Count; i++) { if (_list[i].InspireType == 1) if (_list[i].InspireType == 3) { coinInspireCfg = _list[i]; coinInspireConfig = _list[i]; } else if (_list[i].InspireType == 2) else if (_list[i].InspireType == 2 || _list[i].InspireType == 1 || _list[i].InspireType == 5) { fairyInspireCfg = _list[i]; fairyInspireConfig = _list[i]; } } coinInspireBtn.gameObject.SetActive(coinInspireCfg != null); isCoinInspire = coinInspireCfg == null ? false : true; isFairyInspire = !isCoinInspire; InitData(); m_CoinInspire.gameObject.SetActive(coinInspireConfig != null); coinInspire = coinInspireConfig == null ? false : true; fairyInspire = !coinInspire; Display(); UpdateInspireType(); DisplayRemind(); model.dungeonInspireLvEvent += DungeonEncourageEvent; } @@ -96,6 +93,12 @@ protected override void OnAfterOpen() { var _list = model.GetDungeonInspire(PlayerDatas.Instance.baseData.MapID); if (_list == null) { CloseImmediately(); return; } } protected override void OnPreClose() @@ -110,95 +113,125 @@ private void DungeonEncourageEvent() { var lv = model.dungeonCoinInspireCount + model.dungeonJadeInspireCount; if (lv >= fairyInspireCfg.InspireCount && !InFairyLandGuiding()) var level = model.GetDungeonInspireLevel(); if (level >= model.GetInspireMaxCount(PlayerDatas.Instance.baseData.MapID) && !InGuiding()) { CloseImmediately(); return; } DisplayCost(); UpdateInspireType(); } private void OnCoinInspire() private void CoinInspire() { if (!isCoinInspire) if (!coinInspire) { if (model.dungeonCoinInspireCount >= coinInspireCfg.InspireCount) if (model.GetDungeonInspireLevel(3) >= coinInspireConfig.InspireCount) { SysNotifyMgr.Instance.ShowTip("Xjmj_CopperInspireFull"); return; } isCoinInspire = true; isFairyInspire = false; coinInspire = true; fairyInspire = false; } else { isCoinInspire = false; coinInspire = false; } UpdateInspireType(); } private void OnFairyInspire() private void FairyInspire() { if (coinInspireCfg == null) if (coinInspireConfig == null) { return; } isCoinInspire = false; isFairyInspire = !isFairyInspire; coinInspire = false; fairyInspire = !fairyInspire; UpdateInspireType(); } private void OnConfirmBtn() private void Confirm() { if (isFairyInspire) if (fairyInspire) { if (PlayerDatas.Instance.baseData.GoldPaper + PlayerDatas.Instance.baseData.Gold < fairyInspireCfg.MoneyCount && !InFairyLandGuiding()) uint money = 0; switch (fairyInspireConfig.InspireType) { SysNotifyMgr.Instance.ShowTip("Xjmj_InspireNoEnoughFairy"); case 1: money += PlayerDatas.Instance.baseData.Gold; break; case 2: money += PlayerDatas.Instance.baseData.GoldPaper; break; case 5: money = PlayerDatas.Instance.baseData.GoldPaper + PlayerDatas.Instance.baseData.Gold; break; } if (money < model.GetDungeonInspireCost(fairyInspireConfig) && !InGuiding()) { CloseImmediately(); WindowCenter.Instance.Open<RechargeTipWin>(); } else { CA508_tagCMDoFBAction inspirepack = new CA508_tagCMDoFBAction(); inspirepack.ActionType = 0; inspirepack.ActionInfo = (uint)fairyInspireCfg.InspireType; GameNetSystem.Instance.SendInfo(inspirepack); CA508_tagCMDoFBAction pak = new CA508_tagCMDoFBAction(); pak.ActionType = 0; pak.ActionInfo = (uint)fairyInspireConfig.InspireType; GameNetSystem.Instance.SendInfo(pak); } } else if (isCoinInspire) else if (coinInspire) { if (PlayerDatas.Instance.baseData.Silver < coinInspireCfg.MoneyCount && !InFairyLandGuiding()) if (UIHelper.GetMoneyCnt(3) < (ulong)model.GetDungeonInspireCost(coinInspireConfig) && !InGuiding()) { SysNotifyMgr.Instance.ShowTip("Xjmj_InspireNoEnoughGold"); } else { CA508_tagCMDoFBAction inspirepack = new CA508_tagCMDoFBAction(); inspirepack.ActionType = 0; inspirepack.ActionInfo = (uint)coinInspireCfg.InspireType; GameNetSystem.Instance.SendInfo(inspirepack); CA508_tagCMDoFBAction pak = new CA508_tagCMDoFBAction(); pak.ActionType = 0; pak.ActionInfo = (uint)coinInspireConfig.InspireType; GameNetSystem.Instance.SendInfo(pak); } } } private void OnCancelBtn() private void Cancel() { CloseImmediately(); } private void InitData() private void Display() { if (coinInspireCfg != null) { coinInspireInfoText.text = Language.Get("FairyLand_Func9", coinInspireCfg.MoneyCount, coinInspireCfg.InspireCount); } fairyInspireInfoText.text = Language.Get("FairyLand_Func10", fairyInspireCfg.MoneyCount); DisplayCost(); } bool InFairyLandGuiding() private void DisplayCost() { if (NewBieCenter.Instance.inGuiding && NewBieCenter.Instance.currentGuide == GeneralConfig.Instance.fairyLandGuideId) if (coinInspireConfig != null) { m_CoinCost.text = Language.Get("FairyLand_Func9", model.GetDungeonInspireCost(coinInspireConfig), coinInspireConfig.InspireCount); } if (fairyInspireConfig != null) { m_FairyCost.text = Language.Get("FairyLand_Func10", model.GetDungeonInspireCost(fairyInspireConfig)); } } void DisplayRemind() { m_Remind.gameObject.SetActive(fairyInspireConfig != null && fairyInspireConfig.InspireType == 5); } bool InGuiding() { if (NewBieCenter.Instance.inGuiding && NewBieCenter.Instance.currentGuide == GeneralConfig.Instance.fairyLandGuideId) { return true; } @@ -207,11 +240,12 @@ private void UpdateInspireType() { var lv = model.dungeonJadeInspireCount + model.dungeonCoinInspireCount; m_InpsireLvTxt.text = lv == 0 ? Language.Get("FairyLand_Func4") : Language.Get("HaveInspired", StringUtility.Contact("<color=#109d06>", lv * model.dungeonInspireUper, "%</color>")); coinInspireMark.SetActive(isCoinInspire); fairyInspireMark.SetActive(isFairyInspire); var level = model.GetDungeonInspireLevel(); m_InspireLevel.text = level == 0 ? Language.Get("FairyLand_Func4") : Language.Get("HaveInspired", StringUtility.Contact("<color=#109d06>", level * model.GetDungeonInspireUpper(PlayerDatas.Instance.baseData.MapID), "%</color>")); m_CoinInspireCheck.gameObject.SetActive(coinInspire); m_FairyInspireCheck.gameObject.SetActive(fairyInspire); } } System/Dungeon/DungeonModel.cs
@@ -73,17 +73,9 @@ set { m_DungeonResult = value; } } public int dungeonCoinInspireCount { get; private set; } public int dungeonJadeInspireCount { get; private set; } public int dungeonInspireUper { get; private set; } Dictionary<int, int> dungeonInspireCounts = new Dictionary<int, int>();//5-仙玉或绑玉 Dictionary<int, int> dungeonInspireUpperDict = new Dictionary<int, int>(); Dictionary<int, int> dungeonMaxInspireCountDict = new Dictionary<int, int>(); Dungeon m_SelectedKylinDungeon; public Dungeon selectedKylinDungeon { @@ -140,8 +132,7 @@ public void OnBeforePlayerDataInitialize() { dungeonCountRemainTimes.Clear(); dungeonCoinInspireCount = 0; dungeonJadeInspireCount = 0; dungeonInspireCounts.Clear(); } public void OnAfterPlayerDataInitialize() @@ -597,6 +588,7 @@ specialItemCollectRecord = default(Item); dungeonCoolDowns.Clear(); m_Mission = default(DungeonMissionData); dungeonInspireCounts.Clear(); } public void UpdateRecords(HA320_tagMCPlayerFBInfoData.tagMCFBInfo[] _serverInfos) @@ -690,10 +682,9 @@ } } public void UpdateInspireLevel(int coinInspireLv, int jadeInpsireLv) public void UpdateInspireLevel(int type, int count) { dungeonCoinInspireCount = coinInspireLv; dungeonJadeInspireCount = jadeInpsireLv; dungeonInspireCounts[type] = count; if (dungeonInspireLvEvent != null) { dungeonInspireLvEvent(); @@ -1216,22 +1207,35 @@ } } public int GetInspireMaxCount(int _dataMapId) public int GetDungeonInspireLevel(int moneyType = 0)//0代表总等级 { List<DungeonInspireConfig> _list = GetDungeonInspire(_dataMapId); int _maxCnt = 0; if (_list != null) var level = 0; foreach (var key in dungeonInspireCounts.Keys) { for (int i = 0; i < _list.Count; i++) if (moneyType == 0 || moneyType == key) { if (_list[i].InspireType == 2) { _maxCnt = _list[i].InspireCount; break; } level += dungeonInspireCounts[key]; } } return _maxCnt; return level; } public int GetDungeonInspireCost(DungeonInspireConfig config) { var level = GetDungeonInspireLevel(); Equation.Instance.Clear(); Equation.Instance.AddKeyValue("encourageLV", level); return Equation.Instance.Eval<int>(config.MoneyCount); } public int GetDungeonInspireUpper(int mapId) { return dungeonInspireUpperDict.ContainsKey(mapId) ? dungeonInspireUpperDict[mapId] : 0; } public int GetInspireMaxCount(int _dataMapId) { return dungeonMaxInspireCountDict.ContainsKey(_dataMapId) ? dungeonMaxInspireCountDict[_dataMapId] : 0; } public Item GetLackItem(DungeonSuppliesLackWin.LackType lackType) @@ -1363,10 +1367,11 @@ trialDungeonMapList.AddRange(ConfigParse.GetMultipleStr<int>(funcCfg.Numerical1)); } funcCfg = Config.Instance.Get<FuncConfigConfig>("InspireNum"); funcCfg = Config.Instance.Get<FuncConfigConfig>("FBEncourageBuff"); if (funcCfg != null) { dungeonInspireUper = int.Parse(funcCfg.Numerical1); dungeonMaxInspireCountDict = ConfigParse.GetDic<int, int>(funcCfg.Numerical2); dungeonInspireUpperDict = ConfigParse.GetDic<int, int>(funcCfg.Numerical3); } foreach (var _cfg in Config.Instance.GetAllValues<DungeonInspireConfig>()) System/MainInterfacePanel/FeatureNoticeModel.cs
@@ -99,6 +99,7 @@ } if (OpenFuncId != FunctionList[i].FuncId || !RedPointChange) { OpenFuncId = FunctionList[i].FuncId; IsRedPoint = false; TrailerClassification(FunctionList[i].FuncId); } @@ -223,15 +224,18 @@ } } public void WhetherToPlayTheBox() public IEnumerator WhetherToPlayTheBox() { yield return new WaitForSeconds(0.7f); var inDungeon = IsDungeon(); var IsOpenMaininterface = WindowCenter.Instance.CheckOpen<MainInterfaceWin>(); var IsOpenOffLineOnHook = WindowCenter.Instance.CheckOpen<OffLineOnHookWin>(); var treasureModel = ModelCenter.Instance.GetModel<TreasureModel>(); if (NewBieCenter.Instance.inGuiding || treasureModel.newGotShowing || inDungeon || !IsOpenMaininterface || treasureModel.treasureStageUpShow || WindowCenter.Instance.ExitAnyFullScreenOrMaskWin()) || treasureModel.treasureStageUpShow || WindowCenter.Instance.ExitAnyFullScreenOrMaskWin() || IsOpenOffLineOnHook) { return; yield break; } for (int i = 0; i < FunctionList.Count; i++) { @@ -240,15 +244,19 @@ var functionForecastConfig = Config.Instance.Get<FunctionForecastConfig>(FunctionList[i].FuncId); if (functionForecastConfig.FrameLevel <= 0) { return; yield break; } string strKey = "FeatureNotice" + functionForecastConfig.FrameLevel+PlayerDatas.Instance.baseData.PlayerID; string strKey = "FeatureNotice" + functionForecastConfig.FrameLevel + PlayerDatas.Instance.baseData.PlayerID; int type = LocalSave.GetInt(strKey); bool IsOpenMain = WindowCenter.Instance.CheckOpen<MainInterfaceWin>(); if (PlayerDatas.Instance.baseData.LV >= functionForecastConfig.FrameLevel && type == 0) { LocalSave.SetInt(strKey, functionForecastConfig.FrameLevel); WindowCenter.Instance.Open<FeatureNoticeWin>(); var IsOpenFeatureNotice = WindowCenter.Instance.CheckOpen<FeatureNoticeWin>(); if (!IsOpenFeatureNotice) { WindowCenter.Instance.Open<FeatureNoticeWin>(); } } } } System/MainInterfacePanel/FeatureNoticeWin.cs
@@ -370,7 +370,8 @@ } else { string str = ((float)treasure.exp / treasure.treasureStages[funcStage].exp) * 100 + "%"; double dou=Math.Round((double)treasure.exp / treasure.treasureStages[funcStage].exp,2); string str = dou * 100 + "%"; m_Textschedule.text = string.Format(Language.Get("YGYouFB"), str); } } System/MainInterfacePanel/MainInterfaceWin.cs
@@ -343,7 +343,7 @@ m_HighSettingTip.AfterOpen(); m_ChatTip.OnAfterOpen(); HandleAchievement(); featureNoticeModel.WhetherToPlayTheBox(); StartCoroutine(featureNoticeModel.WhetherToPlayTheBox());//功能预告 } protected override void OnPreClose() @@ -892,7 +892,7 @@ ArticleExperience();//关于经验条 if (_tCDBPlayerRefresh == PlayerDataRefresh.LV) { featureNoticeModel.WhetherToPlayTheBox(); StartCoroutine(featureNoticeModel.WhetherToPlayTheBox());//功能预告 } } System/OpenServerActivity/ImpactRankModel.cs
@@ -72,8 +72,8 @@ private void OnRefreshRank(int type) { if (type >= (int)PlayerRankData.RankType.OpenServerLv && type <= (int)PlayerRankData.RankType.OpenServerMount) if (type >= (int)PlayerRankData.RankType.OpenServerStrengthen && type <= (int)PlayerRankData.RankType.OpenServerFightPower) { foreach (var _type in m_Redpoints.Keys) { System/Store/BagStoreWin.cs
@@ -133,6 +133,7 @@ { shopItemCell.stateImage.gameObject.SetActive(true); shopItemCell.stateImage.SetSprite(shopInfo.SalesStatus); shopItemCell.stateImage.SetNativeSize(); } else { System/Store/StoreModel.cs
@@ -39,6 +39,7 @@ public Dictionary<int, string> resetTimeDict { get; private set; } public Dictionary<int, int> showCoinsUIDict { get; private set; } public int[] StoreRedIdlist { get; private set;} bool isLogin = true; public override void Init() { FuncConfigConfig buyItemHinit = Config.Instance.Get<FuncConfigConfig>("BuyItemHinit"); @@ -53,6 +54,8 @@ public void OnBeforePlayerDataInitialize() { IsMustBuyDay = false; isLogin = true; FuncOpen.Instance.OnFuncStateChangeEvent -= FuncStateChange; PlayerDatas.Instance.fairyData.OnRefreshFairyMine -= RefreshServerHour; PlayerDatas.Instance.fairyData.OnRefreshFairyInfo -= RefreshFamilyLv; @@ -80,13 +83,15 @@ FuncOpen.Instance.OnFuncStateChangeEvent += FuncStateChange; RefreshTCBPlayerDataEvent += RefreshPlayerLv; TimeMgr.Instance.OnHourEvent += RefreshServerHour; SetIsMustBuyDay(); shoplist = null; CheckWeekStoreIsShopBuy(out shoplist); ControllerRedPoint(); SetShopRedpoint(); CheckShopRedpoint(); SetJobReplaceIDDict(); UpdateMustBuyRedpoint(); isLogin = false; } public string GetStoreRefreshTimeByType(int type) @@ -132,6 +137,9 @@ switch(type) { case PlayerDataRefresh.LV: CheckShopRedpoint(); UpdateMustBuyRedpoint(); break; case PlayerDataRefresh.VIPLv: case PlayerDataRefresh.Gold: case PlayerDataRefresh.GoldPaper: @@ -232,6 +240,16 @@ private void RefreshServerHour() { ControllerRedPoint(); if (PlayerPrefs.HasKey(MUSTBUYSAVE_KEY)) { int day = LocalSave.GetInt(MUSTBUYSAVE_KEY); if (day != TimeUtility.ServerNow.Day) { IsMustBuyDay = true; LocalSave.SetInt(MUSTBUYSAVE_KEY, TimeUtility.ServerNow.Day); UpdateMustBuyRedpoint(); } } if(!PlayerDatas.Instance.fairyData.HasFairy) { PlayerPrefs.DeleteKey(UNIONSTORESAVE_KEY); @@ -272,7 +290,12 @@ } } CheckShopRedpoint(); if(!isLogin) { CheckShopRedpoint(); UpdateMustBuyRedpoint(); } if (RefreshBuyShopLimitEvent != null) RefreshBuyShopLimitEvent(); } @@ -658,6 +681,7 @@ } SetShopRedpoint(); CheckShopRedpoint(); UpdateMustBuyRedpoint(); } public bool CheckWeekStoreIsShopBuy(out List<StoreConfig> buylist) @@ -814,42 +838,53 @@ foreach(var key in shopRedDict.Keys) { StoreConfig storeConfig = Config.Instance.Get<StoreConfig>(key); if (storeConfig.MoneyNumber == 0) if(!mustIdlist.Contains(storeConfig.ItemID)) { if(CheckShopIsCanBuy(storeConfig)) if (storeConfig.MoneyNumber == 0) { shopRedDict[storeConfig.ID].state = RedPointState.Simple; if (CheckShopIsCanBuy(storeConfig)) { shopRedDict[storeConfig.ID].state = RedPointState.Simple; } else { shopRedDict[storeConfig.ID].state = RedPointState.None; } } else { shopRedDict[storeConfig.ID].state = RedPointState.None; if (CheckScoreStoreIsCanBuy(storeConfig)) { shopRedDict[storeConfig.ID].state = RedPointState.Simple; } else { shopRedDict[storeConfig.ID].state = RedPointState.None; } } } else { if(CheckScoreStoreIsCanBuy(storeConfig)) { shopRedDict[storeConfig.ID].state = RedPointState.Simple; } else { shopRedDict[storeConfig.ID].state = RedPointState.None; } } UpdateMustBuyRedpoint(storeConfig); } } public void UpdateMustBuyRedpoint(StoreConfig storeConfig) public void UpdateMustBuyRedpoint() { if (CheckIsMustBuy(storeConfig)) if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Store)) return; foreach (var key in shopRedDict.Keys) { shopRedDict[storeConfig.ID].state = RedPointState.Simple; } else { shopRedDict[storeConfig.ID].state = RedPointState.None; StoreConfig storeConfig = Config.Instance.Get<StoreConfig>(key); if(mustIdlist.Contains(storeConfig.ItemID)) { if (CheckIsMustBuy(storeConfig)) { shopRedDict[storeConfig.ID].state = RedPointState.Simple; } else { shopRedDict[storeConfig.ID].state = RedPointState.None; } } } } @@ -858,19 +893,41 @@ if(mustIdlist.Contains(storeConfig.ItemID)) { shopRedDict[storeConfig.ID].state = RedPointState.None; IsMustBuyDay = false; } } public bool IsMustBuyDay { get; private set; } public void SetIsMustBuyDay() { if (IsMustBuyDay) return; if (PlayerPrefs.HasKey(MUSTBUYSAVE_KEY)) { int day = LocalSave.GetInt(MUSTBUYSAVE_KEY); if (day != TimeUtility.ServerNow.Day) { IsMustBuyDay = true; LocalSave.SetInt(MUSTBUYSAVE_KEY, TimeUtility.ServerNow.Day); } else { IsMustBuyDay = false; } } else { IsMustBuyDay = true; LocalSave.SetInt(MUSTBUYSAVE_KEY, TimeUtility.ServerNow.Day); } } public List<int> mustIdlist = new List<int>() { 4741}; public bool CheckIsMustBuy(StoreConfig config) { if(mustIdlist.Contains(config.ItemID) && CheckShopIsCanBuy(config)) if(CheckShopIsCanBuy(config) && IsMustBuyDay) { if(IsNewDay(MUSTBUYSAVE_KEY)) { return true; } return true; } return false; } System/Store/StoreWin.cs
@@ -307,6 +307,7 @@ { shopItemCell.stateImage.gameObject.SetActive(true); shopItemCell.stateImage.SetSprite(shopInfo.SalesStatus); shopItemCell.stateImage.SetNativeSize(); } else { System/Treasure/FairyTreasureCollectPanelPattern5.cs
@@ -256,6 +256,7 @@ CameraUtility.ScreenShotCut((Texture2D _tex) => { TreasureStageUpTriggerWin.screenShotCut = _tex; WindowJumpMgr.Instance.ClearJumpData(); WindowCenter.Instance.CloseImmediately<TreasureLevelUpWin>(); WindowCenter.Instance.Open<TreasureStageUpTriggerWin>(true); WindowCenter.Instance.Open<MainInterfaceWin>(); System/Treasure/TreasureLevelUpWin.cs
@@ -1008,9 +1008,9 @@ { TreasureStageUpTriggerWin.screenShotCut = _tex; WindowJumpMgr.Instance.ClearJumpData(); WindowCenter.Instance.Open<MainInterfaceWin>(); CloseImmediately(); WindowCenter.Instance.Open<TreasureStageUpTriggerWin>(true); WindowCenter.Instance.Open<MainInterfaceWin>(); if (WindowCenter.Instance.CheckOpen<DialogueDuidanceWin>()) { WindowCenter.Instance.CloseImmediately<DialogueDuidanceWin>(); Utility/LanguageVerify.cs
@@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Security.Cryptography; using System.Text; using System.Text.RegularExpressions; using UnityEngine; public class LanguageVerify : Singleton<LanguageVerify> @@ -162,6 +163,7 @@ var account = ModelCenter.Instance.GetModel<LoginModel>().sdkLoginResult.account; var playerId = PlayerDatas.Instance.baseData.PlayerID; var playerName = PlayerDatas.Instance.baseData.PlayerName; var ts = System.DateTime.UtcNow - new System.DateTime(1970, 1, 1, 0, 0, 0, 0); var tables = new Dictionary<string, string>(); tables["game_code"] = "snxxz"; @@ -169,7 +171,7 @@ tables["server_name"] = StringUtility.Contact("s", ServerListCenter.Instance.currentServer.region_flag); tables["chat_type"] = 1.ToString(); tables["chat_channel"] = channel.ToString(); tables["chat_content"] = WWW.EscapeURL(UIHelper.TrimContentToServer(content)); tables["chat_content"] = TransferContent(ts.Ticks, content); tables["sender_uid"] = account; tables["sender_rid"] = playerId.ToString(); tables["sender_name"] = UIHelper.ServerStringTrim(playerName); @@ -182,7 +184,6 @@ tables["receiver_level"] = channel == 3 ? (toPlayerLevel == 0 ? string.Empty : toPlayerLevel.ToString()) : string.Empty; tables["receiver_vip_level"] = string.Empty; var ts = System.DateTime.UtcNow - new System.DateTime(1970, 1, 1, 0, 0, 0, 0); tables["timestamp"] = ((long)System.Convert.ToInt64(ts.TotalSeconds)).ToString(); tables["key"] = FileExtersion.GetStringMD5Hash(StringUtility.Contact(Sercret, tables["timestamp"])); @@ -199,7 +200,7 @@ { if (callback != null) { callback(true, response.content); callback(true, DisTransfer(ts.Ticks, response.content)); callback = null; return; } @@ -223,6 +224,97 @@ }); } Dictionary<long, List<string>> transferContents = new Dictionary<long, List<string>>(); List<MatchString> matchs = new List<MatchString>(); const string TransferIdentify = " 0 "; Regex transferRegex = new Regex(TransferIdentify, RegexOptions.Singleline); struct MatchString { public int index; public string value; } void AddMathcs(MatchCollection _matchs) { if (_matchs.Count == 0) { return; } foreach (Match match in _matchs) { matchs.Add(new MatchString() { index = match.Index, value = match.Value, }); } } string TransferContent(long tick, string content) { List<string> list; if (!transferContents.TryGetValue(tick, out list)) { list = new List<string>(); transferContents.Add(tick, list); } list.Clear(); matchs.Clear(); AddMathcs(WordAnalysis.Color_Start_Regex.Matches(content)); AddMathcs(WordAnalysis.Color_End_Regex.Matches(content)); AddMathcs(ImgAnalysis.FaceRegex.Matches(content)); AddMathcs(ChatCtrl.InviteRegex.Matches(content)); AddMathcs(WordAnalysis.Size_Start_Regex.Matches(content)); AddMathcs(WordAnalysis.Size_End_Regex.Matches(content)); AddMathcs(WordAnalysis.Space_Regex.Matches(content)); AddMathcs(ChatCtrl.KillRegex.Matches(content)); matchs.Sort((x, y) => { return x.index.CompareTo(y.index); }); for (int i = 0; i < matchs.Count; i++) { list.Add(matchs[i].value); } content = WordAnalysis.Color_Start_Regex.Replace(content, TransferIdentify); content = WordAnalysis.Color_End_Regex.Replace(content, TransferIdentify); content = ImgAnalysis.FaceRegex.Replace(content, TransferIdentify); content = ChatCtrl.InviteRegex.Replace(content, TransferIdentify); content = WordAnalysis.Size_Start_Regex.Replace(content, TransferIdentify); content = WordAnalysis.Size_End_Regex.Replace(content, TransferIdentify); content = WordAnalysis.Space_Regex.Replace(content, TransferIdentify); content = ChatCtrl.KillRegex.Replace(content, TransferIdentify); return content; } string DisTransfer(long tick, string content) { List<string> list; if (!transferContents.TryGetValue(tick, out list)) { return content; } var stringIndex = 0; var index = 0; s_StringBuilder.Length = 0; foreach (Match match in transferRegex.Matches(content)) { s_StringBuilder.Append(content.Substring(index, match.Index - index)); if (stringIndex < list.Count) { s_StringBuilder.Append(list[stringIndex]); stringIndex++; } index = match.Index + match.Length; } transferContents.Remove(tick); s_StringBuilder.Append(content.Substring(index, content.Length - index)); return s_StringBuilder.ToString(); } bool GetChannel(ChatInfoType type, out int channel) { channel = 0;