You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm trying to call inside lua an C function that contains 2 arguments, but it doesn't works properly, the output give me the error: "error in error handling".
The function have 1 int argument and 1 std::string argument, see:
sel::State lua;
lua.Load(strfmt("../../Scripts/%d.lua", item->PackageId));
lua["SendClientMsg"] = std::function<void(int, std::string)>(SendClientMessage);
int ret = lua["onUse"](m_buffer->Protocol.Connection);
I've tried also in this way:
lua["SendClientMsg"] = &SendClientMessage;
but both ways doesn't work, anyone have a solution to make this work?
In your code, sel::State lua doesn't know your function SendClientMsg when you loaded your script.
You shall bind your function first then you can load your script.
Hi, I'm trying to call inside lua an C function that contains 2 arguments, but it doesn't works properly, the output give me the error: "error in error handling".
The function have 1 int argument and 1 std::string argument, see:
I've tried also in this way:
lua["SendClientMsg"] = &SendClientMessage;
but both ways doesn't work, anyone have a solution to make this work?
the SendClientMessage:
void SendClientMessage(int32_t connectionId, std::string message)
lua file:
thanks!
The text was updated successfully, but these errors were encountered: