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:
15
src/main.rs
15
src/main.rs
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user