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