summaryrefslogtreecommitdiff
path: root/scripts/socket/sock.js
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2022-07-25 21:10:40 -0400
committerKyle Gunger <kgunger12@gmail.com>2022-07-25 21:10:40 -0400
commit380bfaeeeadbd7c3d6d0ee79551fedb35d597d8c (patch)
treeccf403f824f648e0b4f5e71ce5de546cce4ac3bd /scripts/socket/sock.js
parent7abeb4a35a0105b94e599de9970404c98790b4d9 (diff)
Fix a bug with the handshake
Diffstat (limited to 'scripts/socket/sock.js')
-rw-r--r--scripts/socket/sock.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/socket/sock.js b/scripts/socket/sock.js
index 4c64e02..a52faf4 100644
--- a/scripts/socket/sock.js
+++ b/scripts/socket/sock.js
@@ -11,12 +11,12 @@ class SockWorker extends EventTarget{
this.server = serveraddr;
this.version = version;
- this.handshake = false;
+ this.handshake = true;
}
// Initialize the connection.
init () {
- this.handshake = false;
+ this.handshake = true;
if(this.server == "" || this.server == null) {
return;
}
@@ -44,9 +44,9 @@ class SockWorker extends EventTarget{
if(typeof e.data == "string") {
let dat = JSON.parse(e.data);
- if (!this.handshake) {
+ if (this.handshake) {
if (dat.type == "ready")
- this.handshake = true;
+ this.handshake = false;
this.dispatchEvent(new CustomEvent("handshake", {detail: dat.type}));
return;
}