Manager.cs 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526
  1. using LitJson;
  2. using UnityEngine;
  3. using UnityEngine.UI;
  4. using UnityEngine.Events;
  5. using UnityEngine.Analytics;
  6. using UnityEngine.EventSystems;
  7. using System;
  8. using System.Xml;
  9. using System.Collections;
  10. using System.Collections.Generic;
  11. public class Manager : Regist
  12. {
  13. #region Config
  14. #region 成就
  15. public static double PlayADsAmt
  16. {
  17. get { return playADsAmt; }
  18. set
  19. {
  20. playADsAmt = value;
  21. AchieveManager.UpdateStatus(AchieveType.PlayADsAmt, playADsAmt);
  22. }
  23. }
  24. private static double playADsAmt;
  25. public static double UseSkillAmt
  26. {
  27. get { return useSkillAmt; }
  28. set
  29. {
  30. useSkillAmt = value;
  31. AchieveManager.UpdateStatus(AchieveType.UseSkillAmt, useSkillAmt);
  32. }
  33. }
  34. private static double useSkillAmt;
  35. public static double SignAmt
  36. {
  37. get { return signAmt; }
  38. set
  39. {
  40. signAmt = value;
  41. AchieveManager.UpdateStatus(AchieveType.SignAmt, signAmt);
  42. }
  43. }
  44. private static double signAmt;
  45. public static double CloseAmt
  46. {
  47. get { return closeAmt; }
  48. set
  49. {
  50. closeAmt = value;
  51. AchieveManager.UpdateStatus(AchieveType.CloseAmt, closeAmt);
  52. }
  53. }
  54. private static double closeAmt;
  55. public static double ShareAmt
  56. {
  57. get { return shareAmt; }
  58. set
  59. {
  60. shareAmt = value;
  61. AchieveManager.UpdateStatus(AchieveType.ShareAmt, shareAmt);
  62. }
  63. }
  64. private static double shareAmt;
  65. public static double PlayMinigameAmt
  66. {
  67. get { return playMinigameAmt; }
  68. set
  69. {
  70. playMinigameAmt = value;
  71. AchieveManager.UpdateStatus(AchieveType.PlayMinigameAmt, playMinigameAmt);
  72. }
  73. }
  74. private static double playMinigameAmt;
  75. public static double AllElfLevel
  76. {
  77. get { return allElfLevel; }
  78. set
  79. {
  80. allElfLevel = value;
  81. AchieveManager.UpdateStatus(AchieveType.AllElfLevel, allElfLevel);
  82. }
  83. }
  84. private static double allElfLevel;
  85. public static double TotalCoin
  86. {
  87. get { return totalCoin; }
  88. set
  89. {
  90. totalCoin = value;
  91. AchieveManager.UpdateStatus(AchieveType.TotalCoin, totalCoin);
  92. }
  93. }
  94. private static double totalCoin;
  95. public static double TotalFlowerAwardCoin
  96. {
  97. get { return totalFlowerAwardCoin; }
  98. set
  99. {
  100. totalFlowerAwardCoin = value;
  101. AchieveManager.UpdateStatus(AchieveType.TotalFlowerAwardCoin, totalFlowerAwardCoin);
  102. }
  103. }
  104. private static double totalFlowerAwardCoin;
  105. public static double TotalVisitPerson
  106. {
  107. get { return totalVisitPerson; }
  108. set
  109. {
  110. totalVisitPerson = value;
  111. AchieveManager.UpdateStatus(AchieveType.TotalVisitPerson, totalVisitPerson);
  112. }
  113. }
  114. private static double totalVisitPerson;
  115. public static double TotalSpendDiamond
  116. {
  117. get { return totalSpendDiamond; }
  118. set
  119. {
  120. totalSpendDiamond = value;
  121. AchieveManager.UpdateStatus(AchieveType.TotalSpendDiamond, totalSpendDiamond);
  122. }
  123. }
  124. private static double totalSpendDiamond;
  125. public static double CreateRoomAmt
  126. {
  127. get { return createRoomAmt; }
  128. set
  129. {
  130. createRoomAmt = value;
  131. AchieveManager.UpdateStatus(AchieveType.CreateRoomAmt, createRoomAmt);
  132. }
  133. }
  134. private static double createRoomAmt;
  135. public static double CreateChestAmt
  136. {
  137. get { return createChestAmt; }
  138. set
  139. {
  140. createChestAmt = value;
  141. AchieveManager.UpdateStatus(AchieveType.CreateChestAmt, createChestAmt);
  142. }
  143. }
  144. private static double createChestAmt;
  145. public static double CreateLuckyChestAmt
  146. {
  147. get { return createLuckyChestAmt; }
  148. set
  149. {
  150. createLuckyChestAmt = value;
  151. AchieveManager.UpdateStatus(AchieveType.CreateLuckyChestAmt, createLuckyChestAmt);
  152. }
  153. }
  154. private static double createLuckyChestAmt;
  155. public static double CreateGuessColorChestAmt
  156. {
  157. get { return createGuessColorChestAmt; }
  158. set
  159. {
  160. createGuessColorChestAmt = value;
  161. AchieveManager.UpdateStatus(AchieveType.CreateGuessColorChestAmt, createGuessColorChestAmt);
  162. }
  163. }
  164. private static double createGuessColorChestAmt;
  165. public static double CreateGuessNumberChestAmt
  166. {
  167. get { return createGuessNumberChestAmt; }
  168. set
  169. {
  170. createGuessNumberChestAmt = value;
  171. AchieveManager.UpdateStatus(AchieveType.CreateGuessNumberChestAmt, createGuessNumberChestAmt);
  172. }
  173. }
  174. private static double createGuessNumberChestAmt;
  175. public static double GetChestAwardAmt
  176. {
  177. get { return getChestAwardAmt; }
  178. set
  179. {
  180. getChestAwardAmt = value;
  181. AchieveManager.UpdateStatus(AchieveType.GetChestAwardAmt, getChestAwardAmt);
  182. }
  183. }
  184. private static double getChestAwardAmt;
  185. #endregion
  186. public static Action<int> OnLevelChange;
  187. public static Action<double> OnCoinChange;
  188. public static Action<double> OnDiamondChange;
  189. public static int GardenLevel
  190. {
  191. get { return gardenLevel; }
  192. set
  193. {
  194. gardenLevel = value;
  195. if (!Inited)
  196. {
  197. return;
  198. }
  199. LanguageManager.Add(ResourceManager.Get<Text>(CanvasLabel.C_LevelText), new MulLanStr(LanguageLabel.UI__C_Level), gardenLevel.ToString());
  200. VisitManager.UpdateVisitCost();
  201. AchieveManager.UpdateStatus(AchieveType.GardenLevel, gardenLevel);
  202. for (int i = 0; i < SkillList.Count; i++)
  203. {
  204. SkillList[i].UpdateStatus();
  205. }
  206. foreach (var kv in PlayerManager.CloseItemDictionary)
  207. {
  208. kv.Value.OnLevelChange();
  209. }
  210. if (OnLevelChange != null)
  211. {
  212. OnLevelChange.Invoke(gardenLevel);
  213. }
  214. if (gardenLevel >= TutorialManager.MemoryMinigameTutorialLevel)
  215. {
  216. if (TutorialManager.memoryMinigameTutorial)
  217. {
  218. TutorialManager.MemoryMinigameTutorial = true;
  219. }
  220. }
  221. if (GardenLevel < TutorialManager.DressroomTutorialLevel)
  222. {
  223. ResourceManager.Get<Image>(CanvasLabel.C_DressRoom).material = Lib.GrayMat;
  224. }
  225. else
  226. {
  227. ResourceManager.Get<Image>(CanvasLabel.C_DressRoom).material = null;
  228. }
  229. if (GardenManager.TotalUnlockFlower >= TutorialManager.MinFlowerForFindSoloGame && gardenLevel >= TutorialManager.FindSoloMinigameTutorialLevel)
  230. {
  231. if (TutorialManager.findSoloMinigameTutorial)
  232. {
  233. TutorialManager.PlayFindSoloGame();
  234. }
  235. }
  236. if (GardenManager.TotalUnlockFlower >= TutorialManager.MinFlowerForFindMissingGame && gardenLevel >= TutorialManager.FindMissingMinigameTutorialLevel)
  237. {
  238. if (TutorialManager.findMissingMinigameTutorial)
  239. {
  240. TutorialManager.PlayFindMissingGame();
  241. }
  242. }
  243. if (gardenLevel >= TutorialManager.CommentTutorialLevel)
  244. {
  245. ResourceManager.Get(CanvasLabel.C_CommentParent).TweenForCG();
  246. }
  247. if (gardenLevel >= TutorialManager.VisitTutorialLevel)
  248. {
  249. if (TutorialManager.visitTutorial)
  250. {
  251. TutorialManager.ClickVisitBtn();
  252. return;
  253. }
  254. else
  255. {
  256. ResourceManager.SetActive(CanvasLabel.C_Visit, true);
  257. }
  258. }
  259. if (gardenLevel >= TutorialManager.DressroomTutorialLevel)
  260. {
  261. if (TutorialManager.dressroomTutorial)
  262. {
  263. TutorialManager.ClickDressroomButton();
  264. return;
  265. }
  266. }
  267. if (gardenLevel >= TutorialManager.PlazaRoomTutorialLevel)
  268. {
  269. if (TutorialManager.plazaRoomTutorial)
  270. {
  271. TutorialManager.ClickPlazaRoomBtn();
  272. return;
  273. }
  274. else
  275. {
  276. ResourceManager.SetActive(CanvasLabel.C_EnterPlazaRoom, true);
  277. ResourceManager.SetActive(CanvasLabel.C_EnterPlazaRoom0, true);
  278. }
  279. }
  280. }
  281. }
  282. private static int gardenLevel;
  283. public static float Person
  284. {
  285. get { return person; }
  286. set
  287. {
  288. person = value;
  289. ResourceManager.SetText(CanvasLabel.F_PersonLab, Auxiliary.ShrinkBigNumberStr(CurrentPerson*60));
  290. }
  291. }
  292. private static float person;
  293. public static List<string> ExtraPersonSourceSpritesName = new List<string>();
  294. public static float CoinPerson
  295. {
  296. get { return coinPerson; }
  297. set
  298. {
  299. coinPerson = value;
  300. ResourceManager.SetText(CanvasLabel.F_CoinPersonLab, Auxiliary.ShrinkBigNumberStr(CurrentCoinPerson));
  301. }
  302. }
  303. private static float coinPerson;
  304. public static List<string> ExtraCoinPersonSourceSpritesName = new List<string>();
  305. public static float SkillPerson
  306. {
  307. get { return skillPerson; }
  308. set
  309. {
  310. skillPerson = value;
  311. //TweenOutline tween = ResourceManager.Get(CanvasLabel.F_PersonLab).GetTweenOutline();
  312. //if (skillPerson.Equal(0))
  313. //{
  314. // tween.Pause();
  315. // tween.Target.enabled = false;
  316. //}
  317. //else
  318. //{
  319. // if (tween.InPause)
  320. // {
  321. // tween.Resume();
  322. // tween.Target.enabled = true;
  323. // }
  324. // else
  325. // {
  326. // tween.StartForward();
  327. // }
  328. //}
  329. Person = Person;
  330. }
  331. }
  332. public static float skillPerson;
  333. public static float TempSkillPerson
  334. {
  335. get { return tempSkillPerson; }
  336. set
  337. {
  338. tempSkillPerson = value;
  339. TweenOutline tween = ResourceManager.Get(CanvasLabel.F_PersonLab).GetTweenOutline();
  340. if (tempSkillPerson.Equal(0) && tempSkillPersonBuff.Equal(0))
  341. {
  342. tween.Pause();
  343. tween.Target.enabled = false;
  344. }
  345. else
  346. {
  347. if (tween.InPause)
  348. {
  349. tween.Resume();
  350. tween.Target.enabled = true;
  351. }
  352. else
  353. {
  354. tween.StartForward();
  355. }
  356. }
  357. Person = Person;
  358. }
  359. }
  360. public static float tempSkillPerson;
  361. public static float SkillPersonBuff
  362. {
  363. get { return skillPersonBuff; }
  364. set
  365. {
  366. skillPersonBuff = value;
  367. Person = Person;
  368. }
  369. }
  370. public static float skillPersonBuff;
  371. public static float TempSkillPersonBuff
  372. {
  373. get { return tempSkillPersonBuff; }
  374. set
  375. {
  376. tempSkillPersonBuff = value;
  377. TweenOutline tween = ResourceManager.Get(CanvasLabel.F_PersonLab).GetTweenOutline();
  378. if (tempSkillPerson.Equal(0) && tempSkillPersonBuff.Equal(0))
  379. {
  380. tween.Pause();
  381. tween.Target.enabled = false;
  382. }
  383. else
  384. {
  385. if (tween.InPause)
  386. {
  387. tween.Resume();
  388. tween.Target.enabled = true;
  389. }
  390. else
  391. {
  392. tween.StartForward();
  393. }
  394. }
  395. Person = Person;
  396. }
  397. }
  398. public static float tempSkillPersonBuff;
  399. public static float SkillCoinPerson
  400. {
  401. get { return skillCoinPerson; }
  402. set
  403. {
  404. skillCoinPerson = value;
  405. CoinPerson = CoinPerson;
  406. }
  407. }
  408. public static float skillCoinPerson;
  409. public static float TempSkillCoinPerson
  410. {
  411. get { return tempSkillCoinPerson; }
  412. set
  413. {
  414. tempSkillCoinPerson = value;
  415. TweenOutline tween = ResourceManager.Get(CanvasLabel.F_CoinPersonLab).GetTweenOutline();
  416. if (tempSkillCoinPerson.Equal(0) && tempSkillCoinPersonBuff.Equal(0))
  417. {
  418. tween.Pause();
  419. tween.Target.enabled = false;
  420. }
  421. else
  422. {
  423. if (tween.InPause)
  424. {
  425. tween.Resume();
  426. tween.Target.enabled = true;
  427. }
  428. else
  429. {
  430. tween.StartForward();
  431. }
  432. }
  433. CoinPerson = CoinPerson;
  434. }
  435. }
  436. public static float tempSkillCoinPerson;
  437. public static float SkillCoinPersonBuff
  438. {
  439. get { return skillCoinPersonBuff; }
  440. set
  441. {
  442. skillCoinPersonBuff = value;
  443. CoinPerson = CoinPerson;
  444. }
  445. }
  446. public static float skillCoinPersonBuff;
  447. public static float TempSkillCoinPersonBuff
  448. {
  449. get { return tempSkillCoinPersonBuff; }
  450. set
  451. {
  452. tempSkillCoinPersonBuff = value;
  453. TweenOutline tween = ResourceManager.Get(CanvasLabel.F_CoinPersonLab).GetTweenOutline();
  454. if (tempSkillCoinPersonBuff.Equal(0) && tempSkillCoinPerson.Equal(0))
  455. {
  456. tween.Pause();
  457. tween.Target.enabled = false;
  458. }
  459. else
  460. {
  461. if (tween.InPause)
  462. {
  463. tween.Resume();
  464. tween.Target.enabled = true;
  465. }
  466. else
  467. {
  468. tween.StartForward();
  469. }
  470. }
  471. CoinPerson = CoinPerson;
  472. }
  473. }
  474. public static float tempSkillCoinPersonBuff;
  475. public static float IncomeBuff
  476. {
  477. get { return SkillCoinPersonBuff + FlowerPlus; }
  478. }
  479. public static float FlowerPlus
  480. {
  481. get { return flowerPlus; }
  482. set
  483. {
  484. flowerPlus = value;
  485. }
  486. }
  487. public static float flowerPlus;
  488. public static float CurrentPerson
  489. {
  490. get
  491. {
  492. //Debug.Log(Person * (1 + SkillPersonBuff + TempSkillPersonBuff) + SkillPerson + TempSkillPerson);
  493. return Person*(1 + SkillPersonBuff + TempSkillPersonBuff) + SkillPerson + TempSkillPerson;
  494. }
  495. }
  496. public static float CurrentCoinPerson
  497. {
  498. get
  499. {
  500. //Debug.Log(CoinPerson * (1 + SkillCoinPersonBuff + TempSkillCoinPersonBuff) + SkillCoinPerson + TempSkillCoinPerson);
  501. return CoinPerson*(1 + SkillCoinPersonBuff + TempSkillCoinPersonBuff) + SkillCoinPerson + TempSkillCoinPerson;
  502. }
  503. }
  504. public static double Coin
  505. {
  506. get { return coin; }
  507. set
  508. {
  509. coin = value;
  510. ResourceManager.SetText(CanvasLabel.F_CoinLab, Auxiliary.ShrinkBigNumberStr(coin));
  511. ResourceManager.SetText(CanvasLabel.C_CoinLab, Auxiliary.ShrinkBigNumberStr(coin));
  512. ResourceManager.SetText(CanvasLabel.P_CoinLab, Auxiliary.ShrinkBigNumberStr(coin));
  513. AchieveManager.UpdateStatus(AchieveType.CurrentCoin, coin);
  514. OnCoinChange.SafeInvoke(coin);
  515. }
  516. }
  517. public static double coin;
  518. public static double Diamond
  519. {
  520. get { return diamond; }
  521. set
  522. {
  523. diamond = value;
  524. ResourceManager.SetText(CanvasLabel.F_DiamondLab, Auxiliary.ShrinkBigNumberStr(diamond));
  525. ResourceManager.SetText(CanvasLabel.P_DiamondLab, Auxiliary.ShrinkBigNumberStr(diamond));
  526. OnDiamondChange.SafeInvoke(diamond);
  527. }
  528. }
  529. public static double diamond;
  530. public static bool MinigameFlag;
  531. public static bool UploadConfigFlag;
  532. public static bool LoginFlag;
  533. public static bool ReactiveFlag;
  534. public static bool DownloadConfigFlag;
  535. public static bool SceneSwitchFlag;
  536. public static bool Inited;
  537. public static bool IsFirstFrame = true;
  538. public static bool InBackground;
  539. public static float IncomeDisplayTime = 60f;
  540. public static float IncomeCircleTime = 10;
  541. public static float IncomeCircleTimer;
  542. public static float CircleIncome
  543. {
  544. get
  545. {
  546. return CurrentPerson * IncomeCircleTime * CurrentCoinPerson * (1 + FlowerPlus);
  547. }
  548. }
  549. public static float GameBeginTime;
  550. public static bool AlreadyGetOfflineIncome;
  551. public static bool OfflineFlag;
  552. public static float OfflineTime;
  553. public static string OfflineIncomeFml;
  554. public static double OfflineMaxCoin;
  555. public static double OfflineMaxTime;
  556. public static double OfflineMinTime = 120;
  557. public static float InputDetectTime = 60f;
  558. public static float InputDetectTimer;
  559. public static float LoginTime = 10f;
  560. public static float LoginTimer;
  561. public static float MinigameCDTimer;
  562. public static float UploadConfigTime = 60f;
  563. public static float UploadConfigTimer;
  564. public static Manager Instance;
  565. public static DateTime LastQuitTime;
  566. public static List<Skill> UsingSkillList = new List<Skill>();
  567. public static List<Skill> CoolSkillList = new List<Skill>();
  568. public static List<Skill> OfflineCoolSkillList = new List<Skill>();
  569. public static List<List<Skill>> OfflineUsingSkillList = new List<List<Skill>>();
  570. public static List<SkillRoot> SkillList = new List<SkillRoot>();
  571. public static Dictionary<string, SkillRoot> SkillDictionary = new Dictionary<string, SkillRoot>();
  572. #endregion
  573. private void Update()
  574. {
  575. LoginThread();
  576. if (TutorialManager.NewplayerTutorial)
  577. {
  578. return;
  579. }
  580. InputDetectThread();
  581. ProcessSkillThread();
  582. MinigameCDThread();
  583. UploadConfigThread();
  584. IncomeCircleThread();
  585. }
  586. private void InputDetectThread()
  587. {
  588. //if (VisitManager.InVisit)
  589. //{
  590. // return;
  591. //}
  592. if (Auxiliary.AnyKeyUp)
  593. {
  594. InputDetectTimer = 0;
  595. ResourceManager.Get(CanvasLabel.C_Group).TweenForCG();
  596. }
  597. else
  598. {
  599. InputDetectTimer += Time.deltaTime;
  600. if (InputDetectTimer >= InputDetectTime)
  601. {
  602. InputDetectTimer = 0;
  603. ResourceManager.Get(CanvasLabel.C_Group).TweenBacCG();
  604. }
  605. }
  606. }
  607. private void ProcessSkillThread()
  608. {
  609. for (int i = 0; i < UsingSkillList.Count; i++)
  610. {
  611. if (UsingSkillList[i].DoUpdate())
  612. {
  613. UsingSkillList.RemoveAt(i--);
  614. }
  615. }
  616. for (int i = 0; i < CoolSkillList.Count; i++)
  617. {
  618. if (CoolSkillList[i].DoCD())
  619. {
  620. CoolSkillList.RemoveAt(i--);
  621. }
  622. }
  623. }
  624. private void MinigameCDThread()
  625. {
  626. if (!MinigameFlag)
  627. {
  628. MinigameCDTimer -= Time.deltaTime;
  629. ResourceManager.SetText(CanvasLabel.C_MiniGameLab, Mathf.CeilToInt(MinigameCDTimer).ToString());
  630. if (MinigameCDTimer < 0)
  631. {
  632. MinigameFlag = true;
  633. ResourceManager.Get(CanvasLabel.C_MiniGame).TweenBacRect();
  634. CDMinigamePanelManager.EnableCDButton();
  635. ResourceManager.SetText(CanvasLabel.C_MiniGameLab, "");
  636. StaticsManager.GetInstance().RewardItem(StaticsManager.ItemID.获得小游戏, StaticsManager.ItemType.小游戏, "1", StaticsManager.ConsumeModule.None);
  637. }
  638. }
  639. }
  640. private void UploadConfigThread()
  641. {
  642. if (DownloadConfigFlag)
  643. {
  644. return;
  645. }
  646. UploadConfigTimer += Time.deltaTime;
  647. if (UploadConfigTimer >= UploadConfigTime)
  648. {
  649. UploadConfigTimer = 0;
  650. if (!PlayerPrefManager.GetBool(PlayerPrefManager.INTERACT_CONFIG, false))
  651. {
  652. HttpManager.GetSelfConfig();
  653. }
  654. else
  655. {
  656. HttpManager.UploadConfig();
  657. }
  658. }
  659. }
  660. private void LoginThread()
  661. {
  662. LoginTimer += Time.deltaTime;
  663. if (LoginTimer >= LoginTime)
  664. {
  665. LoginTimer = 0;
  666. HttpManager.Login();
  667. StaticsManager.GetInstance().Online();
  668. }
  669. }
  670. private void IncomeCircleThread()
  671. {
  672. IncomeCircleTimer -= Time.deltaTime;
  673. if (IncomeCircleTimer < 0)
  674. {
  675. IncomeCircleTimer = IncomeCircleTime;
  676. TotalVisitPerson += CurrentPerson * IncomeCircleTime;
  677. float circleIncome = CircleIncome;
  678. AddCoin(circleIncome, StaticsManager.ItemID.获得金币, StaticsManager.ConsumeModule.Income);
  679. ResourceManager.Get(CanvasLabel.C_IncomeLab).TweenReForGra();
  680. ResourceManager.Get(CanvasLabel.C_IncomeLab).TweenReForVec();
  681. ResourceManager.SetText(CanvasLabel.C_IncomeLab, "+" + Auxiliary.ShrinkBigNumberStr(circleIncome, 0));
  682. }
  683. }
  684. public static void AddCoin(double amt, StaticsManager.ItemID itemId, StaticsManager.ConsumeModule consumeModule)
  685. {
  686. Coin += amt;
  687. if (amt > 0)
  688. {
  689. TotalCoin += amt;
  690. StaticsManager.GetInstance().RewardItem(itemId, StaticsManager.ItemType.金币, amt.ToString("0"), consumeModule);
  691. }
  692. }
  693. public static void AddDiamond(double amt, StaticsManager.ItemID itemId, StaticsManager.ConsumeModule consumeModule)
  694. {
  695. Diamond += amt;
  696. if (amt > 0)
  697. {
  698. StaticsManager.GetInstance().RewardItem(itemId, StaticsManager.ItemType.钻石, amt.ToString("0"), consumeModule);
  699. }
  700. }
  701. public override void Reactive()
  702. {
  703. foreach (var kv in SkillDictionary)
  704. {
  705. kv.Value.Reactive();
  706. }
  707. InitAllSkill(false);
  708. GetOfflineIncome();
  709. SignManager.ShowPanels();
  710. }
  711. public override void InstantiatePrefabs()
  712. {
  713. #region 生成技能条
  714. #region 读技能配置
  715. List<XmlAttributeCollection> attributeList = ConfigManager.GetSkillConfig();
  716. for (int i = 0; i < attributeList.Count; i++)
  717. {
  718. SkillRoot skillRoot;
  719. #region MyRegion
  720. if (attributeList[i].Count == 18)
  721. {
  722. skillRoot = new Pack(attributeList[i]);
  723. }
  724. else if (attributeList[i].Count == 24)
  725. {
  726. skillRoot = new Ability(attributeList[i]);
  727. }
  728. else if (attributeList[i].Count == 34)
  729. {
  730. if (string.IsNullOrEmpty(attributeList[i][4].Value))
  731. {
  732. skillRoot = new Skill(attributeList[i]);
  733. }
  734. else
  735. {
  736. skillRoot = new BigSkill(attributeList[i]);
  737. }
  738. }
  739. else
  740. {
  741. throw new Exception(attributeList[i].Count.ToString());
  742. }
  743. #endregion
  744. SkillDictionary.Add(skillRoot.FullID, skillRoot);
  745. SkillList.Add(skillRoot);
  746. }
  747. SkillList.Sort(SkillRoot.Sort);
  748. #endregion
  749. for (int i = 0; i < SkillList.Count; i++)
  750. {
  751. if (SkillList[i].SkillTab != SkillTab.Null)
  752. {
  753. ResourceManager.GetSkillItem(SkillList[i]);
  754. }
  755. }
  756. #endregion
  757. }
  758. public override void FirstInit()
  759. {
  760. ResourceManager.Get<Graphic>(CanvasLabel.F_Elf).material = Lib.GrayMat;
  761. ResourceManager.Get<Graphic>(CanvasLabel.F_Store).material = Lib.GrayMat;
  762. ResourceManager.Get<Graphic>(CanvasLabel.F_Magic).material = Lib.GrayMat;
  763. ResourceManager.Get<Graphic>(CanvasLabel.F_ElfLab).material = Lib.GrayMat;
  764. ResourceManager.Get<Graphic>(CanvasLabel.F_StoreLab).material = Lib.GrayMat;
  765. ResourceManager.Get<Graphic>(CanvasLabel.F_MagicLab).material = Lib.GrayMat;
  766. ResourceManager.Get<Button>(CanvasLabel.F_Elf).interactable = false;
  767. ResourceManager.Get<Button>(CanvasLabel.F_Store).interactable = false;
  768. ResourceManager.Get<Button>(CanvasLabel.F_Magic).interactable = false;
  769. List<XmlAttributeCollection> attributeList = ConfigManager.GetSkillList();
  770. for (int i = 0; i < attributeList.Count; i++)
  771. {
  772. SkillRoot skillRoot = SkillDictionary[attributeList[i][0].Value];
  773. if (!(skillRoot is Skill))
  774. {
  775. skillRoot.RegistReference();
  776. skillRoot.Init(true, OfflineTime, OfflineUsingSkillList, attributeList[i]);
  777. }
  778. }
  779. }
  780. public override void SecondInit()
  781. {
  782. Instance = this;
  783. Coin = ConfigManager.GetDoubleFormConfig(PlayerConfigLabel.Coin);
  784. Diamond = ConfigManager.GetDoubleFormConfig(PlayerConfigLabel.Diamond);
  785. MinigameCDTimer = ConfigManager.GetFloatFormConfig(PlayerConfigLabel.MiniTimer);
  786. IncomeCircleTimer = ConfigManager.GetFloatFormConfig(PlayerConfigLabel.CircleTimer);
  787. if (MinigameCDTimer > 0)
  788. {
  789. ResourceManager.Get(CanvasLabel.C_MiniGame).TweenForRect();
  790. if (ConfigManager.GetBoolFormConfig(PlayerConfigLabel.MinigameCoolFlag))
  791. {
  792. CDMinigamePanelManager.DisableCDButton();
  793. }
  794. }
  795. else
  796. {
  797. MinigameFlag = true;
  798. }
  799. HttpManager.ID = ConfigManager.GetStringFormConfig(PlayerConfigLabel.ID);
  800. HttpManager.SerialNumber = ConfigManager.GetStringFormConfig(PlayerConfigLabel.SerialNumber);
  801. List<string> offlineList = ConfigManager.GetOfflineConfig();
  802. OfflineMaxCoin = Auxiliary.StringToLong(offlineList[1], 999999999999999999);
  803. OfflineMaxTime = Auxiliary.StringToLong(offlineList[2], 999999999999999999);
  804. OfflineIncomeFml = offlineList[0];
  805. List<double> dataList = ConfigManager.GetAchieveValues();
  806. PlayADsAmt = dataList[0];
  807. AllElfLevel = dataList[4];
  808. UseSkillAmt = dataList[1];
  809. SignAmt = dataList[2];
  810. ShareAmt = dataList[3];
  811. TotalFlowerAwardCoin = dataList[6];
  812. TotalVisitPerson = dataList[7];
  813. TotalSpendDiamond = dataList[8];
  814. PlayMinigameAmt = dataList[5];
  815. CreateRoomAmt = dataList[9];
  816. CreateChestAmt = dataList[10];
  817. CreateLuckyChestAmt = dataList[11];
  818. CreateGuessColorChestAmt = dataList[12];
  819. CreateGuessNumberChestAmt = dataList[13];
  820. GetChestAwardAmt = dataList[14];
  821. }
  822. public static void InitAllSkill(bool firstRegist)
  823. {
  824. OfflineFlag = false;
  825. float realOfflineTime = 0;
  826. ResourceManager.SetActive(CanvasLabel.Ba_Lab2, false);
  827. if (HttpManager.IsConnect && ConfigManager.GetBoolFormConfig(PlayerConfigLabel.QuitFlag))
  828. {
  829. AlreadyGetOfflineIncome = true;
  830. LastQuitTime = DateTime.Parse(ConfigManager.GetStringFormConfig(PlayerConfigLabel.QuitTime));
  831. OfflineTime = (float)HttpManager.CurrentDateTime.Subtract(LastQuitTime).TotalSeconds;
  832. MinigameCDTimer -= OfflineTime;
  833. if (OfflineTime <= OfflineMinTime)
  834. {
  835. realOfflineTime = OfflineTime;
  836. OfflineTime = 0;
  837. }
  838. else
  839. {
  840. OfflineFlag = true;
  841. }
  842. if (OfflineTime > OfflineMaxTime)
  843. {
  844. OfflineTime = (long)OfflineMaxTime;
  845. ResourceManager.SetText(CanvasLabel.Ba_Lab2, Language.GetStr(LanguageLabel.UI__Ba_Lab2));
  846. ResourceManager.SetActive(CanvasLabel.Ba_Lab2, true);
  847. }
  848. }
  849. else
  850. {
  851. if (ConfigManager.GetBoolFormConfig(PlayerConfigLabel.QuitFlag))
  852. {
  853. AlreadyGetOfflineIncome = false;
  854. LastQuitTime = DateTime.Parse(ConfigManager.GetStringFormConfig(PlayerConfigLabel.QuitTime));
  855. GameBeginTime = Time.time;
  856. }
  857. }
  858. OfflineUsingSkillList = new List<List<Skill>>();
  859. OfflineCoolSkillList = new List<Skill>();
  860. if (OfflineTime > IncomeCircleTimer)
  861. {
  862. int circle = 1 + Mathf.FloorToInt((OfflineTime - IncomeCircleTimer) / IncomeCircleTime);
  863. for (int i = 0; i < circle; i++)
  864. {
  865. OfflineUsingSkillList.Add(new List<Skill>());
  866. }
  867. }
  868. List<XmlAttributeCollection> attributeList = ConfigManager.GetSkillList();
  869. for (int i = 0; i < attributeList.Count; i++)
  870. {
  871. SkillRoot skillRoot = SkillDictionary[attributeList[i][0].Value];
  872. if (skillRoot is Skill)
  873. {
  874. skillRoot.RegistReference();
  875. skillRoot.Init(firstRegist, OfflineTime, OfflineUsingSkillList, attributeList[i]);
  876. }
  877. }
  878. if (OfflineFlag == false)
  879. {
  880. foreach (var skill in CoolSkillList)
  881. {
  882. skill.CoolTimer -= realOfflineTime;
  883. }
  884. }
  885. }
  886. public static void GetOfflineIncome()
  887. {
  888. double coin = 0;
  889. for (int i = 0; i < OfflineUsingSkillList.Count; i++)
  890. {
  891. for (int j = 0; j < OfflineCoolSkillList.Count; j++)
  892. {
  893. OfflineCoolSkillList[j].CoolTimer -= IncomeCircleTime;
  894. }
  895. for (int j = 0; j < OfflineUsingSkillList[i].Count; j++)
  896. {
  897. OfflineUsingSkillList[i][j].AnnulEffect();
  898. OfflineCoolSkillList.Add(OfflineUsingSkillList[i][j]);
  899. }
  900. TotalVisitPerson += CurrentPerson*IncomeCircleTime;
  901. coin += CircleIncome;
  902. }
  903. IncomeCircleTimer = (OfflineTime - IncomeCircleTimer)%IncomeCircleTime;
  904. for (int j = 0; j < OfflineCoolSkillList.Count; j++)
  905. {
  906. OfflineCoolSkillList[j].CoolTimer -= IncomeCircleTime - IncomeCircleTimer;
  907. }
  908. coin = (long) AdjustOfflineIncome(coin);
  909. AddCoin(coin, StaticsManager.ItemID.获得金币, StaticsManager.ConsumeModule.Income);
  910. ResourceManager.SetText(CanvasLabel.Ba_IconLab, Auxiliary.ShrinkBigNumberStr(coin));
  911. }
  912. public static double AdjustOfflineIncome(double offlineIncome)
  913. {
  914. offlineIncome = (long)Auxiliary.FmlParse(OfflineIncomeFml, "c", offlineIncome.ToString());
  915. if (offlineIncome > OfflineMaxCoin)
  916. {
  917. offlineIncome = OfflineMaxCoin;
  918. ResourceManager.SetText(CanvasLabel.Ba_Lab2, Language.GetStr(LanguageLabel.UI__Ba_Lab2));
  919. ResourceManager.SetActive(CanvasLabel.Ba_Lab2, true);
  920. }
  921. return offlineIncome;
  922. }
  923. public new static void SwitchLanguage()
  924. {
  925. Coin = Coin;
  926. AddDiamond(0, StaticsManager.ItemID.None, StaticsManager.ConsumeModule.None);
  927. }
  928. public static void Pay(string id, double amt, Current current, UnityAction succeedCallback, StaticsManager.ItemID itemId, StaticsManager.ConsumeModule consumeModule, bool navigate = true, bool useBubbleTweenNavigate = true, UnityAction navigateCall = null, int buyAmount = 1)
  929. {
  930. if (TutorialManager.PayExempt)
  931. {
  932. succeedCallback.Invoke();
  933. return;
  934. }
  935. amt = Auxiliary.ShrinkNumber(amt);
  936. if (current == Current.Free)
  937. {
  938. succeedCallback.Invoke();
  939. }
  940. else if (current == Current.AD)
  941. {
  942. IAPManager.PlayAD(succeedCallback);
  943. }
  944. else if (current == Current.Cash)
  945. {
  946. IAPManager.TryPurchase(id);
  947. }
  948. else if (current == Current.Coin)
  949. {
  950. #region MyRegion
  951. if (Coin >= amt)
  952. {
  953. Coin -= amt;
  954. succeedCallback.Invoke();
  955. StaticsManager.GetInstance().UseItem(itemId, StaticsManager.ItemType.金币, buyAmount.ToString(), consumeModule);
  956. }
  957. else
  958. {
  959. ResourceManager.Get(CanvasLabel.Fe_Info).TweenBacCG();
  960. if (navigate)
  961. {
  962. Bubble.Show
  963. (
  964. Language.GetStr(LanguageLabel.Common__ShortCoin),
  965. "",
  966. null,
  967. Lib.GoldSprite,
  968. () =>
  969. {
  970. navigateCall.SafeInvoke();
  971. if (useBubbleTweenNavigate)
  972. {
  973. TweenRoot tween = ResourceManager.Get(CanvasLabel.K_Bubble0).GetTweenScale();
  974. tween.AddEventOnetime
  975. (
  976. EventType.BackwardFinish,
  977. () =>
  978. {
  979. UIManager.NavigateToBuyCoin();
  980. }
  981. );
  982. }
  983. else
  984. {
  985. TweenRoot tween = ResourceManager.Get(CanvasLabel.F_Manage0).GetTweenVec();
  986. tween.AddEventOnetime
  987. (
  988. EventType.ForwardFinish,
  989. () =>
  990. {
  991. UIManager.NavigateToBuyCoin();
  992. }
  993. );
  994. }
  995. }
  996. );
  997. Bubble.Lab3.text = Language.GetStr(LanguageLabel.Common__NavigateCoin);
  998. Bubble.Lab3.SetActive(true);
  999. Bubble.Lab.SetActive(false);
  1000. }
  1001. else
  1002. {
  1003. Bubble.Show
  1004. (
  1005. Language.GetStr(LanguageLabel.Common__ShortCoin),
  1006. null,
  1007. null,
  1008. Lib.GoldSprite
  1009. );
  1010. }
  1011. }
  1012. #endregion
  1013. }
  1014. else if (current == Current.Diamond)
  1015. {
  1016. #region MyRegion
  1017. if (Diamond >= amt)
  1018. {
  1019. Diamond -= amt;
  1020. TotalSpendDiamond += amt;
  1021. succeedCallback.Invoke();
  1022. StaticsManager.GetInstance().PurchaseItem(itemId, StaticsManager.ItemType.钻石, buyAmount.ToString(), amt.ToString("0"), consumeModule);
  1023. }
  1024. else
  1025. {
  1026. ResourceManager.Get(CanvasLabel.Fe_Info).TweenBacCG();
  1027. if (navigate)
  1028. {
  1029. Bubble.Show
  1030. (
  1031. Language.GetStr(LanguageLabel.Common__ShortDiamond),
  1032. "",
  1033. null,
  1034. Lib.DiamondSprite,
  1035. () =>
  1036. {
  1037. navigateCall.SafeInvoke();
  1038. if (useBubbleTweenNavigate)
  1039. {
  1040. TweenRoot tween = ResourceManager.Get(CanvasLabel.K_Bubble0).GetTweenScale();
  1041. tween.AddEventOnetime
  1042. (
  1043. EventType.BackwardFinish,
  1044. () =>
  1045. {
  1046. UIManager.NavigateToBuyDiamond();
  1047. }
  1048. );
  1049. }
  1050. else
  1051. {
  1052. TweenRoot tween = ResourceManager.Get(CanvasLabel.F_Manage0).GetTweenVec();
  1053. tween.AddEventOnetime
  1054. (
  1055. EventType.ForwardFinish,
  1056. () =>
  1057. {
  1058. UIManager.NavigateToBuyDiamond();
  1059. }
  1060. );
  1061. }
  1062. }
  1063. );
  1064. Bubble.Lab3.text = Language.GetStr(LanguageLabel.Common__NavigateDiamond);
  1065. Bubble.Lab3.SetActive(true);
  1066. Bubble.Lab.SetActive(false);
  1067. }
  1068. else
  1069. {
  1070. Bubble.Show
  1071. (
  1072. Language.GetStr(LanguageLabel.Common__ShortDiamond),
  1073. null,
  1074. null,
  1075. Lib.DiamondSprite
  1076. );
  1077. }
  1078. }
  1079. #endregion
  1080. }
  1081. else
  1082. {
  1083. throw new Exception(current.ToString());
  1084. }
  1085. }
  1086. public static void FirstTimeLoginCallback(JsonData jsonData)
  1087. {
  1088. if (!Initializer.Inited || !HttpManager.Inited || Inited)
  1089. {
  1090. return;
  1091. }
  1092. HttpManager.GetBuyPackLimitFlag();
  1093. if (HttpManager.IsConnect)
  1094. {
  1095. if (ConfigManager.GetStringFormConfig(PlayerConfigLabel.ID) == PlayerConfigLabel.DefaultID)
  1096. {
  1097. HttpManager.ID = HttpManager.LoginCallbackData["o"].ToString();
  1098. ResourceManager.SetText(CanvasLabel.L_UserLab, HttpManager.ID);
  1099. }
  1100. if (ConfigManager.GetStringFormConfig(PlayerConfigLabel.SerialNumber) == PlayerConfigLabel.DefaultSerialNumber)
  1101. {
  1102. HttpManager.SerialNumber = HttpManager.LoginCallbackData["i"].ToString();
  1103. }
  1104. }
  1105. InitAllSkill(true);
  1106. GetOfflineIncome();
  1107. SignManager.ShowPanels();
  1108. Analytics.SetUserId(HttpManager.ID);
  1109. Inited = true;
  1110. GardenLevel = GardenLevel;
  1111. if (!PlayerPrefManager.GetBool(PlayerPrefManager.INTERACT_CONFIG, false))
  1112. {
  1113. HttpManager.GetSelfConfig();
  1114. }
  1115. else
  1116. {
  1117. HttpManager.UploadConfig();
  1118. }
  1119. ConfigManager.SaveConfigDocument();
  1120. ConfigManager.SaveConfigDocumentToDisk();
  1121. }
  1122. public static void ReactiveLoginCallback(JsonData jsonData)
  1123. {
  1124. LoginFlag = false;
  1125. for (int i = 0; i < Initializer.RegistList.Count; i++)
  1126. {
  1127. Initializer.RegistList[i].Reactive();
  1128. }
  1129. }
  1130. public static void SwitchConfig(string id)
  1131. {
  1132. ResourceManager.SetText(CanvasLabel.La_Lab, Language.GetStr(LanguageLabel.UI__L_Downloading));
  1133. ResourceManager.SetActive(CanvasLabel.La_Lab, true);
  1134. ResourceManager.SetActive(CanvasLabel.La_Mask, true);
  1135. HttpManager.GetConfigByID(id, SwitchConfigCallback);
  1136. }
  1137. public static void SwitchConfigCallback(JsonData jsonData)
  1138. {
  1139. if (jsonData.Inst_Object.Keys.Contains("l"))
  1140. {
  1141. ResourceManager.Get(CanvasLabel.La_Info).TweenBacCG();
  1142. ResourceManager.SetText(CanvasLabel.La_Lab, Language.GetStr(LanguageLabel.UI__La_Lab0));
  1143. ConfigManager.ConfigDocument.LoadXml(jsonData["l"].ToString());
  1144. ConfigManager.ConfigRootNode = ConfigManager.ConfigDocument.SelectSingleNode(PlayerConfigLabel.RootNode);
  1145. ResourceManager.SetText(CanvasLabel.L_UserLab, ConfigManager.GetStringFormConfig(PlayerConfigLabel.ID));
  1146. HttpManager.ID = ConfigManager.GetStringFormConfig(PlayerConfigLabel.ID);
  1147. HttpManager.SerialNumber = ConfigManager.GetStringFormConfig(PlayerConfigLabel.SerialNumber);
  1148. Debug.Log(HttpManager.ID);
  1149. Debug.Log(HttpManager.SerialNumber);
  1150. Bubble.Show(null, Language.GetStr(LanguageLabel.UI__La_Lab0), null, null, () => { Application.Quit(); }, null, false);
  1151. UploadConfigFlag = true;
  1152. DownloadConfigFlag = true;
  1153. ConfigManager.SaveConfigDocumentToDisk();
  1154. PlayerPrefs.SetString(Lib.ConfigPrefs, "");
  1155. }
  1156. else
  1157. {
  1158. ResourceManager.SetText(CanvasLabel.La_Lab, Language.GetStr(LanguageLabel.UI__La_Lab1));
  1159. ResourceManager.SetActive(CanvasLabel.La_Mask, false);
  1160. }
  1161. }
  1162. public void OnApplicationQuit()
  1163. {
  1164. if (!UploadConfigFlag)
  1165. {
  1166. VisitManager.ReverseConfigData();
  1167. ConfigManager.SaveConfigDocument();
  1168. ConfigManager.SaveConfigDocumentToDisk();
  1169. }
  1170. }
  1171. public void OnApplicationPause(bool pause)
  1172. {
  1173. if (pause)
  1174. {
  1175. InBackground = true;
  1176. AlreadyGetOfflineIncome = true;
  1177. if (DownloadConfigFlag)
  1178. {
  1179. return;
  1180. }
  1181. VisitManager.ReverseConfigData();
  1182. ConfigManager.SaveConfigDocument();
  1183. ConfigManager.SaveConfigDocumentToDisk();
  1184. }
  1185. else
  1186. {
  1187. StaticsManager.GetInstance().StartSession();
  1188. InBackground = false;
  1189. if (IsFirstFrame)
  1190. {
  1191. IsFirstFrame = false;
  1192. }
  1193. else
  1194. {
  1195. if (TutorialManager.NewplayerTutorial)
  1196. {
  1197. return;
  1198. }
  1199. if (!Initializer.Inited)
  1200. {
  1201. return;
  1202. }
  1203. if (!Initializer.IsGameActivated)
  1204. {
  1205. return;
  1206. }
  1207. if (DownloadConfigFlag)
  1208. {
  1209. return;
  1210. }
  1211. VisitManager.RecoverConfigData();
  1212. if (LoginFlag)
  1213. {
  1214. return;
  1215. }
  1216. if (ReactiveFlag)
  1217. {
  1218. ReactiveFlag = false;
  1219. return;
  1220. }
  1221. LoginFlag = true;
  1222. HttpManager.Login(ReactiveLoginCallback);
  1223. HttpManager.GetMailAwardData();
  1224. }
  1225. }
  1226. }
  1227. }