Fixed any mention of sponges being interpreted as a pong.

This commit is contained in:
ThePendulum 2024-06-18 23:34:27 +02:00
parent c2cdd55f2d
commit 8d98581cd9
1 changed files with 3 additions and 1 deletions

View File

@ -130,6 +130,8 @@ function handleError(error, socket, domain, data) {
}
}
const pongRegex = /^pong:\d+$/;
async function connect(bot, games) {
const socket = {
ws: { readyState: 0 },
@ -154,7 +156,7 @@ async function connect(bot, games) {
socket.ws.on('message', async (msgData) => {
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]}`);
return;
}