game.proto 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. syntax = "proto3"; //指定版本,必须要写(proto3、proto2)
  2. option go_package="./;gameproto";
  3. package gameproto;
  4. enum NotifyTypeEnum {
  5. NotifyTypePing = 0;
  6. NotifyTypeJoinRoom = 1;
  7. NotifyTypeLeaveRoom = 2;
  8. NotifyTypeConnect = 3;
  9. NotifyTypeDisconnect = 4;
  10. NotifyTypeReady = 5;
  11. NotifyTypeUnReady = 6;
  12. NotifyTypeStart = 7;
  13. NotifyTypeChooseMaster = 8;
  14. NotifyTypeChooseMasterFinish = 9;
  15. NotifyTypeChooseMul = 10;
  16. NotifyTypeChooseMulinish = 11;
  17. NotifyTypeGameInit = 12;
  18. NotifyTypeOpen = 13;
  19. }
  20. enum DataType {
  21. DataTypeNormal = 0; //0x00000000
  22. DataTypeGZip = 2; //0x00000010
  23. DataTypeEnc = 4; //0x00000100
  24. }
  25. enum RoomType {
  26. RoomTypeFree = 0;
  27. RoomTypeNormal = 1;
  28. }
  29. //Ping
  30. message Ping {
  31. }
  32. message Room {
  33. uint32 ID = 1;
  34. string Name = 2;
  35. RoomType RoomType = 3;
  36. double BseAmount = 4;
  37. uint32 ChairUserID1 = 5;
  38. uint32 ChairUserID2 = 6;
  39. uint32 ChairUserID3 = 7;
  40. uint32 ChairUserID4 = 8;
  41. uint32 ChairUserID5 = 9;
  42. }
  43. message Connect {
  44. uint32 UserID = 1;
  45. string Name = 2;
  46. string Img = 3;
  47. double Balance = 4;
  48. repeated Room RoomList = 5;
  49. }
  50. message Disconnect {
  51. uint32 UserID = 1;
  52. }
  53. message JoinRoom {
  54. uint32 RoomID = 1;
  55. uint32 ChairID = 2;
  56. uint32 UserID = 3;
  57. uint32 GameStatus = 4;
  58. }
  59. message LeaveRoom {
  60. uint32 RoomID = 1;
  61. uint32 ChairID = 2;
  62. uint32 UserID = 3;
  63. }
  64. message Ready {
  65. uint32 RoomID = 1;
  66. uint32 UserID = 3;
  67. }
  68. message UnReady {
  69. uint32 RoomID = 1;
  70. uint32 UserID = 3;
  71. }
  72. //准备人数够,开始游戏
  73. message Start {
  74. uint32 RoomID = 1;
  75. repeated uint32 MulList = 2; //抢庄倍数列表
  76. }
  77. //选庄
  78. message ChooseMaster {
  79. uint32 UserID = 1;
  80. uint32 Mul = 2; //0,1,2,3 - 0表示不抢
  81. uint32 RoomID = 3;
  82. }
  83. //选倍数
  84. message ChooseMul {
  85. uint32 UserID = 1;
  86. uint32 Mul = 2; //1,2,3 - 倍数
  87. uint32 RoomID = 3;
  88. }
  89. //选庄完成
  90. message ChooseMasterFinish {
  91. uint32 MasterUserID = 1; //庄家的ID
  92. repeated uint32 MulList = 2; //倍数列表
  93. uint32 RoomID = 3;
  94. }
  95. //选倍数完成
  96. message ChooseMulinish {
  97. uint32 RoomID = 3;
  98. }
  99. //开牌
  100. message Open {
  101. uint32 RoomID = 1;
  102. uint32 UserID = 2;
  103. repeated uint32 CardList = 3; //牌型列表
  104. double winloss = 4; //输赢
  105. }
  106. //游戏初始化
  107. message GameInit {
  108. uint32 RoomID = 1;
  109. }