diff options
| author | David Skoland <davidskoland@gmail.com> | 2023-11-18 20:05:27 +0100 |
|---|---|---|
| committer | David Skoland <davidskoland@gmail.com> | 2023-11-20 21:10:04 +0100 |
| commit | 576d1d2e6b593a89ab5339b94e57ab1b1044db28 (patch) | |
| tree | 7cf9b1e20f0e27f49d1f7a482f31a642f5fdbe66 | |
| parent | b8f748598f76cb5ebf9cb1b5ef3a455046c920ca (diff) | |
somewhat backward compatible
| -rw-r--r-- | webAO/client.ts | 18 |
1 files changed, 13 insertions, 5 deletions
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(); |
