ServiceProtoRoom.ts 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918
  1. import { ServiceProto } from 'tsrpc-proto';
  2. import { ReqRoomJoin, ResRoomJoin } from './room/PtlRoomJoin';
  3. import { MsgAck } from './room/client/MsgAck';
  4. export interface ServiceType {
  5. api: {
  6. "RoomJoin": {
  7. req: ReqRoomJoin,
  8. res: ResRoomJoin
  9. }
  10. },
  11. msg: {
  12. "msg/client/Ack": MsgAck,
  13. }
  14. }
  15. export const serviceProto: ServiceProto<ServiceType> = {
  16. "version": 36,
  17. "services": [
  18. {
  19. "id": 25,
  20. "name": "msg/client/Ack",
  21. "type": "msg"
  22. },
  23. {
  24. "id": 13,
  25. "name": "msg/client/GameAction",
  26. "type": "msg"
  27. },
  28. {
  29. "id": 18,
  30. "name": "msg/client/SyncMap",
  31. "type": "msg"
  32. },
  33. {
  34. "id": 24,
  35. "name": "msg/server/ActionAck",
  36. "type": "msg"
  37. },
  38. {
  39. "id": 14,
  40. "name": "msg/server/GameAction",
  41. "type": "msg"
  42. },
  43. {
  44. "id": 19,
  45. "name": "msg/server/NotifySync",
  46. "type": "msg"
  47. },
  48. {
  49. "id": 15,
  50. "name": "msg/server/PlayerJoin",
  51. "type": "msg"
  52. },
  53. {
  54. "id": 16,
  55. "name": "msg/server/PlayerLeave",
  56. "type": "msg"
  57. },
  58. {
  59. "id": 22,
  60. "name": "msg/server/PlayerStateChange",
  61. "type": "msg"
  62. },
  63. {
  64. "id": 23,
  65. "name": "msg/server/SyncMapServer",
  66. "type": "msg"
  67. },
  68. {
  69. "id": 26,
  70. "name": "GetMsg",
  71. "type": "api"
  72. },
  73. {
  74. "id": 5,
  75. "name": "RoomJoin",
  76. "type": "api"
  77. },
  78. {
  79. "id": 6,
  80. "name": "RoomLeave",
  81. "type": "api"
  82. },
  83. {
  84. "id": 11,
  85. "name": "TestMatch",
  86. "type": "api",
  87. "conf": {
  88. "needLogin": true
  89. }
  90. }
  91. ],
  92. "types": {
  93. "msg/client/MsgAck/MsgAck": {
  94. "type": "Interface",
  95. "properties": [
  96. {
  97. "id": 0,
  98. "name": "sns",
  99. "type": {
  100. "type": "Array",
  101. "elementType": {
  102. "type": "Number"
  103. }
  104. }
  105. }
  106. ]
  107. },
  108. "msg/client/MsgGameAction/MsgGameAction": {
  109. "type": "Reference",
  110. "target": "../../shared/types/GameAction/GameAction"
  111. },
  112. "../../shared/types/GameAction/GameAction": {
  113. "type": "Interface",
  114. "properties": [
  115. {
  116. "id": 0,
  117. "name": "type",
  118. "type": {
  119. "type": "Literal",
  120. "literal": "GameAction"
  121. }
  122. },
  123. {
  124. "id": 1,
  125. "name": "playerId",
  126. "type": {
  127. "type": "String"
  128. },
  129. "optional": true
  130. },
  131. {
  132. "id": 2,
  133. "name": "actionName",
  134. "type": {
  135. "type": "String"
  136. }
  137. },
  138. {
  139. "id": 3,
  140. "name": "data",
  141. "type": {
  142. "type": "Any"
  143. }
  144. },
  145. {
  146. "id": 4,
  147. "name": "creatorQueue",
  148. "type": {
  149. "type": "Array",
  150. "elementType": {
  151. "type": "Interface",
  152. "properties": [
  153. {
  154. "id": 0,
  155. "name": "key",
  156. "type": {
  157. "type": "String"
  158. }
  159. },
  160. {
  161. "id": 1,
  162. "name": "ids",
  163. "type": {
  164. "type": "Array",
  165. "elementType": {
  166. "type": "String"
  167. }
  168. }
  169. }
  170. ]
  171. }
  172. },
  173. "optional": true
  174. },
  175. {
  176. "id": 6,
  177. "name": "time",
  178. "type": {
  179. "type": "Number"
  180. },
  181. "optional": true
  182. },
  183. {
  184. "id": 5,
  185. "name": "sendTag",
  186. "type": {
  187. "type": "Number"
  188. },
  189. "optional": true
  190. }
  191. ]
  192. },
  193. "msg/client/MsgSyncMap/MsgSyncMap": {
  194. "type": "Interface",
  195. "properties": [
  196. {
  197. "id": 17,
  198. "name": "data",
  199. "type": {
  200. "type": "Any"
  201. }
  202. }
  203. ]
  204. },
  205. "msg/server/MsgActionAck/MsgActionAck": {
  206. "type": "Interface",
  207. "properties": [
  208. {
  209. "id": 1,
  210. "name": "sendTag",
  211. "type": {
  212. "type": "Number"
  213. }
  214. },
  215. {
  216. "id": 2,
  217. "name": "players",
  218. "type": {
  219. "type": "Any"
  220. }
  221. }
  222. ]
  223. },
  224. "msg/server/MsgGameAction/MsgGameAction": {
  225. "type": "Interface",
  226. "properties": [
  227. {
  228. "id": 0,
  229. "name": "state",
  230. "type": {
  231. "type": "Any"
  232. }
  233. },
  234. {
  235. "id": 2,
  236. "name": "players",
  237. "type": {
  238. "type": "Any"
  239. }
  240. },
  241. {
  242. "id": 1,
  243. "name": "sn",
  244. "type": {
  245. "type": "Number"
  246. }
  247. }
  248. ]
  249. },
  250. "msg/server/MsgNotifySync/MsgNotifySync": {
  251. "type": "Interface",
  252. "properties": [
  253. {
  254. "id": 0,
  255. "name": "playerId",
  256. "type": {
  257. "type": "String"
  258. }
  259. }
  260. ]
  261. },
  262. "msg/server/MsgPlayerJoin/MsgPlayerJoin": {
  263. "type": "Interface",
  264. "properties": [
  265. {
  266. "id": 0,
  267. "name": "player",
  268. "type": {
  269. "type": "Reference",
  270. "target": "../../shared/game/state/PlayerState/PlayerState"
  271. }
  272. },
  273. {
  274. "id": 1,
  275. "name": "time",
  276. "type": {
  277. "type": "Number"
  278. }
  279. },
  280. {
  281. "id": 2,
  282. "name": "mapData",
  283. "type": {
  284. "type": "String"
  285. },
  286. "optional": true
  287. }
  288. ]
  289. },
  290. "../../shared/game/state/PlayerState/PlayerState": {
  291. "type": "Interface",
  292. "properties": [
  293. {
  294. "id": 0,
  295. "name": "id",
  296. "type": {
  297. "type": "String"
  298. }
  299. },
  300. {
  301. "id": 1,
  302. "name": "seatId",
  303. "type": {
  304. "type": "Number"
  305. }
  306. },
  307. {
  308. "id": 2,
  309. "name": "score",
  310. "type": {
  311. "type": "Number"
  312. }
  313. },
  314. {
  315. "id": 3,
  316. "name": "pre_score",
  317. "type": {
  318. "type": "Number"
  319. }
  320. },
  321. {
  322. "id": 4,
  323. "name": "power",
  324. "type": {
  325. "type": "Number"
  326. }
  327. },
  328. {
  329. "id": 5,
  330. "name": "avatar",
  331. "type": {
  332. "type": "Number"
  333. }
  334. },
  335. {
  336. "id": 6,
  337. "name": "avatarFrame",
  338. "type": {
  339. "type": "Number"
  340. }
  341. },
  342. {
  343. "id": 7,
  344. "name": "nickName",
  345. "type": {
  346. "type": "String"
  347. }
  348. },
  349. {
  350. "id": 8,
  351. "name": "cardId",
  352. "type": {
  353. "type": "Number"
  354. }
  355. },
  356. {
  357. "id": 9,
  358. "name": "ready",
  359. "type": {
  360. "type": "Number"
  361. }
  362. },
  363. {
  364. "id": 10,
  365. "name": "useProps",
  366. "type": {
  367. "type": "Array",
  368. "elementType": {
  369. "type": "Number"
  370. }
  371. }
  372. },
  373. {
  374. "id": 11,
  375. "name": "cup",
  376. "type": {
  377. "type": "Number"
  378. }
  379. },
  380. {
  381. "id": 12,
  382. "name": "online",
  383. "type": {
  384. "type": "Number"
  385. }
  386. },
  387. {
  388. "id": 13,
  389. "name": "robotId",
  390. "type": {
  391. "type": "String"
  392. },
  393. "optional": true
  394. },
  395. {
  396. "id": 15,
  397. "name": "pre_cubes",
  398. "type": {
  399. "type": "Number"
  400. }
  401. },
  402. {
  403. "id": 16,
  404. "name": "step",
  405. "type": {
  406. "type": "Number"
  407. },
  408. "optional": true
  409. },
  410. {
  411. "id": 17,
  412. "name": "vip",
  413. "type": {
  414. "type": "Number"
  415. },
  416. "optional": true
  417. },
  418. {
  419. "id": 18,
  420. "name": "data",
  421. "type": {
  422. "type": "Any"
  423. },
  424. "optional": true
  425. }
  426. ]
  427. },
  428. "msg/server/MsgPlayerLeave/MsgPlayerLeave": {
  429. "type": "Interface",
  430. "properties": [
  431. {
  432. "id": 0,
  433. "name": "playerId",
  434. "type": {
  435. "type": "String"
  436. }
  437. }
  438. ]
  439. },
  440. "msg/server/MsgPlayerStateChange/MsgPlayerStateChange": {
  441. "type": "Interface",
  442. "properties": [
  443. {
  444. "id": 0,
  445. "name": "playerId",
  446. "type": {
  447. "type": "String"
  448. }
  449. },
  450. {
  451. "id": 1,
  452. "name": "state",
  453. "type": {
  454. "type": "Reference",
  455. "target": "../../shared/game/state/OnlineState/OnlineState"
  456. }
  457. }
  458. ]
  459. },
  460. "../../shared/game/state/OnlineState/OnlineState": {
  461. "type": "Enum",
  462. "members": [
  463. {
  464. "id": 0,
  465. "value": 1
  466. },
  467. {
  468. "id": 1,
  469. "value": 2
  470. }
  471. ]
  472. },
  473. "msg/server/MsgSyncMapServer/MsgSyncMapServer": {
  474. "type": "Interface",
  475. "properties": [
  476. {
  477. "id": 0,
  478. "name": "playerId",
  479. "type": {
  480. "type": "String"
  481. }
  482. },
  483. {
  484. "id": 1,
  485. "name": "state",
  486. "type": {
  487. "type": "Reference",
  488. "target": "../../shared/game/state/OnlineState/OnlineState"
  489. }
  490. },
  491. {
  492. "id": 2,
  493. "name": "data",
  494. "type": {
  495. "type": "Any"
  496. }
  497. }
  498. ]
  499. },
  500. "PtlGetMsg/ReqGetMsg": {
  501. "type": "Interface",
  502. "extends": [
  503. {
  504. "id": 0,
  505. "type": {
  506. "type": "Reference",
  507. "target": "../../shared/base/BaseRequest"
  508. }
  509. }
  510. ],
  511. "properties": [
  512. {
  513. "id": 0,
  514. "name": "playerId",
  515. "type": {
  516. "type": "String"
  517. }
  518. },
  519. {
  520. "id": 1,
  521. "name": "roomId",
  522. "type": {
  523. "type": "String"
  524. }
  525. }
  526. ]
  527. },
  528. "../../shared/base/BaseRequest": {
  529. "type": "Interface",
  530. "properties": [
  531. {
  532. "id": 0,
  533. "name": "__ssoToken",
  534. "type": {
  535. "type": "String"
  536. },
  537. "optional": true
  538. }
  539. ]
  540. },
  541. "PtlGetMsg/ResGetMsg": {
  542. "type": "Interface",
  543. "extends": [
  544. {
  545. "id": 0,
  546. "type": {
  547. "type": "Reference",
  548. "target": "../../shared/base/BaseResponse"
  549. }
  550. }
  551. ],
  552. "properties": [
  553. {
  554. "id": 0,
  555. "name": "data",
  556. "type": {
  557. "type": "Any"
  558. }
  559. },
  560. {
  561. "id": 1,
  562. "name": "players",
  563. "type": {
  564. "type": "Any"
  565. }
  566. }
  567. ]
  568. },
  569. "../../shared/base/BaseResponse": {
  570. "type": "Interface",
  571. "properties": [
  572. {
  573. "id": 0,
  574. "name": "__ssoToken",
  575. "type": {
  576. "type": "String"
  577. },
  578. "optional": true
  579. }
  580. ]
  581. },
  582. "PtlRoomJoin/ReqRoomJoin": {
  583. "type": "Interface",
  584. "extends": [
  585. {
  586. "id": 1,
  587. "type": {
  588. "type": "Reference",
  589. "target": "../../shared/base/BaseRequest"
  590. }
  591. }
  592. ],
  593. "properties": [
  594. {
  595. "id": 0,
  596. "name": "playerId",
  597. "type": {
  598. "type": "String"
  599. }
  600. },
  601. {
  602. "id": 1,
  603. "name": "roomId",
  604. "type": {
  605. "type": "String"
  606. }
  607. },
  608. {
  609. "id": 2,
  610. "name": "mapData",
  611. "type": {
  612. "type": "String"
  613. },
  614. "optional": true
  615. },
  616. {
  617. "id": 3,
  618. "name": "sn",
  619. "type": {
  620. "type": "Number"
  621. },
  622. "optional": true
  623. }
  624. ]
  625. },
  626. "PtlRoomJoin/ResRoomJoin": {
  627. "type": "Interface",
  628. "extends": [
  629. {
  630. "id": 1,
  631. "type": {
  632. "type": "Reference",
  633. "target": "../../shared/base/BaseResponse"
  634. }
  635. }
  636. ],
  637. "properties": [
  638. {
  639. "id": 0,
  640. "name": "playerId",
  641. "type": {
  642. "type": "String"
  643. }
  644. },
  645. {
  646. "id": 3,
  647. "name": "players",
  648. "type": {
  649. "type": "Array",
  650. "elementType": {
  651. "type": "Reference",
  652. "target": "../../shared/game/state/PlayerState/PlayerState"
  653. }
  654. }
  655. },
  656. {
  657. "id": 2,
  658. "name": "mapData",
  659. "type": {
  660. "type": "String"
  661. },
  662. "optional": true
  663. },
  664. {
  665. "id": 4,
  666. "name": "sn",
  667. "type": {
  668. "type": "Number"
  669. },
  670. "optional": true
  671. },
  672. {
  673. "id": 5,
  674. "name": "startTime",
  675. "type": {
  676. "type": "Number"
  677. },
  678. "optional": true
  679. }
  680. ]
  681. },
  682. "PtlRoomLeave/ReqRoomLeave": {
  683. "type": "Interface",
  684. "extends": [
  685. {
  686. "id": 1,
  687. "type": {
  688. "type": "Reference",
  689. "target": "../../shared/base/BaseRequest"
  690. }
  691. }
  692. ],
  693. "properties": [
  694. {
  695. "id": 0,
  696. "name": "playerId",
  697. "type": {
  698. "type": "String"
  699. }
  700. },
  701. {
  702. "id": 1,
  703. "name": "roomId",
  704. "type": {
  705. "type": "String"
  706. }
  707. }
  708. ]
  709. },
  710. "PtlRoomLeave/ResRoomLeave": {
  711. "type": "Interface",
  712. "extends": [
  713. {
  714. "id": 1,
  715. "type": {
  716. "type": "Reference",
  717. "target": "../../shared/base/BaseResponse"
  718. }
  719. }
  720. ],
  721. "properties": [
  722. {
  723. "id": 0,
  724. "name": "playerId",
  725. "type": {
  726. "type": "String"
  727. }
  728. }
  729. ]
  730. },
  731. "PtlTestMatch/ReqTestMatch": {
  732. "type": "Interface",
  733. "extends": [
  734. {
  735. "id": 1,
  736. "type": {
  737. "type": "Reference",
  738. "target": "../../shared/base/BaseRequest"
  739. }
  740. }
  741. ],
  742. "properties": [
  743. {
  744. "id": 0,
  745. "name": "playerId",
  746. "type": {
  747. "type": "String"
  748. }
  749. },
  750. {
  751. "id": 1,
  752. "name": "roomType",
  753. "type": {
  754. "type": "Number"
  755. }
  756. },
  757. {
  758. "id": 2,
  759. "name": "cardId",
  760. "type": {
  761. "type": "Number"
  762. }
  763. },
  764. {
  765. "id": 3,
  766. "name": "cup",
  767. "type": {
  768. "type": "Number"
  769. }
  770. },
  771. {
  772. "id": 4,
  773. "name": "roomId",
  774. "type": {
  775. "type": "String"
  776. }
  777. },
  778. {
  779. "id": 5,
  780. "name": "nickName",
  781. "type": {
  782. "type": "String"
  783. }
  784. },
  785. {
  786. "id": 6,
  787. "name": "avatar",
  788. "type": {
  789. "type": "Number"
  790. }
  791. },
  792. {
  793. "id": 7,
  794. "name": "version",
  795. "type": {
  796. "type": "Number"
  797. }
  798. }
  799. ]
  800. },
  801. "PtlTestMatch/ResTestMatch": {
  802. "type": "Interface",
  803. "extends": [
  804. {
  805. "id": 1,
  806. "type": {
  807. "type": "Reference",
  808. "target": "../../shared/base/BaseResponse"
  809. }
  810. }
  811. ],
  812. "properties": [
  813. {
  814. "id": 0,
  815. "name": "roomState",
  816. "type": {
  817. "type": "Reference",
  818. "target": "../../shared/game/state/RoomState/RoomState"
  819. }
  820. },
  821. {
  822. "id": 1,
  823. "name": "isRobot",
  824. "type": {
  825. "type": "Number"
  826. }
  827. },
  828. {
  829. "id": 2,
  830. "name": "version",
  831. "type": {
  832. "type": "Number"
  833. }
  834. }
  835. ]
  836. },
  837. "../../shared/game/state/RoomState/RoomState": {
  838. "type": "Interface",
  839. "properties": [
  840. {
  841. "id": 0,
  842. "name": "id",
  843. "type": {
  844. "type": "String"
  845. }
  846. },
  847. {
  848. "id": 1,
  849. "name": "roomType",
  850. "type": {
  851. "type": "Number"
  852. }
  853. },
  854. {
  855. "id": 2,
  856. "name": "server",
  857. "type": {
  858. "type": "String"
  859. }
  860. },
  861. {
  862. "id": 3,
  863. "name": "players",
  864. "type": {
  865. "type": "Array",
  866. "elementType": {
  867. "type": "Reference",
  868. "target": "../../shared/game/state/PlayerState/PlayerState"
  869. }
  870. }
  871. },
  872. {
  873. "id": 4,
  874. "name": "sn",
  875. "type": {
  876. "type": "Number"
  877. }
  878. },
  879. {
  880. "id": 8,
  881. "name": "sendTag",
  882. "type": {
  883. "type": "Any"
  884. }
  885. },
  886. {
  887. "id": 7,
  888. "name": "startTime",
  889. "type": {
  890. "type": "Number"
  891. },
  892. "optional": true
  893. },
  894. {
  895. "id": 5,
  896. "name": "conns",
  897. "type": {
  898. "type": "Array",
  899. "elementType": {
  900. "type": "Any"
  901. }
  902. },
  903. "optional": true
  904. },
  905. {
  906. "id": 9,
  907. "name": "mapData",
  908. "type": {
  909. "type": "Any"
  910. },
  911. "optional": true
  912. }
  913. ]
  914. }
  915. }
  916. };