File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -81,9 +81,9 @@ func (e *Engine) Enqueue(change *statemachine.Change) {
8181 e .queue <- change
8282}
8383
84- func isUiOrigin (origins []string ) bool {
84+ func isNonMajorityOrigin (origins []string ) bool {
8585 for _ , origin := range origins {
86- if origin == "UI" {
86+ if origin == "UI" || origin == "Engine" || origin == "StateMachine" {
8787 return true
8888 }
8989 }
@@ -93,7 +93,7 @@ func isUiOrigin(origins []string) bool {
9393func (e * Engine ) filterGameEvent (change * statemachine.Change ) * statemachine.Change {
9494 gameEvent := change .GetAddGameEvent ().GameEvent
9595 behavior := e .config .GameEventBehavior [gameEvent .Type .String ()]
96- if isUiOrigin (gameEvent .Origin ) {
96+ if isNonMajorityOrigin (gameEvent .Origin ) {
9797 behavior = Config_BEHAVIOR_ACCEPT
9898 }
9999 switch behavior {
@@ -392,7 +392,8 @@ func (e *Engine) UpdateConfig(delta *Config) {
392392 }
393393}
394394
395- // IsGameEventEnabled returns true, if the game event type is always accepted
395+ // IsGameEventEnabled returns true, if the game event type is accept
396396func (e * Engine ) IsGameEventEnabled (evenType state.GameEvent_Type ) bool {
397- return e .config .GameEventBehavior [evenType .String ()] == Config_BEHAVIOR_ACCEPT
397+ return e .config .GameEventBehavior [evenType .String ()] == Config_BEHAVIOR_ACCEPT ||
398+ e .config .GameEventBehavior [evenType .String ()] == Config_BEHAVIOR_ACCEPT_MAJORITY
398399}
You can’t perform that action at this time.
0 commit comments