diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-02-24 21:33:11 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-26 12:53:53 +0100 |
commit | 2f28467aed0a1be9e306f2987d5222cb0ad42d6c (patch) | |
tree | d235e8481f62a81a894e44b99d362224e1794ef9 /server.js | |
parent | 6a4be5ae1b89a4e79a83239f184f394efcabeeba (diff) | |
download | server-2f28467aed0a1be9e306f2987d5222cb0ad42d6c.tar.gz |
Only show public games where the owner has joined.
Diffstat (limited to 'server.js')
-rw-r--r-- | server.js | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1126,7 +1126,7 @@ const SQL_INSERT_REMATCH_PLAYERS = SQL("insert into players (game_id, user_id, r const QUERY_LIST_PUBLIC_GAMES = SQL(` SELECT * FROM game_view WHERE is_private=0 AND status = ? - AND EXISTS ( SELECT 1 FROM players WHERE players.game_id = game_view.game_id ) + AND EXISTS ( SELECT 1 FROM players WHERE players.game_id = game_view.game_id AND players.user_id = game_view.owner_id ) ORDER BY mtime DESC, ctime DESC LIMIT ? `) @@ -1134,7 +1134,7 @@ const QUERY_LIST_PUBLIC_GAMES = SQL(` const QUERY_LIST_GAMES_OF_TITLE = SQL(` SELECT * FROM game_view WHERE is_private=0 AND title_id=? AND status=? - AND EXISTS ( SELECT 1 FROM players WHERE players.game_id = game_view.game_id ) + AND EXISTS ( SELECT 1 FROM players WHERE players.game_id = game_view.game_id AND players.user_id = game_view.owner_id ) ORDER BY mtime DESC, ctime DESC LIMIT ? `) |