From a0ede150686a218c92b901b1f20aef12a9913890 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期五, 14 九月 2018 09:36:59 +0800
Subject: [PATCH] 1930【1.0.15】【主干】功能预告跳转八卦炉激活,功能预告界面未关闭
---
Core/GameEngine/Model/ConfigManager.cs | 78 +++++++++++----------------------------
1 files changed, 22 insertions(+), 56 deletions(-)
diff --git a/Core/GameEngine/Model/ConfigManager.cs b/Core/GameEngine/Model/ConfigManager.cs
index d24ce41..fed436d 100644
--- a/Core/GameEngine/Model/ConfigManager.cs
+++ b/Core/GameEngine/Model/ConfigManager.cs
@@ -8,15 +8,14 @@
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;
bool m_Inited = false;
- public bool inited {
+ public bool inited
+ {
get { return m_Inited; }
private set { m_Inited = value; }
}
@@ -42,6 +41,7 @@
AddAsyncTask<IconConfig>();
AddAsyncTask<ItemConfig>();
AddAsyncTask<SkillConfig>();
+ AddAsyncTask<DirtyNameConfig>();
AddAsyncTask<TASKINFOConfig>();
AddAsyncTask<mapnpcConfig>();
AddAsyncTask<LoginSeverListConfig>();
@@ -187,6 +187,12 @@
AddAsyncTask<AllPeoplePartyAwardConfig>();
AddAsyncTask<OrderInfoConfig>();
AddAsyncTask<TrialExchangeConfig>();
+ AddAsyncTask<DogzDungeonConfig>();
+ AddAsyncTask<TrialRewardsConfig>();
+ AddAsyncTask<DogzEquipPlusConfig>();
+ AddAsyncTask<FairyGrabBossConfig>();
+ AddAsyncTask<DungeonSpecialStateTimeConfig>();
+ AddAsyncTask<DailyQuestSpecialOpenTimeConfig>();
while (!AllCompleted())
{
@@ -244,6 +250,7 @@
StartSyncTask<IconConfig>(AssetPath.ResourceOut);
StartSyncTask<SysInfoConfig>(AssetPath.ResourceOut);
StartSyncTask<LanguageConfig>(AssetPath.ResourceOut);
+ StartSyncTask<RealmConfig>(AssetPath.ResourceOut);
}
public bool AllCompleted()
@@ -294,7 +301,7 @@
switch (Application.platform)
{
case RuntimePlatform.Android:
- if (DeviceUtility.cpu >= 4 && DeviceUtility.memory > 3.5f * 1024)
+ if (DeviceUtility.cpu >= 4 && DeviceUtility.memory > 3.2f * 1024)
{
return 4;
}
@@ -327,7 +334,7 @@
switch (Application.platform)
{
case RuntimePlatform.Android:
- if (DeviceUtility.cpu >= 4 && DeviceUtility.memory > 3.5f * 1024)
+ if (DeviceUtility.cpu >= 4 && DeviceUtility.memory > 3.2f * 1024)
{
return 20;
}
@@ -371,7 +378,7 @@
}
else
{
- path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, "config/", fileName, ".bytes");
+ path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, "config/", fileName, ".txt");
}
var task = new ConfigTask(typeof(T), AssetSource.refdataFromEditor ? AssetPath.ResourceOut : AssetPath.External, path);
@@ -394,35 +401,9 @@
(object _obj) =>
{
string[] lines = null;
- StreamReader sr = null;
-
try
{
- if (_task.assetPath == AssetPath.ResourceOut)
- {
- lines = File.ReadAllLines(_task.filePath, Encoding.UTF8);
- }
- else if (_task.assetPath == AssetPath.External)
- {
- var tripleDESCryptoServiceProvider = new TripleDESCryptoServiceProvider();
- tripleDESCryptoServiceProvider.Key = Convert.FromBase64String(CustomKey);
- tripleDESCryptoServiceProvider.IV = Convert.FromBase64String(CustomIV);
- tripleDESCryptoServiceProvider.Mode = CipherMode.CBC;
- tripleDESCryptoServiceProvider.Padding = PaddingMode.PKCS7;
- var decryptor = tripleDESCryptoServiceProvider.CreateDecryptor();
-
- var expectedSteam = new FileStream(_task.filePath, FileMode.Open, FileAccess.Read, FileShare.Read);
- var bytes = new byte[expectedSteam.Length];
- expectedSteam.Read(bytes, 0, bytes.Length);
- var tableMs = new MemoryStream(bytes);
-
- var crypS = new CryptoStream(tableMs, decryptor, CryptoStreamMode.Read);
- sr = new StreamReader(crypS, Encoding.UTF8);
- var content = sr.ReadToEnd();
-
- lines = content.Split(new string[] { "\r\n" }, StringSplitOptions.None);
- }
-
+ lines = File.ReadAllLines(_task.filePath, Encoding.UTF8);
_task.state = TaskState.ReadFileSuccess;
}
catch (Exception ex)
@@ -504,6 +485,7 @@
{
if (isPlaying && _task.state == TaskState.ReadFileFailure)
{
+ Thread.Sleep(30);
ReadFile(_task, OnEndReadFile<T>);
}
else
@@ -519,6 +501,7 @@
if (isPlaying && _task.state == TaskState.ParseFailure)
{
Debug.LogFormat("閰嶇疆琛ㄨВ鏋愬け璐ワ細{0}", _task.taskName);
+ Thread.Sleep(30);
ReadFile(_task, OnEndReadFile<T>);
}
}
@@ -542,26 +525,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;
}
@@ -623,7 +589,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))
{
@@ -658,9 +624,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)
--
Gitblit v1.8.0