From 63dff39be299a7e7ca611c659982d8e4d98853b2 Mon Sep 17 00:00:00 2001 From: Kim Ravn Hansen Date: Mon, 15 Sep 2025 12:33:08 +0200 Subject: [PATCH] prut --- server/frontend/client.js | 7 ++++- server/frontend/index.html | 5 ++-- server/frontend/manifest.json | 21 ++++++++++++++- server/frontend/{style.sass => style.scss} | 28 +++++++++---------- server/frontend/vite.config.js | 10 ++++--- server/package-lock.json | 30 ++++++++++++++++++++- server/package.json | 3 ++- server/public/index.html | 31 ---------------------- server/scenes/scene.js | 1 + server/server.js | 1 + server/test.js | 4 --- server/utils/parseArgs.js | 2 +- 12 files changed, 84 insertions(+), 59 deletions(-) rename server/frontend/{style.sass => style.scss} (83%) delete mode 100644 server/public/index.html delete mode 100644 server/test.js mode change 100644 => 100755 server/utils/parseArgs.js diff --git a/server/frontend/client.js b/server/frontend/client.js index 52cfdcb..d219812 100755 --- a/server/frontend/client.js +++ b/server/frontend/client.js @@ -1,6 +1,8 @@ import { crackdown } from "../utils/crackdown.js"; import { parseArgs } from "../utils/parseArgs.js"; import { MessageType } from "../utils/messages.js"; +import { sprintf } from "sprintf-js"; +import { Config } from "../config.js"; /** Regex to validate if a :help [topic] command i entered correctly */ const helpRegex = /^:help(?:\s+(.*))?$/; @@ -72,7 +74,10 @@ class MUDClient { connect() { const protocol = window.location.protocol === "https:" ? "wss:" : "ws:"; - const wsUrl = `${protocol}//${window.location.host}`; + + const wsUrl = `${protocol}//${window.location.host}`.replace(/:\d+$/, Config.port); + + console.log(window.location); this.updateStatus("Connecting...", "connecting"); diff --git a/server/frontend/index.html b/server/frontend/index.html index a864d61..c65383b 100755 --- a/server/frontend/index.html +++ b/server/frontend/index.html @@ -6,9 +6,9 @@ WebSocket MUD - + -