Give scorekeeper ability to signal field reset and volunteers.

This commit is contained in:
Patrick Fairbank
2022-07-24 14:36:44 -07:00
parent 915351df8f
commit c78c5323bb
4 changed files with 57 additions and 4 deletions

View File

@@ -7,6 +7,7 @@ package web
import (
"fmt"
"github.com/Team254/cheesy-arena-lite/field"
"github.com/Team254/cheesy-arena-lite/game"
"github.com/Team254/cheesy-arena-lite/model"
"github.com/Team254/cheesy-arena-lite/tournament"
@@ -243,6 +244,22 @@ func (web *Web) matchPlayWebsocketHandler(w http.ResponseWriter, r *http.Request
ws.WriteError(err.Error())
continue
}
case "signalVolunteers":
if web.arena.MatchState != field.PostMatch {
// Don't allow clearing the field until the match is over.
continue
}
web.arena.FieldVolunteers = true
continue // Don't reload.
case "signalReset":
if web.arena.MatchState != field.PostMatch {
// Don't allow clearing the field until the match is over.
continue
}
web.arena.FieldReset = true
web.arena.AllianceStationDisplayMode = "fieldReset"
web.arena.AllianceStationDisplayModeNotifier.Notify()
continue // Don't reload.
case "commitResults":
err = web.commitCurrentMatchScore()
if err != nil {