[Server] Add SetRuleString and SetRuleValue to script API

0.6.1
Koncord 8 years ago
parent a0b71eda23
commit a4a77ddeff

@ -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…
Cancel
Save