CommonSProxy.cs 4.0 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. break;
  20. case NumericType.Power:
  21. RoleDataManager.powerTimeServerLock = false;
  22. break;
  23. case NumericType.DailyLiveness:
  24. case NumericType.WeeklyLiveness:
  25. EventAgent.DispatchEvent(ConstMessage.LIVENESS_CHANGE);
  26. break;
  27. case NumericType.PassLevel:
  28. EventAgent.DispatchEvent(ConstMessage.BATTLEPASS_LEVEL_CHANGE);
  29. break;
  30. }
  31. EventAgent.DispatchEvent(ConstMessage.NUMERIC_CHANGE, message.NumericType);
  32. EventAgent.DispatchEvent(ConstMessage.RED_CHANGE, message.NumericType);
  33. await ETTask.CompletedTask;
  34. }
  35. }
  36. }
  37. namespace GFGGame
  38. {
  39. public static class CommonSProxy
  40. {
  41. //客户端请求每日重置
  42. public static async ETTask ResetDailyData()
  43. {
  44. M2C_ResetDailyData response = null;
  45. response = (M2C_ResetDailyData)await MessageHelper.SendToServer(new C2M_ResetDailyData());
  46. if (response != null)
  47. {
  48. if (response.Error == ErrorCode.ERR_Success)
  49. {
  50. // RechargeSProxy.ReqRequestGiftBagInfo().Coroutine();
  51. // RechargeSProxy.ReqExchangeInfo().Coroutine();
  52. ShopSProxy.ReqShopInfo().Coroutine();
  53. DailyTaskSProxy.ReqDailyTaskInfos().Coroutine();
  54. SuitFosterProxy.SendGetSuitInfos().Coroutine();
  55. FieldSProxy.ReqFieldInstanceInfos().Coroutine();
  56. ArenaSproxy.ReqArenaInfos().Coroutine();
  57. FieldWorkSproxy.ReqFieldWorkInfos().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. }