common.proto 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. ReqRoom roomInfo = 4;
  35. }
  36. //玩法列表
  37. message PlayList {
  38. string userId = 1;
  39. }
  40. //商城
  41. message Shop {
  42. string userId = 1;
  43. }
  44. message ResGameInfo {
  45. string gameId = 1;
  46. }
  47. message ReqGameInfo {
  48. string gameId = 1;
  49. string gameName = 2;
  50. string gameStatus = 4;
  51. string gameType = 5;
  52. TeenPattiRoomList teenPattiRoomList = 6;
  53. }
  54. message TeenPattiRoomList {
  55. repeated TeenPattiRoom teenPattiRoom = 1;
  56. }
  57. message TeenPattiRoom {
  58. string boot = 1; //0.1
  59. string minBuyin = 2; // 1
  60. string chaalLimmit = 3; // 12.8
  61. string potLimit = 4; //102.40
  62. string totalPlayers = 5; // 3999
  63. string roomLevel = 6; //low - mid - high
  64. string roomId = 7;
  65. string type = 8;
  66. }
  67. // 通知客户端发牌
  68. message ReqDealCard {
  69. int32 sitPos = 1;
  70. }
  71. // 通知客户端操作
  72. message ReqPlayerAction {
  73. int32 sitPos = 1;
  74. }
  75. // 接到玩家操作
  76. message ResPlayerOptAction {
  77. int32 sitPos = 1;
  78. PlayerOpt playerOpt = 2;
  79. string roomId = 3;
  80. string gameId = 4;
  81. string userId = 5;
  82. }
  83. // PlayerOptType 玩家操作类型
  84. enum PlayerOptType {
  85. OPT_NONE = 0; // 无操作
  86. OPT_LOOK_CARD = 1; // 看牌
  87. OPT_DISCARD = 2; // 弃牌
  88. OPT_CALL = 3; // 跟注
  89. OPT_RAISE = 4; // 加注
  90. OPT_DOUBLE = 5; // 加倍
  91. OPT_FOLD = 6; // 放弃
  92. }
  93. message PlayerOpt {
  94. PlayerOptType opt_type = 1; // 操作类型
  95. int32 bet_amount = 2; // 下注金额
  96. int64 timestamp = 3; // 操作时间戳
  97. }
  98. message ReqRoom {
  99. string Id = 1;
  100. repeated ReqPlayer ReqPlayer = 2;
  101. int32 Status = 3;
  102. int32 Round = 4;
  103. ReqGameRound GameRound = 5;
  104. }
  105. message ReqCard {
  106. int32 Color = 1;
  107. int32 Point = 2;
  108. }
  109. message ReqPlayer {
  110. string Id = 1;
  111. repeated ReqCard HandCards =2;
  112. int32 SitPos = 3;
  113. bool IsDealer = 4;
  114. }
  115. message ReqGameRound {
  116. repeated ReqRound Rounds = 1;
  117. }
  118. message ReqRound {
  119. // 回合数
  120. int32 round = 1;
  121. // 回合座位
  122. int32 roundSitPos = 2;
  123. // 回合操作
  124. PlayerOpt playerOpt = 3;
  125. // 用户id
  126. string userId = 4;
  127. }
  128. //error
  129. message MsgError {
  130. int32 error_code = 1;
  131. string error_msg = 2;
  132. }
  133. message Hello {
  134. string name = 1;
  135. }