v1
This commit is contained in:
@@ -7,7 +7,7 @@ const logger = LoggerUtil.getLogger('ConfigManager')
|
||||
|
||||
const sysRoot = process.env.APPDATA || (process.platform == 'darwin' ? process.env.HOME + '/Library/Application Support' : process.env.HOME)
|
||||
|
||||
const dataPath = path.join(sysRoot, '.helioslauncher')
|
||||
const dataPath = path.join(sysRoot, '.patatalauncher')
|
||||
|
||||
const launcherDir = require('@electron/remote').app.getPath('userData')
|
||||
|
||||
|
||||
4
app/assets/js/custom.js
Normal file
4
app/assets/js/custom.js
Normal file
@@ -0,0 +1,4 @@
|
||||
exports.getCustomConfig = () => {
|
||||
packwizUrl: "https://patatapack.oier.ovh/pack.toml"
|
||||
packwizBootstrap: "packwiz-installer-bootstrap.jar"
|
||||
}
|
||||
@@ -4,7 +4,7 @@ const ConfigManager = require('./configmanager')
|
||||
|
||||
// Old WesterosCraft url.
|
||||
// exports.REMOTE_DISTRO_URL = 'http://mc.westeroscraft.com/WesterosCraftLauncher/distribution.json'
|
||||
exports.REMOTE_DISTRO_URL = 'https://helios-files.geekcorner.eu.org/distribution.json'
|
||||
exports.REMOTE_DISTRO_URL = 'https://distribution.oier.ovh/distribution.json'
|
||||
|
||||
const api = new DistributionAPI(
|
||||
ConfigManager.getLauncherDirectory(),
|
||||
|
||||
@@ -7,7 +7,7 @@ const { getMojangOS, isLibraryCompatible, mcVersionAtLeast } = require('helios-
|
||||
const { Type } = require('helios-distribution-types')
|
||||
const os = require('os')
|
||||
const path = require('path')
|
||||
|
||||
const Custom = require('./custom')
|
||||
const ConfigManager = require('./configmanager')
|
||||
|
||||
const logger = LoggerUtil.getLogger('ProcessBuilder')
|
||||
@@ -70,10 +70,84 @@ class ProcessBuilder {
|
||||
//args = args.concat(this.constructModArguments(modObj.fMods))
|
||||
args = args.concat(this.constructModList(modObj.fMods))
|
||||
}
|
||||
/*const preLaunchArgs = [
|
||||
"-jar",
|
||||
Custom.getCustomConfig().packwizBootstrap,
|
||||
Custom.getCustomConfig().packwizUrl
|
||||
]*/
|
||||
|
||||
logger.info('Launch Arguments:', args)
|
||||
const preLaunchArgsArray = [
|
||||
// "-version"
|
||||
"-jar",
|
||||
//path.join(this.gameDir, "packwiz-installer-bootstrap.jar"),
|
||||
"packwiz-installer-bootstrap.jar",
|
||||
"https://patatapack.oier.ovh/pack/pack.toml"
|
||||
]
|
||||
const preLaunchArgs = [
|
||||
"-jar " +
|
||||
path.join(this.gameDir, "/packwiz-installer-bootstrap.jar") +
|
||||
" https://patatapack.oier.ovh/pack.toml"
|
||||
]
|
||||
|
||||
logger.info('PreLaunch Arguments:', preLaunchArgs)
|
||||
logger.info('getJavaExecutable:', ConfigManager.getJavaExecutable(this.server.rawServer.id))
|
||||
;
|
||||
logger.info('Server RAW id:', this.server.rawServer.id)
|
||||
logger.info('gamedir:', this.gameDir)
|
||||
//const preLaunchChild = child_process.execSync(ConfigManager.getJavaExecutable(this.server.rawServer.id) +" " + preLaunchArgsArray.join(' '), preLaunchArgsArray, {
|
||||
const preLaunchChild = child_process.spawnSync(ConfigManager.getJavaExecutable(this.server.rawServer.id), preLaunchArgsArray, {
|
||||
|
||||
cwd: this.gameDir,
|
||||
// detached: ConfigManager.getLaunchDetached()
|
||||
})
|
||||
const authArgs = [
|
||||
"-Dminecraft.api.env=custom",
|
||||
"-Dminecraft.api.auth.host=https://auth.oier.ovh",
|
||||
"-Dminecraft.api.account.host=https://auth.oier.ovh/user",
|
||||
"-Dminecraft.api.session.host=https://auth.oier.ovh/api/yggdrasil",
|
||||
"-Dminecraft.api.services.host=https://auth.oier.ovh/api/yggdrasil"
|
||||
]
|
||||
args = authArgs.concat(args)
|
||||
|
||||
//preLaunchChild.on('close', (preLaunchCode, preLaunchSignal) => {
|
||||
//logger.info('PRELAUNCH Exited with code', preLaunchCode)
|
||||
logger.info('Launch Arguments:', args)
|
||||
|
||||
const child = child_process.spawn(ConfigManager.getJavaExecutable(this.server.rawServer.id), args, {
|
||||
cwd: this.gameDir,
|
||||
detached: ConfigManager.getLaunchDetached()
|
||||
})
|
||||
|
||||
if(ConfigManager.getLaunchDetached()){
|
||||
child.unref()
|
||||
}
|
||||
|
||||
child.stdout.setEncoding('utf8')
|
||||
child.stderr.setEncoding('utf8')
|
||||
|
||||
child.stdout.on('data', (data) => {
|
||||
data.trim().split('\n').forEach(x => console.log(`\x1b[32m[Minecraft]\x1b[0m ${x}`))
|
||||
|
||||
})
|
||||
child.stderr.on('data', (data) => {
|
||||
data.trim().split('\n').forEach(x => console.log(`\x1b[31m[Minecraft]\x1b[0m ${x}`))
|
||||
})
|
||||
child.on('close', (code, signal) => {
|
||||
logger.info('Exited with code', code)
|
||||
fs.remove(tempNativePath, (err) => {
|
||||
if(err){
|
||||
logger.warn('Error while deleting temp dir', err)
|
||||
} else {
|
||||
logger.info('Temp dir deleted successfully.')
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
//return child
|
||||
return child
|
||||
// });
|
||||
|
||||
const child = child_process.spawn(ConfigManager.getJavaExecutable(this.server.rawServer.id), args, {
|
||||
/* const child = child_process.spawn(ConfigManager.getJavaExecutable(this.server.rawServer.id), args, {
|
||||
cwd: this.gameDir,
|
||||
detached: ConfigManager.getLaunchDetached()
|
||||
})
|
||||
@@ -103,7 +177,7 @@ class ProcessBuilder {
|
||||
})
|
||||
})
|
||||
|
||||
return child
|
||||
return child */
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,15 +18,6 @@ function loginOptionsCancelEnabled(val){
|
||||
}
|
||||
}
|
||||
|
||||
loginOptionMicrosoft.onclick = (e) => {
|
||||
switchView(getCurrentView(), VIEWS.waiting, 500, 500, () => {
|
||||
ipcRenderer.send(
|
||||
MSFT_OPCODE.OPEN_LOGIN,
|
||||
loginOptionsViewOnLoginSuccess,
|
||||
loginOptionsViewOnLoginCancel
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
loginOptionMojang.onclick = (e) => {
|
||||
switchView(getCurrentView(), VIEWS.login, 500, 500, () => {
|
||||
|
||||
Reference in New Issue
Block a user