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": [
|
||||
"extends browserslist-config-erb"
|
||||
],
|
||||
"overrides": {
|
||||
"undici": "6.10.2"
|
||||
},
|
||||
"prettier": {
|
||||
"singleQuote": true,
|
||||
"overrides": [
|
||||
@ -125,7 +128,6 @@
|
||||
"skinview3d": "^3.4.1",
|
||||
"stream-browserify": "^3.0.0",
|
||||
"three": "^0.178.0",
|
||||
"undici": "^7.16.0",
|
||||
"util": "^0.12.5",
|
||||
"uuid": "^11.1.0"
|
||||
},
|
||||
|
||||
@ -14,6 +14,7 @@ import {
|
||||
installTask,
|
||||
installDependenciesTask,
|
||||
} from '@xmcl/installer';
|
||||
import { Dispatcher, Agent } from 'undici';
|
||||
import { spawn } from 'child_process';
|
||||
import { AuthService } from './auth-service';
|
||||
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 agent = new Agent({
|
||||
connections: 16, // максимум 16 одновременных соединений (скачиваний)
|
||||
// тут можно задать и другие параметры при необходимости
|
||||
});
|
||||
|
||||
// Модифицированная функция для получения последней версии релиза с произвольного URL
|
||||
export async function getLatestReleaseVersion(apiUrl: string): Promise<string> {
|
||||
try {
|
||||
@ -610,6 +616,7 @@ export function initMinecraftHandlers() {
|
||||
skipRevalidate: true,
|
||||
assetsDownloadConcurrency: 2,
|
||||
librariesDownloadConcurrency: 2,
|
||||
dispatcher: agent,
|
||||
...DOWNLOAD_OPTIONS,
|
||||
});
|
||||
|
||||
@ -701,6 +708,7 @@ export function initMinecraftHandlers() {
|
||||
const depsTask = installDependenciesTask(resolvedVersion, {
|
||||
skipRevalidate: true,
|
||||
prevalidSizeOnly: true,
|
||||
dispatcher: agent,
|
||||
assetsDownloadConcurrency: 2,
|
||||
librariesDownloadConcurrency: 2,
|
||||
checksumValidatorResolver: () => ({
|
||||
|
||||
Reference in New Issue
Block a user