common.proto 5.4 KB

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