|
@@ -1,2065 +1,2085 @@
|
|
|
-using LitJson;
|
|
|
-
|
|
|
-using UnityEngine;
|
|
|
-
|
|
|
-using System;
|
|
|
-using System.IO;
|
|
|
-using System.Xml;
|
|
|
-using System.Text;
|
|
|
-using System.Collections;
|
|
|
-using System.Collections.Generic;
|
|
|
-using System.Linq;
|
|
|
-using System.Security.Cryptography;
|
|
|
-using Sfs2X.Entities;
|
|
|
-using Sfs2X.Entities.Data;
|
|
|
-using UnityEngine.UI;
|
|
|
-using Random = UnityEngine.Random;
|
|
|
-
|
|
|
-public class ConfigManager : Regist
|
|
|
-{
|
|
|
- #region Config
|
|
|
-
|
|
|
- public static XmlNode ConfigRootNode
|
|
|
- {
|
|
|
- get
|
|
|
- {
|
|
|
- if (configRootNode == null)
|
|
|
- {
|
|
|
- configRootNode = ConfigDocument.SelectSingleNode(PlayerConfigLabel.RootNode);
|
|
|
- }
|
|
|
-
|
|
|
- return configRootNode;
|
|
|
- }
|
|
|
- set { configRootNode = value; }
|
|
|
- }
|
|
|
- public static XmlNode configRootNode;
|
|
|
- public static XmlDocument ConfigDocument
|
|
|
- {
|
|
|
- get
|
|
|
- {
|
|
|
- if (configDocument == null)
|
|
|
- {
|
|
|
- LoadConfigDocument();
|
|
|
- }
|
|
|
-
|
|
|
- return configDocument;
|
|
|
- }
|
|
|
- set { configDocument = value; }
|
|
|
- }
|
|
|
- public static XmlDocument configDocument;
|
|
|
-
|
|
|
- public static float UrlTimer;
|
|
|
- public static bool PlayerDocumentDamageFlag;
|
|
|
- public static bool IDRequestFlag;
|
|
|
- public static bool SerialNumberRequestFlag = true;
|
|
|
- public static XmlDocument DefaultConfigDocument = new XmlDocument();
|
|
|
-
|
|
|
- public static int ConfigReplayVersion = -1000;
|
|
|
- public static string ConfigPath
|
|
|
- {
|
|
|
- get
|
|
|
- {
|
|
|
- if (string.IsNullOrEmpty(configPath))
|
|
|
- {
|
|
|
- configPath = string.Format("{0}/{1}", Application.persistentDataPath, ResourceLabel.PlayerConfigXml);
|
|
|
- }
|
|
|
-
|
|
|
- return configPath;
|
|
|
- }
|
|
|
- }
|
|
|
- public static string configPath;
|
|
|
-
|
|
|
- #endregion
|
|
|
-
|
|
|
- private static string UnvalidConfigMD5 = "";
|
|
|
- private static void LoadConfigDocument()
|
|
|
- {
|
|
|
- //if (!PlayerPrefManager.GetBool(PlayerPrefManager.INTERACT_CONFIG, false))
|
|
|
- //{
|
|
|
- // Debug.LogWarning("Download Archive : did not interact");
|
|
|
-
|
|
|
- // PlayerDocumentDamageFlag = true;
|
|
|
- // SerialNumberRequestFlag = false;
|
|
|
-
|
|
|
- // return;
|
|
|
- //}
|
|
|
-
|
|
|
- int defaultVersion;
|
|
|
- int nativeVersion;
|
|
|
-
|
|
|
- XmlNode node;
|
|
|
- XmlDocument nativeDoc = new XmlDocument();
|
|
|
-
|
|
|
- if (File.Exists(ConfigPath))
|
|
|
- {
|
|
|
- try
|
|
|
- {
|
|
|
- StreamReader sr = new StreamReader(ConfigPath);
|
|
|
-
|
|
|
- nativeDoc.LoadXml(sr.ReadToEnd());
|
|
|
-
|
|
|
- sr.Close();
|
|
|
-
|
|
|
- Auxiliary.DecryptXml(nativeDoc);
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- Debug.LogWarning("Download Archive : MD5 doesn't match");
|
|
|
- //ManaDebug.Log("Download Archive");
|
|
|
-
|
|
|
- PlayerDocumentDamageFlag = true;
|
|
|
- SerialNumberRequestFlag = false;
|
|
|
-
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.PlayerConfig, Folder.Default);
|
|
|
-
|
|
|
- DefaultConfigDocument.LoadXml(textAsset.text);
|
|
|
-
|
|
|
- defaultVersion = int.Parse(DefaultConfigDocument.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value);
|
|
|
-
|
|
|
- node = nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version);
|
|
|
-
|
|
|
- if (node == null)
|
|
|
- {
|
|
|
- StreamWriter sw = new StreamWriter(ConfigPath);
|
|
|
-
|
|
|
- sw.Write(DefaultConfigDocument.OuterXml);
|
|
|
-
|
|
|
- sw.Close();
|
|
|
-
|
|
|
- configDocument = DefaultConfigDocument;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- nativeVersion = int.Parse(node.Attributes[0].Value);
|
|
|
-
|
|
|
- if (nativeVersion == ConfigReplayVersion)
|
|
|
- {
|
|
|
- configDocument = DefaultConfigDocument;
|
|
|
- int currentReplayVersion = int.Parse(nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.ReplayVersion).Attributes[0].Value);
|
|
|
- SaveIntToConfig(PlayerConfigLabel.ReplayVersion, currentReplayVersion + 1);
|
|
|
- //Debug.Log(currentReplayVersion);
|
|
|
- }
|
|
|
- else if (nativeVersion < defaultVersion)
|
|
|
- {
|
|
|
- byte[] bytes;
|
|
|
-
|
|
|
- MD5 md5 = new MD5CryptoServiceProvider();
|
|
|
-
|
|
|
- if (nativeVersion <= 4)
|
|
|
- {
|
|
|
- bytes = Encoding.UTF8.GetBytes(nativeDoc.OuterXml);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- bytes = File.ReadAllBytes(ConfigPath);
|
|
|
- }
|
|
|
-
|
|
|
- if (PlayerPrefs.GetString(Lib.ConfigPrefs) != UnvalidConfigMD5 && PlayerPrefs.GetString(Lib.ConfigPrefs) != Auxiliary.ToString(md5.ComputeHash(bytes)))
|
|
|
- {
|
|
|
- Debug.LogWarning("Download Archive : MD5 doesn't match");
|
|
|
- //ManaDebug.Log("Download Archive");
|
|
|
-
|
|
|
- PlayerDocumentDamageFlag = true;
|
|
|
- SerialNumberRequestFlag = false;
|
|
|
-
|
|
|
- return;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- configDocument = UpdateConfigDocument(nativeVersion, nativeDoc, DefaultConfigDocument);
|
|
|
-
|
|
|
- //HttpManager.UploadConfig();
|
|
|
- }
|
|
|
- }
|
|
|
- else if (nativeVersion > defaultVersion)
|
|
|
- {
|
|
|
- //configDocument = DefaultConfigDocument;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- byte[] bytes = File.ReadAllBytes(ConfigPath);
|
|
|
-
|
|
|
- MD5 md5 = new MD5CryptoServiceProvider();
|
|
|
-
|
|
|
- if (PlayerPrefs.GetString(Lib.ConfigPrefs) != UnvalidConfigMD5 && PlayerPrefs.GetString(Lib.ConfigPrefs) != Auxiliary.ToString(md5.ComputeHash(bytes)))
|
|
|
- {
|
|
|
- Debug.LogWarning("Download Archive : MD5 doesn't match");
|
|
|
- //ManaDebug.Log("Download Archive");
|
|
|
-
|
|
|
- PlayerDocumentDamageFlag = true;
|
|
|
- SerialNumberRequestFlag = false;
|
|
|
-
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- configDocument = nativeDoc;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.PlayerConfig, Folder.Default);
|
|
|
-
|
|
|
- DefaultConfigDocument.LoadXml(textAsset.text);
|
|
|
-
|
|
|
- Debug.LogWarning("Download Archive");
|
|
|
- //ManaDebug.Log("Download Archive");
|
|
|
-
|
|
|
- PlayerDocumentDamageFlag = true;
|
|
|
- SerialNumberRequestFlag = false;
|
|
|
-
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- private float MaxUrlWaitTime = 10;
|
|
|
- public void Update()
|
|
|
- {
|
|
|
- if (PlayerDocumentDamageFlag)
|
|
|
- {
|
|
|
- UrlTimer += Time.deltaTime;
|
|
|
-
|
|
|
- if (UrlTimer >= MaxUrlWaitTime)
|
|
|
- {
|
|
|
- PlayerDocumentDamageFlag = false;
|
|
|
-
|
|
|
- TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.PlayerConfig, Folder.Default);
|
|
|
-
|
|
|
- configDocument = new XmlDocument();
|
|
|
-
|
|
|
- configDocument.LoadXml(textAsset.text);
|
|
|
-
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (!SerialNumberRequestFlag)
|
|
|
- {
|
|
|
- if (HttpManager.SerialNumber != PlayerConfigLabel.DefaultSerialNumber)
|
|
|
- {
|
|
|
- SerialNumberRequestFlag = true;
|
|
|
-
|
|
|
- HttpManager.GetConfigBySerialNumber(HttpManager.SerialNumber, RecoveConfigDocument);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public override bool InitAtOnce()
|
|
|
- {
|
|
|
- if (base.InitAtOnce())
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- enabled = true;
|
|
|
-
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static void RecoveConfigDocument(JsonData jsonData)
|
|
|
- {
|
|
|
- if (!PlayerDocumentDamageFlag)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.PlayerConfig, Folder.Default);
|
|
|
-
|
|
|
- DefaultConfigDocument.LoadXml(textAsset.text);
|
|
|
- //Debug.Log(jsonData.ToJson());
|
|
|
- if (jsonData.Inst_Object.Keys.Contains("l"))
|
|
|
- {
|
|
|
- XmlDocument recoverdDocument = new XmlDocument();
|
|
|
-
|
|
|
- recoverdDocument.LoadXml(jsonData["l"].ToString());
|
|
|
-
|
|
|
- int RecoverdVersion = int.Parse(recoverdDocument.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value);
|
|
|
- int DefaultVersion = int.Parse(DefaultConfigDocument.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value);
|
|
|
-
|
|
|
- PlayerDocumentDamageFlag = false;
|
|
|
- if (RecoverdVersion <= DefaultVersion)
|
|
|
- {
|
|
|
- UpdateConfigDocument(RecoverdVersion, recoverdDocument, DefaultConfigDocument);
|
|
|
- configDocument = recoverdDocument;
|
|
|
- PlayerPrefManager.SaveBool(PlayerPrefManager.INTERACT_CONFIG, true);
|
|
|
- }
|
|
|
- else if (RecoverdVersion > DefaultVersion)
|
|
|
- {
|
|
|
- //configDocument = DefaultConfigDocument;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (!IDRequestFlag)
|
|
|
- {
|
|
|
- if (HttpManager.ID != PlayerConfigLabel.DefaultID)
|
|
|
- {
|
|
|
- IDRequestFlag = true;
|
|
|
- Debug.LogWarning("DownloadByID");
|
|
|
-
|
|
|
- HttpManager.GetConfigByID(HttpManager.ID, RecoveConfigDocument);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Debug.LogWarning("Use Default");
|
|
|
- configDocument = DefaultConfigDocument;
|
|
|
- PlayerDocumentDamageFlag = false;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Debug.LogWarning("Use Default");
|
|
|
- configDocument = DefaultConfigDocument;
|
|
|
- PlayerDocumentDamageFlag = false;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static void SaveSkillList()
|
|
|
- {
|
|
|
- if (TutorialManager.NewplayerTutorial || !Manager.Inited)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- XmlNode xmlNode;
|
|
|
- XmlAttribute xmlAttribute;
|
|
|
-
|
|
|
- xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SkillList);
|
|
|
- xmlNode.RemoveAll();
|
|
|
-
|
|
|
- for (int i = 0; i < Manager.SkillList.Count; i++)
|
|
|
- {
|
|
|
- if (Manager.SkillList[i].SkillType == SkillType.Skill)
|
|
|
- {
|
|
|
- #region Skill
|
|
|
-
|
|
|
- Skill skill = (Skill)Manager.SkillList[i];
|
|
|
-
|
|
|
- xmlNode = xmlNode.AppendChild(ConfigDocument.CreateNode(XmlNodeType.Element, PlayerConfigLabel.Skill, ""));
|
|
|
-
|
|
|
- xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ID));
|
|
|
- xmlAttribute.Value = skill.FullID;
|
|
|
-
|
|
|
- xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.SkillType));
|
|
|
- xmlAttribute.Value = skill.SkillType.ToString();
|
|
|
-
|
|
|
- xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ItemStatus));
|
|
|
- xmlAttribute.Value = skill.ItemStatus.ToString();
|
|
|
-
|
|
|
- xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.Level));
|
|
|
- xmlAttribute.Value = skill.Level.ToString();
|
|
|
-
|
|
|
- xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.CoolTimer));
|
|
|
- xmlAttribute.Value = skill.CoolTimer.ToString("0");
|
|
|
-
|
|
|
- xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.UseTimer));
|
|
|
- xmlAttribute.Value = skill.UseTimer.ToString("0");
|
|
|
-
|
|
|
- xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SkillList);
|
|
|
-
|
|
|
- #endregion
|
|
|
- }
|
|
|
- else if (Manager.SkillList[i].SkillType == SkillType.Pack)
|
|
|
- {
|
|
|
- #region Pack
|
|
|
-
|
|
|
- Pack pack = (Pack)Manager.SkillList[i];
|
|
|
-
|
|
|
- xmlNode = xmlNode.AppendChild(ConfigDocument.CreateNode(XmlNodeType.Element, PlayerConfigLabel.Skill, ""));
|
|
|
-
|
|
|
- xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ID));
|
|
|
- xmlAttribute.Value = pack.FullID;
|
|
|
-
|
|
|
- xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.SkillType));
|
|
|
- xmlAttribute.Value = pack.SkillType.ToString();
|
|
|
-
|
|
|
- xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ItemStatus));
|
|
|
- xmlAttribute.Value = pack.ItemStatus.ToString();
|
|
|
-
|
|
|
- xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.Level));
|
|
|
- xmlAttribute.Value = pack.Level.ToString();
|
|
|
-
|
|
|
- xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SkillList);
|
|
|
-
|
|
|
- #endregion
|
|
|
- }
|
|
|
- else if (Manager.SkillList[i].SkillType == SkillType.Ability)
|
|
|
- {
|
|
|
- #region Ability
|
|
|
-
|
|
|
- Ability ability = (Ability)Manager.SkillList[i];
|
|
|
-
|
|
|
- xmlNode = xmlNode.AppendChild(ConfigDocument.CreateNode(XmlNodeType.Element, PlayerConfigLabel.Skill, ""));
|
|
|
-
|
|
|
- xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ID));
|
|
|
- xmlAttribute.Value = ability.FullID;
|
|
|
-
|
|
|
- xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.SkillType));
|
|
|
- xmlAttribute.Value = ability.SkillType.ToString();
|
|
|
-
|
|
|
- xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ItemStatus));
|
|
|
- xmlAttribute.Value = ability.ItemStatus.ToString();
|
|
|
-
|
|
|
- xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.Level));
|
|
|
- xmlAttribute.Value = ability.Level.ToString();
|
|
|
-
|
|
|
- xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SkillList);
|
|
|
-
|
|
|
- #endregion
|
|
|
- }
|
|
|
- else if (Manager.SkillList[i].SkillType == SkillType.BigSkill)
|
|
|
- {
|
|
|
- #region BigSkill
|
|
|
-
|
|
|
- BigSkill bigSkill = (BigSkill)Manager.SkillList[i];
|
|
|
-
|
|
|
- xmlNode = xmlNode.AppendChild(ConfigDocument.CreateNode(XmlNodeType.Element, PlayerConfigLabel.Skill, ""));
|
|
|
-
|
|
|
- xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ID));
|
|
|
- xmlAttribute.Value = bigSkill.FullID;
|
|
|
-
|
|
|
- xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.SkillType));
|
|
|
- xmlAttribute.Value = bigSkill.SkillType.ToString();
|
|
|
-
|
|
|
- xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ItemStatus));
|
|
|
- xmlAttribute.Value = bigSkill.ItemStatus.ToString();
|
|
|
-
|
|
|
- xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.BarStatus));
|
|
|
- xmlAttribute.Value = bigSkill.BarStatus.ToString();
|
|
|
-
|
|
|
- xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.Level));
|
|
|
- xmlAttribute.Value = bigSkill.Level.ToString();
|
|
|
-
|
|
|
- xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.CoolTimer));
|
|
|
- xmlAttribute.Value = bigSkill.CoolTimer.ToString("0");
|
|
|
-
|
|
|
- xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.UseTimer));
|
|
|
- xmlAttribute.Value = bigSkill.UseTimer.ToString("0");
|
|
|
-
|
|
|
- xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SkillList);
|
|
|
-
|
|
|
- #endregion
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static void SaveDress()
|
|
|
- {
|
|
|
- XmlNode xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.DressList);
|
|
|
- xmlNode.Attributes[0].Value = "";
|
|
|
-
|
|
|
- for (int i = 0; i < PlayerManager.BoughtCloseIDs.Count; i++)
|
|
|
- {
|
|
|
- xmlNode.Attributes[0].Value += PlayerManager.BoughtCloseIDs[i] + " ";
|
|
|
- }
|
|
|
-
|
|
|
- xmlNode.Attributes[0].Value = xmlNode.Attributes[0].Value.TrimEnd(' ');
|
|
|
-
|
|
|
-
|
|
|
- xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.DressData);
|
|
|
-
|
|
|
- for (int i = 0; i < PlayerManager.DressDatas.Count; i++)
|
|
|
- {
|
|
|
- xmlNode.Attributes[i].Value = PlayerManager.DressDatas[i];
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static void SaveAchieve()
|
|
|
- {
|
|
|
- XmlNode xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveList);
|
|
|
- xmlNode.Attributes[0].Value = "";
|
|
|
-
|
|
|
- foreach (var kv in AchieveManager.AchieveItemDictionary)
|
|
|
- {
|
|
|
- if (!kv.Value.Lock)
|
|
|
- {
|
|
|
- xmlNode.Attributes[0].Value += kv.Value.ID + " ";
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- xmlNode.Attributes[0].Value = xmlNode.Attributes[0].Value.TrimEnd(' ');
|
|
|
-
|
|
|
-
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[0].Value = Manager.PlayADsAmt.ToString("0");
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[1].Value = Manager.UseSkillAmt.ToString("0");
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[2].Value = Manager.SignAmt.ToString("0");
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[3].Value = Manager.ShareAmt.ToString("0");
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[4].Value = Manager.AllElfLevel.ToString("0");
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[5].Value = Manager.PlayMinigameAmt.ToString("0");
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[6].Value = Manager.TotalFlowerAwardCoin.ToString("0");
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[7].Value = Manager.TotalVisitPerson.ToString("0");
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[8].Value = Manager.TotalSpendDiamond.ToString("0");
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[9].Value = Manager.CreateRoomAmt.ToString("0");
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[10].Value = Manager.CreateChestAmt.ToString("0");
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[11].Value = Manager.CreateLuckyChestAmt.ToString("0");
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[12].Value = Manager.CreateGuessColorChestAmt.ToString("0");
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[13].Value = Manager.CreateGuessNumberChestAmt.ToString("0");
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[14].Value = Manager.GetChestAwardAmt.ToString("0");
|
|
|
- }
|
|
|
-
|
|
|
- public static void SavePlantList()
|
|
|
- {
|
|
|
- if (VisitManager.InVisit || TutorialManager.NewplayerTutorial)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- XmlAttributeCollection attribute = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.PlantList).Attributes;
|
|
|
-
|
|
|
- attribute[0].Value = "";
|
|
|
-
|
|
|
- for (int i = 0; i < GardenManager.PlantSlotList.Count; i++)
|
|
|
- {
|
|
|
- Slot slot = GardenManager.PlantSlotList[i];
|
|
|
-
|
|
|
- attribute[0].Value += slot.ID + "," + slot.Index + " ";
|
|
|
- }
|
|
|
-
|
|
|
- attribute[0].Value = attribute[0].Value.TrimEnd(' ');
|
|
|
- }
|
|
|
-
|
|
|
- public static void SaveDatas()
|
|
|
- {
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.Coin).Attributes[0].Value = Manager.Coin.ToString("0");
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.Diamond).Attributes[0].Value = Manager.Diamond.ToString("0");
|
|
|
-
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SignTime).Attributes[0].Value = SignManager.LastSignTime.ToString();
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SignIndex).Attributes[0].Value = SignManager.SignIndex.ToString();
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SignRound).Attributes[0].Value = SignManager.SignRound.ToString();
|
|
|
-
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.QuitFlag).Attributes[0].Value = HttpManager.IsConnect.ToInt().ToString();
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.QuitTime).Attributes[0].Value = HttpManager.CurrentDateTime.ToString();
|
|
|
-
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.MiniTimer).Attributes[0].Value = Manager.MinigameCDTimer.ToString("0");
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.CircleTimer).Attributes[0].Value = Manager.IncomeCircleTimer.ToString("0");
|
|
|
-
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.ID).Attributes[0].Value = HttpManager.ID;
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SerialNumber).Attributes[0].Value = HttpManager.SerialNumber;
|
|
|
-
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.Language).Attributes[0].Value = LanguageManager.CurrentLanguage.ToString();
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.MiniGameIndex).Attributes[0].Value = MiniGameManager.MiniGameIndex.ToString();
|
|
|
-
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.NewplayerTutorial).Attributes[0].Value = TutorialManager.NewplayerTutorial.ToInt().ToString();
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.MemoryMinigameTutorial).Attributes[0].Value = TutorialManager.memoryMinigameTutorial.ToInt().ToString();
|
|
|
-
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.VisitTutorial).Attributes[0].Value = TutorialManager.visitTutorial.ToInt().ToString();
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.DressroomTutorial).Attributes[0].Value = TutorialManager.dressroomTutorial.ToInt().ToString();
|
|
|
-
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FashionShowTutorial).Attributes[0].Value = TutorialManager.fashionShowTutorial.ToInt().ToString();
|
|
|
-
|
|
|
- if (TutorialManager.findSoloMinigameTutorial || TutorialManager.FindSoloMinigameTutorial)
|
|
|
- {
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FindSoloMinigameTutorial).Attributes[0].Value = "1";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FindSoloMinigameTutorial).Attributes[0].Value = "0";
|
|
|
- }
|
|
|
- if (TutorialManager.findMissingMinigameTutorial || TutorialManager.FindMissingMinigameTutorial)
|
|
|
- {
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FindMissingMinigameTutorial).Attributes[0].Value = "1";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FindMissingMinigameTutorial).Attributes[0].Value = "0";
|
|
|
- }
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.TutorialPlazaRoom).Attributes[0].Value = TutorialManager.plazaRoomTutorial.ToInt().ToString();
|
|
|
-
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.NewplayerTutorialIndex).Attributes[0].Value = TutorialManager.NewplayerTutorialIndex.ToString();
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.MemoryMinigameTutorialIndex).Attributes[0].Value = TutorialManager.MemoryMinigameTutorialIndex.ToString();
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.VisitTutorialIndex).Attributes[0].Value = TutorialManager.VisitTutorialIndex.ToString();
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.DressroomIndex).Attributes[0].Value = TutorialManager.DressroomTutorialIndex.ToString();
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FindSoloMinigameTutorialIndex).Attributes[0].Value = TutorialManager.FindSoloMinigameTutorialIndex.ToString();
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FindMissingMinigameTutorialIndex).Attributes[0].Value = TutorialManager.FindMissingMinigameTutorialIndex.ToString();
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.TutorialIndexPlazaRoom).Attributes[0].Value = TutorialManager.PlazaRoomTutorialIndex.ToString();
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FashionShowTutorialIndex).Attributes[0].Value = TutorialManager.FashionShowTutorialIndex.ToString();
|
|
|
- }
|
|
|
-
|
|
|
- public static void SaveFlowers()
|
|
|
- {
|
|
|
- XmlAttribute attribute = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FlowerList).Attributes[0];
|
|
|
- XmlAttribute attribute1 = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FlowerAmtList).Attributes[0];
|
|
|
-
|
|
|
- attribute.Value = "";
|
|
|
- attribute1.Value = "";
|
|
|
-
|
|
|
- foreach (var kv in GardenManager.GetFlowerInfoDict())
|
|
|
- {
|
|
|
- if (kv.Value.Unlock)
|
|
|
- {
|
|
|
- attribute.Value += kv.Value.ID + " ";
|
|
|
- attribute1.Value += kv.Value.Amount + " ";
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- attribute.Value = attribute.Value.Trim(' ');
|
|
|
- attribute1.Value = attribute1.Value.Trim(' ');
|
|
|
- }
|
|
|
-
|
|
|
- public static void SaveConfigDocument()
|
|
|
- {
|
|
|
- if (Initializer.Inited)
|
|
|
- {
|
|
|
- SaveSkillList();
|
|
|
- SaveAchieve();
|
|
|
- SaveDress();
|
|
|
- SavePlantList();
|
|
|
- SaveDatas();
|
|
|
- SaveFlowers();
|
|
|
- ChestManager.SaveToConfig();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static void SaveConfigDocumentToDisk()
|
|
|
- {
|
|
|
- if (Initializer.Inited)
|
|
|
- {
|
|
|
- XmlDocument doc = new XmlDocument();
|
|
|
-
|
|
|
- doc.LoadXml(ConfigDocument.OuterXml);
|
|
|
-
|
|
|
- Auxiliary.EncryptXml(doc);
|
|
|
-
|
|
|
- StreamWriter sw = new StreamWriter(ConfigPath);
|
|
|
-
|
|
|
- sw.Write(doc.OuterXml);
|
|
|
-
|
|
|
- sw.Close();
|
|
|
-
|
|
|
- byte[] bytes = File.ReadAllBytes(ConfigPath);
|
|
|
- //byte[] bytes = Encoding.UTF8.GetBytes(PlayerDoc.OuterXml);
|
|
|
-
|
|
|
- MD5 md5 = new MD5CryptoServiceProvider();
|
|
|
-
|
|
|
- PlayerPrefs.SetString(Lib.ConfigPrefs, Auxiliary.ToString(md5.ComputeHash(bytes)));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static void ResetConfigDocument()
|
|
|
- {
|
|
|
- ConfigRootNode.SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = ConfigReplayVersion.ToString();
|
|
|
-
|
|
|
- SaveConfigDocument();
|
|
|
-
|
|
|
- Manager.UploadConfigFlag = true;
|
|
|
- Manager.DownloadConfigFlag = true;
|
|
|
-
|
|
|
- SaveConfigDocumentToDisk();
|
|
|
-
|
|
|
- DelayCall.Call
|
|
|
- (
|
|
|
- 1,
|
|
|
- () =>
|
|
|
- {
|
|
|
- Bubble.Show(null, Language.GetStr(LanguageLabel.UI__La_Lab0), null, null, () => { Application.Quit(); }, null, false);
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static int GetIntFormConfig(string node)
|
|
|
- {
|
|
|
- return int.Parse(ConfigRootNode.SelectSingleNode(node).Attributes[0].Value);
|
|
|
- }
|
|
|
-
|
|
|
- public static bool GetBoolFormConfig(string node)
|
|
|
- {
|
|
|
- return int.Parse(ConfigRootNode.SelectSingleNode(node).Attributes[0].Value).ToBool();
|
|
|
- }
|
|
|
-
|
|
|
- public static float GetFloatFormConfig(string node)
|
|
|
- {
|
|
|
- return float.Parse(ConfigRootNode.SelectSingleNode(node).Attributes[0].Value);
|
|
|
- }
|
|
|
-
|
|
|
- public static string GetStringFormConfig(string node)
|
|
|
- {
|
|
|
- return ConfigRootNode.SelectSingleNode(node).Attributes[0].Value;
|
|
|
- }
|
|
|
-
|
|
|
- public static double GetDoubleFormConfig(string node)
|
|
|
- {
|
|
|
- return double.Parse(ConfigRootNode.SelectSingleNode(node).Attributes[0].Value);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static void SaveIntToConfig(string node, int value)
|
|
|
- {
|
|
|
- ConfigRootNode.SelectSingleNode(node).Attributes[0].Value = value.ToString();
|
|
|
- }
|
|
|
-
|
|
|
- public static void SaveBoolToConfig(string node, bool value)
|
|
|
- {
|
|
|
- ConfigRootNode.SelectSingleNode(node).Attributes[0].Value = value.ToInt().ToString();
|
|
|
- }
|
|
|
-
|
|
|
- public static void SaveFloatToConfig(string node, float value)
|
|
|
- {
|
|
|
- ConfigRootNode.SelectSingleNode(node).Attributes[0].Value = value.ToString();
|
|
|
- }
|
|
|
-
|
|
|
- public static void SaveStringToConfig(string node, string value)
|
|
|
- {
|
|
|
- ConfigRootNode.SelectSingleNode(node).Attributes[0].Value = value;
|
|
|
- }
|
|
|
-
|
|
|
- public static void SaveDoubleToConfig(string node, double value)
|
|
|
- {
|
|
|
- ConfigRootNode.SelectSingleNode(node).Attributes[0].Value = value.ToString();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static List<int> GetIntList(char splitChar, string nodeName, List<int> defaultList)
|
|
|
- {
|
|
|
- return Auxiliary.StringToInts(splitChar, ConfigRootNode.SelectSingleNode(nodeName).Attributes[0].Value, defaultList);
|
|
|
- }
|
|
|
-
|
|
|
- public static List<string> GetStringList(char splitChar, string nodeName, List<string> defaultList)
|
|
|
- {
|
|
|
- return Auxiliary.StringToStrings(splitChar, ConfigRootNode.SelectSingleNode(nodeName).Attributes[0].Value, defaultList);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static List<int> GetDressList()
|
|
|
- {
|
|
|
- List<int> list = new List<int>();
|
|
|
-
|
|
|
- XmlAttributeCollection attribute = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.DressList).Attributes;
|
|
|
-
|
|
|
- return Auxiliary.StringToInts(' ', attribute[0].Value, list);
|
|
|
- }
|
|
|
-
|
|
|
- public static List<int> GetDressDataIDs(Player player)
|
|
|
- {
|
|
|
- //foreach (var VARIABLE in ManaPlayer.CloseIDDic)
|
|
|
- //{
|
|
|
- // Debug.LogWarning(VARIABLE.Key);
|
|
|
- //}
|
|
|
-
|
|
|
- List<int> dressDataIDs = new List<int>();
|
|
|
-
|
|
|
- dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.Head]);
|
|
|
- dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.Dress]);
|
|
|
- dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.Shoe]);
|
|
|
- dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.HeadWear]);
|
|
|
- dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.Top]);
|
|
|
- dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.Eye]);
|
|
|
- dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.Mouse]);
|
|
|
- dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.Wing]);
|
|
|
-
|
|
|
- return dressDataIDs;
|
|
|
- }
|
|
|
-
|
|
|
- public static List<int> GetDressDataIDs(List<string> dressdataNames)
|
|
|
- {
|
|
|
- //foreach (var VARIABLE in ManaPlayer.CloseIDDic)
|
|
|
- //{
|
|
|
- // Debug.LogWarning(VARIABLE.Key);
|
|
|
- //}
|
|
|
-
|
|
|
- List<int> dressDataIDs = new List<int>();
|
|
|
-
|
|
|
- int index = 0;
|
|
|
- dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
|
|
|
- dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
|
|
|
- dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
|
|
|
- dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
|
|
|
- dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
|
|
|
- dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
|
|
|
- dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
|
|
|
- dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
|
|
|
-
|
|
|
- return dressDataIDs;
|
|
|
- }
|
|
|
-
|
|
|
- public static List<int> GetDressDataIDs(ISFSObject parameter)
|
|
|
- {
|
|
|
- List<int> ids = parameter.GetIntArray(InfoLabel.Close.GetHashString()).ToList();
|
|
|
-
|
|
|
- return ids;
|
|
|
- }
|
|
|
-
|
|
|
- public static List<string> GetDressData(SFSObject parameter)
|
|
|
- {
|
|
|
- List<int> ids = GetDressDataIDs(parameter);
|
|
|
-
|
|
|
- List<string> dressData = new List<string>();
|
|
|
-
|
|
|
- foreach (var id in ids)
|
|
|
- {
|
|
|
- dressData.Add(PlayerManager.CloseItemDictionary[id].ArmatureName);
|
|
|
- }
|
|
|
-
|
|
|
- return dressData;
|
|
|
- }
|
|
|
-
|
|
|
- public static List<string> GetDressData(XmlNode node = null)
|
|
|
- {
|
|
|
- XmlNode xmlNode;
|
|
|
-
|
|
|
- if (node == null)
|
|
|
- {
|
|
|
- xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.DressData);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- xmlNode = node.SelectSingleNode(PlayerConfigLabel.DressData);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- List<string> dataList = new List<string>();
|
|
|
-
|
|
|
- if (xmlNode != null && xmlNode.Attributes.Count == 12)
|
|
|
- {
|
|
|
- dataList.Add(xmlNode.Attributes[0].Value);
|
|
|
- dataList.Add(xmlNode.Attributes[1].Value);
|
|
|
- dataList.Add(xmlNode.Attributes[2].Value);
|
|
|
- dataList.Add(xmlNode.Attributes[3].Value);
|
|
|
- dataList.Add(xmlNode.Attributes[4].Value);
|
|
|
- dataList.Add(xmlNode.Attributes[5].Value);
|
|
|
- dataList.Add(xmlNode.Attributes[6].Value);
|
|
|
- dataList.Add(xmlNode.Attributes[7].Value);
|
|
|
- dataList.Add(xmlNode.Attributes[8].Value);
|
|
|
- dataList.Add(xmlNode.Attributes[9].Value);
|
|
|
- dataList.Add(xmlNode.Attributes[10].Value);
|
|
|
- dataList.Add(xmlNode.Attributes[11].Value);
|
|
|
-
|
|
|
- //dataList[8] = "长袖9左";
|
|
|
- //dataList[9] = "Empty";
|
|
|
- //dataList[10] = "长袖9右";
|
|
|
- //dataList[11] = "Empty";
|
|
|
- }
|
|
|
- else if(xmlNode != null && xmlNode.Attributes.Count == 8)
|
|
|
- {
|
|
|
- dataList.Add(xmlNode.Attributes[0].Value);
|
|
|
- dataList.Add(xmlNode.Attributes[1].Value);
|
|
|
- dataList.Add(xmlNode.Attributes[2].Value);
|
|
|
- dataList.Add(xmlNode.Attributes[3].Value);
|
|
|
- dataList.Add(xmlNode.Attributes[4].Value);
|
|
|
- dataList.Add(xmlNode.Attributes[5].Value);
|
|
|
- dataList.Add(xmlNode.Attributes[6].Value);
|
|
|
- dataList.Add(xmlNode.Attributes[7].Value);
|
|
|
- dataList.AddRange (GetSleeveListByTop(xmlNode.Attributes[4].Value));
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- float rate = Random.Range(0f, 1f);
|
|
|
-
|
|
|
- if (rate < 0.33f)
|
|
|
- {
|
|
|
- dataList.Add("脑壳1");
|
|
|
- dataList.Add("裙子1");
|
|
|
- dataList.Add("鞋子1");
|
|
|
- dataList.Add("头饰品1");
|
|
|
- dataList.Add("上衣1");
|
|
|
- dataList.Add("眼睛1");
|
|
|
- dataList.Add("嘴巴1");
|
|
|
- dataList.Add("Empty");
|
|
|
- dataList.Add("Empty");
|
|
|
- dataList.Add("短袖1左");
|
|
|
- dataList.Add("Empty");
|
|
|
- dataList.Add("短袖1右");
|
|
|
- }
|
|
|
- else if (rate < 0.66f)
|
|
|
- {
|
|
|
- dataList.Add("脑壳2");
|
|
|
- dataList.Add("裙子2");
|
|
|
- dataList.Add("鞋子2");
|
|
|
- dataList.Add("头饰品2");
|
|
|
- dataList.Add("上衣2");
|
|
|
- dataList.Add("眼睛2");
|
|
|
- dataList.Add("嘴巴2");
|
|
|
- dataList.Add("Empty");
|
|
|
- dataList.Add("Empty");
|
|
|
- dataList.Add("短袖2左");
|
|
|
- dataList.Add("Empty");
|
|
|
- dataList.Add("短袖2右");
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- dataList.Add("脑壳3");
|
|
|
- dataList.Add("裙子3");
|
|
|
- dataList.Add("鞋子3");
|
|
|
- dataList.Add("头饰品3");
|
|
|
- dataList.Add("上衣3");
|
|
|
- dataList.Add("眼睛3");
|
|
|
- dataList.Add("嘴巴3");
|
|
|
- dataList.Add("Empty");
|
|
|
- dataList.Add("Empty");
|
|
|
- dataList.Add("短袖2左");
|
|
|
- dataList.Add("Empty");
|
|
|
- dataList.Add("短袖2右");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return dataList;
|
|
|
- }
|
|
|
-
|
|
|
- public static List<int> GetFlowerList()
|
|
|
- {
|
|
|
- List<int> list = new List<int>();
|
|
|
-
|
|
|
- XmlAttributeCollection attribute = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FlowerList).Attributes;
|
|
|
-
|
|
|
- return Auxiliary.StringToInts(' ', attribute[0].Value, list);
|
|
|
- }
|
|
|
-
|
|
|
- public static List<int> GetLockAchieveIDs()
|
|
|
- {
|
|
|
- return Auxiliary.StringToInts(' ', GetStringFormConfig(PlayerConfigLabel.AchieveList), new List<int>());
|
|
|
- }
|
|
|
-
|
|
|
- public static List<double> GetAchieveValues()
|
|
|
- {
|
|
|
- List<double> dataList = new List<double>();
|
|
|
-
|
|
|
- dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[0].Value));
|
|
|
- dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[1].Value));
|
|
|
- dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[2].Value));
|
|
|
- dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[3].Value));
|
|
|
- dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[4].Value));
|
|
|
- dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[5].Value));
|
|
|
- dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[6].Value));
|
|
|
- dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[7].Value));
|
|
|
- dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[8].Value));
|
|
|
- dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[9].Value));
|
|
|
- dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[10].Value));
|
|
|
- dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[11].Value));
|
|
|
- dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[12].Value));
|
|
|
- dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[13].Value));
|
|
|
- dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[14].Value));
|
|
|
-
|
|
|
- return dataList;
|
|
|
- }
|
|
|
-
|
|
|
- public static List<KV<int, int>> GetPlantList(XmlNode node = null)
|
|
|
- {
|
|
|
- List<KV<int, int>> list = new List<KV<int, int>>();
|
|
|
-
|
|
|
- XmlNode xmlNode;
|
|
|
-
|
|
|
- if (node == null)
|
|
|
- {
|
|
|
- xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.PlantList);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- xmlNode = node.SelectSingleNode(PlayerConfigLabel.PlantList);
|
|
|
- }
|
|
|
-
|
|
|
- if (!string.IsNullOrEmpty(xmlNode.Attributes[0].Value))
|
|
|
- {
|
|
|
- string[] strings = xmlNode.Attributes[0].Value.Split(' ');
|
|
|
-
|
|
|
- for (int i = 0; i < strings.Length; i++)
|
|
|
- {
|
|
|
- list.Add(new KV<int, int>(int.Parse(strings[i].Split(',')[0]), int.Parse(strings[i].Split(',')[1])));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return list;
|
|
|
- }
|
|
|
-
|
|
|
- public static List<XmlAttributeCollection> GetSkillList(XmlNode node = null)
|
|
|
- {
|
|
|
- List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
|
|
|
-
|
|
|
- XmlNodeList xmlNodeList;
|
|
|
-
|
|
|
- if (node == null)
|
|
|
- {
|
|
|
- xmlNodeList = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SkillList).ChildNodes;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- xmlNodeList = node.SelectSingleNode(PlayerConfigLabel.SkillList).ChildNodes;
|
|
|
- }
|
|
|
-
|
|
|
- for (int i = 0; i < xmlNodeList.Count; i++)
|
|
|
- {
|
|
|
- attributeList.Add(xmlNodeList[i].Attributes);
|
|
|
- }
|
|
|
-
|
|
|
- return attributeList;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static List<string> GetOfflineConfig()
|
|
|
- {
|
|
|
- TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.OfflineConfig, Folder.Config);
|
|
|
-
|
|
|
- XmlDocument xmlDoc = new XmlDocument();
|
|
|
-
|
|
|
- xmlDoc.LoadXml(textAsset.text);
|
|
|
-
|
|
|
- XmlNode xmlNode = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectSingleNode(ConfigLabel.ChildNode);
|
|
|
-
|
|
|
- List<string> strList = new List<string>()
|
|
|
- {
|
|
|
- xmlNode.Attributes[1].Value,
|
|
|
- xmlNode.Attributes[2].Value,
|
|
|
- xmlNode.Attributes[3].Value,
|
|
|
- };
|
|
|
-
|
|
|
- return strList;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlAttributeCollection GetVisitConfig()
|
|
|
- {
|
|
|
- TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.VisitConfig, Folder.Config);
|
|
|
-
|
|
|
- XmlDocument xmlDoc = new XmlDocument();
|
|
|
-
|
|
|
- xmlDoc.LoadXml(textAsset.text);
|
|
|
-
|
|
|
- XmlNode xmlNode = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectSingleNode(ConfigLabel.ChildNode);
|
|
|
-
|
|
|
- return xmlNode.Attributes;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlAttributeCollection GetPlazaRoomConfig()
|
|
|
- {
|
|
|
- TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.PlazaroomConfig, Folder.Config);
|
|
|
-
|
|
|
- XmlDocument xmlDoc = new XmlDocument();
|
|
|
-
|
|
|
- xmlDoc.LoadXml(textAsset.text);
|
|
|
-
|
|
|
- XmlNode xmlNode = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectSingleNode(ConfigLabel.ChildNode);
|
|
|
-
|
|
|
- return xmlNode.Attributes;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlAttributeCollection GetAwardConfig()
|
|
|
- {
|
|
|
- TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.AwardConfig, Folder.Config);
|
|
|
-
|
|
|
- XmlDocument xmlDoc = new XmlDocument();
|
|
|
-
|
|
|
- xmlDoc.LoadXml(textAsset.text);
|
|
|
-
|
|
|
- XmlNode xmlNode = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectSingleNode(ConfigLabel.ChildNode);
|
|
|
-
|
|
|
- return xmlNode.Attributes;
|
|
|
- }
|
|
|
-
|
|
|
- public static List<XmlAttributeCollection> GetIAPConfig()
|
|
|
- {
|
|
|
- TextAsset textAsset;
|
|
|
- XmlNodeList xmlNodeList;
|
|
|
-
|
|
|
- XmlDocument xmlDoc = new XmlDocument();
|
|
|
- List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
|
|
|
-
|
|
|
-
|
|
|
- textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.IAPConfig, Folder.Config);
|
|
|
-
|
|
|
- xmlDoc.LoadXml(textAsset.text);
|
|
|
-
|
|
|
- xmlNodeList = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode);
|
|
|
-
|
|
|
- for (int i = 0; i < xmlNodeList.Count; i++)
|
|
|
- {
|
|
|
- attributeList.Add(xmlNodeList[i].Attributes);
|
|
|
- }
|
|
|
-
|
|
|
- return attributeList;
|
|
|
- }
|
|
|
-
|
|
|
- public static List<XmlAttributeCollection> GetSkillConfig()
|
|
|
- {
|
|
|
- TextAsset textAsset;
|
|
|
- XmlDocument xmlDoc = new XmlDocument();
|
|
|
- List<XmlNodeList> xmlNodeList = new List<XmlNodeList>();
|
|
|
- List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
|
|
|
-
|
|
|
- textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.PackConfig, Folder.Config);
|
|
|
- xmlDoc.LoadXml(textAsset.text);
|
|
|
- xmlNodeList.Add(xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode));
|
|
|
-
|
|
|
- textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.SkillConfig, Folder.Config);
|
|
|
- xmlDoc.LoadXml(textAsset.text);
|
|
|
- xmlNodeList.Add(xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode));
|
|
|
-
|
|
|
- textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.AbilityConfig, Folder.Config);
|
|
|
- xmlDoc.LoadXml(textAsset.text);
|
|
|
- xmlNodeList.Add(xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode));
|
|
|
-
|
|
|
- for (int i = 0; i < xmlNodeList.Count; i++)
|
|
|
- {
|
|
|
- for (int j = 0; j < xmlNodeList[i].Count; j++)
|
|
|
- {
|
|
|
- attributeList.Add(xmlNodeList[i][j].Attributes);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return attributeList;
|
|
|
- }
|
|
|
-
|
|
|
- public static List<XmlAttributeCollection> GetSignConfig()
|
|
|
- {
|
|
|
- TextAsset textAsset;
|
|
|
- XmlNodeList xmlNodeList;
|
|
|
-
|
|
|
- XmlDocument xmlDoc = new XmlDocument();
|
|
|
- List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
|
|
|
-
|
|
|
-
|
|
|
- textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.SigninConfig, Folder.Config);
|
|
|
-
|
|
|
- xmlDoc.LoadXml(textAsset.text);
|
|
|
-
|
|
|
- xmlNodeList = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode);
|
|
|
-
|
|
|
- for (int i = 0; i < xmlNodeList.Count; i++)
|
|
|
- {
|
|
|
- attributeList.Add(xmlNodeList[i].Attributes);
|
|
|
- }
|
|
|
-
|
|
|
- return attributeList;
|
|
|
- }
|
|
|
-
|
|
|
- public static List<XmlAttributeCollection> GetFlowerConfig(TextAsset textAsset = null)
|
|
|
- {
|
|
|
- XmlNodeList xmlNodeList;
|
|
|
-
|
|
|
- XmlDocument xmlDoc = new XmlDocument();
|
|
|
- List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
|
|
|
-
|
|
|
- if (textAsset == null)
|
|
|
- {
|
|
|
- textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.FlowerConfig, Folder.Config);
|
|
|
- }
|
|
|
-
|
|
|
- xmlDoc.LoadXml(textAsset.text);
|
|
|
-
|
|
|
- xmlNodeList = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode);
|
|
|
-
|
|
|
- for (int i = 0; i < xmlNodeList.Count; i++)
|
|
|
- {
|
|
|
- attributeList.Add(xmlNodeList[i].Attributes);
|
|
|
- }
|
|
|
-
|
|
|
- return attributeList;
|
|
|
- }
|
|
|
-
|
|
|
- public static List<XmlAttributeCollection> GetLotteryConfig()
|
|
|
- {
|
|
|
- TextAsset textAsset;
|
|
|
- XmlNodeList xmlNodeList;
|
|
|
-
|
|
|
- XmlDocument xmlDoc = new XmlDocument();
|
|
|
- List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
|
|
|
-
|
|
|
-
|
|
|
- textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.LotteryConfig, Folder.Config);
|
|
|
-
|
|
|
- xmlDoc.LoadXml(textAsset.text);
|
|
|
-
|
|
|
- xmlNodeList = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode);
|
|
|
-
|
|
|
- for (int i = 0; i < xmlNodeList.Count; i++)
|
|
|
- {
|
|
|
- attributeList.Add(xmlNodeList[i].Attributes);
|
|
|
- }
|
|
|
-
|
|
|
- return attributeList;
|
|
|
- }
|
|
|
-
|
|
|
- public static List<XmlAttributeCollection> GetAchieveConfig()
|
|
|
- {
|
|
|
- TextAsset textAsset;
|
|
|
- XmlNodeList xmlNodeList;
|
|
|
-
|
|
|
- XmlDocument xmlDoc = new XmlDocument();
|
|
|
- List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
|
|
|
-
|
|
|
-
|
|
|
- textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.AchieveConfig, Folder.Config);
|
|
|
-
|
|
|
- xmlDoc.LoadXml(textAsset.text);
|
|
|
-
|
|
|
- xmlNodeList = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode);
|
|
|
-
|
|
|
- for (int i = 0; i < xmlNodeList.Count; i++)
|
|
|
- {
|
|
|
- attributeList.Add(xmlNodeList[i].Attributes);
|
|
|
- }
|
|
|
-
|
|
|
- return attributeList;
|
|
|
- }
|
|
|
-
|
|
|
- public static List<XmlAttributeCollection> GetDressRoomConfig(TextAsset textAsset = null)
|
|
|
- {
|
|
|
- XmlNodeList xmlNodeList;
|
|
|
-
|
|
|
- XmlDocument xmlDoc = new XmlDocument();
|
|
|
- List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
|
|
|
-
|
|
|
- if (textAsset == null)
|
|
|
- {
|
|
|
- textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.DressroomConfig, Folder.Config);
|
|
|
- }
|
|
|
-
|
|
|
- xmlDoc.LoadXml(textAsset.text);
|
|
|
-
|
|
|
- xmlNodeList = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode);
|
|
|
-
|
|
|
- for (int i = 0; i < xmlNodeList.Count; i++)
|
|
|
- {
|
|
|
- attributeList.Add(xmlNodeList[i].Attributes);
|
|
|
- }
|
|
|
-
|
|
|
- return attributeList;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static int GetGardenLevel(XmlDocument xmlDocument)
|
|
|
- {
|
|
|
- XmlNodeList nodeList = xmlDocument.SelectNodes(PlayerConfigLabel.RootNode + "/" + PlayerConfigLabel.SkillList + "/" + PlayerConfigLabel.Skill);
|
|
|
- for (int i = 0; i < nodeList.Count; i++)
|
|
|
- {
|
|
|
- if (nodeList[i].Attributes[0].Value == "Ability1")
|
|
|
- {
|
|
|
- return int.Parse(nodeList[i].Attributes[3].Value);
|
|
|
- }
|
|
|
- }
|
|
|
- return -1;
|
|
|
- }
|
|
|
-
|
|
|
- public static int GetConfigVersion(XmlDocument xmlDocument)
|
|
|
- {
|
|
|
- return int.Parse(xmlDocument.SelectSingleNode(PlayerConfigLabel.RootNode + "/" + PlayerConfigLabel.Version).Attributes[0].Value);
|
|
|
- }
|
|
|
-
|
|
|
- public static List<string> GetDefaultDressDatas()
|
|
|
- {
|
|
|
- List<string> defaultDressDatas = new List<string>();
|
|
|
- defaultDressDatas.Add("脑壳-缺失");
|
|
|
- defaultDressDatas.Add("裙子-缺失");
|
|
|
- defaultDressDatas.Add("鞋子-缺失");
|
|
|
- defaultDressDatas.Add("头饰-缺失");
|
|
|
- defaultDressDatas.Add("上衣-缺失");
|
|
|
- defaultDressDatas.Add("眼睛1");
|
|
|
- defaultDressDatas.Add("嘴巴1");
|
|
|
- defaultDressDatas.Add("翅膀-缺失");
|
|
|
- defaultDressDatas.Add("Empty");
|
|
|
- defaultDressDatas.Add("Empty");
|
|
|
- defaultDressDatas.Add("Empty");
|
|
|
- defaultDressDatas.Add("Empty");
|
|
|
-
|
|
|
- //defaultDressDatas.Add("脑壳1");
|
|
|
- //defaultDressDatas.Add("裙子1");
|
|
|
- //defaultDressDatas.Add("鞋子1");
|
|
|
- //defaultDressDatas.Add("头饰品1");
|
|
|
- //defaultDressDatas.Add("上衣1");
|
|
|
- //defaultDressDatas.Add("眼睛1");
|
|
|
- //defaultDressDatas.Add("嘴巴1");
|
|
|
- //defaultDressDatas.Add("Empty");
|
|
|
- //defaultDressDatas.Add("Empty");
|
|
|
- //defaultDressDatas.Add("短袖2左");
|
|
|
- //defaultDressDatas.Add("Empty");
|
|
|
- //defaultDressDatas.Add("短袖2右");
|
|
|
-
|
|
|
- return defaultDressDatas;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static XmlDocument GetXmlDocument(string ConfigName)
|
|
|
- {
|
|
|
- TextAsset textAsset = ResourceManager.Load<TextAsset>(ConfigName, Folder.Config);
|
|
|
- XmlDocument xmlDocument = new XmlDocument();
|
|
|
- xmlDocument.LoadXml(textAsset.text);
|
|
|
- return xmlDocument;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- //玩家存档版本大于默认存档版本时需要清空
|
|
|
- //玩家存档版本小于默认存档版本时需要更新
|
|
|
- //玩家存档版本等于ReplayVersion时需要标记为重玩
|
|
|
- public static XmlDocument UpdateConfigDocument(int nativeVersion, XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- if (nativeVersion < 0)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 0");
|
|
|
-
|
|
|
- ToVersion0(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 1)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 1");
|
|
|
-
|
|
|
- ToVersion1(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 2)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 2");
|
|
|
-
|
|
|
- ToVersion2(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 3)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 3");
|
|
|
-
|
|
|
- ToVersion3(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 4)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 4");
|
|
|
-
|
|
|
- ToVersion4(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 5)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 5");
|
|
|
-
|
|
|
- ToVersion5(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 6)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 6");
|
|
|
-
|
|
|
- ToVersion6(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 7)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 7");
|
|
|
-
|
|
|
- ToVersion7(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 8)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 8");
|
|
|
-
|
|
|
- ToVersion8(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 9)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 9");
|
|
|
-
|
|
|
- ToVersion9(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 10)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 10");
|
|
|
-
|
|
|
- ToVersion10(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 11)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 11");
|
|
|
-
|
|
|
- ToVersion11(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 12)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 12");
|
|
|
-
|
|
|
- ToVersion12(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 13)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 13");
|
|
|
-
|
|
|
- ToVersion13(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 14)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 14");
|
|
|
-
|
|
|
- ToVersion14(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 15)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 15");
|
|
|
-
|
|
|
- ToVersion15(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 16)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 16");
|
|
|
-
|
|
|
- ToVersion16(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 17)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 17");
|
|
|
-
|
|
|
- ToVersion17(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 18)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 18");
|
|
|
-
|
|
|
- ToVersion18(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 19)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 19");
|
|
|
-
|
|
|
- ToVersion19(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 20)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 20");
|
|
|
-
|
|
|
- ToVersion20(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 21)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 21");
|
|
|
-
|
|
|
- ToVersion21(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 22)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 22");
|
|
|
-
|
|
|
- ToVersion22(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 23)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 23");
|
|
|
-
|
|
|
- ToVersion23(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 24)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 24");
|
|
|
-
|
|
|
- ToVersion24(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 25)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 25");
|
|
|
-
|
|
|
- ToVersion25(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 26)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 26");
|
|
|
-
|
|
|
- ToVersion26(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 28)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 28");
|
|
|
-
|
|
|
- ToVersion28(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 29)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 29");
|
|
|
-
|
|
|
- ToVersion29(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 30)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 30");
|
|
|
-
|
|
|
- ToVersion30(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 31)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 31");
|
|
|
-
|
|
|
- ToVersion31(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 32)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 32");
|
|
|
-
|
|
|
- ToVersion32(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 33)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 33");
|
|
|
-
|
|
|
- ToVersion33(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 34)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 34");
|
|
|
-
|
|
|
- ToVersion34(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 35)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 35");
|
|
|
-
|
|
|
- ToVersion35(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- if (nativeVersion < 36)
|
|
|
- {
|
|
|
- Debug.LogWarning("UpdateArchive to 36");
|
|
|
-
|
|
|
- ToVersion36(nativeDoc, defaultDoc);
|
|
|
- }
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion0(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 0.ToString();
|
|
|
-
|
|
|
- XmlNode xmlNode1 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.ADPlayTime);
|
|
|
-
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode1, true));
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion1(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 1.ToString();
|
|
|
-
|
|
|
- XmlNode xmlNode1 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.SerialNumber);
|
|
|
-
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode1, true));
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion2(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 2.ToString();
|
|
|
-
|
|
|
- XmlNode xmlNode1 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.NotificationIndex);
|
|
|
-
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode1, true));
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion3(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 3.ToString();
|
|
|
-
|
|
|
- XmlNode xmlNode1 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.NickName);
|
|
|
-
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode1, true));
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion4(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 4.ToString();
|
|
|
-
|
|
|
- XmlNode xmlNode = nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.DressData);
|
|
|
-
|
|
|
- XmlAttribute attribute = xmlNode.Attributes.Append (nativeDoc.CreateAttribute (PlayerConfigLabel.LeftLongSleeveSlot));
|
|
|
- attribute.Value="Empty";
|
|
|
-
|
|
|
- attribute = xmlNode.Attributes.Append (nativeDoc.CreateAttribute (PlayerConfigLabel.LeftShortSleeveSlot));
|
|
|
- attribute.Value="Empty";
|
|
|
-
|
|
|
- attribute = xmlNode.Attributes.Append (nativeDoc.CreateAttribute (PlayerConfigLabel.RightLongSleeveSlot));
|
|
|
- attribute.Value="Empty";
|
|
|
-
|
|
|
- attribute = xmlNode.Attributes.Append (nativeDoc.CreateAttribute (PlayerConfigLabel.RightShortSleeveSlot));
|
|
|
- attribute.Value="Empty";
|
|
|
-
|
|
|
- List<string> sleeveList = GetSleeveListByTop (xmlNode.Attributes [4].Value);
|
|
|
-
|
|
|
- xmlNode.Attributes [8].Value = sleeveList[0];
|
|
|
- xmlNode.Attributes [9].Value = sleeveList[1];
|
|
|
- xmlNode.Attributes [10].Value = sleeveList[2];
|
|
|
- xmlNode.Attributes [11].Value = sleeveList[3];
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static List<string> GetSleeveListByTop(string topName)
|
|
|
- {
|
|
|
- List<string> sleeveList = new List<string>() {"Empty", "Empty", "Empty", "Empty"};
|
|
|
-
|
|
|
- if (topName == "上衣1")
|
|
|
- {
|
|
|
- sleeveList[1] = "短袖1左";
|
|
|
- sleeveList[3] = "短袖1右";
|
|
|
- }
|
|
|
- else if (topName == "上衣2")
|
|
|
- {
|
|
|
- sleeveList[1] = "短袖2左";
|
|
|
- sleeveList[3] = "短袖2右";
|
|
|
- }
|
|
|
- else if (topName == "上衣3")
|
|
|
- {
|
|
|
- sleeveList[1] = "短袖2左";
|
|
|
- sleeveList[3] = "短袖2右";
|
|
|
- }
|
|
|
- else if (topName == "上衣5")
|
|
|
- {
|
|
|
- sleeveList[1] = "短袖2左";
|
|
|
- sleeveList[3] = "短袖2右";
|
|
|
- }
|
|
|
- else if (topName == "上衣6")
|
|
|
- {
|
|
|
- sleeveList[1] = "短袖6左";
|
|
|
- sleeveList[3] = "短袖6右";
|
|
|
- }
|
|
|
- else if (topName == "上衣7")
|
|
|
- {
|
|
|
- sleeveList[1] = "短袖7左";
|
|
|
- sleeveList[3] = "短袖7右";
|
|
|
- }
|
|
|
- else if (topName == "上衣7(粉)")
|
|
|
- {
|
|
|
- sleeveList[1] = "短袖7粉左";
|
|
|
- sleeveList[3] = "短袖7粉右";
|
|
|
- }
|
|
|
- else if (topName == "上衣12")
|
|
|
- {
|
|
|
- sleeveList[1] = "短袖12左";
|
|
|
- sleeveList[3] = "短袖12右";
|
|
|
- }
|
|
|
- else if (topName == "上衣13")
|
|
|
- {
|
|
|
- sleeveList[1] = "短袖13左";
|
|
|
- sleeveList[3] = "短袖13右";
|
|
|
- }
|
|
|
- else if (topName == "上衣13(紫)")
|
|
|
- {
|
|
|
- sleeveList[1] = "短袖13蓝左";
|
|
|
- sleeveList[3] = "短袖13蓝右";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- sleeveList[0] = "长袖9左";
|
|
|
- sleeveList[2] = "长袖9右";
|
|
|
- }
|
|
|
-
|
|
|
- return sleeveList;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion5(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 5.ToString();
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion6(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 6.ToString();
|
|
|
-
|
|
|
- XmlNode xmlNode1 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.NewFlowerFlag);
|
|
|
-
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode1, true));
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- private static int DefaultFlowerAmt = 1;
|
|
|
- public static XmlDocument ToVersion7(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 7.ToString();
|
|
|
-
|
|
|
- XmlNode xmlNode1 = nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.FlowerList);
|
|
|
- string[] flowerIDs= xmlNode1.Attributes[0].Value.Split(' ');
|
|
|
-
|
|
|
- xmlNode1 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.FlowerAmtList);
|
|
|
- xmlNode1.Attributes[0].Value = "";
|
|
|
- foreach (var flowerID in flowerIDs)
|
|
|
- {
|
|
|
- xmlNode1.Attributes[0].Value += " " + DefaultFlowerAmt;
|
|
|
- }
|
|
|
- xmlNode1.Attributes[0].Value = xmlNode1.Attributes[0].Value.TrimStart();
|
|
|
-
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode1, true));
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion8(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 8.ToString();
|
|
|
-
|
|
|
- XmlNode xmlNode0 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.TutorialPlazaRoom);
|
|
|
- XmlNode xmlNode1 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.TutorialIndexPlazaRoom);
|
|
|
-
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode0, true));
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode1, true));
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- private static int DefaultAchieveValue = 0;
|
|
|
- public static XmlDocument ToVersion9(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 9.ToString();
|
|
|
- XmlNode xmlNode = nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.AchieveData);
|
|
|
- xmlNode.Attributes.Append(nativeDoc.CreateAttribute(PlayerConfigLabel.CreateRoomAmt));
|
|
|
- xmlNode.Attributes.Append(nativeDoc.CreateAttribute(PlayerConfigLabel.CreateChestAmt));
|
|
|
- xmlNode.Attributes.Append(nativeDoc.CreateAttribute(PlayerConfigLabel.CreateLuckyChestAmt));
|
|
|
- xmlNode.Attributes.Append(nativeDoc.CreateAttribute(PlayerConfigLabel.CreateGuessColorChestAmt));
|
|
|
- xmlNode.Attributes.Append(nativeDoc.CreateAttribute(PlayerConfigLabel.CreateGuessNumberChestAmt));
|
|
|
- xmlNode.Attributes.Append(nativeDoc.CreateAttribute(PlayerConfigLabel.GetChestAwardAmt));
|
|
|
- xmlNode.Attributes[9].Value = DefaultAchieveValue.ToString();
|
|
|
- xmlNode.Attributes[10].Value = DefaultAchieveValue.ToString();
|
|
|
- xmlNode.Attributes[11].Value = DefaultAchieveValue.ToString();
|
|
|
- xmlNode.Attributes[12].Value = DefaultAchieveValue.ToString();
|
|
|
- xmlNode.Attributes[13].Value = DefaultAchieveValue.ToString();
|
|
|
- xmlNode.Attributes[14].Value = DefaultAchieveValue.ToString();
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion10(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 10.ToString();
|
|
|
- ChestManager.ClearRefundAndOperateData(nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode));
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion11(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 11.ToString();
|
|
|
- XmlNode xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.ReplayVersion);
|
|
|
-
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion12(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 12.ToString();
|
|
|
- XmlNode xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.ExtraSlot);
|
|
|
-
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion13(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 13.ToString();
|
|
|
- XmlNode xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.CurrentMinigameType);
|
|
|
-
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion14(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 14.ToString();
|
|
|
- XmlNode xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.LastPrivateMessageDate);
|
|
|
-
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion15(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 15.ToString();
|
|
|
- XmlNode xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.LastApplicantSerialNumber);
|
|
|
-
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion16(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 16.ToString();
|
|
|
-
|
|
|
- XmlNode xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.FindMissingMinigameTutorial);
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
|
|
|
- xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.FindMissingMinigameTutorialIndex);
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion17(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 17.ToString();
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion18(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 18.ToString();
|
|
|
-
|
|
|
- string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
- if (Directory.Exists(persistentFolderPath))
|
|
|
- {
|
|
|
- Directory.Delete(persistentFolderPath, true);
|
|
|
- }
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion19(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 19.ToString();
|
|
|
-
|
|
|
- string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
- if (Directory.Exists(persistentFolderPath))
|
|
|
- {
|
|
|
- Directory.Delete(persistentFolderPath, true);
|
|
|
- }
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion20(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 20.ToString();
|
|
|
-
|
|
|
- XmlNode xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.MinigameCoolFlag);
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion21(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 21.ToString();
|
|
|
-
|
|
|
- string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
- if (Directory.Exists(persistentFolderPath))
|
|
|
- {
|
|
|
- Directory.Delete(persistentFolderPath, true);
|
|
|
- }
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion22(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 22.ToString();
|
|
|
-
|
|
|
- string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
- if (Directory.Exists(persistentFolderPath))
|
|
|
- {
|
|
|
- Directory.Delete(persistentFolderPath, true);
|
|
|
- }
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion23(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 23.ToString();
|
|
|
-
|
|
|
- string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
- if (Directory.Exists(persistentFolderPath))
|
|
|
- {
|
|
|
- Directory.Delete(persistentFolderPath, true);
|
|
|
- }
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion24(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 24.ToString();
|
|
|
-
|
|
|
- string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
- if (Directory.Exists(persistentFolderPath))
|
|
|
- {
|
|
|
- Directory.Delete(persistentFolderPath, true);
|
|
|
- }
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion25(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 25.ToString();
|
|
|
-
|
|
|
- XmlNode xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.FashionShowTutorial);
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
|
|
|
- xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.FashionShowTutorialIndex);
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion26(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 26.ToString();
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion27(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 27.ToString();
|
|
|
-
|
|
|
- string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
- if (Directory.Exists(persistentFolderPath))
|
|
|
- {
|
|
|
- Directory.Delete(persistentFolderPath, true);
|
|
|
- }
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion28(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 28.ToString();
|
|
|
-
|
|
|
- string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
- if (Directory.Exists(persistentFolderPath))
|
|
|
- {
|
|
|
- Directory.Delete(persistentFolderPath, true);
|
|
|
- }
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion29(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 29.ToString();
|
|
|
-
|
|
|
- string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
- if (Directory.Exists(persistentFolderPath))
|
|
|
- {
|
|
|
- Directory.Delete(persistentFolderPath, true);
|
|
|
- }
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion30(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 30.ToString();
|
|
|
-
|
|
|
- string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
- if (Directory.Exists(persistentFolderPath))
|
|
|
- {
|
|
|
- Directory.Delete(persistentFolderPath, true);
|
|
|
- }
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion31(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 31.ToString();
|
|
|
-
|
|
|
- string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
- if (Directory.Exists(persistentFolderPath))
|
|
|
- {
|
|
|
- Directory.Delete(persistentFolderPath, true);
|
|
|
- }
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion32(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 32.ToString();
|
|
|
-
|
|
|
- string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
- if (Directory.Exists(persistentFolderPath))
|
|
|
- {
|
|
|
- Directory.Delete(persistentFolderPath, true);
|
|
|
- }
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion33(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 33.ToString();
|
|
|
-
|
|
|
- string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
- if (Directory.Exists(persistentFolderPath))
|
|
|
- {
|
|
|
- Directory.Delete(persistentFolderPath, true);
|
|
|
- }
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion34(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 34.ToString();
|
|
|
-
|
|
|
- string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
- if (Directory.Exists(persistentFolderPath))
|
|
|
- {
|
|
|
- Directory.Delete(persistentFolderPath, true);
|
|
|
- }
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion35(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 35.ToString();
|
|
|
-
|
|
|
- string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
- if (Directory.Exists(persistentFolderPath))
|
|
|
- {
|
|
|
- Directory.Delete(persistentFolderPath, true);
|
|
|
- }
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
-
|
|
|
- public static XmlDocument ToVersion36(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
- {
|
|
|
- nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 36.ToString();
|
|
|
-
|
|
|
- string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
- if (Directory.Exists(persistentFolderPath))
|
|
|
- {
|
|
|
- Directory.Delete(persistentFolderPath, true);
|
|
|
- }
|
|
|
-
|
|
|
- return nativeDoc;
|
|
|
- }
|
|
|
+using LitJson;
|
|
|
+
|
|
|
+using UnityEngine;
|
|
|
+
|
|
|
+using System;
|
|
|
+using System.IO;
|
|
|
+using System.Xml;
|
|
|
+using System.Text;
|
|
|
+using System.Collections;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
+using System.Security.Cryptography;
|
|
|
+using Sfs2X.Entities;
|
|
|
+using Sfs2X.Entities.Data;
|
|
|
+using UnityEngine.UI;
|
|
|
+using Random = UnityEngine.Random;
|
|
|
+
|
|
|
+public class ConfigManager : Regist
|
|
|
+{
|
|
|
+ #region Config
|
|
|
+
|
|
|
+ public static XmlNode ConfigRootNode
|
|
|
+ {
|
|
|
+ get
|
|
|
+ {
|
|
|
+ if (configRootNode == null)
|
|
|
+ {
|
|
|
+ configRootNode = ConfigDocument.SelectSingleNode(PlayerConfigLabel.RootNode);
|
|
|
+ }
|
|
|
+
|
|
|
+ return configRootNode;
|
|
|
+ }
|
|
|
+ set { configRootNode = value; }
|
|
|
+ }
|
|
|
+ public static XmlNode configRootNode;
|
|
|
+ public static XmlDocument ConfigDocument
|
|
|
+ {
|
|
|
+ get
|
|
|
+ {
|
|
|
+ if (configDocument == null)
|
|
|
+ {
|
|
|
+ LoadConfigDocument();
|
|
|
+ }
|
|
|
+
|
|
|
+ return configDocument;
|
|
|
+ }
|
|
|
+ set { configDocument = value; }
|
|
|
+ }
|
|
|
+ public static XmlDocument configDocument;
|
|
|
+
|
|
|
+ public static float UrlTimer;
|
|
|
+ public static bool PlayerDocumentDamageFlag;
|
|
|
+ public static bool IDRequestFlag;
|
|
|
+ public static bool SerialNumberRequestFlag = true;
|
|
|
+ public static XmlDocument DefaultConfigDocument = new XmlDocument();
|
|
|
+
|
|
|
+ public static int ConfigReplayVersion = -1000;
|
|
|
+ public static string ConfigPath
|
|
|
+ {
|
|
|
+ get
|
|
|
+ {
|
|
|
+ if (string.IsNullOrEmpty(configPath))
|
|
|
+ {
|
|
|
+ configPath = string.Format("{0}/{1}", Application.persistentDataPath, ResourceLabel.PlayerConfigXml);
|
|
|
+ }
|
|
|
+
|
|
|
+ return configPath;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ public static string configPath;
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ private static string UnvalidConfigMD5 = "";
|
|
|
+ private static void LoadConfigDocument()
|
|
|
+ {
|
|
|
+ //if (!PlayerPrefManager.GetBool(PlayerPrefManager.INTERACT_CONFIG, false))
|
|
|
+ //{
|
|
|
+ // Debug.LogWarning("Download Archive : did not interact");
|
|
|
+
|
|
|
+ // PlayerDocumentDamageFlag = true;
|
|
|
+ // SerialNumberRequestFlag = false;
|
|
|
+
|
|
|
+ // return;
|
|
|
+ //}
|
|
|
+
|
|
|
+ int defaultVersion;
|
|
|
+ int nativeVersion;
|
|
|
+
|
|
|
+ XmlNode node;
|
|
|
+ XmlDocument nativeDoc = new XmlDocument();
|
|
|
+
|
|
|
+ if (File.Exists(ConfigPath))
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ StreamReader sr = new StreamReader(ConfigPath);
|
|
|
+
|
|
|
+ nativeDoc.LoadXml(sr.ReadToEnd());
|
|
|
+
|
|
|
+ sr.Close();
|
|
|
+
|
|
|
+ Auxiliary.DecryptXml(nativeDoc);
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("Download Archive : MD5 doesn't match");
|
|
|
+ //ManaDebug.Log("Download Archive");
|
|
|
+
|
|
|
+ PlayerDocumentDamageFlag = true;
|
|
|
+ SerialNumberRequestFlag = false;
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.PlayerConfig, Folder.Default);
|
|
|
+
|
|
|
+ DefaultConfigDocument.LoadXml(textAsset.text);
|
|
|
+
|
|
|
+ defaultVersion = int.Parse(DefaultConfigDocument.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value);
|
|
|
+
|
|
|
+ node = nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version);
|
|
|
+
|
|
|
+ if (node == null)
|
|
|
+ {
|
|
|
+ StreamWriter sw = new StreamWriter(ConfigPath);
|
|
|
+
|
|
|
+ sw.Write(DefaultConfigDocument.OuterXml);
|
|
|
+
|
|
|
+ sw.Close();
|
|
|
+
|
|
|
+ configDocument = DefaultConfigDocument;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ nativeVersion = int.Parse(node.Attributes[0].Value);
|
|
|
+
|
|
|
+ if (nativeVersion == ConfigReplayVersion)
|
|
|
+ {
|
|
|
+ configDocument = DefaultConfigDocument;
|
|
|
+ int currentReplayVersion = int.Parse(nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.ReplayVersion).Attributes[0].Value);
|
|
|
+ SaveIntToConfig(PlayerConfigLabel.ReplayVersion, currentReplayVersion + 1);
|
|
|
+ //Debug.Log(currentReplayVersion);
|
|
|
+ }
|
|
|
+ else if (nativeVersion < defaultVersion)
|
|
|
+ {
|
|
|
+ byte[] bytes;
|
|
|
+
|
|
|
+ MD5 md5 = new MD5CryptoServiceProvider();
|
|
|
+
|
|
|
+ if (nativeVersion <= 4)
|
|
|
+ {
|
|
|
+ bytes = Encoding.UTF8.GetBytes(nativeDoc.OuterXml);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ bytes = File.ReadAllBytes(ConfigPath);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (PlayerPrefs.GetString(Lib.ConfigPrefs) != UnvalidConfigMD5 && PlayerPrefs.GetString(Lib.ConfigPrefs) != Auxiliary.ToString(md5.ComputeHash(bytes)))
|
|
|
+ {
|
|
|
+ Debug.LogWarning("Download Archive : MD5 doesn't match");
|
|
|
+ //ManaDebug.Log("Download Archive");
|
|
|
+
|
|
|
+ PlayerDocumentDamageFlag = true;
|
|
|
+ SerialNumberRequestFlag = false;
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ configDocument = UpdateConfigDocument(nativeVersion, nativeDoc, DefaultConfigDocument);
|
|
|
+
|
|
|
+ //HttpManager.UploadConfig();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (nativeVersion > defaultVersion)
|
|
|
+ {
|
|
|
+ //configDocument = DefaultConfigDocument;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ byte[] bytes = File.ReadAllBytes(ConfigPath);
|
|
|
+
|
|
|
+ MD5 md5 = new MD5CryptoServiceProvider();
|
|
|
+
|
|
|
+ if (PlayerPrefs.GetString(Lib.ConfigPrefs) != UnvalidConfigMD5 && PlayerPrefs.GetString(Lib.ConfigPrefs) != Auxiliary.ToString(md5.ComputeHash(bytes)))
|
|
|
+ {
|
|
|
+ Debug.LogWarning("Download Archive : MD5 doesn't match");
|
|
|
+ //ManaDebug.Log("Download Archive");
|
|
|
+
|
|
|
+ PlayerDocumentDamageFlag = true;
|
|
|
+ SerialNumberRequestFlag = false;
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ configDocument = nativeDoc;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.PlayerConfig, Folder.Default);
|
|
|
+
|
|
|
+ DefaultConfigDocument.LoadXml(textAsset.text);
|
|
|
+
|
|
|
+ Debug.LogWarning("Download Archive");
|
|
|
+ //ManaDebug.Log("Download Archive");
|
|
|
+
|
|
|
+ PlayerDocumentDamageFlag = true;
|
|
|
+ SerialNumberRequestFlag = false;
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private float MaxUrlWaitTime = 10;
|
|
|
+ public void Update()
|
|
|
+ {
|
|
|
+ if (PlayerDocumentDamageFlag)
|
|
|
+ {
|
|
|
+ UrlTimer += Time.deltaTime;
|
|
|
+
|
|
|
+ if (UrlTimer >= MaxUrlWaitTime)
|
|
|
+ {
|
|
|
+ PlayerDocumentDamageFlag = false;
|
|
|
+
|
|
|
+ TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.PlayerConfig, Folder.Default);
|
|
|
+
|
|
|
+ configDocument = new XmlDocument();
|
|
|
+
|
|
|
+ configDocument.LoadXml(textAsset.text);
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!SerialNumberRequestFlag)
|
|
|
+ {
|
|
|
+ if (HttpManager.SerialNumber != PlayerConfigLabel.DefaultSerialNumber)
|
|
|
+ {
|
|
|
+ SerialNumberRequestFlag = true;
|
|
|
+
|
|
|
+ HttpManager.GetConfigBySerialNumber(HttpManager.SerialNumber, RecoveConfigDocument);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public override bool InitAtOnce()
|
|
|
+ {
|
|
|
+ if (base.InitAtOnce())
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ enabled = true;
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static void RecoveConfigDocument(JsonData jsonData)
|
|
|
+ {
|
|
|
+ if (!PlayerDocumentDamageFlag)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.PlayerConfig, Folder.Default);
|
|
|
+
|
|
|
+ DefaultConfigDocument.LoadXml(textAsset.text);
|
|
|
+ //Debug.Log(jsonData.ToJson());
|
|
|
+ if (jsonData.Inst_Object.Keys.Contains("l"))
|
|
|
+ {
|
|
|
+ XmlDocument recoverdDocument = new XmlDocument();
|
|
|
+
|
|
|
+ recoverdDocument.LoadXml(jsonData["l"].ToString());
|
|
|
+
|
|
|
+ int RecoverdVersion = int.Parse(recoverdDocument.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value);
|
|
|
+ int DefaultVersion = int.Parse(DefaultConfigDocument.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value);
|
|
|
+
|
|
|
+ PlayerDocumentDamageFlag = false;
|
|
|
+ if (RecoverdVersion <= DefaultVersion)
|
|
|
+ {
|
|
|
+ UpdateConfigDocument(RecoverdVersion, recoverdDocument, DefaultConfigDocument);
|
|
|
+ configDocument = recoverdDocument;
|
|
|
+ PlayerPrefManager.SaveBool(PlayerPrefManager.INTERACT_CONFIG, true);
|
|
|
+ }
|
|
|
+ else if (RecoverdVersion > DefaultVersion)
|
|
|
+ {
|
|
|
+ //configDocument = DefaultConfigDocument;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (!IDRequestFlag)
|
|
|
+ {
|
|
|
+ if (HttpManager.ID != PlayerConfigLabel.DefaultID)
|
|
|
+ {
|
|
|
+ IDRequestFlag = true;
|
|
|
+ Debug.LogWarning("DownloadByID");
|
|
|
+
|
|
|
+ HttpManager.GetConfigByID(HttpManager.ID, RecoveConfigDocument);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Debug.LogWarning("Use Default");
|
|
|
+ configDocument = DefaultConfigDocument;
|
|
|
+ PlayerDocumentDamageFlag = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Debug.LogWarning("Use Default");
|
|
|
+ configDocument = DefaultConfigDocument;
|
|
|
+ PlayerDocumentDamageFlag = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static void SaveSkillList()
|
|
|
+ {
|
|
|
+ if (TutorialManager.NewplayerTutorial || !Manager.Inited)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ XmlNode xmlNode;
|
|
|
+ XmlAttribute xmlAttribute;
|
|
|
+
|
|
|
+ xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SkillList);
|
|
|
+ xmlNode.RemoveAll();
|
|
|
+
|
|
|
+ for (int i = 0; i < Manager.SkillList.Count; i++)
|
|
|
+ {
|
|
|
+ if (Manager.SkillList[i].SkillType == SkillType.Skill)
|
|
|
+ {
|
|
|
+ #region Skill
|
|
|
+
|
|
|
+ Skill skill = (Skill)Manager.SkillList[i];
|
|
|
+
|
|
|
+ xmlNode = xmlNode.AppendChild(ConfigDocument.CreateNode(XmlNodeType.Element, PlayerConfigLabel.Skill, ""));
|
|
|
+
|
|
|
+ xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ID));
|
|
|
+ xmlAttribute.Value = skill.FullID;
|
|
|
+
|
|
|
+ xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.SkillType));
|
|
|
+ xmlAttribute.Value = skill.SkillType.ToString();
|
|
|
+
|
|
|
+ xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ItemStatus));
|
|
|
+ xmlAttribute.Value = skill.ItemStatus.ToString();
|
|
|
+
|
|
|
+ xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.Level));
|
|
|
+ xmlAttribute.Value = skill.Level.ToString();
|
|
|
+
|
|
|
+ xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.CoolTimer));
|
|
|
+ xmlAttribute.Value = skill.CoolTimer.ToString("0");
|
|
|
+
|
|
|
+ xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.UseTimer));
|
|
|
+ xmlAttribute.Value = skill.UseTimer.ToString("0");
|
|
|
+
|
|
|
+ xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SkillList);
|
|
|
+
|
|
|
+ #endregion
|
|
|
+ }
|
|
|
+ else if (Manager.SkillList[i].SkillType == SkillType.Pack)
|
|
|
+ {
|
|
|
+ #region Pack
|
|
|
+
|
|
|
+ Pack pack = (Pack)Manager.SkillList[i];
|
|
|
+
|
|
|
+ xmlNode = xmlNode.AppendChild(ConfigDocument.CreateNode(XmlNodeType.Element, PlayerConfigLabel.Skill, ""));
|
|
|
+
|
|
|
+ xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ID));
|
|
|
+ xmlAttribute.Value = pack.FullID;
|
|
|
+
|
|
|
+ xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.SkillType));
|
|
|
+ xmlAttribute.Value = pack.SkillType.ToString();
|
|
|
+
|
|
|
+ xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ItemStatus));
|
|
|
+ xmlAttribute.Value = pack.ItemStatus.ToString();
|
|
|
+
|
|
|
+ xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.Level));
|
|
|
+ xmlAttribute.Value = pack.Level.ToString();
|
|
|
+
|
|
|
+ xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SkillList);
|
|
|
+
|
|
|
+ #endregion
|
|
|
+ }
|
|
|
+ else if (Manager.SkillList[i].SkillType == SkillType.Ability)
|
|
|
+ {
|
|
|
+ #region Ability
|
|
|
+
|
|
|
+ Ability ability = (Ability)Manager.SkillList[i];
|
|
|
+
|
|
|
+ xmlNode = xmlNode.AppendChild(ConfigDocument.CreateNode(XmlNodeType.Element, PlayerConfigLabel.Skill, ""));
|
|
|
+
|
|
|
+ xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ID));
|
|
|
+ xmlAttribute.Value = ability.FullID;
|
|
|
+
|
|
|
+ xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.SkillType));
|
|
|
+ xmlAttribute.Value = ability.SkillType.ToString();
|
|
|
+
|
|
|
+ xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ItemStatus));
|
|
|
+ xmlAttribute.Value = ability.ItemStatus.ToString();
|
|
|
+
|
|
|
+ xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.Level));
|
|
|
+ xmlAttribute.Value = ability.Level.ToString();
|
|
|
+
|
|
|
+ xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SkillList);
|
|
|
+
|
|
|
+ #endregion
|
|
|
+ }
|
|
|
+ else if (Manager.SkillList[i].SkillType == SkillType.BigSkill)
|
|
|
+ {
|
|
|
+ #region BigSkill
|
|
|
+
|
|
|
+ BigSkill bigSkill = (BigSkill)Manager.SkillList[i];
|
|
|
+
|
|
|
+ xmlNode = xmlNode.AppendChild(ConfigDocument.CreateNode(XmlNodeType.Element, PlayerConfigLabel.Skill, ""));
|
|
|
+
|
|
|
+ xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ID));
|
|
|
+ xmlAttribute.Value = bigSkill.FullID;
|
|
|
+
|
|
|
+ xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.SkillType));
|
|
|
+ xmlAttribute.Value = bigSkill.SkillType.ToString();
|
|
|
+
|
|
|
+ xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ItemStatus));
|
|
|
+ xmlAttribute.Value = bigSkill.ItemStatus.ToString();
|
|
|
+
|
|
|
+ xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.BarStatus));
|
|
|
+ xmlAttribute.Value = bigSkill.BarStatus.ToString();
|
|
|
+
|
|
|
+ xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.Level));
|
|
|
+ xmlAttribute.Value = bigSkill.Level.ToString();
|
|
|
+
|
|
|
+ xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.CoolTimer));
|
|
|
+ xmlAttribute.Value = bigSkill.CoolTimer.ToString("0");
|
|
|
+
|
|
|
+ xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.UseTimer));
|
|
|
+ xmlAttribute.Value = bigSkill.UseTimer.ToString("0");
|
|
|
+
|
|
|
+ xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SkillList);
|
|
|
+
|
|
|
+ #endregion
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void SaveDress()
|
|
|
+ {
|
|
|
+ XmlNode xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.DressList);
|
|
|
+ xmlNode.Attributes[0].Value = "";
|
|
|
+
|
|
|
+ for (int i = 0; i < PlayerManager.BoughtCloseIDs.Count; i++)
|
|
|
+ {
|
|
|
+ xmlNode.Attributes[0].Value += PlayerManager.BoughtCloseIDs[i] + " ";
|
|
|
+ }
|
|
|
+
|
|
|
+ xmlNode.Attributes[0].Value = xmlNode.Attributes[0].Value.TrimEnd(' ');
|
|
|
+
|
|
|
+
|
|
|
+ xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.DressData);
|
|
|
+
|
|
|
+ for (int i = 0; i < PlayerManager.DressDatas.Count; i++)
|
|
|
+ {
|
|
|
+ xmlNode.Attributes[i].Value = PlayerManager.DressDatas[i];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void SaveAchieve()
|
|
|
+ {
|
|
|
+ XmlNode xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveList);
|
|
|
+ xmlNode.Attributes[0].Value = "";
|
|
|
+
|
|
|
+ foreach (var kv in AchieveManager.AchieveItemDictionary)
|
|
|
+ {
|
|
|
+ if (!kv.Value.Lock)
|
|
|
+ {
|
|
|
+ xmlNode.Attributes[0].Value += kv.Value.ID + " ";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ xmlNode.Attributes[0].Value = xmlNode.Attributes[0].Value.TrimEnd(' ');
|
|
|
+
|
|
|
+
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[0].Value = Manager.PlayADsAmt.ToString("0");
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[1].Value = Manager.UseSkillAmt.ToString("0");
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[2].Value = Manager.SignAmt.ToString("0");
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[3].Value = Manager.ShareAmt.ToString("0");
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[4].Value = Manager.AllElfLevel.ToString("0");
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[5].Value = Manager.PlayMinigameAmt.ToString("0");
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[6].Value = Manager.TotalFlowerAwardCoin.ToString("0");
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[7].Value = Manager.TotalVisitPerson.ToString("0");
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[8].Value = Manager.TotalSpendDiamond.ToString("0");
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[9].Value = Manager.CreateRoomAmt.ToString("0");
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[10].Value = Manager.CreateChestAmt.ToString("0");
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[11].Value = Manager.CreateLuckyChestAmt.ToString("0");
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[12].Value = Manager.CreateGuessColorChestAmt.ToString("0");
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[13].Value = Manager.CreateGuessNumberChestAmt.ToString("0");
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[14].Value = Manager.GetChestAwardAmt.ToString("0");
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void SavePlantList()
|
|
|
+ {
|
|
|
+ if (VisitManager.InVisit || TutorialManager.NewplayerTutorial)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ XmlAttributeCollection attribute = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.PlantList).Attributes;
|
|
|
+
|
|
|
+ attribute[0].Value = "";
|
|
|
+
|
|
|
+ for (int i = 0; i < GardenManager.PlantSlotList.Count; i++)
|
|
|
+ {
|
|
|
+ Slot slot = GardenManager.PlantSlotList[i];
|
|
|
+
|
|
|
+ attribute[0].Value += slot.ID + "," + slot.Index + " ";
|
|
|
+ }
|
|
|
+
|
|
|
+ attribute[0].Value = attribute[0].Value.TrimEnd(' ');
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void SaveDatas()
|
|
|
+ {
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.Coin).Attributes[0].Value = Manager.Coin.ToString("0");
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.Diamond).Attributes[0].Value = Manager.Diamond.ToString("0");
|
|
|
+
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SignTime).Attributes[0].Value = SignManager.LastSignTime.ToString();
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SignIndex).Attributes[0].Value = SignManager.SignIndex.ToString();
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SignRound).Attributes[0].Value = SignManager.SignRound.ToString();
|
|
|
+
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.QuitFlag).Attributes[0].Value = HttpManager.IsConnect.ToInt().ToString();
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.QuitTime).Attributes[0].Value = HttpManager.CurrentDateTime.ToString();
|
|
|
+
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.MiniTimer).Attributes[0].Value = Manager.MinigameCDTimer.ToString("0");
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.CircleTimer).Attributes[0].Value = Manager.IncomeCircleTimer.ToString("0");
|
|
|
+
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.ID).Attributes[0].Value = HttpManager.ID;
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SerialNumber).Attributes[0].Value = HttpManager.SerialNumber;
|
|
|
+
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.Language).Attributes[0].Value = LanguageManager.CurrentLanguage.ToString();
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.MiniGameIndex).Attributes[0].Value = MiniGameManager.MiniGameIndex.ToString();
|
|
|
+
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.NewplayerTutorial).Attributes[0].Value = TutorialManager.NewplayerTutorial.ToInt().ToString();
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.MemoryMinigameTutorial).Attributes[0].Value = TutorialManager.memoryMinigameTutorial.ToInt().ToString();
|
|
|
+
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.VisitTutorial).Attributes[0].Value = TutorialManager.visitTutorial.ToInt().ToString();
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.DressroomTutorial).Attributes[0].Value = TutorialManager.dressroomTutorial.ToInt().ToString();
|
|
|
+
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FashionShowTutorial).Attributes[0].Value = TutorialManager.fashionShowTutorial.ToInt().ToString();
|
|
|
+
|
|
|
+ if (TutorialManager.findSoloMinigameTutorial || TutorialManager.FindSoloMinigameTutorial)
|
|
|
+ {
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FindSoloMinigameTutorial).Attributes[0].Value = "1";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FindSoloMinigameTutorial).Attributes[0].Value = "0";
|
|
|
+ }
|
|
|
+ if (TutorialManager.findMissingMinigameTutorial || TutorialManager.FindMissingMinigameTutorial)
|
|
|
+ {
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FindMissingMinigameTutorial).Attributes[0].Value = "1";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FindMissingMinigameTutorial).Attributes[0].Value = "0";
|
|
|
+ }
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.TutorialPlazaRoom).Attributes[0].Value = TutorialManager.plazaRoomTutorial.ToInt().ToString();
|
|
|
+
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.NewplayerTutorialIndex).Attributes[0].Value = TutorialManager.NewplayerTutorialIndex.ToString();
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.MemoryMinigameTutorialIndex).Attributes[0].Value = TutorialManager.MemoryMinigameTutorialIndex.ToString();
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.VisitTutorialIndex).Attributes[0].Value = TutorialManager.VisitTutorialIndex.ToString();
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.DressroomIndex).Attributes[0].Value = TutorialManager.DressroomTutorialIndex.ToString();
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FindSoloMinigameTutorialIndex).Attributes[0].Value = TutorialManager.FindSoloMinigameTutorialIndex.ToString();
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FindMissingMinigameTutorialIndex).Attributes[0].Value = TutorialManager.FindMissingMinigameTutorialIndex.ToString();
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.TutorialIndexPlazaRoom).Attributes[0].Value = TutorialManager.PlazaRoomTutorialIndex.ToString();
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FashionShowTutorialIndex).Attributes[0].Value = TutorialManager.FashionShowTutorialIndex.ToString();
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void SaveFlowers()
|
|
|
+ {
|
|
|
+ XmlAttribute attribute = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FlowerList).Attributes[0];
|
|
|
+ XmlAttribute attribute1 = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FlowerAmtList).Attributes[0];
|
|
|
+
|
|
|
+ attribute.Value = "";
|
|
|
+ attribute1.Value = "";
|
|
|
+
|
|
|
+ foreach (var kv in GardenManager.GetFlowerInfoDict())
|
|
|
+ {
|
|
|
+ if (kv.Value.Unlock)
|
|
|
+ {
|
|
|
+ attribute.Value += kv.Value.ID + " ";
|
|
|
+ attribute1.Value += kv.Value.Amount + " ";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ attribute.Value = attribute.Value.Trim(' ');
|
|
|
+ attribute1.Value = attribute1.Value.Trim(' ');
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void SaveConfigDocument()
|
|
|
+ {
|
|
|
+ if (Initializer.Inited)
|
|
|
+ {
|
|
|
+ SaveSkillList();
|
|
|
+ SaveAchieve();
|
|
|
+ SaveDress();
|
|
|
+ SavePlantList();
|
|
|
+ SaveDatas();
|
|
|
+ SaveFlowers();
|
|
|
+ ChestManager.SaveToConfig();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void SaveConfigDocumentToDisk()
|
|
|
+ {
|
|
|
+ if (Initializer.Inited)
|
|
|
+ {
|
|
|
+ XmlDocument doc = new XmlDocument();
|
|
|
+
|
|
|
+ doc.LoadXml(ConfigDocument.OuterXml);
|
|
|
+
|
|
|
+ Auxiliary.EncryptXml(doc);
|
|
|
+
|
|
|
+ StreamWriter sw = new StreamWriter(ConfigPath);
|
|
|
+
|
|
|
+ sw.Write(doc.OuterXml);
|
|
|
+
|
|
|
+ sw.Close();
|
|
|
+
|
|
|
+ byte[] bytes = File.ReadAllBytes(ConfigPath);
|
|
|
+ //byte[] bytes = Encoding.UTF8.GetBytes(PlayerDoc.OuterXml);
|
|
|
+
|
|
|
+ MD5 md5 = new MD5CryptoServiceProvider();
|
|
|
+
|
|
|
+ PlayerPrefs.SetString(Lib.ConfigPrefs, Auxiliary.ToString(md5.ComputeHash(bytes)));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static void ResetConfigDocument()
|
|
|
+ {
|
|
|
+ ConfigRootNode.SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = ConfigReplayVersion.ToString();
|
|
|
+
|
|
|
+ SaveConfigDocument();
|
|
|
+
|
|
|
+ Manager.UploadConfigFlag = true;
|
|
|
+ Manager.DownloadConfigFlag = true;
|
|
|
+
|
|
|
+ SaveConfigDocumentToDisk();
|
|
|
+
|
|
|
+ DelayCall.Call
|
|
|
+ (
|
|
|
+ 1,
|
|
|
+ () =>
|
|
|
+ {
|
|
|
+ Bubble.Show(null, Language.GetStr(LanguageLabel.UI__La_Lab0), null, null, () => { Application.Quit(); }, null, false);
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static int GetIntFormConfig(string node)
|
|
|
+ {
|
|
|
+ return int.Parse(ConfigRootNode.SelectSingleNode(node).Attributes[0].Value);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static bool GetBoolFormConfig(string node)
|
|
|
+ {
|
|
|
+ return int.Parse(ConfigRootNode.SelectSingleNode(node).Attributes[0].Value).ToBool();
|
|
|
+ }
|
|
|
+
|
|
|
+ public static float GetFloatFormConfig(string node)
|
|
|
+ {
|
|
|
+ return float.Parse(ConfigRootNode.SelectSingleNode(node).Attributes[0].Value);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static string GetStringFormConfig(string node)
|
|
|
+ {
|
|
|
+ return ConfigRootNode.SelectSingleNode(node).Attributes[0].Value;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static double GetDoubleFormConfig(string node)
|
|
|
+ {
|
|
|
+ return double.Parse(ConfigRootNode.SelectSingleNode(node).Attributes[0].Value);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static void SaveIntToConfig(string node, int value)
|
|
|
+ {
|
|
|
+ ConfigRootNode.SelectSingleNode(node).Attributes[0].Value = value.ToString();
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void SaveBoolToConfig(string node, bool value)
|
|
|
+ {
|
|
|
+ ConfigRootNode.SelectSingleNode(node).Attributes[0].Value = value.ToInt().ToString();
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void SaveFloatToConfig(string node, float value)
|
|
|
+ {
|
|
|
+ ConfigRootNode.SelectSingleNode(node).Attributes[0].Value = value.ToString();
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void SaveStringToConfig(string node, string value)
|
|
|
+ {
|
|
|
+ ConfigRootNode.SelectSingleNode(node).Attributes[0].Value = value;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void SaveDoubleToConfig(string node, double value)
|
|
|
+ {
|
|
|
+ ConfigRootNode.SelectSingleNode(node).Attributes[0].Value = value.ToString();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static List<int> GetIntList(char splitChar, string nodeName, List<int> defaultList)
|
|
|
+ {
|
|
|
+ return Auxiliary.StringToInts(splitChar, ConfigRootNode.SelectSingleNode(nodeName).Attributes[0].Value, defaultList);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static List<string> GetStringList(char splitChar, string nodeName, List<string> defaultList)
|
|
|
+ {
|
|
|
+ return Auxiliary.StringToStrings(splitChar, ConfigRootNode.SelectSingleNode(nodeName).Attributes[0].Value, defaultList);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static List<int> GetDressList()
|
|
|
+ {
|
|
|
+ List<int> list = new List<int>();
|
|
|
+
|
|
|
+ XmlAttributeCollection attribute = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.DressList).Attributes;
|
|
|
+
|
|
|
+ return Auxiliary.StringToInts(' ', attribute[0].Value, list);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static List<int> GetDressDataIDs(Player player)
|
|
|
+ {
|
|
|
+ //foreach (var VARIABLE in ManaPlayer.CloseIDDic)
|
|
|
+ //{
|
|
|
+ // Debug.LogWarning(VARIABLE.Key);
|
|
|
+ //}
|
|
|
+
|
|
|
+ List<int> dressDataIDs = new List<int>();
|
|
|
+
|
|
|
+ dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.Head]);
|
|
|
+ dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.Dress]);
|
|
|
+ dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.Shoe]);
|
|
|
+ dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.HeadWear]);
|
|
|
+ dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.Top]);
|
|
|
+ dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.Eye]);
|
|
|
+ dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.Mouse]);
|
|
|
+ dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.Wing]);
|
|
|
+
|
|
|
+ return dressDataIDs;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static List<int> GetDressDataIDs(List<string> dressdataNames)
|
|
|
+ {
|
|
|
+ //foreach (var VARIABLE in ManaPlayer.CloseIDDic)
|
|
|
+ //{
|
|
|
+ // Debug.LogWarning(VARIABLE.Key);
|
|
|
+ //}
|
|
|
+
|
|
|
+ List<int> dressDataIDs = new List<int>();
|
|
|
+
|
|
|
+ int index = 0;
|
|
|
+ dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
|
|
|
+ dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
|
|
|
+ dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
|
|
|
+ dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
|
|
|
+ dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
|
|
|
+ dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
|
|
|
+ dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
|
|
|
+ dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
|
|
|
+
|
|
|
+ return dressDataIDs;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static List<int> GetDressDataIDs(ISFSObject parameter)
|
|
|
+ {
|
|
|
+ List<int> ids = parameter.GetIntArray(InfoLabel.Close.GetHashString()).ToList();
|
|
|
+
|
|
|
+ return ids;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static List<string> GetDressData(SFSObject parameter)
|
|
|
+ {
|
|
|
+ List<int> ids = GetDressDataIDs(parameter);
|
|
|
+
|
|
|
+ List<string> dressData = new List<string>();
|
|
|
+
|
|
|
+ foreach (var id in ids)
|
|
|
+ {
|
|
|
+ dressData.Add(PlayerManager.CloseItemDictionary[id].ArmatureName);
|
|
|
+ }
|
|
|
+
|
|
|
+ return dressData;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static List<string> GetDressData(XmlNode node = null)
|
|
|
+ {
|
|
|
+ XmlNode xmlNode;
|
|
|
+
|
|
|
+ if (node == null)
|
|
|
+ {
|
|
|
+ xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.DressData);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ xmlNode = node.SelectSingleNode(PlayerConfigLabel.DressData);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ List<string> dataList = new List<string>();
|
|
|
+
|
|
|
+ if (xmlNode != null && xmlNode.Attributes.Count == 12)
|
|
|
+ {
|
|
|
+ dataList.Add(xmlNode.Attributes[0].Value);
|
|
|
+ dataList.Add(xmlNode.Attributes[1].Value);
|
|
|
+ dataList.Add(xmlNode.Attributes[2].Value);
|
|
|
+ dataList.Add(xmlNode.Attributes[3].Value);
|
|
|
+ dataList.Add(xmlNode.Attributes[4].Value);
|
|
|
+ dataList.Add(xmlNode.Attributes[5].Value);
|
|
|
+ dataList.Add(xmlNode.Attributes[6].Value);
|
|
|
+ dataList.Add(xmlNode.Attributes[7].Value);
|
|
|
+ dataList.Add(xmlNode.Attributes[8].Value);
|
|
|
+ dataList.Add(xmlNode.Attributes[9].Value);
|
|
|
+ dataList.Add(xmlNode.Attributes[10].Value);
|
|
|
+ dataList.Add(xmlNode.Attributes[11].Value);
|
|
|
+
|
|
|
+ //dataList[8] = "长袖9左";
|
|
|
+ //dataList[9] = "Empty";
|
|
|
+ //dataList[10] = "长袖9右";
|
|
|
+ //dataList[11] = "Empty";
|
|
|
+ }
|
|
|
+ else if(xmlNode != null && xmlNode.Attributes.Count == 8)
|
|
|
+ {
|
|
|
+ dataList.Add(xmlNode.Attributes[0].Value);
|
|
|
+ dataList.Add(xmlNode.Attributes[1].Value);
|
|
|
+ dataList.Add(xmlNode.Attributes[2].Value);
|
|
|
+ dataList.Add(xmlNode.Attributes[3].Value);
|
|
|
+ dataList.Add(xmlNode.Attributes[4].Value);
|
|
|
+ dataList.Add(xmlNode.Attributes[5].Value);
|
|
|
+ dataList.Add(xmlNode.Attributes[6].Value);
|
|
|
+ dataList.Add(xmlNode.Attributes[7].Value);
|
|
|
+ dataList.AddRange (GetSleeveListByTop(xmlNode.Attributes[4].Value));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ float rate = Random.Range(0f, 1f);
|
|
|
+
|
|
|
+ if (rate < 0.33f)
|
|
|
+ {
|
|
|
+ dataList.Add("脑壳1");
|
|
|
+ dataList.Add("裙子1");
|
|
|
+ dataList.Add("鞋子1");
|
|
|
+ dataList.Add("头饰品1");
|
|
|
+ dataList.Add("上衣1");
|
|
|
+ dataList.Add("眼睛1");
|
|
|
+ dataList.Add("嘴巴1");
|
|
|
+ dataList.Add("Empty");
|
|
|
+ dataList.Add("Empty");
|
|
|
+ dataList.Add("短袖1左");
|
|
|
+ dataList.Add("Empty");
|
|
|
+ dataList.Add("短袖1右");
|
|
|
+ }
|
|
|
+ else if (rate < 0.66f)
|
|
|
+ {
|
|
|
+ dataList.Add("脑壳2");
|
|
|
+ dataList.Add("裙子2");
|
|
|
+ dataList.Add("鞋子2");
|
|
|
+ dataList.Add("头饰品2");
|
|
|
+ dataList.Add("上衣2");
|
|
|
+ dataList.Add("眼睛2");
|
|
|
+ dataList.Add("嘴巴2");
|
|
|
+ dataList.Add("Empty");
|
|
|
+ dataList.Add("Empty");
|
|
|
+ dataList.Add("短袖2左");
|
|
|
+ dataList.Add("Empty");
|
|
|
+ dataList.Add("短袖2右");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ dataList.Add("脑壳3");
|
|
|
+ dataList.Add("裙子3");
|
|
|
+ dataList.Add("鞋子3");
|
|
|
+ dataList.Add("头饰品3");
|
|
|
+ dataList.Add("上衣3");
|
|
|
+ dataList.Add("眼睛3");
|
|
|
+ dataList.Add("嘴巴3");
|
|
|
+ dataList.Add("Empty");
|
|
|
+ dataList.Add("Empty");
|
|
|
+ dataList.Add("短袖2左");
|
|
|
+ dataList.Add("Empty");
|
|
|
+ dataList.Add("短袖2右");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return dataList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static List<int> GetFlowerList()
|
|
|
+ {
|
|
|
+ List<int> list = new List<int>();
|
|
|
+
|
|
|
+ XmlAttributeCollection attribute = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FlowerList).Attributes;
|
|
|
+
|
|
|
+ return Auxiliary.StringToInts(' ', attribute[0].Value, list);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static List<int> GetLockAchieveIDs()
|
|
|
+ {
|
|
|
+ return Auxiliary.StringToInts(' ', GetStringFormConfig(PlayerConfigLabel.AchieveList), new List<int>());
|
|
|
+ }
|
|
|
+
|
|
|
+ public static List<double> GetAchieveValues()
|
|
|
+ {
|
|
|
+ List<double> dataList = new List<double>();
|
|
|
+
|
|
|
+ dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[0].Value));
|
|
|
+ dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[1].Value));
|
|
|
+ dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[2].Value));
|
|
|
+ dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[3].Value));
|
|
|
+ dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[4].Value));
|
|
|
+ dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[5].Value));
|
|
|
+ dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[6].Value));
|
|
|
+ dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[7].Value));
|
|
|
+ dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[8].Value));
|
|
|
+ dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[9].Value));
|
|
|
+ dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[10].Value));
|
|
|
+ dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[11].Value));
|
|
|
+ dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[12].Value));
|
|
|
+ dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[13].Value));
|
|
|
+ dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[14].Value));
|
|
|
+
|
|
|
+ return dataList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static List<KV<int, int>> GetPlantList(XmlNode node = null)
|
|
|
+ {
|
|
|
+ List<KV<int, int>> list = new List<KV<int, int>>();
|
|
|
+
|
|
|
+ XmlNode xmlNode;
|
|
|
+
|
|
|
+ if (node == null)
|
|
|
+ {
|
|
|
+ xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.PlantList);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ xmlNode = node.SelectSingleNode(PlayerConfigLabel.PlantList);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(xmlNode.Attributes[0].Value))
|
|
|
+ {
|
|
|
+ string[] strings = xmlNode.Attributes[0].Value.Split(' ');
|
|
|
+
|
|
|
+ for (int i = 0; i < strings.Length; i++)
|
|
|
+ {
|
|
|
+ list.Add(new KV<int, int>(int.Parse(strings[i].Split(',')[0]), int.Parse(strings[i].Split(',')[1])));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static List<XmlAttributeCollection> GetSkillList(XmlNode node = null)
|
|
|
+ {
|
|
|
+ List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
|
|
|
+
|
|
|
+ XmlNodeList xmlNodeList;
|
|
|
+
|
|
|
+ if (node == null)
|
|
|
+ {
|
|
|
+ xmlNodeList = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SkillList).ChildNodes;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ xmlNodeList = node.SelectSingleNode(PlayerConfigLabel.SkillList).ChildNodes;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < xmlNodeList.Count; i++)
|
|
|
+ {
|
|
|
+ attributeList.Add(xmlNodeList[i].Attributes);
|
|
|
+ }
|
|
|
+
|
|
|
+ return attributeList;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static List<string> GetOfflineConfig()
|
|
|
+ {
|
|
|
+ TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.OfflineConfig, Folder.Config);
|
|
|
+
|
|
|
+ XmlDocument xmlDoc = new XmlDocument();
|
|
|
+
|
|
|
+ xmlDoc.LoadXml(textAsset.text);
|
|
|
+
|
|
|
+ XmlNode xmlNode = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectSingleNode(ConfigLabel.ChildNode);
|
|
|
+
|
|
|
+ List<string> strList = new List<string>()
|
|
|
+ {
|
|
|
+ xmlNode.Attributes[1].Value,
|
|
|
+ xmlNode.Attributes[2].Value,
|
|
|
+ xmlNode.Attributes[3].Value,
|
|
|
+ };
|
|
|
+
|
|
|
+ return strList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlAttributeCollection GetVisitConfig()
|
|
|
+ {
|
|
|
+ TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.VisitConfig, Folder.Config);
|
|
|
+
|
|
|
+ XmlDocument xmlDoc = new XmlDocument();
|
|
|
+
|
|
|
+ xmlDoc.LoadXml(textAsset.text);
|
|
|
+
|
|
|
+ XmlNode xmlNode = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectSingleNode(ConfigLabel.ChildNode);
|
|
|
+
|
|
|
+ return xmlNode.Attributes;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlAttributeCollection GetPlazaRoomConfig()
|
|
|
+ {
|
|
|
+ TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.PlazaroomConfig, Folder.Config);
|
|
|
+
|
|
|
+ XmlDocument xmlDoc = new XmlDocument();
|
|
|
+
|
|
|
+ xmlDoc.LoadXml(textAsset.text);
|
|
|
+
|
|
|
+ XmlNode xmlNode = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectSingleNode(ConfigLabel.ChildNode);
|
|
|
+
|
|
|
+ return xmlNode.Attributes;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlAttributeCollection GetAwardConfig()
|
|
|
+ {
|
|
|
+ TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.AwardConfig, Folder.Config);
|
|
|
+
|
|
|
+ XmlDocument xmlDoc = new XmlDocument();
|
|
|
+
|
|
|
+ xmlDoc.LoadXml(textAsset.text);
|
|
|
+
|
|
|
+ XmlNode xmlNode = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectSingleNode(ConfigLabel.ChildNode);
|
|
|
+
|
|
|
+ return xmlNode.Attributes;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static List<XmlAttributeCollection> GetIAPConfig()
|
|
|
+ {
|
|
|
+ TextAsset textAsset;
|
|
|
+ XmlNodeList xmlNodeList;
|
|
|
+
|
|
|
+ XmlDocument xmlDoc = new XmlDocument();
|
|
|
+ List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
|
|
|
+
|
|
|
+
|
|
|
+ textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.IAPConfig, Folder.Config);
|
|
|
+
|
|
|
+ xmlDoc.LoadXml(textAsset.text);
|
|
|
+
|
|
|
+ xmlNodeList = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode);
|
|
|
+
|
|
|
+ for (int i = 0; i < xmlNodeList.Count; i++)
|
|
|
+ {
|
|
|
+ attributeList.Add(xmlNodeList[i].Attributes);
|
|
|
+ }
|
|
|
+
|
|
|
+ return attributeList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static List<XmlAttributeCollection> GetSkillConfig()
|
|
|
+ {
|
|
|
+ TextAsset textAsset;
|
|
|
+ XmlDocument xmlDoc = new XmlDocument();
|
|
|
+ List<XmlNodeList> xmlNodeList = new List<XmlNodeList>();
|
|
|
+ List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
|
|
|
+
|
|
|
+ textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.PackConfig, Folder.Config);
|
|
|
+ xmlDoc.LoadXml(textAsset.text);
|
|
|
+ xmlNodeList.Add(xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode));
|
|
|
+
|
|
|
+ textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.SkillConfig, Folder.Config);
|
|
|
+ xmlDoc.LoadXml(textAsset.text);
|
|
|
+ xmlNodeList.Add(xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode));
|
|
|
+
|
|
|
+ textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.AbilityConfig, Folder.Config);
|
|
|
+ xmlDoc.LoadXml(textAsset.text);
|
|
|
+ xmlNodeList.Add(xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode));
|
|
|
+
|
|
|
+ for (int i = 0; i < xmlNodeList.Count; i++)
|
|
|
+ {
|
|
|
+ for (int j = 0; j < xmlNodeList[i].Count; j++)
|
|
|
+ {
|
|
|
+ attributeList.Add(xmlNodeList[i][j].Attributes);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return attributeList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static List<XmlAttributeCollection> GetSignConfig()
|
|
|
+ {
|
|
|
+ TextAsset textAsset;
|
|
|
+ XmlNodeList xmlNodeList;
|
|
|
+
|
|
|
+ XmlDocument xmlDoc = new XmlDocument();
|
|
|
+ List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
|
|
|
+
|
|
|
+
|
|
|
+ textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.SigninConfig, Folder.Config);
|
|
|
+
|
|
|
+ xmlDoc.LoadXml(textAsset.text);
|
|
|
+
|
|
|
+ xmlNodeList = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode);
|
|
|
+
|
|
|
+ for (int i = 0; i < xmlNodeList.Count; i++)
|
|
|
+ {
|
|
|
+ attributeList.Add(xmlNodeList[i].Attributes);
|
|
|
+ }
|
|
|
+
|
|
|
+ return attributeList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static List<XmlAttributeCollection> GetFlowerConfig(TextAsset textAsset = null)
|
|
|
+ {
|
|
|
+ XmlNodeList xmlNodeList;
|
|
|
+
|
|
|
+ XmlDocument xmlDoc = new XmlDocument();
|
|
|
+ List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
|
|
|
+
|
|
|
+ if (textAsset == null)
|
|
|
+ {
|
|
|
+ textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.FlowerConfig, Folder.Config);
|
|
|
+ }
|
|
|
+
|
|
|
+ xmlDoc.LoadXml(textAsset.text);
|
|
|
+
|
|
|
+ xmlNodeList = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode);
|
|
|
+
|
|
|
+ for (int i = 0; i < xmlNodeList.Count; i++)
|
|
|
+ {
|
|
|
+ attributeList.Add(xmlNodeList[i].Attributes);
|
|
|
+ }
|
|
|
+
|
|
|
+ return attributeList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static List<XmlAttributeCollection> GetLotteryConfig()
|
|
|
+ {
|
|
|
+ TextAsset textAsset;
|
|
|
+ XmlNodeList xmlNodeList;
|
|
|
+
|
|
|
+ XmlDocument xmlDoc = new XmlDocument();
|
|
|
+ List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
|
|
|
+
|
|
|
+
|
|
|
+ textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.LotteryConfig, Folder.Config);
|
|
|
+
|
|
|
+ xmlDoc.LoadXml(textAsset.text);
|
|
|
+
|
|
|
+ xmlNodeList = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode);
|
|
|
+
|
|
|
+ for (int i = 0; i < xmlNodeList.Count; i++)
|
|
|
+ {
|
|
|
+ attributeList.Add(xmlNodeList[i].Attributes);
|
|
|
+ }
|
|
|
+
|
|
|
+ return attributeList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static List<XmlAttributeCollection> GetAchieveConfig()
|
|
|
+ {
|
|
|
+ TextAsset textAsset;
|
|
|
+ XmlNodeList xmlNodeList;
|
|
|
+
|
|
|
+ XmlDocument xmlDoc = new XmlDocument();
|
|
|
+ List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
|
|
|
+
|
|
|
+
|
|
|
+ textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.AchieveConfig, Folder.Config);
|
|
|
+
|
|
|
+ xmlDoc.LoadXml(textAsset.text);
|
|
|
+
|
|
|
+ xmlNodeList = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode);
|
|
|
+
|
|
|
+ for (int i = 0; i < xmlNodeList.Count; i++)
|
|
|
+ {
|
|
|
+ attributeList.Add(xmlNodeList[i].Attributes);
|
|
|
+ }
|
|
|
+
|
|
|
+ return attributeList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static List<XmlAttributeCollection> GetDressRoomConfig(TextAsset textAsset = null)
|
|
|
+ {
|
|
|
+ XmlNodeList xmlNodeList;
|
|
|
+
|
|
|
+ XmlDocument xmlDoc = new XmlDocument();
|
|
|
+ List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
|
|
|
+
|
|
|
+ if (textAsset == null)
|
|
|
+ {
|
|
|
+ textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.DressroomConfig, Folder.Config);
|
|
|
+ }
|
|
|
+
|
|
|
+ xmlDoc.LoadXml(textAsset.text);
|
|
|
+
|
|
|
+ xmlNodeList = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode);
|
|
|
+
|
|
|
+ for (int i = 0; i < xmlNodeList.Count; i++)
|
|
|
+ {
|
|
|
+ attributeList.Add(xmlNodeList[i].Attributes);
|
|
|
+ }
|
|
|
+
|
|
|
+ return attributeList;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static int GetGardenLevel(XmlDocument xmlDocument)
|
|
|
+ {
|
|
|
+ XmlNodeList nodeList = xmlDocument.SelectNodes(PlayerConfigLabel.RootNode + "/" + PlayerConfigLabel.SkillList + "/" + PlayerConfigLabel.Skill);
|
|
|
+ for (int i = 0; i < nodeList.Count; i++)
|
|
|
+ {
|
|
|
+ if (nodeList[i].Attributes[0].Value == "Ability1")
|
|
|
+ {
|
|
|
+ return int.Parse(nodeList[i].Attributes[3].Value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static int GetConfigVersion(XmlDocument xmlDocument)
|
|
|
+ {
|
|
|
+ return int.Parse(xmlDocument.SelectSingleNode(PlayerConfigLabel.RootNode + "/" + PlayerConfigLabel.Version).Attributes[0].Value);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static List<string> GetDefaultDressDatas()
|
|
|
+ {
|
|
|
+ List<string> defaultDressDatas = new List<string>();
|
|
|
+ defaultDressDatas.Add("脑壳-缺失");
|
|
|
+ defaultDressDatas.Add("裙子-缺失");
|
|
|
+ defaultDressDatas.Add("鞋子-缺失");
|
|
|
+ defaultDressDatas.Add("头饰-缺失");
|
|
|
+ defaultDressDatas.Add("上衣-缺失");
|
|
|
+ defaultDressDatas.Add("眼睛1");
|
|
|
+ defaultDressDatas.Add("嘴巴1");
|
|
|
+ defaultDressDatas.Add("翅膀-缺失");
|
|
|
+ defaultDressDatas.Add("Empty");
|
|
|
+ defaultDressDatas.Add("Empty");
|
|
|
+ defaultDressDatas.Add("Empty");
|
|
|
+ defaultDressDatas.Add("Empty");
|
|
|
+
|
|
|
+ //defaultDressDatas.Add("脑壳1");
|
|
|
+ //defaultDressDatas.Add("裙子1");
|
|
|
+ //defaultDressDatas.Add("鞋子1");
|
|
|
+ //defaultDressDatas.Add("头饰品1");
|
|
|
+ //defaultDressDatas.Add("上衣1");
|
|
|
+ //defaultDressDatas.Add("眼睛1");
|
|
|
+ //defaultDressDatas.Add("嘴巴1");
|
|
|
+ //defaultDressDatas.Add("Empty");
|
|
|
+ //defaultDressDatas.Add("Empty");
|
|
|
+ //defaultDressDatas.Add("短袖2左");
|
|
|
+ //defaultDressDatas.Add("Empty");
|
|
|
+ //defaultDressDatas.Add("短袖2右");
|
|
|
+
|
|
|
+ return defaultDressDatas;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static XmlDocument GetXmlDocument(string ConfigName)
|
|
|
+ {
|
|
|
+ TextAsset textAsset = ResourceManager.Load<TextAsset>(ConfigName, Folder.Config);
|
|
|
+ XmlDocument xmlDocument = new XmlDocument();
|
|
|
+ xmlDocument.LoadXml(textAsset.text);
|
|
|
+ return xmlDocument;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //玩家存档版本大于默认存档版本时需要清空
|
|
|
+ //玩家存档版本小于默认存档版本时需要更新
|
|
|
+ //玩家存档版本等于ReplayVersion时需要标记为重玩
|
|
|
+ public static XmlDocument UpdateConfigDocument(int nativeVersion, XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ if (nativeVersion < 0)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 0");
|
|
|
+
|
|
|
+ ToVersion0(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 1)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 1");
|
|
|
+
|
|
|
+ ToVersion1(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 2)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 2");
|
|
|
+
|
|
|
+ ToVersion2(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 3)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 3");
|
|
|
+
|
|
|
+ ToVersion3(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 4)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 4");
|
|
|
+
|
|
|
+ ToVersion4(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 5)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 5");
|
|
|
+
|
|
|
+ ToVersion5(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 6)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 6");
|
|
|
+
|
|
|
+ ToVersion6(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 7)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 7");
|
|
|
+
|
|
|
+ ToVersion7(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 8)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 8");
|
|
|
+
|
|
|
+ ToVersion8(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 9)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 9");
|
|
|
+
|
|
|
+ ToVersion9(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 10)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 10");
|
|
|
+
|
|
|
+ ToVersion10(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 11)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 11");
|
|
|
+
|
|
|
+ ToVersion11(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 12)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 12");
|
|
|
+
|
|
|
+ ToVersion12(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 13)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 13");
|
|
|
+
|
|
|
+ ToVersion13(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 14)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 14");
|
|
|
+
|
|
|
+ ToVersion14(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 15)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 15");
|
|
|
+
|
|
|
+ ToVersion15(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 16)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 16");
|
|
|
+
|
|
|
+ ToVersion16(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 17)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 17");
|
|
|
+
|
|
|
+ ToVersion17(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 18)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 18");
|
|
|
+
|
|
|
+ ToVersion18(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 19)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 19");
|
|
|
+
|
|
|
+ ToVersion19(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 20)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 20");
|
|
|
+
|
|
|
+ ToVersion20(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 21)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 21");
|
|
|
+
|
|
|
+ ToVersion21(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 22)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 22");
|
|
|
+
|
|
|
+ ToVersion22(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 23)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 23");
|
|
|
+
|
|
|
+ ToVersion23(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 24)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 24");
|
|
|
+
|
|
|
+ ToVersion24(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 25)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 25");
|
|
|
+
|
|
|
+ ToVersion25(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 26)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 26");
|
|
|
+
|
|
|
+ ToVersion26(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 28)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 28");
|
|
|
+
|
|
|
+ ToVersion28(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 29)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 29");
|
|
|
+
|
|
|
+ ToVersion29(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 30)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 30");
|
|
|
+
|
|
|
+ ToVersion30(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 31)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 31");
|
|
|
+
|
|
|
+ ToVersion31(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 32)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 32");
|
|
|
+
|
|
|
+ ToVersion32(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 33)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 33");
|
|
|
+
|
|
|
+ ToVersion33(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 34)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 34");
|
|
|
+
|
|
|
+ ToVersion34(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 35)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 35");
|
|
|
+
|
|
|
+ ToVersion35(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 36)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 36");
|
|
|
+
|
|
|
+ ToVersion36(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nativeVersion < 37)
|
|
|
+ {
|
|
|
+ Debug.LogWarning("UpdateArchive to 37");
|
|
|
+
|
|
|
+ ToVersion37(nativeDoc, defaultDoc);
|
|
|
+ }
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion0(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 0.ToString();
|
|
|
+
|
|
|
+ XmlNode xmlNode1 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.ADPlayTime);
|
|
|
+
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode1, true));
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion1(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 1.ToString();
|
|
|
+
|
|
|
+ XmlNode xmlNode1 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.SerialNumber);
|
|
|
+
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode1, true));
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion2(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 2.ToString();
|
|
|
+
|
|
|
+ XmlNode xmlNode1 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.NotificationIndex);
|
|
|
+
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode1, true));
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion3(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 3.ToString();
|
|
|
+
|
|
|
+ XmlNode xmlNode1 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.NickName);
|
|
|
+
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode1, true));
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion4(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 4.ToString();
|
|
|
+
|
|
|
+ XmlNode xmlNode = nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.DressData);
|
|
|
+
|
|
|
+ XmlAttribute attribute = xmlNode.Attributes.Append (nativeDoc.CreateAttribute (PlayerConfigLabel.LeftLongSleeveSlot));
|
|
|
+ attribute.Value="Empty";
|
|
|
+
|
|
|
+ attribute = xmlNode.Attributes.Append (nativeDoc.CreateAttribute (PlayerConfigLabel.LeftShortSleeveSlot));
|
|
|
+ attribute.Value="Empty";
|
|
|
+
|
|
|
+ attribute = xmlNode.Attributes.Append (nativeDoc.CreateAttribute (PlayerConfigLabel.RightLongSleeveSlot));
|
|
|
+ attribute.Value="Empty";
|
|
|
+
|
|
|
+ attribute = xmlNode.Attributes.Append (nativeDoc.CreateAttribute (PlayerConfigLabel.RightShortSleeveSlot));
|
|
|
+ attribute.Value="Empty";
|
|
|
+
|
|
|
+ List<string> sleeveList = GetSleeveListByTop (xmlNode.Attributes [4].Value);
|
|
|
+
|
|
|
+ xmlNode.Attributes [8].Value = sleeveList[0];
|
|
|
+ xmlNode.Attributes [9].Value = sleeveList[1];
|
|
|
+ xmlNode.Attributes [10].Value = sleeveList[2];
|
|
|
+ xmlNode.Attributes [11].Value = sleeveList[3];
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static List<string> GetSleeveListByTop(string topName)
|
|
|
+ {
|
|
|
+ List<string> sleeveList = new List<string>() {"Empty", "Empty", "Empty", "Empty"};
|
|
|
+
|
|
|
+ if (topName == "上衣1")
|
|
|
+ {
|
|
|
+ sleeveList[1] = "短袖1左";
|
|
|
+ sleeveList[3] = "短袖1右";
|
|
|
+ }
|
|
|
+ else if (topName == "上衣2")
|
|
|
+ {
|
|
|
+ sleeveList[1] = "短袖2左";
|
|
|
+ sleeveList[3] = "短袖2右";
|
|
|
+ }
|
|
|
+ else if (topName == "上衣3")
|
|
|
+ {
|
|
|
+ sleeveList[1] = "短袖2左";
|
|
|
+ sleeveList[3] = "短袖2右";
|
|
|
+ }
|
|
|
+ else if (topName == "上衣5")
|
|
|
+ {
|
|
|
+ sleeveList[1] = "短袖2左";
|
|
|
+ sleeveList[3] = "短袖2右";
|
|
|
+ }
|
|
|
+ else if (topName == "上衣6")
|
|
|
+ {
|
|
|
+ sleeveList[1] = "短袖6左";
|
|
|
+ sleeveList[3] = "短袖6右";
|
|
|
+ }
|
|
|
+ else if (topName == "上衣7")
|
|
|
+ {
|
|
|
+ sleeveList[1] = "短袖7左";
|
|
|
+ sleeveList[3] = "短袖7右";
|
|
|
+ }
|
|
|
+ else if (topName == "上衣7(粉)")
|
|
|
+ {
|
|
|
+ sleeveList[1] = "短袖7粉左";
|
|
|
+ sleeveList[3] = "短袖7粉右";
|
|
|
+ }
|
|
|
+ else if (topName == "上衣12")
|
|
|
+ {
|
|
|
+ sleeveList[1] = "短袖12左";
|
|
|
+ sleeveList[3] = "短袖12右";
|
|
|
+ }
|
|
|
+ else if (topName == "上衣13")
|
|
|
+ {
|
|
|
+ sleeveList[1] = "短袖13左";
|
|
|
+ sleeveList[3] = "短袖13右";
|
|
|
+ }
|
|
|
+ else if (topName == "上衣13(紫)")
|
|
|
+ {
|
|
|
+ sleeveList[1] = "短袖13蓝左";
|
|
|
+ sleeveList[3] = "短袖13蓝右";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ sleeveList[0] = "长袖9左";
|
|
|
+ sleeveList[2] = "长袖9右";
|
|
|
+ }
|
|
|
+
|
|
|
+ return sleeveList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion5(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 5.ToString();
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion6(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 6.ToString();
|
|
|
+
|
|
|
+ XmlNode xmlNode1 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.NewFlowerFlag);
|
|
|
+
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode1, true));
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ private static int DefaultFlowerAmt = 1;
|
|
|
+ public static XmlDocument ToVersion7(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 7.ToString();
|
|
|
+
|
|
|
+ XmlNode xmlNode1 = nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.FlowerList);
|
|
|
+ string[] flowerIDs= xmlNode1.Attributes[0].Value.Split(' ');
|
|
|
+
|
|
|
+ xmlNode1 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.FlowerAmtList);
|
|
|
+ xmlNode1.Attributes[0].Value = "";
|
|
|
+ foreach (var flowerID in flowerIDs)
|
|
|
+ {
|
|
|
+ xmlNode1.Attributes[0].Value += " " + DefaultFlowerAmt;
|
|
|
+ }
|
|
|
+ xmlNode1.Attributes[0].Value = xmlNode1.Attributes[0].Value.TrimStart();
|
|
|
+
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode1, true));
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion8(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 8.ToString();
|
|
|
+
|
|
|
+ XmlNode xmlNode0 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.TutorialPlazaRoom);
|
|
|
+ XmlNode xmlNode1 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.TutorialIndexPlazaRoom);
|
|
|
+
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode0, true));
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode1, true));
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ private static int DefaultAchieveValue = 0;
|
|
|
+ public static XmlDocument ToVersion9(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 9.ToString();
|
|
|
+ XmlNode xmlNode = nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.AchieveData);
|
|
|
+ xmlNode.Attributes.Append(nativeDoc.CreateAttribute(PlayerConfigLabel.CreateRoomAmt));
|
|
|
+ xmlNode.Attributes.Append(nativeDoc.CreateAttribute(PlayerConfigLabel.CreateChestAmt));
|
|
|
+ xmlNode.Attributes.Append(nativeDoc.CreateAttribute(PlayerConfigLabel.CreateLuckyChestAmt));
|
|
|
+ xmlNode.Attributes.Append(nativeDoc.CreateAttribute(PlayerConfigLabel.CreateGuessColorChestAmt));
|
|
|
+ xmlNode.Attributes.Append(nativeDoc.CreateAttribute(PlayerConfigLabel.CreateGuessNumberChestAmt));
|
|
|
+ xmlNode.Attributes.Append(nativeDoc.CreateAttribute(PlayerConfigLabel.GetChestAwardAmt));
|
|
|
+ xmlNode.Attributes[9].Value = DefaultAchieveValue.ToString();
|
|
|
+ xmlNode.Attributes[10].Value = DefaultAchieveValue.ToString();
|
|
|
+ xmlNode.Attributes[11].Value = DefaultAchieveValue.ToString();
|
|
|
+ xmlNode.Attributes[12].Value = DefaultAchieveValue.ToString();
|
|
|
+ xmlNode.Attributes[13].Value = DefaultAchieveValue.ToString();
|
|
|
+ xmlNode.Attributes[14].Value = DefaultAchieveValue.ToString();
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion10(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 10.ToString();
|
|
|
+ ChestManager.ClearRefundAndOperateData(nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode));
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion11(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 11.ToString();
|
|
|
+ XmlNode xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.ReplayVersion);
|
|
|
+
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion12(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 12.ToString();
|
|
|
+ XmlNode xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.ExtraSlot);
|
|
|
+
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion13(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 13.ToString();
|
|
|
+ XmlNode xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.CurrentMinigameType);
|
|
|
+
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion14(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 14.ToString();
|
|
|
+ XmlNode xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.LastPrivateMessageDate);
|
|
|
+
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion15(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 15.ToString();
|
|
|
+ XmlNode xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.LastApplicantSerialNumber);
|
|
|
+
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion16(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 16.ToString();
|
|
|
+
|
|
|
+ XmlNode xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.FindMissingMinigameTutorial);
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
|
|
|
+ xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.FindMissingMinigameTutorialIndex);
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion17(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 17.ToString();
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion18(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 18.ToString();
|
|
|
+
|
|
|
+ string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
+ if (Directory.Exists(persistentFolderPath))
|
|
|
+ {
|
|
|
+ Directory.Delete(persistentFolderPath, true);
|
|
|
+ }
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion19(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 19.ToString();
|
|
|
+
|
|
|
+ string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
+ if (Directory.Exists(persistentFolderPath))
|
|
|
+ {
|
|
|
+ Directory.Delete(persistentFolderPath, true);
|
|
|
+ }
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion20(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 20.ToString();
|
|
|
+
|
|
|
+ XmlNode xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.MinigameCoolFlag);
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion21(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 21.ToString();
|
|
|
+
|
|
|
+ string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
+ if (Directory.Exists(persistentFolderPath))
|
|
|
+ {
|
|
|
+ Directory.Delete(persistentFolderPath, true);
|
|
|
+ }
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion22(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 22.ToString();
|
|
|
+
|
|
|
+ string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
+ if (Directory.Exists(persistentFolderPath))
|
|
|
+ {
|
|
|
+ Directory.Delete(persistentFolderPath, true);
|
|
|
+ }
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion23(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 23.ToString();
|
|
|
+
|
|
|
+ string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
+ if (Directory.Exists(persistentFolderPath))
|
|
|
+ {
|
|
|
+ Directory.Delete(persistentFolderPath, true);
|
|
|
+ }
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion24(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 24.ToString();
|
|
|
+
|
|
|
+ string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
+ if (Directory.Exists(persistentFolderPath))
|
|
|
+ {
|
|
|
+ Directory.Delete(persistentFolderPath, true);
|
|
|
+ }
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion25(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 25.ToString();
|
|
|
+
|
|
|
+ XmlNode xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.FashionShowTutorial);
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
|
|
|
+ xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.FashionShowTutorialIndex);
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion26(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 26.ToString();
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion27(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 27.ToString();
|
|
|
+
|
|
|
+ string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
+ if (Directory.Exists(persistentFolderPath))
|
|
|
+ {
|
|
|
+ Directory.Delete(persistentFolderPath, true);
|
|
|
+ }
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion28(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 28.ToString();
|
|
|
+
|
|
|
+ string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
+ if (Directory.Exists(persistentFolderPath))
|
|
|
+ {
|
|
|
+ Directory.Delete(persistentFolderPath, true);
|
|
|
+ }
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion29(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 29.ToString();
|
|
|
+
|
|
|
+ string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
+ if (Directory.Exists(persistentFolderPath))
|
|
|
+ {
|
|
|
+ Directory.Delete(persistentFolderPath, true);
|
|
|
+ }
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion30(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 30.ToString();
|
|
|
+
|
|
|
+ string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
+ if (Directory.Exists(persistentFolderPath))
|
|
|
+ {
|
|
|
+ Directory.Delete(persistentFolderPath, true);
|
|
|
+ }
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion31(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 31.ToString();
|
|
|
+
|
|
|
+ string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
+ if (Directory.Exists(persistentFolderPath))
|
|
|
+ {
|
|
|
+ Directory.Delete(persistentFolderPath, true);
|
|
|
+ }
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion32(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 32.ToString();
|
|
|
+
|
|
|
+ string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
+ if (Directory.Exists(persistentFolderPath))
|
|
|
+ {
|
|
|
+ Directory.Delete(persistentFolderPath, true);
|
|
|
+ }
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion33(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 33.ToString();
|
|
|
+
|
|
|
+ string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
+ if (Directory.Exists(persistentFolderPath))
|
|
|
+ {
|
|
|
+ Directory.Delete(persistentFolderPath, true);
|
|
|
+ }
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion34(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 34.ToString();
|
|
|
+
|
|
|
+ string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
+ if (Directory.Exists(persistentFolderPath))
|
|
|
+ {
|
|
|
+ Directory.Delete(persistentFolderPath, true);
|
|
|
+ }
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion35(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 35.ToString();
|
|
|
+
|
|
|
+ string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
+ if (Directory.Exists(persistentFolderPath))
|
|
|
+ {
|
|
|
+ Directory.Delete(persistentFolderPath, true);
|
|
|
+ }
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion36(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 36.ToString();
|
|
|
+
|
|
|
+ string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
+ if (Directory.Exists(persistentFolderPath))
|
|
|
+ {
|
|
|
+ Directory.Delete(persistentFolderPath, true);
|
|
|
+ }
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static XmlDocument ToVersion37(XmlDocument nativeDoc, XmlDocument defaultDoc)
|
|
|
+ {
|
|
|
+ nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 37.ToString();
|
|
|
+
|
|
|
+ string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
|
|
|
+ if (Directory.Exists(persistentFolderPath))
|
|
|
+ {
|
|
|
+ Directory.Delete(persistentFolderPath, true);
|
|
|
+ }
|
|
|
+
|
|
|
+ return nativeDoc;
|
|
|
+ }
|
|
|
}
|