OneLauncher-Cracked/packages/oneclient_core/examples/launch_game.rs
oiupoyt 163eb0ac0c
Some checks are pending
Release Multiplatform Binaries / build (deb,appimage, linux-x86_64, ubuntu-22.04, x86_64-unknown-linux-gnu) (push) Waiting to run
Release Multiplatform Binaries / build (dmg,app, macos-arm64, macos-14, aarch64-apple-darwin) (push) Waiting to run
Release Multiplatform Binaries / build (dmg,app, macos-x86_64, macos-14, x86_64-apple-darwin) (push) Waiting to run
Release Multiplatform Binaries / build (nsis, windows-x86_64, windows-latest, x86_64-pc-windows-msvc) (push) Waiting to run
Release Multiplatform Binaries / create-release (push) Blocked by required conditions
feat: update base to official upstream 2.3.1 with all cracked features intact (2.3.1-c1)
- Rebased onto official Polyfrost OneLauncher v2.3.1 (commit 0e49c691)
- Preserved 100% offline authentication without requiring Microsoft accounts
- Integrated custom 3D offline skin changer with UUID character slot targeting
- Maintained CustomSkinLoader auto-configuration for Ely.by and SkinRestorer
- Maintained direct GitHub Releases auto-updater pointing to oiupoyt/OneLauncher-Cracked
- Maintained mods filter popover fix eliminating text ghosting/duplication
- Configured dev profile to prevent debug symbol bloat
2026-09-07 17:38:22 +05:30

40 lines
1.3 KiB
Rust

#![recursion_limit = "256"]
use oneclient_core::LauncherResult;
use oneclient_core::clusters::CreateClusterOptions;
use oneclient_core::dev;
use oneclient_common::domain::GameLoader;
#[tokio::main]
async fn main() -> LauncherResult<()> {
dev::initialize().await?;
let state = dev::ephemeral_state().await?;
let args: Vec<String> = std::env::args().skip(1).collect();
let mc_version = args.first().map(String::as_str).unwrap_or("1.21.4");
let loader = args
.get(1)
.and_then(|s| s.parse().ok())
.unwrap_or(GameLoader::Vanilla);
let account = state.auth.add_offline_account("Example".to_string()).await?;
println!("Using offline account {} ({})", account.username, account.id);
let global = state.settings.read().global_game_settings.clone();
let cluster = state.clusters.create(
&global,
CreateClusterOptions::new(format!("launch-{mc_version}"), mc_version, loader),
)
.await?;
println!("Launching {} ({mc_version} {loader:?})...", cluster.name);
let game = oneclient_core::launch_cluster(&state, cluster.id, &account, true).await?;
println!(
"Launched cluster #{} (pid {:?}). Waiting 10s before exit...",
game.cluster_id, game.pid
);
tokio::time::sleep(std::time::Duration::from_secs(10)).await;
Ok(())
}