少年修仙传客户端代码仓库
client_Wu Xijin
2018-11-01 2bfcee1e0ac2fb7a4bfacd552d3a5053c614dccf
3335 资源下载优先级别更新。
9个文件已修改
250 ■■■■ 已修改文件
Core/GameEngine/Model/Config/PriorBundleConfig.cs 53 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/PriorBundleConfig.cs.meta 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/TelPartialConfig/PartPriorBundleConfig.cs 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/MapTransferUtility.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Stage/StageManager.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/AssetVersion/AssetVersion.cs 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/AssetVersion/AssetVersionUtility.cs 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/AssetVersion/InGameDownLoad.cs 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/DungeonModel.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/PriorBundleConfig.cs
@@ -1,26 +1,27 @@
//--------------------------------------------------------
//    [Author]:            第二世界
//    [  Date ]:           Wednesday, July 25, 2018
//--------------------------------------------------------
using UnityEngine;
using System;
namespace TableConfig {
//--------------------------------------------------------
//    [Author]:            第二世界
//    [  Date ]:           Thursday, November 01, 2018
//--------------------------------------------------------
using UnityEngine;
using System;
namespace TableConfig {
    public partial class PriorBundleConfig : ConfigBase {
        public int id { get ; private set ; }
        public string AssetABName { get ; private set; } 
        public int AssetType { get ; private set ; }
        public int Prior { get ; private set ; }
        public override string getKey()
        {
            return id.ToString();
        }
        public override void Parse() {
        }
        public override void Parse() {
            try
            {
                id=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; 
@@ -28,17 +29,19 @@
                AssetABName = rawContents[1].Trim();
            
                AssetType=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; 
                Prior=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0;
            }
            catch (Exception ex)
            {
                DebugEx.Log(ex);
            }
        }
    }
}
            }
        }
    }
}
Core/GameEngine/Model/Config/PriorBundleConfig.cs.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 949b242ddea04fe418ea4647b082dcb7
timeCreated: 1532484855
timeCreated: 1541037151
licenseType: Pro
MonoImporter:
  serializedVersion: 2
