aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/modules
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-11-22 20:42:34 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2022-11-22 20:42:34 +0100
commit1eb81092d7a3e7925ae8e4258aa35a009f911b6e (patch)
tree48846d3ecd8741e9d7e9748a8557d89068f32c11 /planetwars-server/src/modules
parentb75c0e15dcd93794f7822ff5dfbfda0fe74f7c2a (diff)
downloadplanetwars.dev-1eb81092d7a3e7925ae8e4258aa35a009f911b6e.tar.xz
planetwars.dev-1eb81092d7a3e7925ae8e4258aa35a009f911b6e.zip
add is_ranked attribute to matches
Diffstat (limited to 'planetwars-server/src/modules')
-rw-r--r--planetwars-server/src/modules/ranking.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/planetwars-server/src/modules/ranking.rs b/planetwars-server/src/modules/ranking.rs
index aa4060c..b0ebad8 100644
--- a/planetwars-server/src/modules/ranking.rs
+++ b/planetwars-server/src/modules/ranking.rs
@@ -38,7 +38,7 @@ pub async fn run_ranker(config: Arc<GlobalConfig>, db_pool: DbPool) {
.cloned()
.collect();
- let maps = db::maps::list_maps(&mut db_conn).expect("could not load map");
+ let maps = db::maps::get_ranked_maps(&mut db_conn).expect("could not load map");
let map = match maps.choose(&mut rand::thread_rng()).cloned() {
None => continue, // no maps available
Some(map) => map,
@@ -93,7 +93,7 @@ struct MatchStats {
}
fn fetch_match_stats(db_conn: &mut PgConnection) -> QueryResult<HashMap<(i32, i32), MatchStats>> {
- let matches = db::matches::list_matches(RANKER_NUM_MATCHES, db_conn)?;
+ let matches = db::matches::fetch_ranked_maps(RANKER_NUM_MATCHES, db_conn)?;
let mut match_stats = HashMap::<(i32, i32), MatchStats>::new();
for m in matches {