From: Carl Worth Date: Fri, 9 Dec 2022 21:13:06 +0000 (-0800) Subject: Perform a complete round trip when setting a name X-Git-Url: https://git.cworth.org/git?p=zombocom-ai;a=commitdiff_plain;h=c7399ddc7ac3efd6797c3011959f2ac9d3f6e966 Perform a complete round trip when setting a name So a newly-set name ends up on the client (and the client knows the server has it). --- diff --git a/index.js b/index.js index b0e7d7a..07da00a 100644 --- a/index.js +++ b/index.js @@ -85,6 +85,8 @@ io.on('connection', (socket) => { console.log("Received set-name event: " + name); socket.request.session.name = name; socket.request.session.save(); + // Complete the round trip to the client + socket.emit('inform-name', socket.request.session.name); }); // When any client comments, send that to all clients (including sender)