common.proto 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  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 JoinRoomFail {
  43. string gameId = 1;
  44. string confId = 2;
  45. string userId = 3;
  46. }
  47. message ReqInsufficientPoints {
  48. string gameId = 1;
  49. string userId = 2;
  50. int32 AvailableAmount = 3;
  51. int32 RequiredAmount=4;
  52. }
  53. //加入房间
  54. message ResJoinRoom {
  55. string userId = 1;
  56. string confId = 2;
  57. string gameId = 3;
  58. }
  59. //房间相应房间信息
  60. message ReqJoinRoom {
  61. string userId = 1;
  62. string roomId = 2;
  63. string gameId = 3;
  64. int32 sitPos = 4;
  65. ReqRoom roomInfo = 5;
  66. }
  67. //下一回合
  68. message NextRound {
  69. optional ReqJoinRoom Info = 1;
  70. }
  71. //玩法列表
  72. message PlayList {
  73. string userId = 1;
  74. }
  75. //商城
  76. message Shop {
  77. string userId = 1;
  78. }
  79. message ResGameInfo {
  80. string gameId = 1;
  81. }
  82. message ResRoomID {
  83. string gameId = 1;
  84. string confId = 2;
  85. string userId = 3;
  86. }
  87. message ReqRoomID {
  88. string gameId = 1;
  89. string roomId = 2;
  90. string userId = 3;
  91. }
  92. message ResBet {
  93. int32 minBlindBet =1;
  94. int32 maxBlindBet =2;
  95. int32 minCheelBet =3;
  96. int32 maxCheelBet =4;
  97. int32 roomMinBet = 5;
  98. int32 roomMaxBet = 6;
  99. }
  100. message ReqGameInfo {
  101. string gameId = 1;
  102. string gameName = 2;
  103. string gameStatus = 4;
  104. string gameType = 5;
  105. TeenPattiRoomList teenPattiRoomList = 6;
  106. }
  107. message TeenPattiRoomList {
  108. repeated TeenPattiRoom teenPattiRoom = 1;
  109. }
  110. message TeenPattiRoom {
  111. string boot = 1; //1
  112. string minBuyin = 2; // 1
  113. string chaalLimmit = 3; // 128
  114. string potLimit = 4; //1024
  115. string totalPlayers = 5; // 3999
  116. string roomLevel = 6; //low - mid - high
  117. string confId = 7;
  118. string type = 8;
  119. }
  120. // 通知客户端发牌
  121. message ReqDealCard {
  122. optional int32 sitPos = 1;
  123. optional int32 index = 2;
  124. }
  125. // 通知客户端操作
  126. message ReqPlayerAction {
  127. int32 sitPos = 1;
  128. PlayerOpt playerOpt = 2;
  129. }
  130. // 接到玩家操作
  131. message ResPlayerOptAction {
  132. int32 sitPos = 1;
  133. PlayerOpt playerOpt = 2;
  134. string roomId = 3;
  135. string gameId = 4;
  136. string userId = 5;
  137. }
  138. // PlayerOptType 玩家操作类型
  139. enum PlayerOptType {
  140. OPT_NONE = 0; // 无操作
  141. OPT_SEEN = 1; // 看牌
  142. OPT_PACKED = 2; // 弃牌
  143. OPT_CHAAL = 3; // 跟注
  144. OPT_BLIND = 4; // 不看牌跟注
  145. OPT_SELECT = 5; // 选择操作
  146. OPT_SHOW = 6; // 亮牌
  147. OPT_ANTE = 7; // 底注
  148. OPT_SITESHOW =8; // 发起上家比牌
  149. OPT_REFUSESITESHOW =9; // 拒绝与上家比牌
  150. OPT_AGREESITESHOW =10;//同意与上家比牌
  151. OPT_SELECTSITESHOW =11; // 操作上家比牌,同意和拒绝
  152. }
  153. message PlayerOpt {
  154. PlayerOptType opt_type = 1; // 操作类型
  155. int32 bet_amount = 2; // 下注金额
  156. int64 timestamp = 3; // 操作时间戳
  157. repeated ReqCard seenCards = 4; // 看牌的牌
  158. }
  159. message ReqRoom {
  160. string Id = 1;
  161. repeated ReqPlayer ReqPlayers = 2;
  162. int32 Status = 3;
  163. int32 Round = 4;
  164. ReqGameRound GameRound = 5;
  165. ResBet BetInfo = 6;
  166. }
  167. message ReqCard {
  168. int32 Color = 1;
  169. int32 Point = 2;
  170. }
  171. message ReqPlayer {
  172. string Id = 1;
  173. repeated ReqCard HandCards =2;
  174. optional int32 SitPos = 3;
  175. optional bool IsDealer = 4;
  176. optional bool IsSeen = 5;
  177. optional bool IsPacked = 6;
  178. optional bool IsShow = 7;
  179. optional bool CanShow = 8;
  180. optional string Nickname = 9;
  181. optional string Avatar = 10;
  182. }
  183. message ReqPlayerList {
  184. repeated ReqPlayer ReqPlayers = 1;
  185. }
  186. message ReqGameRound {
  187. repeated ReqRound Rounds = 1;
  188. }
  189. message ReqBet {
  190. optional int32 betAmount = 1;
  191. }
  192. message ReqResult {
  193. optional int32 roundSitPos = 1;
  194. optional int32 result = 2;
  195. }
  196. message ReqRound {
  197. // 回合数
  198. int32 round = 1;
  199. // 回合座位
  200. int32 roundSitPos = 2;
  201. // 回合操作
  202. PlayerOpt playerOpt = 3;
  203. // 用户id
  204. string userId = 4;
  205. ResBet resBet = 5;
  206. }
  207. //error
  208. message MsgError {
  209. int32 error_code = 1;
  210. string error_msg = 2;
  211. }
  212. message Hello {
  213. string name = 1;
  214. }
  215. message ReqRoomTipsMessage {
  216. string msg = 1;
  217. }
  218. message ResHeartBeat {
  219. string msg = 1;
  220. }
  221. message ReqHeartBeat {
  222. string msg = 1;
  223. }