common.proto 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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. int32 sitPos = 1;
  71. 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. }
  96. message PlayerOpt {
  97. PlayerOptType opt_type = 1; // 操作类型
  98. int32 bet_amount = 2; // 下注金额
  99. int64 timestamp = 3; // 操作时间戳
  100. repeated ReqCard seenCards = 4; // 看牌的牌
  101. }
  102. message ReqRoom {
  103. string Id = 1;
  104. repeated ReqPlayer ReqPlayers = 2;
  105. int32 Status = 3;
  106. int32 Round = 4;
  107. ReqGameRound GameRound = 5;
  108. }
  109. message ReqCard {
  110. int32 Color = 1;
  111. int32 Point = 2;
  112. }
  113. message ReqPlayer {
  114. string Id = 1;
  115. repeated ReqCard HandCards =2;
  116. optional int32 SitPos = 3;
  117. optional bool IsDealer = 4;
  118. optional bool IsSeen = 5;
  119. optional bool IsPacked = 6;
  120. optional bool IsShow = 7;
  121. }
  122. message ReqPlayerList {
  123. repeated ReqPlayer ReqPlayers = 1;
  124. }
  125. message ReqGameRound {
  126. repeated ReqRound Rounds = 1;
  127. }
  128. message ReqRound {
  129. // 回合数
  130. int32 round = 1;
  131. // 回合座位
  132. int32 roundSitPos = 2;
  133. // 回合操作
  134. PlayerOpt playerOpt = 3;
  135. // 用户id
  136. string userId = 4;
  137. }
  138. //error
  139. message MsgError {
  140. int32 error_code = 1;
  141. string error_msg = 2;
  142. }
  143. message Hello {
  144. string name = 1;
  145. }