common.proto 4.8 KB

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