Update status schema to string for >=1.20.4

thx lahvuun -- https://github.com/timvisee/lazymc/issues/57#issuecomment-1858879744
This commit is contained in:
slime 2024-02-17 00:42:33 -07:00
parent 37fdb9c12a
commit c3d1618ba8
2 changed files with 3 additions and 3 deletions

View File

@ -50,7 +50,7 @@ dotenv = "0.15"
flate2 = { version = "1.0", default-features = false, features = ["default"] } flate2 = { version = "1.0", default-features = false, features = ["default"] }
futures = { version = "0.3", default-features = false, features = ["executor"] } futures = { version = "0.3", default-features = false, features = ["executor"] }
log = "0.4" log = "0.4"
minecraft-protocol = { git = "https://github.com/timvisee/rust-minecraft-protocol", rev = "edfdf87" } minecraft-protocol = { git = "https://git.cozy.software/slime/rust-minecraft-protocol", rev = "4d9c0d4305" }
named-binary-tag = "0.6" named-binary-tag = "0.6"
nix = "0.26" nix = "0.26"
notify = "4.0" notify = "4.0"

View File

@ -232,11 +232,11 @@ async fn server_status(client_info: &ClientInfo, config: &Config, server: &Serve
if config.motd.from_server && status.is_some() { if config.motd.from_server && status.is_some() {
status.as_ref().unwrap().description.clone() status.as_ref().unwrap().description.clone()
} else { } else {
Message::new(Payload::text(match server_state { match server_state {
server::State::Stopped | server::State::Started => &config.motd.sleeping, server::State::Stopped | server::State::Started => &config.motd.sleeping,
server::State::Starting => &config.motd.starting, server::State::Starting => &config.motd.starting,
server::State::Stopping => &config.motd.stopping, server::State::Stopping => &config.motd.stopping,
})) }.to_string()
} }
}; };