diff --git a/flake.nix b/flake.nix index b64872c..4b8563e 100644 --- a/flake.nix +++ b/flake.nix @@ -119,7 +119,6 @@ packages = { default = my-crate; - deps = cargoArtifacts; } // lib.optionalAttrs (!pkgs.stdenv.isDarwin) { my-crate-llvm-coverage = craneLibLLvmTools.cargoLlvmCov (commonArgs // { inherit cargoArtifacts; diff --git a/src/main.rs b/src/main.rs index 798ea01..d54c5c8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,8 +20,6 @@ mod opaque_error; mod packets; mod types; -static BYE_MESSAGE: &str = concat!("§dTami§r with §d<3§r §8(rev: ", env!("COMMIT_HASH"), ")§r"); - #[tokio::main] async fn main() { // ---- Tracing setup ---- @@ -162,6 +160,7 @@ async fn handle_status( let commit_hash: &'static str = env!("COMMIT_HASH"); let mut status_struct = StatusStructNew::create(); status_struct.version.protocol = handshake.protocol_version.get_int(); + let bye_message = format!(" - §dTami§r with §d<3§r §8(rev: {commit_hash})§r"); let server = match api .query_server( @@ -176,7 +175,7 @@ async fn handle_status( status_struct.players.max = 0; status_struct.players.online = 0; status_struct.description.text = format!( - "Could not find §kserver§r: §f§o{server_addr}§r\nMinecraft Ingress - {BYE_MESSAGE}" + "Could not find §kserver§r: §f§o{server_addr}§r\nMinecraft Ingress {bye_message}" ); mc_server::complete_status_request(client_stream, status_struct) @@ -220,12 +219,12 @@ async fn handle_status( status_struct.players.max = 1; status_struct.players.online = 1; status_struct.description.text = - format!("{motd}\n§2Starting!§r §b§oWait a bit§r§b ^^§r - {BYE_MESSAGE}"); + format!("{motd}\n§2Starting!§r §b§oWait a bit§r§b ^^§r{bye_message}"); } ServerDeploymentStatus::Offline => { status_struct.players.max = 1; status_struct.description.text = - format!("{motd}\n§4Offline§r §oJoin to start!§r - {BYE_MESSAGE}"); + format!("{motd}\n§4Offline§r §oJoin to start!§r{bye_message}"); } }; @@ -290,13 +289,13 @@ async fn handle_login( } } ServerDeploymentStatus::PodOk | ServerDeploymentStatus::Starting => { - mc_server::send_disconnect(client_stream, format!("[\"\",{{\"text\":\"The server is still starting up...\n wait a bit more please ^^\n\n\"}},{{\"text\":\"{BYE_MESSAGE}\"}}]").as_str()).await?; + mc_server::send_disconnect(client_stream, "Starting...§d<3§r").await?; } ServerDeploymentStatus::Offline => { server.start().await?; api.start_watch(server.clone(), Duration::from_secs(600)) .await?; - mc_server::send_disconnect(client_stream, format!("[\"\",{{\"text\":\"Okayy, §2starting§r the server!\n\n\"}},{{\"text\":\"{BYE_MESSAGE}\"}}]").as_str()).await?; + mc_server::send_disconnect(client_stream, "Okayy_starting_it...§d<3§r").await?; } } Ok(())