]> git.cworth.org Git - zombocom-ai/blobdiff - index.js
Disable the art-generation form when the puzzle hunt is over
[zombocom-ai] / index.js
index 29f304bd13e2b3015c32b54af60fd94eee5227de..a369ecb59e62227ee0f13756680d30d66a69533f 100644 (file)
--- 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.