diff --git a/server/src/Configuration.cpp b/server/src/Configuration.cpp index 64cf682..ba72a25 100644 --- a/server/src/Configuration.cpp +++ b/server/src/Configuration.cpp @@ -11,6 +11,9 @@ #include #include +#define _stringify(x) #x +#define stringify(x) _stringify(x) + using namespace std; using namespace std::chrono; using namespace ts; @@ -1145,7 +1148,7 @@ std::deque> config::create_bindings() { BIND_GROUP(server) { CREATE_BINDING("platform", PREMIUM_ONLY | FLAG_RELOADABLE); - BIND_STRING(config::server::DefaultServerPlatform, strobf("Linux").string()); + BIND_STRING(config::server::DefaultServerPlatform, build::platform()); ADD_DESCRIPTION("The displayed platform to the client"); ADD_NOTE("This option is only for the premium version."); ADD_NOTE_RELOADABLE(); diff --git a/server/src/build.cpp b/server/src/build.cpp index 0e43944..3d4dcac 100644 --- a/server/src/build.cpp +++ b/server/src/build.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "build.h" #ifndef BUILD_MAJOR @@ -70,4 +71,16 @@ namespace build { //return R"([0-9]{1,5}\.[0-9]{1,5}\.[0-9]{1,5}(\-.*)?)"; return R"([0-9]{1,5}\.[0-9]{1,5}\.[0-9]{1,5}(-\S+( \[[Bb]uild: \d+\])?)?)"; } + + std::string platform() { +#if defined(__aarch64__) + return strobf("arm64v8").string(); /* no port yet */ +#elseif defined(_M_ARM) + return strobf("arm32v" STR2(_M_ARM)).string(); +#elseif defined(WIN32) + return strobf("Windows").string(); /* no port yet */ +#else + return strobf("Linux").string(); +#endif + } } \ No newline at end of file diff --git a/server/src/build.h b/server/src/build.h index f1b7a79..36850d1 100644 --- a/server/src/build.h +++ b/server/src/build.h @@ -60,4 +60,5 @@ namespace build { extern int buildCount(); extern std::string pattern(); + extern std::string platform(); } \ No newline at end of file diff --git a/shared b/shared index deeba1b..a829f70 160000 --- a/shared +++ b/shared @@ -1 +1 @@ -Subproject commit deeba1b73ebdc4aaa07c36b9c0b97e21511356df +Subproject commit a829f705d21267f2252d5aa84fb6213460b1ea33