Skip to content

Commit 86cef0a

Browse files
committed
Always pass non-majority origins (GC) through
Some game events (like BallPlacementFailed) have no behavior by intention and must always be accepted.
1 parent f272195 commit 86cef0a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

internal/app/engine/engine.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,13 @@ func (e *Engine) handleGameEventBehavior(change *statemachine.Change) *statemach
165165
gameEvent := change.GetAddGameEventChange().GameEvent
166166
behavior := e.config.GameEventBehavior[gameEvent.Type.String()]
167167

168+
if isNonMajorityOrigin(gameEvent.Origin) {
169+
// events from GC must always be passed through
170+
return change
171+
}
172+
168173
switch behavior {
169174
case Config_BEHAVIOR_ACCEPT, Config_BEHAVIOR_ACCEPT_MAJORITY, Config_BEHAVIOR_PROPOSE_ONLY:
170-
if isNonMajorityOrigin(gameEvent.Origin) {
171-
return change
172-
}
173175
log.Println("Convert game event to proposal: ", gameEvent.String())
174176
timestamp := timestamppb.New(e.timeProvider())
175177
return &statemachine.Change{

0 commit comments

Comments
 (0)