luaconsole.cpp has been removed. Ascii driver is still sending text via stdin, but it is now ignored. So in ascii mode, commands are currently not interpreted.

This commit is contained in:
2025-12-16 00:34:30 -05:00
parent c0bcb1099b
commit f75ff36c3d
9 changed files with 21 additions and 288 deletions

View File

@@ -3,21 +3,18 @@
#include "drivenengine.hpp"
#include "world.hpp"
#include "luaconsole.hpp"
#include "invocation.hpp"
#include "util.hpp"
#include "printbuffer.hpp"
#include <memory>
class LpxClient : public DrivenEngine, public CommonCommands {
class LpxClient : public DrivenEngine {
public:
using StringVec = LuaConsole::StringVec;
UniqueWorld world_;
int64_t actor_id_;
InvocationQueue unack_;
SharedChannel channel_;
LuaConsole console_;
PrintChanneler print_channeler_;
eng::vector<Invocation> delayed_invocations_;
lua_State *lua_syntax_checker_;
@@ -26,8 +23,6 @@ public:
LpxClient() {
lua_syntax_checker_ = LuaCoreStack::newstate(eng::l_alloc);
set_console_prompt(console_.get_prompt());
set_initial_state_standalone();
}
@@ -134,55 +129,10 @@ public:
}
}
virtual void do_syntax_error(std::string_view error) override {
util::dprint("Syntax error: ", error, "\n");
}
virtual void do_unknown_command(std::string_view name) override {
util::dprint("Unknown command: ", name);
}
virtual void do_view_command() override {
util::dprint(world_->tangibles_near_debug_string(actor_id_, 1000));
}
virtual void do_moveto_command(int x, int y) override {
do_unknown_command("moveto");
}
virtual void do_quit_command() override {
abandon_server();
stop_driver();
}
virtual void do_cpl_command() override {
rescan_lua_source(true);
}
virtual void do_work_command() override {
do_unknown_command("work");
}
virtual void do_display_command() override {
do_unknown_command("display");
}
virtual void do_aborthttp_command() override {
do_unknown_command("aborthttp");
}
virtual void do_connect_command(std::string_view hostname) override {
set_initial_state_connect(util::ss("nocert:", hostname, ":8085"));
}
virtual void do_luainvoke_command(std::string_view cmd) override {
send_invocation(Invocation(AccessKind::INVOKE_LUA_EXPR, actor_id_, actor_id_, cmd));
}
virtual void do_luaprobe_command(std::string_view cmd) override {
world_to_asynchronous();
util::dprint(world_->probe_lua_expr(actor_id_, cmd));
world_to_synchronous();
void slash_command(std::string_view command) {
util::dprint("Slash Command: ", command);
//
// set_initial_state_connect(util::ss("nocert:", hostname, ":8085"));
}
void change_actor_id(int64_t actor_id) {
@@ -279,6 +229,10 @@ public:
set_have_prints(false);
break;
}
case AccessKind::SLASH_COMMAND: {
slash_command(datapk);
break;
}
default: {
util::dprint("Invalid event_access: ", int(kind));
}
@@ -292,15 +246,6 @@ public:
}
delayed_invocations_.clear();
// Check for keyboard input on stdin.
while (true) {
eng::string line = get_stdio_channel()->in()->readline();
if (line == "") break;
console_.add(line);
set_console_prompt(console_.get_prompt());
do_command(console_.get_command());
}
// Check for communication from server..
if (channel_ != nullptr) {
if (channel_->closed()) {