少年修仙传客户端代码仓库
client_Wu Xijin
2019-04-22 5bcf6a59290a5f7f0caac94867f409c42be165ea
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
12个文件已修改
309 ■■■■ 已修改文件
Core/NetworkPackage/ClientPack/ClientToGameServer/CA0_Sys/CA007_tagGCFBLinePlayerCnt.cs 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HA0_Sys/DTCA007_tagGCFBLinePlayerCnt.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Lua/Gen/SnxxzUIMapModelWrap.cs 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Alchemy/AlchemyModel.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipGem/EquipEvolutionWin.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HazyRegion/HazyDemonKingModel.cs 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HazyRegion/HazyRegionIncidentBehaviour.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HazyRegion/HazyRegionIncidentPanel.cs 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HazyRegion/HazyRegionModel.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/RolePromote/RolePromoteModel.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Tip/PromoteDetailsWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/WorldMap/MapModel.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ClientPack/ClientToGameServer/CA0_Sys/CA007_tagGCFBLinePlayerCnt.cs
@@ -1,25 +1,41 @@
using UnityEngine;
using System.Collections;
// A0 04 查询副本功能线路人数 #tagCGGetFBLinePlayerCnt
public class CA004_tagCGGetFBLinePlayerCnt : GameNetPackBasic
{
    public uint MapID;
    public byte FBLineID;
    public byte IsAllLine;
    public CA004_tagCGGetFBLinePlayerCnt()
    {
        combineCmd = (ushort)0x1801;
        _cmd = (ushort)0xA004;
    }
    public override void WriteToBytes()
    {
        WriteBytes(MapID, NetDataType.DWORD);
        WriteBytes(FBLineID, NetDataType.BYTE);
        WriteBytes(IsAllLine, NetDataType.BYTE);
    }
using UnityEngine;
using System.Collections;
// A0 04 查询副本功能线路人数 #tagCGGetFBLinePlayerCnt
public class CA004_tagCGGetFBLinePlayerCnt : GameNetPackBasic
{
    public uint MapID;
    public byte LineCount;
    public byte[] LineIDList;    //个数为0时代表全部
    public CA004_tagCGGetFBLinePlayerCnt()
    {
        combineCmd = (ushort)0x1801;
        _cmd = (ushort)0xA004;
    }
    public override void WriteToBytes()
    {
        WriteBytes(MapID, NetDataType.DWORD);
        WriteBytes(LineCount, NetDataType.BYTE);
        WriteBytes(LineIDList, NetDataType.BYTE, LineCount);
    }
}
Core/NetworkPackage/DTCFile/ServerPack/HA0_Sys/DTCA007_tagGCFBLinePlayerCnt.cs
@@ -19,6 +19,7 @@
        ModelCenter.Instance.GetModel<JadeDynastyBossModel>().OnReceivePackage(package);
        ModelCenter.Instance.GetModel<RidingPetBossModel>().ReceivePackage(package);
        ModelCenter.Instance.GetModel<AllianceBossModel>().ReceivePackage(package);
        ModelCenter.Instance.GetModel<HazyDemonKingModel>().ReceivePackage(package);
    }
}
Lua/Gen/SnxxzUIMapModelWrap.cs
@@ -31,7 +31,6 @@
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnMapInitOk", _m_OnMapInitOk);
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "RequestMapTransport", _m_RequestMapTransport);
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "RequestSelectedLine", _m_RequestSelectedLine);
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "RequestQueryMapLineState", _m_RequestQueryMapLineState);
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetMapLines", _m_GetMapLines);
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "UpdateMapLines", _m_UpdateMapLines);
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "UpdateDungeonMapLines", _m_UpdateDungeonMapLines);
@@ -331,61 +330,6 @@
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
        }
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_RequestQueryMapLineState(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                Snxxz.UI.MapModel gen_to_be_invoked = (Snxxz.UI.MapModel)translator.FastGetCSObj(L, 1);
                int gen_param_count = LuaAPI.lua_gettop(L);
                if(gen_param_count == 4&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 4))
                {
                    int __mapId = LuaAPI.xlua_tointeger(L, 2);
                    int __lineId = LuaAPI.xlua_tointeger(L, 3);
                    bool __isAllLine = LuaAPI.lua_toboolean(L, 4);
                    gen_to_be_invoked.RequestQueryMapLineState( __mapId, __lineId, __isAllLine );
                    return 0;
                }
                if(gen_param_count == 3&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3))
                {
                    int __mapId = LuaAPI.xlua_tointeger(L, 2);
                    int __lineId = LuaAPI.xlua_tointeger(L, 3);
                    gen_to_be_invoked.RequestQueryMapLineState( __mapId, __lineId );
                    return 0;
                }
                if(gen_param_count == 2&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
                {
                    int __mapId = LuaAPI.xlua_tointeger(L, 2);
                    gen_to_be_invoked.RequestQueryMapLineState( __mapId );
                    return 0;
                }
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return LuaAPI.luaL_error(L, "invalid arguments to Snxxz.UI.MapModel.RequestQueryMapLineState!");
            
        }
        
