mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 13:46:44 -04:00
Added automatic configuration of Cisco Aironet AP.
This commit is contained in:
17
arena.go
17
arena.go
@@ -197,6 +197,8 @@ func (arena *Arena) LoadMatch(match *Match) error {
|
||||
return err
|
||||
}
|
||||
|
||||
arena.SetupNetwork()
|
||||
|
||||
// Reset the realtime scores.
|
||||
arena.redRealtimeScore = new(RealtimeScore)
|
||||
arena.blueRealtimeScore = new(RealtimeScore)
|
||||
@@ -256,10 +258,25 @@ func (arena *Arena) SubstituteTeam(teamId int, station string) error {
|
||||
case "B3":
|
||||
arena.currentMatch.Blue3 = teamId
|
||||
}
|
||||
arena.SetupNetwork()
|
||||
arena.matchLoadTeamsNotifier.Notify(nil)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Asynchronously reconfigures the networking hardware for the new set of teams.
|
||||
func (arena *Arena) SetupNetwork() {
|
||||
if eventSettings.NetworkSecurityEnabled {
|
||||
go func() {
|
||||
err := ConfigureTeamWifi(arena.AllianceStations["R1"].team, arena.AllianceStations["R2"].team,
|
||||
arena.AllianceStations["R3"].team, arena.AllianceStations["B1"].team,
|
||||
arena.AllianceStations["B2"].team, arena.AllianceStations["B3"].team)
|
||||
if err != nil {
|
||||
log.Printf("Failed to configure team WiFi: %s", err.Error())
|
||||
}
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
// Returns nil if the match can be started, and an error otherwise.
|
||||
func (arena *Arena) CheckCanStartMatch() error {
|
||||
if arena.MatchState != PRE_MATCH {
|
||||
|
||||
Reference in New Issue
Block a user