SocialManager.cs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using UnityEngine.EventSystems;
  4. using System;
  5. using System.Collections;
  6. using System.Diagnostics;
  7. using System.Collections.Generic;
  8. using LitJson;
  9. using Debug = UnityEngine.Debug;
  10. public class SocialManager : Regist
  11. {
  12. #region Config
  13. public static bool OpenRankPanelFlag;
  14. public static int RecordCommentLastIndex;
  15. public static int RecordCommentFirstIndex;
  16. public static bool OpenCommentFlag;
  17. public static Vector3 RecordCommentPosition;
  18. public static bool IsPlayer;
  19. public static bool IsPanelOpen;
  20. public static bool PullCommentDataFlag;
  21. public static bool UpdateCommentDataFlag;
  22. public static int PlayerLastDisplayIndex = -1;
  23. public static int PlayerFirstDisplayIndex;
  24. public static int VisiteeLastDisplayIndex = -1;
  25. public static int VisiteeFirstDisplayIndex;
  26. public static int CurrentPlayerCommentPage;
  27. public static int CurrentVisiteeCommentPage;
  28. public static bool IsFriendFilterOn;
  29. public static Text PraiseText;
  30. public static Button PraiseButton;
  31. public static Toggle CommentFriendFilterToggle;
  32. public static DateTime CommentTime;
  33. public static InputField CommentInputField;
  34. public static ScrollRectPlus CommentScrollRect;
  35. public static float UpdateRankDataTime = 5;
  36. public static float UpdateRankDataTimer = 0;
  37. public static float UpdatePraiseDataTime = 10;
  38. public static float UpdatePraiseDataTimer = 5;
  39. public static float CommentTimeSpan = 30f;
  40. public static List<CommentData> PlayerCommentDatas = new List<CommentData>();
  41. public static List<CommentData> VisiteeCommentDatas = new List<CommentData>();
  42. public static List<CommentItem> CommentItems = new List<CommentItem>();
  43. private static int CommentPanelMaxRevertAmt = 15;
  44. private static int CommentPanelMaxChildAmt = 20;
  45. private static float CommentItemHeight = 120;
  46. #endregion
  47. public void Update()
  48. {
  49. if (!HttpManager.IsRankDataReady)
  50. {
  51. UpdateRankDataTimer += Time.deltaTime;
  52. if (UpdateRankDataTimer >= UpdateRankDataTime)
  53. {
  54. UpdateRankDataTimer = 0;
  55. HttpManager.GetRankData();
  56. }
  57. }
  58. if (VisitManager.InVisit)
  59. {
  60. return;
  61. }
  62. UpdatePraiseDataTimer += Time.deltaTime;
  63. if (UpdatePraiseDataTimer >= UpdatePraiseDataTime)
  64. {
  65. UpdatePraiseDataTimer = 0;
  66. PraiseText.text = HttpManager.PraiseAmt.ToString();
  67. }
  68. }
  69. public override void FirstInit()
  70. {
  71. PraiseText = ResourceManager.Get<Text>(ObjectLabel.C_PraiseText);
  72. PraiseButton = ResourceManager.Get<Button>(ObjectLabel.C_Praise);
  73. CommentInputField = ResourceManager.Get<InputField>(ObjectLabel.Q_InputField);
  74. CommentScrollRect = ResourceManager.Get<ScrollRectPlus>(ObjectLabel.Q_ScrollRect);
  75. CommentFriendFilterToggle = ResourceManager.Get<Toggle>(ObjectLabel.Q_FriendFilterButton);
  76. CommentFriendFilterToggle.onValueChanged.AddListener(OnCommentFriendFilterToggleClick);
  77. CommentScrollRect.onValueChanged.AddListener(OnScroll);
  78. FriendPanel.OnFriendListRefresh += OnFriendListRefresh;
  79. }
  80. public static void Praise()
  81. {
  82. if (VisitManager.InVisit)
  83. {
  84. PraiseText.text = (int.Parse(PraiseText.text) + 1).ToString();
  85. HttpManager.Praise(HttpManager.SerialNumber, VisitManager.VisiteeSerialNumber);
  86. DisablePraise();
  87. }
  88. else
  89. {
  90. throw new Exception();
  91. }
  92. }
  93. public static void EnablePraise()
  94. {
  95. PraiseText.color = Lib.PraiseTextBlue;
  96. PraiseButton.image.color = Color.white;
  97. PraiseButton.interactable = true;
  98. }
  99. public static void DisablePraise()
  100. {
  101. PraiseText.color = Lib.PraiseTextWhite;
  102. PraiseButton.image.color = Lib.Pink;
  103. PraiseButton.interactable = false;
  104. }
  105. public static void Comment()
  106. {
  107. if (string.IsNullOrEmpty(CommentInputField.text))
  108. {
  109. Bubble.Show(Language.GetStr(LanguageLabel.UI__Lb_Send2));
  110. return;
  111. }
  112. if ((DateTime.Now - CommentTime).TotalSeconds > CommentTimeSpan)
  113. {
  114. CommentTime = DateTime.Now;
  115. string content = StringFilter.GetFilteredString(CommentInputField.text);
  116. HttpManager.AddComment(HttpManager.SerialNumber, VisitManager.VisiteeSerialNumber, content, CommentType.Garden);
  117. CommentInputField.text = "";
  118. }
  119. else
  120. {
  121. Bubble.Show(Language.GetStr(LanguageLabel.UI__Q_CommentTip));
  122. }
  123. }
  124. public static void OpenCommentPanel()
  125. {
  126. IsPlayer = !VisitManager.InVisit;
  127. if (IsPlayer)
  128. {
  129. UpdateCommentPage(IsPlayer);
  130. }
  131. else
  132. {
  133. if (string.IsNullOrEmpty(VisitManager.VisiteeSerialNumber))
  134. {
  135. Bubble.Show(null, Language.GetStr(LanguageLabel.UI__C_CannotComment));
  136. return;
  137. }
  138. else
  139. {
  140. UpdateCommentPage(IsPlayer);
  141. }
  142. }
  143. IsPanelOpen = true;
  144. ResourceManager.Get(ObjectLabel.Q_CommentBK).TweenForCG();
  145. ResourceManager.SetActive(ObjectLabel.Q_InputBK, VisitManager.InVisit);
  146. }
  147. public static void CloseCommentPanel()
  148. {
  149. ResourceManager.Get(ObjectLabel.Q_CommentBK).TweenBacCG();
  150. IsPanelOpen = false;
  151. }
  152. public static void RecordCommentPanel()
  153. {
  154. if (IsPlayer)
  155. {
  156. OpenCommentFlag = true;
  157. RecordCommentLastIndex = PlayerLastDisplayIndex;
  158. RecordCommentFirstIndex = PlayerFirstDisplayIndex;
  159. RecordCommentPosition = CommentScrollRect.content.transform.position;
  160. }
  161. }
  162. public static void RecoverCommentPanel()
  163. {
  164. if (OpenCommentFlag)
  165. {
  166. OpenCommentFlag = false;
  167. ClearCommentPanel();
  168. PlayerLastDisplayIndex = -1;
  169. PlayerFirstDisplayIndex = 0;
  170. int antiCrush = 0;
  171. while (PlayerFirstDisplayIndex != RecordCommentFirstIndex || PlayerLastDisplayIndex != RecordCommentLastIndex)
  172. {
  173. if (antiCrush > 10000)
  174. {
  175. throw new Exception("Crush");
  176. }
  177. if (CommentScrollRect.content.childCount >= CommentPanelMaxChildAmt)
  178. {
  179. CommentItem commentItem = CommentScrollRect.content.GetChild(0).GetComponent<CommentItem>();
  180. ResourceManager.Save(commentItem);
  181. CommentItems.Remove(commentItem);
  182. PlayerFirstDisplayIndex++;
  183. }
  184. PlayerLastDisplayIndex++;
  185. CommentData commentData = PlayerCommentDatas[PlayerLastDisplayIndex];
  186. CommentItem newCommentItem = ResourceManager.GetCommentItem(commentData.NickName, commentData.SerialNumber, commentData.Content);
  187. CommentItems.Add(newCommentItem);
  188. }
  189. CommentScrollRect.content.transform.position = RecordCommentPosition;
  190. OpenCommentPanel();
  191. }
  192. }
  193. public static void PullCommentPage(bool isPlayer)
  194. {
  195. PullCommentDataFlag = true;
  196. UpdateCommentDataFlag = false;
  197. //Debug.Log("PullPage");
  198. if (isPlayer)
  199. {
  200. HttpManager.GetComment
  201. (
  202. HttpManager.SerialNumber,
  203. (CurrentPlayerCommentPage + 1).ToString(),
  204. CommentType.Garden,
  205. data =>
  206. {
  207. if (!UpdateCommentDataFlag)
  208. {
  209. ReceiveCommentDatas(IsPlayer, data);
  210. NextCommentPage(IsPlayer, true);
  211. }
  212. else
  213. {
  214. PullCommentDataFlag = false;
  215. }
  216. }
  217. );
  218. }
  219. else
  220. {
  221. HttpManager.GetComment
  222. (
  223. HttpManager.SerialNumber,
  224. (CurrentVisiteeCommentPage + 1).ToString(),
  225. CommentType.Garden,
  226. data =>
  227. {
  228. if (!UpdateCommentDataFlag)
  229. {
  230. ReceiveCommentDatas(IsPlayer, data);
  231. NextCommentPage(IsPlayer, true);
  232. }
  233. else
  234. {
  235. PullCommentDataFlag = false;
  236. }
  237. }
  238. );
  239. }
  240. }
  241. public static void UpdateCommentPage(bool isPlayer)
  242. {
  243. UpdateCommentDataFlag = true;
  244. ClearCommentPanel();
  245. ResourceManager.Get(ObjectLabel.Q_Tip).TweenForCG();
  246. LanguageManager.Add(ResourceManager.Get<Text>(ObjectLabel.Q_Tip), Language.GetStr(LanguageLabel.UI__Loading));
  247. if (isPlayer)
  248. {
  249. //Debug.Log("UpdatePlayer");
  250. PlayerFirstDisplayIndex = 0;
  251. PlayerLastDisplayIndex = -1;
  252. CurrentPlayerCommentPage = 0;
  253. PlayerCommentDatas = new List<CommentData>();
  254. HttpManager.GetComment
  255. (
  256. HttpManager.SerialNumber,
  257. "1",
  258. CommentType.Garden,
  259. data =>
  260. {
  261. if (!VisitManager.InVisit)
  262. {
  263. DelayCall.Call(0.5f, () => ResourceManager.Get(ObjectLabel.Q_Tip).TweenBacCG());
  264. LanguageManager.Add(ResourceManager.Get<Text>(ObjectLabel.Q_Tip), Language.GetStr(LanguageLabel.UI__LoadSucceed));
  265. ReceiveCommentDatas(true, data);
  266. NextCommentPage(true, true);
  267. ResourceManager.Get<CanvasGroup>(ObjectLabel.Q_CommentBK).interactable = false;
  268. DelayCall.Call(1, () => ResourceManager.Get<CanvasGroup>(ObjectLabel.Q_CommentBK).interactable = true);
  269. }
  270. }
  271. );
  272. }
  273. else
  274. {
  275. //Debug.Log("UpdateVisitee");
  276. VisiteeFirstDisplayIndex = 0;
  277. VisiteeLastDisplayIndex = -1;
  278. CurrentVisiteeCommentPage = 0;
  279. VisiteeCommentDatas = new List<CommentData>();
  280. HttpManager.GetComment
  281. (
  282. VisitManager.VisiteeSerialNumber,
  283. "1",
  284. CommentType.Garden,
  285. data =>
  286. {
  287. if (VisitManager.InVisit)
  288. {
  289. DelayCall.Call(0.5f, () => ResourceManager.Get(ObjectLabel.Q_Tip).TweenBacCG());
  290. LanguageManager.Add(ResourceManager.Get<Text>(ObjectLabel.Q_Tip), Language.GetStr(LanguageLabel.UI__LoadSucceed));
  291. ReceiveCommentDatas(false, data);
  292. NextCommentPage(false, true);
  293. ResourceManager.Get<CanvasGroup>(ObjectLabel.Q_CommentBK).interactable = false;
  294. DelayCall.Call(1, () => ResourceManager.Get<CanvasGroup>(ObjectLabel.Q_CommentBK).interactable = true);
  295. }
  296. }
  297. );
  298. }
  299. }
  300. public static void ReceiveCommentDatas(bool isPlayer, JsonData jsonData)
  301. {
  302. Auxiliary.Instance.DelayCall
  303. (
  304. () =>
  305. {
  306. PullCommentDataFlag = false;
  307. },
  308. 1
  309. );
  310. if (!jsonData.Inst_Object.ContainsKey("l"))
  311. {
  312. return;
  313. }
  314. if (jsonData["l"].Count == 0)
  315. {
  316. return;
  317. }
  318. if (isPlayer)
  319. {
  320. CurrentPlayerCommentPage++;
  321. foreach (JsonData commentData in jsonData["l"])
  322. {
  323. PlayerCommentDatas.UniqueAdd(new CommentData(commentData));
  324. }
  325. }
  326. else
  327. {
  328. CurrentVisiteeCommentPage++;
  329. foreach (JsonData commentData in jsonData["l"])
  330. {
  331. VisiteeCommentDatas.UniqueAdd(new CommentData(commentData));
  332. }
  333. }
  334. }
  335. public static void NextCommentPage(bool isPlayer, bool isDownload)
  336. {
  337. //Debug.Log("NextPage");
  338. if (isPlayer)
  339. {
  340. int saveAmt = 0;
  341. int updateAmt = Mathf.Min(15, PlayerCommentDatas.Count - PlayerLastDisplayIndex - 1);
  342. for (int i = 0; i < updateAmt; i++)
  343. {
  344. if (CommentScrollRect.content.childCount >= CommentPanelMaxChildAmt)
  345. {
  346. saveAmt++;
  347. CommentItem commentItem = CommentScrollRect.content.GetChild(0).GetComponent<CommentItem>();
  348. ResourceManager.Save(commentItem);
  349. CommentItems.Remove(commentItem);
  350. PlayerFirstDisplayIndex++;
  351. }
  352. PlayerLastDisplayIndex++;
  353. CommentData commentData = PlayerCommentDatas[PlayerLastDisplayIndex];
  354. CommentItem newCommentItem = ResourceManager.GetCommentItem(commentData.NickName, commentData.SerialNumber, commentData.Content);
  355. CommentItems.Add(newCommentItem);
  356. }
  357. int offset = isDownload ? 1 : 0;
  358. float scaleFactor = isDownload ? CommentScrollRect.GetComponent<Image>().canvas.scaleFactor : 1;
  359. if (saveAmt > 0)
  360. {
  361. CommentScrollRect.content.position += new Vector3(0, -(saveAmt - offset)*CommentItemHeight*scaleFactor, 0);
  362. CommentScrollRect.AddContentOffset(new Vector3(0, -(saveAmt - offset)* CommentItemHeight * scaleFactor, 0));
  363. }
  364. }
  365. else
  366. {
  367. int saveAmt = 0;
  368. int updateAmt = Mathf.Min(15, VisiteeCommentDatas.Count - VisiteeLastDisplayIndex - 1);
  369. for (int i = 0; i < updateAmt; i++)
  370. {
  371. if (CommentScrollRect.content.childCount >= CommentPanelMaxChildAmt)
  372. {
  373. saveAmt++;
  374. CommentItem commentItem = CommentScrollRect.content.GetChild(0).GetComponent<CommentItem>();
  375. ResourceManager.Save(commentItem);
  376. CommentItems.Remove(commentItem);
  377. VisiteeFirstDisplayIndex++;
  378. }
  379. VisiteeLastDisplayIndex++;
  380. CommentData commentData = VisiteeCommentDatas[VisiteeLastDisplayIndex];
  381. CommentItem newCommentItem = ResourceManager.GetCommentItem(commentData.NickName, commentData.SerialNumber, commentData.Content);
  382. CommentItems.Add(newCommentItem);
  383. }
  384. int offset = isDownload ? 1 : 0;
  385. float scaleFactor = isDownload ? CommentScrollRect.GetComponent<Image>().canvas.scaleFactor : 1;
  386. if (saveAmt > 0)
  387. {
  388. CommentScrollRect.content.position += new Vector3(0, -(saveAmt - offset)* CommentItemHeight * scaleFactor, 0);
  389. CommentScrollRect.AddContentOffset(new Vector3(0, -(saveAmt - offset)* CommentItemHeight * scaleFactor, 0));
  390. }
  391. }
  392. }
  393. public static void PreviousCommentPage(bool isPlayer)
  394. {
  395. if (CommentScrollRect.content.childCount == 0)
  396. {
  397. return;
  398. }
  399. //Debug.Log("PreviousPage");
  400. if (isPlayer)
  401. {
  402. if (PlayerCommentDatas.Count > CommentPanelMaxChildAmt && PlayerFirstDisplayIndex > 0)
  403. {
  404. int revertAmt = Mathf.Min(CommentPanelMaxRevertAmt, PlayerFirstDisplayIndex);
  405. for (int i = 0; i < revertAmt; i++)
  406. {
  407. CommentItem commentItem = CommentScrollRect.content.GetChild(CommentScrollRect.content.childCount - 1).GetComponent<CommentItem>();
  408. ResourceManager.Save(commentItem);
  409. CommentItems.Remove(commentItem);
  410. CommentData commentData = VisiteeCommentDatas[VisiteeLastDisplayIndex];
  411. commentItem = ResourceManager.GetCommentItem(commentData.NickName, commentData.SerialNumber, commentData.Content);
  412. CommentItems.Add(commentItem);
  413. commentItem.transform.SetAsFirstSibling();
  414. PlayerLastDisplayIndex--;
  415. PlayerFirstDisplayIndex--;
  416. }
  417. if (revertAmt > 0)
  418. {
  419. CommentScrollRect.content.position += new Vector3(0, revertAmt* CommentItemHeight, 0);
  420. CommentScrollRect.AddContentOffset(new Vector3(0, revertAmt* CommentItemHeight, 0));
  421. }
  422. }
  423. }
  424. else
  425. {
  426. if (VisiteeCommentDatas.Count > CommentPanelMaxChildAmt && VisiteeFirstDisplayIndex > 0)
  427. {
  428. int revertAmt = Mathf.Min(CommentPanelMaxRevertAmt, VisiteeFirstDisplayIndex);
  429. for (int i = 0; i < revertAmt; i++)
  430. {
  431. CommentItem commentItem = CommentScrollRect.content.GetChild(CommentScrollRect.content.childCount - 1).GetComponent<CommentItem>();
  432. ResourceManager.Save(commentItem);
  433. CommentItems.Remove(commentItem);
  434. CommentData commentData = VisiteeCommentDatas[VisiteeLastDisplayIndex];
  435. commentItem = ResourceManager.GetCommentItem(commentData.NickName, commentData.SerialNumber, commentData.Content);
  436. CommentItems.Add(commentItem);
  437. commentItem.transform.SetAsFirstSibling();
  438. VisiteeLastDisplayIndex--;
  439. VisiteeFirstDisplayIndex--;
  440. }
  441. if (revertAmt > 0)
  442. {
  443. CommentScrollRect.content.position += new Vector3(0, revertAmt* CommentItemHeight, 0);
  444. CommentScrollRect.AddContentOffset(new Vector3(0, revertAmt* CommentItemHeight, 0));
  445. }
  446. }
  447. }
  448. }
  449. public static void ClearCommentPanel()
  450. {
  451. int childAmt = CommentScrollRect.content.childCount;
  452. for (int i = 0; i < childAmt; i++)
  453. {
  454. CommentItem commentItem = CommentScrollRect.content.GetChild(0).GetComponent<CommentItem>();
  455. ResourceManager.Save(commentItem);
  456. CommentItems.Remove(commentItem);
  457. }
  458. CommentScrollRect.verticalNormalizedPosition = 1;
  459. }
  460. public static void OnScroll(Vector2 position)
  461. {
  462. if (PullCommentDataFlag)
  463. {
  464. return;
  465. }
  466. if (CommentScrollRect.content.childCount == 0)
  467. {
  468. return;
  469. }
  470. if (position.y >= 1)
  471. {
  472. PreviousCommentPage(IsPlayer);
  473. }
  474. if (position.y <= 0)
  475. {
  476. if (IsPlayer)
  477. {
  478. if (PlayerLastDisplayIndex == PlayerCommentDatas.Count - 1)
  479. {
  480. PullCommentPage(true);
  481. }
  482. else if (PlayerLastDisplayIndex < PlayerCommentDatas.Count - 1)
  483. {
  484. NextCommentPage(true, false);
  485. }
  486. }
  487. else
  488. {
  489. if (VisiteeLastDisplayIndex == VisiteeCommentDatas.Count - 1)
  490. {
  491. PullCommentPage(false);
  492. }
  493. else if (VisiteeLastDisplayIndex < VisiteeCommentDatas.Count - 1)
  494. {
  495. NextCommentPage(false, false);
  496. }
  497. }
  498. }
  499. }
  500. public static void OpenRankPanel()
  501. {
  502. AudioManager.PlayClip(AudioLabel.Bubble);
  503. ResourceManager.Get(ObjectLabel.S_RankBK).TweenForCG();
  504. }
  505. public static void CloseRankPanel()
  506. {
  507. AudioManager.PlayClip(AudioLabel.ClickButton);
  508. ResourceManager.Get(ObjectLabel.S_RankBK).TweenBacCG();
  509. }
  510. public static void RecordRankPanel()
  511. {
  512. OpenRankPanelFlag = true;
  513. }
  514. public static void RecoverRankPanel()
  515. {
  516. if (OpenRankPanelFlag)
  517. {
  518. OpenRankPanelFlag = false;
  519. OpenRankPanel();
  520. }
  521. }
  522. public static void InitRankPanel()
  523. {
  524. if (Initializer.Inited && HttpManager.IsRankDataReady)
  525. {
  526. for (int i = 0; i < HttpManager.RankDatas.Count; i++)
  527. {
  528. ResourceManager.GetRanktem((i + 1).ToString(), HttpManager.RankDatas[i][1].ToString(), HttpManager.RankDatas[i][0].ToString());
  529. }
  530. }
  531. }
  532. public static void OnCommentFriendFilterToggleClick(bool value)
  533. {
  534. AudioManager.PlayClip(ResourceLabel.BtnClip);
  535. if (value)
  536. {
  537. EnableCommentFriendFilter();
  538. }
  539. else
  540. {
  541. DisableCommentFriendFilter();
  542. }
  543. }
  544. public static void EnableCommentFriendFilter()
  545. {
  546. IsFriendFilterOn = true;
  547. foreach (var commentItem in CommentItems)
  548. {
  549. if (!commentItem.IsFriend(FriendPanel.FriendAccountDatas))
  550. {
  551. commentItem.SetActive(false);
  552. }
  553. }
  554. }
  555. public static void DisableCommentFriendFilter()
  556. {
  557. IsFriendFilterOn = false;
  558. foreach (var commentItem in CommentItems)
  559. {
  560. commentItem.SetActive(true);
  561. }
  562. }
  563. private static void OnFriendListRefresh(List<AccountData> accountDatas)
  564. {
  565. if (IsFriendFilterOn)
  566. {
  567. EnableCommentFriendFilter();
  568. }
  569. }
  570. }