From e5e1c65304cd1e6b5ee9fdd9b27d10009523f1f5 Mon Sep 17 00:00:00 2001 From: Lionarius Date: Thu, 20 Apr 2023 00:06:26 +0300 Subject: [PATCH] fix incorrect ordering and increase time interval for lobby approval --- src/bot/commands/lobby.rs | 2 +- src/main.rs | 2 +- src/mixer/mixer.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bot/commands/lobby.rs b/src/bot/commands/lobby.rs index 35a5733..b2c34e5 100644 --- a/src/bot/commands/lobby.rs +++ b/src/bot/commands/lobby.rs @@ -401,7 +401,7 @@ impl LobbyCommand { let msg = interaction.get_interaction_response(ctx).await.unwrap(); let collector = msg .await_component_interactions(ctx) - .timeout(Duration::from_secs(2 * 60)) + .timeout(Duration::from_secs(10 * 60)) .guild_id(interaction.guild_id.unwrap()) .channel_id(interaction.channel_id) .author_id(interaction.user.id) diff --git a/src/main.rs b/src/main.rs index 4f53de2..b9b34bf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -31,7 +31,7 @@ impl TypeMapKey for CreatorContainer { #[shuttle_runtime::main] async fn serenity( #[shuttle_shared_db::Postgres( - local_uri = "postgres://postgres:{secrets.PASSWORD}@localhost:5432/postgres" + // local_uri = "postgres://postgres:{secrets.PASSWORD}@localhost:5432/postgres" )] pool: PgPool, #[shuttle_secrets::Secrets] secret_store: SecretStore, diff --git a/src/mixer/mixer.rs b/src/mixer/mixer.rs index d6c358d..944b2fe 100644 --- a/src/mixer/mixer.rs +++ b/src/mixer/mixer.rs @@ -41,7 +41,7 @@ fn get_combinations(entries: &[PlayerRoleEntry], count: usize) -> Vec(); let b = b.iter().map(|e| e.priority).sum::(); - a.partial_cmp(&b).unwrap_or(Ordering::Equal) + b.partial_cmp(&a).unwrap_or(Ordering::Equal) }) .collect_vec() } @@ -64,7 +64,7 @@ pub fn mix_players(players: &[Player], slots: Vec) -> Option<(Team, Team)> let mut best_team2 = None; let mut best_diff = None; - let threshold = 100.0; + let threshold = 300.0; // this is awful, but it works for tank1_combo in &tank_combos {