common.proto 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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. }
  72. // 通知客户端操作
  73. message ReqPlayerAction {
  74. int32 sitPos = 1;
  75. }
  76. // 接到玩家操作
  77. message ResPlayerOptAction {
  78. int32 sitPos = 1;
  79. PlayerOpt playerOpt = 2;
  80. string roomId = 3;
  81. string gameId = 4;
  82. string userId = 5;
  83. }
  84. // PlayerOptType 玩家操作类型
  85. enum PlayerOptType {
  86. OPT_NONE = 0; // 无操作
  87. OPT_LOOK_CARD = 1; // 看牌
  88. OPT_DISCARD = 2; // 弃牌
  89. OPT_CALL = 3; // 跟注
  90. OPT_RAISE = 4; // 加注
  91. OPT_DOUBLE = 5; // 加倍
  92. OPT_FOLD = 6; // 放弃
  93. OPT_SELECT = 7; // 选择操作
  94. }
  95. message PlayerOpt {
  96. PlayerOptType opt_type = 1; // 操作类型
  97. int32 bet_amount = 2; // 下注金额
  98. int64 timestamp = 3; // 操作时间戳
  99. }
  100. message ReqRoom {
  101. string Id = 1;
  102. repeated ReqPlayer ReqPlayers = 2;
  103. int32 Status = 3;
  104. int32 Round = 4;
  105. ReqGameRound GameRound = 5;
  106. }
  107. message ReqCard {
  108. int32 Color = 1;
  109. int32 Point = 2;
  110. }
  111. message ReqPlayer {
  112. string Id = 1;
  113. repeated ReqCard HandCards =2;
  114. int32 SitPos = 3;
  115. bool IsDealer = 4;
  116. }
  117. message ReqGameRound {
  118. repeated ReqRound Rounds = 1;
  119. }
  120. message ReqRound {
  121. // 回合数
  122. int32 round = 1;
  123. // 回合座位
  124. int32 roundSitPos = 2;
  125. // 回合操作
  126. PlayerOpt playerOpt = 3;
  127. // 用户id
  128. string userId = 4;
  129. }
  130. //error
  131. message MsgError {
  132. int32 error_code = 1;
  133. string error_msg = 2;
  134. }
  135. message Hello {
  136. string name = 1;
  137. }