Compare commits
2 Commits
c2cdd55f2d
...
ad26d2635c
Author | SHA1 | Date |
---|---|---|
|
ad26d2635c | |
|
8d98581cd9 |
|
@ -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",
|
||||||
|
|
|
@ -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": {
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue