aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/game/hub.go
diff options
context:
space:
mode:
Diffstat (limited to 'backend/game/hub.go')
-rw-r--r--backend/game/hub.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/backend/game/hub.go b/backend/game/hub.go
index 770d257..f857ec5 100644
--- a/backend/game/hub.go
+++ b/backend/game/hub.go
@@ -205,8 +205,8 @@ func (hub *gameHub) run() {
log.Fatalf("failed to set game state: %v", err)
}
hub.game.state = gameStateFinished
+ hub.close()
}
- hub.close()
return
}
}
@@ -255,6 +255,10 @@ func (hubs *GameHubs) Close() {
}
}
+func (hubs *GameHubs) getHub(gameID int) *gameHub {
+ return hubs.hubs[gameID]
+}
+
func (hubs *GameHubs) RestoreFromDB(ctx context.Context) error {
games, err := hubs.q.ListGames(ctx)
if err != nil {