stable launch minecraft
This commit is contained in:
6956
package-lock.json
generated
6956
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -55,6 +55,9 @@
|
|||||||
"browserslist": [
|
"browserslist": [
|
||||||
"extends browserslist-config-erb"
|
"extends browserslist-config-erb"
|
||||||
],
|
],
|
||||||
|
"overrides": {
|
||||||
|
"undici": "6.10.2"
|
||||||
|
},
|
||||||
"prettier": {
|
"prettier": {
|
||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"overrides": [
|
"overrides": [
|
||||||
@ -125,7 +128,6 @@
|
|||||||
"skinview3d": "^3.4.1",
|
"skinview3d": "^3.4.1",
|
||||||
"stream-browserify": "^3.0.0",
|
"stream-browserify": "^3.0.0",
|
||||||
"three": "^0.178.0",
|
"three": "^0.178.0",
|
||||||
"undici": "^7.16.0",
|
|
||||||
"util": "^0.12.5",
|
"util": "^0.12.5",
|
||||||
"uuid": "^11.1.0"
|
"uuid": "^11.1.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import {
|
|||||||
installTask,
|
installTask,
|
||||||
installDependenciesTask,
|
installDependenciesTask,
|
||||||
} from '@xmcl/installer';
|
} from '@xmcl/installer';
|
||||||
|
import { Dispatcher, Agent } from 'undici';
|
||||||
import { spawn } from 'child_process';
|
import { spawn } from 'child_process';
|
||||||
import { AuthService } from './auth-service';
|
import { AuthService } from './auth-service';
|
||||||
import { API_BASE_URL } from '../renderer/api';
|
import { API_BASE_URL } from '../renderer/api';
|
||||||
@ -48,6 +49,11 @@ const MCSTATUS_API_URL = 'https://api.mcstatus.io/v2/status/java/';
|
|||||||
// Создаем экземпляр сервиса аутентификации
|
// Создаем экземпляр сервиса аутентификации
|
||||||
const authService = new AuthService();
|
const authService = new AuthService();
|
||||||
|
|
||||||
|
const agent = new Agent({
|
||||||
|
connections: 16, // максимум 16 одновременных соединений (скачиваний)
|
||||||
|
// тут можно задать и другие параметры при необходимости
|
||||||
|
});
|
||||||
|
|
||||||
// Модифицированная функция для получения последней версии релиза с произвольного URL
|
// Модифицированная функция для получения последней версии релиза с произвольного URL
|
||||||
export async function getLatestReleaseVersion(apiUrl: string): Promise<string> {
|
export async function getLatestReleaseVersion(apiUrl: string): Promise<string> {
|
||||||
try {
|
try {
|
||||||
@ -610,6 +616,7 @@ export function initMinecraftHandlers() {
|
|||||||
skipRevalidate: true,
|
skipRevalidate: true,
|
||||||
assetsDownloadConcurrency: 2,
|
assetsDownloadConcurrency: 2,
|
||||||
librariesDownloadConcurrency: 2,
|
librariesDownloadConcurrency: 2,
|
||||||
|
dispatcher: agent,
|
||||||
...DOWNLOAD_OPTIONS,
|
...DOWNLOAD_OPTIONS,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -701,6 +708,7 @@ export function initMinecraftHandlers() {
|
|||||||
const depsTask = installDependenciesTask(resolvedVersion, {
|
const depsTask = installDependenciesTask(resolvedVersion, {
|
||||||
skipRevalidate: true,
|
skipRevalidate: true,
|
||||||
prevalidSizeOnly: true,
|
prevalidSizeOnly: true,
|
||||||
|
dispatcher: agent,
|
||||||
assetsDownloadConcurrency: 2,
|
assetsDownloadConcurrency: 2,
|
||||||
librariesDownloadConcurrency: 2,
|
librariesDownloadConcurrency: 2,
|
||||||
checksumValidatorResolver: () => ({
|
checksumValidatorResolver: () => ({
|
||||||
|
|||||||
Reference in New Issue
Block a user