summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-07-25 00:46:24 +0200
committerTor Andersson <tor@ccxvii.net>2024-07-25 00:46:36 +0200
commit8fd3afb00368d72cb1b6d79d15f6bb2ed115190f (patch)
tree2c5cfd92770674f5c21e14dda795bf1e1ec5ec55
parent5cd0be37c9e7d420a99763409b144b6413f485ca (diff)
downloadserver-8fd3afb00368d72cb1b6d79d15f6bb2ed115190f.tar.gz
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).
-rw-r--r--server.js16
1 files changed, 12 insertions, 4 deletions
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(`