CommonSProxy.cs 3.6 KB

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