1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 15:49:56 +00:00
openmw-tes3mp/apps/openmw-mp/Script/ScriptFunctions.cpp

34 lines
918 B
C++
Raw Normal View History

#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[];
void ScriptFunctions::MakePublic(ScriptFunc _public, const char *name, char ret_type, const char *def) noexcept
{
Public::MakePublic(_public, name, ret_type, def);
}
boost::any ScriptFunctions::CallPublic(const char *name, va_list args) noexcept
{
2021-03-21 13:45:01 +00:00
std::vector<boost::any> params;
try
{
2021-03-21 13:45:01 +00:00
std::string def = Public::GetDefinition(name);
Utils::getArguments(params, args, def);
return Public::Call(name, params);
}
catch (...) {}
return 0;
}