forked from mirror/openmw-tes3mp
[Server] Implement native CreateTimer & CreateTimerEx
This commit is contained in:
parent
9ab58b6708
commit
c58c26f6c0
1 changed files with 16 additions and 2 deletions
|
@ -13,14 +13,28 @@ using namespace mwmp;
|
||||||
|
|
||||||
int ScriptFunctions::CreateTimer(ScriptFunc callback, int msec) noexcept
|
int ScriptFunctions::CreateTimer(ScriptFunc callback, int msec) noexcept
|
||||||
{
|
{
|
||||||
return -1;
|
return mwmp::TimerAPI::CreateTimer(callback, msec, "", vector<boost::any>());
|
||||||
}
|
}
|
||||||
|
|
||||||
int ScriptFunctions::CreateTimerEx(ScriptFunc callback, int msec, const char *types, ...) noexcept
|
int ScriptFunctions::CreateTimerEx(ScriptFunc callback, int msec, const char *types, ...) noexcept
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
vector<boost::any> params;
|
||||||
|
va_list args;
|
||||||
|
va_start(args, types);
|
||||||
|
GetArguments(params, args, types);
|
||||||
|
va_end(args);
|
||||||
|
|
||||||
|
return mwmp::TimerAPI::CreateTimer(callback, msec, types, params);
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void ScriptFunctions::StartTimer(int timerId) noexcept
|
void ScriptFunctions::StartTimer(int timerId) noexcept
|
||||||
{
|
{
|
||||||
TimerAPI::StartTimer(timerId);
|
TimerAPI::StartTimer(timerId);
|
||||||
|
|
Loading…
Reference in a new issue