This commit is contained in:
aozhiwei 2019-11-20 20:08:46 +08:00
parent f976854d2d
commit 8af6785383
4 changed files with 55 additions and 28 deletions

View File

@ -54,8 +54,10 @@ void Human::FillMFObjectPart(cs::MFObjectPart* part_data)
part_data->set_object_type(ET_Player); part_data->set_object_type(ET_Player);
cs::MFPlayerPart* p = part_data->mutable_union_obj_1(); cs::MFPlayerPart* p = part_data->mutable_union_obj_1();
p->set_obj_uniid(entity_uniid); p->set_obj_uniid(entity_uniid);
#if 0
TypeConvert::ToPb(pos, p->mutable_pos()); TypeConvert::ToPb(pos, p->mutable_pos());
TypeConvert::ToPb(attack_dir, p->mutable_dir()); TypeConvert::ToPb(attack_dir, p->mutable_dir());
#endif
} }
void Human::FillMFObjectFull(cs::MFObjectFull* full_data) void Human::FillMFObjectFull(cs::MFObjectFull* full_data)
@ -63,8 +65,10 @@ void Human::FillMFObjectFull(cs::MFObjectFull* full_data)
full_data->set_object_type(ET_Player); full_data->set_object_type(ET_Player);
cs::MFPlayerFull* p = full_data->mutable_union_obj_1(); cs::MFPlayerFull* p = full_data->mutable_union_obj_1();
p->set_obj_uniid(entity_uniid); p->set_obj_uniid(entity_uniid);
#if 0
TypeConvert::ToPb(pos, p->mutable_pos()); TypeConvert::ToPb(pos, p->mutable_pos());
TypeConvert::ToPb(attack_dir, p->mutable_dir()); TypeConvert::ToPb(attack_dir, p->mutable_dir());
#endif
p->set_dead(dead); p->set_dead(dead);
p->set_disconnected(disconnected); p->set_disconnected(disconnected);

View File

