common.proto 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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 PlayList {
  39. string userId = 1;
  40. }
  41. //商城
  42. message Shop {
  43. string userId = 1;
  44. }
  45. message ResGameInfo {
  46. string gameId = 1;
  47. }
  48. message ReqGameInfo {
  49. string gameId = 1;
  50. string gameName = 2;
  51. string gameStatus = 4;
  52. string gameType = 5;
  53. TeenPattiRoomList teenPattiRoomList = 6;
  54. }
  55. message TeenPattiRoomList {
  56. repeated TeenPattiRoom teenPattiRoom = 1;
  57. }
  58. message TeenPattiRoom {
  59. string boot = 1; //0.1
  60. string minBuyin = 2; // 1
  61. string chaalLimmit = 3; // 12.8
  62. string potLimit = 4; //102.40
  63. string totalPlayers = 5; // 3999
  64. string roomLevel = 6; //low - mid - high
  65. string roomId = 7;
  66. string type = 8;
  67. }
  68. // 通知客户端发牌
  69. message ReqDealCard {
  70. optional int32 sitPos = 1;
  71. optional int32 index = 2;
  72. }
  73. // 通知客户端操作
  74. message ReqPlayerAction {
  75. int32 sitPos = 1;
  76. PlayerOpt playerOpt = 2;
  77. }
  78. // 接到玩家操作
  79. message ResPlayerOptAction {
  80. int32 sitPos = 1;
  81. PlayerOpt playerOpt = 2;
  82. string roomId = 3;
  83. string gameId = 4;
  84. string userId = 5;
  85. }
  86. // PlayerOptType 玩家操作类型
  87. enum PlayerOptType {
  88. OPT_NONE = 0; // 无操作
  89. OPT_SEEN = 1; // 看牌
  90. OPT_PACKED = 2; // 弃牌
  91. OPT_CHAAL = 3; // 跟注
  92. OPT_BIND = 4; // 绑定
  93. OPT_SELECT = 5; // 选择操作
  94. OPT_SHOW = 6; // 亮牌
  95. OPT_ANTE = 7; // 底注
  96. }
  97. message PlayerOpt {
  98. PlayerOptType opt_type = 1; // 操作类型
  99. int32 bet_amount = 2; // 下注金额
  100. int64 timestamp = 3; // 操作时间戳
  101. repeated ReqCard seenCards = 4; // 看牌的牌
  102. }
  103. message ReqRoom {
  104. string Id = 1;
  105. repeated ReqPlayer ReqPlayers = 2;
  106. int32 Status = 3;
  107. int32 Round = 4;
  108. ReqGameRound GameRound = 5;
  109. }
  110. message ReqCard {
  111. int32 Color = 1;
  112. int32 Point = 2;
  113. }
  114. message ReqPlayer {
  115. string Id = 1;
  116. repeated ReqCard HandCards =2;
  117. optional int32 SitPos = 3;
  118. optional bool IsDealer = 4;
  119. optional bool IsSeen = 5;
  120. optional bool IsPacked = 6;
  121. optional bool IsShow = 7;
  122. optional bool CanShow = 8;
  123. optional string Nickname = 9;
  124. optional string Avatar = 10;
  125. }
  126. message ReqPlayerList {
  127. repeated ReqPlayer ReqPlayers = 1;
  128. }
  129. message ReqGameRound {
  130. repeated ReqRound Rounds = 1;
  131. }
  132. message ReqBet {
  133. optional int32 betAmount = 1;
  134. }
  135. message ReqResult {
  136. int32 roundSitPos = 1;
  137. int32 result = 2;
  138. }
  139. message ReqRound {
  140. // 回合数
  141. int32 round = 1;
  142. // 回合座位
  143. int32 roundSitPos = 2;
  144. // 回合操作
  145. PlayerOpt playerOpt = 3;
  146. // 用户id
  147. string userId = 4;
  148. }
  149. //error
  150. message MsgError {
  151. int32 error_code = 1;
  152. string error_msg = 2;
  153. }
  154. message Hello {
  155. string name = 1;
  156. }
  157. message ReqRoomTipsMessage {
  158. string message = 1;
  159. }