mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
feat: add isFinished method to GameSession and update commandController to handle session completion
This commit is contained in:
1 parent
cfbc386c16
commit
52e9a13645
2 files changed
+7
-2
No files matched your search
@@ -60,10 +60,11 @@ export const newCommand = asyncHandler(async (req: Request, res: Response) => {
|
||||
await c.save()
|
||||
|
||||
session.completedEvents = gameSession.completedEvents
|
||||
await session.save()
|
||||
|
||||
if ((session.status as string) === 'finished') {
|
||||
if (gameSession.isFinished()) {
|
||||
await finishSession(session)
|
||||
} else {
|
||||
await session.save()
|
||||
}
|
||||
pushToSession(session.id, 'update', {
|
||||
responses: gameSession.getResponses(),
|
||||
|
||||
Reference in new issue
Block a user