ConfigManager.cs 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577
  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 ConfigManager : Regist
  15. {
  16. #region Config
  17. public static XmlNode ConfigRootNode
  18. {
  19. get
  20. {
  21. if (configRootNode == null)
  22. {
  23. configRootNode = ConfigDocument.SelectSingleNode(PlayerConfigLabel.RootNode);
  24. }
  25. return configRootNode;
  26. }
  27. set { configRootNode = value; }
  28. }
  29. public static XmlNode configRootNode;
  30. public static XmlDocument ConfigDocument
  31. {
  32. get
  33. {
  34. if (configDocument == null)
  35. {
  36. LoadConfigDocument();
  37. }
  38. return configDocument;
  39. }
  40. set { configDocument = value; }
  41. }
  42. public static XmlDocument configDocument;
  43. public static float UrlTimer;
  44. public static bool PlayerDocumentDamageFlag;
  45. public static bool IDRequestFlag;
  46. public static bool SerialNumberRequestFlag = true;
  47. public static XmlDocument DefaultConfigDocument = new XmlDocument();
  48. public static int ConfigReplayVersion = -1000;
  49. public static string ConfigPath
  50. {
  51. get
  52. {
  53. if (string.IsNullOrEmpty(configPath))
  54. {
  55. configPath = $"{Application.persistentDataPath}/{ResourceLabel.PlayerConfigXml}";
  56. }
  57. return configPath;
  58. }
  59. }
  60. public static string configPath;
  61. #endregion
  62. private static string UnvalidConfigMD5 = "";
  63. private static void LoadConfigDocument()
  64. {
  65. int defaultVersion;
  66. int nativeVersion;
  67. XmlNode node;
  68. XmlDocument nativeDoc = new XmlDocument();
  69. if (File.Exists(ConfigPath))
  70. {
  71. try
  72. {
  73. StreamReader sr = new StreamReader(ConfigPath);
  74. nativeDoc.LoadXml(sr.ReadToEnd());
  75. sr.Close();
  76. Auxiliary.DecryptXml(nativeDoc);
  77. }
  78. catch (Exception)
  79. {
  80. Debug.LogWarning("Download Archive : MD5 doesn't match");
  81. //ManaDebug.Log("Download Archive");
  82. PlayerDocumentDamageFlag = true;
  83. SerialNumberRequestFlag = false;
  84. return;
  85. }
  86. TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.PlayerConfig, Folder.Config);
  87. DefaultConfigDocument.LoadXml(textAsset.text);
  88. defaultVersion = int.Parse(DefaultConfigDocument.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value);
  89. node = nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version);
  90. if (node == null)
  91. {
  92. StreamWriter sw = new StreamWriter(ConfigPath);
  93. sw.Write(DefaultConfigDocument.OuterXml);
  94. sw.Close();
  95. configDocument = DefaultConfigDocument;
  96. }
  97. else
  98. {
  99. nativeVersion = int.Parse(node.Attributes[0].Value);
  100. if (nativeVersion == ConfigReplayVersion)
  101. {
  102. configDocument = DefaultConfigDocument;
  103. int currentReplayVersion = int.Parse(nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.ReplayVersion).Attributes[0].Value);
  104. SaveIntToConfig(PlayerConfigLabel.ReplayVersion, currentReplayVersion + 1);
  105. //Debug.Log(currentReplayVersion);
  106. }
  107. else if (nativeVersion < defaultVersion)
  108. {
  109. byte[] bytes;
  110. MD5 md5 = new MD5CryptoServiceProvider();
  111. if (nativeVersion <= 4)
  112. {
  113. bytes = Encoding.UTF8.GetBytes(nativeDoc.OuterXml);
  114. }
  115. else
  116. {
  117. bytes = File.ReadAllBytes(ConfigPath);
  118. }
  119. if (PlayerPrefs.GetString(Lib.ConfigPrefs) != UnvalidConfigMD5 && PlayerPrefs.GetString(Lib.ConfigPrefs) != Auxiliary.ToString(md5.ComputeHash(bytes)))
  120. {
  121. Debug.LogWarning("Download Archive : MD5 doesn't match");
  122. //ManaDebug.Log("Download Archive");
  123. PlayerDocumentDamageFlag = true;
  124. SerialNumberRequestFlag = false;
  125. return;
  126. }
  127. else
  128. {
  129. configDocument = UpdateConfigDocument(nativeVersion, nativeDoc, DefaultConfigDocument);
  130. HttpManager.UploadConfig();
  131. }
  132. }
  133. else if (nativeVersion > defaultVersion)
  134. {
  135. configDocument = DefaultConfigDocument;
  136. }
  137. else
  138. {
  139. byte[] bytes = File.ReadAllBytes(ConfigPath);
  140. MD5 md5 = new MD5CryptoServiceProvider();
  141. if (PlayerPrefs.GetString(Lib.ConfigPrefs) != UnvalidConfigMD5 && PlayerPrefs.GetString(Lib.ConfigPrefs) != Auxiliary.ToString(md5.ComputeHash(bytes)))
  142. {
  143. Debug.LogWarning("Download Archive : MD5 doesn't match");
  144. //ManaDebug.Log("Download Archive");
  145. PlayerDocumentDamageFlag = true;
  146. SerialNumberRequestFlag = false;
  147. return;
  148. }
  149. configDocument = nativeDoc;
  150. }
  151. }
  152. }
  153. else
  154. {
  155. TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.PlayerConfig, Folder.Config);
  156. DefaultConfigDocument.LoadXml(textAsset.text);
  157. Debug.LogWarning("Download Archive");
  158. //ManaDebug.Log("Download Archive");
  159. PlayerDocumentDamageFlag = true;
  160. SerialNumberRequestFlag = false;
  161. return;
  162. }
  163. }
  164. private float MaxUrlWaitTime = 10;
  165. public void Update()
  166. {
  167. if (PlayerDocumentDamageFlag)
  168. {
  169. UrlTimer += Time.deltaTime;
  170. if (UrlTimer >= MaxUrlWaitTime)
  171. {
  172. PlayerDocumentDamageFlag = false;
  173. TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.PlayerConfig, Folder.Config);
  174. configDocument = new XmlDocument();
  175. configDocument.LoadXml(textAsset.text);
  176. return;
  177. }
  178. }
  179. if (!SerialNumberRequestFlag)
  180. {
  181. if (HttpManager.SerialNumber != PlayerConfigLabel.DefaultSerialNumber)
  182. {
  183. SerialNumberRequestFlag = true;
  184. HttpManager.GetConfigBySerialNumber(HttpManager.SerialNumber, RecoveConfigDocument);
  185. }
  186. }
  187. }
  188. public override bool InitAtOnce()
  189. {
  190. if (base.InitAtOnce())
  191. {
  192. return true;
  193. }
  194. enabled = true;
  195. return false;
  196. }
  197. public static void RecoveConfigDocument(JsonData jsonData)
  198. {
  199. if (!PlayerDocumentDamageFlag)
  200. {
  201. return;
  202. }
  203. TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.PlayerConfig, Folder.Config);
  204. DefaultConfigDocument.LoadXml(textAsset.text);
  205. //Debug.Log(jsonData.ToJson());
  206. if (jsonData.Inst_Object.Keys.Contains("l"))
  207. {
  208. configDocument = new XmlDocument();
  209. configDocument.LoadXml(jsonData["l"].ToString());
  210. int nativeVersion = int.Parse(configDocument.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value);
  211. int defaultVersion = int.Parse(DefaultConfigDocument.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value);
  212. if (nativeVersion < defaultVersion)
  213. {
  214. UpdateConfigDocument(nativeVersion, configDocument, DefaultConfigDocument);
  215. HttpManager.UploadConfig();
  216. }
  217. else if (nativeVersion > defaultVersion)
  218. {
  219. configDocument = DefaultConfigDocument;
  220. }
  221. PlayerDocumentDamageFlag = false;
  222. }
  223. else
  224. {
  225. if (!IDRequestFlag)
  226. {
  227. if (HttpManager.ID != PlayerConfigLabel.DefaultID)
  228. {
  229. IDRequestFlag = true;
  230. Debug.LogWarning("DownloadByID");
  231. HttpManager.GetConfigByID(HttpManager.ID, RecoveConfigDocument);
  232. }
  233. else
  234. {
  235. Debug.LogWarning("Use Default");
  236. configDocument = DefaultConfigDocument;
  237. PlayerDocumentDamageFlag = false;
  238. }
  239. }
  240. else
  241. {
  242. Debug.LogWarning("Use Default");
  243. configDocument = DefaultConfigDocument;
  244. PlayerDocumentDamageFlag = false;
  245. }
  246. }
  247. }
  248. public static void SaveSkillList()
  249. {
  250. if (TutorialManager.NewplayerTutorial || !Manager.Inited)
  251. {
  252. return;
  253. }
  254. XmlNode xmlNode;
  255. XmlAttribute xmlAttribute;
  256. xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SkillList);
  257. xmlNode.RemoveAll();
  258. for (int i = 0; i < Manager.SkillList.Count; i++)
  259. {
  260. if (Manager.SkillList[i].SkillType == SkillType.Skill)
  261. {
  262. #region Skill
  263. Skill skill = (Skill)Manager.SkillList[i];
  264. xmlNode = xmlNode.AppendChild(ConfigDocument.CreateNode(XmlNodeType.Element, PlayerConfigLabel.Skill, ""));
  265. xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ID));
  266. xmlAttribute.Value = skill.FullID;
  267. xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.SkillType));
  268. xmlAttribute.Value = skill.SkillType.ToString();
  269. xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ItemStatus));
  270. xmlAttribute.Value = skill.ItemStatus.ToString();
  271. xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.Level));
  272. xmlAttribute.Value = skill.Level.ToString();
  273. xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.CoolTimer));
  274. xmlAttribute.Value = skill.CoolTimer.ToString("0");
  275. xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.UseTimer));
  276. xmlAttribute.Value = skill.UseTimer.ToString("0");
  277. xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SkillList);
  278. #endregion
  279. }
  280. else if (Manager.SkillList[i].SkillType == SkillType.Pack)
  281. {
  282. #region Pack
  283. Pack pack = (Pack)Manager.SkillList[i];
  284. xmlNode = xmlNode.AppendChild(ConfigDocument.CreateNode(XmlNodeType.Element, PlayerConfigLabel.Skill, ""));
  285. xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ID));
  286. xmlAttribute.Value = pack.FullID;
  287. xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.SkillType));
  288. xmlAttribute.Value = pack.SkillType.ToString();
  289. xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ItemStatus));
  290. xmlAttribute.Value = pack.ItemStatus.ToString();
  291. xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.Level));
  292. xmlAttribute.Value = pack.Level.ToString();
  293. xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SkillList);
  294. #endregion
  295. }
  296. else if (Manager.SkillList[i].SkillType == SkillType.Ability)
  297. {
  298. #region Ability
  299. Ability ability = (Ability)Manager.SkillList[i];
  300. xmlNode = xmlNode.AppendChild(ConfigDocument.CreateNode(XmlNodeType.Element, PlayerConfigLabel.Skill, ""));
  301. xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ID));
  302. xmlAttribute.Value = ability.FullID;
  303. xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.SkillType));
  304. xmlAttribute.Value = ability.SkillType.ToString();
  305. xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ItemStatus));
  306. xmlAttribute.Value = ability.ItemStatus.ToString();
  307. xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.Level));
  308. xmlAttribute.Value = ability.Level.ToString();
  309. xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SkillList);
  310. #endregion
  311. }
  312. else if (Manager.SkillList[i].SkillType == SkillType.BigSkill)
  313. {
  314. #region BigSkill
  315. BigSkill bigSkill = (BigSkill)Manager.SkillList[i];
  316. xmlNode = xmlNode.AppendChild(ConfigDocument.CreateNode(XmlNodeType.Element, PlayerConfigLabel.Skill, ""));
  317. xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ID));
  318. xmlAttribute.Value = bigSkill.FullID;
  319. xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.SkillType));
  320. xmlAttribute.Value = bigSkill.SkillType.ToString();
  321. xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.ItemStatus));
  322. xmlAttribute.Value = bigSkill.ItemStatus.ToString();
  323. xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.BarStatus));
  324. xmlAttribute.Value = bigSkill.BarStatus.ToString();
  325. xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.Level));
  326. xmlAttribute.Value = bigSkill.Level.ToString();
  327. xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.CoolTimer));
  328. xmlAttribute.Value = bigSkill.CoolTimer.ToString("0");
  329. xmlAttribute = xmlNode.Attributes.Append(ConfigDocument.CreateAttribute(PlayerConfigLabel.UseTimer));
  330. xmlAttribute.Value = bigSkill.UseTimer.ToString("0");
  331. xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SkillList);
  332. #endregion
  333. }
  334. }
  335. }
  336. public static void SaveDress()
  337. {
  338. XmlNode xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.DressList);
  339. xmlNode.Attributes[0].Value = "";
  340. for (int i = 0; i < PlayerManager.BoughtCloseIDs.Count; i++)
  341. {
  342. xmlNode.Attributes[0].Value += PlayerManager.BoughtCloseIDs[i] + " ";
  343. }
  344. xmlNode.Attributes[0].Value = xmlNode.Attributes[0].Value.TrimEnd(' ');
  345. xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.DressData);
  346. for (int i = 0; i < PlayerManager.DressDatas.Count; i++)
  347. {
  348. xmlNode.Attributes[i].Value = PlayerManager.DressDatas[i];
  349. }
  350. }
  351. public static void SaveAchieve()
  352. {
  353. XmlNode xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveList);
  354. xmlNode.Attributes[0].Value = "";
  355. foreach (var kv in AchieveManager.AchieveItemDictionary)
  356. {
  357. if (!kv.Value.Lock)
  358. {
  359. xmlNode.Attributes[0].Value += kv.Value.ID + " ";
  360. }
  361. }
  362. xmlNode.Attributes[0].Value = xmlNode.Attributes[0].Value.TrimEnd(' ');
  363. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[0].Value = Manager.PlayADsAmt.ToString("0");
  364. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[1].Value = Manager.UseSkillAmt.ToString("0");
  365. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[2].Value = Manager.SignAmt.ToString("0");
  366. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[3].Value = Manager.ShareAmt.ToString("0");
  367. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[4].Value = Manager.AllElfLevel.ToString("0");
  368. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[5].Value = Manager.PlayMinigameAmt.ToString("0");
  369. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[6].Value = Manager.TotalFlowerAwardCoin.ToString("0");
  370. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[7].Value = Manager.TotalVisitPerson.ToString("0");
  371. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[8].Value = Manager.TotalSpendDiamond.ToString("0");
  372. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[9].Value = Manager.CreateRoomAmt.ToString("0");
  373. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[10].Value = Manager.CreateChestAmt.ToString("0");
  374. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[11].Value = Manager.CreateLuckyChestAmt.ToString("0");
  375. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[12].Value = Manager.CreateGuessColorChestAmt.ToString("0");
  376. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[13].Value = Manager.CreateGuessNumberChestAmt.ToString("0");
  377. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[14].Value = Manager.GetChestAwardAmt.ToString("0");
  378. }
  379. public static void SavePlantList()
  380. {
  381. if (VisitManager.InVisit || TutorialManager.NewplayerTutorial)
  382. {
  383. return;
  384. }
  385. XmlAttributeCollection attribute = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.PlantList).Attributes;
  386. attribute[0].Value = "";
  387. for (int i = 0; i < GardenManager.PlantSlotList.Count; i++)
  388. {
  389. Slot slot = GardenManager.PlantSlotList[i];
  390. attribute[0].Value += slot.ID + "," + slot.Index + " ";
  391. }
  392. attribute[0].Value = attribute[0].Value.TrimEnd(' ');
  393. }
  394. public static void SaveDatas()
  395. {
  396. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.Coin).Attributes[0].Value = Manager.Coin.ToString("0");
  397. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.Diamond).Attributes[0].Value = Manager.Diamond.ToString("0");
  398. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SignTime).Attributes[0].Value = SignManager.LastSignTime.ToString();
  399. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SignIndex).Attributes[0].Value = SignManager.SignIndex.ToString();
  400. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SignRound).Attributes[0].Value = SignManager.SignRound.ToString();
  401. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.QuitFlag).Attributes[0].Value = HttpManager.IsConnect.ToInt().ToString();
  402. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.QuitTime).Attributes[0].Value = HttpManager.CurrentDateTime.ToString();
  403. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.MiniTimer).Attributes[0].Value = Manager.MinigameCDTimer.ToString("0");
  404. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.CircleTimer).Attributes[0].Value = Manager.IncomeCircleTimer.ToString("0");
  405. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.ID).Attributes[0].Value = HttpManager.ID;
  406. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SerialNumber).Attributes[0].Value = HttpManager.SerialNumber;
  407. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.Language).Attributes[0].Value = LanguageManager.CurrentLanguage.ToString();
  408. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.MiniGameIndex).Attributes[0].Value = MiniGameManager.MiniGameIndex.ToString();
  409. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.NewplayerTutorial).Attributes[0].Value = TutorialManager.NewplayerTutorial.ToInt().ToString();
  410. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.MemoryMinigameTutorial).Attributes[0].Value = TutorialManager.memoryMinigameTutorial.ToInt().ToString();
  411. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.VisitTutorial).Attributes[0].Value = TutorialManager.visitTutorial.ToInt().ToString();
  412. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.DressroomTutorial).Attributes[0].Value = TutorialManager.dressroomTutorial.ToInt().ToString();
  413. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FindMinigameTutorial).Attributes[0].Value = TutorialManager.findMinigameTutorial.ToInt().ToString();
  414. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.TutorialPlazaRoom).Attributes[0].Value = TutorialManager.plazaRoomTutorial.ToInt().ToString();
  415. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.NewplayerTutorialIndex).Attributes[0].Value = TutorialManager.NewplayerTutorialIndex.ToString();
  416. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.MemoryMinigameTutorialIndex).Attributes[0].Value = TutorialManager.MemoryMinigameTutorialIndex.ToString();
  417. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.VisitTutorialIndex).Attributes[0].Value = TutorialManager.VisitTutorialIndex.ToString();
  418. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.DressroomIndex).Attributes[0].Value = TutorialManager.DressroomTutorialIndex.ToString();
  419. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FindMinigameTutorialIndex).Attributes[0].Value = TutorialManager.FindMinigameTutorialIndex.ToString();
  420. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.TutorialIndexPlazaRoom).Attributes[0].Value = TutorialManager.PlazaRoomTutorialIndex.ToString();
  421. }
  422. public static void SaveFlowers()
  423. {
  424. XmlAttribute attribute = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FlowerList).Attributes[0];
  425. XmlAttribute attribute1 = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FlowerAmtList).Attributes[0];
  426. attribute.Value = "";
  427. attribute1.Value = "";
  428. foreach (var kv in GardenManager.FlowerInfoDictionary)
  429. {
  430. if (kv.Value.Unlock)
  431. {
  432. attribute.Value += kv.Value.ID + " ";
  433. attribute1.Value += kv.Value.Amount + " ";
  434. }
  435. }
  436. attribute.Value = attribute.Value.Trim(' ');
  437. attribute1.Value = attribute1.Value.Trim(' ');
  438. }
  439. public static void SaveConfigDocument()
  440. {
  441. if (Initializer.Inited)
  442. {
  443. SaveSkillList();
  444. SaveAchieve();
  445. SaveDress();
  446. SavePlantList();
  447. SaveDatas();
  448. SaveFlowers();
  449. ChestManager.SaveToConfig();
  450. }
  451. }
  452. public static void SaveConfigDocumentToDisk()
  453. {
  454. if (Initializer.Inited)
  455. {
  456. XmlDocument doc = new XmlDocument();
  457. doc.LoadXml(ConfigDocument.OuterXml);
  458. Auxiliary.EncryptXml(doc);
  459. StreamWriter sw = new StreamWriter(ConfigPath);
  460. sw.Write(doc.OuterXml);
  461. sw.Close();
  462. byte[] bytes = File.ReadAllBytes(ConfigPath);
  463. //byte[] bytes = Encoding.UTF8.GetBytes(PlayerDoc.OuterXml);
  464. MD5 md5 = new MD5CryptoServiceProvider();
  465. PlayerPrefs.SetString(Lib.ConfigPrefs, Auxiliary.ToString(md5.ComputeHash(bytes)));
  466. }
  467. }
  468. public static void ResetConfigDocument()
  469. {
  470. ConfigRootNode.SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = ConfigReplayVersion.ToString();
  471. SaveConfigDocument();
  472. Manager.UploadConfigFlag = true;
  473. SaveConfigDocumentToDisk();
  474. Application.Quit();
  475. }
  476. public static int GetIntFormConfig(string node)
  477. {
  478. return int.Parse(ConfigRootNode.SelectSingleNode(node).Attributes[0].Value);
  479. }
  480. public static bool GetBoolFormConfig(string node)
  481. {
  482. return int.Parse(ConfigRootNode.SelectSingleNode(node).Attributes[0].Value).ToBool();
  483. }
  484. public static float GetFloatFormConfig(string node)
  485. {
  486. return float.Parse(ConfigRootNode.SelectSingleNode(node).Attributes[0].Value);
  487. }
  488. public static string GetStringFormConfig(string node)
  489. {
  490. return ConfigRootNode.SelectSingleNode(node).Attributes[0].Value;
  491. }
  492. public static double GetDoubleFormConfig(string node)
  493. {
  494. return double.Parse(ConfigRootNode.SelectSingleNode(node).Attributes[0].Value);
  495. }
  496. public static void SaveIntToConfig(string node, int value)
  497. {
  498. ConfigRootNode.SelectSingleNode(node).Attributes[0].Value = value.ToString();
  499. }
  500. public static void SaveBoolToConfig(string node, bool value)
  501. {
  502. ConfigRootNode.SelectSingleNode(node).Attributes[0].Value = value.ToInt().ToString();
  503. }
  504. public static void SaveFloatToConfig(string node, float value)
  505. {
  506. ConfigRootNode.SelectSingleNode(node).Attributes[0].Value = value.ToString();
  507. }
  508. public static void SaveStringToConfig(string node, string value)
  509. {
  510. ConfigRootNode.SelectSingleNode(node).Attributes[0].Value = value;
  511. }
  512. public static void SaveDoubleToConfig(string node, double value)
  513. {
  514. ConfigRootNode.SelectSingleNode(node).Attributes[0].Value = value.ToString();
  515. }
  516. public static List<int> GetIntList(char splitChar, string nodeName, List<int> defaultList)
  517. {
  518. return Auxiliary.StringToInts(splitChar, ConfigRootNode.SelectSingleNode(nodeName).Attributes[0].Value, defaultList);
  519. }
  520. public static List<string> GetStringList(char splitChar, string nodeName, List<string> defaultList)
  521. {
  522. return Auxiliary.StringToStrings(splitChar, ConfigRootNode.SelectSingleNode(nodeName).Attributes[0].Value, defaultList);
  523. }
  524. public static List<int> GetDressList()
  525. {
  526. List<int> list = new List<int>();
  527. XmlAttributeCollection attribute = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.DressList).Attributes;
  528. return Auxiliary.StringToInts(' ', attribute[0].Value, list);
  529. }
  530. public static List<int> GetDressDataIDs(Player player)
  531. {
  532. //foreach (var VARIABLE in ManaPlayer.CloseIDDic)
  533. //{
  534. // Debug.LogWarning(VARIABLE.Key);
  535. //}
  536. List<int> dressDataIDs = new List<int>();
  537. dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.Head]);
  538. dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.Dress]);
  539. dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.Shoe]);
  540. dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.HeadWear]);
  541. dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.Top]);
  542. dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.Eye]);
  543. dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.Mouse]);
  544. dressDataIDs.Add(PlayerManager.CloseIDDictionary[player.Wing]);
  545. return dressDataIDs;
  546. }
  547. public static List<int> GetDressDataIDs(List<string> dressdataNames)
  548. {
  549. //foreach (var VARIABLE in ManaPlayer.CloseIDDic)
  550. //{
  551. // Debug.LogWarning(VARIABLE.Key);
  552. //}
  553. List<int> dressDataIDs = new List<int>();
  554. int index = 0;
  555. dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
  556. dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
  557. dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
  558. dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
  559. dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
  560. dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
  561. dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
  562. dressDataIDs.Add(PlayerManager.CloseIDDictionary[dressdataNames[index++]]);
  563. return dressDataIDs;
  564. }
  565. public static List<int> GetDressDataIDs(ISFSObject parameter)
  566. {
  567. List<int> ids = parameter.GetIntArray(InfoLabel.Close.GetHashString()).ToList();
  568. return ids;
  569. }
  570. public static List<string> GetDressData(SFSObject parameter)
  571. {
  572. List<int> ids = GetDressDataIDs(parameter);
  573. List<string> dressData = new List<string>();
  574. foreach (var id in ids)
  575. {
  576. dressData.Add(PlayerManager.CloseItemDictionary[id].ArmatureName);
  577. }
  578. return dressData;
  579. }
  580. public static List<string> GetDressData(XmlNode node = null)
  581. {
  582. XmlNode xmlNode;
  583. if (node == null)
  584. {
  585. xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.DressData);
  586. }
  587. else
  588. {
  589. xmlNode = node.SelectSingleNode(PlayerConfigLabel.DressData);
  590. }
  591. List<string> dataList = new List<string>();
  592. if (xmlNode != null && xmlNode.Attributes.Count == 12)
  593. {
  594. dataList.Add(xmlNode.Attributes[0].Value);
  595. dataList.Add(xmlNode.Attributes[1].Value);
  596. dataList.Add(xmlNode.Attributes[2].Value);
  597. dataList.Add(xmlNode.Attributes[3].Value);
  598. dataList.Add(xmlNode.Attributes[4].Value);
  599. dataList.Add(xmlNode.Attributes[5].Value);
  600. dataList.Add(xmlNode.Attributes[6].Value);
  601. dataList.Add(xmlNode.Attributes[7].Value);
  602. dataList.Add(xmlNode.Attributes[8].Value);
  603. dataList.Add(xmlNode.Attributes[9].Value);
  604. dataList.Add(xmlNode.Attributes[10].Value);
  605. dataList.Add(xmlNode.Attributes[11].Value);
  606. //dataList[8] = "长袖9左";
  607. //dataList[9] = "Empty";
  608. //dataList[10] = "长袖9右";
  609. //dataList[11] = "Empty";
  610. }
  611. else if(xmlNode != null && xmlNode.Attributes.Count == 8)
  612. {
  613. dataList.Add(xmlNode.Attributes[0].Value);
  614. dataList.Add(xmlNode.Attributes[1].Value);
  615. dataList.Add(xmlNode.Attributes[2].Value);
  616. dataList.Add(xmlNode.Attributes[3].Value);
  617. dataList.Add(xmlNode.Attributes[4].Value);
  618. dataList.Add(xmlNode.Attributes[5].Value);
  619. dataList.Add(xmlNode.Attributes[6].Value);
  620. dataList.Add(xmlNode.Attributes[7].Value);
  621. dataList.AddRange (GetSleeveListByTop(xmlNode.Attributes[4].Value));
  622. }
  623. else
  624. {
  625. float rate = Random.Range(0f, 1f);
  626. if (rate < 0.33f)
  627. {
  628. dataList.Add("脑壳1");
  629. dataList.Add("裙子1");
  630. dataList.Add("鞋子1");
  631. dataList.Add("头饰品1");
  632. dataList.Add("上衣1");
  633. dataList.Add("眼睛1");
  634. dataList.Add("嘴巴1");
  635. dataList.Add("Empty");
  636. dataList.Add("Empty");
  637. dataList.Add("短袖1左");
  638. dataList.Add("Empty");
  639. dataList.Add("短袖1右");
  640. }
  641. else if (rate < 0.66f)
  642. {
  643. dataList.Add("脑壳2");
  644. dataList.Add("裙子2");
  645. dataList.Add("鞋子2");
  646. dataList.Add("头饰品2");
  647. dataList.Add("上衣2");
  648. dataList.Add("眼睛2");
  649. dataList.Add("嘴巴2");
  650. dataList.Add("Empty");
  651. dataList.Add("Empty");
  652. dataList.Add("短袖2左");
  653. dataList.Add("Empty");
  654. dataList.Add("短袖2右");
  655. }
  656. else
  657. {
  658. dataList.Add("脑壳3");
  659. dataList.Add("裙子3");
  660. dataList.Add("鞋子3");
  661. dataList.Add("头饰品3");
  662. dataList.Add("上衣3");
  663. dataList.Add("眼睛3");
  664. dataList.Add("嘴巴3");
  665. dataList.Add("Empty");
  666. dataList.Add("Empty");
  667. dataList.Add("短袖2左");
  668. dataList.Add("Empty");
  669. dataList.Add("短袖2右");
  670. }
  671. }
  672. return dataList;
  673. }
  674. public static List<int> GetFlowerList()
  675. {
  676. List<int> list = new List<int>();
  677. XmlAttributeCollection attribute = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.FlowerList).Attributes;
  678. return Auxiliary.StringToInts(' ', attribute[0].Value, list);
  679. }
  680. public static List<int> GetLockAchieveIDs()
  681. {
  682. return Auxiliary.StringToInts(' ', GetStringFormConfig(PlayerConfigLabel.AchieveList), new List<int>());
  683. }
  684. public static List<double> GetAchieveValues()
  685. {
  686. List<double> dataList = new List<double>();
  687. dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[0].Value));
  688. dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[1].Value));
  689. dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[2].Value));
  690. dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[3].Value));
  691. dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[4].Value));
  692. dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[5].Value));
  693. dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[6].Value));
  694. dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[7].Value));
  695. dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[8].Value));
  696. dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[9].Value));
  697. dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[10].Value));
  698. dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[11].Value));
  699. dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[12].Value));
  700. dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[13].Value));
  701. dataList.Add(double.Parse(ConfigRootNode.SelectSingleNode(PlayerConfigLabel.AchieveData).Attributes[14].Value));
  702. return dataList;
  703. }
  704. public static List<KV<int, int>> GetPlantList(XmlNode node = null)
  705. {
  706. List<KV<int, int>> list = new List<KV<int, int>>();
  707. XmlNode xmlNode;
  708. if (node == null)
  709. {
  710. xmlNode = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.PlantList);
  711. }
  712. else
  713. {
  714. xmlNode = node.SelectSingleNode(PlayerConfigLabel.PlantList);
  715. }
  716. if (!string.IsNullOrEmpty(xmlNode.Attributes[0].Value))
  717. {
  718. string[] strings = xmlNode.Attributes[0].Value.Split(' ');
  719. for (int i = 0; i < strings.Length; i++)
  720. {
  721. list.Add(new KV<int, int>(int.Parse(strings[i].Split(',')[0]), int.Parse(strings[i].Split(',')[1])));
  722. }
  723. }
  724. return list;
  725. }
  726. public static List<XmlAttributeCollection> GetSkillList(XmlNode node = null)
  727. {
  728. List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
  729. XmlNodeList xmlNodeList;
  730. if (node == null)
  731. {
  732. xmlNodeList = ConfigRootNode.SelectSingleNode(PlayerConfigLabel.SkillList).ChildNodes;
  733. }
  734. else
  735. {
  736. xmlNodeList = node.SelectSingleNode(PlayerConfigLabel.SkillList).ChildNodes;
  737. }
  738. for (int i = 0; i < xmlNodeList.Count; i++)
  739. {
  740. attributeList.Add(xmlNodeList[i].Attributes);
  741. }
  742. return attributeList;
  743. }
  744. public static List<string> GetOfflineConfig()
  745. {
  746. TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.OfflineConfig, Folder.Config);
  747. XmlDocument xmlDoc = new XmlDocument();
  748. xmlDoc.LoadXml(textAsset.text);
  749. XmlNode xmlNode = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectSingleNode(ConfigLabel.ChildNode);
  750. List<string> strList = new List<string>()
  751. {
  752. xmlNode.Attributes[1].Value,
  753. xmlNode.Attributes[2].Value,
  754. xmlNode.Attributes[3].Value,
  755. };
  756. return strList;
  757. }
  758. public static XmlAttributeCollection GetVisitConfig()
  759. {
  760. TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.VisitConfig, Folder.Config);
  761. XmlDocument xmlDoc = new XmlDocument();
  762. xmlDoc.LoadXml(textAsset.text);
  763. XmlNode xmlNode = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectSingleNode(ConfigLabel.ChildNode);
  764. return xmlNode.Attributes;
  765. }
  766. public static XmlAttributeCollection GetPlazaRoomConfig()
  767. {
  768. TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.PlazaroomConfig, Folder.Config);
  769. XmlDocument xmlDoc = new XmlDocument();
  770. xmlDoc.LoadXml(textAsset.text);
  771. XmlNode xmlNode = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectSingleNode(ConfigLabel.ChildNode);
  772. return xmlNode.Attributes;
  773. }
  774. public static XmlAttributeCollection GetAwardConfig()
  775. {
  776. TextAsset textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.AwardConfig, Folder.Config);
  777. XmlDocument xmlDoc = new XmlDocument();
  778. xmlDoc.LoadXml(textAsset.text);
  779. XmlNode xmlNode = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectSingleNode(ConfigLabel.ChildNode);
  780. return xmlNode.Attributes;
  781. }
  782. public static List<XmlAttributeCollection> GetIAPConfig()
  783. {
  784. TextAsset textAsset;
  785. XmlNodeList xmlNodeList;
  786. XmlDocument xmlDoc = new XmlDocument();
  787. List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
  788. textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.IAPConfig, Folder.Config);
  789. xmlDoc.LoadXml(textAsset.text);
  790. xmlNodeList = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode);
  791. for (int i = 0; i < xmlNodeList.Count; i++)
  792. {
  793. attributeList.Add(xmlNodeList[i].Attributes);
  794. }
  795. return attributeList;
  796. }
  797. public static List<XmlAttributeCollection> GetSkillConfig()
  798. {
  799. TextAsset textAsset;
  800. XmlDocument xmlDoc = new XmlDocument();
  801. List<XmlNodeList> xmlNodeList = new List<XmlNodeList>();
  802. List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
  803. textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.PackConfig, Folder.Config);
  804. xmlDoc.LoadXml(textAsset.text);
  805. xmlNodeList.Add(xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode));
  806. textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.SkillConfig, Folder.Config);
  807. xmlDoc.LoadXml(textAsset.text);
  808. xmlNodeList.Add(xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode));
  809. textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.AbilityConfig, Folder.Config);
  810. xmlDoc.LoadXml(textAsset.text);
  811. xmlNodeList.Add(xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode));
  812. for (int i = 0; i < xmlNodeList.Count; i++)
  813. {
  814. for (int j = 0; j < xmlNodeList[i].Count; j++)
  815. {
  816. attributeList.Add(xmlNodeList[i][j].Attributes);
  817. }
  818. }
  819. return attributeList;
  820. }
  821. public static List<XmlAttributeCollection> GetSignConfig()
  822. {
  823. TextAsset textAsset;
  824. XmlNodeList xmlNodeList;
  825. XmlDocument xmlDoc = new XmlDocument();
  826. List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
  827. textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.SigninConfig, Folder.Config);
  828. xmlDoc.LoadXml(textAsset.text);
  829. xmlNodeList = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode);
  830. for (int i = 0; i < xmlNodeList.Count; i++)
  831. {
  832. attributeList.Add(xmlNodeList[i].Attributes);
  833. }
  834. return attributeList;
  835. }
  836. public static List<XmlAttributeCollection> GetFlowerConfig()
  837. {
  838. TextAsset textAsset;
  839. XmlNodeList xmlNodeList;
  840. XmlDocument xmlDoc = new XmlDocument();
  841. List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
  842. textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.FlowerConfig, Folder.Config);
  843. xmlDoc.LoadXml(textAsset.text);
  844. xmlNodeList = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode);
  845. for (int i = 0; i < xmlNodeList.Count; i++)
  846. {
  847. attributeList.Add(xmlNodeList[i].Attributes);
  848. }
  849. return attributeList;
  850. }
  851. public static List<XmlAttributeCollection> GetLotteryConfig()
  852. {
  853. TextAsset textAsset;
  854. XmlNodeList xmlNodeList;
  855. XmlDocument xmlDoc = new XmlDocument();
  856. List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
  857. textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.LotteryConfig, Folder.Config);
  858. xmlDoc.LoadXml(textAsset.text);
  859. xmlNodeList = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode);
  860. for (int i = 0; i < xmlNodeList.Count; i++)
  861. {
  862. attributeList.Add(xmlNodeList[i].Attributes);
  863. }
  864. return attributeList;
  865. }
  866. public static List<XmlAttributeCollection> GetAchieveConfig()
  867. {
  868. TextAsset textAsset;
  869. XmlNodeList xmlNodeList;
  870. XmlDocument xmlDoc = new XmlDocument();
  871. List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
  872. textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.AchieveConfig, Folder.Config);
  873. xmlDoc.LoadXml(textAsset.text);
  874. xmlNodeList = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode);
  875. for (int i = 0; i < xmlNodeList.Count; i++)
  876. {
  877. attributeList.Add(xmlNodeList[i].Attributes);
  878. }
  879. return attributeList;
  880. }
  881. public static List<XmlAttributeCollection> GetDressRoomConfig()
  882. {
  883. TextAsset textAsset;
  884. XmlNodeList xmlNodeList;
  885. XmlDocument xmlDoc = new XmlDocument();
  886. List<XmlAttributeCollection> attributeList = new List<XmlAttributeCollection>();
  887. textAsset = ResourceManager.Load<TextAsset>(ResourceLabel.DressroomConfig, Folder.Config);
  888. xmlDoc.LoadXml(textAsset.text);
  889. xmlNodeList = xmlDoc.SelectSingleNode(ConfigLabel.RootNode).SelectNodes(ConfigLabel.ChildNode);
  890. for (int i = 0; i < xmlNodeList.Count; i++)
  891. {
  892. attributeList.Add(xmlNodeList[i].Attributes);
  893. }
  894. return attributeList;
  895. }
  896. public static XmlDocument GetXmlDocument(string ConfigName)
  897. {
  898. TextAsset textAsset = ResourceManager.Load<TextAsset>(ConfigName, Folder.Config);
  899. XmlDocument xmlDocument = new XmlDocument();
  900. xmlDocument.LoadXml(textAsset.text);
  901. return xmlDocument;
  902. }
  903. //玩家存档版本大于默认存档版本时需要清空
  904. //玩家存档版本小于默认存档版本时需要更新
  905. //玩家存档版本等于ReplayVersion时需要标记为重玩
  906. public static XmlDocument UpdateConfigDocument(int nativeVersion, XmlDocument nativeDoc, XmlDocument defaultDoc)
  907. {
  908. if (nativeVersion < 0)
  909. {
  910. Debug.LogWarning("UpdateArchive to 0");
  911. ToVersion0(nativeDoc, defaultDoc);
  912. }
  913. if (nativeVersion < 1)
  914. {
  915. Debug.LogWarning("UpdateArchive to 1");
  916. ToVersion1(nativeDoc, defaultDoc);
  917. }
  918. if (nativeVersion < 2)
  919. {
  920. Debug.LogWarning("UpdateArchive to 2");
  921. ToVersion2(nativeDoc, defaultDoc);
  922. }
  923. if (nativeVersion < 3)
  924. {
  925. Debug.LogWarning("UpdateArchive to 3");
  926. ToVersion3(nativeDoc, defaultDoc);
  927. }
  928. if (nativeVersion < 4)
  929. {
  930. Debug.LogWarning("UpdateArchive to 4");
  931. ToVersion4(nativeDoc, defaultDoc);
  932. }
  933. if (nativeVersion < 5)
  934. {
  935. Debug.LogWarning("UpdateArchive to 5");
  936. ToVersion5(nativeDoc, defaultDoc);
  937. }
  938. if (nativeVersion < 6)
  939. {
  940. Debug.LogWarning("UpdateArchive to 6");
  941. ToVersion6(nativeDoc, defaultDoc);
  942. }
  943. if (nativeVersion < 7)
  944. {
  945. Debug.LogWarning("UpdateArchive to 7");
  946. ToVersion7(nativeDoc, defaultDoc);
  947. }
  948. if (nativeVersion < 8)
  949. {
  950. Debug.LogWarning("UpdateArchive to 8");
  951. ToVersion8(nativeDoc, defaultDoc);
  952. }
  953. if (nativeVersion < 9)
  954. {
  955. Debug.LogWarning("UpdateArchive to 9");
  956. ToVersion9(nativeDoc, defaultDoc);
  957. }
  958. if (nativeVersion < 10)
  959. {
  960. Debug.LogWarning("UpdateArchive to 10");
  961. ToVersion10(nativeDoc, defaultDoc);
  962. }
  963. if (nativeVersion < 11)
  964. {
  965. Debug.LogWarning("UpdateArchive to 11");
  966. ToVersion11(nativeDoc, defaultDoc);
  967. }
  968. if (nativeVersion < 12)
  969. {
  970. Debug.LogWarning("UpdateArchive to 12");
  971. ToVersion12(nativeDoc, defaultDoc);
  972. }
  973. if (nativeVersion < 13)
  974. {
  975. Debug.LogWarning("UpdateArchive to 13");
  976. ToVersion13(nativeDoc, defaultDoc);
  977. }
  978. if (nativeVersion < 14)
  979. {
  980. Debug.LogWarning("UpdateArchive to 14");
  981. ToVersion14(nativeDoc, defaultDoc);
  982. }
  983. if (nativeVersion < 15)
  984. {
  985. Debug.LogWarning("UpdateArchive to 15");
  986. ToVersion15(nativeDoc, defaultDoc);
  987. }
  988. return nativeDoc;
  989. }
  990. public static XmlDocument ToVersion0(XmlDocument nativeDoc, XmlDocument defaultDoc)
  991. {
  992. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 0.ToString();
  993. XmlNode xmlNode1 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.ADPlayTime);
  994. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode1, true));
  995. return nativeDoc;
  996. }
  997. public static XmlDocument ToVersion1(XmlDocument nativeDoc, XmlDocument defaultDoc)
  998. {
  999. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 1.ToString();
  1000. XmlNode xmlNode1 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.SerialNumber);
  1001. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode1, true));
  1002. return nativeDoc;
  1003. }
  1004. public static XmlDocument ToVersion2(XmlDocument nativeDoc, XmlDocument defaultDoc)
  1005. {
  1006. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 2.ToString();
  1007. XmlNode xmlNode1 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.NotificationIndex);
  1008. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode1, true));
  1009. return nativeDoc;
  1010. }
  1011. public static XmlDocument ToVersion3(XmlDocument nativeDoc, XmlDocument defaultDoc)
  1012. {
  1013. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 3.ToString();
  1014. XmlNode xmlNode1 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.NickName);
  1015. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode1, true));
  1016. return nativeDoc;
  1017. }
  1018. public static XmlDocument ToVersion4(XmlDocument nativeDoc, XmlDocument defaultDoc)
  1019. {
  1020. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 4.ToString();
  1021. XmlNode xmlNode = nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.DressData);
  1022. XmlAttribute attribute = xmlNode.Attributes.Append (nativeDoc.CreateAttribute (PlayerConfigLabel.LeftLongSleeveSlot));
  1023. attribute.Value="Empty";
  1024. attribute = xmlNode.Attributes.Append (nativeDoc.CreateAttribute (PlayerConfigLabel.LeftShortSleeveSlot));
  1025. attribute.Value="Empty";
  1026. attribute = xmlNode.Attributes.Append (nativeDoc.CreateAttribute (PlayerConfigLabel.RightLongSleeveSlot));
  1027. attribute.Value="Empty";
  1028. attribute = xmlNode.Attributes.Append (nativeDoc.CreateAttribute (PlayerConfigLabel.RightShortSleeveSlot));
  1029. attribute.Value="Empty";
  1030. List<string> sleeveList = GetSleeveListByTop (xmlNode.Attributes [4].Value);
  1031. xmlNode.Attributes [8].Value = sleeveList[0];
  1032. xmlNode.Attributes [9].Value = sleeveList[1];
  1033. xmlNode.Attributes [10].Value = sleeveList[2];
  1034. xmlNode.Attributes [11].Value = sleeveList[3];
  1035. return nativeDoc;
  1036. }
  1037. public static List<string> GetSleeveListByTop(string topName)
  1038. {
  1039. List<string> sleeveList = new List<string>() {"Empty", "Empty", "Empty", "Empty"};
  1040. if (topName == "上衣1")
  1041. {
  1042. sleeveList[1] = "短袖1左";
  1043. sleeveList[3] = "短袖1右";
  1044. }
  1045. else if (topName == "上衣2")
  1046. {
  1047. sleeveList[1] = "短袖2左";
  1048. sleeveList[3] = "短袖2右";
  1049. }
  1050. else if (topName == "上衣3")
  1051. {
  1052. sleeveList[1] = "短袖2左";
  1053. sleeveList[3] = "短袖2右";
  1054. }
  1055. else if (topName == "上衣5")
  1056. {
  1057. sleeveList[1] = "短袖2左";
  1058. sleeveList[3] = "短袖2右";
  1059. }
  1060. else if (topName == "上衣6")
  1061. {
  1062. sleeveList[1] = "短袖6左";
  1063. sleeveList[3] = "短袖6右";
  1064. }
  1065. else if (topName == "上衣7")
  1066. {
  1067. sleeveList[1] = "短袖7左";
  1068. sleeveList[3] = "短袖7右";
  1069. }
  1070. else if (topName == "上衣7(粉)")
  1071. {
  1072. sleeveList[1] = "短袖7粉左";
  1073. sleeveList[3] = "短袖7粉右";
  1074. }
  1075. else if (topName == "上衣12")
  1076. {
  1077. sleeveList[1] = "短袖12左";
  1078. sleeveList[3] = "短袖12右";
  1079. }
  1080. else if (topName == "上衣13")
  1081. {
  1082. sleeveList[1] = "短袖13左";
  1083. sleeveList[3] = "短袖13右";
  1084. }
  1085. else if (topName == "上衣13(紫)")
  1086. {
  1087. sleeveList[1] = "短袖13蓝左";
  1088. sleeveList[3] = "短袖13蓝右";
  1089. }
  1090. else
  1091. {
  1092. sleeveList[0] = "长袖9左";
  1093. sleeveList[2] = "长袖9右";
  1094. }
  1095. return sleeveList;
  1096. }
  1097. public static XmlDocument ToVersion5(XmlDocument nativeDoc, XmlDocument defaultDoc)
  1098. {
  1099. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 5.ToString();
  1100. return nativeDoc;
  1101. }
  1102. public static XmlDocument ToVersion6(XmlDocument nativeDoc, XmlDocument defaultDoc)
  1103. {
  1104. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 6.ToString();
  1105. XmlNode xmlNode1 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.NewFlowerFlag);
  1106. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode1, true));
  1107. return nativeDoc;
  1108. }
  1109. private static int DefaultFlowerAmt = 1;
  1110. public static XmlDocument ToVersion7(XmlDocument nativeDoc, XmlDocument defaultDoc)
  1111. {
  1112. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 7.ToString();
  1113. XmlNode xmlNode1 = nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.FlowerList);
  1114. string[] flowerIDs= xmlNode1.Attributes[0].Value.Split(' ');
  1115. xmlNode1 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.FlowerAmtList);
  1116. xmlNode1.Attributes[0].Value = "";
  1117. foreach (var flowerID in flowerIDs)
  1118. {
  1119. xmlNode1.Attributes[0].Value += " " + DefaultFlowerAmt;
  1120. }
  1121. xmlNode1.Attributes[0].Value = xmlNode1.Attributes[0].Value.TrimStart();
  1122. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode1, true));
  1123. return nativeDoc;
  1124. }
  1125. public static XmlDocument ToVersion8(XmlDocument nativeDoc, XmlDocument defaultDoc)
  1126. {
  1127. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 8.ToString();
  1128. XmlNode xmlNode0 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.TutorialPlazaRoom);
  1129. XmlNode xmlNode1 = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.TutorialIndexPlazaRoom);
  1130. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode0, true));
  1131. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode1, true));
  1132. return nativeDoc;
  1133. }
  1134. private static int DefaultAchieveValue = 0;
  1135. public static XmlDocument ToVersion9(XmlDocument nativeDoc, XmlDocument defaultDoc)
  1136. {
  1137. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 9.ToString();
  1138. XmlNode xmlNode = nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.AchieveData);
  1139. xmlNode.Attributes.Append(nativeDoc.CreateAttribute(PlayerConfigLabel.CreateRoomAmt));
  1140. xmlNode.Attributes.Append(nativeDoc.CreateAttribute(PlayerConfigLabel.CreateChestAmt));
  1141. xmlNode.Attributes.Append(nativeDoc.CreateAttribute(PlayerConfigLabel.CreateLuckyChestAmt));
  1142. xmlNode.Attributes.Append(nativeDoc.CreateAttribute(PlayerConfigLabel.CreateGuessColorChestAmt));
  1143. xmlNode.Attributes.Append(nativeDoc.CreateAttribute(PlayerConfigLabel.CreateGuessNumberChestAmt));
  1144. xmlNode.Attributes.Append(nativeDoc.CreateAttribute(PlayerConfigLabel.GetChestAwardAmt));
  1145. xmlNode.Attributes[9].Value = DefaultAchieveValue.ToString();
  1146. xmlNode.Attributes[10].Value = DefaultAchieveValue.ToString();
  1147. xmlNode.Attributes[11].Value = DefaultAchieveValue.ToString();
  1148. xmlNode.Attributes[12].Value = DefaultAchieveValue.ToString();
  1149. xmlNode.Attributes[13].Value = DefaultAchieveValue.ToString();
  1150. xmlNode.Attributes[14].Value = DefaultAchieveValue.ToString();
  1151. return nativeDoc;
  1152. }
  1153. public static XmlDocument ToVersion10(XmlDocument nativeDoc, XmlDocument defaultDoc)
  1154. {
  1155. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 10.ToString();
  1156. ChestManager.ClearRefundAndOperateData(nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode));
  1157. return nativeDoc;
  1158. }
  1159. public static XmlDocument ToVersion11(XmlDocument nativeDoc, XmlDocument defaultDoc)
  1160. {
  1161. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 11.ToString();
  1162. XmlNode xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.ReplayVersion);
  1163. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
  1164. return nativeDoc;
  1165. }
  1166. public static XmlDocument ToVersion12(XmlDocument nativeDoc, XmlDocument defaultDoc)
  1167. {
  1168. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 12.ToString();
  1169. XmlNode xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.ExtraSlot);
  1170. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
  1171. return nativeDoc;
  1172. }
  1173. public static XmlDocument ToVersion13(XmlDocument nativeDoc, XmlDocument defaultDoc)
  1174. {
  1175. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 13.ToString();
  1176. XmlNode xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.CurrentMinigameType);
  1177. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
  1178. return nativeDoc;
  1179. }
  1180. public static XmlDocument ToVersion14(XmlDocument nativeDoc, XmlDocument defaultDoc)
  1181. {
  1182. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 14.ToString();
  1183. XmlNode xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.LastPrivateMessageDate);
  1184. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
  1185. return nativeDoc;
  1186. }
  1187. public static XmlDocument ToVersion15(XmlDocument nativeDoc, XmlDocument defaultDoc)
  1188. {
  1189. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 15.ToString();
  1190. XmlNode xmlNode = defaultDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.LastApplicantSerialNumber);
  1191. nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).AppendChild(nativeDoc.ImportNode(xmlNode, true));
  1192. return nativeDoc;
  1193. }
  1194. }