diff --git a/server/gameserver/player.h b/server/gameserver/player.h index b3c81de..51f0bf1 100644 --- a/server/gameserver/player.h +++ b/server/gameserver/player.h @@ -53,6 +53,9 @@ class Player : public Human int emote_id = 0; bool use_skill = false; + int skill_target_id = 0; + a8::Vec2 skill_dir; + float skill_param1 = 0; ::google::protobuf::RepeatedField< ::google::protobuf::int32 > interaction_objids; diff --git a/server/gameserver/typeconvert.cc b/server/gameserver/typeconvert.cc index eefa804..e101ae5 100644 --- a/server/gameserver/typeconvert.cc +++ b/server/gameserver/typeconvert.cc @@ -4,13 +4,13 @@ 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_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.y = pb_obj->y(); diff --git a/server/gameserver/typeconvert.h b/server/gameserver/typeconvert.h index ab84f02..71c50da 100644 --- a/server/gameserver/typeconvert.h +++ b/server/gameserver/typeconvert.h @@ -2,11 +2,11 @@ namespace cs { - class MFVector2D; + class MFVec2; } namespace TypeConvert { - void ToPb(const a8::Vec2& v, cs::MFVector2D* pb_obj); - void FromPb(a8::Vec2& v, const cs::MFVector2D* pb_obj); + void ToPb(const a8::Vec2& v, cs::MFVec2* pb_obj); + void FromPb(a8::Vec2& v, const cs::MFVec2* pb_obj); } diff --git a/server/tools/protobuild/cs_proto.proto b/server/tools/protobuild/cs_proto.proto index 3254b1d..36292a5 100755 --- a/server/tools/protobuild/cs_proto.proto +++ b/server/tools/protobuild/cs_proto.proto @@ -88,7 +88,7 @@ message MFTuple } //向量 -message MFVector2D +message MFVec2 { optional float x = 1; //x轴 optional float y = 2; //y轴 @@ -98,7 +98,7 @@ message MFVector2D message MFMapObject { optional int32 object_id = 1; //物件id(mapThing表id) - optional MFVector2D pos = 2; //位置 + optional MFVec2 pos = 2; //位置 } //玩家信息 @@ -128,8 +128,8 @@ message MFSkin message MFPlayerPart { optional int32 obj_uniid = 1; //唯一id - optional MFVector2D pos = 2; //位置 - optional MFVector2D dir = 3; //朝向 + optional MFVec2 pos = 2; //位置 + optional MFVec2 dir = 3; //朝向 optional float max_health = 5; //血量上限(只有变化时才发,没变化时为undefined) optional float health = 6; //血量(只有变化时才发,没变化时为undefined) @@ -141,8 +141,8 @@ message MFPlayerPart message MFPlayerFull { optional int32 obj_uniid = 1; //唯一id - optional MFVector2D pos = 2; //位置 - optional MFVector2D dir = 3; //朝向 + optional MFVec2 pos = 2; //位置 + optional MFVec2 dir = 3; //朝向 optional float max_health = 5; //血量 optional float health = 6; //血量 @@ -163,7 +163,7 @@ message MFPlayerFull message MFObstaclePart { optional int32 obj_uniid = 1; //唯一id - optional MFVector2D pos = 2; //位置 + optional MFVec2 pos = 2; //位置 optional float scale = 3; //缩放比 } @@ -171,7 +171,7 @@ message MFObstaclePart message MFObstacleFull { optional int32 obj_uniid = 1; //唯一id - optional MFVector2D pos = 2; //位置 + optional MFVec2 pos = 2; //位置 optional float scale = 3; //缩放比 optional int32 obstacle_id = 6; //阻挡物id @@ -200,14 +200,14 @@ message MFObstacleFull message MFBuildingPart { optional int32 obj_uniid = 1; //唯一id - optional MFVector2D pos = 2; //位置 + optional MFVec2 pos = 2; //位置 } //建筑物-全量 message MFBuildingFull { optional int32 obj_uniid = 1; //唯一id - optional MFVector2D pos = 2; //位置 + optional MFVec2 pos = 2; //位置 optional int32 building_id = 3; //建筑物id optional bool ceiling_dead = 6; @@ -217,7 +217,7 @@ message MFBuildingFull message MFLootSpawnerPart { optional int32 obj_uniid = 1; //唯一id - optional MFVector2D pos = 2; //位置 + optional MFVec2 pos = 2; //位置 optional int32 loot_id = 3; //id } @@ -225,7 +225,7 @@ message MFLootSpawnerPart message MFLootSpawnerFull { optional int32 obj_uniid = 1; //唯一id - optional MFVector2D pos = 2; //位置 + optional MFVec2 pos = 2; //位置 optional int32 loot_id = 3; //id } @@ -233,14 +233,14 @@ message MFLootSpawnerFull message MFLootPart { optional int32 obj_uniid = 1; //唯一id - optional MFVector2D pos = 2; //位置 + optional MFVec2 pos = 2; //位置 } //loot-全量 message MFLootFull { optional int32 obj_uniid = 1; //唯一id - optional MFVector2D pos = 2; //位置 + optional MFVec2 pos = 2; //位置 optional int32 item_id = 6; optional int32 count = 7; @@ -251,14 +251,14 @@ message MFLootFull message MFDeadBodyPart { optional int32 obj_uniid = 1; //唯一id - optional MFVector2D pos = 2; //位置 + optional MFVec2 pos = 2; //位置 } //尸体-全量 message MFDeadBodyFull { optional int32 obj_uniid = 1; //唯一id - optional MFVector2D pos = 2; //位置 + optional MFVec2 pos = 2; //位置 optional int32 player_id = 3; //玩家id optional int32 inkjet = 6; @@ -268,7 +268,7 @@ message MFDeadBodyFull message MFDecalPart { optional int32 obj_uniid = 1; //唯一id - optional MFVector2D pos = 2; //位置 + optional MFVec2 pos = 2; //位置 optional int32 decal_id = 3; //id } @@ -276,7 +276,7 @@ message MFDecalPart message MFDecalFull { optional int32 obj_uniid = 1; //唯一id - optional MFVector2D pos = 2; //位置 + optional MFVec2 pos = 2; //位置 optional int32 decal_id = 3; //id } @@ -284,7 +284,7 @@ message MFDecalFull message MFProjectilePart { optional int32 obj_uniid = 1; //唯一id - optional MFVector2D pos = 2; //位置 + optional MFVec2 pos = 2; //位置 optional float pos_z = 3; //没用到 } @@ -292,7 +292,7 @@ message MFProjectilePart message MFProjectileFull { optional int32 obj_uniid = 1; //唯一id - optional MFVector2D pos = 2; //位置 + optional MFVec2 pos = 2; //位置 optional float pos_z = 3; //没用到 } @@ -300,8 +300,8 @@ message MFProjectileFull message MFHeroPart { optional int32 obj_uniid = 1; //唯一id - optional MFVector2D pos = 2; //位置 - optional MFVector2D dir = 3; //朝向 + optional MFVec2 pos = 2; //位置 + optional MFVec2 dir = 3; //朝向 } @@ -309,8 +309,8 @@ message MFHeroPart message MFHeroFull { optional int32 obj_uniid = 1; //唯一id - optional MFVector2D pos = 2; //位置 - optional MFVector2D dir = 3; //朝向 + optional MFVec2 pos = 2; //位置 + optional MFVec2 dir = 3; //朝向 optional int32 masert_uniid = 4; //主人id optional MFSkin skin = 13; //皮肤id @@ -325,7 +325,7 @@ message MFHeroFull message MFSmokePart { optional int32 obj_uniid = 1; //唯一id - optional MFVector2D pos = 2; //位置 + optional MFVec2 pos = 2; //位置 optional float rad = 3; //半径 } @@ -333,7 +333,7 @@ message MFSmokePart message MFSmokeFull { optional int32 obj_uniid = 1; //唯一id - optional MFVector2D pos = 2; //位置 + optional MFVec2 pos = 2; //位置 optional float rad = 3; //半径 } @@ -433,8 +433,8 @@ message MFGasData */ optional int32 mode = 1; //0:inactive 1:started optional float duration = 2; //持续时间(秒) - optional MFVector2D pos_old = 3; //前一个圆心 - optional MFVector2D pos_new = 4; //新圆心 + optional MFVec2 pos_old = 3; //前一个圆心 + optional MFVec2 pos_new = 4; //新圆心 optional float rad_old = 5; //前一个圆半径 optional float rad_new = 6; //新圆半径 } @@ -443,8 +443,8 @@ message MFGasData message MFTeamData { optional int32 player_id = 1; //玩家id - optional MFVector2D pos = 2; //位置 - optional MFVector2D dir = 3; //方向 + optional MFVec2 pos = 2; //位置 + optional MFVec2 dir = 3; //方向 optional float health = 4; //血量 optional bool disconnected = 5; //是否短线 optional bool dead = 6; //是否死亡 @@ -458,8 +458,8 @@ message MFBullet { optional int32 player_id = 1; //玩家id optional int32 bullet_id = 2; //子弹id - optional MFVector2D pos = 3; //位置 - optional MFVector2D dir = 4; //方向 + optional MFVec2 pos = 3; //位置 + optional MFVec2 dir = 4; //方向 optional int32 gun_lv = 5; //枪等级 optional int32 bulletskin = 6; //子弹皮肤 @@ -484,7 +484,7 @@ message MFShot message MFExplosion { optional int32 item_id = 1; //配置表id - optional MFVector2D pos = 2; //位置 + optional MFVec2 pos = 2; //位置 optional int32 player_id = 3; //玩家id optional int32 effect = 4 [default = 0]; //爆照效果 0:普通爆照 1:核爆炸 } @@ -493,7 +493,7 @@ message MFExplosion message MFSmoke { optional int32 item_id = 1; //配置表id - optional MFVector2D pos = 2; //位置 + optional MFVec2 pos = 2; //位置 optional int32 player_id = 4; //玩家id } @@ -522,7 +522,7 @@ message MFAirDrop { optional int32 appear_time = 1; //箱子出现时间(毫秒) optional int32 box_id = 2; //箱子id - optional MFVector2D pos = 3; //位置 + optional MFVec2 pos = 3; //位置 } //buff @@ -566,8 +566,8 @@ message CMMove { optional int32 seq = 1; //序号 - optional MFVector2D move_dir = 2; //移动-方向 - optional MFVector2D attack_dir = 3; //攻击方向(朝向) + optional MFVec2 move_dir = 2; //移动-方向 + optional MFVec2 attack_dir = 3; //攻击方向(朝向) optional bool shot_start = 4; //射击-单发 optional bool shot_hold = 5; //射击-连发 @@ -586,7 +586,7 @@ message CMMove optional bool use_skill = 20; //使用技能 optional int32 skill_target_id = 21; //技能目标(单体攻击) - optional MFVector2D skill_dir = 22; //技能方向 + optional MFVec2 skill_dir = 22; //技能方向 optional float skill_param1 = 23; //辅助参数 optional bool spectate = 30; //自杀 @@ -605,7 +605,7 @@ message CMDropItem message CMEmote { optional int32 type = 1; - optional MFVector2D pos = 2; + optional MFVec2 pos = 2; optional bool team_only = 4; } @@ -679,7 +679,7 @@ message SMUpdate optional MFActivePlayerData active_player_data = 6; //活跃玩家数据(如果玩家死亡后是观战对象的数据) optional int32 game_left_time = 15; //游戏剩余时间(毫秒, 战斗开始后字段才有意义) optional int32 gas_progress = 16; //毒圈进度,表示缩进的像素数(只有当gas_data.mode == moving时才会发进度) - optional MFVector2D gas_pos_old = 30; //毒圈当前圆心坐标 + optional MFVec2 gas_pos_old = 30; //毒圈当前圆心坐标 optional MFGasData gas_data = 17; //毒圈数据 repeated MFTeamData team_data = 18; //队伍数据 repeated MFBullet bullets = 20; //子弹