Skip to content

Commit

Permalink
Fix #1738 Auto-pairing joined a corr seek
Browse files Browse the repository at this point in the history
  • Loading branch information
gbtami committed Dec 26, 2024
1 parent 821c19f commit 01dc9a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion server/auto_pair.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ def find_matching_seek(app_state, user, variant_tc):
for seek_candidate in (
seek
for seek in app_state.seeks.values()
if seek.variant == variant
if seek.day == 0
and seek.variant == variant
and seek.chess960 == chess960
and seek.rated
and seek.base == base
Expand Down
4 changes: 2 additions & 2 deletions server/wsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ async def handle_create_seek(app_state, ws, user, data):
log.debug("Created seek: %s", seek)

matching_user = None
# auto pairing games are always rated, so anon seek will never match!
if not user.anon:
# auto pairing games are never corr and always rated, so anon seek will never match!
if seek.day == 0 and not user.anon:
variant_tc = (seek.variant, seek.chess960, seek.base, seek.inc, seek.byoyomi_period)
if variant_tc in app_state.auto_pairings:
matching_user = find_matching_user_for_seek(app_state, seek, variant_tc)
Expand Down

0 comments on commit 01dc9a1

Please sign in to comment.