diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 2c6961c..6ba05a7 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -57,7 +57,9 @@ void Human::FillMFObjectFull(cs::MFObjectFull* full_data) p->set_helmet(helmet); p->set_chest(chest); + #if 0 p->set_weapon(weapon); + #endif p->set_energy_shield(energy_shield); p->set_vip(vip); p->set_sdmg(sdmg); @@ -72,7 +74,9 @@ void Human::Shot(Vector2D& target_dir) { cs::MFShot* shot = room->frame_data.shots.Add(); shot->set_player_id(entity_uniid); + #if 0 shot->set_weapon_id(weapon_meta->i->id()); + #endif shot->set_offhand(true); shot->set_bullskin(10001); } diff --git a/server/gameserver/player.cc b/server/gameserver/player.cc index eabef33..fa317df 100644 --- a/server/gameserver/player.cc +++ b/server/gameserver/player.cc @@ -138,7 +138,9 @@ void Player::Shot() { cs::MFShot* shot = room->frame_data.shots.Add(); shot->set_player_id(entity_uniid); + #if 0 shot->set_weapon_id(weapon_meta->i->id()); + #endif shot->set_offhand(true); shot->set_bullskin(10001); } diff --git a/server/tools/protobuild/cs_proto.proto b/server/tools/protobuild/cs_proto.proto index e3f23b7..d6ec411 100755 --- a/server/tools/protobuild/cs_proto.proto +++ b/server/tools/protobuild/cs_proto.proto @@ -119,6 +119,13 @@ message MFPlug optional int32 param = 3; } +//武器 +message MFWeapon +{ + optional int32 weapon_id = 1; //武器id 当weapon_id == 0时表示无装备(装备位置显示空) + optional int32 num = 2; //数量 手雷和烟雾弹时该字段有意义 +} + //玩家信息-部分 message MFPlayerPart { @@ -145,7 +152,7 @@ message MFPlayerFull optional int32 backpack = 14; //背包 optional int32 helmet = 16; //头盔 optional int32 chest = 17; //防弹衣 - optional int32 weapon = 18; //武器 + optional MFWeapon weapon = 18; //武器 optional int32 energy_shield = 19; //能量护盾 optional int32 vip = 20; //vip optional int32 sdmg = 21; @@ -367,8 +374,8 @@ message MFActivePlayerData */ repeated int32 inventory = 11; //库存 - optional int32 cur_weap_idx = 15; //当前武器索引 0-3 - repeated int32 weapons = 16; //武器列表 + optional int32 cur_weapon_idx = 15; //当前武器索引 0-4 + repeated MFWeapon weapons = 16; //武器列表1-4 0:拳头 1:枪 2:枪 3:手雷 4:烟雾弹 optional int32 spectator_count = 20; } @@ -427,7 +434,7 @@ message MFBullet message MFShot { optional int32 player_id = 1; //玩家id - optional int32 weapon_id = 2; //武器id + optional MFWeapon weapon = 2; //武器id optional bool offhand = 3; optional int32 bullskin = 4; }