Implement probe_lua and add it to lpxclient/lpxserver

This commit is contained in:
2021-11-26 13:56:24 -05:00
parent c02109699e
commit 1e93533246
10 changed files with 134 additions and 35 deletions

View File

@@ -94,10 +94,16 @@ public:
inv.serialize(sb);
}
void do_lua_command(const StringVec &words) {
void do_luainvoke_command(const StringVec &words) {
send_invocation(Invocation(Invocation::KIND_LUA, actor_id_, actor_id_, words[1]));
}
void do_luaprobe_command(const StringVec &words) {
world_to_asynchronous();
stdostream() << world_->probe_lua(actor_id_, words[1]);
world_to_synchronous();
}
void do_syntax_command(const StringVec &words) {
stdostream() << "Syntax Error: " << words[1] << std::endl;
}
@@ -131,7 +137,8 @@ public:
void do_command(const util::StringVec &words) {
if (words.empty()) return;
else if (words[0] == "lua") do_lua_command(words);
else if (words[0] == "luainvoke") do_luainvoke_command(words);
else if (words[0] == "luaprobe") do_luaprobe_command(words);
else if (words[0] == "syntax") do_syntax_command(words);
else if (words[0] == "view") do_view_command(words);
else if (words[0] == "menu") do_menu_command(words);