From: Ismaƫl Bouya Date: Tue, 28 Apr 2020 07:29:26 +0000 (+0200) Subject: Fix codenames landing page X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=615293e477ef5bace312a0d4d7cce99422bf3c3a;p=perso%2FImmae%2FConfig%2FNix.git Fix codenames landing page --- diff --git a/modules/private/websites/tools/games/codenames/greenapid.patch b/modules/private/websites/tools/games/codenames/greenapid.patch index a8f670a..21a9fad 100644 --- a/modules/private/websites/tools/games/codenames/greenapid.patch +++ b/modules/private/websites/tools/games/codenames/greenapid.patch @@ -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 + }