Compare commits

..

No commits in common. "aeb405967b175dc267461278afa69387dd7c61f9" and "c9b985f7686ddb558c8c0be4edf7512d7019b2e6" have entirely different histories.

3 changed files with 4 additions and 26 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "schat2-clive", "name": "schat2-clive",
"version": "1.28.1", "version": "1.28.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "schat2-clive", "name": "schat2-clive",
"version": "1.28.1", "version": "1.28.0",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"better-sqlite3": "^8.3.0", "better-sqlite3": "^8.3.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "schat2-clive", "name": "schat2-clive",
"version": "1.28.1", "version": "1.28.0",
"description": "Game host for SChat 2-powered chat sites", "description": "Game host for SChat 2-powered chat sites",
"main": "src/app.js", "main": "src/app.js",
"scripts": { "scripts": {

View File

@ -149,14 +149,7 @@ async function connect(bot, games) {
}, },
}); });
socket.ws.on('message', async (msgData) => { socket.ws.on('message', async (msg) => {
const msg = msgData.toString();
if (typeof msg === 'string' && msg.includes('pong')) {
logger.debug(`Received pong ${msg.split(':')[1]}`);
return;
}
const [domain, data] = JSON.parse(msg); const [domain, data] = JSON.parse(msg);
logger.debug(`Received ${domain}: ${JSON.stringify(data)}`); logger.debug(`Received ${domain}: ${JSON.stringify(data)}`);
@ -194,21 +187,6 @@ async function connect(bot, games) {
socket.ws.send(JSON.stringify([domain, data])); socket.ws.send(JSON.stringify([domain, data]));
}; };
function ping() {
setTimeout(() => {
if (socket.ws && socket.ws?.readyState === socket.ws?.OPEN) {
const now = Date.now();
socket.ws.send(`ping:${now}`);
logger.debug(`Sent ping ${now}`);
}
ping();
}, 10000);
}
ping();
socket.connect(); socket.connect();
return socket; return socket;