ChestManager.cs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.IO;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Xml;
  8. using Sfs2X.Entities.Data;
  9. using UnityEngine;
  10. using UnityEngine.UI;
  11. using Random = UnityEngine.Random;
  12. public class ChestData
  13. {
  14. #region Config
  15. public int Value;
  16. public int Round;
  17. public int RemainValue;
  18. public int RemainRound;
  19. public int DatabaseRoomID;
  20. public long ID;
  21. public long Owner;
  22. public DateTime ActivatedTime;
  23. public ChestType ChestType;
  24. public Vector3 Position;
  25. public static int SystemRoomDatabaseID = 1;
  26. private static bool Initialized;
  27. private static Vector3 DefaultPosition;
  28. private static Vector3 ChestOffset = new Vector3(0, 0, 1.040916f);
  29. #endregion
  30. public ChestData(ISFSObject arg)
  31. {
  32. if (!Initialized)
  33. {
  34. Initialize();
  35. }
  36. ID = arg.GetLong(gd_chest.ID);
  37. Value = arg.GetInt(gd_chest.Value);
  38. Round = arg.GetInt(gd_chest.Round);
  39. RemainValue = arg.GetInt(gd_chest.RemainValue);
  40. RemainRound = arg.GetInt(gd_chest.RemainRound);
  41. DatabaseRoomID = arg.GetInt(gd_chest.DatabaseRoomID);
  42. Owner = arg.GetLong(gd_chest.Owner);
  43. ActivatedTime = DateUtil.GetTimeFromSeconds(arg.GetLong(gd_chest.ActivatedTime).ToString());
  44. ChestType = (ChestType) arg.GetInt(gd_chest.Type);
  45. Vector3 defaultPosition = DefaultPosition + ChestOffset;
  46. if (arg.ContainsKey(gd_chest.Position))
  47. {
  48. string vectorStr = arg.GetUtfString(gd_chest.Position);
  49. if (vectorStr == "null")
  50. {
  51. Position = defaultPosition;
  52. }
  53. else
  54. {
  55. Position = arg.GetUtfString(gd_chest.Position).ToVector() + ChestOffset;
  56. }
  57. }
  58. else
  59. {
  60. Position = defaultPosition;
  61. }
  62. }
  63. private static void Initialize()
  64. {
  65. Initialized = true;
  66. DefaultPosition = ResourceManager.Get(PlazaRoomLabel.PlazaRoomChestPos).position;
  67. }
  68. }
  69. public class ChestOperateData
  70. {
  71. public long ChestID;
  72. public bool Received;
  73. public int DatabaseRoomID;
  74. public int? RemainGuessAmt;
  75. public DateTime? LastActivatedTime; //只有系统宝箱才用
  76. public ChestOperateData(string str)
  77. {
  78. string[] strings = str.Split('|');
  79. ChestID = long.Parse(strings[0]);
  80. DatabaseRoomID = int.Parse(strings[1]);
  81. Received = int.Parse(strings[2]).ToBool();
  82. if (strings.Length > 3)
  83. {
  84. RemainGuessAmt = int.Parse(strings[3]);
  85. }
  86. if (strings.Length > 4)
  87. {
  88. LastActivatedTime = DateTime.Parse(strings[4]);
  89. }
  90. }
  91. public ChestOperateData(bool received, long chestID, int databaseRoomID)
  92. {
  93. Received = received;
  94. ChestID = chestID;
  95. DatabaseRoomID = databaseRoomID;
  96. }
  97. public override string ToString()
  98. {
  99. StringBuilder stringBuilder = new StringBuilder();
  100. stringBuilder.Append(ChestID);
  101. stringBuilder.Append("|" + DatabaseRoomID);
  102. stringBuilder.Append("|" + Received.ToInt());
  103. if (RemainGuessAmt != null)
  104. {
  105. stringBuilder.Append("|" + RemainGuessAmt);
  106. }
  107. if (LastActivatedTime != null)
  108. {
  109. stringBuilder.Append("|" + LastActivatedTime);
  110. }
  111. return stringBuilder.ToString();
  112. }
  113. }
  114. public class ChestManager : Regist
  115. {
  116. #region Config
  117. public static int PlayerMaxGuessAmt = 3;
  118. private static Text Create_DescriptionText;
  119. private static Text Create_ButtonText;
  120. private static Text Create_SliderValueText;
  121. private static Slider Create_RoundSlider;
  122. private static Button Create_Button;
  123. private static InputField Create_InputField;
  124. private static Button GuessButton;
  125. private static InputField GuessInputField;
  126. public static List<PlazaRoomChest> PlazaRoomChests = new List<PlazaRoomChest>();
  127. public static List<int> RefundRoomIDs = new List<int>();
  128. public static Dictionary<long, ChestOperateData> OperateDataDictionary = new Dictionary<long, ChestOperateData>();
  129. #endregion
  130. public override void FirstInit()
  131. {
  132. XmlNodeList RefundNodes = ConfigManager.ConfigRootNode.SelectNodes(PlayerConfigLabel.RefundNode);
  133. XmlNodeList ReceivedNodes = ConfigManager.ConfigRootNode.SelectNodes(PlayerConfigLabel.ReceivedNode);
  134. for (int i = 0; i < RefundNodes.Count; i++)
  135. {
  136. RefundRoomIDs.Add(int.Parse(RefundNodes[i].InnerText));
  137. }
  138. for (int i = 0; i < ReceivedNodes.Count; i++)
  139. {
  140. ChestOperateData chestOperateData = new ChestOperateData(ReceivedNodes[i].InnerText);
  141. OperateDataDictionary.Add(chestOperateData.ChestID, chestOperateData);
  142. }
  143. CheckRefund();
  144. GetChestExpireStatus();
  145. }
  146. public override void RegistReference()
  147. {
  148. Create_Button = ResourceManager.Get<Button>(CanvasLabel.Yb_Btn);
  149. GuessButton = ResourceManager.Get<Button>(CanvasLabel.Y_Btn);
  150. Create_DescriptionText = ResourceManager.Get<Text>(CanvasLabel.Yb_Desc);
  151. Create_RoundSlider = ResourceManager.Get<Slider>(CanvasLabel.Yb_Slider);
  152. Create_ButtonText = ResourceManager.Get<Text>(CanvasLabel.Yb_BtnLab);
  153. Create_InputField = ResourceManager.Get<InputField>(CanvasLabel.Yb_InputField);
  154. GuessInputField = ResourceManager.Get<InputField>(CanvasLabel.Y_InputField);
  155. Create_SliderValueText = ResourceManager.Get<Text>(CanvasLabel.Yb_SliderValueLab);
  156. GuessInputField.onValueChanged.AddListener(OnGuessInputValueChange);
  157. OnGuessInputValueChange(null);
  158. }
  159. public static void OnGuessInputValueChange(string value)
  160. {
  161. if (string.IsNullOrEmpty(value))
  162. {
  163. GuessButton.image.material = Lib.GrayMat;
  164. GuessButton.interactable = false;
  165. }
  166. else
  167. {
  168. GuessButton.image.material = null;
  169. GuessButton.interactable = true;
  170. }
  171. }
  172. public static void OpenCreateChestPanel()
  173. {
  174. ResourceManager.Get(CanvasLabel.Y_Chest).TweenForCG();
  175. ResourceManager.SetActive(CanvasLabel.Ya_GetAward, false);
  176. ResourceManager.SetActive(CanvasLabel.Y_Guess, false);
  177. ResourceManager.SetActive(CanvasLabel.Yb_CreateChest, true);
  178. OnSliderValueChange(Create_RoundSlider.value);
  179. OnInputValueChange(Create_InputField.text);
  180. Create_RoundSlider.value = 1;
  181. Create_RoundSlider.maxValue = SFSManager.GardenSmartFox.PlazaRoomController.CurrentRoomData.MaxPlayer;
  182. }
  183. public static void CloseCreateChestPanel()
  184. {
  185. ResourceManager.Get(CanvasLabel.Y_Chest).TweenBacCG();
  186. }
  187. public static void OnLuckyToggle(bool enable)
  188. {
  189. if (enable)
  190. {
  191. ChestType = ChestType.Lucky;
  192. LanguageManager.Add(Create_DescriptionText, new MulLanStr(LanguageLabel.UI__Yb_LuckyDesc));
  193. }
  194. }
  195. public static void OnColorToggle(bool enable)
  196. {
  197. if (enable)
  198. {
  199. ChestType = ChestType.GuessColor;
  200. LanguageManager.Add(Create_DescriptionText, new MulLanStr(LanguageLabel.UI__Yb_GuessColorDesc));
  201. }
  202. }
  203. public static void OnNumberToggle(bool enable)
  204. {
  205. if (enable)
  206. {
  207. ChestType = ChestType.GuessNumber;
  208. LanguageManager.Add(Create_DescriptionText, new MulLanStr(LanguageLabel.UI__Yb_GuessNumberDesc));
  209. }
  210. }
  211. public static void OnInputValueChange(string value)
  212. {
  213. if (string.IsNullOrEmpty(value) || int.Parse(value) < 20)
  214. {
  215. Create_Button.interactable = false;
  216. Create_Button.image.material = Lib.GrayMat;
  217. LanguageManager.Add(Create_ButtonText, new MulLanStr(LanguageLabel.UI__Yb_Minimum));
  218. return;
  219. }
  220. Cost = int.Parse(value);
  221. ResourceManager.SetText(CanvasLabel.Yb_CostLab, Language.GetStr(LanguageLabel.UI__AA_Cost) + TransferLabel.DiamondSprite + Cost);
  222. if (Manager.Diamond < Cost)
  223. {
  224. Create_Button.interactable = false;
  225. Create_Button.image.material = Lib.GrayMat;
  226. LanguageManager.Add(Create_ButtonText, new MulLanStr(LanguageLabel.Common__ShortDiamond));
  227. }
  228. else
  229. {
  230. Create_Button.interactable = true;
  231. Create_Button.image.material = null;
  232. LanguageManager.Add(Create_ButtonText, new MulLanStr(LanguageLabel.Common__Confirm));
  233. }
  234. }
  235. public static void OnSliderValueChange(float value)
  236. {
  237. Round = (int) value;
  238. Create_SliderValueText.text = Round + Language.GetStr(LanguageLabel.UI__Yb_SliderValueLab);
  239. }
  240. private static int Cost;
  241. private static int Round;
  242. private static float ChestXMinOffset = 1;
  243. private static float ChestXMaxOffset = 2;
  244. private static ChestType ChestType = ChestType.Lucky;
  245. public static void CreateChest()
  246. {
  247. LanguageManager.Add(ResourceManager.Get<Text>(CanvasLabel.Y_Tip), new MulLanStr(LanguageLabel.UI__AA_SendRequest));
  248. ResourceManager.Get(CanvasLabel.Y_Tip).TweenForCG();
  249. int databaseRoomID = SFSManager.GardenSmartFox.PlazaRoomController.CurrentRoomData.ID;
  250. long serialNumber = long.Parse(HttpManager.SerialNumber);
  251. Vector3 position = PlayerPosToChestPos(SFSManager.PlazaRoomController.SelfInstance.Player.transform.position);
  252. SFSManager.PlazaRoomEvent.CreateChest(Round, Cost, ChestType, databaseRoomID, serialNumber, position);
  253. ResourceManager.Get<CanvasGroup>(CanvasLabel.Y_Chest).interactable = false;
  254. }
  255. public static Vector3 PlayerPosToChestPos(Vector3 playerPos)
  256. {
  257. return playerPos + Mathf.Sign(Random.Range(-1f, 1f))*new Vector3(Random.Range(ChestXMinOffset, ChestXMaxOffset), 0, 0);
  258. }
  259. public static void OnCreateChestError()
  260. {
  261. LanguageManager.Add(ResourceManager.Get<Text>(CanvasLabel.Y_Tip), new MulLanStr(LanguageLabel.UI__AA_CreateError));
  262. ResourceManager.Get(CanvasLabel.Y_Tip).TweenBacCG();
  263. ResourceManager.Get<CanvasGroup>(CanvasLabel.Y_Chest).interactable = true;
  264. }
  265. public static void OnCreateChestSucceed()
  266. {
  267. Manager.CreateChestAmt++;
  268. if (ChestType == ChestType.Lucky)
  269. {
  270. Manager.CreateLuckyChestAmt++;
  271. }
  272. else if (ChestType == ChestType.GuessColor)
  273. {
  274. Manager.CreateGuessColorChestAmt++;
  275. }
  276. else if (ChestType == ChestType.GuessNumber)
  277. {
  278. Manager.CreateGuessNumberChestAmt++;
  279. }
  280. LanguageManager.Add(ResourceManager.Get<Text>(CanvasLabel.Y_Tip), new MulLanStr(LanguageLabel.UI__AA_CreateSucceed));
  281. ResourceManager.Get(CanvasLabel.Y_Tip).TweenBacCG();
  282. ResourceManager.Get<CanvasGroup>(CanvasLabel.Y_Chest).interactable = true;
  283. Manager.AddDiamond(-Cost, StaticsManager.ItemID.创建宝箱, StaticsManager.ConsumeModule.Charge);
  284. CloseCreateChestPanel();
  285. }
  286. public static void OnReceiveNewChest(ChestData chestData)
  287. {
  288. if (!SFSManager.PlazaRoomController.JoinedPlazaRoom)
  289. {
  290. return;
  291. }
  292. AudioManager.PlayClip(AudioLabel.Bubble);
  293. InstantiateChest(chestData);
  294. if (chestData.Owner == long.Parse(HttpManager.SerialNumber))
  295. {
  296. if (SFSManager.PlazaRoomController.CurrentRoomData.ID != ChestData.SystemRoomDatabaseID)
  297. {
  298. RefundRoomIDs.UniqueAdd(SFSManager.PlazaRoomController.CurrentRoomData.ID);
  299. }
  300. }
  301. }
  302. private static void CheckRefund()
  303. {
  304. if (RefundRoomIDs.Count == 0)
  305. {
  306. return;
  307. }
  308. else
  309. {
  310. SFSManager.PlazaRoomEvent.CheckChestRefund(RefundRoomIDs);
  311. }
  312. }
  313. private static void GetChestExpireStatus()
  314. {
  315. if (OperateDataDictionary.Keys.Count == 0)
  316. {
  317. return;
  318. }
  319. SFSManager.PlazaRoomEvent.GetChestExpireStatus(OperateDataDictionary.Keys.ToList());
  320. }
  321. public static void OnReceiveChestExpireStatus(List<long> chestIDs)
  322. {
  323. foreach (var chestID in chestIDs)
  324. {
  325. //Debug.LogWarning("expire " + chestID);
  326. OperateDataDictionary.Remove(chestID);
  327. }
  328. }
  329. public static void RetrieveAllChest()
  330. {
  331. foreach (var plazaRoomChest in PlazaRoomChests)
  332. {
  333. plazaRoomChest.RetriveChest();
  334. }
  335. PlazaRoomChests = new List<PlazaRoomChest>();
  336. }
  337. private static void InstantiateChest(ChestData chestData)
  338. {
  339. if (chestData.ChestType != ChestType.System)
  340. {
  341. if (chestData.RemainRound <= 0 || chestData.RemainValue <= 0)
  342. {
  343. return;
  344. }
  345. ChestOperateData chestOperateData;
  346. OperateDataDictionary.TryGetValue(chestData.ID, out chestOperateData);
  347. if (chestOperateData == null || chestOperateData.Received == false)
  348. {
  349. PlazaRoomChest chest = ResourceManager.GetPlazaRoomChest(chestData.Position);
  350. chest.Init(chestData);
  351. PlazaRoomChests.Add(chest);
  352. if (chestOperateData == null || chestOperateData.RemainGuessAmt == null || chestOperateData.RemainGuessAmt > 0)
  353. {
  354. chest.Active();
  355. chest.TurnNormalColor();
  356. }
  357. else
  358. {
  359. chest.Deactive();
  360. chest.TurnGray();
  361. }
  362. }
  363. }
  364. else
  365. {
  366. PlazaRoomChest chest = ResourceManager.GetPlazaRoomChest(chestData.Position);
  367. chest.SystemChestInit(chestData);
  368. PlazaRoomChests.Add(chest);
  369. }
  370. }
  371. private static int SystemChestActivateTimespan = 600;
  372. public static void ReceiveAllChestData(List<ChestData> chestDatas)
  373. {
  374. AudioManager.PlayClip(AudioLabel.Bubble);
  375. foreach (var chestData in chestDatas)
  376. {
  377. InstantiateChest(chestData);
  378. }
  379. }
  380. public static void ActivateSystemChest(DateTime activatedTime)
  381. {
  382. if (!SFSManager.GardenSmartFox.PlazaRoomController.JoinedPlazaRoom)
  383. {
  384. return;
  385. }
  386. if (PlazaRoomChest.SystemChest == null)
  387. {
  388. return;
  389. }
  390. if (OperateDataDictionary.Keys.Contains(PlazaRoomChest.SystemChest.ChestData.ID))
  391. {
  392. double timeSinceLastActivated = activatedTime.Subtract(OperateDataDictionary[PlazaRoomChest.SystemChest.ChestData.ID].LastActivatedTime.Value).TotalSeconds;
  393. if (timeSinceLastActivated >= SystemChestActivateTimespan)
  394. {
  395. ReactivateSystemChest(activatedTime);
  396. }
  397. return;
  398. }
  399. PlazaRoomChest.SystemChest.Active();
  400. PlazaRoomChest.SystemChest.TurnNormalColor();
  401. PlazaRoomChest.SystemChest.ChestTimerTransform.TweenBacCG();
  402. }
  403. public static void ReactivateSystemChest(DateTime activatedTime)
  404. {
  405. if (!SFSManager.GardenSmartFox.PlazaRoomController.JoinedPlazaRoom)
  406. {
  407. return;
  408. }
  409. if (PlazaRoomChest.SystemChest == null)
  410. {
  411. return;
  412. }
  413. OperateDataDictionary.Remove(PlazaRoomChest.SystemChest.ChestData.ID);
  414. PlazaRoomChest.SystemChest.Active();
  415. PlazaRoomChest.SystemChest.TurnNormalColor();
  416. PlazaRoomChest.SystemChest.ChestTimerTransform.TweenBacCG();
  417. PlazaRoomChest.SystemChest.LastActivatedTime = activatedTime;
  418. }
  419. public static void DeactivateSystemChest(long pasttime)
  420. {
  421. if (!SFSManager.GardenSmartFox.PlazaRoomController.JoinedPlazaRoom)
  422. {
  423. return;
  424. }
  425. if (PlazaRoomChest.SystemChest == null)
  426. {
  427. return;
  428. }
  429. PlazaRoomChest.SystemChest.Deactive();
  430. PlazaRoomChest.SystemChest.TurnGray();
  431. PlazaRoomChest.SystemChest.ChestRefreshTimer = PlazaRoomChest.SystemChest.ChestRefreshTime - pasttime + 1;
  432. }
  433. public static void ReceiveChestAward(int award, long chestID)
  434. {
  435. ChestOperateData chestOperateData;
  436. if (OperateDataDictionary.TryGetValue(chestID, out chestOperateData))
  437. {
  438. chestOperateData.Received = true;
  439. }
  440. else
  441. {
  442. chestOperateData = new ChestOperateData(true, PlazaRoomChest.SelectedChest.ChestData.ID, PlazaRoomChest.SelectedChest.ChestData.DatabaseRoomID);
  443. OperateDataDictionary.Add(chestOperateData.ChestID, chestOperateData);
  444. }
  445. ResourceManager.Get<CanvasGroup>(CanvasLabel.Y_Chest).interactable = true;
  446. if (award <= 0)
  447. {
  448. ResourceManager.Get(CanvasLabel.Y_Chest).TweenBacCG();
  449. Bubble.Show(null, Language.GetStr(LanguageLabel.UI__Y_SoldOut));
  450. }
  451. else
  452. {
  453. AudioManager.PlayClip(AudioLabel.GetCurrent);
  454. ResourceManager.Get(CanvasLabel.Y_Chest).TweenForCG();
  455. ResourceManager.SetActive(CanvasLabel.Ya_GetAward, true);
  456. ResourceManager.SetActive(CanvasLabel.Y_Guess, false);
  457. ResourceManager.SetActive(CanvasLabel.Yb_CreateChest, false);
  458. ResourceManager.SetText(CanvasLabel.Ya_Desc, $"x{award}");
  459. Manager.AddDiamond(award, StaticsManager.ItemID.获得钻石, StaticsManager.ConsumeModule.RoomChestAward);
  460. Manager.GetChestAwardAmt++;
  461. }
  462. for (int i = 0; i < PlazaRoomChests.Count; i++)
  463. {
  464. if (PlazaRoomChests[i].ChestData.ID == chestID)
  465. {
  466. if (PlazaRoomChests[i].ChestData.ChestType == ChestType.System)
  467. {
  468. PlazaRoomChests[i].ResetChestRefreshTimer();
  469. OperateDataDictionary[chestID].RemainGuessAmt = 0;
  470. OperateDataDictionary[chestID].LastActivatedTime = PlazaRoomChests[i].LastActivatedTime;
  471. }
  472. else
  473. {
  474. PlazaRoomChests[i].RetriveChest();
  475. PlazaRoomChests.RemoveAt(i--);
  476. }
  477. }
  478. }
  479. }
  480. public static void ReceiveChestRefund(int refund, List<int> databaseRoomIDs)
  481. {
  482. foreach (var databaseRoomID in databaseRoomIDs)
  483. {
  484. RefundRoomIDs.Remove(databaseRoomID);
  485. }
  486. if (refund > 0)
  487. {
  488. Manager.AddDiamond(refund, StaticsManager.ItemID.获得钻石, StaticsManager.ConsumeModule.RoomChestRefund);
  489. InfoBoxManager.GardenInfoBox.Display(Language.GetStr(LanguageLabel.UI__Y_Refund)+refund, 10, Color.white, ResourceManager.LoadSprite("Atlas", Folder.Atlas));
  490. }
  491. }
  492. public static void SaveToConfig()
  493. {
  494. ClearRefundAndOperateData(ConfigManager.ConfigRootNode);
  495. foreach (var id in RefundRoomIDs)
  496. {
  497. XmlNode node = ConfigManager.ConfigDocument.CreateNode(XmlNodeType.Element, PlayerConfigLabel.RefundNode, null);
  498. node.InnerText = id.ToString();
  499. ConfigManager.ConfigRootNode.AppendChild(node);
  500. }
  501. foreach (var kv in OperateDataDictionary)
  502. {
  503. XmlNode node = ConfigManager.ConfigDocument.CreateNode(XmlNodeType.Element, PlayerConfigLabel.ReceivedNode, null);
  504. node.InnerText = kv.Value.ToString();
  505. ConfigManager.ConfigRootNode.AppendChild(node);
  506. //Debug.LogWarning($"{kv.Key}|{kv.Value}");
  507. }
  508. }
  509. public static void ClearRefundAndOperateData(XmlNode playerConfigNode)
  510. {
  511. XmlNode node = playerConfigNode.SelectSingleNode(PlayerConfigLabel.RefundNode);
  512. while (node != null)
  513. {
  514. playerConfigNode.RemoveChild(node);
  515. node = playerConfigNode.SelectSingleNode(PlayerConfigLabel.RefundNode);
  516. }
  517. node = playerConfigNode.SelectSingleNode(PlayerConfigLabel.ReceivedNode);
  518. while (node != null)
  519. {
  520. playerConfigNode.RemoveChild(node);
  521. node = playerConfigNode.SelectSingleNode(PlayerConfigLabel.ReceivedNode);
  522. }
  523. }
  524. }