diff options
| author | David Skoland <davidskoland@gmail.com> | 2023-11-18 20:00:11 +0100 |
|---|---|---|
| committer | David Skoland <davidskoland@gmail.com> | 2023-11-20 21:10:04 +0100 |
| commit | b8f748598f76cb5ebf9cb1b5ef3a455046c920ca (patch) | |
| tree | 792864378d321ae69b362a2b36a309ff718b812b | |
| parent | eae8a41221a35bb435095f9c4d7419dddb87eee0 (diff) | |
Change client to use connection string
| -rw-r--r-- | webAO/client.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/webAO/client.ts b/webAO/client.ts index 3170ec8..3190bab 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 { ip: serverIP, mode, theme, serverName } = queryParser(); +const { connect, mode, theme, serverName } = queryParser(); document.title = serverName; @@ -70,12 +70,12 @@ fpPromise .then((result) => { hdid = result.visitorId; - if (!serverIP) { - alert("No server IP specified!"); + if (!connect) { + alert("No connection string specified!"); return; } - client = new Client(serverIP); + client = new Client(connect); client.connect() isLowMemory(); loadResources(); @@ -117,7 +117,7 @@ class Client extends EventEmitter { connect: () => void; loadResources: () => void isLowMemory: () => void - constructor(address: string) { + constructor(connectionString: string) { super(); this.connect = () => { @@ -126,7 +126,7 @@ class Client extends EventEmitter { this.on("message", this.onMessage.bind(this)); this.on("error", this.onError.bind(this)); if (mode !== "replay") { - this.serv = new WebSocket(`ws://${address}`); + this.serv = new WebSocket(connectionString); // Assign the websocket events this.serv.addEventListener("open", this.emit.bind(this, "open")); this.serv.addEventListener("close", this.emit.bind(this, "close")); |
