2016-01-12 03:41:44 +00:00
|
|
|
#include "ScriptFunctions.hpp"
|
|
|
|
#include "API/PublicFnAPI.hpp"
|
|
|
|
#include <cstdarg>
|
|
|
|
#include <iostream>
|
|
|
|
#include <apps/openmw-mp/Player.hpp>
|
|
|
|
#include <apps/openmw-mp/Networking.hpp>
|
|
|
|
#include <components/openmw-mp/NetworkMessages.hpp>
|
|
|
|
|
|
|
|
template<typename... Types>
|
|
|
|
constexpr char TypeString<Types...>::value[];
|
|
|
|
constexpr ScriptFunctionData ScriptFunctions::functions[];
|
|
|
|
constexpr ScriptCallbackData ScriptFunctions::callbacks[];
|
|
|
|
|
2016-11-16 17:27:46 +00:00
|
|
|
void ScriptFunctions::MakePublic(ScriptFunc _public, const char *name, char ret_type, const char *def) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
2016-11-16 17:27:46 +00:00
|
|
|
Public::MakePublic(_public, name, ret_type, def);
|
2016-01-12 03:41:44 +00:00
|
|
|
}
|
|
|
|
|
2017-06-30 09:59:50 +00:00
|
|
|
boost::any ScriptFunctions::CallPublic(const char *name, va_list args) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
2021-03-21 13:45:01 +00:00
|
|
|
std::vector<boost::any> params;
|
2016-01-12 03:41:44 +00:00
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2021-03-21 13:45:01 +00:00
|
|
|
std::string def = Public::GetDefinition(name);
|
2019-02-23 23:43:04 +00:00
|
|
|
Utils::getArguments(params, args, def);
|
2016-01-12 03:41:44 +00:00
|
|
|
|
|
|
|
return Public::Call(name, params);
|
|
|
|
}
|
|
|
|
catch (...) {}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|