aboutsummaryrefslogtreecommitdiff
path: root/webAO
diff options
context:
space:
mode:
authorsD <stoned@derpymail.org>2020-03-27 18:59:58 +0100
committersD <stoned@derpymail.org>2020-03-27 18:59:58 +0100
commit99d2c19cfd8608dc8214490992205616fed1e944 (patch)
tree313198dcb91fb4cd3278a4b84461c4dc769358b8 /webAO
parent4c33bc2aef3fe0cc01b94f194ec871dd19b6451a (diff)
don't hide the entries if we're not checking them
Diffstat (limited to 'webAO')
-rw-r--r--webAO/master.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/webAO/master.js b/webAO/master.js
index d5bcff2..4281a49 100644
--- a/webAO/master.js
+++ b/webAO/master.js
@@ -75,9 +75,7 @@ function onOpen(_e) {
}
function checkOnline(serverID, coIP) {
- let oserv;
- if (lowMemory===false)
- oserv = new WebSocket("ws://" + coIP);
+ let oserv = new WebSocket("ws://" + coIP);
// define what the callbacks do
function onCOOpen(_e) {
@@ -131,15 +129,18 @@ function onMessage(e) {
const serverEntry = servers[i];
const args = serverEntry.split("&");
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="unavailable" onmouseover="setServ(${i})"><p>${args[0]}</p>`
+ `<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>`;
server_description[i] = args[1];
- checkOnline(i, `${args[2]}:${args[3]}`);
+ if (lowMemory===false)
+ checkOnline(i, `${args[2]}:${args[3]}`);
}
- checkOnline(-1, "127.0.0.1:50001");
+ if (lowMemory===false)
+ checkOnline(-1, "127.0.0.1:50001");
masterserver.close();
}
else if (header === "servercheok") {