ManaData.cs 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257
  1. using LitJson;
  2. using UnityEngine;
  3. using System;
  4. using System.IO;
  5. using System.Xml;
  6. using System.Text;
  7. using System.Collections;
  8. using System.Collections.Generic;
  9. using System.Linq;
  10. using System.Security.Cryptography;
  11. using Sfs2X.Entities;
  12. using Sfs2X.Entities.Data;
  13. using Random = UnityEngine.Random;
  14. public class ManaData : Regist
  15. {
  16. #region 变量
  17. public static XmlNode PlayerNode
  18. {
  19. get
  20. {
  21. if (PlayerNode_ == null)
  22. {
  23. PlayerNode_ = PlayerDoc.SelectSingleNode("PlayerConfig");
  24. }
  25. return PlayerNode_;
  26. }
  27. set { PlayerNode_ = value; }
  28. }
  29. public static XmlDocument PlayerDoc
  30. {
  31. get
  32. {
  33. if (PlayerDoc_ == null)
  34. {
  35. int defaultVersion;
  36. int nativeVersion;
  37. XmlNode node;
  38. XmlDocument nativeDoc = new XmlDocument();
  39. string configPath = Application.persistentDataPath + "/PlayerConfig.xml";
  40. if (File.Exists(configPath))
  41. {
  42. try
  43. {
  44. StreamReader sr = new StreamReader(configPath);
  45. nativeDoc.LoadXml(sr.ReadToEnd());
  46. sr.Close();
  47. Auxiliary.DecryptXml(nativeDoc);
  48. }
  49. catch (Exception)
  50. {
  51. Debug.LogWarning("Download Archive : MD5 doesn't match");
  52. ManaDebug.Log("Download Archive");
  53. DamageLock = true;
  54. DownloadLock = false;
  55. return null;
  56. }
  57. TextAsset textAsset = ManaReso.Load<TextAsset>("PlayerConfig", Folder.Config);
  58. DefaultDoc.LoadXml(textAsset.text);
  59. defaultVersion = int.Parse(DefaultDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("Version").Attributes[0].Value);
  60. node = nativeDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("Version");
  61. if (node == null)
  62. {
  63. StreamWriter sw = new StreamWriter(Application.persistentDataPath + "/PlayerConfig.xml");
  64. sw.Write(DefaultDoc.OuterXml);
  65. sw.Close();
  66. PlayerDoc_ = DefaultDoc;
  67. }
  68. else
  69. {
  70. nativeVersion = int.Parse(node.Attributes[0].Value);
  71. if (nativeVersion < defaultVersion)
  72. {
  73. byte[] bytes;
  74. MD5 md5 = new MD5CryptoServiceProvider();
  75. if (nativeVersion <= 4)
  76. {
  77. bytes = Encoding.UTF8.GetBytes(nativeDoc.OuterXml);
  78. }
  79. else
  80. {
  81. bytes = File.ReadAllBytes(configPath);
  82. }
  83. if (PlayerPrefs.GetString("config") != Auxiliary.ToString(md5.ComputeHash(bytes)))
  84. {
  85. Debug.LogWarning("Download Archive : MD5 doesn't match");
  86. ManaDebug.Log("Download Archive");
  87. DamageLock = true;
  88. DownloadLock = false;
  89. return null;
  90. }
  91. else
  92. {
  93. PlayerDoc_ = MergeXML(nativeVersion, nativeDoc, DefaultDoc);
  94. ManaServer.Save();
  95. }
  96. }
  97. else if (nativeVersion > defaultVersion)
  98. {
  99. PlayerDoc_ = DefaultDoc;
  100. }
  101. else
  102. {
  103. byte[] bytes = File.ReadAllBytes(configPath);
  104. MD5 md5 = new MD5CryptoServiceProvider();
  105. if (PlayerPrefs.GetString("config") != Auxiliary.ToString(md5.ComputeHash(bytes)))
  106. {
  107. Debug.LogWarning("Download Archive : MD5 doesn't match");
  108. ManaDebug.Log("Download Archive");
  109. DamageLock = true;
  110. DownloadLock = false;
  111. return null;
  112. }
  113. PlayerDoc_ = nativeDoc;
  114. }
  115. }
  116. }
  117. else
  118. {
  119. TextAsset textAsset = ManaReso.Load<TextAsset>("PlayerConfig", Folder.Config);
  120. DefaultDoc.LoadXml(textAsset.text);
  121. Debug.LogWarning("Download Archive");
  122. ManaDebug.Log("Download Archive");
  123. DamageLock = true;
  124. DownloadLock = false;
  125. return null;
  126. }
  127. }
  128. return PlayerDoc_;
  129. }
  130. set { PlayerDoc_ = value; }
  131. }
  132. public static XmlNode PlayerNode_;
  133. public static XmlDocument PlayerDoc_;
  134. public static float Timer;
  135. public static bool DamageLock;
  136. public static bool DownloadLock;
  137. public static XmlDocument DefaultDoc = new XmlDocument();
  138. #endregion
  139. public void Update()
  140. {
  141. if (DamageLock)
  142. {
  143. Timer += Time.deltaTime;
  144. if (Timer >= 10)
  145. {
  146. DamageLock = false;
  147. TextAsset textAsset = ManaReso.Load<TextAsset>("PlayerConfig", Folder.Config);
  148. PlayerDoc_ = new XmlDocument();
  149. PlayerDoc_.LoadXml(textAsset.text);
  150. return;
  151. }
  152. }
  153. if (!DownloadLock)
  154. {
  155. if (ManaServer.ID != "Default")
  156. {
  157. DownloadLock = true;
  158. ManaServer.DownloadBySerialNumber(ManaServer.SerialNumber, RecoveXml);
  159. }
  160. }
  161. }
  162. public override bool RegistImmed()
  163. {
  164. if (base.RegistImmed())
  165. {
  166. return true;
  167. }
  168. enabled = true;
  169. return false;
  170. }
  171. public static void SaveXml()
  172. {
  173. if (Initializer.Complete)
  174. {
  175. XmlDocument doc = new XmlDocument();
  176. doc.LoadXml(PlayerDoc.OuterXml);
  177. Auxiliary.EncryptXml(doc);
  178. StreamWriter sw = new StreamWriter(Application.persistentDataPath + "/PlayerConfig.xml");
  179. sw.Write(doc.OuterXml);
  180. sw.Close();
  181. byte[] bytes = File.ReadAllBytes(Application.persistentDataPath + "/PlayerConfig.xml");
  182. //byte[] bytes = Encoding.UTF8.GetBytes(PlayerDoc.OuterXml);
  183. MD5 md5 = new MD5CryptoServiceProvider();
  184. PlayerPrefs.SetString("config", Auxiliary.ToString(md5.ComputeHash(bytes)));
  185. }
  186. }
  187. public static void RecoveXml(JsonData jsonData)
  188. {
  189. if (!DamageLock)
  190. {
  191. return;
  192. }
  193. DamageLock = false;
  194. TextAsset textAsset = ManaReso.Load<TextAsset>("PlayerConfig", Folder.Config);
  195. DefaultDoc.LoadXml(textAsset.text);
  196. if (jsonData.Inst_Object.Keys.Contains("l"))
  197. {
  198. PlayerDoc_ = new XmlDocument();
  199. PlayerDoc_.LoadXml(jsonData["l"].ToString());
  200. int nativeVersion = int.Parse(PlayerDoc_.SelectSingleNode("PlayerConfig").SelectSingleNode("Version").Attributes[0].Value);
  201. int defaultVersion = int.Parse(DefaultDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("Version").Attributes[0].Value);
  202. //Debug.Log(nativeVersion + " " + defaultVersion);
  203. //ManaDebug.Log(nativeVersion + " " + defaultVersion);
  204. if (nativeVersion < defaultVersion)
  205. {
  206. MergeXML(nativeVersion, PlayerDoc_, DefaultDoc);
  207. ManaServer.Save();
  208. }
  209. else if (nativeVersion > defaultVersion)
  210. {
  211. PlayerDoc_ = DefaultDoc;
  212. }
  213. }
  214. else
  215. {
  216. PlayerDoc_ = DefaultDoc;
  217. }
  218. }
  219. public static void SaveSkillList()
  220. {
  221. if (ManaTutorial.TutorialA || !ManaCenter.Complete)
  222. {
  223. return;
  224. }
  225. XmlNode xmlNode;
  226. XmlAttribute xmlAttribute;
  227. xmlNode = PlayerNode.SelectSingleNode("SkillList");
  228. xmlNode.RemoveAll();
  229. for (int i = 0; i < ManaCenter.SkillList.Count; i++)
  230. {
  231. if (ManaCenter.SkillList[i].SkillType == SkillType.Skill)
  232. {
  233. #region Skill
  234. Skill skill = (Skill)ManaCenter.SkillList[i];
  235. xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, "Skill", ""));
  236. xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("ID"));
  237. xmlAttribute.Value = skill.ID;
  238. xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("SkillType"));
  239. xmlAttribute.Value = skill.SkillType.ToString();
  240. xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("ItemStatus"));
  241. xmlAttribute.Value = skill.ItemStatus.ToString();
  242. xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Level"));
  243. xmlAttribute.Value = skill.Level.ToString();
  244. xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("CoolTimer"));
  245. xmlAttribute.Value = skill.CoolTimer.ToString("0");
  246. xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("UseTimer"));
  247. xmlAttribute.Value = skill.UseTimer.ToString("0");
  248. xmlNode = PlayerNode.SelectSingleNode("SkillList");
  249. #endregion
  250. }
  251. else if (ManaCenter.SkillList[i].SkillType == SkillType.Pack)
  252. {
  253. #region Pack
  254. Pack pack = (Pack)ManaCenter.SkillList[i];
  255. xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, "Skill", ""));
  256. xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("ID"));
  257. xmlAttribute.Value = pack.ID;
  258. xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("SkillType"));
  259. xmlAttribute.Value = pack.SkillType.ToString();
  260. xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("ItemStatus"));
  261. xmlAttribute.Value = pack.ItemStatus.ToString();
  262. xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Level"));
  263. xmlAttribute.Value = pack.Level.ToString();
  264. xmlNode = PlayerNode.SelectSingleNode("SkillList");
  265. #endregion
  266. }
  267. else if (ManaCenter.SkillList[i].SkillType == SkillType.Ability)
  268. {
  269. #region Ability
  270. Ability ability = (Ability)ManaCenter.SkillList[i];
  271. xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, "Skill", ""));
  272. xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("ID"));
  273. xmlAttribute.Value = ability.ID;
  274. xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("SkillType"));
  275. xmlAttribute.Value = ability.SkillType.ToString();
  276. xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("ItemStatus"));
  277. xmlAttribute.Value = ability.ItemStatus.ToString();
  278. xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Level"));
  279. xmlAttribute.Value = ability.Level.ToString();
  280. xmlNode = PlayerNode.SelectSingleNode("SkillList");
  281. #endregion
  282. }
  283. else if (ManaCenter.SkillList[i].SkillType == SkillType.BigSkill)
  284. {
  285. #region BigSkill
  286. BigSkill bigSkill = (BigSkill)ManaCenter.SkillList[i];
  287. xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, "Skill", ""));
  288. xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("ID"));
  289. xmlAttribute.Value = bigSkill.ID;
  290. xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("SkillType"));
  291. xmlAttribute.Value = bigSkill.SkillType.ToString();
  292. xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("ItemStatus"));
  293. xmlAttribute.Value = bigSkill.ItemStatus.ToString();
  294. xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("BarStatus"));
  295. xmlAttribute.Value = bigSkill.BarStatus.ToString();
  296. xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Level"));
  297. xmlAttribute.Value = bigSkill.Level.ToString();
  298. xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("CoolTimer"));
  299. xmlAttribute.Value = bigSkill.CoolTimer.ToString("0");
  300. xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("UseTimer"));
  301. xmlAttribute.Value = bigSkill.UseTimer.ToString("0");
  302. xmlNode = PlayerNode.SelectSingleNode("SkillList");
  303. #endregion
  304. }
  305. }
  306. }
  307. public static void SaveDress()
  308. {
  309. XmlNode xmlNode = PlayerNode.SelectSingleNode("DressList");
  310. xmlNode.Attributes[0].Value = "";
  311. for (int i = 0; i < ManaPlayer.BoughtCloseList.Count; i++)
  312. {
  313. xmlNode.Attributes[0].Value += ManaPlayer.BoughtCloseList[i] + " ";
  314. }
  315. xmlNode.Attributes[0].Value = xmlNode.Attributes[0].Value.TrimEnd(' ');
  316. xmlNode = PlayerNode.SelectSingleNode("DressData");
  317. for (int i = 0; i < ManaPlayer.DressData.Count; i++)
  318. {
  319. xmlNode.Attributes[i].Value = ManaPlayer.DressData[i];
  320. }
  321. }
  322. public static void SaveAchieve()
  323. {
  324. XmlNode xmlNode = PlayerNode.SelectSingleNode("AchieveList");
  325. xmlNode.Attributes[0].Value = "";
  326. foreach (var kv in ManaAchieve.AchieveDic)
  327. {
  328. if (!kv.Value.Lock)
  329. {
  330. xmlNode.Attributes[0].Value += kv.Value.ID_ + " ";
  331. }
  332. }
  333. xmlNode.Attributes[0].Value = xmlNode.Attributes[0].Value.TrimEnd(' ');
  334. PlayerNode.SelectSingleNode("AchieveData").Attributes[0].Value = ManaCenter.AdAmt.ToString("0");
  335. PlayerNode.SelectSingleNode("AchieveData").Attributes[1].Value = ManaCenter.SkillAmt.ToString("0");
  336. PlayerNode.SelectSingleNode("AchieveData").Attributes[2].Value = ManaCenter.SignAmt.ToString("0");
  337. PlayerNode.SelectSingleNode("AchieveData").Attributes[3].Value = ManaCenter.ShareAmt.ToString("0");
  338. PlayerNode.SelectSingleNode("AchieveData").Attributes[4].Value = ManaCenter.ElfLevel.ToString("0");
  339. PlayerNode.SelectSingleNode("AchieveData").Attributes[5].Value = ManaCenter.MiniGameAmt.ToString("0");
  340. PlayerNode.SelectSingleNode("AchieveData").Attributes[6].Value = ManaCenter.FlowerCoin.ToString("0");
  341. PlayerNode.SelectSingleNode("AchieveData").Attributes[7].Value = ManaCenter.TotalPerson.ToString("0");
  342. PlayerNode.SelectSingleNode("AchieveData").Attributes[8].Value = ManaCenter.CostDiamond.ToString("0");
  343. }
  344. public static void SavePlantList()
  345. {
  346. if (ManaVisit.InVisit || ManaTutorial.TutorialA)
  347. {
  348. return;
  349. }
  350. XmlAttributeCollection attribute = PlayerNode.SelectSingleNode("PlantList").Attributes;
  351. attribute[0].Value = "";
  352. for (int i = 0; i < ManaGarden.PlantList.Count; i++)
  353. {
  354. Slot slot = ManaGarden.PlantList[i];
  355. attribute[0].Value += slot.ID + "," + slot.Index + " ";
  356. }
  357. attribute[0].Value = attribute[0].Value.TrimEnd(' ');
  358. }
  359. public static void SaveCommon()
  360. {
  361. PlayerNode.SelectSingleNode("Coin").Attributes[0].Value = ManaCenter.Coin.ToString("0");
  362. PlayerNode.SelectSingleNode("Diamond").Attributes[0].Value = ManaCenter.Diamond.ToString("0");
  363. PlayerNode.SelectSingleNode("SignTime").Attributes[0].Value = ManaSign.SignTime.ToString();
  364. PlayerNode.SelectSingleNode("SignIndex").Attributes[0].Value = ManaSign.SignIndex.ToString();
  365. PlayerNode.SelectSingleNode("SignRound").Attributes[0].Value = ManaSign.SignRound.ToString();
  366. PlayerNode.SelectSingleNode("QuitFlag").Attributes[0].Value = ManaServer.Connect.ToInt().ToString();
  367. PlayerNode.SelectSingleNode("QuitTime").Attributes[0].Value = ManaServer.Time.ToString();
  368. PlayerNode.SelectSingleNode("MiniTimer").Attributes[0].Value = ManaCenter.MiniTimer.ToString("0");
  369. PlayerNode.SelectSingleNode("CircleTimer").Attributes[0].Value = ManaCenter.CircleTimer.ToString("0");
  370. PlayerNode.SelectSingleNode("ID").Attributes[0].Value = ManaServer.ID;
  371. PlayerNode.SelectSingleNode("SerialNumber").Attributes[0].Value = ManaServer.SerialNumber;
  372. PlayerNode.SelectSingleNode("Language").Attributes[0].Value = ManaLan.CurrentLan.ToString();
  373. PlayerNode.SelectSingleNode("MiniGameIndex").Attributes[0].Value = ManaMiniGame.MiniGameIndex.ToString();
  374. PlayerNode.SelectSingleNode("TutorialA").Attributes[0].Value = ManaTutorial.TutorialA.ToInt().ToString();
  375. PlayerNode.SelectSingleNode("TutorialB").Attributes[0].Value = ManaTutorial.TutorialB_.ToInt().ToString();
  376. PlayerNode.SelectSingleNode("TutorialC").Attributes[0].Value = ManaTutorial.TutorialC_.ToInt().ToString();
  377. PlayerNode.SelectSingleNode("TutorialD").Attributes[0].Value = ManaTutorial.TutorialD_.ToInt().ToString();
  378. PlayerNode.SelectSingleNode("TutorialE").Attributes[0].Value = ManaTutorial.TutorialE_.ToInt().ToString();
  379. PlayerNode.SelectSingleNode("TutorialIndexA").Attributes[0].Value = ManaTutorial.TutorialIndexA.ToString();
  380. PlayerNode.SelectSingleNode("TutorialIndexB").Attributes[0].Value = ManaTutorial.TutorialIndexB.ToString();
  381. PlayerNode.SelectSingleNode("TutorialIndexC").Attributes[0].Value = ManaTutorial.TutorialIndexC.ToString();
  382. PlayerNode.SelectSingleNode("TutorialIndexD").Attributes[0].Value = ManaTutorial.TutorialIndexD.ToString();
  383. PlayerNode.SelectSingleNode("TutorialIndexE").Attributes[0].Value = ManaTutorial.TutorialIndexE.ToString();
  384. }
  385. public static void SaveFlowerList()
  386. {
  387. XmlAttribute attribute = PlayerNode.SelectSingleNode("FlowerList").Attributes[0];
  388. attribute.Value = "";
  389. foreach (var kv in ManaGarden.FlowerInfoDic)
  390. {
  391. if (kv.Value.Unlock)
  392. {
  393. attribute.Value += kv.Value.ID_ + " ";
  394. }
  395. }
  396. attribute.Value = attribute.Value.Trim(' ');
  397. }
  398. public static void SavePlayerConfig()
  399. {
  400. if (Initializer.Complete)
  401. {
  402. SaveSkillList();
  403. SaveAchieve();
  404. SaveDress();
  405. SavePlantList();
  406. SaveCommon();
  407. SaveFlowerList();
  408. }
  409. }
  410. public static void ResetPlayerConfig()
  411. {
  412. PlayerNode.SelectSingleNode("Version").Attributes[0].Value = "10000";
  413. SavePlayerConfig();
  414. ManaCenter.SaveLock = true;
  415. }
  416. public static int GetPlayerInt(string node)
  417. {
  418. return int.Parse(PlayerNode.SelectSingleNode(node).Attributes[0].Value);
  419. }
  420. public static bool GetPlayerBool(string node)
  421. {
  422. return int.Parse(PlayerNode.SelectSingleNode(node).Attributes[0].Value).ToBool();
  423. }
  424. public static float GetPlayerFloat(string node)
  425. {
  426. return float.Parse(PlayerNode.SelectSingleNode(node).Attributes[0].Value);
  427. }
  428. public static string GetPlayerString(string node)
  429. {
  430. return PlayerNode.SelectSingleNode(node).Attributes[0].Value;
  431. }
  432. public static double GetPlayerDouble(string node)
  433. {
  434. return double.Parse(PlayerNode.SelectSingleNode(node).Attributes[0].Value);
  435. }
  436. public static void SavePlayerInt(string node, int value)
  437. {
  438. PlayerNode.SelectSingleNode(node).Attributes[0].Value = value.ToString();
  439. }
  440. public static void SavePlayerBool(string node, bool value)
  441. {
  442. PlayerNode.SelectSingleNode(node).Attributes[0].Value = value.ToInt().ToString();
  443. }
  444. public static void SavePlayerFloat(string node, float value)
  445. {
  446. PlayerNode.SelectSingleNode(node).Attributes[0].Value = value.ToString();
  447. }
  448. public static void SavePlayerString(string node, string value)
  449. {
  450. PlayerNode.SelectSingleNode(node).Attributes[0].Value = value;
  451. }
  452. public static void SavePlayerDouble(string node, double value)
  453. {
  454. PlayerNode.SelectSingleNode(node).Attributes[0].Value = value.ToString();
  455. }
  456. public static List<int> GetDressList()
  457. {
  458. List<int> list = new List<int>();
  459. XmlAttributeCollection attribute = PlayerNode.SelectSingleNode("DressList").Attributes;
  460. return Auxiliary.IntListParse(' ', attribute[0].Value, list);
  461. }
  462. public static List<int> GetDressDataIDs(Player player)
  463. {
  464. //foreach (var VARIABLE in ManaPlayer.CloseIDDic)
  465. //{
  466. // Debug.LogWarning(VARIABLE.Key);
  467. //}
  468. List<int> dressDataIDs = new List<int>();
  469. dressDataIDs.Add(ManaPlayer.CloseIDDic[player.Head]);
  470. dressDataIDs.Add(ManaPlayer.CloseIDDic[player.Dress]);
  471. dressDataIDs.Add(ManaPlayer.CloseIDDic[player.Shoe]);
  472. dressDataIDs.Add(ManaPlayer.CloseIDDic[player.HeadWear]);
  473. dressDataIDs.Add(ManaPlayer.CloseIDDic[player.Top]);
  474. dressDataIDs.Add(ManaPlayer.CloseIDDic[player.Eye]);
  475. dressDataIDs.Add(ManaPlayer.CloseIDDic[player.Mouse]);
  476. dressDataIDs.Add(ManaPlayer.CloseIDDic[player.Wing]);
  477. return dressDataIDs;
  478. }
  479. public static List<int> GetDressDataIDs(SFSObject parameter)
  480. {
  481. List<int> ids = parameter.GetIntArray(DataID.Close.GetHashString()).ToList();
  482. return ids;
  483. }
  484. public static List<string> GetDressData(SFSObject parameter)
  485. {
  486. List<int> ids = GetDressDataIDs(parameter);
  487. List<string> dressData = new List<string>();
  488. foreach (var id in ids)
  489. {
  490. dressData.Add(ManaPlayer.CloseUnitDic[id].ArmatureName);
  491. }
  492. return dressData;
  493. }
  494. public static List<string> GetDressData(XmlNode node = null)
  495. {
  496. XmlNode xmlNode;
  497. if (node == null)
  498. {
  499. xmlNode = PlayerNode.SelectSingleNode("DressData");
  500. }
  501. else
  502. {
  503. xmlNode = node.SelectSingleNode("DressData");
  504. }
  505. List<string> dataList = new List<string>();
  506. if (xmlNode != null && xmlNode.Attributes.Count == 12)
  507. {
  508. dataList.Add(xmlNode.Attributes[0].Value);
  509. dataList.Add(xmlNode.Attributes[1].Value);
  510. dataList.Add(xmlNode.Attributes[2].Value);
  511. dataList.Add(xmlNode.Attributes[3].Value);
  512. dataList.Add(xmlNode.Attributes[4].Value);
  513. dataList.Add(xmlNode.Attributes[5].Value);
  514. dataList.Add(xmlNode.Attributes[6].Value);
  515. dataList.Add(xmlNode.Attributes[7].Value);
  516. dataList.Add(xmlNode.Attributes[8].Value);
  517. dataList.Add(xmlNode.Attributes[9].Value);
  518. dataList.Add(xmlNode.Attributes[10].Value);
  519. dataList.Add(xmlNode.Attributes[11].Value);
  520. //dataList[8] = "长袖9左";
  521. //dataList[9] = "Empty";
  522. //dataList[10] = "长袖9右";
  523. //dataList[11] = "Empty";
  524. }
  525. else if(xmlNode != null && xmlNode.Attributes.Count == 8)
  526. {
  527. dataList.Add(xmlNode.Attributes[0].Value);
  528. dataList.Add(xmlNode.Attributes[1].Value);
  529. dataList.Add(xmlNode.Attributes[2].Value);
  530. dataList.Add(xmlNode.Attributes[3].Value);
  531. dataList.Add(xmlNode.Attributes[4].Value);
  532. dataList.Add(xmlNode.Attributes[5].Value);
  533. dataList.Add(xmlNode.Attributes[6].Value);
  534. dataList.Add(xmlNode.Attributes[7].Value);
  535. dataList.AddRange (GetSleeveListByTop(xmlNode.Attributes[4].Value));
  536. }
  537. else
  538. {
  539. float rate = Random.Range(0f, 1f);
  540. if (rate < 0.33f)
  541. {
  542. dataList.Add("脑壳1");
  543. dataList.Add("裙子1");
  544. dataList.Add("鞋子1");
  545. dataList.Add("头饰品1");
  546. dataList.Add("上衣1");
  547. dataList.Add("眼睛1");
  548. dataList.Add("嘴巴1");
  549. dataList.Add("Empty");
  550. dataList.Add("Empty");
  551. dataList.Add("短袖1左");
  552. dataList.Add("Empty");
  553. dataList.Add("短袖1右");
  554. }
  555. else if (rate < 0.66f)
  556. {
  557. dataList.Add("脑壳2");
  558. dataList.Add("裙子2");
  559. dataList.Add("鞋子2");
  560. dataList.Add("头饰品2");
  561. dataList.Add("上衣2");
  562. dataList.Add("眼睛2");
  563. dataList.Add("嘴巴2");
  564. dataList.Add("Empty");
  565. dataList.Add("Empty");
  566. dataList.Add("短袖2左");
  567. dataList.Add("Empty");
  568. dataList.Add("短袖2右");
  569. }
  570. else
  571. {
  572. dataList.Add("脑壳3");
  573. dataList.Add("裙子3");
  574. dataList.Add("鞋子3");
  575. dataList.Add("头饰品3");
  576. dataList.Add("上衣3");
  577. dataList.Add("眼睛3");
  578. dataList.Add("嘴巴3");
  579. dataList.Add("Empty");
  580. dataList.Add("Empty");
  581. dataList.Add("短袖2左");
  582. dataList.Add("Empty");
  583. dataList.Add("短袖2右");
  584. }
  585. }
  586. return dataList;
  587. }
  588. public static List<int> GetFlowerList()
  589. {
  590. List<int> list = new List<int>();
  591. XmlAttributeCollection attribute = PlayerNode.SelectSingleNode("FlowerList").Attributes;
  592. return Auxiliary.IntListParse(' ', attribute[0].Value, list);
  593. }
  594. public static List<int> GetAchieveList()
  595. {
  596. return Auxiliary.IntListParse(' ', GetPlayerString("AchieveList"), new List<int>());
  597. }
  598. public static List<string> GetOfflineConfig()
  599. {
  600. TextAsset textAsset = ManaReso.Load<TextAsset>("offline_config", Folder.Config);
  601. XmlDocument xmlDoc = new XmlDocument();
  602. xmlDoc.LoadXml(textAsset.text);
  603. XmlNode xmlNode = xmlDoc.SelectSingleNode("data").SelectSingleNode("item");
  604. List<string> strList = new List<string>()
  605. {
  606. xmlNode.Attributes[1].Value,
  607. xmlNode.Attributes[2].Value,
  608. xmlNode.Attributes[3].Value,
  609. };
  610. return strList;
  611. }
  612. public static List<double> GetAchieveData()
  613. {
  614. List<double> dataList = new List<double>();
  615. dataList.Add(double.Parse(PlayerNode.SelectSingleNode("AchieveData").Attributes[0].Value));
  616. dataList.Add(double.Parse(PlayerNode.SelectSingleNode("AchieveData").Attributes[1].Value));
  617. dataList.Add(double.Parse(PlayerNode.SelectSingleNode("AchieveData").Attributes[2].Value));
  618. dataList.Add(double.Parse(PlayerNode.SelectSingleNode("AchieveData").Attributes[3].Value));
  619. dataList.Add(double.Parse(PlayerNode.SelectSingleNode("AchieveData").Attributes[4].Value));
  620. dataList.Add(double.Parse(PlayerNode.SelectSingleNode("AchieveData").Attributes[5].Value));
  621. dataList.Add(double.Parse(PlayerNode.SelectSingleNode("AchieveData").Attributes[6].Value));
  622. dataList.Add(double.Parse(PlayerNode.SelectSingleNode("AchieveData").Attributes[7].Value));
  623. dataList.Add(double.Parse(PlayerNode.SelectSingleNode("AchieveData").Attributes[8].Value));
  624. return dataList;
  625. }
  626. public static List<KV<int, int>> GetPlantList(XmlNode node = null)
  627. {
  628. List<KV<int, int>> list = new List<KV<int, int>>();
  629. XmlNode xmlNode;
  630. if (node == null)
  631. {
  632. xmlNode = PlayerNode.SelectSingleNode("PlantList");
  633. }
  634. else
  635. {
  636. xmlNode = node.SelectSingleNode("PlantList");
  637. }
  638. if (!string.IsNullOrEmpty(xmlNode.Attributes[0].Value))
  639. {
  640. string[] strings = xmlNode.Attributes[0].Value.Split(' ');
  641. for (int i = 0; i < strings.Length; i++)
  642. {
  643. list.Add(new KV<int, int>(int.Parse(strings[i].Split(',')[0]), int.Parse(strings[i].Split(',')[1])));
  644. }
  645. }
  646. return list;
  647. }
  648. public static List<XmlAttributeCollection> GetSkillList(XmlNode node = null)
  649. {
  650. List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
  651. XmlNodeList xmlNodeList;
  652. if (node == null)
  653. {
  654. xmlNodeList = PlayerNode.SelectSingleNode("SkillList").ChildNodes;
  655. }
  656. else
  657. {
  658. xmlNodeList = node.SelectSingleNode("SkillList").ChildNodes;
  659. }
  660. for (int i = 0; i < xmlNodeList.Count; i++)
  661. {
  662. attributeList.Add(xmlNodeList[i].Attributes);
  663. }
  664. return attributeList;
  665. }
  666. public static XmlAttributeCollection GetVisitConfig()
  667. {
  668. TextAsset textAsset = ManaReso.Load<TextAsset>("visit_config", Folder.Config);
  669. XmlDocument xmlDoc = new XmlDocument();
  670. xmlDoc.LoadXml(textAsset.text);
  671. XmlNode xmlNode = xmlDoc.SelectSingleNode("data").SelectSingleNode("item");
  672. return xmlNode.Attributes;
  673. }
  674. public static XmlAttributeCollection GetAwardConfig()
  675. {
  676. TextAsset textAsset = ManaReso.Load<TextAsset>("award_config", Folder.Config);
  677. XmlDocument xmlDoc = new XmlDocument();
  678. xmlDoc.LoadXml(textAsset.text);
  679. XmlNode xmlNode = xmlDoc.SelectSingleNode("data").SelectSingleNode("item");
  680. return xmlNode.Attributes;
  681. }
  682. public static List<XmlAttributeCollection> GetIAPConfig()
  683. {
  684. TextAsset textAsset;
  685. XmlNodeList xmlNodeList;
  686. XmlDocument xmlDoc = new XmlDocument();
  687. List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
  688. textAsset = ManaReso.Load<TextAsset>("iap_config", Folder.Config);
  689. xmlDoc.LoadXml(textAsset.text);
  690. xmlNodeList = xmlDoc.SelectSingleNode("data").SelectNodes("item");
  691. for (int i = 0; i < xmlNodeList.Count; i++)
  692. {
  693. attributeList.Add(xmlNodeList[i].Attributes);
  694. }
  695. return attributeList;
  696. }
  697. public static List<XmlAttributeCollection> GetSkillConfig()
  698. {
  699. TextAsset textAsset;
  700. XmlDocument xmlDoc = new XmlDocument();
  701. List<XmlNodeList> xmlNodeList = new List<XmlNodeList>();
  702. List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
  703. textAsset = ManaReso.Load<TextAsset>("pack_config", Folder.Config);
  704. xmlDoc.LoadXml(textAsset.text);
  705. xmlNodeList.Add(xmlDoc.SelectSingleNode("data").SelectNodes("item"));
  706. textAsset = ManaReso.Load<TextAsset>("skill_config", Folder.Config);
  707. xmlDoc.LoadXml(textAsset.text);
  708. xmlNodeList.Add(xmlDoc.SelectSingleNode("data").SelectNodes("item"));
  709. textAsset = ManaReso.Load<TextAsset>("ability_config", Folder.Config);
  710. xmlDoc.LoadXml(textAsset.text);
  711. xmlNodeList.Add(xmlDoc.SelectSingleNode("data").SelectNodes("item"));
  712. for (int i = 0; i < xmlNodeList.Count; i++)
  713. {
  714. for (int j = 0; j < xmlNodeList[i].Count; j++)
  715. {
  716. attributeList.Add(xmlNodeList[i][j].Attributes);
  717. }
  718. }
  719. return attributeList;
  720. }
  721. public static List<XmlAttributeCollection> GetSignConfig()
  722. {
  723. TextAsset textAsset;
  724. XmlNodeList xmlNodeList;
  725. XmlDocument xmlDoc = new XmlDocument();
  726. List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
  727. textAsset = ManaReso.Load<TextAsset>("signin_config", Folder.Config);
  728. xmlDoc.LoadXml(textAsset.text);
  729. xmlNodeList = xmlDoc.SelectSingleNode("data").SelectNodes("item");
  730. for (int i = 0; i < xmlNodeList.Count; i++)
  731. {
  732. attributeList.Add(xmlNodeList[i].Attributes);
  733. }
  734. return attributeList;
  735. }
  736. public static List<XmlAttributeCollection> GetFlowerConfig()
  737. {
  738. TextAsset textAsset;
  739. XmlNodeList xmlNodeList;
  740. XmlDocument xmlDoc = new XmlDocument();
  741. List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
  742. textAsset = ManaReso.Load<TextAsset>("flower_config", Folder.Config);
  743. xmlDoc.LoadXml(textAsset.text);
  744. xmlNodeList = xmlDoc.SelectSingleNode("data").SelectNodes("item");
  745. for (int i = 0; i < xmlNodeList.Count; i++)
  746. {
  747. attributeList.Add(xmlNodeList[i].Attributes);
  748. }
  749. return attributeList;
  750. }
  751. public static List<XmlAttributeCollection> GetLotteryConfig()
  752. {
  753. TextAsset textAsset;
  754. XmlNodeList xmlNodeList;
  755. XmlDocument xmlDoc = new XmlDocument();
  756. List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
  757. textAsset = ManaReso.Load<TextAsset>("lottery_config", Folder.Config);
  758. xmlDoc.LoadXml(textAsset.text);
  759. xmlNodeList = xmlDoc.SelectSingleNode("data").SelectNodes("item");
  760. for (int i = 0; i < xmlNodeList.Count; i++)
  761. {
  762. attributeList.Add(xmlNodeList[i].Attributes);
  763. }
  764. return attributeList;
  765. }
  766. public static List<XmlAttributeCollection> GetAchieveConfig()
  767. {
  768. TextAsset textAsset;
  769. XmlNodeList xmlNodeList;
  770. XmlDocument xmlDoc = new XmlDocument();
  771. List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
  772. textAsset = ManaReso.Load<TextAsset>("achieve_config", Folder.Config);
  773. xmlDoc.LoadXml(textAsset.text);
  774. xmlNodeList = xmlDoc.SelectSingleNode("data").SelectNodes("item");
  775. for (int i = 0; i < xmlNodeList.Count; i++)
  776. {
  777. attributeList.Add(xmlNodeList[i].Attributes);
  778. }
  779. return attributeList;
  780. }
  781. public static List<XmlAttributeCollection> GetDressRoomConfig()
  782. {
  783. TextAsset textAsset;
  784. XmlNodeList xmlNodeList;
  785. XmlDocument xmlDoc = new XmlDocument();
  786. List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
  787. textAsset = ManaReso.Load<TextAsset>("dressRoom_config", Folder.Config);
  788. xmlDoc.LoadXml(textAsset.text);
  789. xmlNodeList = xmlDoc.SelectSingleNode("data").SelectNodes("item");
  790. for (int i = 0; i < xmlNodeList.Count; i++)
  791. {
  792. attributeList.Add(xmlNodeList[i].Attributes);
  793. }
  794. return attributeList;
  795. }
  796. public static XmlDocument MergeXML(int nativeVersion, XmlDocument nativeDoc, XmlDocument defaultDoc)
  797. {
  798. if (nativeVersion < 0)
  799. {
  800. Debug.LogWarning("UpdateArchive to 0");
  801. To0(nativeDoc, defaultDoc);
  802. }
  803. if (nativeVersion < 1)
  804. {
  805. Debug.LogWarning("UpdateArchive to 1");
  806. To1(nativeDoc, defaultDoc);
  807. }
  808. if (nativeVersion < 2)
  809. {
  810. Debug.LogWarning("UpdateArchive to 2");
  811. To2(nativeDoc, defaultDoc);
  812. }
  813. if (nativeVersion < 3)
  814. {
  815. Debug.LogWarning("UpdateArchive to 3");
  816. To3(nativeDoc, defaultDoc);
  817. }
  818. if (nativeVersion < 4)
  819. {
  820. Debug.LogWarning("UpdateArchive to 4");
  821. To4(nativeDoc, defaultDoc);
  822. }
  823. if (nativeVersion < 5)
  824. {
  825. Debug.LogWarning("UpdateArchive to 5");
  826. To5(nativeDoc, defaultDoc);
  827. }
  828. return nativeDoc;
  829. }
  830. public static XmlDocument To0(XmlDocument nativeDoc, XmlDocument defaultDoc)
  831. {
  832. nativeDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("Version").Attributes[0].Value = 0.ToString();
  833. XmlNode xmlNode1 = defaultDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("ADPlayTime");
  834. nativeDoc.SelectSingleNode("PlayerConfig").AppendChild(nativeDoc.ImportNode(xmlNode1, true));
  835. return nativeDoc;
  836. }
  837. public static XmlDocument To1(XmlDocument nativeDoc, XmlDocument defaultDoc)
  838. {
  839. nativeDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("Version").Attributes[0].Value = 1.ToString();
  840. XmlNode xmlNode1 = defaultDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("SerialNumber");
  841. nativeDoc.SelectSingleNode("PlayerConfig").AppendChild(nativeDoc.ImportNode(xmlNode1, true));
  842. return nativeDoc;
  843. }
  844. public static XmlDocument To2(XmlDocument nativeDoc, XmlDocument defaultDoc)
  845. {
  846. nativeDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("Version").Attributes[0].Value = 2.ToString();
  847. XmlNode xmlNode1 = defaultDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("NotificationIndex");
  848. nativeDoc.SelectSingleNode("PlayerConfig").AppendChild(nativeDoc.ImportNode(xmlNode1, true));
  849. return nativeDoc;
  850. }
  851. public static XmlDocument To3(XmlDocument nativeDoc, XmlDocument defaultDoc)
  852. {
  853. nativeDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("Version").Attributes[0].Value = 3.ToString();
  854. XmlNode xmlNode1 = defaultDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("NickName");
  855. nativeDoc.SelectSingleNode("PlayerConfig").AppendChild(nativeDoc.ImportNode(xmlNode1, true));
  856. return nativeDoc;
  857. }
  858. public static XmlDocument To4(XmlDocument nativeDoc, XmlDocument defaultDoc)
  859. {
  860. nativeDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("Version").Attributes[0].Value = 4.ToString();
  861. XmlNode xmlNode = nativeDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("DressData");
  862. XmlAttribute attribute = xmlNode.Attributes.Append (nativeDoc.CreateAttribute ("LeftLongSleeveSlot"));
  863. attribute.Value="Empty";
  864. attribute = xmlNode.Attributes.Append (nativeDoc.CreateAttribute ("LeftShortSleeveSlot"));
  865. attribute.Value="Empty";
  866. attribute = xmlNode.Attributes.Append (nativeDoc.CreateAttribute ("RightLongSleeveSlot"));
  867. attribute.Value="Empty";
  868. attribute = xmlNode.Attributes.Append (nativeDoc.CreateAttribute ("RightShortSleeveSlot"));
  869. attribute.Value="Empty";
  870. List<string> sleeveList = GetSleeveListByTop (xmlNode.Attributes [4].Value);
  871. xmlNode.Attributes [8].Value = sleeveList[0];
  872. xmlNode.Attributes [9].Value = sleeveList[1];
  873. xmlNode.Attributes [10].Value = sleeveList[2];
  874. xmlNode.Attributes [11].Value = sleeveList[3];
  875. return nativeDoc;
  876. }
  877. public static List<string> GetSleeveListByTop(string topName)
  878. {
  879. List<string> sleeveList = new List<string>() {"Empty", "Empty", "Empty", "Empty"};
  880. if (topName == "上衣1")
  881. {
  882. sleeveList[1] = "短袖1左";
  883. sleeveList[3] = "短袖1右";
  884. }
  885. else if (topName == "上衣2")
  886. {
  887. sleeveList[1] = "短袖2左";
  888. sleeveList[3] = "短袖2右";
  889. }
  890. else if (topName == "上衣3")
  891. {
  892. sleeveList[1] = "短袖2左";
  893. sleeveList[3] = "短袖2右";
  894. }
  895. else if (topName == "上衣5")
  896. {
  897. sleeveList[1] = "短袖2左";
  898. sleeveList[3] = "短袖2右";
  899. }
  900. else if (topName == "上衣6")
  901. {
  902. sleeveList[1] = "短袖6左";
  903. sleeveList[3] = "短袖6右";
  904. }
  905. else if (topName == "上衣7")
  906. {
  907. sleeveList[1] = "短袖7左";
  908. sleeveList[3] = "短袖7右";
  909. }
  910. else if (topName == "上衣7(粉)")
  911. {
  912. sleeveList[1] = "短袖7粉左";
  913. sleeveList[3] = "短袖7粉右";
  914. }
  915. else if (topName == "上衣12")
  916. {
  917. sleeveList[1] = "短袖12左";
  918. sleeveList[3] = "短袖12右";
  919. }
  920. else if (topName == "上衣13")
  921. {
  922. sleeveList[1] = "短袖13左";
  923. sleeveList[3] = "短袖13右";
  924. }
  925. else if (topName == "上衣13(紫)")
  926. {
  927. sleeveList[1] = "短袖13蓝左";
  928. sleeveList[3] = "短袖13蓝右";
  929. }
  930. else
  931. {
  932. sleeveList[0] = "长袖9左";
  933. sleeveList[2] = "长袖9右";
  934. }
  935. return sleeveList;
  936. }
  937. public static XmlDocument To5(XmlDocument nativeDoc, XmlDocument defaultDoc)
  938. {
  939. nativeDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("Version").Attributes[0].Value = 5.ToString();
  940. return nativeDoc;
  941. }
  942. }