Compare commits
No commits in common. "8a9ae9f7358e82d77523165df4047c2ee1ba9cb9" and "e403d93dc28a9fc541195996522e024a5270fda5" have entirely different histories.
8a9ae9f735
...
e403d93dc2
2 changed files with 6 additions and 8 deletions
|
|
@ -119,7 +119,6 @@
|
|||
|
||||
packages = {
|
||||
default = my-crate;
|
||||
deps = cargoArtifacts;
|
||||
} // lib.optionalAttrs (!pkgs.stdenv.isDarwin) {
|
||||
my-crate-llvm-coverage = craneLibLLvmTools.cargoLlvmCov (commonArgs // {
|
||||
inherit cargoArtifacts;
|
||||
|
|
|
|||
13
src/main.rs
13
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<T: MinecraftServerHandle>(
|
|||
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<T: MinecraftServerHandle>(
|
|||
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<T: MinecraftServerHandle>(
|
|||
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<T: MinecraftServerHandle>(
|
|||
}
|
||||
}
|
||||
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(())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue