diff --git a/Cargo.lock b/Cargo.lock index 2e207bd8b0..a1c93e5cbb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2765,7 +2765,7 @@ name = "veloren-server" version = "0.2.0" dependencies = [ "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "scan_fmt 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/server/src/lib.rs b/server/src/lib.rs index 9cb99c23ea..f9da79dbc1 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -17,7 +17,7 @@ use common::{ comp, msg::{ClientMsg, ClientState, RequestStateError, ServerError, ServerInfo, ServerMsg}, net::PostOffice, - state::{State, TerrainChange, Uid}, + state::{State, TerrainChange, TimeOfDay, Uid}, terrain::{block::Block, TerrainChunk, TerrainChunkSize, TerrainMap}, vol::VolSize, vol::Vox, @@ -86,6 +86,9 @@ impl Server { .ecs_mut() .add_resource(SpawnPoint(Vec3::new(16_384.0, 16_384.0, 380.0))); + // Set starting time for the server. + state.ecs_mut().write_resource::().0 = settings.start_time; + let this = Self { state, world: Arc::new(World::generate(settings.world_seed)), diff --git a/server/src/settings.rs b/server/src/settings.rs index ef168b3266..4187648bd2 100644 --- a/server/src/settings.rs +++ b/server/src/settings.rs @@ -11,6 +11,7 @@ pub struct ServerSettings { pub server_name: String, pub server_description: String, //pub login_server: whatever + pub start_time: f64, } impl Default for ServerSettings { @@ -21,6 +22,7 @@ impl Default for ServerSettings { server_name: "Server name".to_owned(), server_description: "This is the best Veloren server.".to_owned(), max_players: 16, + start_time: 0.0, } } }