|
@@ -10,7 +10,7 @@ using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Security.Cryptography;
|
|
|
|
|
|
-public class ManaData
|
|
|
+public class ManaData : Regist
|
|
|
{
|
|
|
#region 变量
|
|
|
|
|
@@ -87,12 +87,13 @@ public class ManaData
|
|
|
|
|
|
if (PlayerPrefs.GetString("config") != Auxiliary.ToString(md5.ComputeHash(bytes)))
|
|
|
{
|
|
|
- Debug.LogWarning("Damage");
|
|
|
- ManaDebug.Log("Damage");
|
|
|
+ Debug.LogWarning("Download Archive");
|
|
|
+ ManaDebug.Log("Download Archive");
|
|
|
|
|
|
DamageLock = true;
|
|
|
+ DownloadLock = false;
|
|
|
|
|
|
- ManaServer.Download(PlayerPrefs.GetString("id"), RecoveXml);
|
|
|
+ //ManaServer.Download(PlayerPrefs.GetString("id"), RecoveXml);
|
|
|
|
|
|
return null;
|
|
|
}
|
|
@@ -107,21 +108,15 @@ public class ManaData
|
|
|
|
|
|
DefaultDoc.LoadXml(textAsset.text);
|
|
|
|
|
|
- if (!string.IsNullOrEmpty(PlayerPrefs.GetString("id")))
|
|
|
- {
|
|
|
- Debug.LogWarning("Damage");
|
|
|
- ManaDebug.Log("Damage");
|
|
|
+ Debug.LogWarning("Download Archive");
|
|
|
+ ManaDebug.Log("Download Archive");
|
|
|
|
|
|
- DamageLock = true;
|
|
|
+ DamageLock = true;
|
|
|
+ DownloadLock = false;
|
|
|
|
|
|
- ManaServer.Download(PlayerPrefs.GetString("id"), RecoveXml);
|
|
|
+ //ManaServer.Download(PlayerPrefs.GetString("id"), RecoveXml);
|
|
|
|
|
|
- return null;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- PlayerDoc_ = DefaultDoc;
|
|
|
- }
|
|
|
+ return null;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -133,11 +128,54 @@ public class ManaData
|
|
|
public static XmlNode PlayerNode_;
|
|
|
public static XmlDocument PlayerDoc_;
|
|
|
|
|
|
+ public static float Timer;
|
|
|
public static bool DamageLock;
|
|
|
+ public static bool DownloadLock;
|
|
|
public static XmlDocument DefaultDoc = new XmlDocument();
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
+ public void Update()
|
|
|
+ {
|
|
|
+ if (!DownloadLock)
|
|
|
+ {
|
|
|
+ Timer += Time.fixedDeltaTime;
|
|
|
+
|
|
|
+ if (Timer >= 10)
|
|
|
+ {
|
|
|
+ DamageLock = false;
|
|
|
+
|
|
|
+ TextAsset textAsset = ManaReso.Load<TextAsset>("PlayerConfig", Folder.Config);
|
|
|
+
|
|
|
+ PlayerDoc_ = new XmlDocument();
|
|
|
+
|
|
|
+ PlayerDoc_.LoadXml(textAsset.text);
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (ManaServer.ID != "Default")
|
|
|
+ {
|
|
|
+ DownloadLock = true;
|
|
|
+
|
|
|
+ ManaServer.Download(ManaServer.ID, RecoveXml);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public override bool RegistImmed()
|
|
|
+ {
|
|
|
+ if (base.RegistImmed())
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ enabled = true;
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
public static void SaveXml()
|
|
|
{
|
|
|
if (Initializer.Complete)
|
|
@@ -173,7 +211,7 @@ public class ManaData
|
|
|
PlayerDoc_ = new XmlDocument();
|
|
|
|
|
|
PlayerDoc_.LoadXml(jsonData["l"].ToString());
|
|
|
-
|
|
|
+
|
|
|
SavePlayerInt("Version", int.Parse(DefaultDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("Version").Attributes[0].Value));
|
|
|
}
|
|
|
else
|