diff --git a/internal/app/controller/engine.go b/internal/app/controller/engine.go index 6333e8db..731ce804 100644 --- a/internal/app/controller/engine.go +++ b/internal/app/controller/engine.go @@ -295,6 +295,8 @@ func (e *Engine) processStage(s *EventStage) error { e.updateStage(e.State.Stage.Next()) } else if s.StageOperation == StagePrevious { e.updateStage(e.State.Stage.Previous()) + } else if s.StageOperation == StageEndGame { + e.updateStage(StagePostGame) } else { return errors.Errorf("Unknown stage operation: %v", s.StageOperation) } diff --git a/internal/app/controller/events.go b/internal/app/controller/events.go index 6e5ed727..00efef88 100644 --- a/internal/app/controller/events.go +++ b/internal/app/controller/events.go @@ -35,6 +35,8 @@ const ( StageNext StageOperation = "next" // StagePrevious previous stage StagePrevious StageOperation = "previous" + // StageEndGame ends the game + StageEndGame StageOperation = "endGame" ) // TriggerType is something that can be triggered diff --git a/src/components/control/ControlMatch.vue b/src/components/control/ControlMatch.vue index aeb0d7fb..fe7b0e20 100644 --- a/src/components/control/ControlMatch.vue +++ b/src/components/control/ControlMatch.vue @@ -29,6 +29,11 @@ :disabled="forbidMatchControls || noNextStage"> Next Stage + + End of Game + @@ -66,6 +71,11 @@ 'stage': {'stageOperation': 'next'} }) }, + endGame: function () { + this.$socket.sendObj({ + 'stage': {'stageOperation': 'endGame'} + }) + }, }, computed: { state() {