| 176 | } |
| 177 | |
| 178 | bool LuaEngine::parseConfig(ConfigType type, std::string_view str) |
| 179 | { |
| 180 | lua_getglobal(_stack->getLuaState(), "__onParseConfig"); |
| 181 | if (!lua_isfunction(_stack->getLuaState(), -1)) |
| 182 | { |
| 183 | AXLOGW("[LUA WARN] name '{}' does not represent a Lua function", "__onParseConfig"); |
| 184 | lua_pop(_stack->getLuaState(), 1); |
| 185 | return false; |
| 186 | } |
| 187 | |
| 188 | _stack->pushInt((int)type); |
| 189 | _stack->pushString(str.data(), str.length()); |
| 190 | |
| 191 | return _stack->executeFunction(2); |
| 192 | } |
| 193 | |
| 194 | int LuaEngine::sendEvent(const ScriptEvent& evt) |
| 195 | { |
no test coverage detected