Browse files

Correct seed selection to look at all players in upcoming matches not…

… just seeds
  • Loading branch information...
1 parent 928fdad commit 1307221234e02b969f704550a218edbf6ac8a43f @Janzert Janzert committed Dec 16, 2011
Showing with 6 additions and 5 deletions.
  1. +6 −5 sql/2_generate_matchup.sql
View
11 sql/2_generate_matchup.sql
@@ -45,13 +45,14 @@ if @min_players <= @max_players then
inner join user u
on u.user_id = s.user_id
left outer join (
- select seed_id, max(matchup_id) as max_matchup_id
- from matchup
+ select user_id, max(mp.matchup_id) as max_matchup_id
+ from matchup_player mp
+ inner join matchup m on mp.matchup_id = m.matchup_id
where (worker_id >= 0 or worker_id is null)
- and deleted = 0
- group by seed_id
+ and m.deleted = 0
+ group by user_id
) m
- on s.user_id = m.seed_id
+ on s.user_id = m.user_id
where s.latest = 1 and s.status = 40
-- this selects the user that has least recently played in any game
-- and used them for the next seed player

0 comments on commit 1307221

Please sign in to comment.