// Message2Client syntax = "proto3"; package protobuf; import "MessageType.proto"; import "Message2Server.proto"; message MessageOfHuman { int32 x = 1; int32 y = 2; int32 speed = 3; int32 life = 4; // 本次未倒地前的血量,也即还可以受的伤害 int32 hanged_time = 5; // 被挂上的次数 double time_until_skill_available = 6; PlaceType place = 7; PropType prop = 8; HumanType human_type = 9; int64 guid = 10; bool on_chair = 11; // 是否被挂 double chair_time = 12; // 被挂的时间 bool on_ground = 13; // 是否倒地 double ground_time = 14; // 倒地时间 int64 player_id = 15; repeated HumanBuffType buff = 16; } message MessageOfButcher { int32 x = 1; int32 y = 2; int32 speed = 3; int32 damage = 4; double time_until_skill_available = 5; PlaceType place = 6; PropType prop = 7; ButcherType butcher_type = 8; int64 guid = 9; bool movable = 10; // 是否进入了攻击后摇 int64 playerID = 11; repeated ButcherBuffType buff = 12; } message MessageOfProp // 可拾取道具的信息 { PropType type = 1; int32 x = 2; int32 y = 3; double facing_direction = 4; int64 guid = 5; PlaceType place = 6; } message MessageOfPickedProp //for Unity,直接继承自THUAI5 { PropType type = 1; int32 x = 2; int32 y = 3; double facing_direction = 4; int64 mapping_id = 5; } message MessageOfMap { message Row { repeated PlaceType col = 1; } repeated Row row = 2; } message MessageToClient { repeated MessageOfHuman human_message = 1; repeated MessageOfButcher butcher_message = 2; // 是否真正repeated待定 repeated MessageOfProp prop_message = 3; MessageOfMap map_massage = 4; } message MoveRes // 如果打算设计撞墙保留平行速度分量,且需要返回值则可用这个(大概没啥用) { int64 actual_speed = 1; double actual_angle = 2; } message BoolRes // 用于只需要判断执行操作是否成功的行为,如捡起道具、使用道具 { bool act_success = 1; } service AvailableService { // 游戏开局调用一次的服务 rpc AddPlayer(PlayerMsg) returns(stream MessageToClient); // 连接上后等待游戏开始,server会定时通过该服务向所有client发送消息。 // 游戏过程中玩家执行操作的服务 rpc Move(MoveMsg) returns (MoveRes); rpc PickProp(PickMsg) returns (BoolRes); rpc UseProp(IDMsg) returns (BoolRes); rpc UseSkill(IDMsg) returns (BoolRes); rpc SendMessage(SendMsg) returns (BoolRes); rpc FixMachine(stream IDMsg) returns (stream BoolRes); // 若正常修复且未被打断则返回修复成功,位置错误/被打断则返回修复失败,下同 rpc SaveHuman(stream IDMsg) returns (stream BoolRes); rpc Attack (AttackMsg) returns (BoolRes); rpc CarryHuman (IDMsg) returns (BoolRes); rpc ReleaseHuman (IDMsg) returns (BoolRes); rpc HangHuman (IDMsg) returns (BoolRes); }