Skip to content

Commit

Permalink
Revert "Update arena_notifiers.go"
Browse files Browse the repository at this point in the history
This reverts commit 7cf5fed.
  • Loading branch information
jschenke488 committed Oct 24, 2024
1 parent 7cf5fed commit 266c9e5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion field/arena_notifiers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/FRCTeam1987/crimson-arena/bracket"
"github.com/FRCTeam1987/crimson-arena/game"
"github.com/FRCTeam1987/crimson-arena/model"
"github.com/FRCTeam1987/crimson-arena/network"
"github.com/FRCTeam1987/crimson-arena/websocket"
"strconv"
)
Expand Down Expand Up @@ -75,6 +76,11 @@ func (arena *Arena) generateAllianceStationDisplayModeMessage() interface{} {

func (arena *Arena) generateArenaStatusMessage() interface{} {
// Convert AP team wifi network status array to a map by station for ease of client use.
teamWifiStatuses := make(map[string]*network.TeamWifiStatus)
for i, station := range []string{"R1", "R2", "R3", "B1", "B2", "B3"} {
teamWifiStatuses[station] = arena.accessPoint.TeamWifiStatuses[i]
}

startMatchErr := arena.checkCanStartMatch()
startMatchErrString := ""
if startMatchErr != nil {
Expand All @@ -83,6 +89,7 @@ func (arena *Arena) generateArenaStatusMessage() interface{} {
return &struct {
MatchId int
AllianceStations map[string]*AllianceStation
TeamWifiStatuses map[string]*network.TeamWifiStatus
MatchState
CanStartMatch bool
CanStartMatchReason string
Expand All @@ -92,7 +99,7 @@ func (arena *Arena) generateArenaStatusMessage() interface{} {
ScoringSccConnected bool
RedSccConnected bool
BlueSccConnected bool
}{arena.CurrentMatch.Id, arena.AllianceStations, arena.MatchState,
}{arena.CurrentMatch.Id, arena.AllianceStations, teamWifiStatuses, arena.MatchState,
startMatchErr == nil, startMatchErrString,
arena.Plc.IsHealthy, arena.Plc.GetFieldEstop(),
arena.Plc.GetArmorBlockStatuses(),
Expand Down

0 comments on commit 266c9e5

Please sign in to comment.