summaryrefslogtreecommitdiff
path: root/schema.sql
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2025-02-11 01:01:04 +0100
committerTor Andersson <tor@ccxvii.net>2025-02-12 12:04:43 +0100
commita764abe6565544bea8591b26839ad931f3f42e4d (patch)
treeb085b01746fb339a55e06c2423cdb90bf674581c /schema.sql
parent61e0d18ed045ed89ba9abd711fe7b1b5be2ec095 (diff)
downloadserver-a764abe6565544bea8591b26839ad931f3f42e4d.tar.gz
Use state.active to detect finished games.
Instead of looking for (state.state === "game_over"). Add is_active_role helper function.
Diffstat (limited to 'schema.sql')
-rw-r--r--schema.sql4
1 files changed, 2 insertions, 2 deletions
diff --git a/schema.sql b/schema.sql
index 8abfe06..5fd189e 100644
--- a/schema.sql
+++ b/schema.sql
@@ -137,7 +137,7 @@ create view user_dynamic_view as
status = 1
and user_count = player_count
and players.user_id = users.user_id
- and active in ( players.role, 'Both' )
+ and active in ( 'Both', players.role )
) + (
select
count(*)
@@ -875,7 +875,7 @@ begin
update players
set clock = clock - (julianday() - julianday(old.mtime))
where
- players.game_id = old.game_id and players.role in ( 'Both', old.active );
+ players.game_id = old.game_id and old.active in ( 'Both', players.role );
end;
-- Trigger to remove game data when filing a game as archived