From 554cb3f9bcdd272e16396d3a275ff399ec4c8225 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 25 May 2023 16:02:15 +0800 Subject: [PATCH] 1 --- server/gameserver/mtb/MapThingGroup.h | 5 ++++- server/gameserver/mtb/mtb.all.cc | 1 + server/gameserver/room.cc | 4 ++++ server/tools/protobuild/mt.proto | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/server/gameserver/mtb/MapThingGroup.h b/server/gameserver/mtb/MapThingGroup.h index a06c3b71..059c205a 100644 --- a/server/gameserver/mtb/MapThingGroup.h +++ b/server/gameserver/mtb/MapThingGroup.h @@ -13,19 +13,22 @@ namespace mtb int mtGroupId() const { return mtGroupId_; }; const std::string rule() const { return rule_; }; const std::string mapThings() const { return mapThings_; }; + const std::string heores() const { return heroes_; }; bool has_mtGroupId() const { return __flags__.test(0);}; bool has_rule() const { return __flags__.test(1);}; bool has_mapThings() const { return __flags__.test(2);}; + bool has_heroes() const { return __flags__.test(3);}; protected: int mtGroupId_ = 0; std::string rule_; std::string mapThings_; + std::string heroes_; public: - std::bitset<3> __flags__; + std::bitset<4> __flags__; }; }; diff --git a/server/gameserver/mtb/mtb.all.cc b/server/gameserver/mtb/mtb.all.cc index d92a7489..e4f02418 100644 --- a/server/gameserver/mtb/mtb.all.cc +++ b/server/gameserver/mtb/mtb.all.cc @@ -842,6 +842,7 @@ namespace mtb meta_class->SetSimpleField(0, "mtGroupId", a8::reflect::ET_INT32, my_offsetof2(MapThingGroup, mtGroupId_)); meta_class->SetSimpleField(1, "rule", a8::reflect::ET_STRING, my_offsetof2(MapThingGroup, rule_)); meta_class->SetSimpleField(2, "mapThings", a8::reflect::ET_STRING, my_offsetof2(MapThingGroup, mapThings_)); + meta_class->SetSimpleField(3, "heroes", a8::reflect::ET_STRING, my_offsetof2(MapThingGroup, heroes_)); } return meta_class; } diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 196497b8..bb452a4b 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -3671,6 +3671,10 @@ void Room::CreateWorldObjects() int ikey = itr.first; auto objects = itr.second; std::shuffle(objects.begin(), objects.end(), std::default_random_engine(a8::XGetTickCount())); + const mt::MapThingGroup* group_meta = mt::MapThingGroup::GetById(ikey); + if (group_meta) { + + } } if (born_point_hash_.size() < 10) { abort(); diff --git a/server/tools/protobuild/mt.proto b/server/tools/protobuild/mt.proto index ed3dfd8c..caa79032 100755 --- a/server/tools/protobuild/mt.proto +++ b/server/tools/protobuild/mt.proto @@ -625,4 +625,5 @@ message MapThingGroup optional int32 mtGroupId = 1; optional string rule = 2; optional string mapThings = 3; + optional string heroes = 4; } \ No newline at end of file