itertools = "0.10"
sysinfo = "0.16"
-systemd = "0.8"
cached = "0.23"
[dependencies.askama]
version = "0.9"
features = ["with-actix-web"]
+
+[target.'cfg(unix)'.dependencies]
+systemd = "0.8"
\ No newline at end of file
use sysinfo::{ ProcessExt, SystemExt };\r
+\r
+#[cfg(target_os = "unix")]\r
use systemd::journal;\r
\r
#[derive(Clone, Debug)]\r
\r
const VALHEIM_PROCESS_NAME: &str = "valheim_server";\r
\r
+#[cfg(target_os = "unix")]\r
fn get_number_of_players() -> u32 {\r
let mut journal =\r
journal::OpenOptions::default().current_user(true).open().unwrap();\r
}\r
}\r
\r
+#[cfg(target_os = "windows")]\r
+fn get_number_of_players() -> u32 {\r
+ 0\r
+}\r
+\r
pub fn get_valheim_executable_information(world_path : &str) -> Option<ValheimExe> {\r
let mut system = sysinfo::System::new_all();\r
system.refresh_system();\r