aboutsummaryrefslogtreecommitdiff
path: root/webAO/master.js
diff options
context:
space:
mode:
authorstonedDiscord <10584181+stonedDiscord@users.noreply.github.com>2020-09-27 22:02:32 +0200
committerstonedDiscord <10584181+stonedDiscord@users.noreply.github.com>2020-09-27 22:02:32 +0200
commit8bf6d65748c9ef269bf8b436fed5777ed77aa77c (patch)
tree106b66c20342e90f50541df3569ede4c05d53d83 /webAO/master.js
parentb95fe7317d5c999b0b74f2581bcc8d1696faa896 (diff)
only combine ip and port once
Diffstat (limited to 'webAO/master.js')
-rw-r--r--webAO/master.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/webAO/master.js b/webAO/master.js
index 4862a74..be3478e 100644
--- a/webAO/master.js
+++ b/webAO/master.js
@@ -141,16 +141,17 @@ function onMessage(e) {
for (let i = 0; i < servers.length - 1; i++) {
const serverEntry = servers[i];
const args = serverEntry.split("&");
+ const ipport = args[2] + ":" + args[3];
const asset = args[4] ? `&asset=${args[4]}` : "";
const liclass = lowMemory ? "" : "unavailable"; // don't hide the entries if we're not checking them
document.getElementById("masterlist").innerHTML +=
`<li id="server${i}" class="${liclass}" onmouseover="setServ(${i})"><p>${args[0]}</p>`
- + `<a class="button" href="client.html?mode=watch&ip=${args[2]}:${args[3]}${asset}">Watch</a>`
- + `<a class="button" href="client.html?mode=join&ip=${args[2]}:${args[3]}${asset}">Join</a></li>`;
+ + `<a class="button" href="client.html?mode=watch&ip=${ipport}${asset}">Watch</a>`
+ + `<a class="button" href="client.html?mode=join&ip=${ipport}${asset}">Join</a></li>`;
server_description[i] = args[1];
if (!lowMemory)
- setTimeout(() => checkOnline(i, `${args[2]}:${args[3]}`), 0);
+ setTimeout(() => checkOnline(i, ipport), 0);
}
masterserver.close();
}