Files
horizon-airdef/crates/horizon-client/src/main.rs
T
Ludovic Marie d7b975185c Opt-in data collection (3/5): the game obeys the player's consent
The game never sends anything itself; it keeps items in the outbox for the
launcher, and only for kinds the player allows:
- Crash reports: crash::deliver keeps a scrubbed copy (error, stack, thread,
  Horizon version, graphics adapter and render settings; never the log, world,
  server or resource packs; the world's name and folder and the server address
  are scrubbed wherever they appear). Without consent crash-reports/ stays
  local, as before.
- Performance: a Session records frame times while playing and the integrated
  server's tick times into fixed-size Timings, with the time to the title
  screen and to the world; on leaving a world or quitting, a session of a
  minute or more becomes a summary (under 1 KiB) when the player allows it.
- The GPU, its driver and backend come from the wgpu adapter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 02:51:02 +02:00

38 lines
1.4 KiB
Rust

//! Horizon: native Rust client for Minecraft Java Edition 26.3 gameplay.
#![forbid(unsafe_code)]
mod game;
use horizon_client::{crash, logging};
fn main() {
horizon_client::telemetry::mark_start();
let args: Vec<String> = std::env::args().skip(1).collect();
let game_args = args.iter().take_while(|a| *a != "--dedicated");
let help = game_args.clone().any(|a| a == "--help" || a == "-h");
// The dedicated server logs in its own folder, as vanilla's does; the game in its home.
let (home, side, thread) = if args.iter().any(|a| a == "--dedicated") {
(std::path::PathBuf::from("."), "server", "Server thread")
} else {
(logging::game_home(), "client", "Render thread")
};
if !help {
logging::init(&home, thread);
crash::install(home.clone(), side);
}
if let Err(error) = game::run() {
log::error!("Horizon: {error}");
if !help {
crash::report_error(&home, side, &*error);
}
// Started from Explorer, the console window closes with the game:
// keep the message on screen until it is read.
#[cfg(windows)]
if std::io::IsTerminal::is_terminal(&std::io::stdin()) {
eprintln!("Press Enter to close.");
let _ = std::io::stdin().read_line(&mut String::new());
}
std::process::exit(1);
}
logging::flush();
}