From 8fd3afb00368d72cb1b6d79d15f6bb2ed115190f Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 25 Jul 2024 00:46:24 +0200 Subject: Increase blacklist power. Hide public games if any of the players who have already joined have you on their blacklist (up from game creator only). --- server.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'server.js') diff --git a/server.js b/server.js index 52507e4..3ec7454 100644 --- a/server.js +++ b/server.js @@ -1411,14 +1411,22 @@ const SQL_INSERT_REMATCH = SQL(` const QUERY_LIST_PUBLIC_GAMES_OPEN = SQL(` select * from game_view_public where status = 0 and join_count < player_count - and not exists ( select 1 from contacts where me = owner_id and you = ? and relation < 0 ) - order by mtime desc, ctime desc + and not exists ( + select 1 from players + join contacts on contacts.me=players.user_id + where players.game_id=game_view_public.game_id and you=? and relation < 0 + ) + order by game_id desc `) const QUERY_LIST_PUBLIC_GAMES_REPLACEMENT = SQL(` select * from game_view_public where status = 1 and join_count < player_count - and not exists ( select 1 from contacts where me = owner_id and you = ? and relation < 0 ) - order by mtime desc, ctime desc + and not exists ( + select 1 from players + join contacts on contacts.me=players.user_id + where players.game_id=game_view_public.game_id and you=? and relation < 0 + ) + order by game_id desc `) const QUERY_LIST_PUBLIC_GAMES_ACTIVE = SQL(` -- cgit v1.2.3