System/Alchemy/AlchemyModel.cs
@@ -18,6 +18,7 @@
        public readonly Redpoint redpoint = new Redpoint(MainRedDot.RedPoint_key, 110);
        public readonly Redpoint alchemyDrugRedpoint1 = new Redpoint(110, 11001);
        public readonly Redpoint alchemyDrugRedpoint2 = new Redpoint(110, 11002);
        public readonly Redpoint alchemyDrugREdpoint3 = new Redpoint(110, 11003);
        Dictionary<int, Dictionary<int, Redpoint>> alchemyQualityRedpoints = new Dictionary<int, Dictionary<int, Redpoint>>();
        Dictionary<int, AlchemyRedpoint> alchemyRedpoints = new Dictionary<int, AlchemyRedpoint>();
@@ -114,6 +115,11 @@
            {
                CheckRedpoint();
            }
            if (m_AlchemyDrugs.Contains(itemId))
            {
                RefreshUseDrugRedpoint();
            }
        }
        private void PlayerDataRefreshEvent(PlayerDataType dataType)
@@ -129,6 +135,7 @@
            if (id == (int)FuncOpenEnum.BlastFurnace)
            {
                CheckRedpoint();
                RefreshUseDrugRedpoint();
            }
        }
@@ -628,6 +635,23 @@
                }
            }
        }
        void RefreshUseDrugRedpoint()
        {
            var useable = false;
            if (FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.BlastFurnace))
            {
                foreach (var itemId in m_AlchemyDrugs)
                {
                    if (GetAlchemyDrugState(itemId) == 0)
                    {
                        useable = true;
                        break;
                    }
                }
            }
            alchemyDrugREdpoint3.state = useable ? RedPointState.Simple : RedPointState.None;
        }
    }
    public enum AlchemyType
System/EquipGem/EquipEvolutionWin.cs
@@ -94,8 +94,7 @@
            m_ItemCell.Init(cellModel);
            m_ItemCell.button.SetListener(()=> 
            {
                ItemAttrData attrData = new ItemAttrData(evolve.CostItemID, false, (ulong)1);
                itemTipsModel.SetItemTipsModel(attrData);
                EquipTipUtility.Show(evolve.CostItemID);
            });
            string strItemCount = string.Empty;
            string strEquipLevel = string.Empty;
System/HazyRegion/HazyDemonKingModel.cs
@@ -7,6 +7,7 @@
    public class HazyDemonKingModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
    {
        Dictionary<uint, HazyDemonKingPlayerInfo> m_PlayerInfos = new Dictionary<uint, HazyDemonKingPlayerInfo>();
        Dictionary<int, Dictionary<int, int>> m_MapPlayerCounts = new Dictionary<int, Dictionary<int, int>>();
        List<uint> m_AttackHeroPlayers = new List<uint>();
        public bool IsInDungeon { get; private set; }
@@ -19,6 +20,7 @@
        public const int DEMONKINGMAPID2 = 32030;
        public event Action onPlayerInfoRefresh;
        public event Action onPlayerCountRefresh;
        HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
@@ -37,6 +39,7 @@
        public void OnBeforePlayerDataInitialize()
        {
            m_PlayerInfos.Clear();
            m_MapPlayerCounts.Clear();
        }
        public void OnPlayerLoginOk()
@@ -222,6 +225,15 @@
            return m_PlayerInfos.Keys;
        }
        public int GetDungeonPlayerCount(int mapId, int lineId)
        {
            if (m_MapPlayerCounts.ContainsKey(mapId))
            {
                return m_MapPlayerCounts[mapId].ContainsKey(lineId) ? m_MapPlayerCounts[mapId][lineId] : 0;
            }
            return 0;
        }
        public void SendSelectAtkTarget(uint serverInstId)
        {
            var actor = GAMgr.Instance.GetBySID(serverInstId);
@@ -283,6 +295,30 @@
            }
        }
        public void ReceivePackage(HA007_tagGCFBLinePlayerCnt package)
        {
            var mapId = (int)package.MapID;
            if (IsInDemonKingDungeon(mapId))
            {
                Dictionary<int, int> dict = null;
                if (!m_MapPlayerCounts.TryGetValue(mapId, out dict))
                {
                    dict = new Dictionary<int, int>();
                    m_MapPlayerCounts.Add(mapId, dict);
                }
                for (int i = 0; i < package.Count; i++)
                {
                    var data = package.FBLineInfoList[i];
                    dict[data.FBLineID] = data.PlayerCnt;
                }
                if (onPlayerCountRefresh != null)
                {
                    onPlayerCountRefresh();
                }
            }
        }
        public void RequestEnterClientDungeon()
        {
            var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
System/HazyRegion/HazyRegionIncidentBehaviour.cs
@@ -38,6 +38,7 @@
        HazyRegionModel model { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
        FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } }
        HazyDemonKingModel hazyDemonKingModel { get { return ModelCenter.Instance.GetModel<HazyDemonKingModel>(); } }
        int incidentId = 0;
