From 2f28467aed0a1be9e306f2987d5222cb0ad42d6c Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 24 Feb 2023 21:33:11 +0100 Subject: Only show public games where the owner has joined. --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server.js') diff --git a/server.js b/server.js index 9942cd7..aa42bb0 100644 --- a/server.js +++ b/server.js @@ -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 ? `) -- cgit v1.2.3