From 576d1d2e6b593a89ab5339b94e57ab1b1044db28 Mon Sep 17 00:00:00 2001 From: David Skoland Date: Sat, 18 Nov 2023 20:05:27 +0100 Subject: somewhat backward compatible --- webAO/client.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'webAO/client.ts') diff --git a/webAO/client.ts b/webAO/client.ts index 3190bab..820b7f2 100644 --- a/webAO/client.ts +++ b/webAO/client.ts @@ -17,7 +17,7 @@ import { loadResources } from './client/loadResources' import { AO_HOST } from './client/aoHost' import { fetchBackgroundList, fetchEvidenceList, fetchCharacterList } from './client/fetchLists' -const { connect, mode, theme, serverName } = queryParser(); +const { ip: serverIP, connect, mode, theme, serverName } = queryParser(); document.title = serverName; @@ -70,12 +70,20 @@ fpPromise .then((result) => { hdid = result.visitorId; - if (!connect) { - alert("No connection string specified!"); - return; + let connectionString = connect; + + if (!connectionString) { + if (serverIP) { + // if connectionString is not set, try IP + // and just guess ws, though it could be wss + connectionString = `ws://${serverIP}`; + } else { + alert("No connection string specified!"); + return; + } } - client = new Client(connect); + client = new Client(connectionString); client.connect() isLowMemory(); loadResources(); -- cgit