Core/GameEngine/Model/TelPartialConfig/PartPriorBundleConfig.cs
@@ -7,75 +7,32 @@
{
    public partial class PriorBundleConfig : ConfigBase
    {
        static List<string> m_Audios;
        public static List<string> audios {
            get {
                if (!inited)
                {
                    Init();
                }
                return m_Audios;
            }
        }
        static List<string> m_Effects;
        public static List<string> effects {
            get {
                if (!inited)
                {
                    Init();
                }
                return m_Effects;
            }
        }
        static List<string> m_Scenes;
        public static List<string> scenes {
            get {
                if (!inited)
                {
                    Init();
                }
                return m_Scenes;
            }
        }
        static List<string> m_Mobs;
        public static List<string> mobs {
            get {
                if (!inited)
                {
                    Init();
                }
                return m_Mobs;
            }
        }
        static Dictionary<string, PriorBundleConfig> m_Audios = new Dictionary<string, PriorBundleConfig>();
        static Dictionary<string, PriorBundleConfig> m_Effects = new Dictionary<string, PriorBundleConfig>();
        static Dictionary<string, PriorBundleConfig> m_Scenes = new Dictionary<string, PriorBundleConfig>();
        static Dictionary<string, PriorBundleConfig> m_Mobs = new Dictionary<string, PriorBundleConfig>();
        static bool inited = false;
        static void Init()
        {
            var values = Config.Instance.GetAllValues<PriorBundleConfig>();
            m_Audios = new List<string>();
            m_Effects = new List<string>();
            m_Scenes = new List<string>();
            m_Mobs = new List<string>();
            foreach (var value in values)
            {
                switch (value.AssetType)
                {
                    case 1:
                        m_Scenes.Add(value.AssetABName.ToLower());
                        m_Scenes[value.AssetABName.ToLower()] = value;
                        break;
                    case 2:
                        m_Mobs.Add(value.AssetABName.ToLower());
                        m_Mobs[value.AssetABName.ToLower()] = value;
                        break;
                    case 3:
                        m_Audios.Add(value.AssetABName.ToLower());
                        m_Audios[value.AssetABName.ToLower()] = value;
                        break;
                    case 4:
                        m_Effects.Add(value.AssetABName.ToLower());
                        m_Effects[value.AssetABName.ToLower()] = value;
                        break;
                }
            }
@@ -83,6 +40,28 @@
            inited = true;
        }
        public static int GetAssetPrior(AssetVersion.AssetCategory category, string fileName)
        {
            if (!inited)
            {
                Init();
            }
            fileName = fileName.ToLower();
            switch (category)
            {
                case AssetVersion.AssetCategory.Scene:
                    return m_Scenes.ContainsKey(fileName) ? m_Scenes[fileName].Prior : 100;
                case AssetVersion.AssetCategory.Mob:
                    return m_Mobs.ContainsKey(fileName) ? m_Mobs[fileName].Prior : 101;
                case AssetVersion.AssetCategory.Effect:
                    return m_Effects.ContainsKey(fileName) ? m_Effects[fileName].Prior : 102;
                case AssetVersion.AssetCategory.Audio:
                    return m_Audios.ContainsKey(fileName) ? m_Audios[fileName].Prior : 103;
                default:
                    return 0;
            }
        }
    }
}
Fight/MapTransferUtility.cs
@@ -801,12 +801,11 @@
    public static bool Send_WorldTransfer(int mapId, Vector3 position, MapTransferType type, byte lineID = 255, int _npcId = 0)
    {
        if (!AssetSource.sceneFromEditor && !AssetVersionUtility.IsUnpriorAssetDownLoadOk())
        if (!AssetSource.sceneFromEditor)
        {
            var mapResConfig = DTCA127_tagMCStartChangeMap.GetMapResourcesConfig(mapId, 0);
            var assetVersion = AssetVersionUtility.GetAssetVersion(StringUtility.Contact("maps/", mapResConfig.MapResources.ToLower()));
            if (assetVersion != null && !assetVersion.IsPriorAsset())
            var assetValid = AssetVersionUtility.IsAssetValid(StringUtility.Contact("maps/", mapResConfig.MapResources.ToLower()));
            if (!assetValid)
            {
                InGameDownLoad.Instance.TryDownLoad(InGameDownLoad.Dominant.Whole);
                return false;
Fight/Stage/StageManager.cs
@@ -97,8 +97,8 @@
        }
        else
        {
            var assetVersion = AssetVersionUtility.GetAssetVersion(StringUtility.Contact("maps/", mapResConfig.MapResources.ToLower()));
            if (assetVersion != null && assetVersion.IsPriorAsset())
            var assetValid = AssetVersionUtility.IsAssetValid(StringUtility.Contact("maps/", mapResConfig.MapResources.ToLower()));
            if (assetValid)
            {
                SnxxzGame.Instance.StartCoroutine(LoadCoroutine<T>(stageId, mapResConfig.ID, mapResConfig.MapResources, true));
            }
System/AssetVersion/AssetVersion.cs
@@ -150,19 +150,9 @@
            }
            else
            {
                switch (GetAssetCategory())
                {
                    case AssetCategory.Scene:
                        return PriorBundleConfig.scenes.Contains(m_FileName);
                    case AssetCategory.Mob:
                        return PriorBundleConfig.mobs.Contains(m_FileName);
                    case AssetCategory.Audio:
                        return PriorBundleConfig.audios.Contains(m_FileName);
                    case AssetCategory.Effect:
                        return PriorBundleConfig.effects.Contains(m_FileName);
                    default:
                        return true;
                }
                var category = GetAssetCategory();
                var prior = PriorBundleConfig.GetAssetPrior(category, m_FileName);
                return prior <= 1;
            }
        }
        else
System/AssetVersion/AssetVersionUtility.cs
@@ -143,11 +143,11 @@
        return assetVersions;
    }
    public static AssetVersion GetAssetVersion(string _assetBundleName)
    public static AssetVersion GetAssetVersion(string assetKey)
    {
        if (assetVersions.ContainsKey(_assetBundleName))
        if (assetVersions.ContainsKey(assetKey))
        {
            return assetVersions[_assetBundleName];
            return assetVersions[assetKey];
        }
        else
        {
@@ -155,6 +155,25 @@
        }
    }
    public static bool IsAssetValid(string assetKey)
    {
        if (assetVersions.ContainsKey(assetKey))
        {
            return assetVersions[assetKey].localValid;
        }
        else
        {
            if (VersionUtility.Instance.NeedDownAsset())
            {
                return false;
            }
            else
            {
                return true;
            }
        }
    }
    public static string GetAssetFilePath(string _assetKey)
    {
        var path = string.Empty;
System/AssetVersion/InGameDownLoad.cs
@@ -16,10 +16,8 @@
    public bool inGameDownLoadAllow = false;
    public float progress
    {
        get
        {
    public float progress {
        get {
            return Mathf.Clamp01((float)showDownLoadedSize / showTotalSize);
        }
    }
@@ -34,11 +32,9 @@
    int totalCount = 0;
    int m_OkCount = 0;
    int okCount
    {
    int okCount {
        get { return m_OkCount; }
        set
        {
        set {
            m_OkCount = value;
        }
    }
@@ -53,11 +49,9 @@
    Action onDownLoadOk;
    Dominant m_DominantState = Dominant.None;
    public Dominant dominantState
    {
    public Dominant dominantState {
        get { return m_DominantState; }
        private set
        {
        private set {
            if (m_DominantState != value)
            {
                m_DominantState = value;
@@ -70,11 +64,9 @@
    }
    State m_State = State.None;
    public State state
    {
    public State state {
        get { return m_State; }
        set
        {
        set {
            if (m_State != value)
            {
                m_State = value;
@@ -91,8 +83,7 @@
    public List<Reward> rewards = new List<Reward>();
    public bool hasReward { get; private set; }
    public string completeDownLoadAccount
    {
    public string completeDownLoadAccount {
        get { return LocalSave.GetString("InGameDownLoadCompleteAccount"); }
        set { LocalSave.SetString("InGameDownLoadCompleteAccount", value); }
    }
@@ -103,6 +94,7 @@
    {
        inGameDownLoadAllow = false;
        tasks = _tasks;
        tasks.Sort(AssetDownLoadPriorCompare);
        onDownLoadOk = _onDownLoadOk;
        totalCount = tasks.Count;
@@ -246,7 +238,6 @@
        }
    }
    IEnumerator Co_StartDownLoad()
    {
        downLoadedSizeRecord += RemoteFile.TotalDownloadedSize;
@@ -347,11 +338,9 @@
    Clock netSwitchClock;
    NetworkReachability m_NetworkReachability = NetworkReachability.NotReachable;
    NetworkReachability networkReachability
    {
    NetworkReachability networkReachability {
        get { return m_NetworkReachability; }
        set
        {
        set {
            if (m_NetworkReachability != value)
            {
                m_NetworkReachability = value;
@@ -388,11 +377,9 @@
    bool m_SimulateWifi = true;
    public bool simulateWifi
    {
    public bool simulateWifi {
        get { return m_SimulateWifi; }
        set
        {
        set {
            if (m_SimulateWifi != value)
            {
                m_SimulateWifi = value;
@@ -539,6 +526,15 @@
        }
    }
    private int AssetDownLoadPriorCompare(AssetVersion lhs, AssetVersion rhs)
    {
        var categoryA = lhs.GetAssetCategory();
        var categoryB = rhs.GetAssetCategory();
        var priorA = PriorBundleConfig.GetAssetPrior(categoryA, lhs.fileName);
        var priorB = PriorBundleConfig.GetAssetPrior(categoryB, rhs.fileName);
        return priorA < priorB ? -1 : 1;
    }
    public struct Reward
    {
System/Dungeon/DungeonModel.cs
@@ -550,10 +550,10 @@
                }
                if (Index > -1)
                {
                    if (Index + 1 >=7)
                    if (Index + 1 >= 7)
                    {
                        if(7-mainModel.WaHuangHighestFloor>=0)
                        mainModel.LayerNumber = 7 - mainModel.WaHuangHighestFloor;
                        if (7 - mainModel.WaHuangHighestFloor >= 0)
                            mainModel.LayerNumber = 7 - mainModel.WaHuangHighestFloor;
                    }
                    else
                    {
@@ -1174,12 +1174,12 @@
        public void RequestChallangeDungeon(int _dataMapId, int _lineId)
        {
            if (!AssetSource.sceneFromEditor && !AssetVersionUtility.IsUnpriorAssetDownLoadOk())
            if (!AssetSource.sceneFromEditor)
            {
                var mapResConfig = DTCA127_tagMCStartChangeMap.GetMapResourcesConfig(_dataMapId, _lineId);
                var assetVersion = AssetVersionUtility.GetAssetVersion(StringUtility.Contact("maps/", mapResConfig.MapResources.ToLower()));
                var assetValid = AssetVersionUtility.IsAssetValid(StringUtility.Contact("maps/", mapResConfig.MapResources.ToLower()));
                if (assetVersion != null && !assetVersion.IsPriorAsset())
                if (!assetValid)
                {
                    InGameDownLoad.Instance.TryDownLoad(InGameDownLoad.Dominant.Whole);
                    return;