From: Benjamin Auder Date: Wed, 17 Nov 2021 14:00:02 +0000 (+0100) Subject: Cosmetics X-Git-Url: https://git.auder.net/variants/Baroque/current/css/img/cross.svg?a=commitdiff_plain;h=524e87edee6bf88b8a066ff146adfb75520acd20;p=xogo.git Cosmetics --- diff --git a/server.js b/server.js index 7dbbaac..a068c6e 100644 --- a/server.js +++ b/server.js @@ -10,14 +10,14 @@ const variants = require("./variants.js"); const Crypto = require("crypto"); const randstrSize = 8; -const send = (sid, code, data) => { +function send(sid, code, data) { const socket = sockets[sid]; // If a player deletes local infos and then tries to resume a game, // sockets[oppSid] will probably not exist anymore: if (socket) socket.send(JSON.stringify(Object.assign({ code: code }, data))); -}; +} -wss.on("connection", function connection(socket, req) { +wss.on("connection", (socket, req) => { const sid = req.url.split("=")[1]; //...?sid=... sockets[sid] = socket; socket.isAlive = true;