CmdCode.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <?php
  2. namespace loyalsoft;
  3. /**
  4. * 操作码常量定义:
  5. * @version 2023.8.31 修改约定: cmdcode前两位为opecode. 参数传递过程中不单独传输opecode了.
  6. * @author jgao,gwang,cyzhao
  7. */
  8. class CmdCode {
  9. //
  10. // <editor-fold defaultstate="collapsed" desc="支付操作码 - 88xx">
  11. /**
  12. * 领取首付礼包
  13. */
  14. const cmd_pay_getfirstpaygift = 8802;
  15. // <editor-fold defaultstate="collapsed" desc="移动支付">
  16. //---------- 移动端 支付API 操作码 ----
  17. /**
  18. * 【移动端】购买物品
  19. */
  20. const cmd_mpay_pay = 8807;
  21. /**
  22. * 【移动端】查询游戏币余额
  23. */
  24. const cmd_mpay_get_balance = 8808;
  25. /**
  26. * 【移动端】购买神秘商城物品
  27. */
  28. const cmd_mpay_buyDynamic = 8809;
  29. /**
  30. * 【移动端】刷新神秘商城物品
  31. */
  32. const cmd_mpay_getDynamic = 8810;
  33. /**
  34. * 【移动端】自助检查异常订单
  35. */
  36. const cmd_mpay_selfCheckOrders = 8811;
  37. /**
  38. * 【移动端】查询付费记录
  39. */
  40. const cmd_mpay_getPayRecords = 8812;
  41. /**
  42. * 临时--正式的要根据具体功能实现
  43. */
  44. const cmd_mpay_PayDeliverGoods = 8813;
  45. /**
  46. * 充值领取奖励
  47. */
  48. const cmd_mpay_UserRechargeDrawPrize = 8814;
  49. /**
  50. * 新的首冲功能
  51. */
  52. const cmd_mpay_NewFirstRecharge = 8815;
  53. //
  54. //
  55. // </editor-fold>
  56. //
  57. // </editor-fold>
  58. //
  59. // <editor-fold defaultstate="collapsed" desc="用户操作码 - 60xx">
  60. /**
  61. * 获取分区列表
  62. */
  63. const cmd_user_getzonelist = 6000;
  64. /**
  65. * 玩家登录指令/新玩家直接注册并登录
  66. */
  67. const cmd_user_loginuserinfo = 6001;
  68. /**
  69. * 常量信息指令
  70. */
  71. const cmd_user_gameconstinfo = 6002;
  72. /**
  73. *
  74. */
  75. const cmd_user_setAnimation = 6004;
  76. // </editor-fold>
  77. // <editor-fold defaultstate="collapsed" desc="活动操作码 - 61xx">
  78. const cmd_active_sign = 6101;
  79. // </editor-fold>
  80. // <editor-fold defaultstate="collapsed" desc="任务操作码 - 62xx">
  81. /**
  82. * [6201] 任务 - 拉取最新任务信息
  83. */
  84. const cmd_task_getInfo = 6201;
  85. /**
  86. * [6202] 任务 - 领取任务奖励
  87. */
  88. const cmd_task_getReward = 6202;
  89. // </editor-fold>
  90. // <editor-fold defaultstate="collapsed" desc="邮件操作码 - 63xx">
  91. const cmd_email_questEmailList = 6301;
  92. // </editor-fold>
  93. // <editor-fold defaultstate="collapsed" desc="背包操作码 - 64xx">
  94. const cmd_store_put = 6401;
  95. /**
  96. * 装备
  97. */
  98. const cmd_store_equip = 6402;
  99. /**
  100. * 卸下装备
  101. */
  102. const cmd_store_RemoveEquip = 6403;
  103. /**
  104. * 装备升级
  105. */
  106. const cmd_store_equipUpgrade = 6404;
  107. /**
  108. * 一键升级
  109. */
  110. const cmd_store_equipUpgrade_MaxLv = 6405;
  111. /**
  112. * 合成
  113. */
  114. const cmd_store_equipCompose = 6406;
  115. // </editor-fold>
  116. // <editor-fold defaultstate="collapsed" desc="商城操作码 - 65xx">
  117. /**
  118. * 商城购买东西
  119. */
  120. const cmd_shop_BuyGift = 6501;
  121. // </editor-fold>
  122. // <editor-fold defaultstate="collapsed" desc="英雄模块操作码 - 66xx">
  123. //
  124. /**
  125. * 切换英雄
  126. */
  127. const hero_swith = 6601;
  128. /**
  129. * 解锁英雄
  130. */
  131. const hero_unlock = 6602;
  132. //
  133. // </editor-fold>
  134. // <editor-fold defaultstate="collapsed" desc="战斗操作码 - 68xx">
  135. const cmd_fight_settle = 6801;
  136. /**
  137. * 章节宝箱的领取
  138. */
  139. const cmd_fight_PassGateTsPrizeReceive = 6802;
  140. /**
  141. * 关卡选择
  142. */
  143. const cmd_fight_selectGate = 6803;
  144. const cmd_fight_gateChallengePriceReviced = 6804;
  145. /**
  146. * 进化解锁
  147. */
  148. const cmd_fight_evolveUnlock = 6805;
  149. // </editor-fold>
  150. // <editor-fold defaultstate="collapsed" desc=" 反射方法 ">
  151. /**
  152. * 辅助方法, 将所有错误码信息转换到CSV文本中.
  153. * 用法: 先在本文件中用ctrl + H 全部替换掉 'c onst ' -> 's tatic $'
  154. * 然后再调用本方法,即可在同目录下生成ErrCode.txt, 里面包含了所需信息.
  155. * @throws \Exception
  156. * @author gwang
  157. */
  158. static function L() {
  159. $class = new \ReflectionClass(__CLASS__); # 建立这个类的反射对象
  160. $properties = $class->getProperties(\ReflectionProperty::IS_STATIC); # 拉取所有静态属性
  161. $fileName = __DIR__ . "/" . str_replace('\\', '.', __CLASS__) . ".txt"; # 输出文件名
  162. $fd = fopen($fileName, "w");
  163. if (false === $fd) { # 打开文件失败
  164. throw new \Exception("打开$fileName 失败");
  165. }
  166. foreach ($properties as &$p) {
  167. $d = preg_replace('/[\*|\/|\s+]/', '', $p->getDocComment()); # 处理下注释
  168. $type = (strpos($p->getName(), 'err') === false ? 0 : 1); # errorType: 0 继续, 1 重启
  169. $n = fputs($fd, $p->getName() . ";" . $p->getValue() . ";$type;$d" . PHP_EOL); # 写入文件
  170. if (false === $n) { # 写入时失败
  171. throw new Exception("写入$fileName 时失败");
  172. }
  173. }
  174. fclose($fd);
  175. }
  176. // </editor-fold>
  177. }