mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 13:46:44 -04:00
Remove warmup and pause periods for 2019 scrimmage.
This commit is contained in:
@@ -434,18 +434,28 @@ func (arena *Arena) Update() {
|
||||
auto = true
|
||||
enabled = false
|
||||
case StartMatch:
|
||||
arena.MatchState = WarmupPeriod
|
||||
arena.MatchStartTime = time.Now()
|
||||
arena.LastMatchTimeSec = -1
|
||||
auto = true
|
||||
enabled = false
|
||||
arena.AudienceDisplayMode = "match"
|
||||
arena.AudienceDisplayModeNotifier.Notify()
|
||||
arena.AllianceStationDisplayMode = "match"
|
||||
arena.AllianceStationDisplayModeNotifier.Notify()
|
||||
arena.sendGameSpecificDataPacket()
|
||||
if !arena.MuteMatchSounds {
|
||||
arena.PlaySoundNotifier.NotifyWithMessage("match-warmup")
|
||||
//arena.sendGameSpecificDataPacket()
|
||||
if (game.MatchTiming.WarmupDurationSec > 0) {
|
||||
arena.MatchState = WarmupPeriod
|
||||
enabled = false
|
||||
sendDsPacket = false
|
||||
if !arena.MuteMatchSounds {
|
||||
arena.PlaySoundNotifier.NotifyWithMessage("match-warmup")
|
||||
}
|
||||
} else {
|
||||
arena.MatchState = AutoPeriod
|
||||
enabled = true
|
||||
sendDsPacket = true
|
||||
if !arena.MuteMatchSounds {
|
||||
arena.PlaySoundNotifier.NotifyWithMessage("match-start")
|
||||
}
|
||||
}
|
||||
// Pick an LED warmup mode at random to keep things interesting.
|
||||
allWarmupModes := []led.Mode{led.WarmupMode, led.Warmup2Mode, led.Warmup3Mode, led.Warmup4Mode}
|
||||
@@ -466,12 +476,20 @@ func (arena *Arena) Update() {
|
||||
auto = true
|
||||
enabled = true
|
||||
if matchTimeSec >= float64(game.MatchTiming.WarmupDurationSec+game.MatchTiming.AutoDurationSec) {
|
||||
arena.MatchState = PausePeriod
|
||||
auto = false
|
||||
enabled = false
|
||||
sendDsPacket = true
|
||||
if !arena.MuteMatchSounds {
|
||||
arena.PlaySoundNotifier.NotifyWithMessage("match-end")
|
||||
if game.MatchTiming.PauseDurationSec > 0 {
|
||||
arena.MatchState = PausePeriod
|
||||
enabled = false
|
||||
if !arena.MuteMatchSounds {
|
||||
arena.PlaySoundNotifier.NotifyWithMessage("match-end")
|
||||
}
|
||||
} else {
|
||||
arena.MatchState = TeleopPeriod
|
||||
enabled = true
|
||||
if !arena.MuteMatchSounds {
|
||||
arena.PlaySoundNotifier.NotifyWithMessage("match-resume")
|
||||
}
|
||||
}
|
||||
}
|
||||
case PausePeriod:
|
||||
|
||||
@@ -14,7 +14,7 @@ var MatchTiming = struct {
|
||||
TeleopDurationSec int
|
||||
EndgameTimeLeftSec int
|
||||
TimeoutDurationSec int
|
||||
}{3, 15, 2, 135, 30, 0}
|
||||
}{0, 15, 0, 135, 20, 0}
|
||||
|
||||
func GetAutoEndTime(matchStartTime time.Time) time.Time {
|
||||
return matchStartTime.Add(time.Duration(MatchTiming.WarmupDurationSec+MatchTiming.AutoDurationSec) * time.Second)
|
||||
|
||||
Reference in New Issue
Block a user