mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f5c83ee9ca | |||
| e1546d0975 | |||
| d69ecac496 | |||
| 8f1a2015bd | |||
| 3e4afe5a07 | |||
| 288c219417 | |||
| 31db079b08 | |||
| 5e1eff7143 | |||
| 301d2fdfc4 | |||
| 9638c65407 | |||
| efd69e4bb3 | |||
| 90cb0d5038 | |||
| 73e8e0f15a | |||
| b169b04637 | |||
| 6296a78cbc | |||
| 1305756cac | |||
| 1f2601427b |
@@ -13,5 +13,7 @@
|
||||
{"username": "AndyIsHereBoi", "type": "gold"},
|
||||
{"username": "grtroadrunner"},
|
||||
{"username": "Ilnahro"},
|
||||
{"username": "T3chLog"}
|
||||
{"username": "T3chLog"},
|
||||
{"username": "Phil", "type": "gold"},
|
||||
{"username": "Protocrush", "type": "gold"}
|
||||
]
|
||||
|
||||
@@ -248,7 +248,7 @@
|
||||
"ConnectionError": "Kann nach 10 Versuchen keine Verbindung zu Steam herstellen 🤯",
|
||||
"LicenceError": "Die Liste der Lizenzen kann nicht abgerufen werden.",
|
||||
"RateLimitExceeded": "Du hast es zu oft versucht, warte eine Weile und versuche es später erneut.",
|
||||
"TokenRejected": "BeatSaber kann nicht heruntergeladen werden 😥 versuche es später noch einmal 😕",
|
||||
"TokenRejected": "Ihr Anmeldetoken wurde abgelehnt 😕 Bitte versuchen Sie es erneut.",
|
||||
"AccessDenied": "Der Zugang zu Steam wurde verweigert.",
|
||||
"dotnet-required": ".NET 6 Runtime muss installiert sein, um eine Version von BeatSaber herunterzuladen. Lade es herunter, indem Du auf die Schaltfläche unten klickst."
|
||||
},
|
||||
|
||||
@@ -248,7 +248,7 @@
|
||||
"ConnectionError": "Unable to connect to Steam after 10 tries 🤯",
|
||||
"LicenceError": "Unable to get the list of licenses.",
|
||||
"RateLimitExceeded": "You've tried too many times, wait a while and try again later.",
|
||||
"TokenRejected": "Unable to download Beat Saber 😥 try again later 😕",
|
||||
"TokenRejected": "Your login token has been rejected 😕 Please try again.",
|
||||
"AccessDenied": "Access to Steam has been denied.",
|
||||
"dotnet-required": ".NET 6 Runtime must be installed in order to download a version of Beat Saber. Download it by clicking the button below."
|
||||
},
|
||||
|
||||
@@ -247,7 +247,7 @@
|
||||
"ConnectionError": "No se puede conectar a Steam después de 10 intentos 🤯",
|
||||
"LicenceError": "No se puede obtener la lista de licencias.",
|
||||
"RateLimitExceeded": "Lo has intentado demasiadas veces, espera un poco y vuelve a intentarlo más tarde.",
|
||||
"TokenRejected": "No se puede descargar BeatSaber 😥 inténtalo más tarde 😕",
|
||||
"TokenRejected": "Tu token de inicio de sesión ha sido rechazado 😕 Por favor, inténtalo de nuevo.",
|
||||
"AccessDenied": "El acceso a Steam ha sido denegado.",
|
||||
"dotnet-required": "Se debe instalar el tiempo de ejecución de .NET 6 para descargar una versión de BeatSaber. Descárguelo haciendo clic en el botón de abajo."
|
||||
},
|
||||
|
||||
@@ -244,7 +244,7 @@
|
||||
"ConnectionError": "Impossible de se connecter à Steam après 10 essais 🤯",
|
||||
"LicenceError": "Impossible d'obtenir la liste des licences.",
|
||||
"RateLimitExceeded": "Tu as essayé trop de fois attends un peu et recommence plus tard.",
|
||||
"TokenRejected": "Impossible de télécharger Beat Saber 😥 réessaye plus tard 😕",
|
||||
"TokenRejected": "Votre token de connexion a été rejeté 😕 Veuillez réessayer.",
|
||||
"AccessDenied": "L'accès à Steam a été refusé.",
|
||||
"dotnet-required": ".NET 6 Runtime doit être installé pour pouvoir télécharger une version de Beat Saber. Télécharge-le en cliquant sur le bouton ci-dessous."
|
||||
},
|
||||
|
||||
@@ -248,7 +248,7 @@
|
||||
"ConnectionError": "Не удалось подключиться к Steam за 10 попыток 🤯",
|
||||
"LicenceError": "Не удалось проверить наличие лицензии.",
|
||||
"RateLimitExceeded": "Слишком много попыток, вернитесь позже и попробуйте снова.",
|
||||
"TokenRejected": "Не удалось скачать Beat Saber 😥 повторите попытку позже 😕",
|
||||
"TokenRejected": "Ваш токен для входа был отклонен 😕 Пожалуйста, попробуйте снова.",
|
||||
"AccessDenied": "Доступ к Steam был отклонен.",
|
||||
"dotnet-required": "Среда запуска .NET 6 должна быть установлена, чтобы скачать Beat Saber. Скачайте её с помощью кнопки ниже."
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "bs-manager",
|
||||
"version": "1.3.0-alpha.4",
|
||||
"version": "1.3.0-alpha.6",
|
||||
"description": "BSManager",
|
||||
"main": "./dist/main/main.js",
|
||||
"author": {
|
||||
|
||||
@@ -8,10 +8,12 @@ export class DepotDownloader {
|
||||
private processOut$: Observable<string>;
|
||||
private subscriber: Subscriber<string>;
|
||||
|
||||
public constructor(options: {
|
||||
command: string, args?: string[], options?: SpawnOptionsWithoutStdio, echoStartData?: unknown
|
||||
}){
|
||||
|
||||
public constructor(
|
||||
options: {
|
||||
command: string, args?: string[], options?: SpawnOptionsWithoutStdio, echoStartData?: unknown
|
||||
},
|
||||
logger?: Logger
|
||||
){
|
||||
this.processOut$ = new Observable<string>(subscriber => {
|
||||
|
||||
this.subscriber = subscriber;
|
||||
@@ -21,15 +23,23 @@ export class DepotDownloader {
|
||||
subscriber.next(`[Info]|[Start]|${JSON.stringify(options.echoStartData) ?? ""}`);
|
||||
|
||||
this.process.stdout.on("data", data => {
|
||||
const lines: string[] = data.toString().split("\n");
|
||||
const stringData: string = data.toString();
|
||||
|
||||
if(!stringData.includes(DepotDownloaderInfoEvent.Progress) && !stringData.includes(DepotDownloaderInfoEvent.Validated)){
|
||||
logger?.info("DepotDownloader stdout:", stringData);
|
||||
}
|
||||
|
||||
const lines: string[] = stringData.split("\n");
|
||||
lines.forEach(line => subscriber.next(line));
|
||||
});
|
||||
|
||||
this.process.on("error", error => subscriber.error(error));
|
||||
this.process.stderr.on("error", error => subscriber.error(error));
|
||||
this.process.on("exit", code => subscriber.complete());
|
||||
this.process.on("exit", () => subscriber.complete());
|
||||
|
||||
return () => {
|
||||
this.process.kill();
|
||||
logger?.info("DepotDownloader process end with code", this.process.exitCode);
|
||||
this.process = null;
|
||||
}
|
||||
|
||||
@@ -48,8 +58,6 @@ export class DepotDownloader {
|
||||
|
||||
return this.processOut$.pipe(map(line => {
|
||||
|
||||
console.log(line);
|
||||
|
||||
const matched = (line.toString() as string).match(/(?:\[(.*?)\])\|(?:\[(.*?)\]\|)?(.*?)(?=$|\[)/gm)?.[0] ?? null;
|
||||
|
||||
if(!matched){ return null; }
|
||||
@@ -98,4 +106,10 @@ export class DepotDownloader {
|
||||
return args;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
interface Logger {
|
||||
info: (...args: unknown[]) => void,
|
||||
warn: (...args: unknown[]) => void,
|
||||
error: (...args: unknown[]) => void,
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import log from "electron-log";
|
||||
import { InstallationLocationService } from "./installation-location.service";
|
||||
import { BSLocalVersionService } from "./bs-local-version.service";
|
||||
import { WindowManagerService } from "./window-manager.service";
|
||||
import { copy } from "fs-extra";
|
||||
import { copy, ensureDir } from "fs-extra";
|
||||
import { pathExist } from "../helpers/fs.helpers";
|
||||
import { Observable, map } from "rxjs";
|
||||
import { DepotDownloaderArgsOptions, DepotDownloaderErrorEvent, DepotDownloaderEvent, DepotDownloaderEventType, DepotDownloaderInfoEvent } from "../../shared/models/depot-downloader.model";
|
||||
@@ -42,14 +42,16 @@ export class BSInstallerService {
|
||||
}
|
||||
|
||||
private getDepotDownloaderExePath(): string {
|
||||
return path.join(this.utils.getAssetsScriptsPath(), "depot-downloader", "DepotDownloader.exe");
|
||||
return path.join(this.utils.getAssetsScriptsPath(), "depot-downloader", `DepotDownloader.${process.platform === 'linux' ? 'dll' : 'exe'}`);
|
||||
}
|
||||
|
||||
public async isDotNet6Installed(): Promise<boolean> {
|
||||
try {
|
||||
const process = spawnSync(this.getDepotDownloaderExePath());
|
||||
if (process.stderr.toString()) {
|
||||
log.error("no dotnet", process.stderr.toString());
|
||||
const proc = process.platform === 'linux'
|
||||
? spawnSync('dotnet', [this.getDepotDownloaderExePath()])
|
||||
: spawnSync(this.getDepotDownloaderExePath());
|
||||
if (proc.stderr?.toString()) {
|
||||
log.error("no dotnet", proc.stderr.toString());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -77,12 +79,18 @@ export class BSInstallerService {
|
||||
qr
|
||||
}
|
||||
|
||||
await ensureDir(this.installLocationService.versionsDirectory);
|
||||
|
||||
const isLinux = process.platform === 'linux';
|
||||
const exePath = this.getDepotDownloaderExePath();
|
||||
const args = DepotDownloader.buildArgs(depotDownloaderOptions);
|
||||
|
||||
return new DepotDownloader({
|
||||
command: this.getDepotDownloaderExePath(),
|
||||
args: DepotDownloader.buildArgs(depotDownloaderOptions),
|
||||
command: isLinux ? 'dotnet' : exePath,
|
||||
args: isLinux ? [exePath, ...args] : args,
|
||||
options: { cwd: this.installLocationService.versionsDirectory },
|
||||
echoStartData: downloadVersion
|
||||
});
|
||||
}, log);
|
||||
}
|
||||
|
||||
private buildDepotDownloaderObservable(downloadInfos: DownloadInfo, qr?: boolean): Observable<DepotDownloaderEvent> {
|
||||
@@ -104,7 +112,7 @@ export class BSInstallerService {
|
||||
}
|
||||
return event;
|
||||
})).subscribe(sub);
|
||||
|
||||
|
||||
}).catch(err => sub.error({
|
||||
type: DepotDownloaderEventType.Error,
|
||||
subType: DepotDownloaderErrorEvent.Unknown,
|
||||
|
||||
@@ -38,6 +38,7 @@ export const LinkButton = motion(
|
||||
!props.disabled && props.onClick?.();
|
||||
}}
|
||||
style={{ pointerEvents: props.disabled ? "none" : "auto" }}
|
||||
tabIndex={-1}
|
||||
>
|
||||
<span className="absolute top-0 left-0 h-full w-full rounded-full brightness-50 opacity-75 dark:opacity-20 dark:filter-none" style={{ backgroundColor: linkedColor }} />
|
||||
<BsmIcon className="p-1 absolute top-0 left-0 h-full w-full !bg-transparent -rotate-45 brightness-150" icon={props.linked ? "link" : "unlink"} style={{ color: linkedColor }} />
|
||||
|
||||
@@ -121,6 +121,7 @@ export function MapsPlaylistsPanel({ version, isActive }: Props) {
|
||||
e.stopPropagation();
|
||||
onClickAdd(index);
|
||||
}}
|
||||
tabIndex={-1}
|
||||
>
|
||||
<span className="absolute top-0 left-0 h-full w-full brightness-50 opacity-75 dark:opacity-20 dark:filter-none" style={{ backgroundColor: "currentcolor" }} />
|
||||
<motion.div className="h-full p-0.5" variants={variants}>
|
||||
|
||||
@@ -112,7 +112,7 @@ function ModelItemElement<T = unknown>(props: Props<T>) {
|
||||
};
|
||||
|
||||
return (
|
||||
<motion.li className={`relative flex-grow min-w-[16rem] h-64 cursor-pointer ${props.className ?? ""}`} onHoverStart={() => setHovered(() => true)} onHoverEnd={() => setHovered(() => false)}>
|
||||
<motion.li className={`relative flex-grow min-w-[16rem] h-64 cursor-pointer text-gray-200 ${props.className ?? ""}`} onHoverStart={() => setHovered(() => true)} onHoverEnd={() => setHovered(() => false)}>
|
||||
<GlowEffect visible={props.selected || hovered} />
|
||||
<div className="absolute top-0 left-0 w-full h-full rounded-lg overflow-hidden blur-none bg-black shadow-sm shadow-black">
|
||||
<div ref={ref} className="contents">
|
||||
|
||||
Reference in New Issue
Block a user