diff --git a/apps/openmw-mp/Script/ScriptFunctions.cpp b/apps/openmw-mp/Script/ScriptFunctions.cpp index fc29c6d5b..c08475855 100644 --- a/apps/openmw-mp/Script/ScriptFunctions.cpp +++ b/apps/openmw-mp/Script/ScriptFunctions.cpp @@ -9,6 +9,7 @@ #include #include #include +#include template constexpr char TypeString::value[]; @@ -119,3 +120,13 @@ void ScriptFunctions::Kick(unsigned short pid) noexcept GET_PLAYER(pid, player,); mwmp::Networking::GetPtr()->KickPlayer(player->guid); } + +const char *ScriptFunctions::GetServerVersion() noexcept +{ + return TES3MP_VERSION; +} + +const char *ScriptFunctions::GetProtocolVersion() noexcept +{ + return to_string((int)TES3MP_PROTO_VERSION).c_str(); +} \ No newline at end of file diff --git a/apps/openmw-mp/Script/ScriptFunctions.hpp b/apps/openmw-mp/Script/ScriptFunctions.hpp index 8d59b7d57..643bc1f63 100644 --- a/apps/openmw-mp/Script/ScriptFunctions.hpp +++ b/apps/openmw-mp/Script/ScriptFunctions.hpp @@ -58,6 +58,8 @@ public: static bool IsTimerElapsed(int timerId) noexcept; static void Kick(unsigned short pid) noexcept; + static const char *GetServerVersion() noexcept; + static const char *GetProtocolVersion() noexcept; static constexpr ScriptFunctionData functions[]{ {"CreateTimer", ScriptFunctions::CreateTimer}, @@ -77,6 +79,8 @@ public: // {"Cast", ScriptFunctions::Cast}, {"SendMessage", ScriptFunctions::SendMessage}, {"Kick", ScriptFunctions::Kick}, + {"GetServerVersion", ScriptFunctions::GetServerVersion}, + {"GetProtocolVersion", ScriptFunctions::GetProtocolVersion}, TRANSLOCATIONFUNCTIONS, STATSFUNCTIONS,