CommonSProxy.cs 3.7 KB

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