summaryrefslogtreecommitdiff
path: root/scripts/client.js
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2021-02-11 11:15:37 -0500
committerKyle Gunger <kgunger12@gmail.com>2021-02-11 11:15:37 -0500
commit9afa0420b0d34d8484a71ae278e4dbd1630a035a (patch)
tree6e7a90d247ae89cd65caca71b2cbbaaceeff58ac /scripts/client.js
parentaa92baae14882ccf38f311f71c64cc0a6205553e (diff)
Input and settings fixes
Diffstat (limited to 'scripts/client.js')
-rw-r--r--scripts/client.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/client.js b/scripts/client.js
index 46acf6a..0212efc 100644
--- a/scripts/client.js
+++ b/scripts/client.js
@@ -1,3 +1,4 @@
+'use strict';
const VERSION = "1.0.0";
// Client acts as the message hub for the whole game.
@@ -51,12 +52,28 @@ class Client{
switch (m.type) {
case "verr":
this.socket.close();
+
alert(`Error connecting to server: version of client (${this.version}) not accepted.`);
+
console.error(`Error connecting to server: version of client (${this.version}) not accepted.`);
+
console.error(m.data);
+
return;
+
case "ready":
+ if(this.settings !== undefined)
+ this.settings.cleanup();
+
+ this.settings = new Settings(m.data);
+
+ if(this.lobby.top.mobileSettingsOpen())
+ this.settings.putSettings(this.lobby.top.mobileSettings);
+ else
+ this.settings.putSettings(this.lobby.e.settings);
+
this.socket.send("ready", "");
+
return;
}
}