From 41e52be85cb2b4b8feedaaed506521f71318afaa Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 19 Apr 2023 17:26:42 +0800 Subject: [PATCH] 1 --- server/gameserver/mt/GuideStep.cc | 15 ++++++++++ server/gameserver/mt/GuideStep.h | 19 ++++++++++++ server/gameserver/mt/Param.h | 2 ++ server/gameserver/mtb/GuideStep.h | 40 ++++++++++++++++++++++++++ server/gameserver/mtb/mtb.all.cc | 16 +++++++++++ server/tools/protobuild/cs_proto.proto | 4 +++ server/tools/protobuild/mt.proto | 10 +++++++ 7 files changed, 106 insertions(+) create mode 100644 server/gameserver/mt/GuideStep.cc create mode 100644 server/gameserver/mt/GuideStep.h create mode 100644 server/gameserver/mtb/GuideStep.h diff --git a/server/gameserver/mt/GuideStep.cc b/server/gameserver/mt/GuideStep.cc new file mode 100644 index 00000000..db7b3010 --- /dev/null +++ b/server/gameserver/mt/GuideStep.cc @@ -0,0 +1,15 @@ +#include "precompile.h" + +#include "mt/GuideStep.h" + +IMPL_TABLE(mt::GuideStep) + +namespace mt +{ + + void GuideStep::Init1() + { + + } + +} diff --git a/server/gameserver/mt/GuideStep.h b/server/gameserver/mt/GuideStep.h new file mode 100644 index 00000000..e7bf85cc --- /dev/null +++ b/server/gameserver/mt/GuideStep.h @@ -0,0 +1,19 @@ +#pragma once + +#include "mt/macro.h" +#include "mtb/GuideStep.h" + +namespace mt +{ + + DECLARE_ID_TABLE(GuideStep, mtb::GuideStep, + "guideStep@guideStep.json", + "id") + public: + + void Init1(); + + private: + }; + +} diff --git a/server/gameserver/mt/Param.h b/server/gameserver/mt/Param.h index 2432912c..b2dfb105 100644 --- a/server/gameserver/mt/Param.h +++ b/server/gameserver/mt/Param.h @@ -19,6 +19,8 @@ namespace mt float max_oil = 0.0f; float max_mount_horse_distance = 100.0f; int early_parachute_jump = 0; + glm::vec3 newbie_room_born_point = glm::vec3(0.0f, 0.0f, 0.0f); + float newbie_room_hp_rate = 0.0f; int downed_relive_recover_hp = 0; diff --git a/server/gameserver/mtb/GuideStep.h b/server/gameserver/mtb/GuideStep.h new file mode 100644 index 00000000..19664f89 --- /dev/null +++ b/server/gameserver/mtb/GuideStep.h @@ -0,0 +1,40 @@ +#pragma once + +#include + +namespace mtb +{ + + class GuideStep + { + public: + + a8::reflect::Class* GetClass() const; + int id() const { return id_; }; + int target() const { return target_; }; + const std::string param1() const { return param1_; }; + const std::string param2() const { return param2_; }; + const std::string param3() const { return param3_; }; + const std::string param4() const { return param4_; }; + + bool has_id() const { return __flags__.test(0);}; + bool has_target() const { return __flags__.test(1);}; + bool has_param1() const { return __flags__.test(2);}; + bool has_param2() const { return __flags__.test(3);}; + bool has_param3() const { return __flags__.test(4);}; + bool has_param4() const { return __flags__.test(5);}; + + protected: + + int id_ = 0; + int target_ = 0; + std::string param1_; + std::string param2_; + std::string param3_; + std::string param4_; + +public: + std::bitset<6> __flags__; + }; + +}; diff --git a/server/gameserver/mtb/mtb.all.cc b/server/gameserver/mtb/mtb.all.cc index f680923e..7811255b 100644 --- a/server/gameserver/mtb/mtb.all.cc +++ b/server/gameserver/mtb/mtb.all.cc @@ -36,6 +36,7 @@ #include "mtb/RankRoom.h" #include "mtb/Grasp.h" #include "mtb/GraspBuff.h" +#include "mtb/GuideStep.h" #include "mtb/WorldObject.h" namespace mtb @@ -788,6 +789,21 @@ namespace mtb return meta_class; } + a8::reflect::Class* GuideStep::GetClass() const + { + a8::reflect::Class* meta_class = nullptr; + if (!meta_class) { + meta_class = new a8::reflect::Class("GuideStep", 6, 0); + meta_class->SetSimpleField(0, "id", a8::reflect::ET_INT32, my_offsetof2(GuideStep, id_)); + meta_class->SetSimpleField(1, "target", a8::reflect::ET_INT32, my_offsetof2(GuideStep, target_)); + meta_class->SetSimpleField(2, "param1", a8::reflect::ET_STRING, my_offsetof2(GuideStep, param1_)); + meta_class->SetSimpleField(3, "param2", a8::reflect::ET_STRING, my_offsetof2(GuideStep, param2_)); + meta_class->SetSimpleField(4, "param3", a8::reflect::ET_STRING, my_offsetof2(GuideStep, param3_)); + meta_class->SetSimpleField(5, "param4", a8::reflect::ET_STRING, my_offsetof2(GuideStep, param4_)); + } + return meta_class; + } + a8::reflect::Class* WorldObject::GetClass() const { a8::reflect::Class* meta_class = nullptr; diff --git a/server/tools/protobuild/cs_proto.proto b/server/tools/protobuild/cs_proto.proto index 6983600c..0c2f8d70 100755 --- a/server/tools/protobuild/cs_proto.proto +++ b/server/tools/protobuild/cs_proto.proto @@ -197,6 +197,8 @@ message MFVec3 property_type: 45 兔子隐身提示时间 property_subtype: 时间(单位毫秒) value: max时间(单位毫秒) + property_type: 46 更新当前新手战引导步骤 + property_subtype: 第几步 <= 0时表示完成了所有步骤 */ message MFPropertyChg { @@ -1443,6 +1445,8 @@ message SMJoinedNotify optional string server_info = 9; //服务器信息(重连时使用) 已经废弃移动到SMMapInfo optional int32 adjust_bullet = 12; //是否矫正子弹出生点(默认不矫正 1:矫正) + + optional int32 is_newbie_room = 13; //是否新手房间 } //地图信息 diff --git a/server/tools/protobuild/mt.proto b/server/tools/protobuild/mt.proto index b03d0984..9eadd4d9 100755 --- a/server/tools/protobuild/mt.proto +++ b/server/tools/protobuild/mt.proto @@ -592,6 +592,16 @@ message GraspBuff optional string effect_list = 11; } +message GuideStep +{ + optional int32 id = 1; + optional int32 target = 2; + optional string param1 = 3; + optional string param2 = 4; + optional string param3 = 5; + optional string param4 = 6; +} + message WorldObject { optional int32 object_id= 1;