X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=index.js;fp=index.js;h=a369ecb59e62227ee0f13756680d30d66a69533f;hb=60d4a9c676aba06a3815af5382b428aa44ec5ffa;hp=29f304bd13e2b3015c32b54af60fd94eee5227de;hpb=07b6a82a9dc415426d3ce3e326812f52d9c6f7e2;p=zombocom-ai diff --git a/index.js b/index.js index 29f304b..a369ecb 100644 --- a/index.js +++ b/index.js @@ -556,6 +556,11 @@ io.on('connection', (socket) => { socket.emit('inform-name', socket.request.session.name); } + // And if we're in the endgame, let them know that + if (state.endgame) { + socket.emit('endgame'); + } + // Replay old comments and images to a newly-joining client socket.emit('reset'); state.images.forEach((image) => { @@ -598,6 +603,15 @@ io.on('connection', (socket) => { }); function endgame() { + state.endgame = true; + + // Tell all clients we are in the endgame, (which will disable + // any additional image generation, both showing that Coda is + // correc that Zombo.com has been rendered inert, and also + // making clear to the boys that they have everything they + // need). + io.emit('endgame'); + // Before revealing Coda's final image, have her comment on // each of the weaknesses, in order to bring them to the top // of the feed.