@crypticat/core
Advanced tools
Comparing version 0.2.11 to 0.2.12
@@ -51,6 +51,2 @@ "use strict"; | ||
}); | ||
const pongInterval = setInterval(() => this.ws.send(JSON.stringify({ | ||
action: 'PONG', | ||
payload: {} | ||
})), 1000); | ||
this.ws.addEventListener('message', (message) => { | ||
@@ -153,2 +149,9 @@ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p; | ||
} | ||
case 'PING': { | ||
this.ws.send(JSON.stringify({ | ||
action: 'PONG', | ||
payload: {} | ||
})); | ||
break; | ||
} | ||
} | ||
@@ -162,3 +165,2 @@ } | ||
this.emit('close'); | ||
clearInterval(pongInterval); | ||
}); | ||
@@ -165,0 +167,0 @@ }); |
@@ -55,5 +55,5 @@ "use strict"; | ||
const pongCheckInterval = setInterval(() => { | ||
if (Date.now() - lastPong > 5000) | ||
if (Date.now() - lastPong > 6666) | ||
ws.close(); | ||
}, 5000); | ||
}, 6666); | ||
const leaveRoom = () => __awaiter(this, void 0, void 0, function* () { | ||
@@ -60,0 +60,0 @@ lib_1.assertDefined(room); |
{ | ||
"name": "@crypticat/core", | ||
"version": "0.2.11", | ||
"version": "0.2.12", | ||
"description": "Crypticat's core client and server implementation", | ||
@@ -5,0 +5,0 @@ "author": "Kognise <felix.mattick@gmail.com>", |
Sorry, the diff of this file is not supported yet
40940
504