feat: add admin award winner command (#23)

Co-authored-by: Joshua Higgins <joshuafhiggins@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit was merged in pull request #23.
This commit is contained in:
2026-03-06 00:49:50 -05:00
committed by GitHub
Unverified
parent c754b2ec72
commit 8538068442
2 changed files with 137 additions and 0 deletions

View File

@@ -168,6 +168,21 @@ async fn handle_connection(
let _ = send(&tx, "ERROR:INVALID:TERMINATE");
}
}
} else if parts.get(1) == Some(&"AWARD") && parts.len() > 3 {
match parts[2].parse::<u32>() {
Ok(match_id) => {
let winner = parts[3].to_string();
if let Err(e) =
sd.handle_game_award_winner(addr, match_id, winner).await
{
error!("handle_game_award_winner: {}", e);
let _ = send(&tx, e.to_string().as_str());
}
}
Err(_) => {
let _ = send(&tx, "ERROR:INVALID:AWARD");
}
}
} else {
let _ = send(&tx, "ERROR:INVALID:GAME");
}