diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-03-10 23:35:42 +0100 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-03-10 23:35:42 +0100 |
commit | 523de3ba0692734237b5ed6fa6dce8fbad9d69c8 (patch) | |
tree | 1886c3bfcaba756f3bcc1ca5f4fec7a8b98dbc87 /planetwars-server/src/routes/matches.rs | |
parent | 95b733ba4d7e3041adf4fb42c66e2b83ccce1df9 (diff) | |
download | planetwars.dev-523de3ba0692734237b5ed6fa6dce8fbad9d69c8.tar.xz planetwars.dev-523de3ba0692734237b5ed6fa6dce8fbad9d69c8.zip |
save match players in database
Diffstat (limited to 'planetwars-server/src/routes/matches.rs')
-rw-r--r-- | planetwars-server/src/routes/matches.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/planetwars-server/src/routes/matches.rs b/planetwars-server/src/routes/matches.rs index f2599cd..a6d8ff2 100644 --- a/planetwars-server/src/routes/matches.rs +++ b/planetwars-server/src/routes/matches.rs @@ -62,7 +62,9 @@ pub async fn play_match( }), }); - bot_ids.push(matches::MatchPlayerData { bot_id: bot.id }); + bot_ids.push(matches::MatchPlayerData { + code_bundle_id: code_bundle.id, + }); } let match_config = MatchConfig { @@ -107,7 +109,9 @@ pub struct ApiMatch { #[derive(Serialize, Deserialize)] pub struct ApiMatchPlayer { - bot_id: i32, + // TODO! +// bot_id: i32, +// code_bundle_id: i32 } pub async fn list_matches(conn: DatabaseConnection) -> Result<Json<Vec<ApiMatch>>, StatusCode> { @@ -124,7 +128,7 @@ pub fn match_data_to_api(data: matches::MatchData) -> ApiMatch { players: data .match_players .iter() - .map(|p| ApiMatchPlayer { bot_id: p.bot_id }) + .map(|_p| ApiMatchPlayer {}) .collect(), } } |