projects
/
valheim_web.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8399303
)
Display the number of player instead of the names
author
Greg Burri
<greg.burri@gmail.com>
Tue, 23 Mar 2021 13:00:25 +0000
(14:00 +0100)
committer
Greg Burri
<greg.burri@gmail.com>
Tue, 23 Mar 2021 13:00:25 +0000
(14:00 +0100)
(because of a bug)
backend/src/valheim_controller.rs
patch
|
blob
|
history
diff --git
a/backend/src/valheim_controller.rs
b/backend/src/valheim_controller.rs
index
6fa6c7f
..
33c532f
100644
(file)
--- a/
backend/src/valheim_controller.rs
+++ b/
backend/src/valheim_controller.rs
@@
-38,11
+38,13
@@
impl ValheimExe {
}
\r
\r
pub fn format_active_players(&self) -> String {
\r
}
\r
\r
pub fn format_active_players(&self) -> String {
\r
+ /* Commented because the player list isn't correct (the number is).
\r
if self.active_players.len() == 0 {
\r
String::from("<none>")
\r
} else {
\r
self.active_players.join(", ")
\r
if self.active_players.len() == 0 {
\r
String::from("<none>")
\r
} else {
\r
self.active_players.join(", ")
\r
- }
\r
+ }*/
\r
+ self.active_players.len().to_string()
\r
}
\r
\r
pub fn format_last_backup(&self) -> String {
\r
}
\r
\r
pub fn format_last_backup(&self) -> String {
\r
@@
-75,9
+77,14
@@
fn format_byte_size(bytes: u64, precision: usize) -> String {
}
\r
\r
const VALHEIM_PROCESS_NAME: &str = "valheim_server";
\r
}
\r
\r
const VALHEIM_PROCESS_NAME: &str = "valheim_server";
\r
+
\r
+#[cfg(target_os = "linux")]
\r
const STRING_BEFORE_CHARACTER_NAME: &str = "Got character ZDOID from";
\r
const STRING_BEFORE_CHARACTER_NAME: &str = "Got character ZDOID from";
\r
+
\r
+#[cfg(target_os = "linux")]
\r
const STRING_BEFORE_NB_OF_CONNECTIONS: &str = "Connections";
\r
\r
const STRING_BEFORE_NB_OF_CONNECTIONS: &str = "Connections";
\r
\r
+// It doesn't work for the moment, it only scan the connection event and do not treat disconnections.
\r
#[cfg(target_os = "linux")]
\r
fn get_active_players() -> Vec<String> {
\r
let mut journal =
\r
#[cfg(target_os = "linux")]
\r
fn get_active_players() -> Vec<String> {
\r
let mut journal =
\r