@@ -51,6 +52,11 @@
                {
                    m_BossAlive = value;
                    DisplayBossState();
                    if (m_BossAlive)
                    {
                        model.incidentDirty = true;
                    }
                }
            }
        }
@@ -72,6 +78,7 @@
            var config = HazyRegionConfig.Get(incidentId);
            incidentType = (HazyRegionIncidentType)config.incidentType;
            m_BossAlive = false;
            if (incidentType == HazyRegionIncidentType.DemonKing)
            {
                m_BossAlive = findPreciousModel.IsBossAlive(config.npcId);
@@ -89,6 +96,8 @@
            model.onHazyRegionIncidentRefresh += OnHazyRegionIncidentRefresh;
            findPreciousModel.bossInfoUpdateEvent -= BossInfoUpdateEvent;
            findPreciousModel.bossInfoUpdateEvent += BossInfoUpdateEvent;
            hazyDemonKingModel.onPlayerCountRefresh -= OnPlayerCountRefresh;
            hazyDemonKingModel.onPlayerCountRefresh += OnPlayerCountRefresh;
        }
        void DisplayBase()
@@ -143,7 +152,8 @@
            {
                if (model.InFakeHazyRegion)
                {
                    var fighting = ClientDungeonStageUtility.isClientDungeon;
                    var fighting = ClientDungeonStageUtility.isClientDungeon &&
                        ClientDungeonStageUtility.clientMapId == HazyDemonKingModel.Client_MapID;
                    m_PlayerCount.gameObject.SetActive(true);
                    m_RebornTime.gameObject.SetActive(false);
                    m_PlayerCount.text = Language.Get("HazyDemonKingPlayerCount", fighting ? 1 : 0);
@@ -160,7 +170,7 @@
                    }
                    else
                    {
                        m_PlayerCount.text = Language.Get("HazyDemonKingPlayerCount", 0);
                        DisplayPlayerCount();
                    }
                }
            }
@@ -181,6 +191,16 @@
                {
                    m_RebornTime.text = Language.Get("BossReborn_RefreshTime1");
                }
            }
        }
        void DisplayPlayerCount()
        {
            var config = HazyRegionConfig.Get(incidentId);
            if (config != null)
            {
                m_PlayerCount.text = Language.Get("HazyDemonKingPlayerCount",
                    hazyDemonKingModel.GetDungeonPlayerCount(config.dungeonId, config.lineId));
            }
        }
@@ -245,9 +265,19 @@
            }
        }
        private void OnPlayerCountRefresh()
        {
            if (incidentType == HazyRegionIncidentType.DemonKing
                && !model.InFakeHazyRegion && bossAlive)
            {
                DisplayPlayerCount();
            }
        }
        public override void Dispose()
        {
            base.Dispose();
            hazyDemonKingModel.onPlayerCountRefresh -= OnPlayerCountRefresh;
            findPreciousModel.bossInfoUpdateEvent -= BossInfoUpdateEvent;
            model.selectIncidentRefresh -= SelectIncidentRefresh;
            model.onHazyRegionIncidentRefresh -= OnHazyRegionIncidentRefresh;
System/HazyRegion/HazyRegionIncidentPanel.cs
@@ -20,6 +20,12 @@
        HazyRegionModel model { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
        DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
        PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
        FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } }
        DateTime requestTime = DateTime.Now;
        int requestCount = 0;
        float timer = 0f;
        Dictionary<int, List<byte>> requestLines = new Dictionary<int, List<byte>>();
        private void Awake()
        {
@@ -32,6 +38,10 @@
            DisplayPoint();
            DisplayIncidents();
            DisplayBackButton();
            requestCount = 0;
            model.incidentDirty = false;
            SendRequestPlayerCount();
        }
        void DisplayIncidents()
