Skip to content

Commit b57aebc

Browse files
committed
Add a configurable match type to UI and referee message
1 parent 08ca069 commit b57aebc

File tree

12 files changed

+584
-268
lines changed

12 files changed

+584
-268
lines changed

internal/app/publish/messagegenerator.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ func (g *MessageGenerator) StateToRefereeMessage(matchState *state.State) (r *st
115115
*r.BlueTeamOnPositiveHalf = *matchState.TeamInfo(state.Team_BLUE).OnPositiveHalf
116116
r.NextCommand = mapCommand(matchState.NextCommand)
117117
*r.CurrentActionTimeRemaining = microseconds(matchState.CurrentActionTimeRemaining)
118+
r.MatchType = matchState.MatchType
118119

119120
updateTeam(r.Yellow, matchState.TeamInfo(state.Team_YELLOW))
120121
updateTeam(r.Blue, matchState.TeamInfo(state.Team_BLUE))

internal/app/state/ssl_gc_referee_message.pb.go

Lines changed: 255 additions & 163 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/app/state/ssl_gc_state.pb.go

Lines changed: 29 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/app/state/state.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ func NewState() (s *State) {
2020
s.Division = new(Division)
2121
s.AutoContinue = new(bool)
2222
s.FirstKickoffTeam = new(Team)
23+
s.MatchType = new(MatchType)
2324

25+
*s.MatchType = MatchType_UNKNOWN_MATCH
2426
*s.Stage = Referee_NORMAL_FIRST_HALF_PRE
2527

2628
s.TeamState = map[string]*TeamInfo{}

internal/app/statemachine/change_config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,9 @@ func (s *StateMachine) processChangeUpdateConfig(newState *state.State, change *
2424
log.Printf("Change auto continue to %v", *change.AutoContinue)
2525
newState.AutoContinue = change.AutoContinue
2626
}
27+
if change.MatchType != nil {
28+
log.Printf("Change match type to %s", change.MatchType.String())
29+
newState.MatchType = change.MatchType
30+
}
2731
return
2832
}

0 commit comments

Comments
 (0)