CmdCode.php 5.0 KB

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