LuaAPI: Implement GetOSName

This commit is contained in:
Lion Kortlepel 2021-09-16 12:22:49 +02:00
parent d7f7a81cb0
commit ebe3630ec8
No known key found for this signature in database
GPG Key ID: 4322FF2B4C71259B
2 changed files with 9 additions and 2 deletions

View File

@ -8,7 +8,7 @@ void Print(sol::variadic_args);
namespace MP { namespace MP {
static inline TLuaEngine* Engine { nullptr }; static inline TLuaEngine* Engine { nullptr };
void GetOSName(); std::string GetOSName();
std::tuple<int, int, int> GetServerVersion(); std::tuple<int, int, int> GetServerVersion();
} }
} }

View File

@ -32,7 +32,14 @@ static std::string LuaToString(const sol::object& Value) {
} }
} }
void LuaAPI::MP::GetOSName() { std::string LuaAPI::MP::GetOSName() {
#if WIN32
return "Windows";
#elif __linux
return "Linux";
#else
return "Other";
#endif
} }
std::tuple<int, int, int> LuaAPI::MP::GetServerVersion() { std::tuple<int, int, int> LuaAPI::MP::GetServerVersion() {