common.proto 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. syntax = "proto3";
  2. option go_package = "./msg";
  3. //登录
  4. message ResLogin {
  5. string userId = 1;
  6. string nikeName = 2;
  7. }
  8. //登录 响应
  9. message ReqLogin {
  10. string nikeName = 1;
  11. string userId = 2;
  12. string gameStatus = 3;
  13. MsgError error = 4;
  14. int32 points = 5;
  15. }
  16. //用户信息
  17. message UserInfo {
  18. string nikeName = 1;
  19. string userId = 2;
  20. int32 points = 3;
  21. }
  22. //进入大厅
  23. message EnterHall {
  24. string userId = 1;
  25. }
  26. //离开大厅
  27. message LeaveHall {
  28. string userId = 1;
  29. }
  30. //加入房间
  31. message ResJoinRoom {
  32. string userId = 1;
  33. string roomId = 2;
  34. string gameId = 3;
  35. }
  36. //加入房间
  37. message ReqJoinRoom {
  38. string userId = 1;
  39. string roomId = 2;
  40. string gameId = 3;
  41. int32 sitPos = 4;
  42. ReqRoom roomInfo = 5;
  43. }
  44. //下一回合
  45. message NextRound {
  46. optional ReqJoinRoom Info = 1;
  47. }
  48. //玩法列表
  49. message PlayList {
  50. string userId = 1;
  51. }
  52. //商城
  53. message Shop {
  54. string userId = 1;
  55. }
  56. message ResGameInfo {
  57. string gameId = 1;
  58. }
  59. message ResRoomID {
  60. string gameId = 1;
  61. string confId = 2;
  62. string userId = 3;
  63. }
  64. message ReqRoomID {
  65. string gameId = 1;
  66. string roomId = 2;
  67. string userId = 3;
  68. }
  69. message ResLeaveRoom {
  70. string gameId = 1;
  71. string roomId = 2;
  72. string userId = 3;
  73. }
  74. message ReqLeaveRoom {
  75. string gameId = 1;
  76. string roomId = 2;
  77. string userId = 3;
  78. }
  79. message ResBet {
  80. int32 minBlindBet =1;
  81. int32 maxBlindBet =2;
  82. int32 minCheelBet =3;
  83. int32 maxCheelBet =4;
  84. int32 roomMinBet = 5;
  85. int32 roomMaxBet = 6;
  86. }
  87. message ReqGameInfo {
  88. string gameId = 1;
  89. string gameName = 2;
  90. string gameStatus = 4;
  91. string gameType = 5;
  92. TeenPattiRoomList teenPattiRoomList = 6;
  93. }
  94. message TeenPattiRoomList {
  95. repeated TeenPattiRoom teenPattiRoom = 1;
  96. }
  97. message TeenPattiRoom {
  98. string boot = 1; //1
  99. string minBuyin = 2; // 1
  100. string chaalLimmit = 3; // 128
  101. string potLimit = 4; //1024
  102. string totalPlayers = 5; // 3999
  103. string roomLevel = 6; //low - mid - high
  104. string confId = 7;
  105. string type = 8;
  106. }
  107. // 通知客户端发牌
  108. message ReqDealCard {
  109. optional int32 sitPos = 1;
  110. optional int32 index = 2;
  111. }
  112. // 通知客户端操作
  113. message ReqPlayerAction {
  114. int32 sitPos = 1;
  115. PlayerOpt playerOpt = 2;
  116. }
  117. // 接到玩家操作
  118. message ResPlayerOptAction {
  119. int32 sitPos = 1;
  120. PlayerOpt playerOpt = 2;
  121. string roomId = 3;
  122. string gameId = 4;
  123. string userId = 5;
  124. }
  125. // PlayerOptType 玩家操作类型
  126. enum PlayerOptType {
  127. OPT_NONE = 0; // 无操作
  128. OPT_SEEN = 1; // 看牌
  129. OPT_PACKED = 2; // 弃牌
  130. OPT_CHAAL = 3; // 跟注
  131. OPT_BLIND = 4; // 不看牌跟注
  132. OPT_SELECT = 5; // 选择操作
  133. OPT_SHOW = 6; // 亮牌
  134. OPT_ANTE = 7; // 底注
  135. OPT_SITESHOW =8; // 底注
  136. }
  137. message PlayerOpt {
  138. PlayerOptType opt_type = 1; // 操作类型
  139. int32 bet_amount = 2; // 下注金额
  140. int64 timestamp = 3; // 操作时间戳
  141. repeated ReqCard seenCards = 4; // 看牌的牌
  142. }
  143. message ReqRoom {
  144. string Id = 1;
  145. repeated ReqPlayer ReqPlayers = 2;
  146. int32 Status = 3;
  147. int32 Round = 4;
  148. ReqGameRound GameRound = 5;
  149. ResBet BetInfo = 6;
  150. }
  151. message ReqCard {
  152. int32 Color = 1;
  153. int32 Point = 2;
  154. }
  155. message ReqPlayer {
  156. string Id = 1;
  157. repeated ReqCard HandCards =2;
  158. optional int32 SitPos = 3;
  159. optional bool IsDealer = 4;
  160. optional bool IsSeen = 5;
  161. optional bool IsPacked = 6;
  162. optional bool IsShow = 7;
  163. optional bool CanShow = 8;
  164. optional string Nickname = 9;
  165. optional string Avatar = 10;
  166. }
  167. message ReqPlayerList {
  168. repeated ReqPlayer ReqPlayers = 1;
  169. }
  170. message ReqGameRound {
  171. repeated ReqRound Rounds = 1;
  172. }
  173. message ReqBet {
  174. optional int32 betAmount = 1;
  175. }
  176. message ReqResult {
  177. optional int32 roundSitPos = 1;
  178. optional int32 result = 2;
  179. }
  180. message ReqRound {
  181. // 回合数
  182. int32 round = 1;
  183. // 回合座位
  184. int32 roundSitPos = 2;
  185. // 回合操作
  186. PlayerOpt playerOpt = 3;
  187. // 用户id
  188. string userId = 4;
  189. ResBet resBet = 5;
  190. }
  191. //error
  192. message MsgError {
  193. int32 error_code = 1;
  194. string error_msg = 2;
  195. }
  196. message Hello {
  197. string name = 1;
  198. }
  199. message ReqRoomTipsMessage {
  200. string msg = 1;
  201. }
  202. message ResHeartBeat {
  203. string msg = 1;
  204. }
  205. message ReqHeartBeat {
  206. string msg = 1;
  207. }