common.proto 2.3 KB

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