diff --git a/apps/openmw-mp/Script/Functions/Server.cpp b/apps/openmw-mp/Script/Functions/Server.cpp index 5f188b61a..3c8a795dc 100644 --- a/apps/openmw-mp/Script/Functions/Server.cpp +++ b/apps/openmw-mp/Script/Functions/Server.cpp @@ -34,6 +34,11 @@ void ServerFunctions::UnbanAddress(const char *ipAddress) noexcept mwmp::Networking::getPtr()->unbanAddress(ipAddress); } +const char *ServerFunctions::GetOperatingSystemType() noexcept +{ + return Utils::getOperatingSystem().c_str(); +} + const char *ServerFunctions::GetServerVersion() noexcept { return TES3MP_VERSION; diff --git a/apps/openmw-mp/Script/Functions/Server.hpp b/apps/openmw-mp/Script/Functions/Server.hpp index 7d4b0f10f..371be142e 100644 --- a/apps/openmw-mp/Script/Functions/Server.hpp +++ b/apps/openmw-mp/Script/Functions/Server.hpp @@ -10,6 +10,7 @@ {"BanAddress", ServerFunctions::BanAddress},\ {"UnbanAddress", ServerFunctions::UnbanAddress},\ \ + {"GetOperatingSystemType", ServerFunctions::GetOperatingSystemType},\ {"GetServerVersion", ServerFunctions::GetServerVersion},\ {"GetProtocolVersion", ServerFunctions::GetProtocolVersion},\ {"GetAvgPing", ServerFunctions::GetAvgPing},\ @@ -65,6 +66,15 @@ public: */ static void UnbanAddress(const char *ipAddress) noexcept; + /** + * \brief Get the type of the operating system used by the server. + * + * Note: Currently, the type can be "Windows", "Linux", "OS X" or "Unknown OS". + * + * \return The type of the operating system. + */ + static const char *GetOperatingSystemType() noexcept; + /** * \brief Get the TES3MP version of the server. *