CmdCode.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878
  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_buygoods = 8801;
  14. /**
  15. * 领取首付礼包
  16. */
  17. const cmd_pay_getfirstpaygift = 8802;
  18. /**
  19. * 领取黄钻新手礼包
  20. */
  21. const cmd_pay_getvipnewergift = 8803;
  22. /**
  23. * 领取黄钻每日礼包
  24. */
  25. const cmd_pay_getvipdaygift = 8804;
  26. /**
  27. * 领取开通包月礼包
  28. */
  29. const cmd_pay_getvipopengift = 8805;
  30. /**
  31. * 客户端确认支付发货
  32. */
  33. const cmd_pay_confirmdelivery = 8806;
  34. // <editor-fold defaultstate="collapsed" desc="移动支付">
  35. //---------- 移动端 支付API 操作码 ----
  36. /**
  37. * 【移动端】购买物品
  38. */
  39. const cmd_mpay_pay = 8807;
  40. /**
  41. * 【移动端】查询游戏币余额
  42. */
  43. const cmd_mpay_get_balance = 8808;
  44. /**
  45. * 【移动端】购买神秘商城物品
  46. */
  47. const cmd_mpay_buyDynamic = 8809;
  48. /**
  49. * 【移动端】刷新神秘商城物品
  50. */
  51. const cmd_mpay_getDynamic = 8810;
  52. /**
  53. * 【移动端】自助检查异常订单
  54. */
  55. const cmd_mpay_selfCheckOrders = 8811;
  56. /**
  57. * 【移动端】查询付费记录
  58. */
  59. const cmd_mpay_getPayRecords = 8812;
  60. //
  61. //
  62. // </editor-fold>
  63. //
  64. // </editor-fold>
  65. //
  66. // <editor-fold defaultstate="collapsed" desc="用户操作码 - 60xx">
  67. /**
  68. * 获取分区列表
  69. */
  70. const cmd_user_getzonelist = 6000;
  71. /**
  72. * 玩家登录指令
  73. */
  74. const cmd_user_loginuserinfo = 6001;
  75. /**
  76. * 常量信息指令
  77. */
  78. const cmd_user_gameconstinfo = 6002;
  79. /**
  80. * 获取连续登录奖励
  81. */
  82. const cmd_user_acceptcontidaysgift = 6003;
  83. /**
  84. * 更新玩家新手引导的进度
  85. */
  86. const cmd_user_registerNewUID = 6004;
  87. /**
  88. * 【测试】机器码登录
  89. */
  90. const cmd_user_testUserLogin = 6005;
  91. /**
  92. * 注册新用户
  93. */
  94. const cmd_user_registerNewRole = 6006;
  95. /**
  96. * 完成新手引导
  97. */
  98. const cmd_user_completeNewbieGuide = 6007;
  99. /**
  100. * [6008] 设置/修改玩家昵称
  101. */
  102. const cmd_user_setNickname = 6008;
  103. /**
  104. * [6009] 发放新手引导所需卡牌
  105. */
  106. const cmd_user_setNewbieGuideCards = 6009;
  107. /** [6010]
  108. * 修改头像框
  109. */
  110. const cmd_user_SetUserImageBorder = 6010;
  111. /** [6011]
  112. * 新手引导——设置结束标志位
  113. */
  114. const cmd_user_setNewbieGuideOver = 6011;
  115. // </editor-fold>
  116. //
  117. // <editor-fold defaultstate="collapsed" desc="好友操作码 - 61xx">
  118. /**
  119. * [6101]申请好友
  120. */
  121. const cmd_user_friend_apply = 6101;
  122. /**
  123. * [6102]同意成为好友
  124. */
  125. const cmd_user_friend_accept = 6102;
  126. /**
  127. * [6103]拒绝好友申请->?这里需不需要通知被拒绝人?
  128. */
  129. const cmd_user_friend_deny = 6103;
  130. /**
  131. * [6104]解除好友关系
  132. */
  133. const cmd_user_friend_remove = 6104;
  134. /**
  135. * [6105]拉取好友请求列表
  136. */
  137. const cmd_user_friend_getapplylist = 6105;
  138. // --------- 好友列表 -------------
  139. /**
  140. * [6106] 拉取好友列表
  141. */
  142. const cmd_user_friend_get_list = 6106;
  143. /**
  144. * [6107] 拉取好友详细信息(分批次)
  145. */
  146. const cmd_user_friend_get_infos = 6107;
  147. //----------消息--------------------
  148. /**
  149. * [6108] 给好友发送消息
  150. */
  151. const cmd_user_friend_leave_message = 6108;
  152. /**
  153. * [6109] 拉取最新好友消息
  154. */
  155. const cmd_user_friend_get_message = 6109;
  156. //------------查找----------------------
  157. /**
  158. * [6110]搜索好友
  159. */
  160. const cmd_user_friend_search = 6110;
  161. /**
  162. * [6111]系统推荐好友列表(添加好友面板适用)
  163. */
  164. const cmd_user_friend_suggestList = 6111;
  165. // ---------------刷新--------------------
  166. /**
  167. * [6112] 重新载入好友模块(刷新好友模块,该删除的删除,该添加的添加)
  168. */
  169. const cmd_user_friend_reload = 6112;
  170. /**
  171. * [6113] 拉取好友向我赠送礼物的记录
  172. */
  173. const cmd_user_friend_gift_getlist = 6113;
  174. /**
  175. * [6114] 领取礼物
  176. */
  177. const cmd_user_friend_gift_redraw = 6114;
  178. /**
  179. * [6115]向好友示好(如浇水,送花之类的表现)
  180. */
  181. const cmd_user_friend_gift_send = 6115;
  182. /**
  183. * [6116]请求查看玩家是否有未读信息
  184. */
  185. const cmd_user_friend_unduckmsg = 6116;
  186. /**
  187. * [6117]请求查看玩家公会信息
  188. */
  189. const cmd_user_friend_LookGuildInfo = 6117;
  190. /**
  191. * [6118]请求查看玩家简介
  192. */
  193. const cmd_user_friend_LookFriendInfo = 6118;
  194. // </editor-fold>
  195. //
  196. // <editor-fold defaultstate="collapsed" desc="英雄操作码 - 63xx">
  197. /**
  198. * 英雄 - 升级
  199. * ::= 消耗金币和碎片进行升级
  200. */
  201. const cmd_hero_levelup = 6301;
  202. /**
  203. * 英雄 - 加上装备
  204. */
  205. const cmd_hero_equip = 6302;
  206. /**
  207. * 英雄 - 卸下装备
  208. */
  209. const cmd_hero_unequip = 6303;
  210. /**
  211. * 英雄 - 升阶 :: 消耗碎片
  212. */
  213. const cmd_hero_stageup = 6304;
  214. /**
  215. * 英雄- 升星
  216. */
  217. const cmd_hero_upstar = 6305;
  218. /**
  219. * 英雄- 更改锁定状态
  220. */
  221. const cmd_hero_changelockstate = 6306;
  222. /**
  223. * 英雄- 更改好友支援状态
  224. */
  225. const cmd_hero_changefirendbackup = 6307;
  226. /**
  227. * 英雄---获得 一个英雄
  228. */
  229. const cmd_hero_gethero = 6308;
  230. /**
  231. * 英雄的突破升级
  232. */
  233. const cmd_hero_strength = 6309;
  234. /**
  235. * 英雄的解锁好感度
  236. */
  237. const cmd_hero_openFavor = 6310;
  238. /**
  239. * 英雄的分解获得好感度晶石
  240. */
  241. const cmd_hero_separate = 6311;
  242. /**
  243. * 购买玩家可以收集的英雄的数量上限
  244. */
  245. const cmd_hero_buyCollectHeroLimtCount = 6312;
  246. /**
  247. * 更改好友支援
  248. */
  249. const cmd_hero_changefriendsupport = 6313;
  250. /**
  251. * 英雄的技能升级
  252. */
  253. const cmd_hero_upgradeSkillLevel = 6314;
  254. /**
  255. * 存储队伍配置
  256. */
  257. const cmd_hero_saveHeroTeamConfig = 6315;
  258. /**
  259. * 拉取英雄评论列表
  260. */
  261. const cmd_hero_GetDiscuss = 6316;
  262. /**
  263. * 对英雄发表评论
  264. */
  265. const cmd_hero_PostDiscuss = 6317;
  266. /**
  267. * 给某条评论点赞
  268. */
  269. const cmd_hero_PraiseDiscuss = 6318;
  270. /**
  271. * 删除对某个英雄的评论
  272. */
  273. const cmd_hero_DeleteDiscuss = 6319;
  274. /**
  275. * 给某个英雄打分
  276. */
  277. const cmd_hero_scoreit = 6320;
  278. /**
  279. * 购买英雄
  280. */
  281. const cmd_hero_buyHero = 6321;
  282. /**
  283. * 英雄神血升级
  284. */
  285. const cmd_hero_upGodBlood = 6322;
  286. /**
  287. * 英雄碎片 先解锁 再购买
  288. */
  289. const cmd_hero_unlockByPieces = 6323;
  290. /**
  291. * 英雄技能 - 解锁技能
  292. */
  293. const cmd_hero_unlockSkill = 6324;
  294. /**
  295. * 英雄技能 - 一键升级
  296. */
  297. const cmd_hero_skillLevel_onekeyupgrade = 6325;
  298. // </editor-fold>
  299. //
  300. // <editor-fold defaultstate="collapsed" desc="仓库操作码 - 64xx">
  301. /**
  302. * 放入仓库
  303. */
  304. const cmd_store_put = 6401;
  305. /**
  306. * 卖出单个物品
  307. */
  308. const cmd_store_singleSell = 6402;
  309. /**
  310. * 从背包批量卖出物品
  311. */
  312. const cmd_store_mutliSell = 6403;
  313. /**
  314. * 使用物品
  315. */
  316. const cmd_store_use = 6404;
  317. /**
  318. * 刷新仓库
  319. */
  320. const cmd_store_refresh = 6405;
  321. /**
  322. * 分解道具
  323. */
  324. const cmd_store_decomposeItem = 6406;
  325. /**
  326. * 测试用的命令
  327. */
  328. const cmd_store_Testcmd = 6407;
  329. /**
  330. * 升级某个装备
  331. */
  332. const cmd_store_ItemUpgrade = 6408;
  333. /**
  334. * 宝石合成
  335. */
  336. const cmd_store_GemCompose = 6409;
  337. /**
  338. * 英雄穿装备
  339. */
  340. const cmd_store_WearEquip = 6410;
  341. /**
  342. * 英雄脱装备
  343. */
  344. const cmd_store_UnWield = 6411;
  345. /**
  346. * 购买增加物品栏格子数
  347. */
  348. const cmd_store_AddMaxPacketNum = 6412;
  349. /**
  350. * 装备熔炼
  351. */
  352. const cmd_store_MeltEquip = 6413;
  353. /* * *
  354. * 碎片合成
  355. */
  356. const cmd_store_PiecesCompose = 6415;
  357. // </editor-fold>
  358. //
  359. // <editor-fold defaultstate="collapsed" desc="活动操作码 - 65xx">
  360. /**
  361. * 开服七日活动 - 刷新任务列表
  362. */
  363. const active_day7_gettasklist = 6500;
  364. /**
  365. * 开服7日活动 - 完成任务
  366. */
  367. const active_day7_completetask = 6501;
  368. /**
  369. * 开服七日活动 - 领取奖励
  370. */
  371. const active_day7_drawreward = 6502;
  372. /**
  373. * 查询开服时间
  374. */
  375. const active_getzonePublicTs = 6503;
  376. /**
  377. * 普通任务 - 完成任务
  378. */
  379. const Task_completetask = 6506;
  380. /**
  381. * 普通任务 - 领取奖励
  382. */
  383. const Task_drawreward = 6507;
  384. /**
  385. * 领取体力,间隔领取体力
  386. */
  387. const Task_Tili = 6508;
  388. /**
  389. * 活动 - 抽奖
  390. */
  391. const lottery = 6509;
  392. /**
  393. * 新手引导 - 活动-抽奖
  394. */
  395. const lottery_demo = 6510;
  396. /**
  397. * 活动 - 抽奖 领取保底奖励
  398. */
  399. const lottery_baodi = 6511;
  400. /**
  401. * 活动 - 凭兑换码领取礼包
  402. */
  403. const active_token_drawReward = 6512;
  404. /**
  405. * 活动 - 领取在线礼包
  406. */
  407. const active_draw_onlinegift = 6513;
  408. /**
  409. * 活动 - 领取全服注册礼包
  410. */
  411. const active_draw_reggift = 6514;
  412. /**
  413. * 活动 - 领取在线赠送体力
  414. */
  415. const active_presentTili = 6515;
  416. /**
  417. * 活动 - 查询当前全服注册人数
  418. */
  419. const active_get_regnum = 6516;
  420. /**
  421. * 开宝箱-减少冷却时间
  422. */
  423. const box_SubCoolDown = 6517;
  424. // </editor-fold>
  425. //
  426. // <editor-fold defaultstate="collapsed" desc="战斗操作码 - 68xx">
  427. /**
  428. * 关卡战斗
  429. */
  430. const cmd_fight_arenasfight = 6801;
  431. /**
  432. * 关卡扫荡
  433. */
  434. const cmd_fight_arenassweep = 6802;
  435. /**
  436. * 获得星星奖励
  437. */
  438. const cmd_fight_GetArenasStarReward = 6803;
  439. /**
  440. * 扣除买buffer的费用
  441. */
  442. const cmd_fight_ConsumeBufferGold = 6804;
  443. /**
  444. * 查询已经借用过的好友
  445. */
  446. const cmd_fight_GetborrowedFriend = 6805;
  447. /**
  448. * 扣除借用好友的费用
  449. */
  450. const cmd_fight_BorrowFriend = 6806;
  451. /**
  452. * 挑战无尽模式
  453. */
  454. const cmd_fight_ChallengeEndlessFightMode = 6807;
  455. /**
  456. * 开启副本
  457. */
  458. const cmd_fight_OpenCarbon = 6808;
  459. /**
  460. * 挑战副本
  461. */
  462. const cmd_fight_ChallengeCarbon = 6809;
  463. //
  464. // <editor-fold defaultstate="collapsed" desc=" PVP 挑战 ">
  465. //
  466. /**
  467. * pvp 主界面信息
  468. */
  469. const cmd_fight_pvp_maininfo = 6810;
  470. /**
  471. * pvp 挑战xx.
  472. */
  473. const cmd_fight_pvp_pk = 6811;
  474. /**
  475. * pvp 刷新对手列表
  476. */
  477. const cmd_fight_pvp_refresh = 6812;
  478. /**
  479. * pvp 体力充值
  480. */
  481. const cmd_fight_pvp_chargetili = 6813;
  482. /**
  483. * pvp 拉取前100名榜单
  484. */
  485. const cmd_fight_pvp_getrank = 6814;
  486. /**
  487. * pvp 拉取蝉联信息
  488. */
  489. const fight_pvp_getChanlianInfo = 6819;
  490. /**
  491. * pvp 领取活跃奖励
  492. */
  493. const cmd_fight_pvp_drawactivereward = 6815;
  494. /**
  495. * 剧情关卡_ 挑战关卡
  496. */
  497. const cmd_fight_Challenge_StoryGate = 6816;
  498. /**
  499. * 新版地图 挑战关卡
  500. */
  501. const cmd_new_arenas_fight = 6817;
  502. /**
  503. * 新版地图 挑战关卡
  504. */
  505. const cmd_new_arenas_changeStayCity = 6818;
  506. // const cmd_fight_pvp_shop...
  507. //
  508. // </editor-fold>
  509. //
  510. // </editor-fold>
  511. //
  512. // <editor-fold defaultstate="collapsed" desc="系统操作码 - 69xx">
  513. /**
  514. * 获取系统消息列表
  515. */
  516. const cmd_system_getsysmessage = 6901;
  517. /**
  518. * 系统日志上报
  519. */
  520. const cmd_system_logreport = 6902;
  521. /**
  522. * 客户端心跳包
  523. */
  524. const cmd_system_clienttick = 6903;
  525. /**
  526. * 玩家发送系统消息
  527. */
  528. const cmd_system_userSendsysmessage = 6904;
  529. // </editor-fold>
  530. //
  531. // <editor-fold defaultstate="collapsed" desc="邮件操作码 - 67xx开始(ope)">
  532. /**
  533. * [6701]获取邮件列表
  534. */
  535. const cmd_email_questEmailList = 6701;
  536. /**
  537. * [6702]读取/领取一封邮件
  538. */
  539. const cmd_email_readAllEmail = 6702;
  540. /**
  541. * [6703]删除邮件
  542. */
  543. const cmd_email_delMmail = 6703;
  544. /**
  545. * [6704] 测试-插入一封邮件
  546. */
  547. const cmd_email_test = 6704;
  548. /**
  549. * [6705] 删除邮件——没有条件的
  550. */
  551. const cmd_mail_delMmailAnyConditions = 6705;
  552. /**
  553. * 6706 请求邮件未处理的数量
  554. */
  555. const cmd_mail_notReadMailNum = 6706;
  556. // const
  557. // </editor-fold>
  558. //
  559. // <editor-fold defaultstate="collapsed" desc="公会操作码 - 70xx开始(ope)">
  560. /**
  561. * 【会员】查询自己的公会信息
  562. */
  563. const cmd_guild_getUserGuildInfo = 7000;
  564. /**
  565. * 查询公会列表
  566. */
  567. const cmd_guild_getList = 7001;
  568. /**
  569. * 查询 推荐公会列表
  570. */
  571. const cmd_guild_refuseGuildCupScore = 7002;
  572. /**
  573. * 搜索 公会
  574. */
  575. const cmd_guild_searchGuildByID = 7003;
  576. /**
  577. * 创建公会
  578. */
  579. const cmd_guild_create = 7004;
  580. /**
  581. * 申请加入
  582. */
  583. const cmd_guild_apply = 7005;
  584. /**
  585. * 一键加入
  586. */
  587. const cmd_guild_QuickIn = 7006;
  588. /**
  589. * 请求公会信息
  590. */
  591. const cmd_guild_GetGuildInfo = 7007;
  592. /**
  593. * 编辑
  594. */
  595. const cmd_guild_modifyDeclare = 7008;
  596. /**
  597. * 解散
  598. */
  599. const cmd_guild_dismiss = 7009;
  600. /**
  601. * 开除
  602. */
  603. const cmd_guild_fireMember = 7010;
  604. /**
  605. * 审批
  606. */
  607. const cmd_guild_approve = 7011;
  608. /**
  609. * 转让副会长
  610. */
  611. //const cmd_guild_transferChair = 7012;
  612. /**
  613. * 设置副会长
  614. */
  615. const cmd_guild_setPriceChairman = 7013;
  616. /**
  617. * 获取成员信息
  618. */
  619. const cmd_guild_getGuildMembers = 7014;
  620. /**
  621. * 设置 干部职位
  622. */
  623. const cmd_guild_setOfficer = 7015;
  624. /**
  625. * 退会
  626. */
  627. const cmd_guild_quit = 7016;
  628. /**
  629. * 发起弹劾
  630. */
  631. const cmd_guild_InitiateAccuse = 7017;
  632. /**
  633. * 同意弹劾
  634. */
  635. const cmd_guild_Accuse = 7018;
  636. /**
  637. * 会长取消本次弹劾
  638. */
  639. const cmd_guild_ChairmanCancelAccuse = 7019;
  640. /**
  641. * 申请者玩家简介
  642. */
  643. const cmd_guild_ApplyUserIntro = 7020;
  644. /**
  645. * 发起捐献
  646. */
  647. const cmd_guild_requestDonate = 7021;
  648. /**
  649. * 捐献
  650. */
  651. const cmd_guild_donate = 7022;
  652. /**
  653. * 捐献数据刷新
  654. */
  655. const cmd_guild_donateInfoRefresh = 7023;
  656. /**
  657. * 购买捐献度 礼包
  658. */
  659. const cmd_guild_buyDonateGift = 7024;
  660. /**
  661. * 购买公会钻石 礼包
  662. */
  663. const cmd_guild_buyGuildCashGift = 7025;
  664. /**
  665. * 公会公告
  666. */
  667. const cmd_guild_announcement = 7026;
  668. /**
  669. * 公会邮件
  670. */
  671. const cmd_guild_noticeMail = 7027;
  672. /**
  673. * 【公会战】 邀请成员战斗
  674. */
  675. const cmd_guild_vsFightInvite = 7028;
  676. /**
  677. * 【公会战】 取消邀请
  678. */
  679. const cmd_guild_cancelInvite = 7029;
  680. /**
  681. * 【公会战】 接受,战斗
  682. */
  683. const cmd_guild_fight = 7030;
  684. // const
  685. // </editor-fold>
  686. // <editor-fold defaultstate="collapsed" desc=" 反射方法 ">
  687. /**
  688. * 辅助方法, 将所有错误码信息转换到CSV文本中.
  689. * 用法: 先在本文件中用ctrl + H 全部替换掉 'c onst ' -> 's tatic $'
  690. * 然后再调用本方法,即可在同目录下生成ErrCode.txt, 里面包含了所需信息.
  691. * @throws \Exception
  692. * @author gwang
  693. */
  694. static function L() {
  695. $class = new \ReflectionClass(__CLASS__); # 建立这个类的反射对象
  696. $properties = $class->getProperties(\ReflectionProperty::IS_STATIC); # 拉取所有静态属性
  697. $fileName = __DIR__ . "/" . str_replace(__CLASS__, '\\', '.') . ".txt"; # 输出文件名
  698. \var_dump($fileName);
  699. $fd = fopen($fileName, "w");
  700. if (false === $fd) { # 打开文件失败
  701. throw new \Exception("打开$fileName 失败");
  702. }
  703. foreach ($properties as &$p) {
  704. $d = preg_replace('/[\*|\/|\s+]/', '', $p->getDocComment()); # 处理下注释
  705. $type = (strpos($p->getName(), 'err') === false ? 0 : 1); # errorType: 0 继续, 1 重启
  706. $n = fputs($fd, $p->getName() . ";" . $p->getValue() . ";$type;$d" . PHP_EOL); # 写入文件
  707. if (false === $n) { # 写入时失败
  708. throw new Exception("写入$fileName 时失败");
  709. }
  710. }
  711. fclose($fd);
  712. }
  713. // </editor-fold>
  714. }