]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Fix codenames landing page
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Tue, 28 Apr 2020 07:29:26 +0000 (09:29 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Tue, 28 Apr 2020 07:29:26 +0000 (09:29 +0200)
modules/private/websites/tools/games/codenames/greenapid.patch

index a8f670aaa5102429423fab76ba01919b29e6361c..21a9fadeecf090ebe246fd0149f29eb13adda8cc 100644 (file)
@@ -24,3 +24,16 @@ index 86499e9..1589323 100644
 +      err = server.Serve(ln)
        panic(err)
  }
+diff --git a/gameapi/handler.go b/gameapi/handler.go
+index d67cf94..108e7e1 100644
+--- a/gameapi/handler.go
++++ b/gameapi/handler.go
+@@ -101,7 +101,7 @@ func (h *handler) handleIndex(rw http.ResponseWriter, req *http.Request) {
+       for {
+               w1 := strings.ToLower(h.allWords[h.rand.Int63n(int64(len(h.allWords)))])
+               w2 := strings.ToLower(h.allWords[h.rand.Int63n(int64(len(h.allWords)))])
+-              id := fmt.Sprintf("%s-%s", w1, w2)
++              id = fmt.Sprintf("%s-%s", w1, w2)
+               if _, ok := h.games[id]; !ok {
+                       break
+               }