CommonSProxy.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using ET;
  2. using GFGGame;
  3. using GFGGame.Launcher;
  4. namespace ET
  5. {
  6. public class M2C_NoticeUnitNumericHandler : AMHandler<M2C_NoticeUnitNumeric>
  7. {
  8. protected override async ETTask Run(Session session, M2C_NoticeUnitNumeric message)
  9. {
  10. if (GameGlobal.myNumericComponent == null) return;//如果为空表示角色还没有进入游戏,忽略
  11. var oldValue = GameGlobal.myNumericComponent.GetAsInt(message.NumericType);
  12. GameGlobal.myNumericComponent.Set(message.NumericType, message.NewValue);
  13. switch (message.NumericType)
  14. {
  15. case NumericType.Lvl:
  16. FunctionOpenDataManager.Instance.CheckHasLvFunOpen((int)message.NewValue,
  17. oldValue); //等级变化要加测是否有功能开启
  18. RoleDataManager.RoleLvUp(oldValue);
  19. QDManager.PushRoleAction(DouYouRoleLogReportType.LevelUp);
  20. break;
  21. case NumericType.Power:
  22. RoleDataManager.powerTimeServerLock = false;
  23. break;
  24. case NumericType.DailyLiveness:
  25. case NumericType.WeeklyLiveness:
  26. EventAgent.DispatchEvent(ConstMessage.LIVENESS_CHANGE);
  27. break;
  28. case NumericType.PassLevel:
  29. EventAgent.DispatchEvent(ConstMessage.BATTLEPASS_LEVEL_CHANGE);
  30. break;
  31. }
  32. EventAgent.DispatchEvent(ConstMessage.NUMERIC_CHANGE, message.NumericType);
  33. EventAgent.DispatchEvent(ConstMessage.RED_CHANGE, message.NumericType);
  34. await ETTask.CompletedTask;
  35. }
  36. }
  37. }
  38. namespace GFGGame
  39. {
  40. public static class CommonSProxy
  41. {
  42. //客户端请求每日重置
  43. public static async ETTask ResetDailyData()
  44. {
  45. M2C_ResetDailyData response = null;
  46. response = (M2C_ResetDailyData)await MessageHelper.SendToServer(new C2M_ResetDailyData());
  47. if (response != null)
  48. {
  49. if (response.Error == ErrorCode.ERR_Success)
  50. {
  51. // RechargeSProxy.ReqRequestGiftBagInfo().Coroutine();
  52. // RechargeSProxy.ReqExchangeInfo().Coroutine();
  53. ShopSProxy.ReqShopInfo().Coroutine();
  54. DailyTaskSProxy.ReqDailyTaskInfos().Coroutine();
  55. SuitFosterProxy.SendGetSuitInfos().Coroutine();
  56. FieldSProxy.ReqFieldInstanceInfos().Coroutine();
  57. ArenaSproxy.ReqArenaInfos().Coroutine();
  58. EnduringGiftBoxSProxy.ReqGetAllGiftBagRebateStatus().Coroutine();
  59. LuckyBoxSProxy.ReqGetLuckyBoxRotatingInfo().Coroutine();
  60. RoleLimitSProxy.ReqUnitLimitInfos().Coroutine();
  61. await ActivitySProxy.ReqSevenDayLoginInfos();
  62. await ActivityGlobalSProxy.GetActivityInfo();
  63. await ActivityAfuGiftSProxy.GetAfuGiftInfo();
  64. await ActivityAfuGiftSProxy.GetSummerGiftInfo();
  65. await ActivityTeaSProxy.ReqGetNPCVisitInfo();
  66. await MiniGameProxy.ReqGetChallengeReward();
  67. ActivitySProxy.ReqGetActivitySignInfos().Coroutine();
  68. await NewYearRedEnvelopeSProxy.ReqGetRedPacketInfo();
  69. await ActivityGetYuanXiaoProxy.ReqGetActivityGameInfos();
  70. await ActivityFYJYProxy.ReqGetActivityGameInfos();
  71. await MatchingCompetitionSproxy.ReqMatchingCompetitionInfo();
  72. ActivityDataManager.Instance.todayActivityTips = GameGlobal.myNumericComponent.GetAsInt(NumericType.IsPropYchmActivity);
  73. ActivityDataManager.Instance.todayMonthlyCardTips = GameGlobal.myNumericComponent.GetAsInt(NumericType.IsPropCzykActivity);
  74. EventAgent.DispatchEvent(ConstMessage.RESET_DAILY_DATA);
  75. PromptController.Instance.ShowFloatTextPrompt("每日次数已重置", MessageType.SUCCESS);
  76. }
  77. }
  78. }
  79. }
  80. }