Compare commits

...

2 Commits

Author SHA1 Message Date
ThePendulum ad26d2635c 1.29.8 2024-06-18 23:34:30 +02:00
ThePendulum 8d98581cd9 Fixed any mention of sponges being interpreted as a pong. 2024-06-18 23:34:27 +02:00
3 changed files with 6 additions and 4 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "schat2-clive", "name": "schat2-clive",
"version": "1.29.7", "version": "1.29.8",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "schat2-clive", "name": "schat2-clive",
"version": "1.29.7", "version": "1.29.8",
"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.29.7", "version": "1.29.8",
"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

@ -130,6 +130,8 @@ function handleError(error, socket, domain, data) {
} }
} }
const pongRegex = /^pong:\d+$/;
async function connect(bot, games) { async function connect(bot, games) {
const socket = { const socket = {
ws: { readyState: 0 }, ws: { readyState: 0 },
@ -154,7 +156,7 @@ async function connect(bot, games) {
socket.ws.on('message', async (msgData) => { socket.ws.on('message', async (msgData) => {
const msg = msgData.toString(); const msg = msgData.toString();
if (typeof msg === 'string' && msg.includes('pong')) { if (typeof msg === 'string' && pongRegex.test(msg)) {
logger.debug(`Received pong ${msg.split(':')[1]}`); logger.debug(`Received pong ${msg.split(':')[1]}`);
return; return;
} }