From 9afa0420b0d34d8484a71ae278e4dbd1630a035a Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Thu, 11 Feb 2021 11:15:37 -0500 Subject: Input and settings fixes --- scripts/client.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'scripts/client.js') 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; } } -- cgit v1.2.3