diff --git a/server/gameserver/ability.cc b/server/gameserver/ability.cc index 1b830d37..e40968c3 100644 --- a/server/gameserver/ability.cc +++ b/server/gameserver/ability.cc @@ -1,10 +1,12 @@ #include "precompile.h" #include "ability.h" -#include "metamgr.h" #include "buff.h" #include "creature.h" +#include "mt/Equip.h" +#include "mt/Buff.h" + float Ability::GetAttrAbs(int attr_id) { float attr_abs_val = GetBuffAttrAbs(attr_id); @@ -12,17 +14,17 @@ float Ability::GetAttrAbs(int attr_id) if (owner.Get()) { Buff* buff = owner.Get()->GetBuffByEffectId(kBET_Car); if (buff) { - MetaData::Equip* equip_meta = MetaMgr::Instance()->GetEquip(buff->meta->param4); + const mt::Equip* equip_meta = mt::Equip::GetById(buff->meta->_param4); if (equip_meta) { switch (attr_id) { case kHAT_Atk: { - attr_abs_val += equip_meta->pb->atk(); + attr_abs_val += equip_meta->atk(); } break; case kHAT_Def: { - attr_abs_val += equip_meta->pb->def(); + attr_abs_val += equip_meta->def(); } break; default: diff --git a/server/gameserver/android.cc b/server/gameserver/android.cc index 73e3730c..745a474b 100644 --- a/server/gameserver/android.cc +++ b/server/gameserver/android.cc @@ -1,7 +1,6 @@ #include "precompile.h" #include "android.h" -#include "metamgr.h" #include "room.h" #include "app.h" #include "android_agent.h" @@ -9,6 +8,9 @@ #include "f8/btmgr.h" +#include "mt/Equip.h" +#include "mt/Robot.h" + Android::Android():Human() { #if 0 @@ -110,17 +112,17 @@ void Android::InternalUpdate(int delta_time) void Android::GiveEquip() { - MetaData::Equip* weapon_meta = MetaMgr::Instance()->GetEquip(robot_meta->pb->weapon_id()); + const mt::Equip* weapon_meta = mt::Equip::GetById(robot_meta->weapon_id()); if (weapon_meta) { Weapon& weapon = weapons[GUN_SLOT1]; weapon.weapon_idx = GUN_SLOT1; - weapon.weapon_id = weapon_meta->pb->id(); + weapon.weapon_id = weapon_meta->id(); weapon.ammo = 0; weapon.meta = weapon_meta; weapon.Recalc(); SetCurrWeapon(&weapon); } - sex = robot_meta->pb->sex(); + sex = robot_meta->sex(); if (sex == 0) { sex = rand() % 3; } @@ -128,9 +130,9 @@ void Android::GiveEquip() void Android::RandSkin() { - if (!robot_meta->skin_id.empty()) { + if (!robot_meta->_skin_id.empty()) { Skin& skin = skins[0]; - skin.skin_id = 1 + (robot_meta->pb->id() % 3); + skin.skin_id = 1 + (robot_meta->id() % 3); skin.skin_lv = 1; } } diff --git a/server/gameserver/android.h b/server/gameserver/android.h index ce565289..923fa81c 100644 --- a/server/gameserver/android.h +++ b/server/gameserver/android.h @@ -2,16 +2,11 @@ #include "human.h" -namespace MetaData -{ - class Robot; -} - class AndroidAgent; class Android : public Human { public: - MetaData::Robot* robot_meta = nullptr; + const mt::Robot* robot_meta = nullptr; virtual ~Android() override; virtual void Initialize() override; diff --git a/server/gameserver/app.cc b/server/gameserver/app.cc index 1de1303d..b78c22e3 100644 --- a/server/gameserver/app.cc +++ b/server/gameserver/app.cc @@ -16,7 +16,6 @@ #include "app.h" #include "jsondatamgr.h" #include "handlermgr.h" -#include "metamgr.h" #include "roommgr.h" #include "player.h" #include "playermgr.h" @@ -204,7 +203,6 @@ bool App::Init(int argc, char* argv[]) #endif SkillHelper::Init(); JsonDataMgr::Instance()->Init(); - MetaMgr::Instance()->Init(); mt::MetaMgr::Instance()->Init(); EntityFactory::Instance()->Init(); uuid.SetMachineId((node_id - 1) * MAX_NODE_ID + instance_id); @@ -260,7 +258,6 @@ void App::UnInit() KillMgr::Instance()->UnInit(); EntityFactory::Instance()->UnInit(); mt::MetaMgr::Instance()->UnInit(); - MetaMgr::Instance()->UnInit(); JsonDataMgr::Instance()->UnInit(); f8::BtMgr::Instance()->UnInit(); f8::HttpClientPool::Instance()->UnInit(); diff --git a/server/gameserver/battledatacontext.cc b/server/gameserver/battledatacontext.cc index c4dd87c2..e3558e12 100644 --- a/server/gameserver/battledatacontext.cc +++ b/server/gameserver/battledatacontext.cc @@ -5,7 +5,6 @@ #include "battledatacontext.h" #include "human.h" -#include "metamgr.h" #include "creature.h" #include "types.h" #include "bullet.h" @@ -15,6 +14,13 @@ #include "roommgr.h" #include "mt/Param.h" #include "mt/Hero.h" +#include "mt/HeroQuality.h" +#include "mt/NpcStandard.h" +#include "mt/PveGemini.h" +#include "mt/PveGeminiContent.h" +#include "mt/Equip.h" +#include "mt/Skill.h" +#include "mt/FormulaPvp.h" #include "attrhelper.h" @@ -89,13 +95,13 @@ private: dodge_ = hero_meta->miss(); dodge_damage_ruduce_ = hero_meta->miss_damage_ruduce(); if (c->room->pve_instance) { - MetaData::NpcStandard* standard_meta = MetaMgr::Instance()->GetNpcStandard - (c->room->pve_instance->pb->gemini_lv()); + const mt::NpcStandard* standard_meta = mt::NpcStandard::GetById + (c->room->pve_instance->gemini_lv()); if (standard_meta) { - hp_ = standard_meta->pb->hp() * hero_meta->hp_ratio() * + hp_ = standard_meta->hp() * hero_meta->hp_ratio() * c->room->pve_instance->GetHpMul(c->room->GetHumanNum()); - atk_ = standard_meta->pb->damage() * hero_meta->damage_ratio(); - def_ = standard_meta->pb->defence() * hero_meta->defence_ratio(); + atk_ = standard_meta->damage() * hero_meta->damage_ratio(); + def_ = standard_meta->defence() * hero_meta->defence_ratio(); } else { #ifdef DEBUG abort(); @@ -198,7 +204,7 @@ class WeaponAbility { public: long long weapon_uniid = 0; - MetaData::Equip* weapon_meta = nullptr; + const mt::Equip* weapon_meta = nullptr; std::shared_ptr weapon_dto; float GetAtk() @@ -244,12 +250,12 @@ private: void DefaultInit(Creature* c) { - atk_ = weapon_meta->pb->atk(); - crit_atk_ = weapon_meta->pb->critical(); - crit_atk_ratio_ = weapon_meta->pb->cri_damage(); - clip_volume_ = weapon_meta->pb->clip_volume(); - fire_rate_ = weapon_meta->pb->fire_rate(); - reload_time_ = weapon_meta->pb->reload_time(); + atk_ = weapon_meta->atk(); + crit_atk_ = weapon_meta->critical(); + crit_atk_ratio_ = weapon_meta->cri_damage(); + clip_volume_ = weapon_meta->clip_volume(); + fire_rate_ = weapon_meta->fire_rate(); + reload_time_ = weapon_meta->reload_time(); } void DtoInit(Creature* c) @@ -355,7 +361,7 @@ void BattleDataContext::ParseResult(a8::XObject& obj) } if (obj.HasKey("weapon_dto1") && obj.At("weapon_dto1")->IsObject()) { weapon_dto1 = obj.At("weapon_dto1"); - MetaData::Equip* meta = MetaMgr::Instance()->GetEquip(weapon_dto1->Get("gun_id", 0)); + const mt::Equip* meta = mt::Equip::GetById(weapon_dto1->Get("gun_id", 0)); if (meta) { weapon1_ability_ = std::make_shared(); weapon1_ability_->weapon_uniid = weapon_dto1->Get("gun_uniid", 0); @@ -365,7 +371,7 @@ void BattleDataContext::ParseResult(a8::XObject& obj) } if (obj.HasKey("weapon_dto2") && obj.At("weapon_dto2")->IsObject()) { weapon_dto2 = obj.At("weapon_dto2"); - MetaData::Equip* meta = MetaMgr::Instance()->GetEquip(weapon_dto2->Get("gun_id", 0)); + const mt::Equip* meta = mt::Equip::GetById(weapon_dto2->Get("gun_id", 0)); if (meta) { weapon2_ability_ = std::make_shared(); weapon2_ability_->weapon_uniid = weapon_dto2->Get("gun_uniid", 0); @@ -411,7 +417,7 @@ void BattleDataContext::CalcBattleStat(struct PlayerStats* stats) auto CalcHeroPvpCeg = [] (long long ceg_uplimit, struct PlayerStats* stats) -> long long { - MetaData::FormulaPvp* meta = MetaMgr::Instance()->GetFormulaPvp(stats->ranked_topx); + const mt::FormulaPvp* meta = mt::FormulaPvp::GetById(stats->ranked_topx); if (!meta) { return 0; } @@ -419,11 +425,11 @@ void BattleDataContext::CalcBattleStat(struct PlayerStats* stats) ( ceg_uplimit * ( - (0.5 * stats->ranked_topx * meta->pb->ranked_topx()) + - (0.25 * stats->kills_topx * meta->pb->kills_topx()) + - (0.15 * stats->hero_topx * meta->pb->hero_topx()) + - (0.5 * stats->weapon_topx * meta->pb->weapon_topx()) + - (0.5 * stats->survival_topx * meta->pb->survival_topx()) + (0.5 * stats->ranked_topx * meta->ranked_topx()) + + (0.25 * stats->kills_topx * meta->kills_topx()) + + (0.15 * stats->hero_topx * meta->hero_topx()) + + (0.5 * stats->weapon_topx * meta->weapon_topx()) + + (0.5 * stats->survival_topx * meta->survival_topx()) ) ); return ceg; @@ -431,7 +437,7 @@ void BattleDataContext::CalcBattleStat(struct PlayerStats* stats) auto CalcWeaponPvpCeg = [] (long long ceg_uplimit, struct PlayerStats* stats) -> long long { - MetaData::FormulaPvp* meta = MetaMgr::Instance()->GetFormulaPvp(stats->ranked_topx); + const mt::FormulaPvp* meta = mt::FormulaPvp::GetById(stats->ranked_topx); if (!meta) { return 0; } @@ -439,11 +445,11 @@ void BattleDataContext::CalcBattleStat(struct PlayerStats* stats) ( ceg_uplimit * ( - (0.5 * stats->ranked_topx * meta->pb->ranked_topx()) + - (0.25 * stats->kills_topx * meta->pb->kills_topx()) + - (0.15 * stats->hero_topx * meta->pb->hero_topx()) + - (0.5 * stats->weapon_topx * meta->pb->weapon_topx()) + - (0.5 * stats->survival_topx * meta->pb->survival_topx()) + (0.5 * stats->ranked_topx * meta->ranked_topx()) + + (0.25 * stats->kills_topx * meta->kills_topx()) + + (0.15 * stats->hero_topx * meta->hero_topx()) + + (0.5 * stats->weapon_topx * meta->weapon_topx()) + + (0.5 * stats->survival_topx * meta->survival_topx()) ) ); return ceg; @@ -454,7 +460,7 @@ void BattleDataContext::CalcBattleStat(struct PlayerStats* stats) int quality = hero_dto->Get("quality", 0).GetInt(); int today_get_gold = hero_dto->Get("today_get_gold", 0).GetInt(); const mt::Hero* hero_meta = mt::Hero::GetById(hero_id); - MetaData::HeroQuality* quality_meta = MetaMgr::Instance()->GetHeroQuality(quality); + const mt::HeroQuality* quality_meta = mt::HeroQuality::GetById(quality); stats->pb_hero_stats.set_hero_uniid(a8::XValue(hero_ability_->hero_uniid_).GetString()); stats->pb_hero_stats.set_hero_id(hero_id); @@ -482,14 +488,14 @@ void BattleDataContext::CalcBattleStat(struct PlayerStats* stats) int gun_id = weapon_dto->Get("gun_id", 0).GetInt(); int quality = weapon_dto->Get("quality", 0).GetInt(); int today_get_gold = weapon_dto->Get("today_get_gold", 0).GetInt(); - MetaData::Item* item_meta = MetaMgr::Instance()->GetItem(gun_id); - MetaData::GunQuality* quality_meta = MetaMgr::Instance()->GetGunQuality(quality); + const mt::Item* item_meta = MetaMgr::Instance()->GetItem(gun_id); + const mt::GunQuality* quality_meta = MetaMgr::Instance()->GetGunQuality(quality); auto p = stats->pb_weapons_stats.Add(); p->set_weapon_uniid(gun_uniid); p->set_weapon_id(gun_id); - p->set_weapon_name(item_meta ? item_meta->pb->name() : ""); + p->set_weapon_name(item_meta ? item_meta->name() : ""); if (quality_meta) { int up_limit = quality_meta->GetPvpCegUpLimit(); int ceg = CalcWeaponPvpCeg(up_limit, stats); @@ -639,7 +645,7 @@ float BattleDataContext::GetWeaponAtk(IBullet* bullet) break; } } - return bullet->GetGunMeta()->pb->atk(); + return bullet->GetGunMeta()->atk(); } bool BattleDataContext::IsCrit(IBullet* bullet) @@ -679,9 +685,9 @@ std::shared_ptr BattleDataContext::GetWeaponByUniId(long long wea void BattleDataContext::ForceInit(long long hero_uniid, const mt::Hero* hum_meta, long long weapon1_uniid, - MetaData::Equip* weapon1_meta, + const mt::Equip* weapon1_meta, long long weapon2_uniid, - MetaData::Equip* weapon2_meta) + const mt::Equip* weapon2_meta) { hero_ability_->hero_uniid_ = hero_uniid; hero_ability_->hero_meta = hum_meta; @@ -717,26 +723,26 @@ void BattleDataContext::GetSkillList(std::vector& skill_list) int hero_lv = 1; int quality = 1; GetHeroLvQuality(hero_lv, quality); - MetaData::Skill* skill1 = MetaMgr::Instance()->GetSkill(hero_ability_->hero_meta->skill1list()); - MetaData::Skill* skill2 = MetaMgr::Instance()->GetSkill(hero_ability_->hero_meta->skill2list()); - MetaData::Skill* skill3 = MetaMgr::Instance()->GetSkill(hero_ability_->hero_meta->skill3list()); + const mt::Skill* skill1 = MetaMgr::Instance()->GetSkill(hero_ability_->hero_meta->skill1list()); + const mt::Skill* skill2 = MetaMgr::Instance()->GetSkill(hero_ability_->hero_meta->skill2list()); + const mt::Skill* skill3 = MetaMgr::Instance()->GetSkill(hero_ability_->hero_meta->skill3list()); if (skill1 && skill2 && skill3 && skill1_lv > 0 && skill2_lv > 0 && skill3_lv > 0) { - if (MetaMgr::Instance()->GetSkill(skill1->pb->skill_id() + skill1_lv - 1)) { - skill_list.push_back(skill1->pb->skill_id() + skill1_lv - 1); + if (MetaMgr::Instance()->GetSkill(skill1->skill_id() + skill1_lv - 1)) { + skill_list.push_back(skill1->skill_id() + skill1_lv - 1); } else { - skill_list.push_back(skill1->pb->skill_id()); + skill_list.push_back(skill1->skill_id()); } - if (MetaMgr::Instance()->GetSkill(skill2->pb->skill_id() + skill2_lv - 2)) { - skill_list.push_back(skill2->pb->skill_id() + skill2_lv - 2); + if (MetaMgr::Instance()->GetSkill(skill2->skill_id() + skill2_lv - 2)) { + skill_list.push_back(skill2->skill_id() + skill2_lv - 2); } else { - skill_list.push_back(skill2->pb->skill_id()); + skill_list.push_back(skill2->skill_id()); } - if (MetaMgr::Instance()->GetSkill(skill3->pb->skill_id() + skill3_lv - 3)) { - skill_list.push_back(skill3->pb->skill_id() + skill3_lv - 3); + if (MetaMgr::Instance()->GetSkill(skill3->skill_id() + skill3_lv - 3)) { + skill_list.push_back(skill3->skill_id() + skill3_lv - 3); } else { - skill_list.push_back(skill3->pb->skill_id()); + skill_list.push_back(skill3->skill_id()); } } @@ -759,7 +765,7 @@ int BattleDataContext::GetClipVolume(Creature* c, Weapon* weapon) return 0; } auto p = GetWeaponByUniId(weapon->weapon_uniid); - return p ? p->GetClipVolume() : weapon->meta->pb->clip_volume(); + return p ? p->GetClipVolume() : weapon->meta->clip_volume(); } int BattleDataContext::GetFireRate(Creature* c, Weapon* weapon) @@ -768,7 +774,7 @@ int BattleDataContext::GetFireRate(Creature* c, Weapon* weapon) return 0; } auto p = GetWeaponByUniId(weapon->weapon_uniid); - return p ? p->GetFireRate() : weapon->meta->pb->fire_rate(); + return p ? p->GetFireRate() : weapon->meta->fire_rate(); } int BattleDataContext::GetReloadTime(Creature* c, Weapon* weapon) @@ -777,7 +783,7 @@ int BattleDataContext::GetReloadTime(Creature* c, Weapon* weapon) return 0; } auto p = GetWeaponByUniId(weapon->weapon_uniid); - return p ? p->GetReloadTime() : weapon->meta->pb->reload_time(); + return p ? p->GetReloadTime() : weapon->meta->reload_time(); } float BattleDataContext::GetExtRecoverHp() diff --git a/server/gameserver/battledatacontext.h b/server/gameserver/battledatacontext.h index c5d44dfe..d9f5df67 100644 --- a/server/gameserver/battledatacontext.h +++ b/server/gameserver/battledatacontext.h @@ -62,9 +62,9 @@ struct BattleDataContext void ForceInit(long long hero_uniid, const mt::Hero* hum_meta, long long weapon1_uniid, - MetaData::Equip* weapon1_meta, + const mt::Equip* weapon1_meta, long long weapon2_uniid, - MetaData::Equip* weapon2_meta); + const mt::Equip* weapon2_meta); void Init(Creature* c); void GetSkillList(std::vector& skill_list); int GetClipVolume(Creature* c, Weapon* weapon); diff --git a/server/gameserver/buff.h b/server/gameserver/buff.h index 86144f98..bb9348c7 100644 --- a/server/gameserver/buff.h +++ b/server/gameserver/buff.h @@ -3,16 +3,6 @@ #include "weakptr.h" #include "weapon.h" -namespace MetaData -{ - struct Player; - struct Equip; - struct Dress; - struct Skill; - struct Tank; - struct Buff; -} - namespace cs { class MFBuff; @@ -33,8 +23,8 @@ class Buff public: int buff_uniid = 0; Creature* owner = nullptr; - MetaData::Buff* meta = nullptr; - MetaData::Skill* skill_meta = nullptr; + const mt::Buff* meta = nullptr; + const mt::Skill* skill_meta = nullptr; a8::Attacher xtimer_attacher; long long add_frameno = 0; list_head effect_entry; diff --git a/server/gameserver/mt/Forward.h b/server/gameserver/mt/Forward.h index 955a8084..de9bc4e1 100644 --- a/server/gameserver/mt/Forward.h +++ b/server/gameserver/mt/Forward.h @@ -5,6 +5,7 @@ namespace mt class Param; class Hero; class Map; + class MapThing; class Attr; class FormulaPvp; class GunQuality; diff --git a/server/gameserver/mt/GunQuality.cc b/server/gameserver/mt/GunQuality.cc index 39ec0b47..80ba7684 100644 --- a/server/gameserver/mt/GunQuality.cc +++ b/server/gameserver/mt/GunQuality.cc @@ -9,7 +9,7 @@ IMPL_TABLE(mt::GunQuality) namespace mt { - long long GunQuality::GetPvpCegUpLimit() + long long GunQuality::GetPvpCegUpLimit() const { double sys_param = 0; long long up_limit = round diff --git a/server/gameserver/mt/GunQuality.h b/server/gameserver/mt/GunQuality.h index 335db6d5..7be7753d 100644 --- a/server/gameserver/mt/GunQuality.h +++ b/server/gameserver/mt/GunQuality.h @@ -11,7 +11,7 @@ namespace mt "id") public: - long long GetPvpCegUpLimit(); + long long GetPvpCegUpLimit() const; }; } diff --git a/server/gameserver/mt/HeroQuality.cc b/server/gameserver/mt/HeroQuality.cc index d33618fa..519108a0 100644 --- a/server/gameserver/mt/HeroQuality.cc +++ b/server/gameserver/mt/HeroQuality.cc @@ -9,7 +9,7 @@ IMPL_TABLE(mt::HeroQuality) namespace mt { - long long HeroQuality::GetPvpCegUpLimit() + long long HeroQuality::GetPvpCegUpLimit() const { double sys_param = 0; long long up_limit = round diff --git a/server/gameserver/mt/HeroQuality.h b/server/gameserver/mt/HeroQuality.h index 33d0b2f5..bfce36b8 100644 --- a/server/gameserver/mt/HeroQuality.h +++ b/server/gameserver/mt/HeroQuality.h @@ -11,7 +11,7 @@ namespace mt "id") public: - long long GetPvpCegUpLimit(); + long long GetPvpCegUpLimit() const; }; } diff --git a/server/gameserver/mt/PveGemini.cc b/server/gameserver/mt/PveGemini.cc index 266bb3b2..c6612d22 100644 --- a/server/gameserver/mt/PveGemini.cc +++ b/server/gameserver/mt/PveGemini.cc @@ -19,7 +19,7 @@ namespace mt } } - float PveGemini::GetHpMul(int num) + float PveGemini::GetHpMul(int num) const { if (num > 0 && num <= hp_muls.size()) { return hp_muls[num - 1]; diff --git a/server/gameserver/mt/PveGemini.h b/server/gameserver/mt/PveGemini.h index aa067998..c84a2d4e 100644 --- a/server/gameserver/mt/PveGemini.h +++ b/server/gameserver/mt/PveGemini.h @@ -12,7 +12,8 @@ namespace mt public: void Init1(); - float GetHpMul(int num); + float GetHpMul(int num) const; + private: std::vector hp_muls; std::vector hp_mul; diff --git a/server/gameserver/mt/Robot.h b/server/gameserver/mt/Robot.h index 9a1a8e21..f9a0d4d6 100644 --- a/server/gameserver/mt/Robot.h +++ b/server/gameserver/mt/Robot.h @@ -13,7 +13,7 @@ namespace mt void Init1(); static const mt::Robot* RandRobot(std::set& refreshed_robot_set); - private: + std::vector _skin_id; }; diff --git a/server/gameserver/room.h b/server/gameserver/room.h index 3328634a..e206b6b6 100644 --- a/server/gameserver/room.h +++ b/server/gameserver/room.h @@ -11,17 +11,6 @@ #include "pvedata.h" #include "bornpoint.h" -namespace MetaData -{ - struct Map; - struct AirLine; - struct MapThing; - struct Player; - struct PveGeminiMode; - struct PveGemini; - struct Skill; -} - class Entity; class RoomEntity; class MoveableEntity; @@ -71,8 +60,8 @@ public: bool added_to_over_room = false; glm::vec3 last_player_jump_pos; std::map mine_objects; - MetaData::PveGeminiMode* pve_mode_meta = nullptr; - MetaData::PveGemini* pve_instance = nullptr; + const mt::PveGeminiMode* pve_mode_meta = nullptr; + const mt::PveGemini* pve_instance = nullptr; int pve_human_num = 0; PveData pve_data; @@ -92,7 +81,7 @@ public: long long GetRoomUuid() { return room_uuid_; } int GetRoomIdx() { return room_idx_; } std::string GetMapTplName() { return map_tpl_name_; } - const MetaData::Map* GetMapMeta() { return map_meta_; } + const mt::Map* GetMapMeta() { return map_meta_; } #if 1 bool IsWaitingStart() { return false; } #else @@ -140,9 +129,9 @@ public: int CreateLootEx(int equip_id, Position born_pos, Position pos, int count, int equip_lv, bool show_anim); int CreateBullet(Creature* sender, Creature* passenger, - MetaData::Equip* weapon_meta, - MetaData::Equip* bullet_meta, - MetaData::Skill* skill_meta, + const mt::Equip* weapon_meta, + const mt::Equip* bullet_meta, + const mt::Skill* skill_meta, Position pos, glm::vec3 dir, float fly_distance, @@ -153,7 +142,7 @@ public: float shot_animi_time); Car* CreateCar(Human* driver, int car_uniid, - MetaData::Equip* meta, + const mt::Equip* meta, const Position& pos, int team_id); Hero* CreateHero(Creature* master, @@ -236,7 +225,7 @@ private: void MatchTeam(Human* hum); void CombineTeam(); void AirDrop(int appear_time, int box_id, int airdrop_id); - void AdjustAirDropPos(MetaData::MapThing* thing_meta, Position& box_pos); + void AdjustAirDropPos(const mt::MapThing* thing_meta, Position& box_pos); void AirRaid(int airraid_id); void ShuaPlane(); Team* NewTeam(); @@ -308,7 +297,7 @@ private: int room_idx_ = 0; RoomMode_e room_mode_ = kChiJiMode; long long room_uuid_ = 0; - const MetaData::Map* map_meta_ = nullptr; + const mt::Map* map_meta_ = nullptr; std::string map_tpl_name_; RoomType_e room_type_ = RT_NewBrid; @@ -323,7 +312,7 @@ private: int alive_count_ = 0; long long alive_count_chged_frameno_ = 0; int human_alive_count_ = 0; - MetaData::AirLine* airline_ = nullptr; + const mt::AirLine* airline_ = nullptr; size_t airdrop_times_ = 0; size_t airraid_times_ = 0; int level0room_born_point_uniid_ = 0; diff --git a/server/gameserver/weapon.h b/server/gameserver/weapon.h index 178f0e1d..0341d2cb 100644 --- a/server/gameserver/weapon.h +++ b/server/gameserver/weapon.h @@ -5,12 +5,6 @@ namespace cs class MFWeapon; } -namespace MetaData -{ - struct Equip; - struct Skill; -} - class Creature; class Weapon { @@ -20,9 +14,9 @@ class Weapon int weapon_idx = 0; int weapon_id = 0; int ammo = 0; - MetaData::Equip* meta = nullptr; - MetaData::Equip* bullet_meta = nullptr; - MetaData::Skill* skill_meta = nullptr; + const mt::Equip* meta = nullptr; + const mt::Equip* bullet_meta = nullptr; + const mt::Skill* skill_meta = nullptr; void Clear(); void ToPB(Creature* c, cs::MFWeapon* pb_obj);