From 6584a2c0224a8f1f2c73a9246aadc62d334bf3e2 Mon Sep 17 00:00:00 2001 From: Alpyne Date: Fri, 6 Nov 2020 17:18:39 -0800 Subject: [PATCH] Move ServerProperties classes into Feather::Config To avoid future conflicts with block Property classes --- src/DedicatedServer.cpp | 1 + src/DedicatedServer.h | 9 ++++----- src/Main.cpp | 2 +- src/config/Properties.cpp | 2 +- src/config/Properties.h | 2 +- src/config/Property.h | 2 +- src/config/ServerProperties.cpp | 2 +- src/config/ServerProperties.h | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/DedicatedServer.cpp b/src/DedicatedServer.cpp index 5f22011..3cbd501 100644 --- a/src/DedicatedServer.cpp +++ b/src/DedicatedServer.cpp @@ -8,6 +8,7 @@ #include using std::string; +using Feather::Config::ServerProperties; namespace Feather { diff --git a/src/DedicatedServer.h b/src/DedicatedServer.h index daba4c8..7289bc4 100644 --- a/src/DedicatedServer.h +++ b/src/DedicatedServer.h @@ -2,6 +2,8 @@ #include "MinecraftClient.h" #include "ServerStatus.h" +#include "config/ServerProperties.h" + #include "protocol/Protocol.h" #include "PacketReader.h" //#include "JobManager.h" @@ -10,15 +12,12 @@ #include "network/IListenerInterface.h" - namespace Feather { - class ServerProperties; - class DedicatedServer final : public Network::IListenerInterface { public: - DedicatedServer(ServerProperties* properties); + DedicatedServer(Config::ServerProperties* properties); ~DedicatedServer(); void OnClientConnect(Network::TCPClientHandle&& client) override; @@ -32,7 +31,7 @@ namespace Feather void HandleUnknownPacket(MinecraftClient& client, int32_t id, const PacketReader& packet); private: - ServerProperties* m_properties; + Config::ServerProperties* m_properties; Network::TCPListener m_listener; ServerStatus m_status; diff --git a/src/Main.cpp b/src/Main.cpp index 2b79d32..30d6206 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -4,7 +4,7 @@ #include "DedicatedServer.h" using namespace Feather; - +using Feather::Config::ServerProperties; int main() { diff --git a/src/config/Properties.cpp b/src/config/Properties.cpp index 48126c5..b278ad1 100644 --- a/src/config/Properties.cpp +++ b/src/config/Properties.cpp @@ -4,7 +4,7 @@ static const string STRING_TRUE("true"); static const string STRING_FALSE("false"); -namespace Feather +namespace Feather::Config { template <> string Properties::Get(string_view key) diff --git a/src/config/Properties.h b/src/config/Properties.h index dca5c94..d6ef91b 100644 --- a/src/config/Properties.h +++ b/src/config/Properties.h @@ -9,7 +9,7 @@ using std::string; using std::string_view; using std::unordered_map; -namespace Feather +namespace Feather::Config { class Properties { diff --git a/src/config/Property.h b/src/config/Property.h index a3b6ff5..68c7b11 100644 --- a/src/config/Property.h +++ b/src/config/Property.h @@ -13,7 +13,7 @@ using std::string; using std::string_view; using std::unordered_map; -namespace Feather +namespace Feather::Config { template diff --git a/src/config/ServerProperties.cpp b/src/config/ServerProperties.cpp index 874cca3..c6b75d3 100644 --- a/src/config/ServerProperties.cpp +++ b/src/config/ServerProperties.cpp @@ -10,7 +10,7 @@ #include "../util/StringUtil.h" -namespace Feather +namespace Feather::Config { void ServerProperties::Load() { diff --git a/src/config/ServerProperties.h b/src/config/ServerProperties.h index 4fbd48c..0bf06ce 100644 --- a/src/config/ServerProperties.h +++ b/src/config/ServerProperties.h @@ -13,7 +13,7 @@ using std::string; using std::string_view; using std::unordered_map; -namespace Feather +namespace Feather::Config { class ServerProperties : public Properties {