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:
@@ -3,7 +3,6 @@
|
||||
|
||||
#include "world.hpp"
|
||||
#include "drivenengine.hpp"
|
||||
#include "luaconsole.hpp"
|
||||
#include "util.hpp"
|
||||
#include "printbuffer.hpp"
|
||||
#include "luastack.hpp"
|
||||
@@ -22,11 +21,9 @@ public:
|
||||
using UniqueClient = std::unique_ptr<Client>;
|
||||
using ClientVector = eng::vector<UniqueClient>;
|
||||
|
||||
class LpxServer : public DrivenEngine, public CommonCommands {
|
||||
class LpxServer : public DrivenEngine {
|
||||
public:
|
||||
using StringVec = LuaConsole::StringVec;
|
||||
UniqueWorld master_;
|
||||
LuaConsole console_;
|
||||
ClientVector clients_;
|
||||
PrintChanneler print_channeler_;
|
||||
HttpChannelMap http_client_channels_;
|
||||
@@ -57,9 +54,6 @@ public:
|
||||
// Enable listening on port 8080 (http server connections)
|
||||
listen_port(8080);
|
||||
|
||||
// Set the console prompt.
|
||||
set_console_prompt(console_.get_prompt());
|
||||
|
||||
// Export stuff to the graphics engine.
|
||||
set_visible_world_and_actor(master_.get(), admin_id_);
|
||||
|
||||
@@ -74,54 +68,9 @@ public:
|
||||
lua_close(lua_syntax_checker_);
|
||||
}
|
||||
|
||||
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, "\n");
|
||||
}
|
||||
|
||||
virtual void do_view_command() override {
|
||||
util::dprint(master_->tangibles_near_debug_string(admin_id_, 1000));
|
||||
}
|
||||
|
||||
virtual void do_moveto_command(int x, int y) override {
|
||||
do_unknown_command("moveto");
|
||||
}
|
||||
|
||||
virtual void do_quit_command() override {
|
||||
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 {
|
||||
master_->abort_all_http_requests(425, "http requests aborted from the server command line");
|
||||
}
|
||||
|
||||
virtual void do_connect_command(std::string_view hostname) override {
|
||||
do_unknown_command("connect");
|
||||
}
|
||||
|
||||
virtual void do_luainvoke_command(std::string_view cmd) override {
|
||||
master_->invoke(Invocation(AccessKind::INVOKE_LUA_EXPR, admin_id_, admin_id_, cmd));
|
||||
}
|
||||
|
||||
virtual void do_luaprobe_command(std::string_view cmd) override {
|
||||
master_->snapshot();
|
||||
util::dprint(master_->probe_lua_expr(admin_id_, cmd));
|
||||
master_->rollback();
|
||||
void slash_command(std::string_view command)
|
||||
{
|
||||
util::dprint("Slash Command:", command);
|
||||
}
|
||||
|
||||
void delete_client(UniqueClient &client) {
|
||||
@@ -205,6 +154,10 @@ public:
|
||||
set_have_prints(false);
|
||||
break;
|
||||
}
|
||||
case AccessKind::SLASH_COMMAND: {
|
||||
slash_command(datapk);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
util::dprint("Invalid event_access: ", int(kind));
|
||||
}
|
||||
@@ -222,15 +175,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 new incoming channels, set up client structures.
|
||||
while (true) {
|
||||
SharedChannel chan = new_incoming_channel();
|
||||
|
||||
Reference in New Issue
Block a user