common.proto 5.3 KB

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