EventProc.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?php
  2. //
  3. //namespace loyalsoft;
  4. //
  5. ///**
  6. // * 事件模块.
  7. // * @version
  8. // * 1.0.0 Created at 2017-8-28. by --gwang
  9. // * @author gwang (mail@wanggangzero.cn)
  10. // * @copyright ? 2017-8-28, SJZ LoyalSoft Corporation & gwang. All rights reserved.
  11. // */
  12. //class EventProc {
  13. //
  14. // public static function procMain() {
  15. // switch (req()->cmd) {
  16. // case CmdCode::cmd_event_GetNotifications: # 7201 拉取角标通知列表
  17. // return self::GetCornerSignNotifications();
  18. // case CmdCode::cmd_event_ClearNotifications: # 7202 清理指定类型的角标
  19. // return self::ClearCornerSignNotification();
  20. // default:
  21. // return Resp::err(ErrCode::cmd_err);
  22. // }
  23. // }
  24. //
  25. // /**
  26. // * [7202] 清理指定类型的角标记录
  27. // */
  28. // static function ClearCornerSignNotification() {
  29. // $ctype = req()->paras[0];
  30. // $e = new OperateEventType();
  31. // if ($e->isValidValue($ctype)) {
  32. // StlUtil::arrayRemove(ctx()->privateData()->cornerSignNotifications, $ctype); # 移除角标
  33. // UserProc::updateUserInfo();
  34. // }
  35. // $arr = array_values(array_unique(ctx()->privateData()->cornerSignNotifications)); # 返回值去重
  36. // ctx()->privateData()->cornerSignNotifications = $arr; # 更新记录
  37. // return Resp::ok(array("notifications" => $arr)); # 返回
  38. // }
  39. //
  40. // /**
  41. // * [7201] 拉取角标通知
  42. // */
  43. // static function GetCornerSignNotifications() {
  44. // // 这里直接返回, 将来开发对应的触发逻辑, 给数组中添加相应的值
  45. // $arr = array_values(array_unique(ctx()->privateData()->cornerSignNotifications)); # 返回值去重
  46. // ctx()->privateData()->cornerSignNotifications = $arr; # 更新记录
  47. // UserProc::updateUserInfo();
  48. // return Resp::ok(array("notifications" => $arr)); # 返回
  49. // }
  50. //
  51. // static function Init() {
  52. // Event::register('onpay', array(new Data_UserProfile(ctx()->profile), "OnPay"));
  53. // }
  54. //
  55. // /**
  56. // * 收到请求
  57. // */
  58. // static function OnRequest() {
  59. //
  60. // }
  61. //
  62. // /**
  63. // * 处理完毕准备返回
  64. // */
  65. // static function AfterResponse() {
  66. //
  67. // }
  68. //
  69. // /**
  70. // * 当天第一次登录
  71. // */
  72. // static function OnNewDay() {
  73. // CornerSignEventProc::OnNewDay();
  74. // }
  75. //
  76. // /**
  77. // * 当周第一次登录(周一)
  78. // */
  79. // static function OnNewWeek() {
  80. //
  81. // }
  82. //
  83. // /**
  84. // * 当玩家等级变更
  85. // * @param type $old
  86. // * @param type $new
  87. // */
  88. // static function OnUserLevelup($old, $new) {
  89. // // 处理逻辑,
  90. // $ubs = ctx()->privateData()->unlockedBuild;
  91. // foreach (GameConfig::build() as $id => $b) {
  92. // isEditor() and $b = new \sm_build();
  93. // if (!in_array($id, $ubs)) { # 尚未解锁的建筑,判断,已解锁的跳过
  94. // if ($b->playerLevelLimit <= $new) { # 符合解锁条件
  95. // ctx()->privateData()->unlockedBuild[] = $id; # 插入解锁记录
  96. // StatisticsProc::TargetStatistics(Enum_TargetStatistics::unlockbuidId, $id);
  97. // if ($id == 1000) {
  98. // $college = new Info_College();
  99. // $college->setFunUnluckTs();
  100. // }
  101. // StatisticsProc::unlockBuild($id); # 统计全服玩家解锁建筑
  102. // NormalEventProc::OnUnlockBuild($id, null); # 插入事件
  103. // }
  104. // }
  105. // }
  106. //
  107. //
  108. //
  109. // NormalEventProc::OnUserLvlUp($old, $new); # 添加升级事件,算了这个暂时没人关注
  110. // }
  111. //}