From e1f73dd40a186c5cece7ae514375fd2e77cd86f5 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 11 Oct 2023 14:40:15 +0800 Subject: [PATCH] 1 --- server/gameserver/CMakeLists.txt | 6 +++--- server/gameserver/mtb/Hero.h | 5 ++++- server/gameserver/mtb/mtb.all.cc | 3 ++- server/tools/protobuild/mt.proto | 1 + 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/server/gameserver/CMakeLists.txt b/server/gameserver/CMakeLists.txt index 310ba7dc..d07c82ea 100644 --- a/server/gameserver/CMakeLists.txt +++ b/server/gameserver/CMakeLists.txt @@ -14,11 +14,11 @@ endif() set(LIB_DIR "ubuntu20.04_g++-9") message(LIB_DIR: ${LIB_DIR} ) -set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g -std=gnu++1z -DGAME_ID=${GAME_ID} -DNDEBUG -DMAP3D -DDT_VIRTUAL_QUERYFILTER -DNEW_WEAPON_SYS=1 -DNEWBIE_ROOM=1") +set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g -std=gnu++1z -DGAME_ID=${GAME_ID} -DNDEBUG -DMAP3D -DDT_VIRTUAL_QUERYFILTER -DNEW_WEAPON_SYS=1 -DNEWBIE_ROOM=1 -DNEW_BT") if (${ASAN}) - set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++1z -DGAME_ID=${GAME_ID} -DDEBUG -DCXY -DSXY -DMAP3D -DDT_VIRTUAL_QUERYFILTER -DNEW_WEAPON_SYS=1 -DNEWBIE_ROOM=1 -fsanitize=address -fno-omit-frame-pointer") + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++1z -DGAME_ID=${GAME_ID} -DDEBUG -DCXY -DSXY -DMAP3D -DDT_VIRTUAL_QUERYFILTER -DNEW_WEAPON_SYS=1 -DNEWBIE_ROOM=1 -DNEW_BT -fsanitize=address -fno-omit-frame-pointer") else() - set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++1z -DGAME_ID=${GAME_ID} -DDEBUG -DCXY -DSXY -DMAP3D -DDT_VIRTUAL_QUERYFILTER -DNEW_WEAPON_SYS=1 -DNEWBIE_ROOM=1") + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++1z -DGAME_ID=${GAME_ID} -DDEBUG -DCXY -DSXY -DMAP3D -DDT_VIRTUAL_QUERYFILTER -DNEW_WEAPON_SYS=1 -DNEWBIE_ROOM=1 -DNEW_BT") endif() include_directories( diff --git a/server/gameserver/mtb/Hero.h b/server/gameserver/mtb/Hero.h index 8581fa91..ab0ca9b7 100644 --- a/server/gameserver/mtb/Hero.h +++ b/server/gameserver/mtb/Hero.h @@ -52,6 +52,7 @@ namespace mtb float damage_ratio() const { return damage_ratio_; }; float defence_ratio() const { return defence_ratio_; }; const std::string bt() const { return bt_; }; + const std::string new_bt() const { return new_bt_; }; bool has_id() const { return __flags__.test(0);}; bool has_radius() const { return __flags__.test(1);}; @@ -95,6 +96,7 @@ namespace mtb bool has_defence_ratio() const { return __flags__.test(39);}; bool has_bt() const { return __flags__.test(40);}; bool has_drop() const { return __flags__.test(41);}; + bool has_new_bt() const { return __flags__.test(42);}; protected: @@ -140,9 +142,10 @@ namespace mtb float defence_ratio_ = 0.0f; std::string bt_; std::string drop_; + std::string new_bt_; public: - std::bitset<42> __flags__; + std::bitset<43> __flags__; }; }; diff --git a/server/gameserver/mtb/mtb.all.cc b/server/gameserver/mtb/mtb.all.cc index fcfac1b4..10756afb 100644 --- a/server/gameserver/mtb/mtb.all.cc +++ b/server/gameserver/mtb/mtb.all.cc @@ -312,7 +312,7 @@ namespace mtb { a8::reflect::Class* meta_class = nullptr; if (!meta_class) { - meta_class = new a8::reflect::Class("Hero", 42, 0); + meta_class = new a8::reflect::Class("Hero", 43, 0); meta_class->SetSimpleField(0, "id", a8::reflect::ET_INT32, my_offsetof2(Hero, id_)); meta_class->SetSimpleField(1, "radius", a8::reflect::ET_FLOAT, my_offsetof2(Hero, radius_)); meta_class->SetSimpleField(2, "move_speed", a8::reflect::ET_FLOAT, my_offsetof2(Hero, move_speed_)); @@ -355,6 +355,7 @@ namespace mtb meta_class->SetSimpleField(39, "defence_ratio", a8::reflect::ET_FLOAT, my_offsetof2(Hero, defence_ratio_)); meta_class->SetSimpleField(40, "bt", a8::reflect::ET_STRING, my_offsetof2(Hero, bt_)); meta_class->SetSimpleField(41, "drop", a8::reflect::ET_STRING, my_offsetof2(Hero, drop_)); + meta_class->SetSimpleField(42, "new_bt", a8::reflect::ET_STRING, my_offsetof2(Hero, new_bt_)); } return meta_class; } diff --git a/server/tools/protobuild/mt.proto b/server/tools/protobuild/mt.proto index 4c30ae0b..34b20b60 100755 --- a/server/tools/protobuild/mt.proto +++ b/server/tools/protobuild/mt.proto @@ -285,6 +285,7 @@ message Hero optional string bt = 70; optional string drop = 71; + optional string new_bt = 72; } message Robot