You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Message2Clients.proto 3.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. // Message2Client
  2. syntax = "proto3";
  3. package Protobuf;
  4. import "MessageType.proto";
  5. import "Message2Server.proto";
  6. import "google/protobuf/empty.proto";
  7. message MessageOfHuman
  8. {
  9. int32 x = 1;
  10. int32 y = 2;
  11. int32 speed = 3;
  12. int32 life = 4; // 本次未倒地前的血量,也即还可以受的伤害
  13. int32 hangedTime = 5; // 被挂上的次数
  14. double timeUntilSkillAvailable = 6;
  15. PlaceType place = 7;
  16. PropType prop = 8;
  17. HumanType humanType = 9;
  18. int64 guid = 10;
  19. bool onChair = 11; // 是否被挂
  20. double chairTime = 12; // 被挂的时间
  21. bool onGround = 13; // 是否倒地
  22. double groundTime = 14; // 倒地时间
  23. int64 playerID = 15;
  24. repeated HumanBuffType buff = 16;
  25. }
  26. message MessageOfButcher
  27. {
  28. int32 x = 1;
  29. int32 y = 2;
  30. int32 speed = 3;
  31. int32 damage = 4;
  32. double timeUntilSkillAvailable = 5;
  33. PlaceType place = 6;
  34. PropType prop = 7;
  35. ButcherType butcherType = 8;
  36. int64 guid = 9;
  37. bool movable = 10; // 是否进入了攻击后摇
  38. int64 playerID = 11;
  39. repeated ButcherBuffType buff = 12;
  40. }
  41. message MessageOfProp // 可拾取道具的信息
  42. {
  43. PropType type = 1;
  44. int32 x = 2;
  45. int32 y = 3;
  46. double facingDirection = 4;
  47. int64 guid = 5;
  48. PlaceType place = 6;
  49. }
  50. message MessageOfPickedProp //for Unity,直接继承自THUAI5
  51. {
  52. PropType type = 1;
  53. int32 x = 2;
  54. int32 y = 3;
  55. double facingDirection = 4;
  56. int64 mappingID = 5;
  57. }
  58. message MessageOfMap
  59. {
  60. message Row
  61. {
  62. repeated PlaceType col = 1;
  63. }
  64. repeated Row row = 2;
  65. }
  66. message MessageToClient
  67. {
  68. repeated MessageOfHuman humanMessage = 1;
  69. repeated MessageOfButcher butcherMessage = 2;
  70. repeated MessageOfProp propMessage = 3;
  71. MessageOfMap mapMassage = 4;
  72. }
  73. message MoveRes // 如果打算设计撞墙保留平行速度分量,且需要返回值则可用这个(大概没啥用)
  74. {
  75. int64 actualSpeed = 1;
  76. double actualAngle = 2;
  77. }
  78. message BoolRes // 用于只需要判断执行操作是否成功的行为,如捡起道具、使用道具
  79. {
  80. bool actSuccess = 1;
  81. }
  82. service AvailableService
  83. {
  84. // 游戏开局调用一次的接口
  85. rpc AddPlayer(PlayerMsg) returns(BoolRes);
  86. // 游戏过程中玩家执行操作的接口
  87. rpc Move(MoveMsg) returns (MoveRes);
  88. rpc PickProp(PickMsg) returns (BoolRes);
  89. rpc UseProp(IDMsg) returns (BoolRes);
  90. rpc UseSkill(IDMsg) returns (BoolRes);
  91. rpc SendMessage(SendMsg) returns (BoolRes);
  92. rpc FixMachine(stream IDMsg) returns (stream BoolRes); // 若正常修复且未被打断则返回修复成功,位置错误/被打断则返回修复失败,下同
  93. rpc SaveHuman(stream IDMsg) returns (stream BoolRes);
  94. rpc Attack (AttackMsg) returns (BoolRes);
  95. rpc CarryHuman (IDMsg) returns (BoolRes);
  96. rpc ReleaseHuman (IDMsg) returns (BoolRes);
  97. rpc HangHuman (IDMsg) returns (BoolRes);
  98. // 游戏过程中玩家获取信息的接口
  99. rpc GetInfo(google.protobuf.Empty) returns (stream MessageToClient); // 可直接获取全部的信息
  100. }