少年修仙传客户端代码仓库
client_Hale
2018-08-22 2b47fde8e7902ddddd898309f281b9c310fc877f
Core/GameEngine/Model/ConfigManager.cs
@@ -8,10 +8,8 @@
using UnityEngine;
using System.Threading;
public class ConfigManager : Singleton<ConfigManager>
public class Config : Singleton<Config>
{
    public readonly static string CustomIV = "4vHKRj3yfzU=";
    public readonly static string CustomKey = "xhVs6DRXLfUGxw+AhtfQdpQGoa+8SA9d";
    bool isPlaying = true;
@@ -188,7 +186,7 @@
        AddAsyncTask<OrderInfoConfig>();
        AddAsyncTask<TrialExchangeConfig>();
        AddAsyncTask<TrialRewardsConfig>();
        AddAsyncTask<DogzEquipPlusConfig>();
        while (!AllCompleted())
        {
            var completedCount = 0;
@@ -518,26 +516,9 @@
                lines = File.ReadAllLines(path, Encoding.UTF8);
                break;
            case AssetPath.External:
                var assetVersion = AssetVersionUtility.GetAssetVersion(StringUtility.Contact("config/", fileName, ".bytes"));
                var assetVersion = AssetVersionUtility.GetAssetVersion(StringUtility.Contact("config/", fileName, ".txt"));
                path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, assetVersion.relativePath);
                var provider = new TripleDESCryptoServiceProvider();
                provider.Key = Convert.FromBase64String(CustomKey);
                provider.IV = Convert.FromBase64String(CustomIV);
                provider.Mode = CipherMode.CBC;
                provider.Padding = PaddingMode.PKCS7;
                var decryptor = provider.CreateDecryptor();
                var fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read);
                var bytes = new byte[fs.Length];
                fs.Read(bytes, 0, bytes.Length);
                var ms = new MemoryStream(bytes);
                var crypS = new CryptoStream(ms, decryptor, CryptoStreamMode.Read);
                var sr = new StreamReader(crypS, Encoding.UTF8);
                var content = sr.ReadToEnd();
                lines = content.Split(new string[] { "\r\n" }, StringSplitOptions.None);
                lines = File.ReadAllLines(path, Encoding.UTF8);
                break;
        }
@@ -599,7 +580,7 @@
    }
    public T GetTemplate<T>(string _dwTemplateID) where T : ConfigBase, new()
    public T Get<T>(string _dwTemplateID) where T : ConfigBase, new()
    {
        if (string.IsNullOrEmpty(_dwTemplateID))
        {
@@ -634,9 +615,9 @@
        return config as T;
    }
    public T GetTemplate<T>(int _dwTemplateID) where T : ConfigBase, new()
    public T Get<T>(int _dwTemplateID) where T : ConfigBase, new()
    {
        return GetTemplate<T>(_dwTemplateID.ToString());
        return Get<T>(_dwTemplateID.ToString());
    }
    public bool ContainKey<T>(int _id)