Enha: sse update on actions

This commit is contained in:
Grail Finder
2025-05-10 11:03:23 +03:00
parent 416cc63ec0
commit 35e215e26f
12 changed files with 89 additions and 73 deletions

View File

@ -149,6 +149,7 @@ func HandleJoinTeam(w http.ResponseWriter, r *http.Request) {
abortWithError(w, err.Error())
return
}
notify(models.NotifyRoomUpdatePrefix+fi.Room.ID, "")
tmpl.ExecuteTemplate(w, "base", fi)
}
@ -176,6 +177,7 @@ func HandleEndTurn(w http.ResponseWriter, r *http.Request) {
abortWithError(w, err.Error())
return
}
notify(models.NotifyRoomUpdatePrefix+fi.Room.ID, "")
tmpl.ExecuteTemplate(w, "base", fi)
}
@ -204,6 +206,8 @@ func HandleStartGame(w http.ResponseWriter, r *http.Request) {
abortWithError(w, err.Error())
return
}
// to update only the room that should be updated
notify(models.NotifyRoomUpdatePrefix+fi.Room.ID, "")
tmpl.ExecuteTemplate(w, "room", fi)
}