common.proto 4.4 KB

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