merge dev2
This commit is contained in:
commit
48baafc4b0
@ -122,6 +122,7 @@ class Human : public MoveableEntity
|
|||||||
|
|
||||||
long long send_msg_times = 0;
|
long long send_msg_times = 0;
|
||||||
|
|
||||||
|
Weapon spec_weapon;
|
||||||
std::map<int, int> weapon_configs;
|
std::map<int, int> weapon_configs;
|
||||||
std::map<int, int> skin_configs;
|
std::map<int, int> skin_configs;
|
||||||
|
|
||||||
|
@ -871,6 +871,26 @@ void Player::ProcPrepareItems(const ::google::protobuf::RepeatedField< ::google:
|
|||||||
curr_weapon->ammo = add_num;
|
curr_weapon->ammo = add_num;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (spec_weapon.weapon_id != 0) {
|
||||||
|
MetaData::Equip* item_meta = MetaMgr::Instance()->GetEquip(spec_weapon.weapon_id);
|
||||||
|
if (item_meta &&
|
||||||
|
item_meta->i->equip_type() == EQUIP_TYPE_WEAPON) {
|
||||||
|
if (item_meta->i->equip_subtype() != 1) {
|
||||||
|
Weapon* weapon = &weapons[GUN_SLOT1];
|
||||||
|
weapon->weapon_idx = GUN_SLOT1;
|
||||||
|
if (curr_weapon != &weapons[GUN_SLOT2]) {
|
||||||
|
curr_weapon = &weapons[GUN_SLOT1];
|
||||||
|
}
|
||||||
|
if (weapon) {
|
||||||
|
weapon->weapon_id = spec_weapon.weapon_id;
|
||||||
|
weapon->weapon_lv = spec_weapon.weapon_lv;
|
||||||
|
weapon->ammo = spec_weapon.ammo;
|
||||||
|
weapon->meta = item_meta;
|
||||||
|
weapon->Recalc();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
need_sync_active_player = true;
|
need_sync_active_player = true;
|
||||||
if (prepare_items.size() > 0) {
|
if (prepare_items.size() > 0) {
|
||||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||||
|
@ -74,6 +74,9 @@ Player* PlayerMgr::CreatePlayerByCMJoin(long ip_saddr, int socket, const cs::CMJ
|
|||||||
for (auto& weapon : msg.weapons()) {
|
for (auto& weapon : msg.weapons()) {
|
||||||
if (weapon.weapon_id() != 0 && weapon.weapon_lv() > 0) {
|
if (weapon.weapon_id() != 0 && weapon.weapon_lv() > 0) {
|
||||||
hum->weapon_configs[weapon.weapon_id()] = weapon.weapon_lv();
|
hum->weapon_configs[weapon.weapon_id()] = weapon.weapon_lv();
|
||||||
|
hum->spec_weapon.weapon_id = weapon.weapon_id();
|
||||||
|
hum->spec_weapon.weapon_lv = weapon.weapon_lv();
|
||||||
|
hum->spec_weapon.ammo = weapon.ammo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (auto& skin : msg.skins()) {
|
for (auto& skin : msg.skins()) {
|
||||||
|
@ -682,6 +682,7 @@ message CMJoin
|
|||||||
optional int32 parachute = 26; //降落伞
|
optional int32 parachute = 26; //降落伞
|
||||||
optional bool has_pass = 27; //是否有通行证
|
optional bool has_pass = 27; //是否有通行证
|
||||||
optional int32 today_enter_times = 28; //今天进入游戏的次数
|
optional int32 today_enter_times = 28; //今天进入游戏的次数
|
||||||
|
repeated MFWeapon grow_weapons = 30; //武器养成
|
||||||
}
|
}
|
||||||
|
|
||||||
//移动
|
//移动
|
||||||
|
Loading…
x
Reference in New Issue
Block a user