* feat: added adding new instances of a cluster with 'start from scratch' option enabling user to create a vanilla/modded cluster; fixed couple pre-existing bugs that wouldn't let other loaders boot up * feat: fully implemented cluster creation modal design * chore: refactoring * feat: expanded the tags section on customization step; found that fabric doesnt work with 1.8.9 * feat: added gallery covers handling for new cluster instances * feat: added 'redirecting' from fabric to orinthe on versions pre-1.14 * feat: added java-version-override * feat: added loader types migrations (right now they dont migrate mods because there are no bundles) * chore: wider loader dropdown for multiloader cluster (if it will be used in the future) * chore: fixed more issues with isolated and shared dir, with migrations and instances naming * chore: refactor; taken the loader version dropdown from version picker view back to loader selector * chore: deleted Quilt from UI --------- Co-authored-by: LynithDev <61880709+LynithDev@users.noreply.github.com>
52 lines
1.6 KiB
Rust
52 lines
1.6 KiB
Rust
#![recursion_limit = "256"]
|
|
use oneclient_common::domain::GameLoader;
|
|
use oneclient_core::LauncherResult;
|
|
use oneclient_core::clusters::CreateClusterOptions;
|
|
use oneclient_core::dev;
|
|
|
|
#[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("26.1");
|
|
let loader = args
|
|
.get(1)
|
|
.and_then(|s| s.parse().ok())
|
|
.unwrap_or(GameLoader::Vanilla);
|
|
let loader_version = args.get(2).map(String::as_str);
|
|
|
|
let global = state.settings.read().global_game_settings.clone();
|
|
|
|
let cluster = state
|
|
.clusters
|
|
.create(
|
|
&global,
|
|
CreateClusterOptions {
|
|
name: format!("download-{mc_version}"),
|
|
mc_version: mc_version.to_string(),
|
|
mc_loader: loader,
|
|
mc_loader_version: loader_version.map(str::to_string),
|
|
mem_max: None,
|
|
kind: oneclient_cluster::ClusterKind::OneClient,
|
|
user_created: false,
|
|
description: None,
|
|
tags: Vec::new(),
|
|
},
|
|
)
|
|
.await?;
|
|
|
|
println!(
|
|
"Preparing cluster {} ({} {:?})...",
|
|
cluster.name, cluster.mc_version, cluster.mc_loader
|
|
);
|
|
|
|
let ready = oneclient_core::clusters::prepare_cluster_locked(
|
|
&state, cluster.id, false, true, true, None,
|
|
)
|
|
.await?;
|
|
println!("Cluster ready at {}", ready.dir()?.display());
|
|
|
|
Ok(())
|
|
}
|