stable launch minecraft

This commit is contained in:
2025-12-04 00:53:42 +05:00
parent fd6bb8b4db
commit 5deba6ca92
3 changed files with 4094 additions and 2874 deletions

6956
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -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"
},

View File

@ -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: () => ({