MCPcopy Create free account
hub / github.com/DFHack/dfhack / RunLua

Method RunLua

library/RemoteTools.cpp:759–773  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

757}
758
759command_result CoreService::RunLua(color_ostream &stream,
760 const dfproto::CoreRunLuaRequest *in,
761 StringListMessage *out)
762{
763 auto L = DFHack::Core::getInstance().getLuaState();
764 LuaFunctionData data = { CR_FAILURE, in, out };
765
766 lua_pushcfunction(L, doRunLuaFunction);
767 lua_pushlightuserdata(L, &data);
768
769 if (!Lua::Core::SafeCall(stream, 1, 0))
770 return CR_FAILURE;
771
772 return data.rv;
773}
774
775int CoreService::doRunLuaFunction(lua_State *L)
776{

Callers

nothing calls this directly

Calls 2

lua_pushlightuserdataFunction · 0.85
SafeCallFunction · 0.85

Tested by

no test coverage detected