summaryrefslogtreecommitdiffstats
path: root/ozone-cli/src/main.rs
blob: 332b6e72badca5ca074abce786ef8abd11937e1b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use std::env::consts::{ARCH, OS};
use std::error::Error;
use std::path::PathBuf;
use log::{error, info};
use sysinfo::System;
use o3launcher::launcher::{Launcher, Settings};

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
    simple_logger::SimpleLogger::new().env().init().unwrap();
    
    info!("Hello, world!");
    info!("stuff: {:?} {:?} {:?} {:?} {:?}", System::name(), System::os_version(), System::long_os_version(), System::kernel_version(), System::cpu_arch());
    info!("stuff: {:?} {:?} {:?} {}", System::distribution_id(), OS, ARCH, size_of::<*const i32>());

    let settings = Settings::load("./work/ozone.json").await?;
    settings.save().await?;

    let launcher = Launcher::new("./work", true).await?;

    let profile = settings.get_profile("default").unwrap();

    let launch = launcher.prepare_launch(profile, settings.get_instance_for(profile)).await.map_err(|e| {
        error!("error launching: {e}");
        e
    })?;
    
    dbg!(&launch);
    info!("ok");
    
    o3launcher::launcher::run_the_game(&launch)?;
    
    Ok(())
}