Feat: save room even if llm failed to properly guess; fix prompt

This commit is contained in:
Grail Finder
2025-06-26 11:36:27 +03:00
parent 661a320fb5
commit 12fe92b261
7 changed files with 134 additions and 117 deletions

View File

@ -78,7 +78,7 @@ func HandleShowColor(w http.ResponseWriter, r *http.Request) {
Actor: fi.State.Username,
ActorColor: string(fi.State.Team),
WordColor: string(color),
Action: "guessed",
Action: models.ActionTypeGuess,
Word: word,
}
fi.Room.ActionHistory = append(fi.Room.ActionHistory, action)
@ -103,8 +103,8 @@ func HandleShowColor(w http.ResponseWriter, r *http.Request) {
action := models.Action{
Actor: fi.State.Username,
ActorColor: string(fi.State.Team),
WordColor: "black",
Action: "game over",
WordColor: models.WordColorBlack,
Action: models.ActionTypeGameOver,
}
fi.Room.OpenedThisTurn = 0
fi.Room.ThisTurnLimit = 0
@ -124,8 +124,8 @@ func HandleShowColor(w http.ResponseWriter, r *http.Request) {
action := models.Action{
Actor: fi.State.Username,
ActorColor: string(fi.State.Team),
WordColor: "blue",
Action: "game over",
WordColor: models.WordColorBlue,
Action: models.ActionTypeGameOver,
}
fi.Room.OpenedThisTurn = 0
fi.Room.ThisTurnLimit = 0
@ -139,8 +139,8 @@ func HandleShowColor(w http.ResponseWriter, r *http.Request) {
action := models.Action{
Actor: fi.State.Username,
ActorColor: string(fi.State.Team),
WordColor: "red",
Action: "game over",
WordColor: models.WordColorRed,
Action: models.ActionTypeGameOver,
}
fi.Room.OpenedThisTurn = 0
fi.Room.ThisTurnLimit = 0