@@ -193,6 +203,70 @@
            }
        }
        private void LateUpdate()
        {
            timer += Time.deltaTime;
            if (timer >= 0.5f && !model.InFakeHazyRegion)
            {
                if (model.incidentDirty)
                {
                    model.incidentDirty = false;
                    requestCount = 0;
                    requestTime = DateTime.Now;
                    SendRequestPlayerCount();
                    return;
                }
                timer = 0f;
                if ((DateTime.Now - requestTime).TotalSeconds > 5
                    && requestCount < 10)
                {
                    SendRequestPlayerCount();
                }
            }
        }
        void SendRequestPlayerCount()
        {
            requestLines.Clear();
            if (model.InFakeHazyRegion)
            {
                return;
            }
            for (int i = 0; i < incidents.Count; i++)
            {
                var config = HazyRegionConfig.Get(incidents[i]);
                if (config.incidentType != (int)HazyRegionIncidentType.DemonKing)
                {
                    continue;
                }
                if (findPreciousModel.IsBossAlive(config.npcId))
                {
                    if (!requestLines.ContainsKey(config.dungeonId))
                    {
                        requestLines.Add(config.dungeonId, new List<byte>());
                    }
                    if (!requestLines[config.dungeonId].Contains((byte)config.lineId))
                    {
                        requestLines[config.dungeonId].Add((byte)config.lineId);
                    }
                }
            }
            if (requestLines.Count > 0)
            {
                foreach (var mapId in requestLines.Keys)
                {
                    var pak = new CA004_tagCGGetFBLinePlayerCnt();
                    pak.MapID = (uint)mapId;
                    pak.LineCount = (byte)requestLines[mapId].Count;
                    pak.LineIDList = requestLines[mapId].ToArray();
                    GameNetSystem.Instance.SendInfo(pak);
                }
                requestCount++;
                requestTime = DateTime.Now;
            }
        }
        public void Dispose()
        {
            m_CyclicScroll.Dispose();
System/HazyRegion/HazyRegionModel.cs
@@ -20,6 +20,7 @@
        public int fakeOpenTimes { get; private set; }
        public bool isServerPrepare { get; private set; }
        public bool requireIncidentAnimation { get; set; }
        public bool incidentDirty { get; set; }
        int m_SelectIncident;
        public int selectIncident
System/RolePromote/RolePromoteModel.cs
@@ -422,7 +422,7 @@
        private void RedpointValueChangeEvent(int _id)
        {
            if (_id ==999999 /*strengthengmodel.StrengthRedpoint.id*/ ||
            if (_id == 999999 /*strengthengmodel.StrengthRedpoint.id*/ ||
                _id == MainRedDot.RedPoint_MountPackKey ||
                _id == MainRedDot.Instance.redPonintPetFunc2.id ||
                _id == MainRedDot.Instance.redPointWashFunc.id ||
@@ -431,7 +431,8 @@
                _id == methodData.fairyHeartRedpoint.id ||
                _id == realmModel.levelUpRedpoint.id ||
                _id == equipGemModel.redpoint.id ||
                _id == reikiRootModel.redpoint.id)
                _id == reikiRootModel.redpoint.id ||
                _id == alchemyModel.alchemyDrugREdpoint3.id)
            {
                CheckPromoteDetailEffect();
            }
@@ -467,8 +468,7 @@
                case PromoteDetailType.FairyHeart:
                    return ModelCenter.Instance.GetModel<PlayerMethodData>().fairyHeartRedpoint.state == RedPointState.Simple;
                case PromoteDetailType.BlastFurnace:
                    return false;
                    //return alchemyModel.CheckUseDrugLimit();
                    return alchemyModel.alchemyDrugREdpoint3.state == RedPointState.Simple;
                case PromoteDetailType.max:
                    break;
            }
System/Tip/PromoteDetailsWin.cs
@@ -110,7 +110,7 @@
                    //WindowCenter.Instance.Open<EquipReinforceWin>(false, 1);
                    break;
                case RolePromoteModel.PromoteDetailType.BlastFurnace:
                    WindowCenter.Instance.Open<AlchemyBaseWin>(false, 0);
                    WindowCenter.Instance.Open<AlchemyBaseWin>(false, 2);
                    break;
            }
            CloseClick();
System/WorldMap/MapModel.cs
@@ -147,7 +147,7 @@
            }
        }
        public void RequestQueryMapLineState(int _mapId, int _lineId = 0, bool _isAllLine = true)
        public void RequestQueryMapLineState(int _mapId, byte[] _lineIds = null, bool _isAllLine = true)
        {
            var config = MapConfig.Get(_mapId);
            if (config.MapFBType == (int)MapType.OpenCountry)
@@ -160,10 +160,10 @@
            {
                var lineState = new CA004_tagCGGetFBLinePlayerCnt();
                lineState.MapID = (uint)_mapId;
                lineState.IsAllLine = (byte)(_isAllLine ? 1 : 0);
                lineState.LineCount = (byte)(_isAllLine ? 0 : _lineIds.Length);
                if (_isAllLine)
                {
                    lineState.FBLineID = (byte)_lineId;
                    lineState.LineIDList = new byte[0];
                }
                GameNetSystem.Instance.SendInfo(lineState);
            }