From 615293e477ef5bace312a0d4d7cce99422bf3c3a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Tue, 28 Apr 2020 09:29:26 +0200 Subject: [PATCH] Fix codenames landing page --- .../websites/tools/games/codenames/greenapid.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 + } -- 2.41.0