完成武器协议定义

This commit is contained in:
aozhiwei 2019-04-02 11:14:11 +08:00
parent 7f21ebc7d1
commit 61bf237ab7
3 changed files with 17 additions and 4 deletions

View File

@ -57,7 +57,9 @@ void Human::FillMFObjectFull(cs::MFObjectFull* full_data)
p->set_helmet(helmet); p->set_helmet(helmet);
p->set_chest(chest); p->set_chest(chest);
#if 0
p->set_weapon(weapon); p->set_weapon(weapon);
#endif
p->set_energy_shield(energy_shield); p->set_energy_shield(energy_shield);
p->set_vip(vip); p->set_vip(vip);
p->set_sdmg(sdmg); p->set_sdmg(sdmg);
@ -72,7 +74,9 @@ void Human::Shot(Vector2D& target_dir)
{ {
cs::MFShot* shot = room->frame_data.shots.Add(); cs::MFShot* shot = room->frame_data.shots.Add();
shot->set_player_id(entity_uniid); shot->set_player_id(entity_uniid);
#if 0
shot->set_weapon_id(weapon_meta->i->id()); shot->set_weapon_id(weapon_meta->i->id());
#endif
shot->set_offhand(true); shot->set_offhand(true);
shot->set_bullskin(10001); shot->set_bullskin(10001);
} }

View File

@ -138,7 +138,9 @@ void Player::Shot()
{ {
cs::MFShot* shot = room->frame_data.shots.Add(); cs::MFShot* shot = room->frame_data.shots.Add();
shot->set_player_id(entity_uniid); shot->set_player_id(entity_uniid);
#if 0
shot->set_weapon_id(weapon_meta->i->id()); shot->set_weapon_id(weapon_meta->i->id());
#endif
shot->set_offhand(true); shot->set_offhand(true);
shot->set_bullskin(10001); shot->set_bullskin(10001);
} }

View File

@ -119,6 +119,13 @@ message MFPlug
optional int32 param = 3; optional int32 param = 3;
} }
//
message MFWeapon
{
optional int32 weapon_id = 1; //id weapon_id == 0
optional int32 num = 2; //
}
//- //-
message MFPlayerPart message MFPlayerPart
{ {
@ -145,7 +152,7 @@ message MFPlayerFull
optional int32 backpack = 14; // optional int32 backpack = 14; //
optional int32 helmet = 16; // optional int32 helmet = 16; //
optional int32 chest = 17; // optional int32 chest = 17; //
optional int32 weapon = 18; // optional MFWeapon weapon = 18; //
optional int32 energy_shield = 19; // optional int32 energy_shield = 19; //
optional int32 vip = 20; //vip optional int32 vip = 20; //vip
optional int32 sdmg = 21; optional int32 sdmg = 21;
@ -367,8 +374,8 @@ message MFActivePlayerData
*/ */
repeated int32 inventory = 11; // repeated int32 inventory = 11; //
optional int32 cur_weap_idx = 15; // 0-3 optional int32 cur_weapon_idx = 15; // 0-4
repeated int32 weapons = 16; // repeated MFWeapon weapons = 16; //1-4 0 1 2 3 4
optional int32 spectator_count = 20; optional int32 spectator_count = 20;
} }
@ -427,7 +434,7 @@ message MFBullet
message MFShot message MFShot
{ {
optional int32 player_id = 1; //id optional int32 player_id = 1; //id
optional int32 weapon_id = 2; //id optional MFWeapon weapon = 2; //id
optional bool offhand = 3; optional bool offhand = 3;
optional int32 bullskin = 4; optional int32 bullskin = 4;
} }