aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/routes/matches.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-08-27 17:41:32 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-08-27 17:41:32 +0200
commit49a5735e07e7868195590a13c247698aaa1c5358 (patch)
tree30647b9b3cb25d8548e66757785f0b64cdf73490 /planetwars-server/src/routes/matches.rs
parentc80ce332791c94b83a03c9f7c3cbb937f474cc5d (diff)
downloadplanetwars.dev-49a5735e07e7868195590a13c247698aaa1c5358.tar.xz
planetwars.dev-49a5735e07e7868195590a13c247698aaa1c5358.zip
show map info for matches
Diffstat (limited to 'planetwars-server/src/routes/matches.rs')
-rw-r--r--planetwars-server/src/routes/matches.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/planetwars-server/src/routes/matches.rs b/planetwars-server/src/routes/matches.rs
index 71c4409..10b4507 100644
--- a/planetwars-server/src/routes/matches.rs
+++ b/planetwars-server/src/routes/matches.rs
@@ -15,6 +15,8 @@ use crate::{
DatabaseConnection, GlobalConfig,
};
+use super::maps::ApiMap;
+
#[derive(Serialize, Deserialize)]
pub struct ApiMatch {
id: i32,
@@ -22,6 +24,7 @@ pub struct ApiMatch {
state: MatchState,
players: Vec<ApiMatchPlayer>,
winner: Option<i32>,
+ map: Option<ApiMap>,
}
#[derive(Serialize, Deserialize)]
@@ -102,6 +105,7 @@ pub fn match_data_to_api(data: matches::FullMatchData) -> ApiMatch {
})
.collect(),
winner: data.base.winner,
+ map: data.map.map(|m| ApiMap { name: m.name }),
}
}