This commit is contained in:
Kim Ravn Hansen
2025-09-19 16:04:11 +02:00
parent b1d667d7cb
commit 3a9185ca94
20 changed files with 2520 additions and 360 deletions

View File

@@ -1,7 +1,6 @@
import { crackdown } from "../utils/crackdown.js";
import { parseArgs } from "../utils/parseArgs.js";
import { MessageType } from "../utils/messages.js";
import { sprintf } from "sprintf-js";
/** Regex to validate if a :help [topic] command i entered correctly */
const helpRegex = /^:help(?:\s+(.*))?$/;
@@ -107,6 +106,7 @@ class MUDClient {
};
this.websocket.onerror = (error) => {
console.log("Websocket error", error);
this.updateStatus("Connection Error", "error");
this.writeToOutput("Connection error occurred. Retrying...", { class: "error" });
};
@@ -203,7 +203,7 @@ class MUDClient {
let help = helpRegex.exec(inputText);
if (help) {
console.log("here");
help[1] ? this.send(MshType.HELP, help[1].trim()) : this.send(MshType.HELP);
help[1] ? this.send(MessageType.HELP, help[1].trim()) : this.send(MessageType.HELP);
this.echo(inputText);
return;
}