Core/GameEngine/DataToCtl/PackageRegedit.cs
@@ -11,6 +11,9 @@ public static void Init() { // 登记相应的数据体及对应的数据转逻辑类 Register(typeof(HA326_tagMCNPCIDCollectionCntInfo), typeof(DTCA326_tagMCNPCIDCollectionCntInfo)); Register(typeof(HA904_tagGCDogzNPCRefreshTime), typeof(DTCA904_tagGCDogzNPCRefreshTime)); Register(typeof(HA714_tagMCNPCCntList), typeof(DTCA714_tagMCNPCCntList)); Register(typeof(HAB04_tagMCBossRebornInfo), typeof(DTCAB04_tagMCBossRebornInfo)); Register(typeof(HA40B_tagGCPlayerJoinFamilyWarInfo), typeof(DTCA40B_tagGCPlayerJoinFamilyWarInfo)); Register(typeof(HA319_tagMCPackDownloadRecord), typeof(DTCA319_tagMCPackDownloadRecord)); Core/NetworkPackage/ClientPack/ClientToMapServer/CA2_Interaction/CA227_tagCMQueryNPCCntInfo.cs
New file @@ -0,0 +1,29 @@ using UnityEngine; using System.Collections; // A2 27 查询地图NPC数量信息 #tagCMQueryNPCCntInfo public class CA227_tagCMQueryNPCCntInfo : GameNetPackBasic { public uint MapID; // 目标地图ID public ushort LineID; // 线路ID public byte IsNoTimeLimit; //是否没有查询时间限制,默认有限制 public byte NPCIDListLen; public string NPCIDList; // 需要查询的NPCID列表 public CA227_tagCMQueryNPCCntInfo() { combineCmd = (ushort)0x03FE; _cmd = (ushort)0xA227; } public override void WriteToBytes() { WriteBytes(MapID, NetDataType.DWORD); WriteBytes(LineID, NetDataType.WORD); WriteBytes(IsNoTimeLimit, NetDataType.BYTE); WriteBytes(NPCIDListLen, NetDataType.BYTE); WriteBytes(NPCIDList, NetDataType.Chars, NPCIDListLen); } } Core/NetworkPackage/ClientPack/ClientToMapServer/CA2_Interaction/CA227_tagCMQueryNPCCntInfo.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: cd1ae837bd2fb0740a2eebd1bd12e4bf timeCreated: 1534765562 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA326_tagMCNPCIDCollectionCntInfo.cs
New file @@ -0,0 +1,35 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Monday, August 20, 2018 //-------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using Snxxz.UI; public class DTCA326_tagMCNPCIDCollectionCntInfo : DtcBasic { DogzDungeonModel model { get { return ModelCenter.Instance.GetModel<DogzDungeonModel>(); } } public override void Done(GameNetPackBasic vNetPack) { base.Done(vNetPack); var package = vNetPack as HA326_tagMCNPCIDCollectionCntInfo; for (int i = 0; i < package.NPCCollCntList.Length; i++) { var collect = package.NPCCollCntList[i]; if (collect.NPCID == 9999) { model.bigBoxCollectCount = collect.CollectionCnt; } } } } Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA326_tagMCNPCIDCollectionCntInfo.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 9fffd651589b82c46a6274d6209639b8 timeCreated: 1534766485 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3B7_tagMCBOSSAttactCnt.cs
@@ -14,6 +14,7 @@ { WorldBossModel worldBossModel { get { return ModelCenter.Instance.GetModel<WorldBossModel>(); } } BossHomeModel bossHomeModel { get { return ModelCenter.Instance.GetModel<BossHomeModel>(); } } DogzDungeonModel dogzDungeonModel { get { return ModelCenter.Instance.GetModel<DogzDungeonModel>(); } } public override void Done(GameNetPackBasic vNetPack) { @@ -32,6 +33,9 @@ case 1: bossHomeModel.wearyValue = info.KillCnt; break; case 2: dogzDungeonModel.wearyValue = info.KillCnt; break; } } } Core/NetworkPackage/DTCFile/ServerPack/HA7_Interaction/DTCA714_tagMCNPCCntList.cs
New file @@ -0,0 +1,28 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Monday, August 20, 2018 //-------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using Snxxz.UI; public class DTCA714_tagMCNPCCntList : DtcBasic { DogzDungeonModel model { get { return ModelCenter.Instance.GetModel<DogzDungeonModel>(); } } public override void Done(GameNetPackBasic vNetPack) { base.Done(vNetPack); var package = vNetPack as HA714_tagMCNPCCntList; model.UpdateMonsterSurplusInfo(package); } } Core/NetworkPackage/DTCFile/ServerPack/HA7_Interaction/DTCA714_tagMCNPCCntList.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 3fe7c73d652077745ac6d4ff21662559 timeCreated: 1534765878 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Core/NetworkPackage/DTCFile/ServerPack/HA9_Function/DTCA904_tagGCDogzNPCRefreshTime.cs
New file @@ -0,0 +1,27 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Monday, August 20, 2018 //-------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using Snxxz.UI; public class DTCA904_tagGCDogzNPCRefreshTime : DtcBasic { DogzDungeonModel model { get { return ModelCenter.Instance.GetModel<DogzDungeonModel>(); } } public override void Done(GameNetPackBasic vNetPack) { base.Done(vNetPack); var package = vNetPack as HA904_tagGCDogzNPCRefreshTime; model.UpdateBoxOrGuardRefreshTime(package); } } Core/NetworkPackage/DTCFile/ServerPack/HA9_Function/DTCA904_tagGCDogzNPCRefreshTime.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 46d9553ef31c5d041a1c7fe24e4101b3 timeCreated: 1534766114 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Core/NetworkPackage/ServerPack/HA3_Function/HA326_tagMCNPCIDCollectionCntInfo.cs
New file @@ -0,0 +1,34 @@ using UnityEngine; using System.Collections; // A3 26 NPCID已采集次数信息 #tagMCNPCIDCollectionCntInfo public class HA326_tagMCNPCIDCollectionCntInfo : GameNetPackBasic { public byte CollNPCCnt; //采集NPC记录数 public tagMCNPCIDCollectionCnt[] NPCCollCntList = null; // 采集NPC次数记录列表 public HA326_tagMCNPCIDCollectionCntInfo() { _cmd = (ushort)0xA326; } public override void ReadFromBytes(byte[] vBytes) { TransBytes(out CollNPCCnt, vBytes, NetDataType.BYTE); NPCCollCntList = new tagMCNPCIDCollectionCnt[CollNPCCnt]; for (int i = 0; i < CollNPCCnt; i++) { NPCCollCntList[i] = new tagMCNPCIDCollectionCnt(); TransBytes(out NPCCollCntList[i].NPCID, vBytes, NetDataType.DWORD); TransBytes(out NPCCollCntList[i].CollectionCnt, vBytes, NetDataType.BYTE); } } public struct tagMCNPCIDCollectionCnt { public uint NPCID; //NPCID public byte CollectionCnt; //已采集次数 } } Core/NetworkPackage/ServerPack/HA3_Function/HA326_tagMCNPCIDCollectionCntInfo.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 9503ba9edfa7bc648b1a7ceef6d73f09 timeCreated: 1534766369 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Core/NetworkPackage/ServerPack/HA7_Interaction/HA714_tagMCNPCCntList.cs
New file @@ -0,0 +1,36 @@ using UnityEngine; using System.Collections; // A7 14 通知查询的NPC数量 #tagMCNPCCntList public class HA714_tagMCNPCCntList : GameNetPackBasic { public uint MapID; public byte NPCInfoCnt; public tagMCNPCCntInfo[] NPCInfoList = null; public HA714_tagMCNPCCntList() { _cmd = (ushort)0xA714; } public override void ReadFromBytes(byte[] vBytes) { TransBytes(out MapID, vBytes, NetDataType.DWORD); TransBytes(out NPCInfoCnt, vBytes, NetDataType.BYTE); NPCInfoList = new tagMCNPCCntInfo[NPCInfoCnt]; for (int i = 0; i < NPCInfoCnt; i++) { NPCInfoList[i] = new tagMCNPCCntInfo(); TransBytes(out NPCInfoList[i].NPCID, vBytes, NetDataType.DWORD); TransBytes(out NPCInfoList[i].Cnt, vBytes, NetDataType.DWORD); } } public struct tagMCNPCCntInfo { public uint NPCID; public uint Cnt; } } Core/NetworkPackage/ServerPack/HA7_Interaction/HA714_tagMCNPCCntList.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: bf9b9299398fb9a458800aa77445fc16 timeCreated: 1534765697 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Core/NetworkPackage/ServerPack/HA9_Function/HA904_tagGCDogzNPCRefreshTime.cs
New file @@ -0,0 +1,34 @@ using UnityEngine; using System.Collections; // A9 04 通知神兽副本NPC刷新时间 #tagGCDogzNPCRefreshTime public class HA904_tagGCDogzNPCRefreshTime : GameNetPackBasic { public byte Cnt; //信息个数 public tagDogzTimeInfoObj[] InfoList = null; //信息列表 public HA904_tagGCDogzNPCRefreshTime() { _cmd = (ushort)0xA904; } public override void ReadFromBytes(byte[] vBytes) { TransBytes(out Cnt, vBytes, NetDataType.BYTE); InfoList = new tagDogzTimeInfoObj[Cnt]; for (int i = 0; i < Cnt; i++) { InfoList[i] = new tagDogzTimeInfoObj(); TransBytes(out InfoList[i].NPCID, vBytes, NetDataType.DWORD); TransBytes(out InfoList[i].RefreshSecond, vBytes, NetDataType.DWORD); } } public struct tagDogzTimeInfoObj { public uint NPCID; // npcid public uint RefreshSecond; // 刷新倒计时, 秒 } } Core/NetworkPackage/ServerPack/HA9_Function/HA904_tagGCDogzNPCRefreshTime.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: a6d61160de2d3074dbcaade643da682c timeCreated: 1534766033 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/DogzDungeon/DogzBoxBehaviour.cs
@@ -19,7 +19,8 @@ public void Display() { UI3DModelExhibition.Instance.BeginShowNPC(999, Vector3.zero, m_RawImage); timer = 0f; UI3DModelExhibition.Instance.BeginShowNPC(model.bigBoxNpcId, Vector3.zero, m_RawImage); DisplayBoxSurplusInfo(); model.boxSurplusChangeEvent += OnBoxInfoUpdate; } @@ -44,6 +45,17 @@ m_SmallBoxCount.color = UIHelper.GetUIColor(boxInfo.smallBoxSurplus > 0 ? TextColType.White : TextColType.Red); } float timer = 0f; private void LateUpdate() { timer += Time.deltaTime; if (timer > 30) { timer = 0f; model.RequestBoxSurplusInfo(); } } } } System/DogzDungeon/DogzDungeonModel.cs
@@ -73,6 +73,10 @@ FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } } public int bigBoxNpcId = 0; public int smallBoxNpcId = 0; public List<int> eliteMonsters = new List<int>(); public override void Init() { } @@ -86,9 +90,14 @@ return bosses.TryGetValue(_bossId, out _data); } public List<int> GetBosses() public List<int> GetNpcIds() { return new List<int>(bosses.Keys); var npcIds = new List<int>(); npcIds.Add(bigBoxNpcId); npcIds.Add(eliteMonsters[0]); npcIds.AddRange(bosses.Keys); return npcIds; } public int GetRecommendBoss() @@ -126,20 +135,97 @@ return bosses.ContainsKey(_bossId) && bosses[_bossId].isUnLocked; } public void UpdateBoxSurplusInfo() public void RequestBoxSurplusInfo() { if (boxSurplusChangeEvent != null) { boxSurplusChangeEvent(); } var sendInfo = new CA227_tagCMQueryNPCCntInfo(); sendInfo.MapID = DATA_MAPID; sendInfo.LineID = 0; sendInfo.NPCIDList = string.Format("[{0},{1}]", bigBoxNpcId, smallBoxNpcId); GameNetSystem.Instance.SendInfo(sendInfo); } public void UpdateEliteSurplusInfo() public void RequestEliteSurplusInfo() { if (eliteSurplusChangeEvent != null) var sendInfo = new CA227_tagCMQueryNPCCntInfo(); sendInfo.MapID = DATA_MAPID; sendInfo.LineID = 0; var stringArray = new string[eliteMonsters.Count]; for (int i = 0; i < stringArray.Length; i++) { eliteSurplusChangeEvent(); stringArray[i] = eliteMonsters[i].ToString(); } sendInfo.NPCIDList = string.Format("[{0}]", string.Join(",", stringArray)); GameNetSystem.Instance.SendInfo(sendInfo); } public void UpdateMonsterSurplusInfo(HA714_tagMCNPCCntList _npcInfoes) { if (_npcInfoes.MapID != DATA_MAPID) { return; } var updatedBox = false; var updatedElite = false; var eliteMonsterSurplus = 0; for (int i = 0; i < _npcInfoes.NPCInfoList.Length; i++) { var npcInfo = _npcInfoes.NPCInfoList[i]; if (npcInfo.NPCID == bigBoxNpcId) { dogzDungeonBox.bigBoxSurplus = (int)npcInfo.Cnt; updatedBox = true; } if (npcInfo.NPCID == smallBoxNpcId) { dogzDungeonBox.smallBoxSurplus = (int)npcInfo.Cnt; updatedBox = true; } if (eliteMonsters.Contains((int)npcInfo.NPCID)) { eliteMonsterSurplus += (int)npcInfo.Cnt; updatedElite = true; } } if (updatedBox) { if (boxSurplusChangeEvent != null) { boxSurplusChangeEvent(); } } if (updatedElite) { dogzDungeonGuard.guardSurplus = eliteMonsterSurplus; if (eliteSurplusChangeEvent != null) { eliteSurplusChangeEvent(); } } } public void UpdateBoxOrGuardRefreshTime(HA904_tagGCDogzNPCRefreshTime _refreshTimes) { for (int i = 0; i < _refreshTimes.InfoList.Length; i++) { var info = _refreshTimes.InfoList[i]; if (bigBoxNpcId == info.NPCID || smallBoxNpcId == info.NPCID) { dogzDungeonBox.UpdateBoxRefreshTime((int)info.RefreshSecond); RequestBoxSurplusInfo(); } if (eliteMonsters.Contains((int)info.NPCID)) { dogzDungeonGuard.UpdateGuardInfo((int)info.RefreshSecond); RequestEliteSurplusInfo(); } } } @@ -148,8 +234,22 @@ var configs = ConfigManager.Instance.GetAllValues<DogzDungeonConfig>(); foreach (var config in configs) { bosses[config.NPCID] = new DogzDungeonBossData(config.NPCID); sortedBossIds.Add(config.NPCID); switch (config.MonsterType) { case 1: bigBoxNpcId = config.NPCID; break; case 2: smallBoxNpcId = config.NPCID; break; case 3: eliteMonsters.Add(config.NPCID); break; case 4: bosses[config.NPCID] = new DogzDungeonBossData(config.NPCID); sortedBossIds.Add(config.NPCID); break; } } sortedBossIds.Sort(DogzDungeonBossData.LevelCompare); @@ -160,22 +260,34 @@ { public int bigBoxSurplus; public int smallBoxSurplus; public DateTime refreshTime { get; private set; } public void UpdateBoxInfo(int _big, int _small) { bigBoxSurplus = _big; smallBoxSurplus = _small; } public void UpdateBoxRefreshTime(int _seconds) { refreshTime = DateTime.Now + new TimeSpan(_seconds * TimeSpan.TicksPerSecond); } } public class DogzDungeonGuard { public int guardSurplus; public DateTime refreshTime { get; private set; } public void UpdateGuardInfo(int _surplus) { guardSurplus = _surplus; } public void UpdateGuardRefreshTime(int _seconds) { refreshTime = DateTime.Now + new TimeSpan(_seconds * TimeSpan.TicksPerSecond); } } public class DogzDungeonBossData System/DogzDungeon/DogzDungeonWin.cs
@@ -75,7 +75,7 @@ private void ShowBosses() { var bosses = model.GetBosses(); var bosses = model.GetNpcIds(); model.selectedBoss = model.GetRecommendBoss(); m_Bosses.Init(bosses); m_Bosses.MoveToCenter(bosses.IndexOf(model.selectedBoss)); @@ -127,6 +127,7 @@ switch (config.MonsterType) { case 1: case 2: m_KillRecord.gameObject.SetActive(false); m_BossIntroduce.Dispose(); m_BossIntroduce.gameObject.SetActive(false); @@ -135,7 +136,7 @@ m_BoxBehaviour.gameObject.SetActive(true); m_BoxBehaviour.Display(); break; case 2: case 3: m_KillRecord.gameObject.SetActive(false); m_BossIntroduce.Dispose(); m_BossIntroduce.gameObject.SetActive(false); @@ -145,9 +146,7 @@ m_EliteMonsterBehaviour.gameObject.SetActive(true); m_EliteMonsterBehaviour.Display(); break; case 3: case 4: m_KillRecord.gameObject.SetActive(true); m_BoxBehaviour.Dispose(); m_BoxBehaviour.gameObject.SetActive(false); @@ -168,9 +167,9 @@ { case 1: case 2: case 3: m_SurpassLevel.gameObject.SetActive(false); break; case 3: case 4: var npcDropConfig = ConfigManager.Instance.GetTemplate<NPCDropItemConfig>(_bossId); m_SurpassLevel.gameObject.SetActive(npcDropConfig.MaxLV != 0 && PlayerDatas.Instance.baseData.LV > npcDropConfig.MaxLV); @@ -185,13 +184,13 @@ switch (config.MonsterType) { case 1: case 2: m_ContainerBoxCollectWeary.gameObject.SetActive(true); m_ContainerBossKillWeary.gameObject.SetActive(false); var bigBoxCollectCountLimit = 2; m_BossKillWearyValue.text = StringUtility.Contact(model.wearyValue, "/", bigBoxCollectCountLimit); m_BossKillWearyValue.colorType = model.bigBoxCollectCount >= bigBoxCollectCountLimit ? TextColType.Red : TextColType.DarkGreen; break; case 2: case 3: case 4: m_ContainerBoxCollectWeary.gameObject.SetActive(false); System/DogzDungeon/DogzEliteMonsterBehaviour.cs
@@ -18,7 +18,8 @@ public void Display() { UI3DModelExhibition.Instance.BeginShowNPC(999, Vector3.zero, m_RawImage); timer = 0f; UI3DModelExhibition.Instance.BeginShowNPC(model.eliteMonsters[0], Vector3.zero, m_RawImage); DisplayGuardSurplusInfo(); model.boxSurplusChangeEvent += OnGuardInfoUpdate; } @@ -41,6 +42,16 @@ m_Elite.color = UIHelper.GetUIColor(guard.guardSurplus > 0 ? TextColType.White : TextColType.Red); } float timer = 0f; private void LateUpdate() { timer += Time.deltaTime; if (timer > 30) { timer = 0f; model.RequestEliteSurplusInfo(); } } } }