Compare commits

...

2 Commits

Author SHA1 Message Date
ThePendulum b8898d3fa3 1.4.5 2021-11-09 03:11:43 +01:00
ThePendulum 11225c7aa6 Added debug logger. 2021-11-09 03:11:29 +01:00
3 changed files with 7 additions and 3 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "schat2-clive",
"version": "1.4.4",
"version": "1.4.5",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "schat2-clive",
"version": "1.4.4",
"version": "1.4.5",
"license": "ISC",
"dependencies": {
"bhttp": "^1.2.8",

View File

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

View File

@ -9,6 +9,8 @@ const logger = require('simple-node-logger').createSimpleLogger();
const points = {};
logger.setLevel('debug');
async function auth() {
const httpSession = bhttp.session();
const username = config.uniqueUsername ? `${config.user.username}-${new Date().getTime().toString().slice(-5)}` : config.user.username;
@ -255,6 +257,8 @@ async function connect(wsCreds, sessionCookie, bot, games) {
socket.ws.on('message', async (msg) => {
const [domain, data] = JSON.parse(msg);
logger.debug(`Received ${domain}: ${JSON.stringify(data)}`);
if (messageHandlers[domain]) {
try {
await messageHandlers[domain](data, bot, games);