forked from mirror/openmw-tes3mp
[Server] Add SetRuleString and SetRuleValue to script API
This commit is contained in:
parent
a0b71eda23
commit
a4a77ddeff
2 changed files with 18 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue