Compare commits

...

6 Commits
master ... test

Author SHA1 Message Date
aozhiwei
a3f965089a 1 2021-12-13 13:20:57 +08:00
aozhiwei
ce956abef3 1 2021-12-13 12:00:04 +08:00
aozhiwei
94fc41091d 1 2021-12-13 11:51:43 +08:00
aozhiwei
46f1b52cba 1 2021-12-13 11:47:32 +08:00
aozhiwei
4faaedd690 1 2021-12-13 11:27:13 +08:00
aozhiwei
8fb91ad06c 1 2021-12-13 11:14:02 +08:00
10 changed files with 51 additions and 61 deletions

View File

@ -218,8 +218,8 @@ void Human::FillMFObjectFull(Room* room, Human* hum, cs::MFObjectFull* full_data
if (vip_lv != 0) {
p->set_vip_lv(vip_lv);
}
if (head != 0) {
p->set_head(head);
if (head_frame != 0) {
p->set_head_frame(head_frame);
}
if (sex != 0) {
p->set_sex(sex);
@ -348,8 +348,8 @@ void Human::FillMFPlayerStats(cs::MFPlayerStats* stats_pb)
if (vip_lv != 0) {
stats_pb->set_vip_lv(vip_lv);
}
if (head != 0) {
stats_pb->set_head(head);
if (head_frame != 0) {
stats_pb->set_head_frame(head_frame);
}
if (sex != 0) {
stats_pb->set_sex(sex);
@ -448,8 +448,8 @@ void Human::FillMFTeamData(Human* hum, cs::MFTeamData* team_data, bool is_game_o
if (vip_lv != 0) {
team_data->set_vip_lv(vip_lv);
}
if (head != 0) {
team_data->set_head(head);
if (head_frame != 0) {
team_data->set_head_frame(head_frame);
}
if (sex != 0) {
team_data->set_sex(sex);

View File

@ -90,7 +90,7 @@ class Human : public Creature
long long user_value3 = 0;
long long guild_id = 0;
int vip_lv = 0;
int head = 0;
int head_frame = 0;
int sex = 0;
std::string user_data;
long long last_cmmove_frameno = 0;

View File

@ -24,7 +24,7 @@ void RawTeamMember::FillMFMatchTeamMember(cs::MFMatchTeamMember* p)
}
p->set_is_leader(is_leader);
p->set_state(state);
p->set_head(msg.head());
p->set_head_frame(msg.head_frame());
p->set_hero_skin(msg.hero_skin());
}
@ -37,6 +37,7 @@ void RawTeamMember::InitRobot()
std::set<int> refreshed_robot_set;
robot_meta = MetaMgr::Instance()->RandRobot(refreshed_robot_set);
if (robot_meta) {
msg.set_avatar_url(a8::Format("%s", {50001 + (robot_meta->i->id() % 3)}));
#if 1
msg.set_hero_id(30100 + 100 * (robot_meta->i->id() % 3));
#else
@ -51,7 +52,7 @@ void RawTeamMember::InitRobot()
{
MetaData::Player* hero_meta = MetaMgr::Instance()->GetPlayer(msg.hero_id());
if (hero_meta) {
MetaData::PlayerSkin* skin_meta = MetaMgr::Instance()->GetPlayerSkin(hero_meta->i->skinlist());
MetaData::Item* skin_meta = MetaMgr::Instance()->GetHeroSkin(msg.hero_id());
if (skin_meta) {
msg.set_hero_skin(skin_meta->i->id());
}

View File

@ -642,11 +642,6 @@ namespace MetaData
return 0;
}
void PlayerSkin::Init()
{
}
void Robot::Init()
{
{
@ -1535,4 +1530,9 @@ namespace MetaData
}
void Item::Init()
{
}
}

View File

@ -84,6 +84,8 @@ namespace MetaData
struct Item
{
const metatable::Item* i = nullptr;
void Init();
};
struct Buff;
@ -138,13 +140,6 @@ namespace MetaData
int RandDrop();
};
struct PlayerSkin
{
const metatable::PlayerSkin* i = nullptr;
void Init();
};
struct Robot
{
const metatable::Robot* i = nullptr;

View File

@ -153,8 +153,6 @@ public:
std::list<MetaData::Equip> equip_list;
std::list<metatable::Player> player_meta_list;
std::list<MetaData::Player> player_list;
std::list<metatable::PlayerSkin> playerskin_meta_list;
std::list<MetaData::PlayerSkin> playerskin_list;
std::list<metatable::MapThing> mapthing_meta_list;
std::list<MetaData::MapThing> mapthing_list;
std::list<metatable::BuildingJson> building_meta_list;
@ -200,10 +198,10 @@ public:
std::map<int, MetaData::SafeArea*> safearea_type_hash;
std::map<int, std::vector<MetaData::SafeAreaPos*>> safearea_pos_hash;
std::map<int, MetaData::Item*> item_hash;
std::map<int, MetaData::Item*> item_heroskin_hash;
std::map<int, MetaData::Equip*> equip_hash;
std::map<int, MetaData::Equip*> equip_slot_hash;
std::map<int, MetaData::Player*> player_hash;
std::map<int, MetaData::PlayerSkin*> playerskin_hash;
std::map<int, MetaData::MapThing*> mapthing_hash;
std::map<int, MetaData::Building*> building_hash;
std::map<int, MetaData::Drop*> drop_hash;
@ -260,7 +258,6 @@ public:
f8::ReadCsvMetaFile(res_path + "buff@buff.csv", buff_meta_list);
f8::ReadCsvMetaFile(res_path + "equip@equip.csv", equip_meta_list);
f8::ReadCsvMetaFile(res_path + "player@player.csv", player_meta_list);
f8::ReadCsvMetaFile(res_path + "playerskin@playerskin.csv", playerskin_meta_list);
f8::ReadCsvMetaFile(res_path + "mapThing@mapThing.csv", mapthing_meta_list);
f8::ReadCsvMetaFile(res_path + "drop@drop.csv", drop_meta_list);
f8::ReadCsvMetaFile(res_path + "airdrop@airdrop.csv", airdrop_meta_list);
@ -729,7 +726,11 @@ private:
for (auto& meta : item_meta_list) {
MetaData::Item& item = a8::FastAppend(item_list);
item.i = &meta;
item.Init();
item_hash[item.i->id()] = &item;
if (meta.playerid()) {
item_heroskin_hash[item.i->playerid()] = &item;
}
}
for (auto& meta : equip_meta_list) {
@ -763,13 +764,6 @@ private:
player_hash[item.i->id()] = &item;
}
for (auto& meta : playerskin_meta_list) {
MetaData::PlayerSkin& item = a8::FastAppend(playerskin_list);
item.i = &meta;
item.Init();
playerskin_hash[item.i->id()] = &item;
}
for (auto& meta : mapthing_meta_list) {
MetaData::MapThing& item = a8::FastAppend(mapthing_list);
item.i = &meta;
@ -968,18 +962,6 @@ MetaData::Player* MetaMgr::GetPlayer(int id)
return itr != loader_->player_hash.end() ? itr->second : nullptr;
}
MetaData::PlayerSkin* MetaMgr::GetPlayerSkin(int id)
{
auto itr = loader_->playerskin_hash.find(id);
return itr != loader_->playerskin_hash.end() ? itr->second : nullptr;
}
std::shared_ptr<std::vector<MetaData::PlayerSkin*>> MetaMgr::GetHeroSkins(int hero_id)
{
std::shared_ptr<std::vector<MetaData::PlayerSkin*>> p;
return p;
}
MetaData::Equip* MetaMgr::GetEquip(int id)
{
auto itr = loader_->equip_hash.find(id);
@ -1224,3 +1206,15 @@ std::vector<std::tuple<int, std::string>>* MetaMgr::GetTextElements(const std::s
auto itr = loader_->text_element_hash.find(textid);
return itr != loader_->text_element_hash.end() ? &itr->second : nullptr;
}
MetaData::Item* MetaMgr::GetItem(int id)
{
auto itr = loader_->item_hash.find(id);
return itr != loader_->item_hash.end() ? itr->second : nullptr;
}
MetaData::Item* MetaMgr::GetHeroSkin(int hero_id)
{
auto itr = loader_->item_heroskin_hash.find(hero_id);
return itr != loader_->item_heroskin_hash.end() ? itr->second : nullptr;
}

View File

@ -25,11 +25,11 @@ class MetaMgr : public a8::Singleton<MetaMgr>
std::list<MetaData::Map>* GetMaps();
MetaData::MapThing* GetMapThing(int mapthing_id);
MetaData::Player* GetPlayer(int id);
MetaData::PlayerSkin* GetPlayerSkin(int id);
std::shared_ptr<std::vector<MetaData::PlayerSkin*>> GetHeroSkins(int hero_id);
MetaData::Equip* GetEquip(int id);
MetaData::Equip* GetEquipBySlotId(int slot_id);
MetaData::EquipUpgrade* GetEquipUpgrade(int equip_id);
MetaData::Item* GetItem(int id);
MetaData::Item* GetHeroSkin(int id);
MetaData::Building* GetBuilding(int building_id);
MetaData::Drop* GetDrop(int drop_id);
MetaData::SafeArea* GetSafeArea(int area_id);

View File

@ -83,7 +83,7 @@ Player* PlayerMgr::CreatePlayerByCMJoin(Player* hum,
hum->user_value3 = msg.user_value3();
hum->guild_id = msg.guild_id();
hum->vip_lv = msg.vip_lv();
hum->head = msg.head();
hum->head_frame = msg.head_frame();
hum->sex = msg.sex();
hum->user_data = msg.user_data();
for (auto& weapon : msg.weapons()) {

View File

@ -265,7 +265,7 @@ message MFPlayerFull
optional int32 killer_id = 33; //id() id: -1:
optional int32 vip_lv = 35 [default = 0]; //vip等级
optional int32 head = 36 [default = 0]; //
optional int32 head_frame = 36 [default = 0]; //
optional int32 sex = 37 [default = 0]; //
repeated MFSkill skill_list = 38; //
@ -645,7 +645,7 @@ message MFTeamData
optional int64 user_value3 = 33; //user_value3
optional int64 guild_id = 34; //id
optional int32 vip_lv = 35 [default = 0]; //
optional int32 head = 36 [default = 0]; //
optional int32 head_frame = 36 [default = 0]; //
optional int32 sex = 37 [default = 0]; //
}
@ -739,7 +739,7 @@ message MFPlayerStats
optional int32 rescue_guild_member = 23; //
optional int32 vip_lv = 35 [default = 0]; //
optional int32 head = 36 [default = 0]; //
optional int32 head_frame = 36 [default = 0]; //
optional int32 sex = 37 [default = 0]; //
optional int32 charid = 38; //id
optional int32 team_id = 39; //tamid
@ -885,7 +885,7 @@ message MFMatchTeamMember
repeated MFPair skill_list = 7; // key:id value:,0
optional bool is_leader = 8; //
optional int32 state = 9; //0: 1:
optional int32 head = 10; //
optional int32 head_frame = 10; //
repeated int32 baseskin = 11; //id
optional int32 hero_skin = 12; //
}
@ -938,7 +938,7 @@ message CMJoin
optional int64 user_value3 = 33; //user_value3
optional int64 guild_id = 34; //id
optional int32 vip_lv = 35 [default = 0]; //
optional int32 head = 36 [default = 0]; //
optional int32 head_frame = 36 [default = 0]; //
optional int32 sex = 37 [default = 0]; //
optional bool force_entry_newbie_room = 50; //
repeated MFTeamMember team_members = 51; //
@ -947,6 +947,7 @@ message CMJoin
repeated MFPair skill_list = 54; // key:id value:,0
optional string user_data = 60 [default = ""]; //
optional int32 hero_id = 61; //id
repeated MFPair talent_list = 64; // key:id value:
/*
(getSwitch返回的结果)
1:

View File

@ -118,7 +118,14 @@ message SafeAreaPos
message Item
{
optional int32 id = 1; //id
optional int32 id = 1;
optional int32 type = 2;
optional int32 sub_type = 3;
optional int32 quality = 4;
optional int32 use = 5;
optional int32 skinid = 6;
optional int32 isdefaultskin = 7;
optional int32 playerid = 8;
}
message Equip
@ -230,14 +237,6 @@ message Player
optional int32 skinlist = 48;
}
message PlayerSkin
{
optional int32 id = 1;
optional int32 itemid = 2;
optional int32 playerid = 3;
optional int32 skinid = 4;
}
message Robot
{
optional int32 id = 1;