Feat: add game over

This commit is contained in:
Grail Finder
2025-05-11 10:03:18 +03:00
parent becd3aca02
commit cf5643227b
5 changed files with 29 additions and 10 deletions

View File

@ -192,11 +192,12 @@ func HandleStartGame(w http.ResponseWriter, r *http.Request) {
fi.Room.IsOver = false
fi.Room.TeamTurn = "blue"
fi.Room.LoadTestCards()
fi.Room.UpdateCounter()
fi.Room.TeamWon = ""
if err := saveFullInfo(fi); err != nil {
abortWithError(w, err.Error())
return
}
fi.Room.UpdateCounter()
// reveal all cards
if fi.State.Role == "mime" {
fi.Room.RevealAllCards()