mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Add immediate variant for singleplayer vehicle, misc tweaks
This commit is contained in:
@@ -227,13 +227,13 @@ fn default_game_modes() -> GameModes {
|
||||
GameModes {
|
||||
battle_arena: GameMode {
|
||||
respawn_heal_duration: 10.0,
|
||||
respawn_full_heal_duration: 10.0,
|
||||
respawn_full_heal_duration: 0.5,
|
||||
kill_limit: 0,
|
||||
game_time_m: 20,
|
||||
},
|
||||
elimination: GameMode {
|
||||
respawn_heal_duration: 10.0,
|
||||
respawn_full_heal_duration: 10.0,
|
||||
respawn_full_heal_duration: 0.5,
|
||||
kill_limit: 10,
|
||||
game_time_m: 10,
|
||||
},
|
||||
@@ -245,7 +245,7 @@ fn default_game_modes() -> GameModes {
|
||||
},
|
||||
team_deathmatch: GameMode {
|
||||
respawn_heal_duration: 10.0,
|
||||
respawn_full_heal_duration: 10.0,
|
||||
respawn_full_heal_duration: 0.5,
|
||||
kill_limit: 10,
|
||||
game_time_m: 10,
|
||||
},
|
||||
@@ -321,17 +321,17 @@ pub(super) fn default_campaigns() -> super::SingleplayerConfig {
|
||||
vehicles: vec![
|
||||
super::PrefabVehicle {
|
||||
name: Some("Config your singleplayer!".to_owned()),
|
||||
username: "NGnius".to_owned(),
|
||||
username: "NGnius!".to_owned(),
|
||||
id: super::PrefabId::Database { garage: 1 }
|
||||
},
|
||||
super::PrefabVehicle {
|
||||
name: Some("Config your singleplayer!".to_owned()),
|
||||
username: "NGram".to_owned(),
|
||||
username: "NGram!".to_owned(),
|
||||
id: super::PrefabId::Database { garage: 1 }
|
||||
},
|
||||
super::PrefabVehicle {
|
||||
name: Some("Config your singleplayer!".to_owned()),
|
||||
username: "NGniusness".to_owned(),
|
||||
username: "NGniusness!".to_owned(),
|
||||
id: super::PrefabId::Database { garage: 1 }
|
||||
},
|
||||
],
|
||||
|
||||
@@ -195,5 +195,9 @@ pub enum PrefabId {
|
||||
Database {
|
||||
garage: u32,
|
||||
},
|
||||
// TODO File, Raw
|
||||
Raw {
|
||||
cube_data: Vec<u8>,
|
||||
colour_data: Vec<u8>,
|
||||
}
|
||||
// TODO File
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ impl AccountProvider {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn fake_user<C: Clone>(&self) -> Box<dyn super::User<C> + Send + Sync> {
|
||||
/*pub fn fake_user<C: Clone>(&self) -> Box<dyn super::User<C> + Send + Sync> {
|
||||
Box::new(UserData {
|
||||
token: super::UserToken { uuid: "fake user!".to_owned(), token: "".to_owned(), refresh_token: "".to_owned() },
|
||||
account: rc_database::schema::user::Model {
|
||||
@@ -56,7 +56,7 @@ impl AccountProvider {
|
||||
extensions: Default::default(),
|
||||
db: self.db.clone(),
|
||||
})
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
@@ -351,6 +351,33 @@ impl UserData {
|
||||
}
|
||||
}
|
||||
},
|
||||
crate::persist::PrefabId::Raw {
|
||||
cube_data,
|
||||
colour_data,
|
||||
} => {
|
||||
let weapons_guess = weapon_order.guess_weapons(&mut std::io::Cursor::new(&cube_data));
|
||||
let weapons_guess = vec![weapons_guess[0], 0, 0];
|
||||
let weapon_ranks = weapons_guess.iter().map(|&x| (x, if x == 0 { 0 } else { 1 })).collect();
|
||||
crate::data::player_data::PlayerData {
|
||||
name: username.clone(),
|
||||
display_name: username.clone(),
|
||||
mastery: 1,
|
||||
tier: 1, // FIXME
|
||||
robot_name: vehicle.name.clone().unwrap_or_else(|| "Raw Robot".to_owned()),
|
||||
robot_map: cube_data.to_owned(),
|
||||
team: 1,
|
||||
has_premium: false,
|
||||
robot_uuid: uuid_str,
|
||||
cpu: 420, // FIXME
|
||||
weapon_order: weapons_guess,
|
||||
colour_map: colour_data.to_owned(),
|
||||
is_ai: true,
|
||||
spawn_effect: "Spawn".to_owned(),
|
||||
death_effect: "Explosion".to_owned(),
|
||||
player_rank: 1,
|
||||
weapon_rank: weapon_ranks,
|
||||
}
|
||||
}
|
||||
};
|
||||
next_id += 1;
|
||||
enemies.push(enemy);
|
||||
|
||||
Reference in New Issue
Block a user