diff --git a/components/addbotbtn.html b/components/addbotbtn.html index 889647b..a817654 100644 --- a/components/addbotbtn.html +++ b/components/addbotbtn.html @@ -1,10 +1,18 @@ {{ define "addbot" }}
+ {{ if eq .Room.BlueTeam.Mime "" }} + {{ end }} + {{ if eq .Room.RedTeam.Mime "" }} + {{ end }}
+ {{ if not .Room.BlueTeam.Guessers }} + {{ end }} + {{ if not .Room.RedTeam.Guessers }} + {{ end }}
{{end}} diff --git a/components/room.html b/components/room.html index 9945eaf..a079694 100644 --- a/components/room.html +++ b/components/room.html @@ -56,6 +56,11 @@ {{template "mimeclue"}} {{end}} +
+ {{if and (eq .State.Username .Room.CreatorName) (.Room.IsRunning)}} + + {{end}} +
{{template "actionhistory" .Room.ActionHistory}}
diff --git a/handlers/game.go b/handlers/game.go index 0a4382a..4da845c 100644 --- a/handlers/game.go +++ b/handlers/game.go @@ -260,3 +260,12 @@ func HandleGiveClue(w http.ResponseWriter, r *http.Request) { return } } + +func HandleRenotifyBot(w http.ResponseWriter, r *http.Request) { + fi, err := getFullInfoByCtx(r.Context()) + if err != nil { + abortWithError(w, err.Error()) + return + } + notifyBotIfNeeded(fi) +} diff --git a/main.go b/main.go index fd0cb77..bc818c0 100644 --- a/main.go +++ b/main.go @@ -43,6 +43,8 @@ func ListenToRequests(port string) error { mux.HandleFunc("GET /word/show-color", handlers.HandleShowColor) mux.HandleFunc("POST /check/name", handlers.HandleNameCheck) mux.HandleFunc("GET /add-bot", handlers.HandleAddBot) + // special + mux.HandleFunc("GET /renotify-bot", handlers.HandleRenotifyBot) // sse mux.Handle("GET /sub/sse", handlers.Notifier) slog.Info("Listening", "addr", port) diff --git a/todos.md b/todos.md index 333a014..7f0359d 100644 --- a/todos.md +++ b/todos.md @@ -1,17 +1,17 @@ ### feats - auto close room if nothing is going on there (hmm) for ~1h; -- words database (file) load and form random 25 words; +- words database (file) load and form random 25 words; + - different files for each supported lang; - mark cards (instead of opening them (right click?); -- invite link; -- login with invite link; +- invite link; + +- login with invite link; + - add html icons of whos turn it is (like an image of big ? when mime is thinking); -- there two places for bot to check if its its move: start-game; end-turn; -- remove bot button (if game is not running); +- there three places for bot to check if its its move: start-game; end-turn, after mime gave clue; +- remove bot button (if game is not running, or bot already added); - show in backlog (and with that in prompt to llm) how many cards are left to open, also additional comment: if guess was right; - if bot already added; remove add bot button; - hide clue input for mime when it's not their turn; -- needs resend to llm btn; +- needs resend to llm btn; + #### sse points - clue sse update; @@ -30,3 +30,5 @@ - sse hangs / fails connection which causes to wait for cards to open a few seconds (on local machine); - after starting a new game (after old one) blue mime has no clue input; - gameover to backlog; +- remove verbs from word file; +- invite link gets cutoff;