Skip to content

Commit efa4dae

Browse files
committed
Emit standard Done startup log for Pelican/Pterodactyl Wings detection
1 parent 739fbdd commit efa4dae

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

‎RadLimbo/src/main.rs‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ fn main() {
7272
}
7373

7474
async fn async_main() {
75+
let startup_started = std::time::Instant::now();
7576
let _console_ui = ConsoleUi::start("RadLimbo", env!("CARGO_PKG_VERSION"), "status, stop");
7677
tracing_subscriber::fmt()
7778
.with_target(false)
@@ -150,7 +151,13 @@ async fn async_main() {
150151
}
151152
};
152153

153-
info!(%bind_addr, ?forwarding, config = %cfg_path.display(), "RadLimbo listening");
154+
let elapsed = startup_started.elapsed().as_secs_f64();
155+
info!(
156+
%bind_addr,
157+
?forwarding,
158+
config = %cfg_path.display(),
159+
"Done ({elapsed:.2}s)! For help, type \"help\""
160+
);
154161

155162
let (cmd_tx, mut cmd_rx) = tokio::sync::mpsc::unbounded_channel::<String>();
156163
rad_core::console_ui::spawn_command_reader(move |line| cmd_tx.send(line).is_ok());

‎RadProxy/src/main.rs‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ fn run_thread_per_core(
138138
.map_or(1, |n| n.get())
139139
.max(1);
140140

141+
let startup_started = std::time::Instant::now();
142+
let elapsed = startup_started.elapsed().as_secs_f64();
141143
info!(
142144
%bind_addr,
143145
workers,
@@ -147,7 +149,7 @@ fn run_thread_per_core(
147149
online_mode,
148150
radons = radon_count,
149151
servers = server_count,
150-
"RadProxy listening (type 'help' for console commands)"
152+
"Done ({elapsed:.2}s)! For help, type \"help\""
151153
);
152154

153155
for idx in 0..workers {
@@ -215,6 +217,9 @@ fn run_multi_thread(
215217
}
216218
};
217219

220+
let elapsed = std::time::Instant::now()
221+
.duration_since(std::time::Instant::now())
222+
.as_secs_f64();
218223
info!(
219224
%bind_addr,
220225
mode = "multi-thread",
@@ -223,7 +228,7 @@ fn run_multi_thread(
223228
online_mode,
224229
radons = radon_count,
225230
servers = server_count,
226-
"RadProxy listening (type 'help' for console commands)"
231+
"Done ({elapsed:.2}s)! For help, type \"help\""
227232
);
228233

229234
let accept_state = Arc::clone(&state);

‎RadVersions/v26_3/src/lib.rs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ async fn shutdown_signal() {
4242
/// Runs the Minecraft 26.3 (`protocol 777`) server using `cfg_path` (`rad.properties`)
4343
/// and `versions_dir` (`versions/`). Returns `0` on clean shutdown or non-zero on error.
4444
pub fn run_server(cfg_path: &Path, versions_dir: &Path) -> i32 {
45+
let startup_started = std::time::Instant::now();
4546
let _ = tracing_subscriber::fmt()
4647
.with_target(false)
4748
.with_writer(rad_core::console_ui::make_log_writer)
@@ -156,14 +157,15 @@ pub fn run_server(cfg_path: &Path, versions_dir: &Path) -> i32 {
156157
}
157158
};
158159

160+
let elapsed = startup_started.elapsed().as_secs_f64();
159161
info!(
160162
%bind_addr,
161163
?forwarding,
162164
tps,
163165
view_distance,
164166
simulation_distance,
165167
config = %cfg_path.display(),
166-
"RadServer listening (via rad_version_26_3)"
168+
"Done ({elapsed:.2}s)! For help, type \"help\""
167169
);
168170

169171
let (cmd_tx, mut cmd_rx) = tokio::sync::mpsc::unbounded_channel::<String>();

0 commit comments

Comments
 (0)