aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/db
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-03-10 23:35:42 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2022-03-10 23:35:42 +0100
commit523de3ba0692734237b5ed6fa6dce8fbad9d69c8 (patch)
tree1886c3bfcaba756f3bcc1ca5f4fec7a8b98dbc87 /planetwars-server/src/db
parent95b733ba4d7e3041adf4fb42c66e2b83ccce1df9 (diff)
downloadplanetwars.dev-523de3ba0692734237b5ed6fa6dce8fbad9d69c8.tar.xz
planetwars.dev-523de3ba0692734237b5ed6fa6dce8fbad9d69c8.zip
save match players in database
Diffstat (limited to 'planetwars-server/src/db')
-rw-r--r--planetwars-server/src/db/matches.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/planetwars-server/src/db/matches.rs b/planetwars-server/src/db/matches.rs
index 6444bf6..d649189 100644
--- a/planetwars-server/src/db/matches.rs
+++ b/planetwars-server/src/db/matches.rs
@@ -17,10 +17,10 @@ pub struct NewMatch<'a> {
pub struct NewMatchPlayer {
/// id of the match this player is in
pub match_id: i32,
- /// id of the bot behind this player
- pub bot_id: i32,
/// player id within the match
pub player_id: i32,
+ /// id of the bot behind this player
+ pub code_bundle_id: i32,
}
#[derive(Queryable, Identifiable)]
@@ -37,12 +37,12 @@ pub struct MatchBase {
#[belongs_to(MatchBase, foreign_key = "match_id")]
pub struct MatchPlayer {
pub match_id: i32,
- pub bot_id: i32,
pub player_id: i32,
+ pub code_bundle_id: i32,
}
pub struct MatchPlayerData {
- pub bot_id: i32,
+ pub code_bundle_id: i32,
}
pub fn create_match(
@@ -60,8 +60,8 @@ pub fn create_match(
.enumerate()
.map(|(num, player_data)| NewMatchPlayer {
match_id: match_base.id,
- bot_id: player_data.bot_id,
player_id: num as i32,
+ code_bundle_id: player_data.code_bundle_id,
})
.collect::<Vec<_>>();