diff --git a/apps/openmw-mp/Script/ScriptFunctions.cpp b/apps/openmw-mp/Script/ScriptFunctions.cpp index a4032238c..fd2c1546b 100644 --- a/apps/openmw-mp/Script/ScriptFunctions.cpp +++ b/apps/openmw-mp/Script/ScriptFunctions.cpp @@ -144,3 +144,17 @@ void ScriptFunctions::SetServerPassword(const char *passw) noexcept { mwmp::Networking::getPtr()->setServerPassword(passw); } + +void ScriptFunctions::SetRuleString(const char *key, const char *value) noexcept +{ + auto mc = mwmp::Networking::getPtr()->getMasterClient(); + if(mc) + mc->SetRuleString(key, value); +} + +void ScriptFunctions::SetRuleValue(const char *key, double value) noexcept +{ + auto mc = mwmp::Networking::getPtr()->getMasterClient(); + if(mc) + mc->SetRuleValue(key, value); +} diff --git a/apps/openmw-mp/Script/ScriptFunctions.hpp b/apps/openmw-mp/Script/ScriptFunctions.hpp index 38b87ba83..936f2b48c 100644 --- a/apps/openmw-mp/Script/ScriptFunctions.hpp +++ b/apps/openmw-mp/Script/ScriptFunctions.hpp @@ -69,6 +69,8 @@ public: static void SetModname(const char* name) noexcept; static void SetHostname(const char* name) noexcept; static void SetServerPassword(const char *passw) noexcept; + static void SetRuleString(const char *key, const char *value) noexcept; + static void SetRuleValue(const char *key, double value) noexcept; static constexpr ScriptFunctionData functions[]{ {"CreateTimer", ScriptFunctions::CreateTimer}, @@ -92,6 +94,8 @@ public: {"SetModname", ScriptFunctions::SetModname}, {"SetHostname", ScriptFunctions::SetHostname}, {"SetServerPassword", ScriptFunctions::SetServerPassword}, + {"SetRuleString", ScriptFunctions::SetRuleString}, + {"SetRuleValue", ScriptFunctions::SetRuleValue}, POSITIONAPI, CELLAPI,