ActivitySProxy.cs 26 KB

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