diff options
Diffstat (limited to 'webAO')
| -rw-r--r-- | webAO/master.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/webAO/master.ts b/webAO/master.ts index a48f4e9..5c538d4 100644 --- a/webAO/master.ts +++ b/webAO/master.ts @@ -132,6 +132,7 @@ function cachedServerlist(response: Response) { } function processServerlist(thelist: { name: string, description: string, ip: string, port: number, ws_port: number, assets: string, online: string }[]) { + const myURL: string = window.location.href.replace('https://','http://'); for (let i = 0; i < thelist.length - 1; i++) { const serverEntry: { name: string, description: string, ip: string, port: number, ws_port: number, assets: string, online: string } = thelist[i]; @@ -142,14 +143,13 @@ function processServerlist(thelist: { name: string, description: string, ip: str if (serverEntry.ws_port) { document.getElementById('masterlist').innerHTML += `<li id="server${i}" onmouseover="setServ(${i})"><p>${safeTags(serverEntry.name)}</p>` - + `<a class="button" href="client.html?mode=watch&ip=${ipport}">Watch</a>` - + `<a class="button" href="client.html?mode=join&ip=${ipport}">Join</a></li>`; + + `<a class="button" href="${myURL}client.html?mode=watch&ip=${ipport}">Watch</a>` + + `<a class="button" href="${myURL}client.html?mode=join&ip=${ipport}">Join</a></li>`; } } } function processVersion(data: string) { - console.debug(data); document.getElementById('clientinfo').innerHTML = `Client version: ${version}`; document.getElementById('serverinfo').innerHTML = `Master server version: ${data}`; } |
