Do a refactor of command parsing in lpxclient and lpxserver

This commit is contained in:
2024-02-28 18:24:36 -05:00
parent 4495ae7133
commit c2a94b5332
6 changed files with 240 additions and 183 deletions

View File

@@ -268,7 +268,7 @@ int64_t World::create_login_actor(bool initialize) {
return id;
}
eng::string World::probe_lua(int64_t actor_id, const eng::string &lua) {
eng::string World::probe_lua(int64_t actor_id, std::string_view lua) {
assert(stack_is_clear());
lua_State *L = state();
@@ -281,7 +281,7 @@ eng::string World::probe_lua(int64_t actor_id, const eng::string &lua) {
LuaExtStack LS(L, closure);
// create the compiled closure.
int status = luaL_loadbuffer(L, lua.c_str(), lua.size(), "=probe");
int status = luaL_loadbuffer(L, lua.data(), lua.size(), "=probe");
lua_replace(L, closure.index());
if (status != LUA_OK) {
// The closure is actually an error message. Do nothing.