common.proto 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. syntax = "proto3";
  2. option go_package = "./msg";
  3. //登录
  4. message ResLogin {
  5. string userId = 1;
  6. string nikeName = 2;
  7. }
  8. //登录 响应
  9. message ReqLogin {
  10. string nikeName = 1;
  11. string userId = 2;
  12. string gameStatus = 3;
  13. MsgError error = 4;
  14. }
  15. //进入大厅
  16. message EnterHall {
  17. string userId = 1;
  18. }
  19. //离开大厅
  20. message LeaveHall {
  21. string userId = 1;
  22. }
  23. //加入房间
  24. message ResJoinRoom {
  25. string userId = 1;
  26. string roomId = 2;
  27. string gameId = 3;
  28. }
  29. //加入房间
  30. message ReqJoinRoom {
  31. string userId = 1;
  32. string roomId = 2;
  33. string gameId = 3;
  34. int32 sitPos = 4;
  35. ReqRoom roomInfo = 5;
  36. }
  37. //下一回合
  38. message NextRound {
  39. optional ReqJoinRoom Info = 1;
  40. }
  41. //玩法列表
  42. message PlayList {
  43. string userId = 1;
  44. }
  45. //商城
  46. message Shop {
  47. string userId = 1;
  48. }
  49. message ResGameInfo {
  50. string gameId = 1;
  51. }
  52. message ReqGameInfo {
  53. string gameId = 1;
  54. string gameName = 2;
  55. string gameStatus = 4;
  56. string gameType = 5;
  57. TeenPattiRoomList teenPattiRoomList = 6;
  58. }
  59. message TeenPattiRoomList {
  60. repeated TeenPattiRoom teenPattiRoom = 1;
  61. }
  62. message TeenPattiRoom {
  63. string boot = 1; //0.1
  64. string minBuyin = 2; // 1
  65. string chaalLimmit = 3; // 12.8
  66. string potLimit = 4; //102.40
  67. string totalPlayers = 5; // 3999
  68. string roomLevel = 6; //low - mid - high
  69. string roomId = 7;
  70. string type = 8;
  71. }
  72. // 通知客户端发牌
  73. message ReqDealCard {
  74. optional int32 sitPos = 1;
  75. optional int32 index = 2;
  76. }
  77. // 通知客户端操作
  78. message ReqPlayerAction {
  79. int32 sitPos = 1;
  80. PlayerOpt playerOpt = 2;
  81. }
  82. // 接到玩家操作
  83. message ResPlayerOptAction {
  84. int32 sitPos = 1;
  85. PlayerOpt playerOpt = 2;
  86. string roomId = 3;
  87. string gameId = 4;
  88. string userId = 5;
  89. }
  90. // PlayerOptType 玩家操作类型
  91. enum PlayerOptType {
  92. OPT_NONE = 0; // 无操作
  93. OPT_SEEN = 1; // 看牌
  94. OPT_PACKED = 2; // 弃牌
  95. OPT_CHAAL = 3; // 跟注
  96. OPT_BIND = 4; // 绑定
  97. OPT_SELECT = 5; // 选择操作
  98. OPT_SHOW = 6; // 亮牌
  99. OPT_ANTE = 7; // 底注
  100. }
  101. message PlayerOpt {
  102. PlayerOptType opt_type = 1; // 操作类型
  103. int32 bet_amount = 2; // 下注金额
  104. int64 timestamp = 3; // 操作时间戳
  105. repeated ReqCard seenCards = 4; // 看牌的牌
  106. }
  107. message ReqRoom {
  108. string Id = 1;
  109. repeated ReqPlayer ReqPlayers = 2;
  110. int32 Status = 3;
  111. int32 Round = 4;
  112. ReqGameRound GameRound = 5;
  113. }
  114. message ReqCard {
  115. int32 Color = 1;
  116. int32 Point = 2;
  117. }
  118. message ReqPlayer {
  119. string Id = 1;
  120. repeated ReqCard HandCards =2;
  121. optional int32 SitPos = 3;
  122. optional bool IsDealer = 4;
  123. optional bool IsSeen = 5;
  124. optional bool IsPacked = 6;
  125. optional bool IsShow = 7;
  126. optional bool CanShow = 8;
  127. optional string Nickname = 9;
  128. optional string Avatar = 10;
  129. }
  130. message ReqPlayerList {
  131. repeated ReqPlayer ReqPlayers = 1;
  132. }
  133. message ReqGameRound {
  134. repeated ReqRound Rounds = 1;
  135. }
  136. message ReqBet {
  137. optional int32 betAmount = 1;
  138. }
  139. message ReqResult {
  140. int32 roundSitPos = 1;
  141. int32 result = 2;
  142. }
  143. message ReqRound {
  144. // 回合数
  145. int32 round = 1;
  146. // 回合座位
  147. int32 roundSitPos = 2;
  148. // 回合操作
  149. PlayerOpt playerOpt = 3;
  150. // 用户id
  151. string userId = 4;
  152. }
  153. //error
  154. message MsgError {
  155. int32 error_code = 1;
  156. string error_msg = 2;
  157. }
  158. message Hello {
  159. string name = 1;
  160. }
  161. message ReqRoomTipsMessage {
  162. string msg = 1;
  163. }
  164. message ResHeartBeat {
  165. string msg = 1;
  166. }
  167. message ReqHeartBeat {
  168. string msg = 1;
  169. }