X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=backend%2Fsrc%2Fvalheim_controller.rs;h=3c2bab6e35d6a34a08629e33fa49b067fa5957bb;hb=f5ee5c4f340df1843e82b54e8a8835981aef6aa0;hp=414cee12486c2b46bd8cdfb55e85275032d35501;hpb=bfe8979bb9ba5017db32a5bd4f876cd318670c46;p=valheim_web.git diff --git a/backend/src/valheim_controller.rs b/backend/src/valheim_controller.rs index 414cee1..3c2bab6 100644 --- a/backend/src/valheim_controller.rs +++ b/backend/src/valheim_controller.rs @@ -1,4 +1,6 @@ use sysinfo::{ ProcessExt, SystemExt }; + +#[cfg(target_os = "unix")] use systemd::journal; #[derive(Clone, Debug)] @@ -55,6 +57,7 @@ fn format_byte_size(bytes: u64, precision: usize) -> String { const VALHEIM_PROCESS_NAME: &str = "valheim_server"; +#[cfg(target_os = "unix")] fn get_number_of_players() -> u32 { let mut journal = journal::OpenOptions::default().current_user(true).open().unwrap(); @@ -82,6 +85,11 @@ fn get_number_of_players() -> u32 { } } +#[cfg(target_os = "windows")] +fn get_number_of_players() -> u32 { + 0 +} + pub fn get_valheim_executable_information(world_path : &str) -> Option { let mut system = sysinfo::System::new_all(); system.refresh_system();