123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260 |
- <?php
- namespace loyalsoft;
- /**
- * 操作码常量定义:
- * @version 2023.8.31 修改约定: cmdcode前两位为opecode. 参数传递过程中不单独传输opecode了.
- * @author jgao,gwang,cyzhao
- */
- class CmdCode {
- //
- // <editor-fold defaultstate="collapsed" desc="支付操作码 - 88xx">
- /**
- * 领取首付礼包
- */
- const cmd_pay_getfirstpaygift = 8802;
- // <editor-fold defaultstate="collapsed" desc="移动支付">
- //---------- 移动端 支付API 操作码 ----
- /**
- * 【移动端】购买物品
- */
- const cmd_mpay_pay = 8807;
- /**
- * 【移动端】查询游戏币余额
- */
- const cmd_mpay_get_balance = 8808;
- /**
- * 【移动端】购买神秘商城物品
- */
- const cmd_mpay_buyDynamic = 8809;
- /**
- * 【移动端】刷新神秘商城物品
- */
- const cmd_mpay_getDynamic = 8810;
- /**
- * 【移动端】自助检查异常订单
- */
- const cmd_mpay_selfCheckOrders = 8811;
- /**
- * 【移动端】查询付费记录
- */
- const cmd_mpay_getPayRecords = 8812;
- /**
- * 临时--正式的要根据具体功能实现
- */
- const cmd_mpay_PayDeliverGoods = 8813;
- /**
- * 充值领取奖励
- */
- const cmd_mpay_UserRechargeDrawPrize = 8814;
- /**
- * 新的首冲功能
- */
- const cmd_mpay_NewFirstRecharge = 8815;
- //
- //
- // </editor-fold>
- //
- // </editor-fold>
- //
- // <editor-fold defaultstate="collapsed" desc="用户操作码 - 60xx">
- /**
- * 获取分区列表
- */
- const cmd_user_getzonelist = 6000;
- /**
- * 玩家登录指令/新玩家直接注册并登录
- */
- const cmd_user_loginuserinfo = 6001;
- /**
- * 常量信息指令
- */
- const cmd_user_gameconstinfo = 6002;
- /**
- * 走完片头后给值 1
- */
- const cmd_user_setAnimation = 6004;
- // </editor-fold>
- // <editor-fold defaultstate="collapsed" desc="活动操作码 - 61xx">
- /**
- * 7日奖励领取
- */
- const active_day7_drawreward = 6101;
-
- /**
- * 7日累充奖励领取
- */
- const active_day7_accumulateDrawreward = 6102;
- // </editor-fold>
- // <editor-fold defaultstate="collapsed" desc="任务操作码 - 62xx">
- /**
- * [6201] 任务 - 拉取最新任务信息
- */
- const cmd_task_getInfo = 6201;
- /**
- * [6202] 任务 - 领取任务奖励
- */
- const cmd_task_getReward = 6202;
-
- /**
- * 领取成就奖励
- */
- const cmd_task_getAchieveReward = 6203;
-
- // <editor-fold defaultstate="collapsed" desc="邮件操作码 - 63xx">
- const cmd_email_questEmailList = 6301;
- // </editor-fold>
- // <editor-fold defaultstate="collapsed" desc="背包操作码 - 64xx">
- const cmd_store_put = 6401;
- /**
- * 装备
- */
- const cmd_store_equip = 6402;
- /**
- * 卸下装备
- */
- const cmd_store_RemoveEquip = 6403;
- /**
- * 装备升级
- */
- const cmd_store_equipUpgrade = 6404;
- /**
- * 一键升级
- */
- const cmd_store_equipUpgrade_MaxLv = 6405;
- /**
- * 合成
- */
- const cmd_store_equipCompose = 6406;
-
- /**
- * 消耗体力
- */
- const store_comsumeTili = 6407;
-
- /**
- * 装备降级
- */
- const store_equip_fallLevel = 6408;
-
- /**
- * 装备降品
- */
- const store_equip_fallQual = 6409;
- // </editor-fold>
- // <editor-fold defaultstate="collapsed" desc="商城操作码 - 65xx">
- /**
- * 商城购买东西
- */
- const cmd_shop_BuyGift = 6501;
- // </editor-fold>
- // <editor-fold defaultstate="collapsed" desc="英雄模块操作码 - 66xx">
- //
- /**
- * 切换英雄
- */
- const hero_swith = 6601;
- /**
- * 解锁英雄
- */
- const hero_unlock = 6602;
- //
- // </editor-fold>
- // <editor-fold defaultstate="collapsed" desc="战斗操作码 - 68xx">
- const cmd_fight_settle = 6801;
- /**
- * 章节宝箱的领取
- */
- const cmd_fight_PassGateTsPrizeReceive = 6802;
- /**
- * 关卡选择
- */
- const cmd_fight_selectGate = 6803;
- const cmd_fight_gateChallengePriceReviced = 6804;
- /**
- * 进化解锁
- */
- const cmd_fight_evolveUnlock = 6805;
- /**
- *
- */
- const cmd_fight_plotSav = 6806;
- /**
- * 巡逻
- */
- const cmd_fight_xunluoPrizeReceived = 6807;
- /**
- * 开始挑战
- */
- const fight_startFight = 6808;
- // </editor-fold>
- // <editor-fold defaultstate="collapsed" desc=" 反射方法 ">
- /**
- * 辅助方法, 将所有错误码信息转换到CSV文本中.
- * 用法: 先在本文件中用ctrl + H 全部替换掉 'c onst ' -> 's tatic $'
- * 然后再调用本方法,即可在同目录下生成ErrCode.txt, 里面包含了所需信息.
- * @throws \Exception
- * @author gwang
- */
- static function L() {
- $class = new \ReflectionClass(__CLASS__); # 建立这个类的反射对象
- $properties = $class->getProperties(\ReflectionProperty::IS_STATIC); # 拉取所有静态属性
- $fileName = __DIR__ . "/" . str_replace('\\', '.', __CLASS__) . ".txt"; # 输出文件名
- $fd = fopen($fileName, "w");
- if (false === $fd) { # 打开文件失败
- throw new \Exception("打开$fileName 失败");
- }
- foreach ($properties as &$p) {
- $d = preg_replace('/[\*|\/|\s+]/', '', $p->getDocComment()); # 处理下注释
- $type = (strpos($p->getName(), 'err') === false ? 0 : 1); # errorType: 0 继续, 1 重启
- $n = fputs($fd, $p->getName() . ";" . $p->getValue() . ";$type;$d" . PHP_EOL); # 写入文件
- if (false === $n) { # 写入时失败
- throw new Exception("写入$fileName 时失败");
- }
- }
- fclose($fd);
- }
- // </editor-fold>
- }
|