[Server] Add GetOperatingSystemType() script function

pull/496/head
David Cernat 6 years ago
parent da6b89c185
commit fa1700e2ab

@ -34,6 +34,11 @@ void ServerFunctions::UnbanAddress(const char *ipAddress) noexcept
mwmp::Networking::getPtr()->unbanAddress(ipAddress); mwmp::Networking::getPtr()->unbanAddress(ipAddress);
} }
const char *ServerFunctions::GetOperatingSystemType() noexcept
{
return Utils::getOperatingSystem().c_str();
}
const char *ServerFunctions::GetServerVersion() noexcept const char *ServerFunctions::GetServerVersion() noexcept
{ {
return TES3MP_VERSION; return TES3MP_VERSION;

@ -10,6 +10,7 @@
{"BanAddress", ServerFunctions::BanAddress},\ {"BanAddress", ServerFunctions::BanAddress},\
{"UnbanAddress", ServerFunctions::UnbanAddress},\ {"UnbanAddress", ServerFunctions::UnbanAddress},\
\ \
{"GetOperatingSystemType", ServerFunctions::GetOperatingSystemType},\
{"GetServerVersion", ServerFunctions::GetServerVersion},\ {"GetServerVersion", ServerFunctions::GetServerVersion},\
{"GetProtocolVersion", ServerFunctions::GetProtocolVersion},\ {"GetProtocolVersion", ServerFunctions::GetProtocolVersion},\
{"GetAvgPing", ServerFunctions::GetAvgPing},\ {"GetAvgPing", ServerFunctions::GetAvgPing},\
@ -65,6 +66,15 @@ public:
*/ */
static void UnbanAddress(const char *ipAddress) noexcept; 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. * \brief Get the TES3MP version of the server.
* *

Loading…
Cancel
Save