Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/database/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,12 @@ pub async fn get_ic_names(ic_name: &str, pool: &MySqlPool) -> Result<Vec<IcName>
pub async fn get_characters(ckey: &str, pool: &MySqlPool) -> Result<Vec<(String, i64)>, Error> {
let mut connection = pool.acquire().await?;

const EXCLUDED_ROLES: &str = "('Nightmare', 'Wizard', 'Nuclear Operative', 'Wizard (Midround)', 'Paradox Clone', 'Space Ninja', 'Fugitive', 'Syndicate Cyborg', 'Lone Operative', 'Maintenance Clown', 'Abductor', 'Operative (Midround)', 'Cyber Police', 'Syndicate Monkey Agent', 'apprentice', 'Glitch', 'Santa', 'Changeling', 'Changeling (Midround)', 'Syndicate Medical Cyborg', 'Operative Overwatch Agent', 'survivalist', 'Syndicate Assault Cyborg')";
const EXCLUDED_ROLES: &str = "('Operative', 'Wizard')";

let query = sqlx::query(concatcp!(
"SELECT name, COUNT(*) AS times FROM death WHERE byondkey = ? AND special NOT IN ",
"SELECT character_name, COUNT(*) AS times FROM manifest WHERE ckey = ? AND special NOT IN ",
EXCLUDED_ROLES,
" GROUP BY name ORDER BY times DESC"
" GROUP BY character_name ORDER BY times DESC"
))
.bind(ckey.to_lowercase());

Expand All @@ -313,7 +313,7 @@ pub async fn get_characters(ckey: &str, pool: &MySqlPool) -> Result<Vec<(String,
while let Some(row) = rows.next().await {
let row = row?;

characters.push((row.try_get("name")?, row.try_get("times")?));
characters.push((row.try_get("character_name")?, row.try_get("times")?));
}
}

Expand Down
Loading