diff --git a/server/gameserver/mt/SafeAreaSafePoint.cc b/server/gameserver/mt/SafeAreaSafePoint.cc new file mode 100644 index 00000000..122124b4 --- /dev/null +++ b/server/gameserver/mt/SafeAreaSafePoint.cc @@ -0,0 +1,25 @@ +#include "precompile.h" + +#include "mt/SafeAreaSafePoint.h" + +IMPL_TABLE(mt::SafeAreaSafePoint) + +std::map> mt::SafeAreaSafePoint::_type_safe_points_hash; + +namespace mt +{ + + void SafeAreaSafePoint::Init1() + { + } + + void SafeAreaSafePoint::StaticPostInit() + { + } + + glm::vec3* SafeAreaSafePoint::RandPoint(int type) const + { + + } + +} diff --git a/server/gameserver/mt/SafeAreaSafePoint.h b/server/gameserver/mt/SafeAreaSafePoint.h new file mode 100644 index 00000000..5babc6b8 --- /dev/null +++ b/server/gameserver/mt/SafeAreaSafePoint.h @@ -0,0 +1,22 @@ +#pragma once + +#include "mt/macro.h" +#include "mtb/SafeAreaSafePoint.h" + +namespace mt +{ + + DECLARE_ID_TABLE(SafeAreaSafePoint, mtb::SafeAreaSafePoint, + "safearea_safepoint@safearea_safepoint.json", + "id") + public: + + void Init1(); + static void StaticPostInit(); + glm::vec3* RandPoint(int type) const; + + private: + static std::map> _type_safe_points_hash; + }; + +} diff --git a/server/gameserver/mtb/SafeAreaSafePoint.h b/server/gameserver/mtb/SafeAreaSafePoint.h new file mode 100644 index 00000000..16baf934 --- /dev/null +++ b/server/gameserver/mtb/SafeAreaSafePoint.h @@ -0,0 +1,37 @@ +#pragma once + +#include + +namespace mtb +{ + + class SafeAreaSafePoint + { + public: + + a8::reflect::Class* GetClass() const; + int id() const { return id_; }; + int type() const { return type_; }; + float x() const { return x_; }; + float y() const { return y_; }; + float z() const { return z_; }; + + bool has_id() const { return __flags__.test(0);}; + bool has_type() const { return __flags__.test(1);}; + bool has_x() const { return __flags__.test(2);}; + bool has_y() const { return __flags__.test(3);}; + bool has_z() const { return __flags__.test(4);}; + + protected: + + int id_ = 0; + int type_ = 0; + float x_ = 0; + float y_ = 0; + float z_ = 0; + +public: + std::bitset<5> __flags__; + }; + +}; diff --git a/server/gameserver/mtb/mtb.all.cc b/server/gameserver/mtb/mtb.all.cc index df7a40ab..d0fb1a60 100644 --- a/server/gameserver/mtb/mtb.all.cc +++ b/server/gameserver/mtb/mtb.all.cc @@ -40,6 +40,7 @@ #include "mtb/WorldObject.h" #include "mtb/MergeItem.h" #include "mtb/MapThingGroup.h" +#include "mtb/SafeAreaSafePoint.h" namespace mtb { @@ -853,4 +854,18 @@ namespace mtb return meta_class; } + a8::reflect::Class* SafeAreaSafePoint::GetClass() const + { + a8::reflect::Class* meta_class = nullptr; + if (!meta_class) { + meta_class = new a8::reflect::Class("SafeAreaSafePoint", 5, 0); + meta_class->SetSimpleField(0, "id", a8::reflect::ET_INT32, my_offsetof2(SafeAreaSafePoint, id_)); + meta_class->SetSimpleField(1, "type", a8::reflect::ET_INT32, my_offsetof2(SafeAreaSafePoint, type_)); + meta_class->SetSimpleField(2, "x", a8::reflect::ET_FLOAT, my_offsetof2(SafeAreaSafePoint, x_)); + meta_class->SetSimpleField(3, "y", a8::reflect::ET_FLOAT, my_offsetof2(SafeAreaSafePoint, y_)); + meta_class->SetSimpleField(3, "z", a8::reflect::ET_FLOAT, my_offsetof2(SafeAreaSafePoint, z_)); + } + return meta_class; + } + } diff --git a/server/tools/protobuild/mt.proto b/server/tools/protobuild/mt.proto index e79bbec8..e13b42b7 100755 --- a/server/tools/protobuild/mt.proto +++ b/server/tools/protobuild/mt.proto @@ -103,6 +103,15 @@ message SafeArea optional string boss = 10; } +message SafeAreaSafePoint +{ + optional int32 id = 1; + optional int32 type = 2; + optional float x = 8; + optional float y = 9; + optional float z = 10; +} + message SafeAreaPos { optional int32 id = 1;