Core/NetworkPackage/DTCFile/ServerPack/H01_System/DTC0102_tagCDBPlayer.cs
@@ -26,6 +26,9 @@ DEBUG_STEP = 0; DTC0403_tagPlayerLoginLoadOK.neverLoginOk = true; MapTransferUtility.Instance.lastMoveToWorldBossTime = float.MinValue; MapTransferUtility.Instance.lastMoveToWorldBossNpcID = 0; if (beforePlayerDataInitializeEvent != null) { beforePlayerDataInitializeEvent(); @@ -39,7 +42,6 @@ { Debug.LogError(ex); } if (vNetData.LV == 1) { @@ -188,6 +190,7 @@ { _hero.StopAll(); _hero.InitBornPos(vNetData.PosX, vNetData.PosY); _hero.RequestName(); } } Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0406_tagNPCAppear.cs
@@ -27,6 +27,11 @@ return; } if (BossInfoConfig.IsStone((int)vNetData.NPCID)) { BossFakeLineUtility.Instance.RecordSawStone((int)vNetData.NPCID, PlayerDatas.Instance.baseData.FBID); } if (GA_PlayerXMZZ.xmzzDict.ContainsKey(vNetData.NPCID)) { _actor = GAMgr.Instance.RequestPlayer<GA_PlayerXMZZ>(vNetData.ObjID, E_ActorGroup.Player, vNetData); @@ -37,14 +42,7 @@ if (Config.Instance.ContainKey<WorldBossConfig>((int)vNetData.NPCID)) { WorldBossConfig _worldBoss = Config.Instance.Get<WorldBossConfig>((int)vNetData.NPCID); if (vNetData.NPCID == MapTransferUtility.Instance.lastMoveToWorldBossNpcID) { MapTransferUtility.Instance.lastMoveToWorldBossTime = Time.realtimeSinceStartup; } BossFakeLineUtility.Instance.inMistakeForBossAliveOverTime = Time.realtimeSinceStartup + 61; BossFakeLineUtility.Instance.lastBossNpcID = vNetData.NPCID; BossFakeLineUtility.Instance.RecordSawBoss((int)vNetData.NPCID, PlayerDatas.Instance.baseData.FBID); } if (_npcConfig == null) Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0407_tagNPCDisappear.cs
@@ -38,8 +38,7 @@ if (Config.Instance.ContainKey<WorldBossConfig>(_npcConfig.NPCID)) { BossFakeLineUtility.Instance.inMistakeForBossAliveOverTime = Time.realtimeSinceStartup + 60; BossFakeLineUtility.Instance.lastBossNpcID = (uint)_npcConfig.NPCID; BossFakeLineUtility.Instance.RecordSawBoss(_npcConfig.NPCID,PlayerDatas.Instance.baseData.FBID); } } Core/NetworkPackage/DTCFile/ServerPack/H06_PlayerVsNPC/DTC0608_tagNPCDie.cs
@@ -35,10 +35,9 @@ MapTransferUtility.Instance.lastMoveToWorldBossTime = Time.realtimeSinceStartup + 61; } if (BossFakeLineUtility.Instance.lastBossNpcID == _targetFight.NpcConfig.NPCID) if (BossFakeLineUtility.Instance.recordBossId == _targetFight.NpcConfig.NPCID) { BossFakeLineUtility.Instance.lastBossNpcID = 0; BossFakeLineUtility.Instance.inMistakeForBossAliveOverTime = Time.realtimeSinceStartup - 61; BossFakeLineUtility.Instance.ClearBossRecord(); } if (_targetFight.NpcConfig.IsBoss > 1 && vNetData.KillerID == PlayerDatas.Instance.baseData.PlayerID) Fight/BossFakeLineUtility.cs
@@ -24,9 +24,9 @@ DTC0102_tagCDBPlayer.switchAccountEvent += OnAccountSwitch; } //这个值在初见boss和最后看见boss的时候记录,其值为time.time+1分钟,这段时间内告诉玩家其所在分线的boss的死亡情况,否则告诉玩家公共boss的死亡情况。 public uint lastBossNpcID; public float inMistakeForBossAliveOverTime = 0f; public int recordBossId { get { return bossSawRecorder.npcId; } } NpcSawRecorder bossSawRecorder = new NpcSawRecorder(); NpcSawRecorder stoneSawRecorder = new NpcSawRecorder(); public bool IsShuntBoss(int _bossId) { @@ -68,29 +68,47 @@ } } public void RecordSawStone(int npcId, int lineId) { stoneSawRecorder.Record(npcId, lineId, Time.realtimeSinceStartup); } public bool HasSawLineStoneRecently(int bossId, int lineId) { var config = Config.Instance.Get<BossInfoConfig>(bossId); if (config == null) if (config != null) { return stoneSawRecorder.HasSawRecently(config.StoneNPCID, lineId, 60); } else { return false; } } var stoneId = config.StoneNPCID; public void ClearStoneRecord() { stoneSawRecorder.Clear(); } //补充具体逻辑 public void RecordSawBoss(int bossId, int lineId) { bossSawRecorder.Record(bossId, lineId, Time.realtimeSinceStartup); } return false; public bool HasSawBossRecently(int bossId) { return stoneSawRecorder.HasSawRecently(bossId, 60); } public bool HasSawLineBossRecently(int bossId, int lineId) { var isMistakeBoss = lastBossNpcID == bossId && Time.realtimeSinceStartup < inMistakeForBossAliveOverTime; return bossSawRecorder.HasSawRecently(bossId, lineId, 60); } //补充具体逻辑 return false; public void ClearBossRecord() { bossSawRecorder.Clear(); } FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } } @@ -146,7 +164,77 @@ private void OnAccountSwitch() { m_MakeFakeLineTimes = 0; bossKillTimes.Clear(); ClearBossRecord(); ClearStoneRecord(); } class NpcSawRecorder { public int npcId { get; private set; } int m_LineId = -1; public int lineId { get { return m_LineId; } private set { m_LineId = value; } } float m_Time = -99999; public float time { get { return m_Time; } private set { m_Time = value; } } public void Record(int npcId, int lineId, float time) { this.npcId = npcId; this.lineId = lineId; this.time = time; } public void Clear() { this.npcId = 0; this.lineId = -1; this.time = -99999; } public bool HasSawRecently(int npcId, float second) { if (this.npcId != npcId) { return false; } if (Time.realtimeSinceStartup - this.time > 60) { return false; } return true; } public bool HasSawRecently(int npcId, int lineId, float second) { if (this.npcId != npcId) { return false; } if (this.lineId != lineId) { return false; } if (Time.realtimeSinceStartup - this.time > 60) { return false; } return true; } } } Fight/GameActor/GA_NpcCollect.cs
@@ -345,7 +345,6 @@ { PlayerTaskDatas _model = ModelCenter.Instance.GetModel<PlayerTaskDatas>(); m_CanCollect = _model.IsGather(NpcConfig.NPCID); Debug.LogFormat("Npc: {0} 是否可以采集: {1}", NpcConfig.NPCID, m_CanCollect); } if (!m_CanCollect) Fight/GameActor/GA_NpcFunc.cs
@@ -99,7 +99,7 @@ float _distSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, Pos); if (_distSqrt > Mathf.Pow(GeneralConfig.Instance.CloseNpcDist + NpcConfig.ModelRadius + 0.4f, 2)) { MapTransferUtility.Instance.MoveToNPC(NpcConfig.NPCID); MapTransferUtility.Instance.MoveToNPC(NpcConfig.NPCID, (int)ServerInstID); } else { Fight/MapTransferUtility.cs
@@ -180,8 +180,22 @@ } } public void MoveToNPC(int npcID) public void MoveToNPC(int npcID, int sid = 0) { if (sid != 0) { GActor _actor = GAMgr.Instance.GetBySID((uint)sid); if (_actor != null) { NpcID = npcID; MapTransferDoType = E_MapTransferDoType.Npc; MoveToExistNpc(npcID, _actor); return; } } NPCConfig _config = Config.Instance.Get<NPCConfig>(npcID); if (_config == null) @@ -350,22 +364,21 @@ } else { //Debug.LogFormat(" |-- 在本地图"); if (PlayerDatas.Instance.baseData.FBID != 0) { if (BossFakeLineUtility.Instance.IsShuntBoss(npcID)) { //Debug.LogFormat(" |-- BossFakeLineUtility.Instance.makeFakeLineTimes = 1"); BossFakeLineUtility.Instance.makeFakeLineTimes = 1; } } //Debug.LogFormat(" |-- 在本地图"); // Debug.LogFormat("lastMoveToWorldBossNpcID: {0}, Time: {1}, FBID: {2}, showFakeLine: {3}, FairyBoss: {4}", // lastMoveToWorldBossNpcID, // Time.realtimeSinceStartup - lastMoveToWorldBossTime, // PlayerDatas.Instance.baseData.FBID, // BossFakeLineUtility.Instance.showFakeLine, // _fairyBossModel.bosses != null // && _fairyBossModel.bosses.Contains(npcID)); if (((lastMoveToWorldBossNpcID == npcID && Time.realtimeSinceStartup - lastMoveToWorldBossTime < 60) && PlayerDatas.Instance.baseData.FBID == 0) || BossFakeLineUtility.Instance.showFakeLine || (_fairyBossModel.bosses != null && _fairyBossModel.bosses.Contains(npcID))) && Time.realtimeSinceStartup - lastMoveToWorldBossTime < 60) && PlayerDatas.Instance.baseData.FBID == 0) || BossFakeLineUtility.Instance.showFakeLine || (_fairyBossModel.bosses != null && _fairyBossModel.bosses.Contains(npcID))) { //Debug.LogFormat(" |-- 非想去的boss为60秒内行为产生且为同一只boss, {0}, {1}", BossFakeLineUtility.Instance.showFakeLine, //PlayerDatas.Instance.baseData.FBID); @@ -375,9 +388,14 @@ else { // 处于相同地图 if (BossFakeLineUtility.Instance.lastBossNpcID != npcID || Time.realtimeSinceStartup - BossFakeLineUtility.Instance.inMistakeForBossAliveOverTime > 60) if (!BossFakeLineUtility.Instance.HasSawBossRecently(npcID)) { if (BossFakeLineUtility.Instance.IsShuntBoss(npcID)) { //Debug.LogFormat(" |-- BossFakeLineUtility.Instance.makeFakeLineTimes = 1"); BossFakeLineUtility.Instance.makeFakeLineTimes = 1; } //Debug.LogFormat(" |-- 非想去的boss记录,或则见到boss时差超过60秒"); Send_WorldTransfer(_npcLocation.mapId, new Vector3(_hero.Pos.x * 2, 0, _hero.Pos.z * 2), MapTransferType.WorldTransport, 0, npcID); } @@ -459,111 +477,115 @@ { _npc = GAMgr.Instance.GetCloserNPC(_hero.Pos, npcID); // 目标点, 默认为主角坐标, 找不到任务终点的时候不移动 Vector3 _destPos = _hero.Pos; MoveToExistNpc(npcID, _npc); } } // 计算当前坐标与目标角色的坐标差 //GActor _npc = GAMgr.Instance.GetCloserNPC(_hero.Pos, npcID); //// 如果在当前地图找得到已创建出来最近的目标 //if (_npc != null) //{ // _destPos = _npc.Pos; //} //else //{ Vector2 _calculPos = _destPos; if (_findLocation) private void MoveToExistNpc(int npcID, GActor npc) { GA_Hero _hero = PlayerDatas.Instance.hero; NPCConfig _config = Config.Instance.Get<NPCConfig>(npcID); // 目标点, 默认为主角坐标, 找不到任务终点的时候不移动 Vector3 _destPos = _hero.Pos; // 获取NPC位置数据 GAStaticDefine.NPCLocation _npcLocation; var _findLocation = GAStaticDefine.TryGetMapNPCLocation(npcID, out _npcLocation); Vector2 _calculPos = _destPos; if (_findLocation) { _calculPos = _npcLocation.position; } _destPos = new Vector3(_calculPos.x, _hero.Pos.y, _calculPos.y); //} // 判断距离 float _distSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, _destPos); // 判断是否需要骑马移动 if (_distSqrt > Mathf.Pow(7, 2)) { DTC0428_tagPlayerRideHorse.Send_tagPlayerRideHorse(true); } float _chkDist = Mathf.Max(GeneralConfig.Instance.CloseNpcDist + _config.ModelRadius - 0.3f, 0); if (_config.NPCType == (int)E_NpcType.OpenWorldMap) { _chkDist = 1; } // 针对挖洞对象保持距离为0 if (npc != null && _config.Dig == 1) { _chkDist = 0; } // 大于配置的距离, 移动至 if (_distSqrt > Mathf.Pow(_chkDist, 2)) { if (_config.NPCType == (int)E_NpcType.Fight) { _calculPos = _npcLocation.position; _hero.MoveToPosition(_destPos, _npcLocation.scope); } _destPos = new Vector3(_calculPos.x, _hero.Pos.y, _calculPos.y); //} // 判断距离 float _distSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, _destPos); // 判断是否需要骑马移动 if (_distSqrt > Mathf.Pow(7, 2)) else { DTC0428_tagPlayerRideHorse.Send_tagPlayerRideHorse(true); if (npc != null) { _destPos = npc.Pos; } _hero.MoveToPosition(_destPos, _chkDist); } float _chkDist = Mathf.Max(GeneralConfig.Instance.CloseNpcDist + _config.ModelRadius - 0.3f, 0); if (_config.NPCType == (int)E_NpcType.OpenWorldMap) if (s_OnHeroStartMoveToNPC != null) { _chkDist = 1; s_OnHeroStartMoveToNPC(); } // 针对挖洞对象保持距离为0 if (_npc != null && _config.Dig == 1) { _chkDist = 0; } // 大于配置的距离, 移动至 if (_distSqrt > Mathf.Pow(_chkDist, 2)) } // 小于距离则判断目标的类型,执行相应的逻辑 else { if (_config != null) { if (_config.NPCType == (int)E_NpcType.Fight) { _hero.MoveToPosition(_destPos, _npcLocation.scope); _hero.Behaviour.StartHandupAI(); } else if (_config.NPCType == (int)E_NpcType.Collect) { GA_NpcCollect _collect = npc as GA_NpcCollect; if (_collect != null) { _collect.Arrive(); } } else { if (_npc != null) // 如果目标已经在之前搜索中确定了 // 没确定其实在这里应该是异常情况 if (npc != null) { _destPos = _npc.Pos; } _hero.LockTarget = npc; _hero.SelectTarget = npc; _hero.MoveToPosition(_destPos, _chkDist); } NPCInteractProcessor.InvokeEvent((E_NpcType)_config.NPCType, npcID, npc.ServerInstID); if (s_OnHeroStartMoveToNPC != null) { s_OnHeroStartMoveToNPC(); } } // 小于距离则判断目标的类型,执行相应的逻辑 else { if (_config != null) { if (_config.NPCType == (int)E_NpcType.Fight) { _hero.Behaviour.StartHandupAI(); } else if (_config.NPCType == (int)E_NpcType.Collect) { GA_NpcCollect _collect = _npc as GA_NpcCollect; if (_collect != null) Vector3 _npc2heroDir = MathUtility.ForwardXZ(npc.Pos, _hero.Pos); if (_config.AutomaticFace == 1) { _collect.Arrive(); npc.Forward = -_npc2heroDir; } _hero.Forward = _npc2heroDir; } // 会有为空的时候, 例如是小飞鞋飞的情况, 这里直接判断与配置的坐标的距离 else { // 如果目标已经在之前搜索中确定了 // 没确定其实在这里应该是异常情况 if (_npc != null) { _hero.LockTarget = _npc; _hero.SelectTarget = _npc; NPCInteractProcessor.InvokeEvent((E_NpcType)_config.NPCType, npcID, _npc.ServerInstID); Vector3 _npc2heroDir = MathUtility.ForwardXZ(_npc.Pos, _hero.Pos); if (_config.AutomaticFace == 1) { _npc.Forward = -_npc2heroDir; } _hero.Forward = _npc2heroDir; } // 会有为空的时候, 例如是小飞鞋飞的情况, 这里直接判断与配置的坐标的距离 else { } } } } @@ -885,6 +907,15 @@ } else if (_npcConfig.NPCType == (int)E_NpcType.Collect) { float _chkDist = GeneralConfig.Instance.CloseNpcDist + _npcConfig.ModelRadius + 0.3f; if (_chkDistSqrt <= Mathf.Pow(_chkDist, 2)) { if (!UserInputHandler.isTouched && (_hero.SkillMgr.CurCastSkill == null || _hero.SkillMgr.CurCastSkill.SkillCompelete)) { NPCInteractProcessor.InvokeEvent(E_NpcType.Func, NpcID, _npc.ServerInstID); } } } else { System/Chat/ChatCtrl.cs
@@ -277,7 +277,7 @@ { isDirty = DirtyWordConfig.IsDirtWord(msg); msg = DirtyWordConfig.IsDirtWord(msg, '*'); var length = msg.Length; var length = GetChatMessageLength(msg); if (length > CHAT_INFO_CNT) { MessageWin.Inst.ShowFixedTip(Language.Get("L1014")); @@ -381,6 +381,13 @@ }); } int GetChatMessageLength(string message) { message = WordAnalysis.Color_Start_Regex.Replace(message, string.Empty); message = WordAnalysis.Color_End_Regex.Replace(message, string.Empty); return message.Length; } bool CheckEmptyChat(string msg) { if (string.IsNullOrEmpty(msg.Replace(" ", string.Empty))) System/Dogz/DogzWin.cs
@@ -21,6 +21,7 @@ [SerializeField] FunctionButton functionButtonStrengthen; [SerializeField] FunctionButtonGroup funcBtnGroup; GodBeastModel beastModel { get { return ModelCenter.Instance.GetModel<GodBeastModel>(); } } DogzModel dogzModel { get { return ModelCenter.Instance.GetModel<DogzModel>(); } } protected override void BindController() { @@ -46,11 +47,29 @@ { dogzModel.SetDefaultSelectDogz(); } else { if(dogzModel.presentSelectDogz == 0) { dogzModel.SetDefaultSelectDogz(); } } } protected override void OnActived() { base.OnActived(); if(!WindowJumpMgr.Instance.IsJumpState && functionOrder == 0) { if(dogzModel.dogzFuncRedpoint.state != RedPointState.None) { functionOrder = functionButtonDogz.order; } else if(beastModel.redPointStre1.state != RedPointState.None) { functionOrder = functionButtonStrengthen.order; } } funcBtnGroup.TriggerByOrder(functionOrder); } @@ -86,14 +105,14 @@ private void OnDogzStrengthen() { CloseChild(); functionOrder = 1; functionOrder = functionButtonStrengthen.order; WindowCenter.Instance.Open<GodBeastReinforcementWin>(); } private void OnDogz() { CloseChild(); functionOrder = 0; functionOrder = functionButtonDogz.order; WindowCenter.Instance.Open<DogzActiveWin>(); } System/DogzDungeon/DogzDungeonModel.cs
@@ -339,7 +339,7 @@ private void UpdateRedpoint() { if (FuncOpen.Instance.IsFuncOpen(138)) if (!FuncOpen.Instance.IsFuncOpen(138)) { redpoint.count = 0; } System/Dungeon/DungeonAncientTargetWin.cs
@@ -7,7 +7,7 @@ { public class DungeonAncientTargetWin : Window { //[SerializeField] List<Text> m_DungeonTargets; [SerializeField] Text m_DungeonName; [SerializeField] DungeonTargetBehaviour m_DungeonTargetBehaviour; DungeonModel m_Model; @@ -40,6 +40,8 @@ protected override void OnPreOpen() { //model.updateMissionEvent += UpdateTargets; var line = PlayerDatas.Instance.baseData.FBID + 1; m_DungeonName.text = StringUtility.Contact(Language.Get("AncientBattle"), "(", Language.Get("FBLine", line), ")"); m_DungeonTargetBehaviour.Init(31160); //UpdateTargets(); } System/FriendSystem/New/FriendsModel.cs
@@ -146,7 +146,11 @@ { foreach(var value in _groupDict[(byte)groupType].Values) { SendChatInfoToPlayer((int)value.PlayerID,UIHelper.ServerStringTrim(value.PlayerName),value.LV,info); if (_socialPlayerDict.ContainsKey(value.PlayerID)) { FriendPlayer friendPlayer = _socialPlayerDict[value.PlayerID]; SendChatInfoToPlayer((int)friendPlayer.PlayerID, UIHelper.ServerStringTrim(friendPlayer.PlayerName), friendPlayer.LV, info); } } } } System/KnapSack/Logic/BoxInfoWin.cs
@@ -322,7 +322,16 @@ if(itemTipsModel.curAttrData.itemConfig.MaxSkillCnt > 0) { promptText.gameObject.SetActive(true); promptText.text = Language.Get("BoxUseCntTip",StringUtility.Contact(useCnt, "/", itemTipsModel.curAttrData.itemConfig.MaxSkillCnt)); promptText.text = Language.Get("BoxUseCntTip", StringUtility.Contact(useCnt, "/", itemTipsModel.curAttrData.itemConfig.MaxSkillCnt)); if (useCnt < itemTipsModel.curAttrData.itemConfig.MaxSkillCnt) { promptText.color = UIHelper.s_DarkGreenColor; } else { promptText.color = UIHelper.s_DarkRedColor; } } else { @@ -337,6 +346,8 @@ yield return null; //this.transform.localScale = Vector3.one; //itemTipsModel.SetCommonTipPos(bgObj); bottomPart.gameObject.SetActive(false); bottomPart.gameObject.SetActive(true); bgObj.localPosition = Vector3.zero; tipAlpha.alpha = 1; } System/KnapSack/Logic/ItemInfoWin.cs
@@ -111,6 +111,7 @@ protected override void OnAfterOpen() { this.transform.SetAsLastSibling(); } protected override void OnPreClose() @@ -339,6 +340,14 @@ { promptText.gameObject.SetActive(true); promptText.text = Language.Get("BoxUseCntTip", StringUtility.Contact(useCnt, "/", itemTipsModel.curAttrData.itemConfig.MaxSkillCnt)); if (useCnt < itemTipsModel.curAttrData.itemConfig.MaxSkillCnt) { promptText.color = UIHelper.s_DarkGreenColor; } else { promptText.color = UIHelper.s_DarkRedColor; } } else { @@ -351,6 +360,8 @@ IEnumerator SetPanelScale() { yield return null; bottomPart.gameObject.SetActive(false); bottomPart.gameObject.SetActive(true); //itemTipsModel.SetCommonTipPos(bgObj); //this.transform.localScale = Vector3.one; tipAlpha.alpha = 1;