common.proto 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. string type = 8;
  65. }
  66. // 通知客户端发牌
  67. message ReqDealCard {
  68. int32 sitPos = 1;
  69. }
  70. // 通知客户端操作
  71. message ReqPlayerAction {
  72. int32 sitPos = 1;
  73. }
  74. // 接到玩家操作
  75. message ResPlayerOptAction {
  76. int32 sitPos = 1;
  77. PlayerOpt playerOpt = 2;
  78. string roomId = 3;
  79. string gameId = 4;
  80. string userId = 5;
  81. }
  82. // PlayerOptType 玩家操作类型
  83. enum PlayerOptType {
  84. OPT_NONE = 0; // 无操作
  85. OPT_LOOK_CARD = 1; // 看牌
  86. OPT_DISCARD = 2; // 弃牌
  87. OPT_CALL = 3; // 跟注
  88. OPT_RAISE = 4; // 加注
  89. OPT_DOUBLE = 5; // 加倍
  90. OPT_FOLD = 6; // 放弃
  91. }
  92. message PlayerOpt {
  93. PlayerOptType opt_type = 1; // 操作类型
  94. int32 bet_amount = 2; // 下注金额
  95. int64 timestamp = 3; // 操作时间戳
  96. }
  97. message ReqRound {
  98. // 回合数
  99. int32 round = 1;
  100. // 回合座位
  101. int32 roundSitPos = 2;
  102. // 回合操作
  103. PlayerOpt playerOpt = 3;
  104. // 用户id
  105. string userId = 4;
  106. }
  107. //error
  108. message MsgError {
  109. int32 error_code = 1;
  110. string error_msg = 2;
  111. }
  112. message Hello {
  113. string name = 1;
  114. }