@ -4,13 +4,13 @@
namespace TypeConvert namespace TypeConvert
{ {
void ToPb(const a8::Vec2& v, cs::MFVector2D* pb_obj) void ToPb(const a8::Vec2& v, cs::MFVec2* pb_obj)
{ {
pb_obj->set_x(v.x); pb_obj->set_x(v.x);
pb_obj->set_y(v.y); pb_obj->set_y(v.y);
} }
void FromPb(a8::Vec2& v, const cs::MFVector2D* pb_obj) void FromPb(a8::Vec2& v, const cs::MFVec2* pb_obj)
{ {
v.x = pb_obj->x(); v.x = pb_obj->x();
v.y = pb_obj->y(); v.y = pb_obj->y();

View File

@ -2,11 +2,11 @@
namespace cs namespace cs
{ {
class MFVector2D; class MFVec2;
} }
namespace TypeConvert namespace TypeConvert
{ {
void ToPb(const a8::Vec2& v, cs::MFVector2D* pb_obj); void ToPb(const a8::Vec2& v, cs::MFVec2* pb_obj);
void FromPb(a8::Vec2& v, const cs::MFVector2D* pb_obj); void FromPb(a8::Vec2& v, const cs::MFVec2* pb_obj);
} }

View File

@ -88,7 +88,7 @@ message MFPair64
} }
// //
message MFVector2D message MFVec2
{ {
optional float x = 1; //x轴 optional float x = 1; //x轴
optional float y = 2; //y轴 optional float y = 2; //y轴
@ -119,7 +119,7 @@ message MFPropertyChg
message MFMapObject message MFMapObject
{ {
optional int32 object_id = 1; //id(mapThing表id) optional int32 object_id = 1; //id(mapThing表id)
optional MFVector2D pos = 2; // optional MFVec2 pos = 2; //
} }
// //
@ -130,6 +130,29 @@ message MFPlayerInfo
optional string name = 3; optional string name = 3;
} }
//
message MFSnakeHead
{
optional MFVec2 pos = 1; //
optional MFVec2 dir = 2; //
optional float radius = 3; //
optional float speed = 4; //
}
//
message MFSnakeBody
{
optional MFVec2 pos = 1; //
}
//
message MFSnake
{
optional MFSnakeHead snake_head = 1; //
repeated MFSnakeBody snake_body = 2; //
optional int32 total_mass = 3; //
}
// //
message MFSkin message MFSkin
{ {
@ -141,16 +164,14 @@ message MFSkin
message MFPlayerPart message MFPlayerPart
{ {
optional int32 obj_uniid = 1; //id optional int32 obj_uniid = 1; //id
optional MFVector2D pos = 2; // optional MFSnake snake = 2; //
optional MFVector2D dir = 3; //
} }
//- //-
message MFPlayerFull message MFPlayerFull
{ {
optional int32 obj_uniid = 1; //id optional int32 obj_uniid = 1; //id
optional MFVector2D pos = 2; // optional MFSnake snake = 2; //
optional MFVector2D dir = 3; //
optional bool dead = 7; // optional bool dead = 7; //
optional bool disconnected = 9; // optional bool disconnected = 9; //
@ -167,7 +188,7 @@ message MFPlayerFull
message MFObstaclePart message MFObstaclePart
{ {
optional int32 obj_uniid = 1; //id optional int32 obj_uniid = 1; //id
optional MFVector2D pos = 2; // optional MFVec2 pos = 2; //
optional float scale = 3; // optional float scale = 3; //
} }
@ -175,7 +196,7 @@ message MFObstaclePart
message MFObstacleFull message MFObstacleFull
{ {
optional int32 obj_uniid = 1; //id optional int32 obj_uniid = 1; //id
optional MFVector2D pos = 2; // optional MFVec2 pos = 2; //
optional float scale = 3; // optional float scale = 3; //
optional int32 obstacle_id = 6; //id optional int32 obstacle_id = 6; //id
@ -187,14 +208,14 @@ message MFObstacleFull
message MFLootPart message MFLootPart
{ {
optional int32 obj_uniid = 1; //id optional int32 obj_uniid = 1; //id
optional MFVector2D pos = 2; // optional MFVec2 pos = 2; //
} }
//loot- //loot-
message MFLootFull message MFLootFull
{ {
optional int32 obj_uniid = 1; //id optional int32 obj_uniid = 1; //id
optional MFVector2D pos = 2; // optional MFVec2 pos = 2; //
optional int32 item_id = 6; optional int32 item_id = 6;
optional int32 count = 7; optional int32 count = 7;
@ -248,8 +269,8 @@ message MFGasData
message MFTeamData message MFTeamData
{ {
optional int32 player_id = 1; //id optional int32 player_id = 1; //id
optional MFVector2D pos = 2; // optional MFVec2 pos = 2; //
optional MFVector2D dir = 3; // optional MFVec2 dir = 3; //
optional bool disconnected = 5 [default = false]; //线 optional bool disconnected = 5 [default = false]; //线
optional bool dead = 6 [default = false]; // optional bool dead = 6 [default = false]; //
optional string name = 8; // optional string name = 8; //
@ -332,8 +353,8 @@ message CMMove
{ {
optional int32 seq = 1; // optional int32 seq = 1; //
optional MFVector2D move_dir = 24; //- optional MFVec2 move_dir = 24; //-
optional MFVector2D attack_dir = 20; //() optional MFVec2 attack_dir = 20; //()
optional bool spectate = 30; // optional bool spectate = 30; //
optional int32 emote = 31; //id optional int32 emote = 31; //id
} }
@ -348,7 +369,7 @@ message CMDropItem
message CMEmote message CMEmote
{ {
optional int32 type = 1; optional int32 type = 1;
optional MFVector2D pos = 2; optional MFVec2 pos = 2;
optional bool team_only = 4; optional bool team_only = 4;
} }
@ -393,15 +414,17 @@ message SMWatchWar
// //
message SMJoinedNotify message SMJoinedNotify
{ {
optional int32 team_mode = 1; // 0: 1: optional int32 error_code = 1; // 1: 2
optional int32 player_id = 2; //id() optional int32 team_mode = 2; // 0: 1:
optional bool started = 3; // optional int32 player_id = 3; //id()
optional string room_uuid = 4; //id optional bool started = 4; //
optional string room_uuid = 5; //id
optional int32 map_type = 5; // optional int32 left_time = 6; //()
optional bool elo_start = 6; // optional int32 scene_width = 7; //
optional int32 grid_widht = 8; //
optional int32 error_code = 7; // 1: 2 optional int32 server_time = 9; //
optional int32 update_hz = 10; //
} }
// //