mirror of
https://github.com/artegoser/pimi-launcher-core.git
synced 2025-02-23 20:51:30 +03:00
Deprecated start, fixed download hanging
This commit is contained in:
parent
fd5b201143
commit
f90c2b89af
3 changed files with 2 additions and 7 deletions
|
@ -10,7 +10,7 @@ function downloadAsync (url, directory, name) {
|
|||
return new Promise(resolve => {
|
||||
shelljs.mkdir('-p', directory);
|
||||
|
||||
const _request = request(url);
|
||||
const _request = request(url, {timeout: 10000});
|
||||
|
||||
_request.on('error', function(error) {
|
||||
resolve({
|
||||
|
|
|
@ -48,12 +48,9 @@ module.exports = async function (options) {
|
|||
if(forge) {
|
||||
classPaths.push(`${options.forge.path};${forge.paths.join(';')};${classes.join(';')};${mcPath}`);
|
||||
classPaths.push(forge.forge.mainClass)
|
||||
} else if(custom) {
|
||||
classPaths.push(`${classes.join(";")};${mcPath}`);
|
||||
classPaths.push(custom.mainClass);
|
||||
} else {
|
||||
classPaths.push(`${mcPath};${classes.join(";")}`);
|
||||
classPaths.push(versionFile.mainClass);
|
||||
classPaths.push(versionFile.mainClass || custom.mainClass);
|
||||
}
|
||||
|
||||
// Download version's assets
|
||||
|
@ -66,7 +63,6 @@ module.exports = async function (options) {
|
|||
const launchArguments = args.concat(jvm, classPaths, launchOptions);
|
||||
|
||||
const minecraft = child.spawn(options.javaPath ? options.javaPath : 'java', launchArguments);
|
||||
event.emit('start', null);
|
||||
minecraft.stdout.on('data', (data) => event.emit('data', data));
|
||||
minecraft.stderr.on('data', (data) => event.emit('error', data));
|
||||
minecraft.on('close', (code) => event.emit('close', code));
|
||||
|
|
Loading…
Add table
Reference in a new issue