common.proto 5.3 KB

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