You've already forked AstralRinth
forked from didirus/AstralRinth
Jre api (#66)
* 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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user