* basic push

* actual push

* JRE detection, and autosetting

* removed a println, retrying CI/CD

* new game version compare; preset java 7 and 8 using our jre

* 1.8 mislabeled

* working JRE changes

* fixed bugs with JRE setup

* fixed bugs with JRE setup

* manual merge

* prettier

* fixes + jre 17

* clippy, prettier

* typo

* forgot to hook up a function

* pr fix + comment fix

* added loader_version

* take 2
This commit is contained in:
Wyatt Verchere
2023-04-07 13:31:06 -07:00
committed by GitHub
parent 4b41ffbd8a
commit 34005dd2e2
21 changed files with 542 additions and 83 deletions

View File

@@ -1,5 +1,6 @@
//! Theseus state management system
use crate::config::sled_config;
use crate::jre;
use std::sync::Arc;
use tokio::sync::{Mutex, OnceCell, RwLock, Semaphore};
@@ -31,6 +32,9 @@ pub use self::auth_task::*;
mod tags;
pub use self::tags::*;
mod java_globals;
pub use self::java_globals::*;
// Global state
static LAUNCHER_STATE: OnceCell<Arc<State>> = OnceCell::const_new();
pub struct State {
@@ -74,7 +78,7 @@ impl State {
.open()?;
// Settings
let settings =
let mut settings =
Settings::init(&directories.settings_file()).await?;
// Loose initializations
@@ -101,6 +105,12 @@ impl State {
);
};
// On launcher initialization, if global java variables are unset, try to find and set them
// (they are required for the game to launch)
if settings.java_globals.count() == 0 {
settings.java_globals = jre::autodetect_java_globals()?;
}
Ok(Arc::new(Self {
database,
directories,