projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some advances in challenge handling (server+client)
[vchess.git]
/
server
/
sockets.js
diff --git
a/server/sockets.js
b/server/sockets.js
index
333fe77
..
c05293e
100644
(file)
--- a/
server/sockets.js
+++ b/
server/sockets.js
@@
-33,7
+33,7
@@
module.exports = function(wss) {
wss.on("connection", (socket, req) => {
const query = getJsonFromUrl(req.url);
const sid = query["sid"];
wss.on("connection", (socket, req) => {
const query = getJsonFromUrl(req.url);
const sid = query["sid"];
-
// Ignore duplicate connections (on the same live game that we play):
+ // Ignore duplicate connections (on the same live game that we play):
if (!!clients[sid])
return socket.send(JSON.stringify({code:"duplicate"}));
clients[sid] = socket;
if (!!clients[sid])
return socket.send(JSON.stringify({code:"duplicate"}));
clients[sid] = socket;