ActivitySProxy.cs 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. using System;
  2. using System.Collections.Generic;
  3. using ET;
  4. using GFGGame;
  5. using Hutool;
  6. namespace GFGGame
  7. {
  8. public class NoticeTimeLimitLuckyBoxDropOutCount : AMHandler<S2C_NoticeTimeLimitLuckyBoxDropOutCount>
  9. {
  10. protected override async ETTask Run(Session session, S2C_NoticeTimeLimitLuckyBoxDropOutCount message)
  11. {
  12. var activityOpenCfg = CommonDataManager.Tables.TblActivityOpenCfg.GetOrDefault(message.ActivityId);
  13. if (activityOpenCfg.Type == ConstLimitTimeActivityType.ActLimitLuckyBox)
  14. {
  15. ActivityDataManager.Instance.allPlayTimes = message.AllPlayTimes;
  16. ActivityDataManager.Instance.lastDrawCount = message.Count;
  17. }
  18. else if (activityOpenCfg.Type == ConstLimitTimeActivityType.ActLimitTsy)
  19. {
  20. ActivityDataManager.Instance.allTsyPlayTimes = message.AllPlayTimes;
  21. ActivityDataManager.Instance.lastTsyDrawCount = message.Count;
  22. }
  23. else if (activityOpenCfg.Type == ConstLimitTimeActivityType.ActLimitStlyc)
  24. {
  25. ActivityDataManager.Instance.allLimitStlycTimes = message.AllPlayTimes;
  26. ActivityDataManager.Instance.lastStlycDrawCount = message.Count;
  27. }
  28. EventAgent.DispatchEvent(ConstMessage.ACTIVITY_LUCKY_BOX);
  29. await ETTask.CompletedTask;
  30. }
  31. }
  32. /**********************************************************七日登录*************************************************/
  33. public static class ActivitySProxy
  34. {
  35. public static async ETTask<bool> ReqSevenDayLoginInfos()
  36. {
  37. M2C_GetDailySignInBonusInfoList response = null;
  38. response =
  39. (M2C_GetDailySignInBonusInfoList)await MessageHelper.SendToServer(
  40. new C2M_GetDailySignInBonusInfoList());
  41. if (response != null)
  42. {
  43. if (response.Error == ErrorCode.ERR_Success)
  44. {
  45. ActivityDataManager.Instance.sevenDayLoginLoginIdList = response.KsBonusId;
  46. ActivityDataManager.Instance.sevenDayLoginBonusStatusList = response.VsBonusStatus;
  47. return true;
  48. }
  49. }
  50. return false;
  51. }
  52. public static async ETTask<bool> ReqSevenDayLoginRewards(int id)
  53. {
  54. M2C_GetDailySinInBonus response = null;
  55. response = (M2C_GetDailySinInBonus)await MessageHelper.SendToServer(new C2M_GetDailySinInBonus()
  56. { BonusId = id });
  57. if (response != null)
  58. {
  59. if (response.Error == ErrorCode.ERR_Success)
  60. {
  61. ActivityDataManager.Instance.sevenDayLoginBonusStatusList[response.BonusId - 1] =
  62. response.BonusStatus;
  63. var rewards = CommonDataManager.Tables.TblDailyLoginCfg.GetOrDefault(response.BonusId).Rewards;
  64. BonusController.TryShowBonusList(rewards.ToGfgGameItemParam());
  65. EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
  66. return true;
  67. }
  68. }
  69. return false;
  70. }
  71. /*************************************************************首冲奖励*****************************************************/
  72. //领取首冲奖励
  73. public static async ETTask<bool> ReqFirstChargeBonusRewards()
  74. {
  75. S2C_GetFirstRechargeBonus response = null;
  76. response = (S2C_GetFirstRechargeBonus)await MessageHelper.SendToServer(new C2S_GetFirstRechargeBonus() { });
  77. if (response != null)
  78. {
  79. if (response.Error == ErrorCode.ERR_Success)
  80. {
  81. BonusController.TryShowBonusList(CommonDataManager.Tables.TblGlobalCfg.FirstChargeBonus
  82. .ToGfgGameItemParam());
  83. return true;
  84. }
  85. }
  86. return false;
  87. }
  88. /*************************************************************限时抽奖活动*****************************************************/
  89. //请求限时抽奖活动信息
  90. public static async ETTask<bool> ReqGetTimeLimitLuckyBoxInfo(int activityId)
  91. {
  92. S2C_GetTimeLimitLuckyBoxInfo response = null;
  93. response = (S2C_GetTimeLimitLuckyBoxInfo)await MessageHelper.SendToServer(new C2S_GetTimeLimitLuckyBoxInfo()
  94. { ActivityId = activityId });
  95. if (response != null)
  96. {
  97. if (response.Error == ErrorCode.ERR_Success)
  98. {
  99. var activityCfg = CommonDataManager.Tables.TblActivityOpenCfg.GetOrDefault(response.ActivityId);
  100. if (activityCfg.Type == ConstLimitTimeActivityType.ActLimitLuckyBox)
  101. {
  102. if (ActivityDataManager.Instance.actLuckyBoxId != response.ActivityId)
  103. {
  104. ActivityDataManager.Instance.luckyBoxActBonusState.Clear();
  105. }
  106. ActivityDataManager.Instance.actLuckyBoxId = response.ActivityId;
  107. ActivityDataManager.Instance.allPlayTimes = response.AllPlayTimes;
  108. ActivityDataManager.Instance.lastDrawCount = response.Count;
  109. for (int i = 0; i < response.KsBonusState.Count; i++)
  110. {
  111. ActivityDataManager.Instance.luckyBoxActBonusState[response.KsBonusState[i]] =
  112. response.VsBonusState[i];
  113. }
  114. }
  115. else if (activityCfg.Type == ConstLimitTimeActivityType.ActLimitTsy)
  116. {
  117. if (ActivityDataManager.Instance.actLimitTsyId != response.ActivityId)
  118. {
  119. ActivityDataManager.Instance.luckyActTsyBonusState.Clear();
  120. }
  121. ActivityDataManager.Instance.actLimitTsyId = response.ActivityId;
  122. ActivityDataManager.Instance.allTsyPlayTimes = response.AllPlayTimes;
  123. ActivityDataManager.Instance.lastTsyDrawCount = response.Count;
  124. for (int i = 0; i < response.KsBonusState.Count; i++)
  125. {
  126. ActivityDataManager.Instance.luckyActTsyBonusState[response.KsBonusState[i]] =
  127. response.VsBonusState[i];
  128. }
  129. }
  130. else if (activityCfg.Type == ConstLimitTimeActivityType.ActLimitStlyc)
  131. {
  132. if (ActivityDataManager.Instance.actLimitStlycId != response.ActivityId)
  133. {
  134. ActivityDataManager.Instance.limitStlycActBonusState.Clear();
  135. }
  136. ActivityDataManager.Instance.actLimitStlycId = response.ActivityId;
  137. ActivityDataManager.Instance.allLimitStlycTimes = response.AllPlayTimes;
  138. ActivityDataManager.Instance.lastStlycDrawCount = response.Count;
  139. for (int i = 0; i < response.KsBonusState.Count; i++)
  140. {
  141. ActivityDataManager.Instance.limitStlycActBonusState[response.KsBonusState[i]] =
  142. response.VsBonusState[i];
  143. }
  144. }
  145. return true;
  146. }
  147. }
  148. return false;
  149. }
  150. /// <summary>
  151. /// 领取抽奖奖励
  152. /// </summary>
  153. /// <param name="activityId"></param>
  154. /// <param name="bonusKey">奖励key,这里对应抽奖次数</param>
  155. /// <returns></returns>
  156. public static async ETTask<bool> ReqGetTimeLimitLuckyBoxBonus(int activityId, int bonusKey)
  157. {
  158. S2C_GetTimeLimitLuckyBoxBonus response = null;
  159. response = (S2C_GetTimeLimitLuckyBoxBonus)await MessageHelper.SendToServer(
  160. new C2S_GetTimeLimitLuckyBoxBonus() { ActivityId = activityId, BonusKey = bonusKey });
  161. if (response != null)
  162. {
  163. if (response.Error == ErrorCode.ERR_Success)
  164. {
  165. var activityCfg = CommonDataManager.Tables.TblActivityOpenCfg.GetOrDefault(response.ActivityId);
  166. if (activityCfg.Type == ConstLimitTimeActivityType.ActLimitLuckyBox)
  167. {
  168. if (ActivityDataManager.Instance.actLuckyBoxId != response.ActivityId)
  169. {
  170. return false;
  171. }
  172. ActivityDataManager.Instance.luckyBoxActBonusState[response.BonusKey] = response.BonusStatus;
  173. }
  174. else if (activityCfg.Type == ConstLimitTimeActivityType.ActLimitTsy)
  175. {
  176. if (ActivityDataManager.Instance.actLimitTsyId != response.ActivityId)
  177. {
  178. return false;
  179. }
  180. ActivityDataManager.Instance.luckyActTsyBonusState[response.BonusKey] = response.BonusStatus;
  181. }
  182. else if (activityCfg.Type == ConstLimitTimeActivityType.ActLimitStlyc)
  183. {
  184. if (ActivityDataManager.Instance.actLimitStlycId != response.ActivityId)
  185. {
  186. return false;
  187. }
  188. ActivityDataManager.Instance.limitStlycActBonusState[response.BonusKey] = response.BonusStatus;
  189. }
  190. // int[][] bonus = ActivityLuckybonusCfgArray.Instance.GetCfgByidAndnum(response.ActivityId, response.BonusKey).bonusArr;
  191. BonusController.TryShowBonusList(ItemUtil.CreateItemDataList(response.BonusList));
  192. EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
  193. EventAgent.DispatchEvent(ConstMessage.LUCKY_BOX_ACTIVITY_REWARD);
  194. return true;
  195. }
  196. }
  197. return false;
  198. }
  199. /*************************************************************限时累充*****************************************************/
  200. // /// <summary>
  201. // /// 领取累充奖励
  202. // /// </summary>
  203. // /// <param name="activityId"></param>
  204. // /// <param name="bonusKey">奖励key,这里对应抽奖次数</param>
  205. // /// <returns></returns>
  206. // public static async ETTask<bool> ReqGetLimitChargeBonus(int activityId, int bonusKey)
  207. // {
  208. // S2C_GetTimeLimitLuckyBoxBonus response = null;
  209. // response = (S2C_GetTimeLimitLuckyBoxBonus)await MessageHelper.SendToServer(new C2S_GetTimeLimitLuckyBoxBonus() { ActivityId = activityId, BonusKey = bonusKey });
  210. // if (response != null)
  211. // {
  212. // if (response.Error == ErrorCode.ERR_Success)
  213. // {
  214. // if (ActivityDataManager.Instance.actLuckyBoxId != response.ActivityId)
  215. // {
  216. // return false;
  217. // }
  218. // ActivityDataManager.Instance.luckyBoxActBonusState[response.BonusKey] = response.BonusStatus;
  219. // int[][] bonus = ActivityLuckybonusCfgArray.Instance.GetCfgByidAndnum(response.ActivityId, response.BonusKey).bonusArr;
  220. // BonusController.TryShowBonusList(bonus);
  221. // return true;
  222. // }
  223. // }
  224. // return false;
  225. // }
  226. /*************************************************************活动弹窗*****************************************************/
  227. public static async ETTask<bool> ReqActivityTips(int type, int val)
  228. {
  229. S2C_UpLimitNumericValue response = null;
  230. response = (S2C_UpLimitNumericValue)await MessageHelper.SendToServer(new C2S_UpLimitNumericValue()
  231. { NumericType = type, NumericVal = val });
  232. if (response != null)
  233. {
  234. if (response.Error == ErrorCode.ERR_Success)
  235. {
  236. GameGlobal.myNumericComponent.Set(response.NumericType, response.NumericVal);
  237. return true;
  238. }
  239. }
  240. return false;
  241. }
  242. //招财进宝活动
  243. public static async ETTask<bool> ReqActivityZCJBInfo(int id = 5006)
  244. {
  245. int activityID = ActivityDataManager.Instance.GetCurOpenActiveByType(17);
  246. if (activityID != 0)
  247. {
  248. ActivityDataManager.Instance.activityZCJBId =
  249. CommonDataManager.Tables.TblActivityOpenCfg.GetOrDefault(activityID).Params1[0];
  250. }
  251. S2C_GetDressRewrdStatusList response = null;
  252. response = (S2C_GetDressRewrdStatusList)await MessageHelper.SendToServer(new C2S_GetDressRewrdStatusList()
  253. { ActivityId = activityID });
  254. if (response != null)
  255. {
  256. if (response.Error == ErrorCode.ERR_Success)
  257. {
  258. ActivityDataManager.Instance.ActivityZCJBList = response.RewrdIds;
  259. return true;
  260. }
  261. }
  262. return false;
  263. }
  264. public static async ETTask<bool> ReqActivityZCJBReward(int id, int rewardId)
  265. {
  266. S2C_GetDressRewrd response = null;
  267. response = (S2C_GetDressRewrd)await MessageHelper.SendToServer(new C2S_GetDressRewrd()
  268. { ActivityId = id, RewrdId = rewardId });
  269. if (response != null)
  270. {
  271. if (response.Error == ErrorCode.ERR_Success)
  272. {
  273. ActivityDataManager.Instance.ActivityZCJBList = response.RewrdIds;
  274. BonusController.TryShowBonusList(ItemUtil.CreateItemDataList(response.BonusList));
  275. return true;
  276. }
  277. }
  278. return false;
  279. }
  280. public static async ETTask SetOnceStatus(int k, long id, int type)
  281. {
  282. S2C_UpdateDataRecord response =
  283. (S2C_UpdateDataRecord)await MessageHelper.SendToServer(new C2S_UpdateDataRecord()
  284. { K = k, V = id, ResetType = type });
  285. }
  286. public static async ETTask<bool> GetOnceStatus(long k)
  287. {
  288. S2C_GetDataRecord response =
  289. (S2C_GetDataRecord)await MessageHelper.SendToServer(new C2S_GetDataRecord() { });
  290. for (int i = 0; i < response.AllKs.Count; i++)
  291. {
  292. if (response.AllKs[i] == k)
  293. {
  294. if (response.AllVs[i] == 1)
  295. {
  296. GameGlobal.AutoZCJBTips = false;
  297. return true;
  298. }
  299. else
  300. {
  301. GameGlobal.AutoZCJBTips = true;
  302. return true;
  303. }
  304. }
  305. }
  306. GameGlobal.AutoZCJBTips = true;
  307. return true;
  308. }
  309. /**********************************************************新年签到*************************************************/
  310. public static async ETTask<bool> ReqGetActivitySignInfos()
  311. {
  312. int activityId = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.ShenDuChenYou);
  313. var dd = CommonDataManager.Tables.TblActivitySignCfg.GetGroup1ByActivityId(activityId);
  314. int ddCount = dd?.Count ?? 0;
  315. if (activityId < 0 || ddCount <= 0)
  316. return false;
  317. S2C_GetActivitySignInfos response = null;
  318. response = (S2C_GetActivitySignInfos)await MessageHelper.SendToServer(new C2S_GetActivitySignInfos()
  319. { ActivityId = activityId });
  320. if (response != null)
  321. {
  322. if (response.Error == ErrorCode.ERR_Success)
  323. {
  324. ActivityDataManager.Instance.NewYearLoginInfoDic.Clear();
  325. for (int i = 0; i < response.ksDay.Count; i++)
  326. {
  327. ActivityDataManager.Instance.NewYearLoginInfoDic.Add(response.ksDay[i], response.vsStatus[i]);
  328. }
  329. return true;
  330. }
  331. }
  332. return false;
  333. }
  334. public static async ETTask<bool> ReqGetAcitivitySignBonus(int activityId, int day)
  335. {
  336. S2C_ReqGetAcitivitySignBonus response = null;
  337. response = (S2C_ReqGetAcitivitySignBonus)await MessageHelper.SendToServer(new C2S_ReqGetAcitivitySignBonus()
  338. { ActivityId = activityId, Day = day });
  339. if (response != null)
  340. {
  341. if (response.Error == ErrorCode.ERR_Success)
  342. {
  343. ActivityDataManager.Instance.NewYearLoginInfoDic[response.Day] = ConstBonusStatus.GOT;
  344. var rewards = CommonDataManager.Tables.TblActivitySignCfg.Get(activityId, response.Day)
  345. .Bonus;
  346. BonusController.TryShowBonusList(rewards.ToGfgGameItemParam());
  347. EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
  348. return true;
  349. }
  350. }
  351. return false;
  352. }
  353. //**************************新人礼包领取
  354. public static async ETTask<bool> ReqGetNewPlayerBonus()
  355. {
  356. S2C_GetNewcomerRewards response = null;
  357. response = (S2C_GetNewcomerRewards)await MessageHelper.SendToServer(new C2S_GetNewcomerRewards() { });
  358. if (response != null)
  359. {
  360. if (response.Error == ErrorCode.ERR_Success)
  361. {
  362. ActivityDataManager.Instance.IsGetNewPlayerReward = response.Status;
  363. BonusController.TryShowBonusList(ItemUtil.CreateItemDataList(response.BonusList));
  364. return true;
  365. }
  366. }
  367. return false;
  368. }
  369. //获取新人礼包状态
  370. public static async ETTask<bool> ReqGetNewPlayerBonusStatus()
  371. {
  372. S2C_GetNewcomerRewardStatus response = null;
  373. response = (S2C_GetNewcomerRewardStatus)await MessageHelper.SendToServer(new C2S_GetNewcomerRewardStatus()
  374. { });
  375. if (response != null)
  376. {
  377. if (response.Error == ErrorCode.ERR_Success)
  378. {
  379. ActivityDataManager.Instance.IsGetNewPlayerReward = response.Status;
  380. GameGlobal.AutoNewPlayersTips = response.OpenStatus;
  381. return true;
  382. }
  383. }
  384. return false;
  385. }
  386. public static async ETTask SetNewPlayerOnceStatus(long id)
  387. {
  388. S2C_UpdateDataRecord response =
  389. (S2C_UpdateDataRecord)await MessageHelper.SendToServer(
  390. new C2S_UpdateDataRecord() { K = 100001, V = id });
  391. }
  392. public static async ETTask<bool> GetNewPlayerOnceStatus()
  393. {
  394. S2C_GetDataRecord response =
  395. (S2C_GetDataRecord)await MessageHelper.SendToServer(new C2S_GetDataRecord() { });
  396. for (int i = 0; i < response.AllKs.Count; i++)
  397. {
  398. if (response.AllKs[i] == 100001)
  399. {
  400. if (response.AllVs[i] == 0)
  401. {
  402. GameGlobal.NewPlayerOnceTips = false;
  403. return true;
  404. }
  405. else
  406. {
  407. GameGlobal.NewPlayerOnceTips = true;
  408. return true;
  409. }
  410. }
  411. }
  412. GameGlobal.NewPlayerOnceTips = true;
  413. return true;
  414. }
  415. //弹窗状态设置
  416. public static async ETTask SetTipsStatus(long tips, long value, int type = 1)
  417. {
  418. S2C_UpdateDataRecord response =
  419. (S2C_UpdateDataRecord)await MessageHelper.SendToServer(new C2S_UpdateDataRecord()
  420. { K = tips, V = value, ResetType = type });
  421. }
  422. public static async ETTask GetTipsStatus()
  423. {
  424. S2C_GetDataRecord response =
  425. (S2C_GetDataRecord)await MessageHelper.SendToServer(new C2S_GetDataRecord() { });
  426. for (int i = 0; i < response.AllKs.Count; i++)
  427. {
  428. if (ActivityDataManager.Instance.TipsStatusDic.ContainsKey(response.AllKs[i]))
  429. {
  430. ActivityDataManager.Instance.TipsStatusDic[response.AllKs[i]] = response.AllVs[i];
  431. }
  432. else
  433. {
  434. ActivityDataManager.Instance.TipsStatusDic.Add(response.AllKs[i], response.AllVs[i]);
  435. }
  436. //
  437. }
  438. }
  439. //获取转盘活动信息
  440. public static async ETTask<bool> ReqGetTurnTableInfo()
  441. {
  442. S2C_GetWishingActivityInfo response = null;
  443. int id = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityDataManager.Instance
  444. .TurnTableActivityType);
  445. if (id == 0)
  446. {
  447. return false;
  448. }
  449. response = (S2C_GetWishingActivityInfo)await MessageHelper.SendToServer(new C2S_GetWishingActivityInfo()
  450. { AcitvityId = id });
  451. if (response != null)
  452. {
  453. if (response.Error == ErrorCode.ERR_Success)
  454. {
  455. ActivityDataManager.Instance.TurnRewardStateDic.Clear();
  456. ActivityDataManager.Instance.TurnTableTimes = response.SpecialTotalNum;
  457. ActivityDataManager.Instance.StartDropId = response.ExtraIdDropId;
  458. ActivityDataManager.Instance.TipsDropId = response.ExtraIdDropId;
  459. ActivityDataManager.Instance.GiftBagIdList = response.WishingBags;
  460. for (int i = 0; i < response.RewardIds.Count; i++)
  461. {
  462. ActivityDataManager.Instance.TurnRewardStateDic.Add(response.RewardIds[i],
  463. response.RewardStatus[i]);
  464. }
  465. return true;
  466. }
  467. }
  468. return false;
  469. }
  470. public static async ETTask<bool> ReqTurnTableWish(int wishType)
  471. {
  472. S2C_WishingLuckyBox response = null;
  473. int id = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityDataManager.Instance
  474. .TurnTableActivityType);
  475. response = (S2C_WishingLuckyBox)await MessageHelper.SendToServer(new C2S_WishingLuckyBox()
  476. { AcitvityId = id, WishingType = wishType });
  477. if (response != null)
  478. {
  479. if (response.Error == ErrorCode.ERR_Success)
  480. {
  481. ActivityDataManager.Instance.TurnRewardStateDic.Clear();
  482. ActivityDataManager.Instance.threeTurnResult.Clear();
  483. ActivityDataManager.Instance.TurnTableTimes = response.SpecialTotalNum;
  484. ActivityDataManager.Instance.TipsDropId = response.ExtraIdDropId;
  485. ActivityDataManager.Instance.GiftBagIdList = response.WishingBags;
  486. for (int i = 0; i < response.RewardIds.Count; i++)
  487. {
  488. ActivityDataManager.Instance.TurnRewardStateDic.Add(response.RewardIds[i],
  489. response.RewardStatus[i]);
  490. }
  491. if (response.RewardList.Count == 3)
  492. {
  493. ActivityDataManager.Instance.threeTurnResult.Add(0, response.RewardList);
  494. }
  495. else if (response.RewardList.Count == 9)
  496. {
  497. List<ItemInfoProto> infoOneList = new List<ItemInfoProto>();
  498. List<ItemInfoProto> infoTwoList = new List<ItemInfoProto>();
  499. List<ItemInfoProto> infoThreeList = new List<ItemInfoProto>();
  500. for (int i = 0; i < response.RewardList.Count; i++)
  501. {
  502. if (i < 3)
  503. {
  504. infoOneList.Add(response.RewardList[i]);
  505. }
  506. else if (i >= 3 && i < 6)
  507. {
  508. infoTwoList.Add(response.RewardList[i]);
  509. }
  510. else if (i >= 6)
  511. {
  512. infoThreeList.Add(response.RewardList[i]);
  513. }
  514. }
  515. ActivityDataManager.Instance.threeTurnResult.Add(0, infoOneList);
  516. ActivityDataManager.Instance.threeTurnResult.Add(1, infoTwoList);
  517. ActivityDataManager.Instance.threeTurnResult.Add(2, infoThreeList);
  518. }
  519. ActivityDataManager.Instance.TurnRewardList = response.RewardList;
  520. ActivityDataManager.Instance.TurnSpecialRewardList = response.SpecialRewardList;
  521. return true;
  522. }
  523. }
  524. return false;
  525. }
  526. //获取领取转盘奖励
  527. public static async ETTask<bool> ReqGetTurnTableReward(int rewardId)
  528. {
  529. S2C_GetWishingRewards response = null;
  530. response = (S2C_GetWishingRewards)await MessageHelper.SendToServer(new C2S_GetWishingRewards()
  531. { RewardId = rewardId });
  532. if (response != null)
  533. {
  534. if (response.Error == ErrorCode.ERR_Success)
  535. {
  536. ActivityDataManager.Instance.TurnRewardStateDic.Clear();
  537. for (int i = 0; i < response.RewardIds.Count; i++)
  538. {
  539. ActivityDataManager.Instance.TurnRewardStateDic.Add(response.RewardIds[i],
  540. response.RewardStatus[i]);
  541. }
  542. BonusController.TryShowBonusList(ItemUtil.CreateItemDataList(response.RewardList));
  543. EventAgent.DispatchEvent(ConstMessage.TurnTable_DateCHANGE);
  544. return true;
  545. }
  546. }
  547. return false;
  548. }
  549. }
  550. //新人活动开启状态推送
  551. public class NewPlayerOpenStatus : AMHandler<S2C_PushNewcomerRewardStatus>
  552. {
  553. protected override async ETTask Run(Session session, S2C_PushNewcomerRewardStatus message)
  554. {
  555. ActivityDataManager.Instance.IsGetNewPlayerReward = message.Status;
  556. GameGlobal.AutoNewPlayersTips = message.OpenStatus;
  557. await ETTask.CompletedTask;
  558. }
  559. }
  560. }