Compare commits

..

159 Commits

Author SHA1 Message Date
MathieuG-P 3a9e77de24 bumb to 1.4.0 2023-11-28 13:31:25 +01:00
MathieuG-P 83b2d30b66 Wrong boolean 2023-11-26 16:23:09 +01:00
MathieuG-P 6e9e60cd08 Fix "Download .NET" translation broken 2023-11-26 16:04:28 +01:00
MathieuG-P bf6e9cc95d Fix break line issues with Chinese translation 2023-11-26 16:00:50 +01:00
MathieuG-P 0a10f9d1d5 Change chinese flag 2023-11-26 15:41:40 +01:00
MathieuG-P 72329b6ae4 Merge pull request #359 from ktKongTong/master
[feature] Chinese i18n support
2023-11-26 15:37:47 +01:00
ktKongTong 5e388b801a i18n chinese support 2023-11-26 00:05:37 +08:00
MathieuG-P 64858a3d2c Merge pull request #358 from Zagrios/bugfix/import-version-progression-was-wrong
[bugfix] Import version progression was wrong if symlinks present in the folder
2023-11-22 00:02:25 +01:00
MathieuG-P c4c77bbd7b [bugfix] Import version progression was wrong if symlinks present in the folder 2023-11-21 23:56:56 +01:00
MathieuG-P f2f087e6be update patreons 2023-11-20 11:40:43 +01:00
MathieuG-P 7806dfb3b9 bumb to 1.4.0-alpha.2 2023-11-18 13:21:03 +01:00
MathieuG-P d7eb9807f3 nothing 2023-11-18 13:18:56 +01:00
MathieuG-P 713b50a49d Merge pull request #357 from Zagrios/bugfix/unable-to-start-oculus-version-after-moving-installation-path
[bugfix] Unable to start Oculus version after moving installation directory
2023-11-18 12:57:16 +01:00
MathieuG-P d74008b109 [bugfix] Unable to start Oculus version after moving installation path 2023-11-18 12:51:49 +01:00
MathieuG-P a837310518 [chore] add bunch of logs for mods installation 2023-11-18 00:15:55 +01:00
MathieuG-P 2b35226f07 Merge pull request #354 from Zagrios/feature/recommended-banner-best-moddable-version
[feature] Added "recommended" banner on the best modable version
2023-11-17 23:34:45 +01:00
MathieuG-P 8986b5fed9 [feature] thicken "recommended" banner 2023-11-17 23:30:42 +01:00
MathieuG-P 01d07db991 Merge pull request #356 from Zagrios/bugfix/unable-to-launch-oculus-version-after-staying-in-the-version-page-while-downloading
[bugfix] BS version page being downloaded was always recognized as a Steam version, preventing launching if it was an Oculus version
2023-11-17 23:26:54 +01:00
MathieuG-P 9948e9b073 [bugfix] BS version page being downloaded was always recognized as a Steam version, preventing launching if it was an Oculus version 2023-11-17 23:21:28 +01:00
MathieuG-P 77aaeb14c8 Merge pull request #355 from Zagrios/bugfix/prevent-being-able-to-launch-currently-downloading-version
Bugfix/prevent being able to launch currently downloading version
2023-11-17 21:56:32 +01:00
MathieuG-P 3db58391ad [bugfix] Prevent being able to launch downloading BS version 2023-11-17 21:52:36 +01:00
MathieuG-P 0fa298bc09 [chore] add logs for installed versions detection 2023-11-17 21:02:55 +01:00
MathieuG-P 8421288322 [feature] Added "recommended" banner on the best modable version 2023-11-17 20:25:42 +01:00
MathieuG-P 46ee9d33e6 Merge pull request #353 from Zagrios/bugfix/prioritise-ipv4-to-avoid-ipv6-issues
[bugfix] prioritise ipv4 to avoid ipv6 issues
2023-11-15 18:02:55 +01:00
MathieuG-P 811d7a9f5a Merge branch 'master' into bugfix/prioritise-ipv4-to-avoid-ipv6-issues 2023-11-15 17:59:06 +01:00
MathieuG-P 1a5507249b bumb to 1.4.0-alpha.1 2023-11-15 13:24:20 +01:00
MathieuG-P ce0e7ae19e [bugfix] fix download success notification when canceling oculus download 2023-11-12 13:35:34 +01:00
MathieuG-P 6f46b943c9 [chore] add bs must be installed at least once for launching 2023-11-12 13:22:59 +01:00
MathieuG-P e2f461346d [chore] add log when launching a version 2023-11-12 02:58:04 +01:00
MathieuG-P 19d2a370ce Merge pull request #352 from Zagrios/feature/add-the-possibility-to-enter-oculus-token-manually
[feature] add the possibility to enter oculus token manually
2023-11-12 02:33:26 +01:00
MathieuG-P 4cd2fb8da0 [feature] add the possibility to enter oculus token manually 2023-11-12 02:24:40 +01:00
MathieuG-P a5bb3a1c3d [chore] small change for oculus download 2023-11-11 17:31:31 +01:00
MathieuG-P 7900f187de Merge pull request #351 from Zagrios/bugfix/refresh-list-was-not-refreshing-installed-versions
[bugfix] "Refresh list" was not refreshing installed versions, only available versions
2023-11-11 12:57:16 +01:00
MathieuG-P 586175878e [bugfix] "Refresh list" was not refreshing installed versions, only available versions 2023-11-11 12:56:32 +01:00
MathieuG-P 6c60013fca [chore] set favicon as extraResources 2023-11-10 20:25:13 +01:00
MathieuG-P e7afa033ad Merge pull request #349 from Zagrios/bugfix/cannot-download-playlist-with-one-click/342
[bugfix-342] Fix unable to download playlist with OneClick from certain websites
2023-11-10 20:24:13 +01:00
MathieuG-P b520c4463c [bugfix-342] remove sonarcloud code smell 2023-11-10 20:20:15 +01:00
MathieuG-P 07600507f3 [bugfix-342] Fix unable to download playlist with OneClick from certain sites 2023-11-10 20:16:22 +01:00
MathieuG-P a5cb761282 Merge pull request #347 from Zagrios/chore/images-duplicated-in-build
[chore] images was duplicated in build
2023-11-08 18:17:37 +01:00
MathieuG-P c1ad63264d [chore] images was duplicated in build 2023-11-08 17:46:57 +01:00
MathieuG-P 4e8e9aabc9 Merge pull request #346 from Zagrios/feature/oculus-pcvr-download/274
[feature-274] oculus pcvr download
2023-11-07 23:53:17 +01:00
MathieuG-P dee8d7a25f [feature-274] remove sonarcloud code smells 2023-11-07 23:44:30 +01:00
MathieuG-P a8dd2d72f5 [feature-274] fix non awaited promise in if statement 2023-11-07 23:25:44 +01:00
MathieuG-P 7b88100758 [feature-274] remove todo 2023-11-07 22:01:39 +01:00
MathieuG-P 26579bd7c6 [feature-274] add logs 2023-11-07 21:47:17 +01:00
MathieuG-P e40244666a [feature-274] return steamLauncher by default just un case 2023-11-06 21:50:35 +01:00
MathieuG-P c9297276d9 [feature-274] Better error handling + handle invalid symlinks (after uninstalling an oculus version) 2023-11-06 18:44:45 +01:00
MathieuG-P d34753d9b8 [feature-274] Fix not writing metadata download from meta form 2023-11-06 18:42:49 +01:00
MathieuG-P 7090391f94 [feature-274] Reduce parallel download to 15 2023-11-06 17:09:13 +01:00
MathieuG-P b692bcc7cd [feature-274] add translations 2023-11-06 17:08:07 +01:00
MathieuG-P 8e5e04ad52 [feature-274] add OCULUS_LIB_NOT_FOUND error 2023-11-06 17:07:35 +01:00
MathieuG-P d7a885f3b8 [feature-274] Use CustomError class for launch errors 2023-11-06 17:06:56 +01:00
MathieuG-P d69a55de7d [feature-274] Not clean Oculus BS symlink when starting BSM 2023-11-06 10:58:07 +01:00
MathieuG-P 356083712e [feature-274] public function for restoring original bs oculus folder 2023-11-06 10:57:20 +01:00
MathieuG-P a07e7111c1 [feature-274] Fix unable to verify original Steam or Oculus version + add "Restore folder" button for original oculus version 2023-11-05 00:36:12 +01:00
MathieuG-P 555a9bc98e [feature-274] Add backup inforamtion modal before launch oculus version 2023-11-04 18:09:55 +01:00
MathieuG-P 31a0cff1f3 [feature-274] add OculusBinaryId to version 1.33.0 2023-11-03 15:17:58 +01:00
MathieuG-P 6acc2831b3 Merge branch 'master' into feature/oculus-pcvr-download/274 2023-11-03 15:15:08 +01:00
MathieuG-P 9b7fa23016 [feature-274] Can now launch downgraded version from Oculus 2023-11-03 15:11:35 +01:00
MathieuG-P f45698121f [feature-274] 5 to 20 concurent downlaod + write metadata on after downloading bs via oculus 2023-11-02 21:33:37 +01:00
MathieuG-P f30557f651 add patreon 2023-11-01 10:46:05 +01:00
Iluhadesu 843bdfaf01 Add v1.33.0 to bs_versions.json 2023-10-30 16:43:15 +01:00
MathieuG-P 685313a133 [feature-274] Add setting to select the default platfrom to download BS 2023-10-29 13:04:22 +01:00
MathieuG-P 78d55bd6ae [feature-274] Add success notification oculus download + not restart download after auto-download oculus if success to downloas some files + change translation + fix error when viewing an official version 2023-10-29 09:25:37 +01:00
MathieuG-P 0645e88307 [feature-274] Add errors notifications with their translations 2023-10-29 01:28:04 +02:00
MathieuG-P 43bf822aee [feature-274] handle irrelevant oculus download errors
Ignore errors such as "no token" when auto download or "window closed by user" in the ui
2023-10-27 20:11:16 +02:00
MathieuG-P 0a1e1efcd9 [feature-274] Refactoring downloaders service + handle importing Oculus version + logout from steam and oculus in settings + other things 2023-10-27 02:00:24 +02:00
MathieuG-P e9780a60f4 [feature-274] clean component 2023-10-24 02:18:16 +02:00
MathieuG-P a17da3a83f [feature-274] improve oculus downloading process 2023-10-24 02:17:46 +02:00
MathieuG-P b576a33293 [feature-274] add Oculus binary ids to versions json 2023-10-23 22:28:56 +02:00
MathieuG-P cb7a46a434 Merge branch 'master' of https://github.com/Zagrios/bs-manager 2023-10-18 21:04:18 +02:00
MathieuG-P df806881df add patreon 2023-10-18 21:04:14 +02:00
MathieuG-P c0f2baffa6 [feature-274] can now download oculus version from the interface 2023-10-18 01:13:46 +02:00
MathieuG-P a02ee41b0b Merge pull request #341 from Synaelle/master
fix spelling and standardize the name of the game
2023-10-17 14:07:10 +02:00
MathieuG-P 08d1add47b [feature-274] Improve Oculus downloading + add Modal to choose from where to download Beat Saber 2023-10-16 23:38:57 +02:00
Synaelle 5dc8a2815e Standardize the name Beat Saber with a space 2023-10-15 23:39:39 +02:00
Synaelle 5ec700cfe3 Standardize the name Beat Saber with a space 2023-10-15 23:39:25 +02:00
Synaelle af0a9b980d fix spelling and standardize the name of the game with a space 2023-10-15 23:38:18 +02:00
MathieuG-P f8b0874f7d Merge branch 'master' into feature/oculus-pcvr-download/274 2023-10-15 14:23:37 +02:00
MathieuG-P da387169a5 [chore] remove ununsed function 2023-10-15 14:23:23 +02:00
MathieuG-P dae4dbb6d2 Merge branch 'master' into feature/oculus-pcvr-download/274 2023-10-15 14:21:57 +02:00
MathieuG-P dcd10e01ea add patreon 2023-10-15 11:37:43 +02:00
MathieuG-P e0da65cce9 Merge pull request #340 from Zagrios/bugfix/crash-when-multiple-oneclick-at-same-time
[bugfix] Fix crash when multiple oneclick at same time
2023-10-14 17:47:57 +02:00
MathieuG-P 1b06443fa5 [bugfix] Fix crash when multiple oneclick at same time 2023-10-14 17:42:51 +02:00
MathieuG-P 47bcb96dba [chore] update electron + electron-updater 2023-10-14 11:23:06 +02:00
MathieuG-P 109d560953 bumb to 1.3.2 2023-10-08 23:03:00 +02:00
MathieuG-P bfc853ee55 Merge pull request #337 from Zagrios/bugfix/one-click-download-playlist-conflict-with-shared-maps
[bugfix] Fix error when downloading playlist with OneClick and having maps linked
2023-10-08 22:53:00 +02:00
MathieuG-P fc2cb676d2 [bugfix] Fix error when downloading playlist with OneClick and having maps linked 2023-10-08 22:38:34 +02:00
MathieuG-P 226468aa00 Merge pull request #336 from Zagrios/bugfix/fix-english-translation-typos
[bugfix] Fix english translation typos
2023-10-08 11:28:24 +02:00
MathieuG-P 767bbf389b [bugfix] Fix english translation typos 2023-10-08 11:24:14 +02:00
MathieuG-P 0de2ea44d3 Merge pull request #335 from Zagrios/bugfix/advanced-launch-arguments-not-work-with-shortcuts
[bugfix] when only one advanced launch arg was set for a shortcut it was mishandled
2023-10-07 21:41:18 +02:00
MathieuG-P 1dde41f4f6 [bugfix] when only one advanced launch arg was set for a shortcut it was mishandled 2023-10-07 21:28:57 +02:00
Iluhadesu 029df85ddb Add v1.32.0 to bs_versions.json 2023-10-05 20:14:17 +02:00
MathieuG-P 819409bce1 [bugfix] fix wrong configuration https 2023-10-05 16:36:25 +02:00
MathieuG-P 788d1087ba [bugfix] use ipv4 agent to perform requests 2023-10-04 15:24:41 +02:00
MathieuG-P 139f17d7fc Merge pull request #331 from Zagrios/bugfix/one-click-map-download-may-not-work-with-shared-maps
[bugfix] Fix OneClick map download may not work with multiple maps sharing
2023-10-04 00:21:22 +02:00
MathieuG-P 92fd59be1e [bugfix] Fix OneClick map download may not work with multiple maps sharing 2023-10-04 00:10:05 +02:00
MathieuG-P d61f59c714 bumb to 1.3.1 2023-10-02 13:36:22 +02:00
MathieuG-P 64e3652b60 Merge pull request #330 from Zagrios/bugfix/steam-vr-restored-before-beatsaber-was-launched
[bugfix] increase timout for restoring SteamVR after launching Beat Saber
2023-10-02 13:35:46 +02:00
MathieuG-P 6f018e6a32 [bugfix] increase timout for restoring SteamVR after launching Beat Saber 2023-10-02 13:30:23 +02:00
MathieuG-P 3afeeef848 [feature-274] the script for download and verify oculus game works 2023-10-02 13:04:28 +02:00
MathieuG-P 90ef3532b4 [feature-274] fix import 2023-09-28 21:04:48 +02:00
MathieuG-P e032d7b453 [feature-274] nothing juste a timout for tests 2023-09-28 21:01:32 +02:00
MathieuG-P 8bfe4caa5e [feature] add function to get user oculus token + other small changes 2023-09-28 20:50:51 +02:00
MathieuG-P bd7d6b2f2e [feature] Enable cookie encryption 2023-09-28 20:50:07 +02:00
MathieuG-P da3b2b13a8 Merge pull request #328 from Zagrios/bugfix/replace-resvg-that-need-dll-by-sharp
[bugfix] Remove resvg lib that need DLL by Sharp that doesnt
2023-09-25 12:52:40 +02:00
MathieuG-P 381daa80a4 [bufix] install node-abi 2023-09-25 12:34:05 +02:00
MathieuG-P bdfe8ce535 [bugfix] Remove resvg lib that need DLL by Sharp that doesnt 2023-09-25 11:55:34 +02:00
MathieuG-P 7f71d3006c bumb to 1.3.1-alpha.2 2023-09-25 08:12:50 +02:00
MathieuG-P 120470de5e Merge pull request #326 from Zagrios/bugfix/bsm-was-using-the-parent-of-bs-content-folder
[bugfix] fix of using the parent of installation folder when it was set in the config
2023-09-23 16:14:27 +02:00
MathieuG-P 8efe5be63f [bugfix] fix of using the parent of installation folder when it was set in the config 2023-09-23 16:09:24 +02:00
MathieuG-P 7378b234eb Merge pull request #325 from Insprill/fix/liv-linux
Skip Liv initialization on Linux
2023-09-21 17:17:37 +02:00
Pierce Thompson d256f2989f Pass noError instead of using a dummy impl 2023-09-21 10:59:13 -04:00
Pierce Thompson 85d43639af Skip Liv initialization on Linux 2023-09-20 22:47:59 -04:00
MathieuG-P f849b0d570 Merge pull request #323 from Zagrios/bugfix/steam-and-oculus-are-not-at-the-top
[bugfix] Steam and Oculus are not at the top of the versions list
2023-09-20 17:38:37 +02:00
MathieuG-P 34936f6666 [bugfix] Steam and Oculus are not at the top of the versions list 2023-09-20 17:32:45 +02:00
MathieuG-P d8a4889298 Merge pull request #321 from Zagrios/bugfix/add-no-yeet-args-prevent-mods-to-be-yeeted
[bugfix] Add no-yeet agrs to prevent mods to be yeeted
2023-09-18 15:29:35 +02:00
MathieuG-P 21c7f9d225 [bugfix] Add no-yeet agrs to prevent mods to be moved when UserData folder is linked 2023-09-18 15:24:53 +02:00
MathieuG-P 1048ca6b9b remove code sign verification 2023-09-18 15:14:09 +02:00
MathieuG-P b2b7002a8e Merge branch 'master' of https://github.com/Zagrios/bs-manager 2023-09-18 14:37:43 +02:00
MathieuG-P 1776f5f769 [chore] update code sign sha 2023-09-18 14:37:40 +02:00
MathieuG-P f17c8a27cc for code sign verification 2023-09-15 17:05:43 +02:00
MathieuG-P 1b8e009a62 bumb to 1.3.1-alpha.1 2023-09-15 16:58:50 +02:00
MathieuG-P 3a44779ade Merge pull request #320 from Zagrios/feature/liv-shortcuts
[feature] Liv shortcuts
2023-09-15 09:51:13 +02:00
MathieuG-P c407997dc2 [feature] remove code smells 2023-09-15 09:44:55 +02:00
MathieuG-P d61c1a519f [feature] remove unused function, and add logs 2023-09-15 09:39:08 +02:00
MathieuG-P 46eb8d065b [feature] Start LIV service on startup 2023-09-14 22:36:59 +02:00
MathieuG-P 9ee036527c [feature] LIV shortcut synchronise with installed BSM versions 2023-09-13 23:41:46 +02:00
MathieuG-P 825b35d164 [feature] create LIV service 2023-09-13 00:14:38 +02:00
MathieuG-P 9de0a4a821 [chore] update deps 2023-09-12 22:38:18 +02:00
MathieuG-P e01fe02c08 Merge pull request #319 from Zagrios/chore/change-default-contents-path
[chore] Change default contents path to avoid OneDrive issues
2023-09-11 22:08:17 +02:00
MathieuG-P 2e376b03fc [chore] fix sonarcloud bug 2023-09-11 21:53:58 +02:00
MathieuG-P 6bdf47678e [chore] Change default contents path to avoid OneDrive issues 2023-09-11 21:49:43 +02:00
Iluhadesu c9bcdc8da6 Add v1.31.1 to bs_versions.json 2023-09-04 13:34:54 +02:00
MathieuG-P 7d21ba5bca add patreon 2023-09-03 17:14:58 +02:00
MathieuG-P 7fb19f46d0 Merge pull request #314 from Zagrios/bugfix/steamvr-not-retored-after-fpfc-mode/313
[bugfix-313] Restore SteamVR shortly after launching BS and on disabl…
2023-08-28 16:45:18 +02:00
MathieuG-P 195bc1ad64 [bugfix-313] remove unused imports 2023-08-28 16:36:31 +02:00
MathieuG-P ccc133cf6d [bugfix-313] Restore SteamVR shortly after launching BS and on disabling FPFC Mode 2023-08-28 16:33:53 +02:00
MathieuG-P 549d4473ab Merge pull request #312 from Zagrios/feature/use-arcviewer/237
[feature-237] use ArcViewer
2023-08-28 00:36:09 +02:00
MathieuG-P 23d7f8ad64 [feature-237] remove unused import 2023-08-28 00:29:56 +02:00
MathieuG-P 3edb3f583b [feature-237] use ArcViewer 2023-08-28 00:25:43 +02:00
MathieuG-P 71a2a01aca [chore] update electron 2023-08-27 23:33:42 +02:00
MathieuG-P e3468fac0a Merge pull request #311 from Zagrios/bugfix/song-not-goes-in-custom-symlink/310
[bugfix] one click install contents not goes in custom symlinks
2023-08-27 20:54:13 +02:00
MathieuG-P 8d2075012b [bugfix] one click install contents not goes in custom symlinks 2023-08-27 20:39:21 +02:00
MathieuG-P f3ed2a8477 Merge pull request #309 from GabiRP/master
Better spanish translations
2023-08-17 13:07:42 +02:00
GabiRP 5355f84bc6 better spanish translations 2023-08-16 21:11:26 +02:00
MathieuG-P 6758e5937e Merge pull request #308 from Zagrios/chore/no-need-to-delete-cetrificateSha1-in-packagejson-to-test-a-build
[chore] no need to delete "certificateSha1" in package.json to run "npm run package" when don't have certificate
2023-08-14 19:04:18 +02:00
MathieuG-P de2d38bd45 [chore] no need to delete "certificateSha1" in package.json to run "npm run package" when don't have certificate 2023-08-14 19:00:54 +02:00
MathieuG-P 7b8c98e809 Merge pull request #307 from Zagrios/bugfix/installing-version-disappear-on-uninstall-another/304
[bugfix] On uninstalling a version, downloading version disappears
2023-08-14 16:21:05 +02:00
MathieuG-P bda7c6719a Merge pull request #303 from slinkstr/chore/registered-typo
typo: isDeepLinkRegistred -> isDeepLinkRegistered
2023-08-14 16:07:27 +02:00
MathieuG-P 254047e99e remove useless import 2023-08-14 16:03:42 +02:00
MathieuG-P 578f2ec335 [bugfix] On uninstalling a version, downloading version disappears 2023-08-14 16:00:05 +02:00
MathieuG-P 8cc5449818 Merge pull request #305 from Zagrios/chore/update-packages
Chore/update packages
2023-08-13 20:42:19 +02:00
MathieuG-P 323e666d5a [chore] update semver 2023-08-13 20:40:00 +02:00
MathieuG-P cbe6cb06c0 [chore] update framer-motion 2023-08-13 20:33:48 +02:00
MathieuG-P 3e36321ba5 [chore] update dot-prop 2023-08-13 20:30:27 +02:00
MathieuG-P c9677b1224 [chore] update electron 2023-08-13 20:26:58 +02:00
MathieuG-P e6387b45c5 Add patreon 2023-08-12 12:37:24 +02:00
slinky 8b4a5f15e7 typo: isDeepLinkRegistred -> isDeepLinkRegistered 2023-08-11 20:04:46 -07:00
122 changed files with 6184 additions and 2110 deletions
+5
View File
@@ -0,0 +1,5 @@
const { fuseElectron } = require("./fuse-electron")
exports.afterPack = async function afterPack(context) {
await fuseElectron(context);
}
+36
View File
@@ -0,0 +1,36 @@
/// const { AfterPackContext } = require("electron-builder");
const { flipFuses, FuseVersion, FuseV1Options } = require('@electron/fuses');
const path = require("path");
exports.fuseElectron = async function fuseElectron({
appOutDir,
packager,
electronPlatformName,
}){
const { productFilename } = packager.appInfo;
const target = (() => {
switch (electronPlatformName) {
case "darwin":
return `${productFilename}.app`;
case "win32":
return `${productFilename}.exe`;
case "linux":
// Sadly, `LinuxPackager` type is not exported by electron-builder so we have to improvise
return packager.executableName;
default:
throw new Error(`Unsupported platform: ${electronPlatformName}`);
}
})();
const electron = path.join(appOutDir, target);
console.log(`Fusing electron at ${electron}`);
return flipFuses(electron, {
version: FuseVersion.V1,
[FuseV1Options.EnableCookieEncryption]: true,
});
}
+99 -1
View File
@@ -2,6 +2,7 @@
{ {
"BSVersion": "0.10.1", "BSVersion": "0.10.1",
"BSManifest": "6316038906315325420", "BSManifest": "6316038906315325420",
"OculusBinaryId": "1392433784189730",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1662268711472777795", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1662268711472777795",
"ReleaseImg": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/32055887/a6d2b9ce074e71458499defdb5ef83bc4b9b56bb.png", "ReleaseImg": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/32055887/a6d2b9ce074e71458499defdb5ef83bc4b9b56bb.png",
"ReleaseDate": "1525201860", "ReleaseDate": "1525201860",
@@ -10,6 +11,7 @@
{ {
"BSVersion": "0.10.2", "BSVersion": "0.10.2",
"BSManifest": "2542095265882143144", "BSManifest": "2542095265882143144",
"OculusBinaryId": "1401326316633810",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3199123443061240805", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3199123443061240805",
"ReleaseDate": "1526065860", "ReleaseDate": "1526065860",
"year": "2018" "year": "2018"
@@ -17,6 +19,7 @@
{ {
"BSVersion": "0.10.2p1", "BSVersion": "0.10.2p1",
"BSManifest": "5611588554149133260", "BSManifest": "5611588554149133260",
"OculusBinaryId": "1408948315871610",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1660018815112331498", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1660018815112331498",
"ReleaseDate": "1526843460", "ReleaseDate": "1526843460",
"year": "2018" "year": "2018"
@@ -30,6 +33,7 @@
{ {
"BSVersion": "0.11.0", "BSVersion": "0.11.0",
"BSManifest": "8700049030626148111", "BSManifest": "8700049030626148111",
"OculusBinaryId": "1480180522081722",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1675787121569907303", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1675787121569907303",
"ReleaseDate": "1532027460", "ReleaseDate": "1532027460",
"year": "2018" "year": "2018"
@@ -37,6 +41,7 @@
{ {
"BSVersion": "0.11.1", "BSVersion": "0.11.1",
"BSManifest": "6574193224879562324", "BSManifest": "6574193224879562324",
"OculusBinaryId": "1481807568585684",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1675787121577641471", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1675787121577641471",
"ReleaseDate": "1532113860", "ReleaseDate": "1532113860",
"year": "2018" "year": "2018"
@@ -44,6 +49,7 @@
{ {
"BSVersion": "0.11.2", "BSVersion": "0.11.2",
"BSManifest": "2707973953401625222", "BSManifest": "2707973953401625222",
"OculusBinaryId": "1529600877139686",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1700559455389069835", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1700559455389069835",
"ReleaseDate": "1534792260", "ReleaseDate": "1534792260",
"year": "2018" "year": "2018"
@@ -51,6 +57,7 @@
{ {
"BSVersion": "0.12.0", "BSVersion": "0.12.0",
"BSManifest": "6094599000655593822", "BSManifest": "6094599000655593822",
"OculusBinaryId": "1645858012180638",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1708449632708343984", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1708449632708343984",
"ReleaseDate": "1543349460", "ReleaseDate": "1543349460",
"year": "2018" "year": "2018"
@@ -58,6 +65,7 @@
{ {
"BSVersion": "0.12.0p1", "BSVersion": "0.12.0p1",
"BSManifest": "2068421223689664394", "BSManifest": "2068421223689664394",
"OculusBinaryId": "1648187958614310",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1708450266986928520", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1708450266986928520",
"ReleaseDate": "1543435860", "ReleaseDate": "1543435860",
"year": "2018" "year": "2018"
@@ -65,6 +73,7 @@
{ {
"BSVersion": "0.12.1", "BSVersion": "0.12.1",
"BSManifest": "2472041066434647526", "BSManifest": "2472041066434647526",
"OculusBinaryId": "1668279893271783",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3142848113551335636", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3142848113551335636",
"ReleaseImg": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/32055887/9b4b1890f39a682c6f4a06f12a56965b7aee0b6c.jpg", "ReleaseImg": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/32055887/9b4b1890f39a682c6f4a06f12a56965b7aee0b6c.jpg",
"ReleaseDate": "1544818260", "ReleaseDate": "1544818260",
@@ -73,6 +82,7 @@
{ {
"BSVersion": "0.12.2", "BSVersion": "0.12.2",
"BSManifest": "5325635033564462932", "BSManifest": "5325635033564462932",
"OculusBinaryId": "1676445885788517",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1708452169977638962", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1708452169977638962",
"ReleaseImg": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/32055887/82e2ce43df0e59337a79341c54ac2e5e12a5e7bc.jpg", "ReleaseImg": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/32055887/82e2ce43df0e59337a79341c54ac2e5e12a5e7bc.jpg",
"ReleaseDate": "1545423060", "ReleaseDate": "1545423060",
@@ -81,6 +91,7 @@
{ {
"BSVersion": "0.13.0", "BSVersion": "0.13.0",
"BSManifest": "3102409495238838111", "BSManifest": "3102409495238838111",
"OculusBinaryId": "1796264627139975",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1809790777736470809", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1809790777736470809",
"ReleaseImg": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/32055887/8f2128973e6d221b4f00aedb5194417eadad9920.jpg", "ReleaseImg": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/32055887/8f2128973e6d221b4f00aedb5194417eadad9920.jpg",
"ReleaseDate": "1552594260", "ReleaseDate": "1552594260",
@@ -96,6 +107,7 @@
{ {
"BSVersion": "0.13.1", "BSVersion": "0.13.1",
"BSManifest": "6033025349617217666", "BSManifest": "6033025349617217666",
"OculusBinaryId": "1823415097758261",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1735482645687974657", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1735482645687974657",
"ReleaseDate": "1554145860", "ReleaseDate": "1554145860",
"year": "2019" "year": "2019"
@@ -103,6 +115,7 @@
{ {
"BSVersion": "0.13.2", "BSVersion": "0.13.2",
"BSManifest": "6839388023573913446", "BSManifest": "6839388023573913446",
"OculusBinaryId": "1827595530673551",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1779393376014546213", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1779393376014546213",
"ReleaseDate": "1554405060", "ReleaseDate": "1554405060",
"year": "2019" "year": "2019"
@@ -110,6 +123,7 @@
{ {
"BSVersion": "1.0.0", "BSVersion": "1.0.0",
"BSManifest": "152937782137361764", "BSManifest": "152937782137361764",
"OculusBinaryId": "1901720436594393",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/2655347409592352590", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/2655347409592352590",
"ReleaseImg": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/32055887/023ab2b6a2f811e2beea327ae3875da643101694.jpg", "ReleaseImg": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/32055887/023ab2b6a2f811e2beea327ae3875da643101694.jpg",
"ReleaseDate": "1558465860", "ReleaseDate": "1558465860",
@@ -118,6 +132,7 @@
{ {
"BSVersion": "1.0.1", "BSVersion": "1.0.1",
"BSManifest": "7950322551526208347", "BSManifest": "7950322551526208347",
"OculusBinaryId": "1910612422371861",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1617268229025488499", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1617268229025488499",
"ReleaseDate": "1558984260", "ReleaseDate": "1558984260",
"year": "2019" "year": "2019"
@@ -125,6 +140,7 @@
{ {
"BSVersion": "1.1.0", "BSVersion": "1.1.0",
"BSManifest": "1400454104881094752", "BSManifest": "1400454104881094752",
"OculusBinaryId": "1929327700500333",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1606010497768610092", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1606010497768610092",
"ReleaseDate": "1560193860", "ReleaseDate": "1560193860",
"year": "2019" "year": "2019"
@@ -139,6 +155,7 @@
{ {
"BSVersion": "1.2.0", "BSVersion": "1.2.0",
"BSManifest": "3820905673516362176", "BSManifest": "3820905673516362176",
"OculusBinaryId": "2007606406005795",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3266717385279679846", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3266717385279679846",
"ReleaseImg": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/32055887/cd96e7e784bb8761ba8e8609285baa5e1aec0d85.jpg", "ReleaseImg": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/32055887/cd96e7e784bb8761ba8e8609285baa5e1aec0d85.jpg",
"ReleaseDate": "1564081860", "ReleaseDate": "1564081860",
@@ -147,6 +164,7 @@
{ {
"BSVersion": "1.3.0", "BSVersion": "1.3.0",
"BSManifest": "2440312204809283162", "BSManifest": "2440312204809283162",
"OculusBinaryId": "2063391663760602",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1602640407719691235", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1602640407719691235",
"ReleaseImg": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/32055887/7aec534fb70fafa582addd6cd52998ccc31adf57.jpg", "ReleaseImg": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/32055887/7aec534fb70fafa582addd6cd52998ccc31adf57.jpg",
"ReleaseDate": "1567105860", "ReleaseDate": "1567105860",
@@ -155,6 +173,7 @@
{ {
"BSVersion": "1.4.0", "BSVersion": "1.4.0",
"BSManifest": "3532596684905902618", "BSManifest": "3532596684905902618",
"OculusBinaryId": "2126093504157084",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1595888090489865366", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1595888090489865366",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/2998e47ebbc57552718bb95e233a3a43d598630f.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/2998e47ebbc57552718bb95e233a3a43d598630f.png",
"ReleaseDate": "1567105860", "ReleaseDate": "1567105860",
@@ -163,6 +182,7 @@
{ {
"BSVersion": "1.4.2", "BSVersion": "1.4.2",
"BSManifest": "1199049250928380207", "BSManifest": "1199049250928380207",
"OculusBinaryId": "2136904763075958",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3172148783714663931", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3172148783714663931",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/b35d93fe817cea38c92c266579395c1fcd275af2.jpg", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/b35d93fe817cea38c92c266579395c1fcd275af2.jpg",
"ReleaseDate": "1570821060", "ReleaseDate": "1570821060",
@@ -171,6 +191,7 @@
{ {
"BSVersion": "1.5.0", "BSVersion": "1.5.0",
"BSManifest": "2831333980042022356", "BSManifest": "2831333980042022356",
"OculusBinaryId": "2179706668795767",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1604898551795379829", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1604898551795379829",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/56dbb4a14b764ccea1de93625225b83de1636aee_400x225.jpg", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/56dbb4a14b764ccea1de93625225b83de1636aee_400x225.jpg",
"ReleaseDate": "1573157460", "ReleaseDate": "1573157460",
@@ -179,6 +200,7 @@
{ {
"BSVersion": "1.6.0", "BSVersion": "1.6.0",
"BSManifest": "1869974316274529288", "BSManifest": "1869974316274529288",
"OculusBinaryId": "2264419510324482",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3462636667924814182", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3462636667924814182",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/99a5ad752c76859e8697d75a140500195969fb2d.jpg", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/99a5ad752c76859e8697d75a140500195969fb2d.jpg",
"ReleaseDate": "1576267860", "ReleaseDate": "1576267860",
@@ -187,6 +209,7 @@
{ {
"BSVersion": "1.6.1", "BSVersion": "1.6.1",
"BSManifest": "6122319670026856947", "BSManifest": "6122319670026856947",
"OculusBinaryId": "2313973998702366",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1702855647517326143", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1702855647517326143",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/5e54a041cc52674f03a4d7c5406f2bb42d1f379b_400x225.jpg", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/5e54a041cc52674f03a4d7c5406f2bb42d1f379b_400x225.jpg",
"ReleaseDate": "1578427860", "ReleaseDate": "1578427860",
@@ -195,6 +218,7 @@
{ {
"BSVersion": "1.6.2", "BSVersion": "1.6.2",
"BSManifest": "4932559146183937357", "BSManifest": "4932559146183937357",
"OculusBinaryId": "2319779251455174",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1702857555888635029", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1702857555888635029",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/5e54a041cc52674f03a4d7c5406f2bb42d1f379b_400x225.jpg", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/5e54a041cc52674f03a4d7c5406f2bb42d1f379b_400x225.jpg",
"ReleaseDate": "1578600660", "ReleaseDate": "1578600660",
@@ -203,6 +227,7 @@
{ {
"BSVersion": "1.7.0", "BSVersion": "1.7.0",
"BSManifest": "3516084911940449222", "BSManifest": "3516084911940449222",
"OculusBinaryId": "2355681587864940",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1708488968117071534", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/1708488968117071534",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/ddf8c11e64231bf86ff18f5bb7d81f7dec7bc655_400x225.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/ddf8c11e64231bf86ff18f5bb7d81f7dec7bc655_400x225.png",
"ReleaseDate": "1580328660", "ReleaseDate": "1580328660",
@@ -211,6 +236,7 @@
{ {
"BSVersion": "1.8.0", "BSVersion": "1.8.0",
"BSManifest": "3177969677109016846", "BSManifest": "3177969677109016846",
"OculusBinaryId": "2483396065093491",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/2080040995048021450", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/2080040995048021450",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/ef301c5813a7f029156da357a997f17f80564a17_400x225.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/ef301c5813a7f029156da357a997f17f80564a17_400x225.png",
"ReleaseDate": "1585253460", "ReleaseDate": "1585253460",
@@ -219,6 +245,7 @@
{ {
"BSVersion": "1.9.0", "BSVersion": "1.9.0",
"BSManifest": "7885463693258878294", "BSManifest": "7885463693258878294",
"OculusBinaryId": "2509250149174749",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/2194884053816491058", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/2194884053816491058",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/8b365e3fdd9e8494987ea92543114404f20db891.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/8b365e3fdd9e8494987ea92543114404f20db891.png",
"ReleaseDate": "1586459460", "ReleaseDate": "1586459460",
@@ -227,6 +254,7 @@
{ {
"BSVersion": "1.9.1", "BSVersion": "1.9.1",
"BSManifest": "6222769774084748916", "BSManifest": "6222769774084748916",
"OculusBinaryId": "2555492557883841",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/2196011856188103369", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/2196011856188103369",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/144427845aef04dbe4aa9dee62818f2d637e1f42_400x225.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/144427845aef04dbe4aa9dee62818f2d637e1f42_400x225.png",
"ReleaseDate": "1588705860", "ReleaseDate": "1588705860",
@@ -235,6 +263,7 @@
{ {
"BSVersion": "1.10.0", "BSVersion": "1.10.0",
"BSManifest": "6711131863503994755", "BSManifest": "6711131863503994755",
"OculusBinaryId": "2611337982299298",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/2179125258536373088", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/2179125258536373088",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/3a13e1c04c4f91a16c53fdb3a7662bcae60f48fa.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/3a13e1c04c4f91a16c53fdb3a7662bcae60f48fa.png",
"ReleaseDate": "1590433860", "ReleaseDate": "1590433860",
@@ -243,6 +272,7 @@
{ {
"BSVersion": "1.11.0", "BSVersion": "1.11.0",
"BSManifest": "1919603726987963829", "BSManifest": "1919603726987963829",
"OculusBinaryId": "2827873783979049",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3961432516746159538", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3961432516746159538",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/afba23a3fcc80b6d2c40d2acd9ab9a51be9d3eee.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/afba23a3fcc80b6d2c40d2acd9ab9a51be9d3eee.png",
"ReleaseDate": "1597691460", "ReleaseDate": "1597691460",
@@ -251,12 +281,14 @@
{ {
"BSVersion": "1.11.1", "BSVersion": "1.11.1",
"BSManifest": "3268824881806146387", "BSManifest": "3268824881806146387",
"OculusBinaryId": "2844730055626755",
"ReleaseDate": "1597950660", "ReleaseDate": "1597950660",
"year": "2020" "year": "2020"
}, },
{ {
"BSVersion": "1.12.1", "BSVersion": "1.12.1",
"BSManifest": "2928416283534881313", "BSManifest": "2928416283534881313",
"OculusBinaryId": "3002627316503694",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/2889580787311737971", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/2889580787311737971",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/cb8f24404f10a177e0ff60473f9293c8fb9b5496.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/cb8f24404f10a177e0ff60473f9293c8fb9b5496.png",
"ReleaseDate": "1602616260", "ReleaseDate": "1602616260",
@@ -265,6 +297,7 @@
{ {
"BSVersion": "1.12.2", "BSVersion": "1.12.2",
"BSManifest": "543439039654962432", "BSManifest": "543439039654962432",
"OculusBinaryId": "3027756187324140",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/5096345334644252275", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/5096345334644252275",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/56d1d6b2a2687530a5db221241cc4d7e4feefb4d.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/56d1d6b2a2687530a5db221241cc4d7e4feefb4d.png",
"ReleaseDate": "1603134660", "ReleaseDate": "1603134660",
@@ -273,6 +306,7 @@
{ {
"BSVersion": "1.13.0", "BSVersion": "1.13.0",
"BSManifest": "4635119747389290346", "BSManifest": "4635119747389290346",
"OculusBinaryId": "3087480618018363",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/2903094755791760339", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/2903094755791760339",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/4ae946eda7c0bc9421c2afb7b33e965103924cb9.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/4ae946eda7c0bc9421c2afb7b33e965103924cb9.png",
"ReleaseDate": "1605211860", "ReleaseDate": "1605211860",
@@ -281,6 +315,7 @@
{ {
"BSVersion": "1.13.2", "BSVersion": "1.13.2",
"BSManifest": "8571679771389514488", "BSManifest": "8571679771389514488",
"OculusBinaryId": "3259559474143809",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3025824186763919109", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3025824186763919109",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/70f13d02f95c7fadae92305474ae16ce1b99162e.jpg", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/70f13d02f95c7fadae92305474ae16ce1b99162e.jpg",
"ReleaseDate": "1611259860", "ReleaseDate": "1611259860",
@@ -289,6 +324,7 @@
{ {
"BSVersion": "1.13.4", "BSVersion": "1.13.4",
"BSManifest": "1257277263145069282", "BSManifest": "1257277263145069282",
"OculusBinaryId": "3377183652381390",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3020198491530803202", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3020198491530803202",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/78643cb3c68591da1e69550300a6452390c3e797.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/78643cb3c68591da1e69550300a6452390c3e797.png",
"ReleaseDate": "1615320660", "ReleaseDate": "1615320660",
@@ -297,6 +333,7 @@
{ {
"BSVersion": "1.13.5", "BSVersion": "1.13.5",
"BSManifest": "7007516983116400336", "BSManifest": "7007516983116400336",
"OculusBinaryId": "3391815807584841",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3021325027071201045", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3021325027071201045",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/2611baaea1f0e49be4f611fed4a3cb5d155c8eb5.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/2611baaea1f0e49be4f611fed4a3cb5d155c8eb5.png",
"ReleaseDate": "1615579860", "ReleaseDate": "1615579860",
@@ -305,6 +342,7 @@
{ {
"BSVersion": "1.14.0", "BSVersion": "1.14.0",
"BSManifest": "9218225910501819399", "BSManifest": "9218225910501819399",
"OculusBinaryId": "3405570192876069",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3012318462417082617", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3012318462417082617",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/51750f9885b9fe51df5820ba0e7f36c9b2154d22.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/51750f9885b9fe51df5820ba0e7f36c9b2154d22.png",
"ReleaseDate": "1616098260", "ReleaseDate": "1616098260",
@@ -313,6 +351,7 @@
{ {
"BSVersion": "1.15.0", "BSVersion": "1.15.0",
"BSManifest": "7624554893344753887", "BSManifest": "7624554893344753887",
"OculusBinaryId": "3512427425523678",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3041595663499101523", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3041595663499101523",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/e8de2954a115e1961bdbfa3abab546d43dd653a4.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/e8de2954a115e1961bdbfa3abab546d43dd653a4.png",
"ReleaseDate": "1619723460", "ReleaseDate": "1619723460",
@@ -321,6 +360,7 @@
{ {
"BSVersion": "1.16.0", "BSVersion": "1.16.0",
"BSManifest": "3667184295685865706", "BSManifest": "3667184295685865706",
"OculusBinaryId": "3602735303159556",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3001065803744427929", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3001065803744427929",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/0ad20c1cf3d4e78aa8f28fd136f89f3683df2fb6.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/0ad20c1cf3d4e78aa8f28fd136f89f3683df2fb6.png",
"ReleaseDate": "1622142660", "ReleaseDate": "1622142660",
@@ -329,6 +369,7 @@
{ {
"BSVersion": "1.16.1", "BSVersion": "1.16.1",
"BSManifest": "9201874499606445062", "BSManifest": "9201874499606445062",
"OculusBinaryId": "3608513445915075",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3001065803748822093", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3001065803748822093",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/522ca68fe0c4576f57189afdbb8107226cdcc819.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/522ca68fe0c4576f57189afdbb8107226cdcc819.png",
"ReleaseDate": "1622229060", "ReleaseDate": "1622229060",
@@ -337,6 +378,7 @@
{ {
"BSVersion": "1.16.2", "BSVersion": "1.16.2",
"BSManifest": "3692829915208062825", "BSManifest": "3692829915208062825",
"OculusBinaryId": "3631747100258376",
"ReleaseURL": "http://steamcommunity.com/games/620980/announcements/detail/3024710972645830369", "ReleaseURL": "http://steamcommunity.com/games/620980/announcements/detail/3024710972645830369",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/7e81895079a84f1b85ddcee330aec7e5626fd2c6.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/7e81895079a84f1b85ddcee330aec7e5626fd2c6.png",
"ReleaseDate": "1623352260", "ReleaseDate": "1623352260",
@@ -345,6 +387,7 @@
{ {
"BSVersion": "1.16.3", "BSVersion": "1.16.3",
"BSManifest": "6392596175313869009", "BSManifest": "6392596175313869009",
"OculusBinaryId": "3737896816310070",
"ReleaseURL": "http://steamcommunity.com/games/620980/announcements/detail/5293402556388135977", "ReleaseURL": "http://steamcommunity.com/games/620980/announcements/detail/5293402556388135977",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/34340f96abfa0203931ca312302ee0c19dc336c2.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/34340f96abfa0203931ca312302ee0c19dc336c2.png",
"ReleaseDate": "1626808260", "ReleaseDate": "1626808260",
@@ -353,6 +396,7 @@
{ {
"BSVersion": "1.16.4", "BSVersion": "1.16.4",
"BSManifest": "8820433629543698585", "BSManifest": "8820433629543698585",
"OculusBinaryId": "3759730617460023",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/2965042081090310028", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/2965042081090310028",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/22b48a8e92eed7c4e471692124724a2f3ebc3f18.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/22b48a8e92eed7c4e471692124724a2f3ebc3f18.png",
"ReleaseDate": "1627326660", "ReleaseDate": "1627326660",
@@ -361,6 +405,7 @@
{ {
"BSVersion": "1.17.0", "BSVersion": "1.17.0",
"BSManifest": "7826684224434229804", "BSManifest": "7826684224434229804",
"OculusBinaryId": "3858475637585520",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/2945905042782366475", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/2945905042782366475",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/a789a030122442308376887039c244222b92c768.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/a789a030122442308376887039c244222b92c768.png",
"ReleaseDate": "1630437060", "ReleaseDate": "1630437060",
@@ -369,6 +414,7 @@
{ {
"BSVersion": "1.17.1", "BSVersion": "1.17.1",
"BSManifest": "4668547658954826996", "BSManifest": "4668547658954826996",
"OculusBinaryId": "3894496013983482",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/2947032120578243378", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/2947032120578243378",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/51561161026afcf3482bcbe2ea62a6d56e03a8d0.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/51561161026afcf3482bcbe2ea62a6d56e03a8d0.png",
"ReleaseDate": "1631214660", "ReleaseDate": "1631214660",
@@ -377,6 +423,7 @@
{ {
"BSVersion": "1.18.0", "BSVersion": "1.18.0",
"BSManifest": "5599254819160454367", "BSManifest": "5599254819160454367",
"OculusBinaryId": "3926417640791319",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/5570379635768010184", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/5570379635768010184",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/89a693714b3ee32d84d05bf62caca6f651a1dbec.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/89a693714b3ee32d84d05bf62caca6f651a1dbec.png",
"ReleaseDate": "1632251460", "ReleaseDate": "1632251460",
@@ -385,6 +432,7 @@
{ {
"BSVersion": "1.18.1", "BSVersion": "1.18.1",
"BSManifest": "8961661233382948062", "BSManifest": "8961661233382948062",
"OculusBinaryId": "3968051796627903",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/2994322456166449763", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/2994322456166449763",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/a3a4511beadf811a56742fc234724ad14ab34749.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/a3a4511beadf811a56742fc234724ad14ab34749.png",
"ReleaseDate": "1633547460", "ReleaseDate": "1633547460",
@@ -393,6 +441,7 @@
{ {
"BSVersion": "1.18.2", "BSVersion": "1.18.2",
"BSManifest": "6835596583028648427", "BSManifest": "6835596583028648427",
"OculusBinaryId": "4024867594279656",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3026974832179662032", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3026974832179662032",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/71994e941f3d2a8fbbe335fc717c136b5dc9f823.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/71994e941f3d2a8fbbe335fc717c136b5dc9f823.png",
"ReleaseDate": "1635189060", "ReleaseDate": "1635189060",
@@ -401,6 +450,7 @@
{ {
"BSVersion": "1.18.3", "BSVersion": "1.18.3",
"BSManifest": "6558821762131072991", "BSManifest": "6558821762131072991",
"OculusBinaryId": "4042806399152442",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3067508483705433949", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3067508483705433949",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/7d79335af5e8ca560198e6a850e339bd7b430d9f.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/7d79335af5e8ca560198e6a850e339bd7b430d9f.png",
"ReleaseDate": "1636056660", "ReleaseDate": "1636056660",
@@ -409,6 +459,7 @@
{ {
"BSVersion": "1.19.0", "BSVersion": "1.19.0",
"BSManifest": "8948172000430595334", "BSManifest": "8948172000430595334",
"OculusBinaryId": "4132873813479033",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3105792342251200877", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3105792342251200877",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/537cf297a6f90b8bbe7baae92b6885f8fbf98d8c.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/537cf297a6f90b8bbe7baae92b6885f8fbf98d8c.png",
"ReleaseDate": "1639167060", "ReleaseDate": "1639167060",
@@ -417,6 +468,7 @@
{ {
"BSVersion": "1.19.1", "BSVersion": "1.19.1",
"BSManifest": "1175216641760077721", "BSManifest": "1175216641760077721",
"OculusBinaryId": "4409301142502964",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/5771929045825669047", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/5771929045825669047",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/908d3ebdf273ca6573c3c95898be22ff052ea014.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/908d3ebdf273ca6573c3c95898be22ff052ea014.png",
"ReleaseDate": "1644869460", "ReleaseDate": "1644869460",
@@ -425,6 +477,7 @@
{ {
"BSVersion": "1.20.0", "BSVersion": "1.20.0",
"BSManifest": "4202491068770948196", "BSManifest": "4202491068770948196",
"OculusBinaryId": "4473099549456456",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3096792662638975765", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3096792662638975765",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/8dfcc668bc78674d7c1d010cee2a8153e0c0c2aa.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/8dfcc668bc78674d7c1d010cee2a8153e0c0c2aa.png",
"ReleaseDate": "1646770260", "ReleaseDate": "1646770260",
@@ -433,6 +486,7 @@
{ {
"BSVersion": "1.21.0", "BSVersion": "1.21.0",
"BSManifest": "3648558848715327622", "BSManifest": "3648558848715327622",
"OculusBinaryId": "4527595284006882",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3180111792066790947", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3180111792066790947",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/d854a4cc83b282acc191227a7759b4f5e6c6b085.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/d854a4cc83b282acc191227a7759b4f5e6c6b085.png",
"ReleaseDate": "1648753860", "ReleaseDate": "1648753860",
@@ -441,6 +495,7 @@
{ {
"BSVersion": "1.22.0", "BSVersion": "1.22.0",
"BSManifest": "4038188869828689801", "BSManifest": "4038188869828689801",
"OculusBinaryId": "4634406099992466",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3181240878804806326", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3181240878804806326",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/8486ec6eb3b6e28eaac59d414dd20bd18eed36d8.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/8486ec6eb3b6e28eaac59d414dd20bd18eed36d8.png",
"ReleaseDate": "1651777860", "ReleaseDate": "1651777860",
@@ -449,6 +504,7 @@
{ {
"BSVersion": "1.22.1", "BSVersion": "1.22.1",
"BSManifest": "3771211058784167267", "BSManifest": "3771211058784167267",
"OculusBinaryId": "4660898857343190",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3185745740381652029", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3185745740381652029",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/bc9fea661f7f18616b6b2feb267cc3af0ea679c5.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/bc9fea661f7f18616b6b2feb267cc3af0ea679c5.png",
"ReleaseDate": "1652987460", "ReleaseDate": "1652987460",
@@ -457,6 +513,7 @@
{ {
"BSVersion": "1.23.0", "BSVersion": "1.23.0",
"BSManifest": "8051970117665729770", "BSManifest": "8051970117665729770",
"OculusBinaryId": "4681198518646557",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3346751320551809488", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3346751320551809488",
"ReleaseImg": "https://cdn.cloudflare.steamstatic.com/steamcommunity/public/images/clans//32055887/1623b6e0b864fdad8be08275c3bb126868eafe9b.png", "ReleaseImg": "https://cdn.cloudflare.steamstatic.com/steamcommunity/public/images/clans//32055887/1623b6e0b864fdad8be08275c3bb126868eafe9b.png",
"ReleaseDate": "1655218980", "ReleaseDate": "1655218980",
@@ -465,6 +522,7 @@
{ {
"BSVersion": "1.24.0", "BSVersion": "1.24.0",
"BSManifest": "649695825989344999", "BSManifest": "649695825989344999",
"OculusBinaryId": "4793158617450546",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/4719226562388423388", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/4719226562388423388",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans//32055887/82c29d674bc57596102a6b815f66e956f217e658.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans//32055887/82c29d674bc57596102a6b815f66e956f217e658.png",
"ReleaseDate": "1657810920", "ReleaseDate": "1657810920",
@@ -473,6 +531,7 @@
{ {
"BSVersion": "1.24.1", "BSVersion": "1.24.1",
"BSManifest": "3141359577983993890", "BSManifest": "3141359577983993890",
"OculusBinaryId": "4962706317162441",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/4719226562388423388", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/4719226562388423388",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans//32055887/82c29d674bc57596102a6b815f66e956f217e658.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans//32055887/82c29d674bc57596102a6b815f66e956f217e658.png",
"ReleaseDate": "1661864214", "ReleaseDate": "1661864214",
@@ -481,6 +540,7 @@
{ {
"BSVersion": "1.25.0", "BSVersion": "1.25.0",
"BSManifest": "4529582051007915041", "BSManifest": "4529582051007915041",
"OculusBinaryId": "4996170620482677",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3312985013538143172", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3312985013538143172",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans//32055887/54ac649877eca25a2a6449662337e2c63c51bbcf.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans//32055887/54ac649877eca25a2a6449662337e2c63c51bbcf.png",
"ReleaseDate": "1665068529", "ReleaseDate": "1665068529",
@@ -489,6 +549,7 @@
{ {
"BSVersion": "1.25.1", "BSVersion": "1.25.1",
"BSManifest": "7372469314660649150", "BSManifest": "7372469314660649150",
"OculusBinaryId": "5074476459318759",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/5346361068670142187", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/5346361068670142187",
"ReleaseImg": "https://cdn.cloudflare.steamstatic.com/steamcommunity/public/images/clans//32055887/52cbd15b5e226f509e051565f6e4935eb0e44e2c.png", "ReleaseImg": "https://cdn.cloudflare.steamstatic.com/steamcommunity/public/images/clans//32055887/52cbd15b5e226f509e051565f6e4935eb0e44e2c.png",
"ReleaseDate": "1665673269", "ReleaseDate": "1665673269",
@@ -497,6 +558,7 @@
{ {
"BSVersion": "1.26.0", "BSVersion": "1.26.0",
"BSManifest": "3634450655207470002", "BSManifest": "3634450655207470002",
"OculusBinaryId": "5116093325157072",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3414318646334948892", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3414318646334948892",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans//32055887/d18ad9d7f45a5cc2a467d75f0bdf9d32b9141b14.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans//32055887/d18ad9d7f45a5cc2a467d75f0bdf9d32b9141b14.png",
"ReleaseDate": "1667923560", "ReleaseDate": "1667923560",
@@ -505,6 +567,7 @@
{ {
"BSVersion": "1.27.0", "BSVersion": "1.27.0",
"BSManifest": "3485516174915301618", "BSManifest": "3485516174915301618",
"OculusBinaryId": "5232077970225273",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3629368753553708497", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3629368753553708497",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans//32055887/d9ed8771498be7fc83721aaaaa5b15a08fbeadb1.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans//32055887/d9ed8771498be7fc83721aaaaa5b15a08fbeadb1.png",
"ReleaseDate": "1670943003", "ReleaseDate": "1670943003",
@@ -513,6 +576,7 @@
{ {
"BSVersion": "1.28.0", "BSVersion": "1.28.0",
"BSManifest": "7463243155526905423", "BSManifest": "7463243155526905423",
"OculusBinaryId": "5425534454212956",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3666530358620442392", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3666530358620442392",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans//32055887/8f978bbf292810004bca12523e76be8a7eec8c4e.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans//32055887/8f978bbf292810004bca12523e76be8a7eec8c4e.png",
"ReleaseDate": "1677593822", "ReleaseDate": "1677593822",
@@ -521,6 +585,7 @@
{ {
"BSVersion": "1.29.0", "BSVersion": "1.29.0",
"BSManifest": "3341527958186345367", "BSManifest": "3341527958186345367",
"OculusBinaryId": "5550538398379227",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/6169409105082976092", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/6169409105082976092",
"ReleaseImg": "https://cdn.cloudflare.steamstatic.com/steamcommunity/public/images/clans//32055887/255fd49cd96042b97089f754609be291293e783f.png", "ReleaseImg": "https://cdn.cloudflare.steamstatic.com/steamcommunity/public/images/clans//32055887/255fd49cd96042b97089f754609be291293e783f.png",
"ReleaseDate": "1680188760", "ReleaseDate": "1680188760",
@@ -529,14 +594,17 @@
{ {
"BSVersion": "1.29.1", "BSVersion": "1.29.1",
"BSManifest": "886973241045584398", "BSManifest": "886973241045584398",
"OculusBinaryId": "5581819385251128",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/6169409105101272202", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/6169409105101272202",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/c328e407367e9914abaf92f609501877ee5abb63.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/c328e407367e9914abaf92f609501877ee5abb63.png",
"ReleaseDate": "1680623885", "ReleaseDate": "1680623885",
"year": "2023" "year": "2023",
"recommended": true
}, },
{ {
"BSVersion": "1.29.4", "BSVersion": "1.29.4",
"BSManifest": "6291266771922375922", "BSManifest": "6291266771922375922",
"OculusBinaryId": "5659705544129178",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3708194993422325380", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3708194993422325380",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/9c3d476c03e4a2ac72ca5df016b7c94d242b41cb.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/9c3d476c03e4a2ac72ca5df016b7c94d242b41cb.png",
"ReleaseDate": "1683644991", "ReleaseDate": "1683644991",
@@ -545,6 +613,7 @@
{ {
"BSVersion": "1.30.0", "BSVersion": "1.30.0",
"BSManifest": "7304715857122259127", "BSManifest": "7304715857122259127",
"OculusBinaryId": "5699848430114889",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3725085394628677636", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3725085394628677636",
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/cd56688ad716b544af14a61b2fbace9088478887.png", "ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/cd56688ad716b544af14a61b2fbace9088478887.png",
"ReleaseDate": "1684965390", "ReleaseDate": "1684965390",
@@ -553,6 +622,7 @@
{ {
"BSVersion": "1.30.2", "BSVersion": "1.30.2",
"BSManifest": "8042804988990059618", "BSManifest": "8042804988990059618",
"OculusBinaryId": "5770096269756771",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3655280868312846230", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3655280868312846230",
"ReleaseImg": "https://clan.akamai.steamstatic.com/images/32055887/6d78e092c54f411b36f2c0577d62eb1b25f91aa3.png", "ReleaseImg": "https://clan.akamai.steamstatic.com/images/32055887/6d78e092c54f411b36f2c0577d62eb1b25f91aa3.png",
"ReleaseDate": "1686668364", "ReleaseDate": "1686668364",
@@ -561,9 +631,37 @@
{ {
"BSVersion": "1.31.0", "BSVersion": "1.31.0",
"BSManifest": "676582354127623831", "BSManifest": "676582354127623831",
"OculusBinaryId": "5824747874291610",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3674423070127121445", "ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3674423070127121445",
"ReleaseImg": "https://clan.cloudflare.steamstatic.com/images/32055887/28993aecc56a75c52295fa07620f58cb0e4b09e8.png", "ReleaseImg": "https://clan.cloudflare.steamstatic.com/images/32055887/28993aecc56a75c52295fa07620f58cb0e4b09e8.png",
"ReleaseDate": "1688050646", "ReleaseDate": "1688050646",
"year": "2023" "year": "2023"
},
{
"BSVersion": "1.31.1",
"BSManifest": "5239818041644201119",
"OculusBinaryId": "6044391715660557",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3664295677895178184",
"ReleaseImg": "https://clan.akamai.steamstatic.com/images/32055887/58621b3cb8bf42fcfbf3b97fe47aa91b290eea04.png",
"ReleaseDate": "1693824747",
"year": "2023"
},
{
"BSVersion": "1.32.0",
"BSManifest": "1660149393914874041",
"OculusBinaryId": "6168675063232221",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3723971545002767483",
"ReleaseImg": "https://clan.cloudflare.steamstatic.com/images/32055887/02284793f06188caf740da66939679afc25415e4.png",
"ReleaseDate": "1696517680",
"year": "2023"
},
{
"BSVersion": "1.33.0",
"BSManifest": "706865160400890715",
"OculusBinaryId": "6255299197903140",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3744239644488431243",
"ReleaseImg": "https://clan.akamai.steamstatic.com/images/32055887/cac079717d62489822af3a6e90679a570842f4ca.png",
"ReleaseDate": "1698678611",
"year": "2023"
} }
] ]
+7 -7
View File
@@ -6,14 +6,14 @@
{"username": "Naysy"}, {"username": "Naysy"},
{"username": "Falmil"}, {"username": "Falmil"},
{"username": "K1Lc4m"}, {"username": "K1Lc4m"},
{"username": "Adam"},
{"username": "Cabalia"},
{"username": "Anonymously42", "type": "diamond", "link": "https://www.twitch.tv/anonymously42tv"}, {"username": "Anonymously42", "type": "diamond", "link": "https://www.twitch.tv/anonymously42tv"},
{"username": "En4Yuz"}, {"username": "Burt", "type": "gold"},
{"username": "AndyIsHereBoi", "type": "gold"},
{"username": "grtroadrunner"},
{"username": "Ilnahro"}, {"username": "Ilnahro"},
{"username": "T3chLog"},
{"username": "Phil", "type": "gold"}, {"username": "Phil", "type": "gold"},
{"username": "Protocrush", "type": "gold"} {"username": "Protocrush", "type": "gold"},
{"username": "ServerMensch", "type": "gold"},
{"username": "Karlito", "type": "gold"},
{"username": "Cathery", "type": "gold"},
{"username": ".sharkey"},
{"username": "Z3t4"}
] ]
+130 -60
View File
@@ -98,22 +98,30 @@
"edit": "Bearbeiten", "edit": "Bearbeiten",
"uninstall": "Entfernen", "uninstall": "Entfernen",
"create-shortcut": "Verknüpfung erstellen", "create-shortcut": "Verknüpfung erstellen",
"shared-folders": "Geteilte Ordner" "shared-folders": "Geteilte Ordner",
"restore-oculus-folder": "Ordner wiederherstellen"
} }
}, },
"available-versions": { "available-versions": {
"title": "Wähle eine Version", "title": "Wähle eine Version",
"steam-release": "Versions Seite", "steam-release": "Versions Seite",
"dropdown": { "dropdown": {
"refresh": "Liste aktualisieren", "refresh": "Aktualisieren Sie die Versionen",
"import-version": "Importiere eine Version" "import-version": "Importiere eine Version"
} },
"recommended": "empfohlen",
"recommended-tooltip": "Am modbarsten Version"
}, },
"settings": { "settings": {
"steam": { "steam-and-oculus": {
"title": "Steam", "title": "Steam & Oculus",
"description": "Wenn Du dich von Steam abmeldest, musst Du dich erneut anmelden, um eine neue Version von Beat Saber herunterzuladen.", "description": "Abmelden ermöglicht es dir, beim nächsten Beat Saber Download den Account zu wechseln.",
"logout": "Abmelden" "logout": "Abmelden",
"download-platform": {
"title": "Standardplattform",
"desc": "Wähle die Standardplattform, die für das Herunterladen von Beat Saber-Versionen verwendet wird.",
"always-ask": "Immer fragen"
}
}, },
"appearance": { "appearance": {
"title": "Aussehen", "title": "Aussehen",
@@ -133,7 +141,7 @@
}, },
"additional-content": { "additional-content": {
"title": "Zusätzlicher Inhalt", "title": "Zusätzlicher Inhalt",
"description": "Mit zusätzlichen Inhalten kannst du BeatSaber anpassen!", "description": "Mit zusätzlichen Inhalten kannst du Beat Saber anpassen!",
"deep-links": { "deep-links": {
"sub-title": "OneClick-Installationen" "sub-title": "OneClick-Installationen"
} }
@@ -148,13 +156,15 @@
"es-ES": "Español", "es-ES": "Español",
"de-DE": "Deutsch", "de-DE": "Deutsch",
"ru-RU": "Русский", "ru-RU": "Русский",
"zh-CN": "简体中文",
"translated": { "translated": {
"en-EN": "Englisch, Vereinigtes Königreich", "en-EN": "Englisch, Vereinigtes Königreich",
"en-US": "Englisch, USA", "en-US": "Englisch, USA",
"fr-FR": "Französisch", "fr-FR": "Französisch",
"es-ES": "Spanisch", "es-ES": "Spanisch",
"de-DE": "Deutsch", "de-DE": "Deutsch",
"ru-RU": "Russisch" "ru-RU": "Russisch",
"zh-CN": "Vereinfachtes Chinesisch"
} }
} }
}, },
@@ -214,46 +224,65 @@
"verification-finished": "Verifikation Erfolgreich" "verification-finished": "Verifikation Erfolgreich"
} }
}, },
"warnings": { "steam-download": {
"msg": { "warnings": {
"ManifestChecksum": "Die zuvor heruntergeladene Manifest stimmt nicht mit dem neuen überein 🤔", "msg": {
"ConnectionTimeout": "Deine Internetverbindung scheint instabil zu sein 🥶", "ManifestChecksum": "Die zuvor heruntergeladene Manifest stimmt nicht mit dem neuen überein 🤔",
"ConnectionLost": "Die Verbindung wurde unterbrochen, versuche es erneut...", "ConnectionTimeout": "Deine Internetverbindung scheint instabil zu sein 🥶",
"ConnectionError": "Kann keine Verbindung zu Steam herstellen, versuche es erneut...", "ConnectionLost": "Die Verbindung wurde unterbrochen, versuche es erneut...",
"Unknown": "Etwas Seltsames ist passiert 🤔 Deine Verbindung ist wahrscheinlich instabil." "ConnectionError": "Kann keine Verbindung zu Steam herstellen, versuche es erneut...",
"Unknown": "Etwas Seltsames ist passiert 🤔 Deine Verbindung ist wahrscheinlich instabil."
}
},
"errors": {
"titles": {
"dotnet-required": ".NET 6 Benötigt"
},
"msg": {
"401": "Steam scheint uns BeatSaber nicht herunterladen zu lassen 😢",
"404": "Steam-Server können nicht kontaktiert werden.",
"Password": "Passwort ist ungültig.",
"InvalidCredentials": "Ungültige Anmeldedaten, nicht genehmigte Verbindung oder zu viele Anmeldeversuche.",
"NoManifest": "Es wurde keine Manifest gefunden",
"DirectoryCreate": "Die erforderlichen Ordner können nicht installiert werden.",
"NotAvailableApp": "Versuchst du, Beat Saber herunterzuladen, wenn Du es nicht hast? 🤣",
"DepotNotFound": "BeatSaber kann nicht heruntergeladen werden 😥 versuche es später noch einmal 😕",
"NotCompleted": "Der Download konnte nicht beendet werden ¯\\_(ツ)_/¯",
"InvalidManifest": "BeatSaber kann nicht heruntergeladen werden 😥 versuche es später noch einmal 😕",
"NoValidKey": "BeatSaber kann nicht heruntergeladen werden 😥 versuche es später noch einmal 😕",
"NoManifestCode": "BeatSaber kann nicht heruntergeladen werden 😥 versuche es später noch einmal 😕",
"Unknown": "Ein Unbekannter Fehler ist aufgetreten ¯\\_(ツ)_/¯",
"NoServer": "Steam-Server können nicht kontaktiert werden.",
"NotAllowed": "Anscheinend darfst Du BeatSaber nicht herunterladen 🥱",
"ConnectionTimeout": "Kann keine Verbindung zu Steam herstellen 😕",
"SteamLib": "Wenn dieser Fehler auftritt, melde den Fehler auf Github mit Protokollen, bitte.",
"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": "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."
},
"actions": {
"download-dotnet": ".NET 6 Herunterladen"
}
} }
}, },
"errors": { "oculus-download": {
"titles": { "errors": {
"dotnet-required": ".NET 6 Benötigt" "msg": {
}, "DOWNLOAD_MANIFEST_FAILED": "Es ist nicht möglich, das Manifest für diese Version herunterzuladen; Ihr Anmelde-Token ist möglicherweise ungültig.",
"msg": { "MANIFEST_FILE_NOT_FOUND": "Unmöglich, das Manifest für diese Version zu finden.",
"401": "Steam scheint uns BeatSaber nicht herunterladen zu lassen 😢", "PARSE_MANIFEST_FILE_FAILED": "Beim Lesen des Manifests ist ein Fehler aufgetreten.",
"404": "Steam-Server können nicht kontaktiert werden.", "ALREADY_DOWNLOADING": "Eine Version wird bereits heruntergeladen.",
"Password": "Passwort ist ungültig.", "UNABLE_TO_GET_MANIFEST": "Unmöglich, das für den Download erforderliche Manifest zu erhalten.",
"InvalidCredentials": "Ungültige Anmeldedaten, nicht genehmigte Verbindung oder zu viele Anmeldeversuche.", "VERIFY_INTEGRITY_FAILED": "Beim Überprüfen der Dateien ist ein Fehler aufgetreten.",
"NoManifest": "Es wurde keine Manifest gefunden", "SOME_FILES_FAILED_TO_DOWNLOAD": "Einige Dateien konnten nicht heruntergeladen werden.",
"DirectoryCreate": "Die erforderlichen Ordner können nicht installiert werden.", "OCULUS_LOGIN_TIMED_OUT": "Das Anmelde-Token hat zu lange gedauert, um abgerufen zu werden.",
"NotAvailableApp": "Versuchst du, Beat Saber herunterzuladen, wenn Du es nicht hast? 🤣", "OCULUS_LOGIN_WINDOW_CLOSED_BY_USER": "Das Meta Anmeldefenster wurde geschlossen.",
"DepotNotFound": "BeatSaber kann nicht heruntergeladen werden 😥 versuche es später noch einmal 😕", "NO_META_AUTH_TOKEN": "Unmöglich, das für den Download erforderliche Meta-Anmelde-Token zu erhalten.",
"NotCompleted": "Der Download konnte nicht beendet werden ¯\\_(ツ)_/¯", "UNKNOWN_ERROR": "Ein unbekannter Fehler ist aufgetreten."
"InvalidManifest": "BeatSaber kann nicht heruntergeladen werden 😥 versuche es später noch einmal 😕", }
"NoValidKey": "BeatSaber kann nicht heruntergeladen werden 😥 versuche es später noch einmal 😕",
"NoManifestCode": "BeatSaber kann nicht heruntergeladen werden 😥 versuche es später noch einmal 😕",
"Unknown": "Ein Unbekannter Fehler ist aufgetreten ¯\\_(ツ)_/¯",
"NoServer": "Steam-Server können nicht kontaktiert werden.",
"NotAllowed": "Anscheinend darfst Du BeatSaber nicht herunterladen 🥱",
"ConnectionTimeout": "Kann keine Verbindung zu Steam herstellen 😕",
"SteamLib": "Wenn dieser Fehler auftritt, melde den Fehler auf Github mit Protokollen, bitte.",
"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": "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."
},
"actions": {
"download-dotnet": ".NET 6 Herunterladen"
} }
} }
}, },
@@ -269,7 +298,7 @@
}, },
"errors": { "errors": {
"import-error": { "import-error": {
"desc": "Überprüfe, ob der ausgewählte Ordner eine BeatSaber-Installation ist." "desc": "Überprüfe, ob der ausgewählte Ordner eine Beat Saber-Installation ist."
} }
} }
}, },
@@ -349,17 +378,19 @@
"UNKNOWN_ERROR": "Start nicht möglich", "UNKNOWN_ERROR": "Start nicht möglich",
"STEAM_NOT_RUNNING": "Steam läuft nicht", "STEAM_NOT_RUNNING": "Steam läuft nicht",
"OCULUS_NOT_RUNNING": "Oculus läuft nicht", "OCULUS_NOT_RUNNING": "Oculus läuft nicht",
"BS_ALREADY_RUNNING": "BeatSaber läuft bereits", "BS_ALREADY_RUNNING": "Beat Saber läuft bereits",
"EXE_NOT_FINDED": "Dateien Fehlen", "EXE_NOT_FINDED": "Dateien Fehlen",
"EXIT": "Abrupter Stop" "EXIT": "Abrupter Stop",
"OCULUS_LIB_NOT_FOUND": "Oculus-Bibliothek nicht gefunden"
}, },
"msg": { "msg": {
"UNKNOWN_ERROR": "Ein unbekannter Fehler ist aufgetreten.", "UNKNOWN_ERROR": "Ein unbekannter Fehler ist aufgetreten.",
"STEAM_NOT_RUNNING": "Steam muss laufen, um BeatSaber zu starten.", "STEAM_NOT_RUNNING": "Steam muss laufen, um Beat Saber zu starten.",
"OCULUS_NOT_RUNNING": "Oculus muss ausgeführt werden, um BeatSaber zu starten.", "OCULUS_NOT_RUNNING": "Oculus muss ausgeführt werden, um Beat Saber zu starten.",
"BS_ALREADY_RUNNING": "Schließe BeatSaber, bevor Du es erneut startest.", "BS_ALREADY_RUNNING": "Schließe Beat Saber, bevor Du es erneut startest.",
"EXE_NOT_FINDED": "Einige Dateien scheinen zu fehlen, versuche die Dateien zu überprüfen.", "EXE_NOT_FINDED": "Einige Dateien scheinen zu fehlen, versuche die Dateien zu überprüfen.",
"EXIT": "BeatSaber stoppte abrupt, versuche die Dateien zu überprüfen." "EXIT": "Beat Saber stoppte abrupt, versuche die Dateien zu überprüfen.",
"OCULUS_LIB_NOT_FOUND": "Überprüfe, ob die Oculus-Anwendung korrekt installiert ist und dass die Bibliotheken in Oculus richtig definiert sind."
}, },
"actions": { "actions": {
"STEAM_NOT_RUNNING": "Starte Steam" "STEAM_NOT_RUNNING": "Starte Steam"
@@ -467,6 +498,11 @@
"misc": { "misc": {
"remember-my-choice": "Merke meine Wahl" "remember-my-choice": "Merke meine Wahl"
}, },
"choose-store": {
"title": "Welche Plattform?",
"body": "Wählen Sie die Plattform, von der Sie Beat Saber herunterladen möchten.",
"set-in-settings": "Die Standardplattform in den Einstellungen festlegen"
},
"guard": { "guard": {
"title": "Steam Guard", "title": "Steam Guard",
"inputs": { "inputs": {
@@ -520,14 +556,16 @@
}, },
"bs-import-version": { "bs-import-version": {
"title": "Importiere eine Version", "title": "Importiere eine Version",
"description": "Importiert eine Version von BeatSaber zur Verwendung mit BSManager. Der Import kopiert den ausgewählten BeatSaber-Installationsordner in den BSManager-Versionsordner.", "description": "Importiert eine Version von Beat Saber zur Verwendung mit BSManager. Der Import kopiert den ausgewählten Beat Saber-Installationsordner in den BSManager-Versionsordner.",
"oculus-version": "Oculus-Version",
"oculus-version-tooltip": "Ankreuzen, wenn es eine Oculus-Version ist",
"buttons": { "buttons": {
"submit": "Importiere eine Version" "submit": "Importiere eine Version"
} }
}, },
"bs-uninstall": { "bs-uninstall": {
"title": "Deinstallieren", "title": "Deinstallieren",
"description": "Möchtest du BeatSaber {version} wirklich deinstallieren? Du musst es erneut herunterladen, um es zu spielen.", "description": "Möchtest du Beat Saber {version} wirklich deinstallieren? Du musst es erneut herunterladen, um es zu spielen.",
"buttons": { "buttons": {
"submit": "Deinstallieren" "submit": "Deinstallieren"
} }
@@ -547,7 +585,7 @@
}, },
"clone-version": { "clone-version": {
"title": "Version Klonen", "title": "Version Klonen",
"description": "Durch das Klonen der Version kannst Du zusätzlichen BeatSaber-Inhalt zwischen zwei Versionen trennen.", "description": "Durch das Klonen der Version kannst Du zusätzlichen Beat Saber-Inhalt zwischen zwei Versionen trennen.",
"inputs": { "inputs": {
"name": { "name": {
"label": "Name", "label": "Name",
@@ -627,7 +665,7 @@
}, },
"shared-folders": { "shared-folders": {
"title": "Geteilte Ordner", "title": "Geteilte Ordner",
"description": "Verknüpfe BeatSaber-Ordner, um ihre Inhalte mit freigegebenen Ordnern in anderen Versionen zu synchronisieren. Beachte, dass auch das Löschen von Inhalten geteilt wird.", "description": "Verknüpfe Beat Saber-Ordner, um ihre Inhalte mit freigegebenen Ordnern in anderen Versionen zu synchronisieren. Beachte, dass auch das Löschen von Inhalten geteilt wird.",
"buttons": { "buttons": {
"add-folder": "Ordner Hinzufügen", "add-folder": "Ordner Hinzufügen",
"link-folder": "Ordner Verknüpfen", "link-folder": "Ordner Verknüpfen",
@@ -641,6 +679,38 @@
"launch-options": "Startoptionen", "launch-options": "Startoptionen",
"advanced-launch": "Erweiterte Start", "advanced-launch": "Erweiterte Start",
"valid-btn": "Verknüpfung erstellen" "valid-btn": "Verknüpfung erstellen"
},
"connect-to-meta":{
"title": "Mit Meta verbinden",
"body":{
"token-needed": "Dein Meta-Verbindungstoken wird benötigt, um Beat Saber herunterzuladen.",
"need-cookie-enabled": "Beim Einloggen in Meta wird ein Anmeldefenster geöffnet und du kannst dann den Anmeldevorgang beginnen. Bitte stelle sicher, dass Cookies akzeptiert werden, sonst könnten wir deinen Token zum Starten des Downloads nicht abrufen.",
"enter-token-manually": "Mein Anmelde-Token manuell eingeben",
"enter-token-manually-tooltip": "Dies ermöglicht es Ihnen, Ihren Anmelde-Token einzugeben, ohne sich über Meta anzumelden."
},
"stay":"Angemeldet bleiben",
"connect-to-meta": "Mit Meta verbinden"
},
"original-version-backup-oculus": {
"title": "Achtung",
"body": {
"must-be-installed-once": "Sie müssen Beat Saber mindestens einmal aus dem Oculus Store installiert haben, sonst könnte sich Beat Saber nach dem Start automatisch schließen.",
"need-backup": "Um diese Version zu starten, wird der Installationsordner von Beat Saber in Ihrer Oculus-Bibliothek umbenannt.",
"can-restore-later": "Bei Bedarf können Sie ihn vom BSManager aus wiederherstellen, indem Sie zu den Optionen der originalen Oculus-Version gehen und auf 'Ordner wiederherstellen' klicken",
"tips-launch-oculus": "Tipp: Sie können diese Version direkt über Oculus starten, solange die Originalversion nicht wiederhergestellt ist."
},
"not-remind-me": "Nicht mehr erinnern",
"understood": "Verstanden"
},
"enter-meta-token": {
"title": "Meta-Token",
"body": {
"need-token": "Um Beat Saber herunterzuladen, ist Ihr Meta-Anmelde-Token erforderlich.",
"how-obtain-token": "Wie erhalte ich mein Meta-Token?",
"input-label": "Meta-Token",
"token-is-invalid": "Das Token ist ungültig."
},
"valid-btn": "Validieren"
} }
}, },
"maps": { "maps": {
@@ -866,13 +936,13 @@
"notifications": { "notifications": {
"prevent-for-mods": { "prevent-for-mods": {
"title": "Erforderliche Mods", "title": "Erforderliche Mods",
"desc": "Stellen Sie sicher, dass Sie die notwendigen Mods installiert haben, um Modelle in BeatSaber zu verwenden", "desc": "Stellen Sie sicher, dass Sie die notwendigen Mods installiert haben, um Modelle in Beat Saber zu verwenden",
"go-to-mods": "Gehe zu Mods", "go-to-mods": "Gehe zu Mods",
"not-remind": "Erinnere mich nicht" "not-remind": "Erinnere mich nicht"
}, },
"prevent-for-models-breaks": { "prevent-for-models-breaks": {
"title": "Gebrochene Modelle", "title": "Gebrochene Modelle",
"desc": "Seit dem Update des BeatSaber-Motors sind Modelle für diese Version nicht mehr funktional." "desc": "Seit dem Update des Beat Saber-Motors sind Modelle für diese Version nicht mehr funktional."
}, },
"export-success": { "export-success": {
"title": "Export abgeschlossen 🎉" "title": "Export abgeschlossen 🎉"
+120 -50
View File
@@ -44,7 +44,7 @@
"maps": { "maps": {
"title": "Shared maps", "title": "Shared maps",
"search-bar": { "search-bar": {
"search-placeholder": "Search installed maps", "search-placeholder": "Search a map",
"filters-btn": "Filters", "filters-btn": "Filters",
"dropdown": { "dropdown": {
"export-maps": "Export maps", "export-maps": "Export maps",
@@ -98,22 +98,30 @@
"edit": "Edit", "edit": "Edit",
"uninstall": "Uninstall", "uninstall": "Uninstall",
"create-shortcut": "Create a shortcut", "create-shortcut": "Create a shortcut",
"shared-folders": "Shared Folders" "shared-folders": "Shared Folders",
"restore-oculus-folder": "Restore the folder"
} }
}, },
"available-versions": { "available-versions": {
"title": "Select a version", "title": "Select a version",
"steam-release": "Release page", "steam-release": "Release page",
"dropdown": { "dropdown": {
"refresh": "Refresh list", "refresh": "Refresh versions",
"import-version": "Import a version" "import-version": "Import a version"
} },
"recommended": "recommended",
"recommended-tooltip": "Most modable version"
}, },
"settings": { "settings": {
"steam": { "steam-and-oculus": {
"title": "Steam", "title": "Steam & Oculus",
"description": "If you log out of Steam, you will have to log back in to download new versions of Beat Saber.", "description": "Logging out will allow you to switch accounts on the next Beat Saber download.",
"logout": "Log out" "logout": "Log out",
"download-platform": {
"title": "Default Platform",
"desc": "Choose the default platform that will be used to download versions of Beat Saber.",
"always-ask": "Always ask"
}
}, },
"appearance": { "appearance": {
"title": "Appearance", "title": "Appearance",
@@ -148,13 +156,15 @@
"es-ES": "Español", "es-ES": "Español",
"de-DE": "Deutsch", "de-DE": "Deutsch",
"ru-RU": "Русский", "ru-RU": "Русский",
"zh-CN": "简体中文",
"translated": { "translated": {
"en-EN": "English, United Kingdom", "en-EN": "English, United Kingdom",
"en-US": "English, USA", "en-US": "English, USA",
"fr-FR": "French", "fr-FR": "French",
"es-ES": "Spanish", "es-ES": "Spanish",
"de-DE": "German", "de-DE": "German",
"ru-RU": "Russian" "ru-RU": "Russian",
"zh-CN": "Chinese (Simplified)"
} }
} }
}, },
@@ -214,46 +224,65 @@
"verification-finished": "Verification complete" "verification-finished": "Verification complete"
} }
}, },
"warnings": { "steam-download": {
"msg": { "warnings": {
"ManifestChecksum": "The previously downloaded manifest does not match the new 🤔", "msg": {
"ConnectionTimeout": "Your internet connection seems unstable 🥶", "ManifestChecksum": "The previously downloaded manifest does not match the new 🤔",
"ConnectionLost": "The connection has been lost, try again...", "ConnectionTimeout": "Your internet connection seems unstable 🥶",
"ConnectionError": "Unable to connect to Steam, try again...", "ConnectionLost": "The connection has been lost, try again...",
"Unknown": "Something strange has happened 🤔 Your connection is probably unstable." "ConnectionError": "Unable to connect to Steam, try again...",
"Unknown": "Something strange has happened 🤔 Your connection is probably unstable."
}
},
"errors": {
"titles": {
"dotnet-required": ".NET 6 Required"
},
"msg": {
"401": "Steam doesn't seem to want to let us download Beat Saber 😢",
"404": "Unable to contact Steam servers.",
"Password": "Password is invalid.",
"InvalidCredentials": "Invalid login credentials, unapproved connection, or too many login attempts.",
"NoManifest": "No manifest was found",
"DirectoryCreate": "Unable to install the necessary folders.",
"NotAvailableApp": "Are you trying to download Beat Saber when you don't have it? 🤣",
"DepotNotFound": "Unable to download Beat Saber 😥 try again later 😕",
"NotCompleted": "The download could not complete ¯\\_(ツ)_/¯",
"InvalidManifest": "Unable to download Beat Saber 😥 try again later 😕",
"NoValidKey": "Unable to download Beat Saber 😥 try again later 😕",
"NoManifestCode": "Unable to download Beat Saber 😥 try again later 😕",
"Unknown": "An unknown error occurred ¯\\_(ツ)_/¯",
"NoServer": "Unable to contact Steam servers.",
"NotAllowed": "Apparently you are not allowed to download Beat Saber 🥱",
"ConnectionTimeout": "Cannot connect to Steam 😕",
"SteamLib": "If you have this error, report the bug on GitHub with the logs pls.",
"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": "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."
},
"actions": {
"download-dotnet": "Download .NET 6"
}
} }
}, },
"errors": { "oculus-download": {
"titles": { "errors": {
"dotnet-required": ".NET 6 Required" "msg": {
}, "DOWNLOAD_MANIFEST_FAILED": "Unable to download the manifest for this version; your login token may be invalid.",
"msg": { "MANIFEST_FILE_NOT_FOUND": "Unable to find the manifest for this version.",
"401": "Steam doesn't seem to want to let us download Beat Saber 😢", "PARSE_MANIFEST_FILE_FAILED": "An error occurred while reading the manifest.",
"404": "Unable to contact Steam servers.", "ALREADY_DOWNLOADING": "A version is already being downloaded.",
"Password": "Password is invalid.", "UNABLE_TO_GET_MANIFEST": "Unable to obtain the manifest required for download.",
"InvalidCredentials": "Invalid login credentials, unapproved connection, or too many login attempts.", "VERIFY_INTEGRITY_FAILED": "An error occurred during file verification.",
"NoManifest": "No manifest was found", "SOME_FILES_FAILED_TO_DOWNLOAD": "Some files failed to download.",
"DirectoryCreate": "Unable to install the necessary folders.", "OCULUS_LOGIN_TIMED_OUT": "The login token took too long to retrieve.",
"NotAvailableApp": "Are you trying to download Beat Saber when you don't have it? 🤣", "OCULUS_LOGIN_WINDOW_CLOSED_BY_USER": "The Meta login window was closed.",
"DepotNotFound": "Unable to download Beat Saber 😥 try again later 😕", "NO_META_AUTH_TOKEN": "Unable to retrieve the Meta login token required for download.",
"NotCompleted": "The download could not complete ¯\\_(ツ)_/¯", "UNKNOWN_ERROR": "An unknown error occurred."
"InvalidManifest": "Unable to download Beat Saber 😥 try again later 😕", }
"NoValidKey": "Unable to download Beat Saber 😥 try again later 😕",
"NoManifestCode": "Unable to download Beat Saber 😥 try again later 😕",
"Unknown": "An unknown error occurred ¯\\_(ツ)_/¯",
"NoServer": "Unable to contact Steam servers.",
"NotAllowed": "Apparently you are not allowed to download Beat Saber 🥱",
"ConnectionTimeout": "Cannot connect to Steam 😕",
"SteamLib": "If you have this error, report the bug on GitHub with the logs pls.",
"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": "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."
},
"actions": {
"download-dotnet": "Download .NET 6"
} }
} }
}, },
@@ -351,7 +380,8 @@
"OCULUS_NOT_RUNNING": "Oculus is not running", "OCULUS_NOT_RUNNING": "Oculus is not running",
"BS_ALREADY_RUNNING": "Beat Saber already running", "BS_ALREADY_RUNNING": "Beat Saber already running",
"EXE_NOT_FINDED": "Missing files", "EXE_NOT_FINDED": "Missing files",
"EXIT": "Abrupt stop" "EXIT": "Abrupt stop",
"OCULUS_LIB_NOT_FOUND": "Oculus library not found"
}, },
"msg": { "msg": {
"UNKNOWN_ERROR": "An unknown error has occurred.", "UNKNOWN_ERROR": "An unknown error has occurred.",
@@ -359,7 +389,8 @@
"OCULUS_NOT_RUNNING": "Oculus must be running to launch BeatSaber.", "OCULUS_NOT_RUNNING": "Oculus must be running to launch BeatSaber.",
"BS_ALREADY_RUNNING": "Close BeatSaber before launching it again.", "BS_ALREADY_RUNNING": "Close BeatSaber before launching it again.",
"EXE_NOT_FINDED": "Some files seem to be missing, try to verify the files.", "EXE_NOT_FINDED": "Some files seem to be missing, try to verify the files.",
"EXIT": "BeatSaber stopped abruptly, tries to check the files." "EXIT": "BeatSaber stopped abruptly, tries to check the files.",
"OCULUS_LIB_NOT_FOUND": "Check that the Oculus application is properly installed, and that the libraries are correctly defined in Oculus."
}, },
"actions": { "actions": {
"STEAM_NOT_RUNNING": "Launch Steam" "STEAM_NOT_RUNNING": "Launch Steam"
@@ -467,6 +498,11 @@
"misc": { "misc": {
"remember-my-choice": "Remember my choice" "remember-my-choice": "Remember my choice"
}, },
"choose-store": {
"title": "Which platform?",
"body": "Select the platform from which you wish to download Beat Saber.",
"set-in-settings": "Set the default platform in settings"
},
"guard": { "guard": {
"title": "Steam Guard", "title": "Steam Guard",
"inputs": { "inputs": {
@@ -521,6 +557,8 @@
"bs-import-version": { "bs-import-version": {
"title": "Import a version", "title": "Import a version",
"description": "Imports a version of Beat Saber to use with BSManager. This will copy the selected Beat Saber installation folder to the BSManager versions folder.", "description": "Imports a version of Beat Saber to use with BSManager. This will copy the selected Beat Saber installation folder to the BSManager versions folder.",
"oculus-version": "Oculus Version",
"oculus-version-tooltip": "Check if it's an Oculus version",
"buttons": { "buttons": {
"submit": "Import a version" "submit": "Import a version"
} }
@@ -641,6 +679,38 @@
"launch-options": "Launch options", "launch-options": "Launch options",
"advanced-launch": "Advanced launch", "advanced-launch": "Advanced launch",
"valid-btn": "Create the shortcut" "valid-btn": "Create the shortcut"
},
"connect-to-meta":{
"title": "Connect to Meta",
"body":{
"token-needed": "Your Meta connection token is required to download Beat Saber.",
"need-cookie-enabled": "By logging into Meta, a login window will open and you can then start the login process. Please ensure to accept cookies, otherwise, we might not be able to retrieve your token to start the download.",
"enter-token-manually": "Enter my login token manually",
"enter-token-manually-tooltip": "This will allow you to enter your login token without going through Meta login."
},
"stay":"Remember me",
"connect-to-meta": "Connect to Meta"
},
"original-version-backup-oculus": {
"title": "Warning",
"body": {
"must-be-installed-once": "You must have installed Beat Saber at least once from the Oculus Store, otherwise Beat Saber might automatically close after launching.",
"need-backup": "To launch this version, the Beat Saber installation folder located in your Oculus library will be renamed.",
"can-restore-later": "If needed, you can restore it from BSManager by going to the options of the original Oculus version and clicking on 'Restore the folder'",
"tips-launch-oculus": "Tip: You can launch this version directly from Oculus, as long as the original version is not restored."
},
"not-remind-me": "Do not remind me",
"understood": "Understood"
},
"enter-meta-token": {
"title": "Meta Token",
"body": {
"need-token": "To download Beat Saber, your Meta login token is required.",
"how-obtain-token": "How do I obtain my Meta Token?",
"input-label": "Meta Token",
"token-is-invalid": "The Token is invalid."
},
"valid-btn": "Validate"
} }
}, },
"maps": { "maps": {
@@ -738,7 +808,7 @@
}, },
"panel": { "panel": {
"actions": { "actions": {
"search": "Search installed models", "search": "Search a model",
"drop-down": { "drop-down": {
"delete": "Delete models", "delete": "Delete models",
"export": "Export models" "export": "Export models"
+188 -118
View File
@@ -3,7 +3,7 @@
"download": "Descargar", "download": "Descargar",
"add": "Añadir", "add": "Añadir",
"verify": "Verificar", "verify": "Verificar",
"launch": "Lanzar", "launch": "Iniciar",
"mods": "Mods", "mods": "Mods",
"maps": "Mapas", "maps": "Mapas",
"playlists": "Playlists", "playlists": "Playlists",
@@ -30,20 +30,20 @@
}, },
"version-viewer": { "version-viewer": {
"launch-mods": { "launch-mods": {
"oculus": "Oculus Mod", "oculus": "Modo Oculus",
"oculus-description": "Si estás usando Beat Saber a través de Steam, te permite usar el compositor VR de Oculus sin pasar por SteamVR, para ganar prestaciones. Esto no es necesario para usar auriculares Oculus.", "oculus-description": "Si estás usando Beat Saber a través de Steam, te permite usar el compositor VR de Oculus sin pasar por SteamVR, para ganar prestaciones. Esto no es necesario para usar auriculares Oculus.",
"desktop": "FPFC Mod", "desktop": "Modo FPFC",
"desktop-description": "Esto te permite usar WASD y el mouse para navegar por el menú en juego. Esto hace que las pruebas sean mucho más fáciles, ¡porque no tienes que ponerte el auricular!", "desktop-description": "El modo FPFC te permite usar WASD y el mouse para navegar por el menú en juego. Esto hace que las pruebas sean mucho más fáciles, ¡porque no tienes que ponerte las gafas VR!",
"debug": "Debug Mod", "debug": "Modo Depuración",
"debug-description": "Habilita la ventana de registro de salida para IPA. Esto mostrará la consola de depuración que usan los mods.", "debug-description": "Habilita la ventana de registro de salida para IPA. Esto mostrará la consola de depuración que usan los mods.",
"advanced-launch": { "advanced-launch": {
"button": "Lanzamiento avanzado", "button": "Opciones avanzadas",
"placeholder": "Argumentos adicionales ej: --revert; --no-wait" "placeholder": "Argumentos adicionales ej: --revert; --no-wait"
} }
}, },
"maps": { "maps": {
"search-bar": { "search-bar": {
"search-placeholder": "Buscar en un mapa", "search-placeholder": "Buscar un mapa",
"filters-btn": "Filtros", "filters-btn": "Filtros",
"dropdown": { "dropdown": {
"export-maps": "Exportar mapas", "export-maps": "Exportar mapas",
@@ -97,26 +97,34 @@
"edit": "Editar", "edit": "Editar",
"uninstall": "Desinstalar", "uninstall": "Desinstalar",
"create-shortcut": "Crear un atajo", "create-shortcut": "Crear un atajo",
"shared-folders": "Carpetas Compartidas" "shared-folders": "Carpetas Compartidas",
"restore-oculus-folder": "Restaurar la carpeta"
} }
}, },
"available-versions": { "available-versions": {
"title": "Seleccione una versión", "title": "Selecciona una versión",
"steam-release": "Publicación Página", "steam-release": "Anuncio en Steam",
"dropdown": { "dropdown": {
"refresh": "Actualizar la lista", "refresh": "Actualizar las versiones",
"import-version": "Importar una versión" "import-version": "Importar una versión"
} },
"recommended": "recomendada",
"recommended-tooltip": "Versión más modable"
}, },
"settings": { "settings": {
"steam": { "steam-and-oculus": {
"title": "Steam", "title": "Steam & Oculus",
"description": "Si sales de Steam, tendrás que volver a entrar para descargar una nueva versión de Beat Saber.", "description": "Desconectarte te permitirá cambiar de cuenta en la próxima descarga de Beat Saber.",
"logout": "Desconectar" "logout": "Cerrar sesión",
"download-platform": {
"title": "Plataforma predeterminada",
"desc": "Elige la plataforma predeterminada que se utilizará para descargar las versiones de Beat Saber.",
"always-ask": "Siempre preguntar"
}
}, },
"appearance": { "appearance": {
"title": "Apariencia", "title": "Apariencia",
"description": "Elija los dos colores principales de BSManager.", "description": "Elige los dos colores principales de BSManager.",
"reset": "Reiniciar", "reset": "Reiniciar",
"sub-title": "Tema", "sub-title": "Tema",
"themes": { "themes": {
@@ -127,12 +135,12 @@
}, },
"installation-folder": { "installation-folder": {
"title": "Carpeta de instalación", "title": "Carpeta de instalación",
"description": "Cambia la carpeta por defecto para las versiones de Beat Saber y otras características próximas.", "description": "Cambia la carpeta por defecto para las versiones de Beat Saber y próximas funciones.",
"choose-folder": "Elija la carpeta" "choose-folder": "Elige la carpeta"
}, },
"additional-content": { "additional-content": {
"title": "Contenido adicional", "title": "Contenido adicional",
"description": El contenido adicional te permite personalizar BeatSaber!", "description": Contenido adicional que te permite personalizar Beat Saber!",
"deep-links": { "deep-links": {
"sub-title": "Instalaciones OneClick" "sub-title": "Instalaciones OneClick"
} }
@@ -147,34 +155,36 @@
"es-ES": "Español", "es-ES": "Español",
"de-DE": "Deutsch", "de-DE": "Deutsch",
"ru-RU": "Русский", "ru-RU": "Русский",
"zh-CN": "简体中文",
"translated": { "translated": {
"en-EN": "Inglés, Reino Unido", "en-EN": "Inglés, Reino Unido",
"en-US": "Inglés, Estados Unidos", "en-US": "Inglés, Estados Unidos",
"fr-FR": "Francés", "fr-FR": "Francés",
"es-ES": "Español", "es-ES": "Español",
"de-DE": "Alemán", "de-DE": "Alemán",
"ru-RU": "Ruso" "ru-RU": "Ruso",
"zh-CN": "Chino simplificado"
} }
} }
}, },
"patreon": { "patreon": {
"title": "Apoyo BSManager 💖", "title": "Apoya BSManager 💖",
"description": "Apoye el proyecto y ayúdenos a proporcionar mejoras continuas a BSManager.", "description": "Apoya el proyecto y ayúdanos a proporcionar mejoras continuas a BSManager.",
"buttons": { "buttons": {
"support": "Apoyo BSManager 🥰", "support": "Apoya BSManager 🥰",
"supporters": "Apoyos 👀" "supporters": "Donadores 👀"
}, },
"view": { "view": {
"no-supporters": "Todavía no hay apoyos", "no-supporters": "Todavía no hay donadores",
"sponsors": "Patrocinadores", "sponsors": "Patrocinadores",
"supporters": "Apoyos" "supporters": "Donadores"
} }
}, },
"discord": { "discord": {
"description": "¡Únete a la comunidad de BSManager siguiéndonos en nuestras redes sociales!" "description": "¡Únete a la comunidad de BSManager siguiéndonos en nuestras redes sociales!"
}, },
"contribution": { "contribution": {
"description": "¡Sugiera nuevas características o reporte un error para ayudar a mejorar BSManager!", "description": "¡Sugiere nuevas características o reporta un error para ayudar a mejorar BSManager!",
"buttons": { "buttons": {
"request-features": "Proponer una funcionalidad", "request-features": "Proponer una funcionalidad",
"report-bug": "Informar de un error", "report-bug": "Informar de un error",
@@ -201,7 +211,7 @@
"no-internet": "Sin internet" "no-internet": "Sin internet"
}, },
"msg": { "msg": {
"operation-running": "Espere a que termine la operación actual y vuelva a empezar.", "operation-running": "Espera a que termine la operación actual y vuelve a empezar.",
"no-internet": "Comprueba tu conexión a Internet e inténtalo de nuevo." "no-internet": "Comprueba tu conexión a Internet e inténtalo de nuevo."
} }
} }
@@ -209,50 +219,69 @@
"bs-download": { "bs-download": {
"success": { "success": {
"titles": { "titles": {
"download-success": "Descargar completo", "download-success": "Descarga completada",
"verification-finished": "Verificación completa" "verification-finished": "Verificación completada"
} }
}, },
"warnings": { "steam-download": {
"msg": { "warnings": {
"ManifestChecksum": "El manifiesto descargado anteriormente no coincide con el nuevo 🤔", "msg": {
"ConnectionTimeout": "Su conexión a Internet parece inestable 🥶", "ManifestChecksum": "El manifiesto descargado anteriormente no coincide con el nuevo 🤔",
"ConnectionLost": "Se ha perdido la conexión, inténtelo de nuevo...", "ConnectionTimeout": "Tu conexión a Internet parece inestable 🥶",
"ConnectionError": "No se puede conectar a Steam, reintentar...", "ConnectionLost": "Se ha perdido la conexión, inténtalo de nuevo...",
"Unknown": "Algo extraño ha ocurrido 🤔 Tu conexión es probablemente inestable." "ConnectionError": "No se puede conectar a Steam, reintentando...",
"Unknown": "Algo extraño ha ocurrido 🤔 Tu conexión es probablemente inestable."
}
},
"errors": {
"titles": {
"dotnet-required": ".NET 6 Requerido"
},
"msg": {
"401": "Parece que Steam no quiere dejarnos descargar Beat Saber 😢",
"404": "No se puede contactar con los servidores de Steam",
"Password": "La contraseña es inválida.",
"InvalidCredentials": "Credenciales de inicio de sesión inválidas, conexión no aprobada o demasiados intentos de inicio de sesión.",
"NoManifest": "No se ha encontrado el manifiesto",
"DirectoryCreate": "No se pueden instalar las carpetas necesarias.",
"NotAvailableApp": "¿Intentas descargar Beat Saber cuando no lo tienes? 🤣",
"DepotNotFound": "No se puede descargar Beat Saber 😥 inténtalo más tarde 😕",
"NotCompleted": "La descarga no pudo completarse ¯\\_(ツ)_/¯",
"InvalidManifest": "No se puede descargar Beat Saber 😥 inténtalo más tarde 😕",
"NoValidKey": "No se puede descargar Beat Saber 😥 inténtalo más tarde 😕",
"NoManifestCode": "No se puede descargar Beat Saber 😥 inténtalo más tarde 😕",
"Unknown": "Se ha producido un error desconocido ¯\\_(ツ)_/¯",
"NoServer": "No se puede contactar con los servidores de Steam.",
"NotAllowed": "Aparentemente no tienes permiso para descargar Beat Saber 🥱",
"ConnectionTimeout": "No se puede conectar a Steam 😕",
"SteamLib": "Si tienes este error, reporta el bug en GitHub con los logs, por favor.",
"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": "Tu token de inicio de sesión ha sido rechazada 😕 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 Beat Saber. Descárgalo haciendo clic en el botón de abajo."
},
"actions": {
"download-dotnet": "Descargar .NET 6"
}
} }
}, },
"errors": { "oculus-download": {
"titles": { "errors": {
"dotnet-required": ".NET 6 Requerido" "msg": {
}, "DOWNLOAD_MANIFEST_FAILED": "No se puede descargar el manifiesto de esta versión; su token de inicio de sesión podría ser inválido.",
"msg": { "MANIFEST_FILE_NOT_FOUND": "Imposible encontrar el manifiesto de esta versión.",
"401": "Parece que Steam no quiere dejarnos descargar BeatSaber 😢", "PARSE_MANIFEST_FILE_FAILED": "Se produjo un error al leer el manifiesto.",
"404": "No se puede contactar con los servidores de Steam", "ALREADY_DOWNLOADING": "Ya se está descargando una versión.",
"Password": "La contraseña es inválida.", "UNABLE_TO_GET_MANIFEST": "Imposible obtener el manifiesto necesario para la descarga.",
"InvalidCredentials": "Credenciales de inicio de sesión inválidas, conexión no aprobada, o demasiados intentos de inicio de sesión.", "VERIFY_INTEGRITY_FAILED": "Se produjo un error durante la verificación de archivos.",
"NoManifest": "No se ha encontrado el manifiesto", "SOME_FILES_FAILED_TO_DOWNLOAD": "Algunos archivos no pudieron ser descargados.",
"DirectoryCreate": "No se pueden instalar las carpetas necesarias.", "OCULUS_LOGIN_TIMED_OUT": "El token de inicio de sesión tardó demasiado en recuperarse.",
"NotAvailableApp": "¿Intentas descargar BeatSaber cuando no lo tienes? 🤣", "OCULUS_LOGIN_WINDOW_CLOSED_BY_USER": "La ventana de inicio de sesión de Meta fue cerrada.",
"DepotNotFound": "No se puede descargar BeatSaber 😥 inténtalo más tarde 😕", "NO_META_AUTH_TOKEN": "Imposible recuperar el token de inicio de sesión de Meta necesario para la descarga.",
"NotCompleted": "La descarga no pudo completarse ¯\\_(ツ)_/¯", "UNKNOWN_ERROR": "Se produjo un error desconocido."
"InvalidManifest": "No se puede descargar BeatSaber 😥 inténtalo más tarde 😕", }
"NoValidKey": "No se puede descargar BeatSaber 😥 inténtalo más tarde 😕",
"NoManifestCode": "No se puede descargar BeatSaber 😥 inténtalo más tarde 😕",
"Unknown": "Se ha producido un error desconocido ¯\\_(ツ)_/¯",
"NoServer": "No se puede contactar con los servidores de Steam.",
"NotAllowed": "Aparentemente no tienes permiso para descargar BeatSaber 🥱",
"ConnectionTimeout": "No se puede conectar a Steam 😕",
"SteamLib": "Si tienes este error, reporta el bug en GitHub con los logs por favor.",
"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": "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."
},
"actions": {
"download-dotnet": "Descargar .NET 6"
} }
} }
}, },
@@ -260,7 +289,7 @@
"success": { "success": {
"start-import": { "start-import": {
"title": "Importación en curso 👌", "title": "Importación en curso 👌",
"desc": "La importación puede tardar varios minutos dependiendo de su configuración." "desc": "La importación puede tardar varios minutos dependiendo de tu configuración."
}, },
"imported": { "imported": {
"title": "Versión importada 🎉" "title": "Versión importada 🎉"
@@ -268,7 +297,7 @@
}, },
"errors": { "errors": {
"import-error": { "import-error": {
"desc": "Compruebe que la carpeta seleccionada es una instalación de BeatSaber." "desc": "Comprueba que la carpeta seleccionada es una instalación de Beat Saber."
} }
} }
}, },
@@ -277,10 +306,10 @@
"success": { "success": {
"titles": { "titles": {
"transfer-started": "Transferencia en curso", "transfer-started": "Transferencia en curso",
"transfer-finished": "Transferencia completa" "transfer-finished": "Transferencia completada"
}, },
"descs": { "descs": {
"transfer-started": "La transferencia ha comenzado y puede tomar varios minutos dependiendo de su configuración." "transfer-started": "La transferencia ha comenzado y puede tomar varios minutos dependiendo de tu configuración."
} }
}, },
"errors": { "errors": {
@@ -289,7 +318,7 @@
}, },
"descs": { "descs": {
"COPY_TO_SUBPATH": "La carpeta de destino no puede ser una subcarpeta de la carpeta de origen.", "COPY_TO_SUBPATH": "La carpeta de destino no puede ser una subcarpeta de la carpeta de origen.",
"restore-linked-folders": "Se produjo un error al restaurar las carpetas compartidas. Aún puede restaurarlas manualmente a través del menú 'Carpetas compartidas' en la página de versiones." "restore-linked-folders": "Se produjo un error al restaurar las carpetas compartidas. Aún puedes restaurarlas manualmente a través del menú 'Carpetas compartidas' en la página de versiones."
} }
} }
}, },
@@ -318,12 +347,12 @@
"description": "Las instalaciones OneClick han sido desactivadas." "description": "Las instalaciones OneClick han sido desactivadas."
}, },
"error": { "error": {
"description": "Ocurrió un error desconocido." "description": "Ha ocurrido un error desconocido."
} }
}, },
"check-all-enabled": { "check-all-enabled": {
"title": "OneClick deshabilitado", "title": "OneClick deshabilitado",
"description": "Una o más instalaciones de OneClick están deshabilitadas. Vaya a la configuración para habilitarlas.", "description": "Una o más instalaciones de OneClick están deshabilitadas. Ve a la configuración para habilitarlas.",
"actions": { "actions": {
"settings": "Ajustes", "settings": "Ajustes",
"not-remind": "No volver a recordarme" "not-remind": "No volver a recordarme"
@@ -339,26 +368,28 @@
"STEAM_LAUNCHING": "¡Steam se está iniciando!" "STEAM_LAUNCHING": "¡Steam se está iniciando!"
}, },
"msg": { "msg": {
"BS_LAUNCHING": "No olvides calentarte 😉", "BS_LAUNCHING": "No olvides calentar 😉",
"STEAM_LAUNCHING": "Beat Saber se lanzará automáticamente después de Steam." "STEAM_LAUNCHING": "Beat Saber se iniciará automáticamente después de Steam."
} }
}, },
"errors": { "errors": {
"titles": { "titles": {
"UNKNOWN_ERROR": "No se puede lanzar", "UNKNOWN_ERROR": "No se puede iniciar",
"STEAM_NOT_RUNNING": "Steam no funciona", "STEAM_NOT_RUNNING": "Steam no funciona",
"OCULUS_NOT_RUNNING": "Oculus no funciona", "OCULUS_NOT_RUNNING": "Oculus no funciona",
"BS_ALREADY_RUNNING": "BeatSaber ya está en marcha", "BS_ALREADY_RUNNING": "Beat Saber ya está en marcha",
"EXE_NOT_FINDED": "Archivos perdidos", "EXE_NOT_FINDED": "Archivos no encontrados",
"EXIT": "Parada abrupta" "EXIT": "Parada abrupta",
"OCULUS_LIB_NOT_FOUND": "Librería Oculus no encontrada"
}, },
"msg": { "msg": {
"UNKNOWN_ERROR": "Se ha producido un error desconocido.", "UNKNOWN_ERROR": "Se ha producido un error desconocido.",
"STEAM_NOT_RUNNING": "Para iniciar BeatSaber es necesario que Steam esté en funcionamiento.", "STEAM_NOT_RUNNING": "Para iniciar Beat Saber es necesario que Steam esté en funcionamiento.",
"OCULUS_NOT_RUNNING": "Oculus debe estar funcionando para lanzar BeatSaber.", "OCULUS_NOT_RUNNING": "Oculus debe estar funcionando para iniciar Beat Saber.",
"BS_ALREADY_RUNNING": "Cierra BeatSaber antes de volver a lanzarlo.", "BS_ALREADY_RUNNING": "Cierra Beat Saber antes de volver a iniciarlo.",
"EXE_NOT_FINDED": "Parece que faltan algunos archivos, intente verificar los archivos.", "EXE_NOT_FINDED": "Parece que faltan algunos archivos, intenta verificar los archivos.",
"EXIT": "BeatSaber se detuvo abruptamente, trata de revisar los archivos." "EXIT": "Beat Saber se detuvo abruptamente, trata de verificar los archivos.",
"OCULUS_LIB_NOT_FOUND": "Verifica que la aplicación Oculus esté correctamente instalada y que las librerías estén bien definidas en Oculus."
}, },
"actions": { "actions": {
"STEAM_NOT_RUNNING": "Iniciar Steam" "STEAM_NOT_RUNNING": "Iniciar Steam"
@@ -368,14 +399,14 @@
"steam": { "steam": {
"steam-launching": { "steam-launching": {
"title": "¡Steam se está iniciando!", "title": "¡Steam se está iniciando!",
"description": "Beat Saber se lanzará automáticamente después de Steam." "description": "Beat Saber se iniciará automáticamente después de Steam."
} }
}, },
"custom-version": { "custom-version": {
"errors": { "errors": {
"titles": { "titles": {
"CantEditSteam": "Imposible editar", "CantEditSteam": "Imposible editar",
"CantRename": "El renombramiento es imposible", "CantRename": "Cambio de nombre imposible",
"VersionAlreadExist": "Esta versión ya existe", "VersionAlreadExist": "Esta versión ya existe",
"CantClone": "Clonación imposible" "CantClone": "Clonación imposible"
}, },
@@ -399,7 +430,7 @@
"success": "Todos los mods han sido instalados.", "success": "Todos los mods han sido instalados.",
"warning": "No se han podido instalar uno o más mods.", "warning": "No se han podido instalar uno o más mods.",
"errors": { "errors": {
"no-mods": "No hay que instalar mods.", "no-mods": "No hay mods para instalar.",
"cannot-install-bsipa": "La instalación de BSIPA falló 😨" "cannot-install-bsipa": "La instalación de BSIPA falló 😨"
} }
} }
@@ -421,7 +452,7 @@
"msg": { "msg": {
"success": "Todos los mods han sido desinstalados.", "success": "Todos los mods han sido desinstalados.",
"errors": { "errors": {
"no-mods": "No se instala ningún mod en esta versión 😑" "no-mods": "No hay mods instalados en esta versión 😑"
} }
} }
} }
@@ -448,7 +479,7 @@
"info": { "info": {
"userdata-backup-created": { "userdata-backup-created": {
"title": "Backup creado", "title": "Backup creado",
"msg": "Compartir la carpeta 'UserData' puede generar errores, en caso de problemas desvincular la carpeta para restaurar la copia de seguridad" "msg": "Compartir la carpeta 'UserData' puede generar errores, en caso de problemas desvincula la carpeta para restaurar la copia de seguridad"
} }
} }
}, },
@@ -466,23 +497,28 @@
"misc": { "misc": {
"remember-my-choice": "Recordar mi elección" "remember-my-choice": "Recordar mi elección"
}, },
"choose-store": {
"title": "¿Qué plataforma?",
"body": "Selecciona la plataforma desde la que deseas descargar Beat Saber.",
"set-in-settings": "Establecer la plataforma predeterminada en los ajustes"
},
"guard": { "guard": {
"title": "Steam Guard", "title": "Steam Guard",
"inputs": { "inputs": {
"guard-code": { "guard-code": {
"label": "Guard Código", "label": "Código Guard",
"placeholder": "Introduzca su código Guard" "placeholder": "Introduzca su código Guard"
} }
}, },
"buttons": { "buttons": {
"submit": "Conéctate" "submit": "Conectar"
} }
}, },
"steam-login": { "steam-login": {
"title": "Inicio de sesión Steam", "title": "Inicio de sesión Steam",
"inputs": { "inputs": {
"username": { "username": {
"label": "Iniciar sesión con un nombre de cuenta", "label": "Inicia sesión con un nombre de cuenta",
"placeholder": "Introduce tu nombre de cuenta" "placeholder": "Introduce tu nombre de cuenta"
}, },
"password": { "password": {
@@ -514,19 +550,21 @@
}, },
"steam-credentials": { "steam-credentials": {
"title": "Steam Credentials", "title": "Steam Credentials",
"p-1": "Las credenciales sólo se utilizan para descargar el juego porque steam necesita verificar que has pagado el juego para que se te permita descargarlo. No se guardan y se pasan directamente a DepotDownloader. Si no quieres introducir tus credenciales puedes seguir este tutorial :", "p-1": "Las credenciales sólo se utilizan para descargar el juego porque steam necesita verificar que has pagado el juego para permitirte descargarlo. No se guardan y se pasan directamente a DepotDownloader. Si no quieres introducir tus credenciales puedes seguir este tutorial :",
"p-2": "y, a continuación, haga clic en el icono de engranaje en la esquina superior derecha y seleccione \"Importar una versión\", seleccione la carpeta donde se ha descargado beat saber (Si usted sigue el tutorial anterior debe tener la ubicación correcta)" "p-2": "y, a continuación, haga clic en el icono de engranaje en la esquina superior derecha y seleccione \"Importar una versión\", seleccione la carpeta donde se ha descargado beat saber (Si usted sigue el tutorial anterior debe tener la ubicación correcta)"
}, },
"bs-import-version": { "bs-import-version": {
"title": "Importar una versión", "title": "Importar una versión",
"description": "Importa una versión de BeatSaber para usar con BSManager. La importación copiará la carpeta de instalación seleccionada de BeatSaber en la carpeta de versiones de BSManager.", "description": "Importa una versión de Beat Saber para usar con BSManager. La importación copiará la carpeta de instalación seleccionada de Beat Saber en la carpeta de versiones de BSManager.",
"oculus-version": "Versión de Oculus",
"oculus-version-tooltip": "Marcar si es una versión de Oculus",
"buttons": { "buttons": {
"submit": "Importar una versión" "submit": "Importar una versión"
} }
}, },
"bs-uninstall": { "bs-uninstall": {
"title": "Desinstalar", "title": "Desinstalar",
"description": "¿Estás seguro de que quieres desinstalar BeatSaber {version}? Tendrás que descargarlo de nuevo para poder jugar.", "description": "¿Estás seguro de que quieres desinstalar Beat Saber {version}? Tendrás que descargarlo de nuevo para poder jugar.",
"buttons": { "buttons": {
"submit": "Desinstalar" "submit": "Desinstalar"
} }
@@ -546,7 +584,7 @@
}, },
"clone-version": { "clone-version": {
"title": "Versión clonada", "title": "Versión clonada",
"description": "La clonación de la versión le permite separar el contenido adicional de BeatSaber entre dos versiones.", "description": "La clonación de la versión te permite separar el contenido adicional de Beat Saber entre dos versiones.",
"inputs": { "inputs": {
"name": { "name": {
"label": "Nombre", "label": "Nombre",
@@ -602,7 +640,7 @@
}, },
"unlink-maps": { "unlink-maps": {
"title": "Desvincular mapas", "title": "Desvincular mapas",
"desc": "Tenga en cuenta que desvincular mapas no permitirá el uso de mapas compartidos para esta versión.", "desc": "Ten en cuenta que desvincular mapas no permitirá el uso de mapas compartidos para esta versión.",
"keep-maps": { "keep-maps": {
"label": "Mantener mapas", "label": "Mantener mapas",
"title": "Mantener los mapas creará una copia de los mapas compartidos para la versión actual. De lo contrario, no se mantendrá ningún mapa para esta versión." "title": "Mantener los mapas creará una copia de los mapas compartidos para la versión actual. De lo contrario, no se mantendrá ningún mapa para esta versión."
@@ -611,7 +649,7 @@
} }
}, },
"download-maps": { "download-maps": {
"search-btn": "buscar", "search-btn": "Buscar",
"loading-maps": "Cargando mapas...", "loading-maps": "Cargando mapas...",
"no-maps-found": "No se encontraron mapas", "no-maps-found": "No se encontraron mapas",
"no-internet": "Sin internet" "no-internet": "Sin internet"
@@ -626,7 +664,7 @@
}, },
"shared-folders": { "shared-folders": {
"title": "Carpetas Compartidas", "title": "Carpetas Compartidas",
"description": "Enlace las carpetas de BeatSaber para sincronizar su contenido con las carpetas compartidas en otras versiones. Tenga en cuenta que la eliminación de contenido también se compartirá.", "description": "Enlaza las carpetas de Beat Saber para sincronizar su contenido con las carpetas compartidas en otras versiones. Tenga en cuenta que la eliminación de contenido también se compartirá.",
"buttons": { "buttons": {
"add-folder": "Añadir Carpeta", "add-folder": "Añadir Carpeta",
"link-folder": "Enlazar Carpeta", "link-folder": "Enlazar Carpeta",
@@ -640,6 +678,38 @@
"launch-options": "Opciones de lanzamiento", "launch-options": "Opciones de lanzamiento",
"advanced-launch": "Lanzamiento avanzado", "advanced-launch": "Lanzamiento avanzado",
"valid-btn": "Crear el atajo" "valid-btn": "Crear el atajo"
},
"connect-to-meta":{
"title": "Conexión a Meta",
"body":{
"token-needed": "Tu token de conexión a Meta es necesario para descargar Beat Saber.",
"need-cookie-enabled": "Al conectarte a Meta, se abrirá una ventana de inicio de sesión y entonces podrás empezar el proceso de conexión. Asegúrate de aceptar las cookies, de lo contrario, podríamos no poder recuperar tu token para iniciar la descarga.",
"enter-token-manually": "Ingresar mi token de inicio de sesión manualmente",
"enter-token-manually-tooltip": "Esto te permitirá ingresar tu token de inicio de sesión sin pasar por el inicio de sesión de Meta."
},
"stay":"Recuérdame",
"connect-to-meta": "Conectarse a Meta"
},
"original-version-backup-oculus": {
"title": "Atención",
"body": {
"must-be-installed-once": "Debes haber instalado Beat Saber al menos una vez desde la Oculus Store, de lo contrario, Beat Saber podría cerrarse automáticamente después de iniciar.",
"need-backup": "Para iniciar esta versión, la carpeta de instalación de Beat Saber que se encuentra en tu biblioteca de Oculus será renombrada.",
"can-restore-later": "Si es necesario, podrás restaurarla desde el BSManager accediendo a las opciones de la versión original de Oculus y haciendo clic en 'Restaurar la carpeta'",
"tips-launch-oculus": "Consejo: Podrás iniciar esta versión directamente desde Oculus, siempre que la versión original no haya sido restaurada."
},
"not-remind-me": "No volver a recordármelo",
"understood": "Entendido"
},
"enter-meta-token": {
"title": "Token de Meta",
"body": {
"need-token": "Para descargar Beat Saber, se requiere su token de inicio de sesión de Meta.",
"how-obtain-token": "¿Cómo obtengo mi Token de Meta?",
"input-label": "Token de Meta",
"token-is-invalid": "El Token es inválido."
},
"valid-btn": "Validar"
} }
}, },
"maps": { "maps": {
@@ -656,7 +726,7 @@
"dancestyle": "baile", "dancestyle": "baile",
"fitness": "fitness", "fitness": "fitness",
"speed": "speed", "speed": "speed",
"tech": "tec" "tech": "tech"
}, },
"map-styles": { "map-styles": {
"dance": "baile", "dance": "baile",
@@ -813,14 +883,14 @@
"valid-btn": "Vincular plataformas" "valid-btn": "Vincular plataformas"
}, },
"bloq": { "bloq": {
"title": "Vincular bloqs", "title": "Vincular bloques",
"desc": "La vinculación de bloqs permite compartir bloqs entre todas las versiones. Una vez vinculada, esta versión se beneficiará de los bloqs compartidos", "desc": "La vinculación de bloques permite compartir bloques entre todas las versiones. Una vez vinculada, esta versión se beneficiará de los bloques compartidos",
"info": "La adición y eliminación de bloqs también se compartirá", "info": "La adición y eliminación de bloques también se compartirá",
"keep-models": { "keep-models": {
"label": "Conservar los bloqs", "label": "Conservar los bloques",
"title": "Conservar los bloqs moverá los bloqs de la versión actual a la carpeta de bloqs compartidos. De lo contrario, se perderán" "title": "Conservar los bloques moverá los bloques de la versión actual a la carpeta de bloques compartidos. De lo contrario, se perderán"
}, },
"valid-btn": "Vincular bloqs" "valid-btn": "Vincular bloques"
} }
}, },
"unlink-models": { "unlink-models": {
@@ -852,26 +922,26 @@
"valid-btn": "Desvincular plataformas" "valid-btn": "Desvincular plataformas"
}, },
"bloq": { "bloq": {
"title": "Desvincular bloqs", "title": "Desvincular bloques",
"desc": "Atención, desvincular los bloqs ya no permitirá el uso de bloqs compartidos para esta versión.", "desc": "Atención, desvincular los bloques ya no permitirá el uso de bloques compartidos para esta versión.",
"keep-models": { "keep-models": {
"label": "Conservar los bloqs", "label": "Conservar los bloques",
"title": "Conservar los bloqs creará una copia de los bloqs compartidos para la versión actual. En caso contrario, ningún bloq se conservará para esta versión." "title": "Conservar los bloques creará una copia de los bloques compartidos para la versión actual. En caso contrario, ningún bloques se conservará para esta versión."
}, },
"valid-btn": "Desvincular bloqs" "valid-btn": "Desvincular bloques"
} }
} }
}, },
"notifications": { "notifications": {
"prevent-for-mods": { "prevent-for-mods": {
"title": "Mods necesarios", "title": "Mods necesarios",
"desc": "Asegúrate de haber instalado los mods necesarios para usar modelos en BeatSaber", "desc": "Asegúrate de haber instalado los mods necesarios para usar modelos en Beat Saber",
"go-to-mods": "Ir a mods", "go-to-mods": "Ir a mods",
"not-remind": "No volver a recordarme" "not-remind": "No volver a recordarme"
}, },
"prevent-for-models-breaks": { "prevent-for-models-breaks": {
"title": "Modelos rotos", "title": "Modelos rotos",
"desc": "Desde la actualización del motor de BeatSaber, los modelos ya no son funcionales para esta versión." "desc": "Desde la actualización del motor de Beat Saber, los modelos ya no son funcionales para esta versión."
}, },
"export-success": { "export-success": {
"title": "Exportación completada 🎉" "title": "Exportación completada 🎉"
@@ -887,8 +957,8 @@
} }
}, },
"auto-update": { "auto-update": {
"checking": "Comprobar las actualizaciones", "checking": "Comprobando actualizaciones",
"downloading": "Descargar actualizaciones" "downloading": "Descargando actualizaciones"
}, },
"bs-shortcut-launch": { "bs-shortcut-launch": {
"beat-saber-launching": "Iniciando Beat Saber", "beat-saber-launching": "Iniciando Beat Saber",
+147 -77
View File
@@ -20,8 +20,8 @@
"add-version": "Ajouter une version", "add-version": "Ajouter une version",
"settings": "Paramètres", "settings": "Paramètres",
"shared": { "shared": {
"text": "Partagés", "text": "Partagé",
"tooltip": "Contenus partagés" "tooltip": "Contenu partagé"
} }
}, },
"pages": { "pages": {
@@ -31,7 +31,7 @@
"version-viewer": { "version-viewer": {
"launch-mods": { "launch-mods": {
"oculus": "Mode Oculus", "oculus": "Mode Oculus",
"oculus-description": "Si vous utilisez Beat Saber via Steam, cela vous permet d'utiliser le compositeur VR d'Oculus sans passer par SteamVR, pour gagner en performances. Ceci n'est pas nécessaire pour utiliser les casques Oculus.", "oculus-description": "Si vous utilisez Beat Saber via Steam, cela vous permet d'utiliser le compositeur VR d'Oculus (sans passer par SteamVR pour gagner en performances). Ceci n'est pas nécessaire pour utiliser les casques Oculus.",
"desktop": "Mode FPFC", "desktop": "Mode FPFC",
"desktop-description": "Cela vous permet d'utiliser WASD et la souris pour naviguer dans le menu en jeu. Cela rend les tests beaucoup plus faciles, car vous n'avez pas à mettre votre casque!", "desktop-description": "Cela vous permet d'utiliser WASD et la souris pour naviguer dans le menu en jeu. Cela rend les tests beaucoup plus faciles, car vous n'avez pas à mettre votre casque!",
"debug": "Mode Debug", "debug": "Mode Debug",
@@ -72,7 +72,7 @@
}, },
"mods": { "mods": {
"loading-mods": "Chargement des mods...", "loading-mods": "Chargement des mods...",
"no-internet": "Pas d'internet", "no-internet": "Pas d'accès Internet",
"mods-not-available": "Aucun mod n'est encore disponible pour cette version de Beat Saber", "mods-not-available": "Aucun mod n'est encore disponible pour cette version de Beat Saber",
"buttons": { "buttons": {
"more-infos": "Plus d'infos", "more-infos": "Plus d'infos",
@@ -94,25 +94,33 @@
"open-folder": "Ouvrir le dossier", "open-folder": "Ouvrir le dossier",
"verify-files": "Vérifier les fichiers", "verify-files": "Vérifier les fichiers",
"clone": "Cloner", "clone": "Cloner",
"edit": "Editer", "edit": "Modifier",
"uninstall": "Désinstaller", "uninstall": "Désinstaller",
"create-shortcut": "Créer un raccourci", "create-shortcut": "Créer un raccourci",
"shared-folders": "Dossiers Partagés" "shared-folders": "Dossiers partagés",
"restore-oculus-folder": "Restaurer le dossier"
} }
}, },
"available-versions": { "available-versions": {
"title": "Choisis une version", "title": "Choisis une version",
"steam-release": "Notes de version", "steam-release": "Notes de version",
"dropdown": { "dropdown": {
"refresh": "Rafraichir la liste", "refresh": "Actualiser les versions",
"import-version": "Importer une version" "import-version": "Importer une version"
} },
"recommended": "recommandée",
"recommended-tooltip": "Version la plus modable"
}, },
"settings": { "settings": {
"steam": { "steam-and-oculus": {
"title": "Steam", "title": "Steam & Oculus",
"description": "Si tu te déconnectes de Steam, tu devras te reconnecter pour télécharger une nouvelle version de Beat Saber.", "description": "Te déconnecter te permettra de changer de compte au prochain téléchargement de Beat Saber.",
"logout": "Déconnexion" "logout": "Déconnexion",
"download-platform": {
"title": "Plateforme par défaut",
"desc": "Choisi la plateforme par défaut qui sera utilisée pour télécharger les versions de Beat Saber.",
"always-ask": "Toujours demander"
}
}, },
"appearance": { "appearance": {
"title": "Apparence", "title": "Apparence",
@@ -147,13 +155,15 @@
"es-ES": "Español", "es-ES": "Español",
"de-DE": "Deutsch", "de-DE": "Deutsch",
"ru-RU": "Русский", "ru-RU": "Русский",
"zh-CN": "简体中文",
"translated": { "translated": {
"en-EN": "Anglais, Royaume-Uni", "en-EN": "Anglais, Royaume-Uni",
"en-US": "Anglais, États-Unis", "en-US": "Anglais, États-Unis",
"fr-FR": "Français", "fr-FR": "Français",
"es-ES": "Espagnol", "es-ES": "Espagnol",
"de-DE": "Allemand", "de-DE": "Allemand",
"ru-RU": "Russe" "ru-RU": "Russe",
"zh-CN": "Chinois simplifié"
} }
} }
}, },
@@ -198,11 +208,11 @@
"errors": { "errors": {
"titles": { "titles": {
"operation-running": "Opération en cours", "operation-running": "Opération en cours",
"no-internet": "Pas d'internet" "no-internet": "Pas d'accès Internet"
}, },
"msg": { "msg": {
"operation-running": "Attends la fin de l'opération en cours puis recommence.", "operation-running": "Attends la fin de l'opération en cours puis recommence.",
"no-internet": "Verifie ta connexion internet et recommence." "no-internet": "Vérifie ta connexion internet et ressaye."
} }
} }
}, },
@@ -213,43 +223,62 @@
"verification-finished": "Vérification terminée" "verification-finished": "Vérification terminée"
} }
}, },
"warnings": { "steam-download": {
"msg": { "warnings": {
"ConnectionTimeout": "Ta connexion internet semble instable 🥶", "msg": {
"Unknown": "Quelque chose d'étrange s'est produit 🤔 Votre connexion est surement instable." "ConnectionTimeout": "Ta connexion internet semble instable 🥶",
"Unknown": "Quelque chose d'étrange s'est produit 🤔 Votre connexion est surement instable."
}
},
"errors": {
"titles": {
"dotnet-required": ".NET 6 Requis"
},
"msg": {
"401": "Steam ne semble pas vouloir nous laisser télécharger Beat Saber 😢",
"404": "Impossible de contacter les serveurs de Steam.",
"Password": "Le mot de passe est invalide.",
"InvalidCredentials": "Identifiants de connexion invalides, connexion non approuvée, ou trop de tentatives de connexion.",
"NoManifest": "Aucun manifest n'a été trouvé.",
"DirectoryCreate": "Impossible d'installer les dossiers nécessaires.",
"NotAvailableApp": "Tu essayes de télécharger Beat Saber alors que tu ne l'as pas ? 🤣",
"DepotNotFound": "Impossible de télécharger Beat Saber 😥 réessaye plus tard 😕",
"NotCompleted": "Le téléchargement n'a pas pu se terminer ¯\\_(ツ)_/¯",
"InvalidManifest": "Impossible de télécharger Beat Saber 😥 réessaye plus tard 😕",
"NoValidKey": "Impossible de télécharger Beat Saber 😥 réessaye plus tard 😕",
"NoManifestCode": "Impossible de télécharger Beat Saber 😥 réessaye plus tard 😕",
"Unknown": "Une erreur inconnue s'est produite ¯\\_(ツ)_/¯",
"NoServer": "Impossible de contacter les serveurs de Steam.",
"NotAllowed": "Apparemment tu n'es pas autorisé à télécharger Beat Saber 🥱",
"ConnectionTimeout": "Impossible de se connecter à Steam 😕",
"SteamLib": "Si tu as cette erreur, signale le bug sur GitHub avec les logs stp.",
"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": "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."
},
"actions": {
"download-dotnet": "Télécharger .NET 6"
}
} }
}, },
"errors": { "oculus-download": {
"titles": { "errors": {
"dotnet-required": ".NET 6 Requis" "msg": {
}, "DOWNLOAD_MANIFEST_FAILED": "Impossible de télécharger le manifest de cette version; vote token de connexion est peut-être invalide.",
"msg": { "MANIFEST_FILE_NOT_FOUND": "Impossible de trouver le manifest de cette version.",
"401": "Steam ne semble pas vouloir nous laisser télécharger Beat Saber 😢", "PARSE_MANIFEST_FILE_FAILED": "Une erreur c'est produite lors de la lecture du manifest.",
"404": "Impossible de contacter les serveurs de Steam.", "ALREADY_DOWNLOADING": "Une version est déjà en cours de téléchargement.",
"Password": "Le mot de passe est invalide.", "UNABLE_TO_GET_MANIFEST": "Impossible d'obtenir le manifest nécessaire au téléchargement.",
"InvalidCredentials": "Identifiants de connexion invalides, connexion non approuvée, ou trop de tentatives de connexion.", "VERIFY_INTEGRITY_FAILED": "Une erreur c'est produite lors de la vérification des fichiers.",
"NoManifest": "Aucun manifest n'a été trouvé.", "SOME_FILES_FAILED_TO_DOWNLOAD": "Certains fichiers n'ont pas pu être téléchargés.",
"DirectoryCreate": "Impossible d'installer les dossiers nécessaires.", "OCULUS_LOGIN_TIMED_OUT": "Le Token de connexion à mis trop de temps à être récupéré.",
"NotAvailableApp": "Tu essayes de télécharger Beat Saber alors que tu ne l'as pas ? 🤣", "OCULUS_LOGIN_WINDOW_CLOSED_BY_USER": "La fenêtre de connexion à Meta a été fermée.",
"DepotNotFound": "Impossible de télécharger Beat Saber 😥 réessaye plus tard 😕", "NO_META_AUTH_TOKEN": "Impossible de récupérer le token de connexion à Meta nécessaire au téléchargement.",
"NotCompleted": "Le téléchargement n'a pas pu se terminer ¯\\_(ツ)_/¯", "UNKNOWN_ERROR": "Une erreur inconnue s'est produite."
"InvalidManifest": "Impossible de télécharger Beat Saber 😥 réessaye plus tard 😕", }
"NoValidKey": "Impossible de télécharger Beat Saber 😥 réessaye plus tard 😕",
"NoManifestCode": "Impossible de télécharger Beat Saber 😥 réessaye plus tard 😕",
"Unknown": "Une erreur inconnue s'est produite ¯\\_(ツ)_/¯",
"NoServer": "Impossible de contacter les serveurs de Steam.",
"NotAllowed": "Apparemment tu n'es pas autorisé à télécharger Beat Saber 🥱",
"ConnectionTimeout": "Impossible de se connecter à Steam 😕",
"SteamLib": "Si tu as cette erreur, signale le bug sur GitHub avec les logs stp.",
"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": "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."
},
"actions": {
"download-dotnet": "Télécharger .NET 6"
} }
} }
}, },
@@ -347,7 +376,8 @@
"OCULUS_NOT_RUNNING": "Oculus n'est pas lancé", "OCULUS_NOT_RUNNING": "Oculus n'est pas lancé",
"BS_ALREADY_RUNNING": "Beat Saber est déjà lancé", "BS_ALREADY_RUNNING": "Beat Saber est déjà lancé",
"EXE_NOT_FINDED": "Fichiers manquants", "EXE_NOT_FINDED": "Fichiers manquants",
"EXIT": "Arrêt brutal" "EXIT": "Arrêt brutal",
"OCULUS_LIB_NOT_FOUND": "Librairie Oculus introuvable"
}, },
"msg": { "msg": {
"UNKNOWN_ERROR": "Une erreur inconnue s'est produite.", "UNKNOWN_ERROR": "Une erreur inconnue s'est produite.",
@@ -355,7 +385,8 @@
"OCULUS_NOT_RUNNING": "Oculus doit être en cours d'exécution pour lancer Beat Saber.", "OCULUS_NOT_RUNNING": "Oculus doit être en cours d'exécution pour lancer Beat Saber.",
"BS_ALREADY_RUNNING": "Ferme Beat Saber avant de le lancer à nouveau.", "BS_ALREADY_RUNNING": "Ferme Beat Saber avant de le lancer à nouveau.",
"EXE_NOT_FINDED": "Quelques fichiers semblent manquants. Essaye de vérifier les fichiers.", "EXE_NOT_FINDED": "Quelques fichiers semblent manquants. Essaye de vérifier les fichiers.",
"EXIT": "BeatSaber s'est arrêté brusquement, essaye de vérifier les fichiers." "EXIT": "Beat Saber s'est arrêté brusquement, essaye de vérifier les fichiers.",
"OCULUS_LIB_NOT_FOUND": "Vérifie que l'application Oculus est correctement installée, et que les librairies sont bien définies dans Oculus."
}, },
"actions": { "actions": {
"STEAM_NOT_RUNNING": "Lancer Steam" "STEAM_NOT_RUNNING": "Lancer Steam"
@@ -371,13 +402,13 @@
"custom-version": { "custom-version": {
"errors": { "errors": {
"titles": { "titles": {
"CantEditSteam": "Edition impossible", "CantEditSteam": "Modification impossible",
"CantRename": "Renommage impossible", "CantRename": "Renommage impossible",
"VersionAlreadExist": "Cette version existe déjà", "VersionAlreadExist": "Cette version existe déjà",
"CantClone": "Clonage impossible" "CantClone": "Clonage impossible"
}, },
"msg": { "msg": {
"CantEditSteam": "Tu ne peux pas éditer la version Steam. Tu peux la cloner par contre." "CantEditSteam": "Tu ne peux pas modifier la version Steam, cependant tu peux la cloner."
} }
}, },
"success": { "success": {
@@ -416,7 +447,7 @@
"success": "Mods désintallés 🎉" "success": "Mods désintallés 🎉"
}, },
"msg": { "msg": {
"success": "Tous les mods ont été désintallés.", "success": "Tous les mods ont été désinstallés.",
"errors": { "errors": {
"no-mods": "Aucun mod n'est installé dans dans cette version 😑" "no-mods": "Aucun mod n'est installé dans dans cette version 😑"
} }
@@ -463,12 +494,17 @@
"misc": { "misc": {
"remember-my-choice": "Se souvenir de mon choix" "remember-my-choice": "Se souvenir de mon choix"
}, },
"choose-store": {
"title": "Quelle plateforme ?",
"body": "Sélectionnez la plateforme depuis laquelle vous souhaitez télécharger Beat Saber.",
"set-in-settings": "Définir la platforme par défaut dans les paramètres"
},
"guard": { "guard": {
"title": "Steam Guard", "title": "Steam Guard",
"inputs": { "inputs": {
"guard-code": { "guard-code": {
"label": "Code Guard", "label": "Code Steam Guard",
"placeholder": "Entre ton code Guard" "placeholder": "Entre ton code Steam Guard"
} }
}, },
"buttons": { "buttons": {
@@ -516,7 +552,9 @@
}, },
"bs-import-version": { "bs-import-version": {
"title": "Importer une version", "title": "Importer une version",
"description": "Importe une version de BeatSaber pour profiter des fonctionnalités de BSManager. L'importation copiera le dossier d'installation de BeatSaber sélectionné dans le dossier de versions de BSManager.", "description": "Importe une version de Beat Saber pour profiter des fonctionnalités de BSManager. L'importation copiera le dossier d'installation de Beat Saber sélectionné dans le dossier de versions de BSManager.",
"oculus-version": "Version Oculus",
"oculus-version-tooltip": "Cocher si c'est une version Oculus",
"buttons": { "buttons": {
"submit": "Importer une version" "submit": "Importer une version"
} }
@@ -536,14 +574,14 @@
} }
}, },
"edit-version": { "edit-version": {
"title": "Editer la version", "title": "Modifier la version",
"buttons": { "buttons": {
"submit": "Editer" "submit": "Modifier"
} }
}, },
"clone-version": { "clone-version": {
"title": "Cloner la version", "title": "Cloner la version",
"description": "Cloner la version te permet de séparer les contenus additionnels de BeatSaber entre deux mêmes versions.", "description": "Cloner la version te permet de séparer les contenus additionnels de Beat Saber entre deux mêmes versions.",
"inputs": { "inputs": {
"name": { "name": {
"label": "Nom", "label": "Nom",
@@ -574,7 +612,7 @@
}, },
"desc": { "desc": {
"single": "Es-tu sur de vouloir supprimer la map {name} ?", "single": "Es-tu sur de vouloir supprimer la map {name} ?",
"multiple": "Es-tu sur de vouloir supprimer les {nb} maps ?" "multiple": "Es-tu sur de vouloir supprimer {nb} maps ?"
}, },
"info": { "info": {
"desc": { "desc": {
@@ -623,7 +661,7 @@
}, },
"shared-folders": { "shared-folders": {
"title": "Dossiers Partagés", "title": "Dossiers Partagés",
"description": "Liez les dossiers de BeatSaber pour synchroniser leurs contenus avec les dossiers partagés des autres versions. Notez que la suppression de contenu sera également partagée.", "description": "Liez les dossiers de Beat Saber pour synchroniser leurs contenus avec les dossiers partagés des autres versions. Notez que la suppression de contenu sera également partagée.",
"buttons": { "buttons": {
"add-folder": "Ajouter un dossier", "add-folder": "Ajouter un dossier",
"link-folder": "Lier le dossier", "link-folder": "Lier le dossier",
@@ -637,6 +675,38 @@
"launch-options": "Options de lancement", "launch-options": "Options de lancement",
"advanced-launch": "Lancement avancé", "advanced-launch": "Lancement avancé",
"valid-btn": "Créer le raccourci" "valid-btn": "Créer le raccourci"
},
"connect-to-meta":{
"title": "Connexion à Meta",
"body":{
"token-needed": "Votre token de connexion à Meta est nécessaire pour télécharger Beat Saber.",
"need-cookie-enabled": "En vous connectant à Meta, une fenêtre de connexion s'ouvrira et vous pourrez alors débuter le processus de connexion. Veillez à bien accepter les cookies sinon quoi, il se pourrait que l'on n'arrive pas à récupérer votre token pour démarrer le téléchargement.",
"enter-token-manually": "Entrer mon token de connexion manuellement",
"enter-token-manually-tooltip": "Cela vous permettra d'entrer votre token de connexion sans passer par la connexion Meta."
},
"stay":"Se souvenir de moi",
"connect-to-meta": "Se connecter à Meta"
},
"original-version-backup-oculus": {
"title": "Attention",
"body": {
"must-be-installed-once": "Vous devez avoir installé au moins une fois Beat Saber depuis l'Oculus Store, sinon Beat Saber pourrait se fermer automatiquement après son lancement.",
"need-backup": "Pour lancer cette version, le dossier d'installation de Beat Saber se trouvant dans votre librairie Oculus va être renommé.",
"can-restore-later": "Au besoin, vous pourrez le restaurer depuis BSManager en vous rendant dans les options de la version originale Oculus et en cliquant sur \"Restaurer le dossier\"",
"tips-launch-oculus": "Astuce : Vous pourrez lancer cette version directement depuis Oculus, tant que la version originale n'est pas restaurée."
},
"not-remind-me": "Ne plus me rappeler",
"understood": "J'ai compris"
},
"enter-meta-token": {
"title": "Token Meta",
"body": {
"need-token": "Pour télécharger Beat Saber, votre token de connexion à Meta est nécessaire.",
"how-obtain-token": "Comment obtenir mon Token Meta ?",
"input-label": "Token Meta",
"token-is-invalid": "Le Token est invalide."
},
"valid-btn": "Valider"
} }
}, },
"maps": { "maps": {
@@ -690,8 +760,8 @@
"jpop": "j-pop", "jpop": "j-pop",
"rock": "rock", "rock": "rock",
"pop": "pop", "pop": "pop",
"electronic": "éléctronique", "electronic": "électronique",
"classical-orchestral": "Classique & Orchestral" "classical-orchestral": "classique & orchestrale"
}, },
"map-specificities": { "map-specificities": {
"automapper": "IA", "automapper": "IA",
@@ -751,12 +821,12 @@
"modals": { "modals": {
"delete-model": { "delete-model": {
"title": "Supprimer le modèle", "title": "Supprimer le modèle",
"desc": "Est-tu sûr de vouloir supprimer le modèle {modelName} ?", "desc": "Es-tu sûr de vouloir supprimer le modèle {modelName} ?",
"linked-annotation": "Ce modèle sera supprimé de toutes les versions liées." "linked-annotation": "Ce modèle sera supprimé de toutes les versions liées."
}, },
"delete-models": { "delete-models": {
"title": "Supprimer les modèles", "title": "Supprimer les modèles",
"desc": "Est-tu sûr de vouloir supprimer les {nb} modèles ?", "desc": "Es-tu sûr de vouloir supprimer {nb} modèles ?",
"linked-annotation": "Ces modèles seront supprimés de toutes les versions liées." "linked-annotation": "Ces modèles seront supprimés de toutes les versions liées."
}, },
"download-models": { "download-models": {
@@ -781,8 +851,8 @@
"link-models": { "link-models": {
"avatar": { "avatar": {
"title": "Lier les avatars", "title": "Lier les avatars",
"desc": "La liaison des avatars permet de partager les avatars entre toute les version. Une fois liée, cette version profitera des avatars partagés", "desc": "La liaison des avatars permet de partager les avatars entre toutes les version. Une fois liée, cette version profitera des avatars partagés",
"info": "L'ajout et la suppression d'avatars sera également partagé", "info": "L'ajout et la suppression d'avatars seront également partagés",
"keep-models": { "keep-models": {
"label": "Conserver les avatars", "label": "Conserver les avatars",
"title": "Conserver les avatars déplacera les avatars de la version actuelle dans le dossier des avatars partagés. Dans le cas contraire ils seront perdus" "title": "Conserver les avatars déplacera les avatars de la version actuelle dans le dossier des avatars partagés. Dans le cas contraire ils seront perdus"
@@ -791,8 +861,8 @@
}, },
"saber": { "saber": {
"title": "Lier les sabres", "title": "Lier les sabres",
"desc": "La liaison des sabres permet de partager les sabres entre toute les version. Une fois liée, cette version profitera des sabres partagés", "desc": "La liaison des sabres permet de partager les sabres entre toutes les version. Une fois liée, cette version profitera des sabres partagés",
"info": "L'ajout et la suppression de sabres sera également partagé", "info": "L'ajout et la suppression de sabres seront également partagés",
"keep-models": { "keep-models": {
"label": "Conserver les sabres", "label": "Conserver les sabres",
"title": "Conserver les sabres déplacera les sabres de la version actuelle dans le dossier des sabres partagés. Dans le cas contraire ils seront perdus" "title": "Conserver les sabres déplacera les sabres de la version actuelle dans le dossier des sabres partagés. Dans le cas contraire ils seront perdus"
@@ -801,8 +871,8 @@
}, },
"platform": { "platform": {
"title": "Lier les plateformes", "title": "Lier les plateformes",
"desc": "La liaison des plateformes permet de partager les plateformes entre toute les version. Une fois liée, cette version profitera des plateformes partagées", "desc": "La liaison des plateformes permet de partager les plateformes entre toutes les version. Une fois liée, cette version profitera des plateformes partagées",
"info": "L'ajout et la suppression de plateformes sera également partagé", "info": "L'ajout et la suppression de plateformes seront également partagés",
"keep-models": { "keep-models": {
"label": "Conserver les plateformes", "label": "Conserver les plateformes",
"title": "Conserver les plateformes déplacera les plateformes de la version actuelle dans le dossier des plateformes partagées. Dans le cas contraire ils seront perdus" "title": "Conserver les plateformes déplacera les plateformes de la version actuelle dans le dossier des plateformes partagées. Dans le cas contraire ils seront perdus"
@@ -811,8 +881,8 @@
}, },
"bloq": { "bloq": {
"title": "Lier les bloqs", "title": "Lier les bloqs",
"desc": "La liaison des bloqs permet de partager les bloqs entre toute les version. Une fois liée, cette version profitera des bloqs partagés", "desc": "La liaison des bloqs permet de partager les bloqs entre toutes les version. Une fois liée, cette version profitera des bloqs partagés",
"info": "L'ajout et la suppression de bloqs sera également partagé", "info": "L'ajout et la suppression de bloqs seront également partagés",
"keep-models": { "keep-models": {
"label": "Conserver les bloqs", "label": "Conserver les bloqs",
"title": "Conserver les bloqs déplacera les bloqs de la version actuelle dans le dossier des bloqs partagés. Dans le cas contraire ils seront perdus" "title": "Conserver les bloqs déplacera les bloqs de la version actuelle dans le dossier des bloqs partagés. Dans le cas contraire ils seront perdus"
@@ -862,13 +932,13 @@
"notifications": { "notifications": {
"prevent-for-mods": { "prevent-for-mods": {
"title": "Mods nécessaires", "title": "Mods nécessaires",
"desc": "Assurez-toi d'avoir installé les mods nécessaires pour utiliser des modèles dans BeatSaber", "desc": "Assure-toi d'avoir installé les mods nécessaires pour utiliser des modèles dans Beat Saber",
"go-to-mods": "Aller aux mods", "go-to-mods": "Aller aux mods",
"not-remind": "Ne plus me rappeler" "not-remind": "Ne plus me rappeler"
}, },
"prevent-for-models-breaks": { "prevent-for-models-breaks": {
"title": "Modèles cassés", "title": "Modèles cassés",
"desc": "Depuis la mise à jour du moteur de BeatSaber, les modèles ne sont plus fonctionnels pour cette version." "desc": "Depuis la mise à jour du moteur de Beat Saber, les modèles ne sont plus fonctionnels pour cette version."
}, },
"export-success": { "export-success": {
"title": "Export terminé 🎉" "title": "Export terminé 🎉"
+121 -51
View File
@@ -98,22 +98,30 @@
"edit": "Редактировать", "edit": "Редактировать",
"uninstall": "Удалить", "uninstall": "Удалить",
"create-shortcut": "Создать ярлык", "create-shortcut": "Создать ярлык",
"shared-folders": "Общие папки" "shared-folders": "Общие папки",
"restore-oculus-folder": "Восстановить папку"
} }
}, },
"available-versions": { "available-versions": {
"title": "Выберите версию", "title": "Выберите версию",
"steam-release": "Список изменений", "steam-release": "Список изменений",
"dropdown": { "dropdown": {
"refresh": "Обновить список", "refresh": "Обновить версии",
"import-version": "Импорт версии" "import-version": "Импорт версии"
} },
"recommended": "рекомендуемая",
"recommended-tooltip": "самая модифицируемая версия"
}, },
"settings": { "settings": {
"steam": { "steam-and-oculus": {
"title": "Steam", "title": "Steam & Oculus",
"description": "Если вы выйдете из Steam, вам придётся снова войти, если вы хотите скачать другие версии Beat Saber.", "description": "Выход позволит вам сменить учетную запись при следующей загрузке Beat Saber.",
"logout": "Выйти" "logout": "Выйти",
"download-platform": {
"title": "Основная платформа",
"desc": "Выберите основную платформу, которая будет использоваться для скачивания версий Beat Saber.",
"always-ask": "Всегда спрашивать"
}
}, },
"appearance": { "appearance": {
"title": "Персонализация", "title": "Персонализация",
@@ -148,13 +156,15 @@
"es-ES": "Español", "es-ES": "Español",
"de-DE": "Deutsch", "de-DE": "Deutsch",
"ru-RU": "Русский", "ru-RU": "Русский",
"zh-CN": "简体中文",
"translated": { "translated": {
"en-EN": "Английский, Великобритания", "en-EN": "Английский, Великобритания",
"en-US": "Английский, США", "en-US": "Английский, США",
"fr-FR": "Французский", "fr-FR": "Французский",
"es-ES": "Испанский", "es-ES": "Испанский",
"de-DE": "Немецкий", "de-DE": "Немецкий",
"ru-RU": "Русский" "ru-RU": "Русский",
"zh-CN": "Китайский (упрощенный)"
} }
} }
}, },
@@ -214,46 +224,65 @@
"verification-finished": "Проверка завершена" "verification-finished": "Проверка завершена"
} }
}, },
"warnings": { "steam-download": {
"msg": { "warnings": {
"ManifestChecksum": "Предыдущий файл манифесте не совпадает с новым 🤔", "msg": {
"ConnectionTimeout": "У вас нестабильное соединение с интернетом 🥶", "ManifestChecksum": "Предыдущий файл манифесте не совпадает с новым 🤔",
"ConnectionLost": "Соединение потеряно, попробуйте снова...", "ConnectionTimeout": "У вас нестабильное соединение с интернетом 🥶",
"ConnectionError": "Не удалось подключиться к Steam, попробуйте снова...", "ConnectionLost": "Соединение потеряно, попробуйте снова...",
"Unknown": "Что-то странное произошло 🤔 Возможно ваш интернет барахлит." "ConnectionError": "Не удалось подключиться к Steam, попробуйте снова...",
"Unknown": "Что-то странное произошло 🤔 Возможно ваш интернет барахлит."
}
},
"errors": {
"titles": {
"dotnet-required": "Требуется .NET 6"
},
"msg": {
"401": "Похоже Steam не хочет, чтобы мы скачали Beat Saber 😢",
"404": "Нет связи с серверами Steam.",
"Password": "Неверный пароль.",
"InvalidCredentials": "Неверные учетные данные для входа, неразрешенное соединение или слишком много попыток входа.",
"NoManifest": "Файл манифеста не найден",
"DirectoryCreate": "Не смогли создать нужные папки.",
"NotAvailableApp": "Вы пытаетесь скачать Beat Saber, не купив её? 🤣",
"DepotNotFound": "Не удалось скачать Beat Saber 😥 повторите попытку позже 😕",
"NotCompleted": "Скачивание не завершилось ¯\\_(ツ)_/¯",
"InvalidManifest": "Не удалось скачать Beat Saber 😥 повторите попытку позже 😕",
"NoValidKey": "Не удалось скачать Beat Saber 😥 повторите попытку позже 😕",
"NoManifestCode": "Не удалось скачать Beat Saber 😥 повторите попытку позже 😕",
"Unknown": "Неизвестная ошибка ¯\\_(ツ)_/¯",
"NoServer": "Нет связи с серверами Steam.",
"NotAllowed": "Внезапно, вы не можете скачать Beat Saber 🥱",
"ConnectionTimeout": "Не удалось подключиться к Steam 😕",
"SteamLib": "Если вы это видите, пожалуйста, сообщите о баге на GitHub с файлом логов.",
"ConnectionError": "Не удалось подключиться к Steam за 10 попыток 🤯",
"LicenceError": "Не удалось проверить наличие лицензии.",
"RateLimitExceeded": "Слишком много попыток, вернитесь позже и попробуйте снова.",
"TokenRejected": "Ваш токен для входа был отклонен 😕 Пожалуйста, попробуйте снова.",
"AccessDenied": "Доступ к Steam был отклонен.",
"dotnet-required": "Среда запуска .NET 6 должна быть установлена, чтобы скачать Beat Saber. Скачайте её с помощью кнопки ниже."
},
"actions": {
"download-dotnet": "Скачать .NET 6"
}
} }
}, },
"errors": { "oculus-download": {
"titles": { "errors": {
"dotnet-required": "Требуется .NET 6" "msg": {
}, "DOWNLOAD_MANIFEST_FAILED": "Невозможно загрузить манифест этой версии; ваш токен входа, возможно, недействителен.",
"msg": { "MANIFEST_FILE_NOT_FOUND": "Невозможно найти манифест этой версии.",
"401": "Похоже Steam не хочет, чтобы мы скачали Beat Saber 😢", "PARSE_MANIFEST_FILE_FAILED": "При чтении манифеста произошла ошибка.",
"404": "Нет связи с серверами Steam.", "ALREADY_DOWNLOADING": "Версия уже загружается.",
"Password": "Неверный пароль.", "UNABLE_TO_GET_MANIFEST": "Невозможно получить манифест, необходимый для загрузки.",
"InvalidCredentials": "Неверные учетные данные для входа, неразрешенное соединение или слишком много попыток входа.", "VERIFY_INTEGRITY_FAILED": "При проверке файлов произошла ошибка.",
"NoManifest": "Файл манифеста не найден", "SOME_FILES_FAILED_TO_DOWNLOAD": "Некоторые файлы не удалось загрузить.",
"DirectoryCreate": "Не смогли создать нужные папки.", "OCULUS_LOGIN_TIMED_OUT": "Получение токена входа заняло слишком много времени.",
"NotAvailableApp": "Вы пытаетесь скачать Beat Saber, не купив её? 🤣", "OCULUS_LOGIN_WINDOW_CLOSED_BY_USER": "Окно входа в Meta было закрыто.",
"DepotNotFound": "Не удалось скачать Beat Saber 😥 повторите попытку позже 😕", "NO_META_AUTH_TOKEN": "Невозможно получить токен входа в Meta, необходимый для загрузки.",
"NotCompleted": "Скачивание не завершилось ¯\\_(ツ)_/¯", "UNKNOWN_ERROR": "Произошла неизвестная ошибка."
"InvalidManifest": "Не удалось скачать Beat Saber 😥 повторите попытку позже 😕", }
"NoValidKey": "Не удалось скачать Beat Saber 😥 повторите попытку позже 😕",
"NoManifestCode": "Не удалось скачать Beat Saber 😥 повторите попытку позже 😕",
"Unknown": "Неизвестная ошибка ¯\\_(ツ)_/¯",
"NoServer": "Нет связи с серверами Steam.",
"NotAllowed": "Внезапно, вы не можете скачать Beat Saber 🥱",
"ConnectionTimeout": "Не удалось подключиться к Steam 😕",
"SteamLib": "Если вы это видите, пожалуйста, сообщите о баге на GitHub с файлом логов.",
"ConnectionError": "Не удалось подключиться к Steam за 10 попыток 🤯",
"LicenceError": "Не удалось проверить наличие лицензии.",
"RateLimitExceeded": "Слишком много попыток, вернитесь позже и попробуйте снова.",
"TokenRejected": "Ваш токен для входа был отклонен 😕 Пожалуйста, попробуйте снова.",
"AccessDenied": "Доступ к Steam был отклонен.",
"dotnet-required": "Среда запуска .NET 6 должна быть установлена, чтобы скачать Beat Saber. Скачайте её с помощью кнопки ниже."
},
"actions": {
"download-dotnet": "Скачать .NET 6"
} }
} }
}, },
@@ -351,15 +380,17 @@
"OCULUS_NOT_RUNNING": "Oculus не запущен", "OCULUS_NOT_RUNNING": "Oculus не запущен",
"BS_ALREADY_RUNNING": "Beat Saber уде запущен", "BS_ALREADY_RUNNING": "Beat Saber уде запущен",
"EXE_NOT_FINDED": "Отсутствуют файлы", "EXE_NOT_FINDED": "Отсутствуют файлы",
"EXIT": "Вылет" "EXIT": "Вылет",
"OCULUS_LIB_NOT_FOUND": "Библиотека Oculus не найдена"
}, },
"msg": { "msg": {
"UNKNOWN_ERROR": "Возникла неизвестная ошибка.", "UNKNOWN_ERROR": "Возникла неизвестная ошибка.",
"STEAM_NOT_RUNNING": "Steam должен быть запущен, чтобы запустить BeatSaber.", "STEAM_NOT_RUNNING": "Steam должен быть запущен, чтобы запустить Beat Saber.",
"OCULUS_NOT_RUNNING": "Oculus должен быть запущен, чтобы запустить BeatSaber.", "OCULUS_NOT_RUNNING": "Oculus должен быть запущен, чтобы запустить Beat Saber.",
"BS_ALREADY_RUNNING": "Закройте BeatSaber, чтобы запустить его.", "BS_ALREADY_RUNNING": "Закройте Beat Saber, чтобы запустить его.",
"EXE_NOT_FINDED": "Некоторые файлы отсутствуют, пробуем их проверить.", "EXE_NOT_FINDED": "Некоторые файлы отсутствуют, пробуем их проверить.",
"EXIT": "BeatSaber вылетел, пытаемся проверить файлы." "EXIT": "Beat Saber вылетел, пытаемся проверить файлы.",
"OCULUS_LIB_NOT_FOUND": "Проверьте, правильно ли установлено приложение Oculus, и правильно ли определены библиотеки в Oculus."
}, },
"actions": { "actions": {
"STEAM_NOT_RUNNING": "Запустить Steam" "STEAM_NOT_RUNNING": "Запустить Steam"
@@ -467,6 +498,11 @@
"misc": { "misc": {
"remember-my-choice": "Запомнить выбор" "remember-my-choice": "Запомнить выбор"
}, },
"choose-store": {
"title": "Какая платформа?",
"body": "Выберите платформу, с которой вы хотите скачать Beat Saber.",
"set-in-settings": "Установить платформу по умолчанию в настройках"
},
"guard": { "guard": {
"title": "Steam Guard", "title": "Steam Guard",
"inputs": { "inputs": {
@@ -521,6 +557,8 @@
"bs-import-version": { "bs-import-version": {
"title": "Импорт версии", "title": "Импорт версии",
"description": "Импортировать версию Beat Saber, чтобы использоваться BSManager. Beat Saber будет скопирован в папку версий BSManager.", "description": "Импортировать версию Beat Saber, чтобы использоваться BSManager. Beat Saber будет скопирован в папку версий BSManager.",
"oculus-version": "Версия Oculus",
"oculus-version-tooltip": "Отметьте, если это версия для Oculus",
"buttons": { "buttons": {
"submit": "Импортировать версию" "submit": "Импортировать версию"
} }
@@ -641,6 +679,38 @@
"launch-options": "Параметры запуска", "launch-options": "Параметры запуска",
"advanced-launch": "Расширенный запуск", "advanced-launch": "Расширенный запуск",
"valid-btn": "Создать ярлык" "valid-btn": "Создать ярлык"
},
"connect-to-meta":{
"title": "Подключение к Meta",
"body":{
"token-needed": "Для скачивания Beat Saber необходим ваш токен подключения к Meta.",
"need-cookie-enabled": "При входе в Meta откроется окно входа, и вы сможете начать процесс входа. Пожалуйста, убедитесь, что вы приняли cookies, иначе мы можем не суметь получить ваш токен для начала загрузки.",
"enter-token-manually": "Ввести мой токен входа вручную",
"enter-token-manually-tooltip": "Это позволит вам ввести ваш токен входа без прохождения через вход в Meta."
},
"stay":"Запомнить меня",
"connect-to-meta": "Подключиться к Meta"
},
"original-version-backup-oculus": {
"title": "Внимание",
"body": {
"must-be-installed-once": "Вы должны были установить Beat Saber хотя бы один раз из Oculus Store, иначе Beat Saber может автоматически закрыться после запуска.",
"need-backup": "Для запуска этой версии папка установки Beat Saber в вашей библиотеке Oculus будет переименована.",
"can-restore-later": "При необходимости вы можете восстановить её через BSManager, перейдя в опции оригинальной версии Oculus и нажав на 'Восстановить папку'",
"tips-launch-oculus": "Совет: Вы можете запустить эту версию напрямую через Oculus, пока оригинальная версия не восстановлена."
},
"not-remind-me": "Больше не напоминать",
"understood": "Понял"
},
"enter-meta-token": {
"title": "Мета Токен",
"body": {
"need-token": "Для загрузки Beat Saber требуется ваш токен входа в Meta.",
"how-obtain-token": "Как получить мой Мета Токен?",
"input-label": "Мета Токен",
"token-is-invalid": "Токен недействителен."
},
"valid-btn": "Подтвердить"
} }
}, },
"maps": { "maps": {
+984
View File
@@ -0,0 +1,984 @@
{
"misc": {
"download": "下载",
"add": "添加",
"verify": "验证",
"launch": "启动",
"mods": "Mod",
"maps": "谱面",
"playlists": "歌单",
"models": "模型",
"cancel": "取消",
"delete": "删除",
"accept": "接受",
"refuse": "拒绝",
"apply": "应用",
"copy": "复制",
"copied": "已复制!"
},
"nav-bar": {
"add-version": "添加版本",
"settings": "设置",
"shared": {
"text": "共享",
"tooltip": "共享内容"
}
},
"pages": {
"shared-maps": {
"title": "共享谱面"
},
"version-viewer": {
"launch-mods": {
"oculus": "Oculus 模式",
"oculus-description": "若使用 Steam 版 BeatSaber,这允许你在绕过 SteamVR 的同时使用 Oculus 的 VR comsposer,可能会有性能提升。(不只是 Oculus 头显)",
"desktop": "FPFC 模式",
"desktop-description": "第一人称飞控模式允许你使用键盘 WASD 和鼠标在游戏中进行导航。你无需带上头显即可进行测试!",
"debug": "Debug 模式",
"debug-description": "为 IPA 启用输出日志窗口。 会显示所用 Mod 的 debug 输出",
"advanced-launch": {
"button": "高级启动",
"placeholder": "额外启动参数,例如: --revert; --nowait"
}
},
"maps": {
"title": "Shared maps",
"search-bar": {
"search-placeholder": "谱面搜索",
"filters-btn": "筛选",
"dropdown": {
"export-maps": "导出谱面",
"delete-maps": "删除谱面"
}
},
"tabs": {
"maps": {
"actions": {
"add-maps": {
"text": "添加"
},
"link-maps": {
"tooltips": {
"link": "Link maps",
"unlink": "Unlink maps"
}
}
},
"empty-maps": {
"text": "无谱面",
"button": "下载谱面"
}
}
}
},
"mods": {
"loading-mods": "Mod 加载中...",
"no-internet": "无网络",
"mods-not-available": "该版本 BeatSaber 暂无可用 Mod",
"buttons": {
"more-infos": "更多信息",
"install-or-update": "安装或更新"
},
"mods-grid": {
"header-bar": {
"name": "名称",
"installed": "已安装",
"latest": "最新",
"description": "描述",
"dropdown": {
"uninstall-all": "全部卸载"
}
}
}
},
"dropdown": {
"open-folder": "打开文件夹",
"verify-files": "验证文件",
"clone": "Clone",
"edit": "编辑",
"uninstall": "卸载",
"create-shortcut": "创建快捷方式",
"shared-folders": "Shared Folders",
"restore-oculus-folder": "Restore the folder"
}
},
"available-versions": {
"title": "选择版本",
"steam-release": "发布页面",
"dropdown": {
"refresh": "刷新版本",
"import-version": "导入版本"
},
"recommended": "推荐",
"recommended-tooltip": "多 Mod 版本"
},
"settings": {
"steam-and-oculus": {
"title": "Steam & Oculus",
"description": "登出后,您可以在下一次下载 Beat Saber 时切换帐户。",
"logout": "登出",
"download-platform": {
"title": ",默认平台",
"desc": "选择要下载 BeatSaber 的默认平台。",
"always-ask": "总是询问"
}
},
"appearance": {
"title": "外观",
"description": "选择 BSManager 的两种主题色",
"reset": "重置",
"sub-title": "主题",
"themes": {
"dark": "Dark",
"light": "Light",
"os": "与系统保持同步"
}
},
"installation-folder": {
"title": "安装文件夹",
"description": "为 BeatSaber 不同版本及未来其他特性修改默认文件夹",
"choose-folder": "选择文件夹"
},
"additional-content": {
"title": "附加内容",
"description": "允许你自定义 BeatSaber 的附加内容!",
"deep-links": {
"sub-title": "一键安装"
}
},
"language": {
"title": "语言",
"description": "选择语言",
"languages": {
"en-EN": "English, UK",
"en-US": "English, US",
"fr-FR": "Français",
"es-ES": "Español",
"de-DE": "Deutsch",
"ru-RU": "Русский",
"zh-CN": "简体中文",
"translated": {
"en-EN": "英式英语",
"en-US": "美式英语",
"fr-FR": "法语",
"es-ES": "西班牙语",
"de-DE": "德语",
"ru-RU": "俄语",
"zh-CN": "简体中文"
}
}
},
"patreon": {
"title": "支持 BSManager 💖",
"description": "支持该项目并帮助我们持续改进 BSManager。",
"buttons": {
"support": "支持 BSManager 🥰",
"supporters": "支持者 👀"
},
"view": {
"no-supporters": "暂无支持者",
"sponsors": "赞助者",
"supporters": "支持者"
}
},
"discord": {
"description": "在社交媒体上关注我们,加入 BSManager 社区!"
},
"contribution": {
"description": "建议新功能或报告错误以帮助改进 BSManager",
"buttons": {
"request-features": "请求新功能",
"report-bug": "报告 bug",
"open-logs": "打开日志"
}
}
}
},
"notifications": {
"types": {
"error": "🚨 错误",
"warning": "⚠️ 警告",
"success": "🎉 成功"
},
"common": {
"msg": {
"error-occurred": "发生了一个错误"
}
},
"shared": {
"errors": {
"titles": {
"operation-running": "操作进行中",
"no-internet": "无网络"
},
"msg": {
"operation-running": "等待当前操作完成,然后重试。",
"no-internet": "检查你的连接并重试。"
}
}
},
"bs-download": {
"success": {
"titles": {
"download-success": "下载完成",
"verification-finished": "验证完成"
}
},
"steam-download": {
"warnings": {
"msg": {
"ManifestChecksum": "之前下载的清单与新的清单不匹配 🤔",
"ConnectionTimeout": "你的网络连接似乎不稳定 🥶",
"ConnectionLost": "连接已丢失,请重试...",
"ConnectionError": "无法连接到 Steam,请重试...",
"Unknown": "发生了奇怪的事情 🤔 你的连接可能不稳定。"
}
},
"errors": {
"titles": {
"dotnet-required": "需要 .NET 6"
},
"msg": {
"401": "Steam 似乎不想让我们下载 Beat Saber😢",
"404": "无法联系 Steam 服务器。",
"Password": "密码无效",
"InvalidCredentials": "登录凭据无效、连接未经批准或登录尝试次数过多。",
"NoManifest": "未找到清单",
"DirectoryCreate": "无法安装必要的文件夹。",
"NotAvailableApp": "您是否在没有安装 BeatSaber 的情况下尝试下载?🤣",
"DepotNotFound": "无法下载 Beat Saber 😥 稍后重试 😕",
"NotCompleted": "下载无法完成 ¯\\_(ツ)_/¯",
"InvalidManifest": "无法下载 Beat Saber 😥 稍后重试 😕",
"NoValidKey": "无法下载 Beat Saber 😥 稍后重试 😕",
"NoManifestCode": "无法下载 Beat Saber 😥 稍后重试 😕",
"Unknown": "发生了一个错误 ¯\\_(ツ)_/¯",
"NoServer": "U无法联系 Steam 服务器。",
"NotAllowed": "显然你没有下载 Beat Saber 的许可 🥱",
"ConnectionTimeout": "无法连接到 Steam 😕",
"SteamLib": "如果你遇到此错误,请在 GitHub 上报告该错误并附上日志。",
"ConnectionError": "尝试 10 次后仍无法连接到 Steam🤯",
"LicenceError": "无法获取许可证列表。",
"RateLimitExceeded": "你已经尝试了太多次,请稍等片刻,稍后再试。",
"TokenRejected": "你的登录令牌已被拒绝 😕 请重试。",
"AccessDenied": "访问 Steam 被拒绝。",
"dotnet-required": "必须安装 .NET 6 Runtime 才能下载 Beat Saber 版本。单击下面的按钮下载它。"
},
"actions": {
"download-dotnet": "下载 .NET 6"
}
}
},
"oculus-download": {
"errors": {
"msg": {
"DOWNLOAD_MANIFEST_FAILED": "无法下载此版本的清单;你的登录令牌可能无效。",
"MANIFEST_FILE_NOT_FOUND": "找不到此版本的清单。",
"PARSE_MANIFEST_FILE_FAILED": "读取清单时发生错误。",
"ALREADY_DOWNLOADING": "已经有一个版本在下载中。",
"UNABLE_TO_GET_MANIFEST": "无法获取下载所需的清单。",
"VERIFY_INTEGRITY_FAILED": "文件验证过程中发生错误。",
"SOME_FILES_FAILED_TO_DOWNLOAD": "一些文件下载失败。",
"OCULUS_LOGIN_TIMED_OUT": "获取登录令牌用时过长。",
"OCULUS_LOGIN_WINDOW_CLOSED_BY_USER": "Meta 登录窗口被关闭。",
"NO_META_AUTH_TOKEN": "无法获取下载所需的 Meta 登录令牌。",
"UNKNOWN_ERROR": "发生未知错误。"
}
}
}
},
"bs-import-version": {
"success": {
"start-import": {
"title": "正在导入 👌",
"desc": "导入可能需要几分钟时间(依赖于你如何配置)。"
},
"imported": {
"title": "已导入版本 🎉"
}
},
"errors": {
"import-error": {
"desc": "检查所选文件夹是否为 Beat Saber 的安装内容。"
}
}
},
"settings": {
"move-folder": {
"success": {
"titles": {
"transfer-started": "正在传输",
"transfer-finished": "传输完成"
},
"descs": {
"transfer-started": "传输已开始,可能需要几分钟时间(依赖于你如何配置)。"
}
},
"errors": {
"titles": {
"transfer-failed": "传输失败 😕"
},
"descs": {
"COPY_TO_SUBPATH": "目标文件夹不能是源文件夹的子文件夹。",
"restore-linked-folders": "恢复共享文件夹时发生错误。你仍然可以通过版本页面上的'共享文件夹'菜单手动恢复它们。"
}
}
},
"steam": {
"success": {
"titles": {
"logout": "断开与 Steam 的连接"
}
}
},
"additional-content": {
"deep-link": {
"select-all": "全选",
"activation": {
"success": {
"title": "一键安装激活成功!",
"description": "一键安装已被激活。"
},
"error": {
"description": "无法激活一键安装。"
}
},
"deactivation": {
"success": {
"title": "一键安装已停用!",
"description": "一键安装安装已被停用。"
},
"error": {
"description": "发生未知错误。"
}
},
"check-all-enabled": {
"title": "一键安装已禁用",
"description": "一个或多个一键安装被禁用。前往设置以启用它们。",
"actions": {
"settings": "设置",
"not-remind": "不再提醒"
}
}
}
}
},
"bs-launch": {
"success": {
"titles": {
"BS_LAUNCHING": "启动中...🚀",
"STEAM_LAUNCHING": "Steam 正在启动!"
},
"msg": {
"BS_LAUNCHING": "别忘了热身哦 😉",
"STEAM_LAUNCHING": "Beat Saber 会在 Steam 启动后自动启动。"
}
},
"errors": {
"titles": {
"UNKNOWN_ERROR": "无法启动",
"STEAM_NOT_RUNNING": "Steam 未运行",
"OCULUS_NOT_RUNNING": "Oculus 未运行",
"BS_ALREADY_RUNNING": "Beat Saber 已在运行",
"EXE_NOT_FINDED": "缺少文件",
"EXIT": "突然停止",
"OCULUS_LIB_NOT_FOUND": "未找到 Oculus 库"
},
"msg": {
"UNKNOWN_ERROR": "发生未知错误。",
"STEAM_NOT_RUNNING": "启动 BeatSaber 前必须运行 Steam。",
"OCULUS_NOT_RUNNING": "启动 BeatSaber 前必须运行 Oculus。",
"BS_ALREADY_RUNNING": "再次启动前请关闭 BeatSaber。",
"EXE_NOT_FINDED": "某些文件似乎丢失了,尝试验证文件。",
"EXIT": "BeatSaber 突然停止,请检查文件。",
"OCULUS_LIB_NOT_FOUND": "检查 Oculus 应用是否正确安装,以及库是否在 Oculus 中正确定义。"
},
"actions": {
"STEAM_NOT_RUNNING": "启动 Steam"
}
}
},
"steam": {
"steam-launching": {
"title": "Steam 正在启动!",
"description": "Beat Saber 会在 Steam 启动后自动启动。"
}
},
"custom-version": {
"errors": {
"titles": {
"CantEditSteam": "无法编辑",
"CantRename": "无法重命名",
"VersionAlreadExist": "该版本已存在",
"CantClone": "无法克隆"
},
"msg": {
"CantEditSteam": "你不能编辑 Steam 版本。不过你可以克隆它。"
}
},
"success": {
"titles": {
"CloningFinished": "克隆完成 🎉"
}
}
},
"mods": {
"install-mods": {
"titles": {
"success": "Mod 已安装 🎉",
"warning": "Mod 已安装 🤔"
},
"msg": {
"success": "所有 Mod 已被安装。",
"warning": "一个或多个 Mod 无法安装。",
"errors": {
"no-mods": "没有 Mod 可安装。",
"cannot-install-bsipa": "BSIPA安装失败 😨"
}
}
},
"uninstall-mod": {
"titles": {
"success": "Mod 已卸载 🎉"
},
"msg": {
"errors": {
"no-mods": "该 Mod 未安装 😑"
}
}
},
"uninstall-all-mods": {
"titles": {
"success": "所有 Mod 已卸载 🎉"
},
"msg": {
"success": "所有 Mod 已被卸载。",
"errors": {
"no-mods": "该版本中没有安装 Mod 😑"
}
}
}
},
"maps": {
"one-click-install": {
"success": "谱面安装完成",
"error": "安装谱面时发生错误"
}
},
"playlists": {
"one-click-install": {
"success": "歌单安装完成",
"error": "歌单安装时发生错误"
}
},
"models": {
"one-click-install": {
"success": "模型安装完成",
"error": "模型安装时发生错误"
}
},
"shared-folder": {
"info": {
"userdata-backup-created": {
"title": "备份已创建",
"msg": "共享 “UserData” 文件夹可能会产生错误,如果出现问题,请取消关联该文件夹以恢复备份"
}
}
},
"create-launch-shortcut": {
"success": {
"title": "快捷方式已创建",
"msg": "快捷方式已在桌面上创建"
},
"error": {
"msg": "创建快捷方式时发生错误"
}
}
},
"modals": {
"misc": {
"remember-my-choice": "记住我的选择"
},
"choose-store": {
"title": "选择哪个平台?",
"body": "选择你希望为其下载 BeatSaber 的平台。",
"set-in-settings": "在设置中设定默认平台"
},
"guard": {
"title": "Steam Guard",
"inputs": {
"guard-code": {
"label": "Guard Code",
"placeholder": "输入你的 Guard Code"
}
},
"buttons": {
"submit": "登录"
}
},
"steam-login": {
"title": "Steam登录",
"inputs": {
"username": {
"label": "使用账户名登录",
"placeholder": "输入你的账户名"
},
"password": {
"label": "密码",
"placeholder": "输入你的密码",
"max-length-warning": "密码超过64个字符!如果密码无效,请尝试只输入前64个字符。"
},
"qr":{
"label": "或使用二维码",
"note":{
"use-the":"使用",
"steam-mobile-app": "Steam 移动应用",
"to-connect-with-qr": "通过二维码登录。"
}
},
"stay": "记住我"
},
"why-credentials": "为什么需要我的凭证?",
"need-help-to-connect": "我需要帮助以访问我的账户!",
"buttons": {
"submit": "登录"
}
},
"steam-auth-approve": {
"title": "等待确认",
"protected-by-mobile-auth": "账户受移动认证器保护。",
"use-steam-app-to-approve": "使用 Steam 移动应用程序确认连接...",
"not-access-to-steam-app": "我无法访问 Steam 移动应用程序"
},
"steam-credentials": {
"title": "Steam 凭证",
"p-1": "凭证仅用于下载游戏,因为 Steam 需要验证你是否已经购买了游戏,以便允许你下载它。它们不会被保存,而是直接传递给 DepotDownloader。如果你不想输入你的凭证,你可以按照此教程操作:",
"p-2": "然后点击右上角的齿轮图标,选择“导入版本”,选择 Beat Saber 已下载的文件夹(如果你按照上面的教程,你应该会得到正确的位置)"
},
"bs-import-version": {
"title": "导入版本",
"description": "导入 Beat Saber 版本以与 BSManager 一起使用。这将把所选的 Beat Saber 安装文件夹复制到 BSManager 版本文件夹。",
"oculus-version": "Oculus 版本",
"oculus-version-tooltip": "检查是否为 Oculus 版本",
"buttons": {
"submit": "导入版本"
}
},
"bs-uninstall": {
"title": "卸载",
"description": "你确定要卸载 Beat Saber {version} 吗?你将不得不重新下载它才能游玩。",
"buttons": {
"submit": "卸载"
}
},
"install-folder": {
"title": "安装文件夹",
"description": "更改默认安装文件夹将导致所有已安装数据移动到新文件夹。",
"buttons": {
"submit": "选择文件夹"
}
},
"edit-version": {
"title": "编辑版本",
"buttons": {
"submit": "编辑"
}
},
"clone-version": {
"title": "克隆版本",
"description": "克隆版本可以让你在两个版本之间分离附加的 BeatSaber 内容。",
"inputs": {
"name": {
"label": "名称",
"placeholder": "版本名称"
},
"color": {
"label": "颜色"
}
},
"buttons": {
"submit": "克隆"
}
},
"uninstall-mod": {
"title": "卸载",
"description": "你确定要卸载 {mod} 吗?这可能会导致其他已安装的 Mod 失效。",
"description-bsipa": "你确定要卸载 BSIPA 吗?之后所有已安装的 Mod 将不再起作用。"
},
"uninstall-all-mods": {
"title": "Mod 卸载中",
"description": "你确定要卸载 {version} 版本的所有 Mod 卸载吗?该操作无法回退。"
},
"maps-actions": {
"delete-maps": {
"title": {
"single": "删除该谱面?",
"multiple": "删除谱面?"
},
"desc": {
"single": "你确定要删除谱面 {name} 吗?",
"multiple": "你确定要删除全部 {nb} 个谱面吗?"
},
"info": {
"desc": {
"single": "该谱面是共享谱面的一部分",
"multiple": "这些谱面是共享谱面的一部分"
},
"title": {
"single": "该谱面也将从使用共享谱面的版本中移除",
"multiple": "这些谱面也将从使用共享谱面的版本中移除"
}
}
},
"link-maps": {
"title": "关联谱面",
"desc": "关联谱面可以在所有启用此功能的版本之间共享谱面。一旦关联,该版本将受益于共享谱面。",
"info": "添加和删除的谱面也将被共享",
"keep-maps": {
"label": "保留谱面",
"title": "保留谱面将会把当前版本的所有谱面复制到共享谱面文件夹。否则,该版本的谱面将不会被保留,它们将丢失。"
},
"valid-btn": "关联谱面"
},
"unlink-maps": {
"title": "取消关联谱面",
"desc": "请注意,取消关联谱面后该版本将无法使用共享谱面,直到重新启用。",
"keep-maps": {
"label": "保留谱面",
"title": "保留谱面将会在取消关联后把共享文件夹的所有谱面复制到当前版本。如果此项被禁用,谱面也不会丢失。"
},
"valid-btn": "取消关联谱面"
}
},
"download-maps": {
"search-btn": "搜索",
"loading-maps": "谱面加载中...",
"no-maps-found": "未找到谱面",
"no-internet": "无网络"
},
"mods-disclaimer": {
"title": "免责声明",
"p-1": "选择使用 Mod,你需要理解:",
"li-1": "你可能会遇到原版游戏中不存在的问题。99.9%的bug、崩溃和延迟都是由 Mod 引起的。",
"li-2": "模组可能会因更新而失效,这是正常的——当这种情况发生时,请保持耐心和尊重,因为模组制作者都是有真实生活的志愿者。",
"li-3": "Beat Games并不是故意想要破坏 Mod。他们希望能够修改代码库,有时这会破坏 Mod,但他们并不是想要消灭 Mod。",
"p-2": "不要因为与 Mod 相关的问题攻击游戏开发者,反之亦然——Mod 制作者和游戏开发者是两个不同的群体。总之,不要做个 SB。"
},
"shared-folders": {
"title": "共享文件夹",
"description": "关联 Beat Saber 文件夹,以便与其他版本中的共享文件夹同步其内容。请注意,删除操作也会被共享。",
"buttons": {
"add-folder": "添加文件夹",
"link-folder": "关联文件夹",
"unlink-folder": "取消关联文件夹",
"link-all": "关联所有"
}
},
"create-launch-shortcut": {
"title": "创建快捷方式",
"desc": "创建快捷方式使得你可以在不通过 BSManager 的情况下以特定选项启动 BeatSaber",
"launch-options": "启动选项",
"advanced-launch": "高级启动",
"valid-btn": "创建快捷方式"
},
"connect-to-meta":{
"title": "连接到 Meta",
"body":{
"token-needed": "需要 Meta 登录令牌用于下载 Beat Saber。",
"need-cookie-enabled": "通过登录 Meta,将打开一个登录窗口,然后你可以开始登录过程。请确保接受 cookie,否则我们可能无法检索你的令牌以开始下载。",
"enter-token-manually": "手动输入我的登录令牌",
"enter-token-manually-tooltip": "这将允许你在不通过 Meta 登录的情况下输入你的登录令牌。"
},
"stay":"记住我",
"connect-to-meta": "连接到 Meta"
},
"original-version-backup-oculus": {
"title": "警告",
"body": {
"must-be-installed-once": "你必须至少从 Oculus 商店安装过一次 BeatSaber,否则 BeatSaber 可能会在启动后自动关闭。",
"need-backup": "要启动该版本,位于你的 Oculus 库中的 BeatSaber 安装文件夹将被重命名。",
"can-restore-later": "如果需要,你可以通过前往 BSManager 的原始 Oculus 版本选项并点击'恢复文件夹'来恢复它。",
"tips-launch-oculus": "提示:只要原始版本没有被恢复,你就可以直接从 Oculus 启动该版本。"
},
"not-remind-me": "不再提醒我",
"understood": "明白了"
},
"enter-meta-token": {
"title": "Meta 令牌",
"body": {
"need-token": "要下载 BeatSaber,需要你的 Meta 登录令牌。",
"how-obtain-token": "如何获取我的 Meta 令牌?",
"input-label": "Meta 令牌",
"token-is-invalid": "令牌无效。"
},
"valid-btn": "验证"
}
},
"maps": {
"map-filter-panel": {
"duration": "时长",
"tags": "标签",
"specificities": "general",
"requirements": "要求"
},
"map-types": {
"accuracy": "精确度",
"balanced": "平衡",
"challenge": "挑战",
"dancestyle": "舞蹈",
"fitness": "健身",
"speed": "速度",
"tech": "技术"
},
"map-styles": {
"dance": "dance",
"swing": "swing",
"nightcore": "nightcore",
"folk": "folk",
"family": "family",
"ambient": "ambient",
"funk": "funk",
"jazz": "jazz",
"soul": "soul",
"speedcore": "speedcore",
"punk": "punk",
"rb": "r&b",
"holiday": "holiday",
"vocaloid": "vocaloid",
"jrock": "j-rock",
"trance": "trance",
"drumbass": "drum & bass",
"comedy": "comedy",
"instrumental": "instrumental",
"hardcore": "hardcore",
"kpop": "k-pop",
"indie": "indie",
"techno": "techno",
"house": "house",
"game": "video game",
"film": "film",
"alt": "alternative",
"dubstep": "dubstep",
"metal": "metal",
"anime": "anime",
"hiphop": "hiphop",
"jpop": "j-pop",
"rock": "rock",
"pop": "pop",
"electronic": "electronic",
"classical-orchestral": "Classical & Orchestral"
},
"map-specificities": {
"automapper": "AI",
"ranked": "ranked",
"curated": "curated",
"verified": "verified",
"fullSpread": "full spread"
},
"difficulties": {
"Easy": "easy",
"Normal": "normal",
"Hard": "hard",
"Expert": "expert",
"ExpertPlus": "expert+"
},
"map-item": {
"by": "By {songAutor}",
"mapped-by": "mapped by"
}
},
"models": {
"types": {
"singular": {
"avatar": "avatar",
"saber": "光剑",
"platform": "平台",
"bloq": "方块"
},
"plural": {
"avatar": "avatars",
"saber": "光剑",
"platform": "平台",
"bloq": "方块"
}
},
"sorts": {
"name": "名称",
"date": "日期",
"author": "作者"
},
"panel": {
"actions": {
"search": "搜索模型",
"drop-down": {
"delete": "删除模型",
"export": "导出模型"
},
"link-models": "关联模型",
"unlink-models": "取消关联模型"
},
"grid": {
"loading": "模型加载中...",
"no-models": "无模型",
"download-models": "下载模型"
}
},
"modals": {
"delete-model": {
"title": "删除该模型",
"desc": "确定要删除模型 {modelName} 吗?",
"linked-annotation": "该模型将从所有关联版本中移除。"
},
"delete-models": {
"title": "删除模型",
"desc": "确定要删除 {nb} 个模型吗?",
"linked-annotation": "这些模型将从所有关联版本中移除。"
},
"download-models": {
"search-btn": "搜索",
"search-placeholder": "搜索模型",
"search-tips": {
"header": {
"tag": "Tag",
"desc": "描述"
},
"author-desc": "仅显示指定作者的模型。",
"hash-desc": "仅显示具有指定哈希值的模型。",
"tag-desc": "仅显示具有指定 tag 的模型。",
"name-desc": "仅显示具有指定名称的模型。",
"discordid-desc": "仅显示来自指定 Discord 用户的模型。",
"status-desc": "仅显示具有指定状态的模型。(仅限个人资料,且仅限作者)"
},
"no-models": "未找到模型",
"no-internet": "无网络连接",
"error-occured": "发生了一个错误,稍后重试。"
},
"link-models": {
"avatar": {
"title": "关联 Avatar",
"desc": "关联 Avatar 允许在所有启用此功能的版本之间共享 Avatar。一旦关联,该版本将受益于共享 Avatar。",
"info": "对 Avatar 的添加和删除也将被共享",
"keep-models": {
"label": "保留 Avatar",
"title": "保留 Avatar 将会把当前版本的所有 Avatar复制到共享 Avatar文件夹。否则,该版本的 Avatar将不会被保留,它们将丢失。"
},
"valid-btn": "关联 Avatar "
},
"saber": {
"title": "关联光剑",
"desc": "关联光剑允许在所有启用此功能的版本之间共享光剑。一旦关联,该版本将受益于共享光剑。",
"info": "对光剑的添加和删除也将被共享",
"keep-models": {
"label": "保留光剑",
"title": "保留光剑将会把当前版本的所有光剑复制到共享光剑文件夹。否则,该版本的光剑将不会被保留,它们将丢失。"
},
"valid-btn": "关联光剑"
},
"platform": {
"title": "关联平台",
"desc": "关联平台允许在所有启用此功能的版本之间共享平台。一旦关联,该版本将受益于共享平台。",
"info": "对平台的添加和删除也将被共享",
"keep-models": {
"label": "保留平台",
"title": "保留平台将会把当前版本的所有平台复制到共享平台文件夹。否则,该版本的平台将不会被保留,它们将丢失。"
},
"valid-btn": "关联平台"
},
"bloq": {
"title": "关联方块",
"desc": "关联方块允许在所有启用此功能的版本之间共享方块。一旦关联,该版本将受益于共享方块。",
"info": "对方块的添加和删除也将被共享",
"keep-models": {
"label": "保留方块",
"title": "保留方块将会把当前版本的所有方块复制到共享方块文件夹。否则,该版本的方块将不会被保留,它们将丢失。"
},
"valid-btn": "关联方块"
}
},
"unlink-models": {
"avatar": {
"title": "取消关联 Avatar",
"desc": "请注意,取消关联 Avatar 将禁用该版本的共享 Avatar 使用,直到重新启用。",
"keep-models": {
"label": "保留 Avatar",
"title": "保留 Avatar 将会在取消关联后把共享文件夹的所有 Avatar 复制到当前版本。如果此项被禁用,Avatar 将不会丢失。"
},
"valid-btn": "取消关联 Avatar"
},
"saber": {
"title": "取消关联光剑",
"desc": "请注意,取消关联光剑将禁用该版本的共享光剑使用,直到重新启用。",
"keep-models": {
"label": "保留光剑",
"title": "保留光剑将会在取消关联后把共享文件夹的所有光剑复制到当前版本。如果此项被禁用,光剑将不会丢失。"
},
"valid-btn": "取消关联光剑"
},
"platform": {
"title": "取消关联平台",
"desc": "请注意,取消关联平台将禁用该版本的共享平台使用,直到重新启用。",
"keep-models": {
"label": "保留平台",
"title": "保留平台将会在取消关联后把共享文件夹的所有平台复制到当前版本。如果此项被禁用,平台将不会丢失。"
},
"valid-btn": "取消关联平台"
},
"bloq": {
"title": "取消关联方块",
"desc": "请注意,取消关联方块将禁用该版本的共享方块使用,直到重新启用。",
"keep-models": {
"label": "保留方块",
"title": "保留方块将会在取消关联后把共享文件夹的所有方块复制到当前版本。如果此项被禁用,方块将不会丢失。"
},
"valid-btn": "取消关联方块"
}
}
},
"notifications": {
"prevent-for-mods": {
"title": "需要的 Mod",
"desc": "确保你已经安装了在 BeatSaber 中使用模型所需的 Mod",
"go-to-mods": "前往 Mod 页",
"not-remind": "不再提醒我"
},
"prevent-for-models-breaks": {
"title": "已损坏的模型",
"desc": "因 BeatSaber 引擎更新,这些模型在该版本中不再可用。"
},
"export-success": {
"title": "导出成功 🎉"
}
}
},
"beat-saver": {
"maps-sorts": {
"Latest": "最新",
"Relevance": "相关",
"Rating": "评分",
"Curated": "Curated"
}
},
"auto-update": {
"checking": "检查更新中",
"downloading": "下载更新中"
},
"bs-shortcut-launch": {
"beat-saber-launching": "启动 Beat Saber",
"launching": "启动中",
"open-bsmanager": "打开 BSManager",
"status-text": {
"init": "正在初始化...",
"success": {
"BS_LAUNCHING": "Beat Saber 启动中...",
"STEAM_LAUNCHING": "Steam 启动中...",
"STEAM_LAUNCHED": "Steam 成功启动!",
"UNABLE_TO_LAUNCH_STEAM": "无法启动 Steam, 强制启动 Beat Saber ..."
}
}
},
"dateformat": {
"dayNames": ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
"monthNames": ["1 月", "2 月", "3 月", "4 月", "5 月", "6 月", "7 月", "8 月", "9 月", "10 月", "11 月", "12 月", "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
"timeNames": ["上午", "下午", "上午", "下午", "上午", "下午", "上午", "下午"]
}
}
+415 -259
View File
File diff suppressed because it is too large Load Diff
+18 -10
View File
@@ -14,7 +14,7 @@
"start:preload": "cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.preload.dev.ts", "start:preload": "cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.preload.dev.ts",
"start:renderer": "cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack serve --config ./.erb/configs/webpack.config.renderer.dev.ts", "start:renderer": "cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack serve --config ./.erb/configs/webpack.config.renderer.dev.ts",
"test": "jest", "test": "jest",
"publish": "npm run build && electron-builder --publish always --win --x64" "publish": "npm run build && electron-builder -c.win.certificateSha1=842a817a51e2a1d360fcd62f54bf5f9193e919e1 --publish always --win --x64"
}, },
"lint-staged": { "lint-staged": {
"*.{js,jsx,ts,tsx}": [ "*.{js,jsx,ts,tsx}": [
@@ -32,7 +32,10 @@
}, },
"build": { "build": {
"extraResources": [ "extraResources": [
"./assets/**" "./assets/favicon.ico",
"./assets/jsons/bs-versions.json",
"./assets/jsons/patreons.json",
"./assets/scripts/**"
], ],
"productName": "BSManager", "productName": "BSManager",
"appId": "org.erb.BSManager", "appId": "org.erb.BSManager",
@@ -43,6 +46,7 @@
"package.json" "package.json"
], ],
"afterSign": ".erb/scripts/notarize.js", "afterSign": ".erb/scripts/notarize.js",
"afterPack": ".erb/scripts/after-pack.js",
"mac": { "mac": {
"target": { "target": {
"target": "default", "target": "default",
@@ -76,8 +80,7 @@
"nsis", "nsis",
"nsis-web" "nsis-web"
], ],
"icon": "assets/favicon.ico", "icon": "assets/favicon.ico"
"certificateSha1": "f3363a89b084f8f6b616babea3c91f9d79e15000"
}, },
"linux": { "linux": {
"target": [ "target": [
@@ -156,6 +159,7 @@
"@types/jest": "^27.5.2", "@types/jest": "^27.5.2",
"@types/node": "17.0.23", "@types/node": "17.0.23",
"@types/node-fetch": "^2.6.3", "@types/node-fetch": "^2.6.3",
"@types/pako": "^2.0.1",
"@types/react": "^18.0.33", "@types/react": "^18.0.33",
"@types/react-dom": "^18.0.11", "@types/react-dom": "^18.0.11",
"@types/react-outside-click-handler": "^1.3.1", "@types/react-outside-click-handler": "^1.3.1",
@@ -179,7 +183,7 @@
"css-loader": "^6.7.1", "css-loader": "^6.7.1",
"css-minimizer-webpack-plugin": "^4.1.0", "css-minimizer-webpack-plugin": "^4.1.0",
"detect-port": "^1.3.0", "detect-port": "^1.3.0",
"electron": "^25.3.0", "electron": "^27.0.0",
"electron-builder": "^24.6.3", "electron-builder": "^24.6.3",
"electron-devtools-installer": "^3.2.0", "electron-devtools-installer": "^3.2.0",
"electron-notarize": "^1.2.1", "electron-notarize": "^1.2.1",
@@ -229,24 +233,27 @@
"webpack-merge": "^5.8.0" "webpack-merge": "^5.8.0"
}, },
"dependencies": { "dependencies": {
"@electron/fuses": "^1.6.2",
"@node-steam/vdf": "^2.2.0", "@node-steam/vdf": "^2.2.0",
"@tippyjs/react": "^4.2.6", "@tippyjs/react": "^4.2.6",
"archiver": "^5.3.1", "archiver": "^6.0.1",
"color": "^4.2.3", "color": "^4.2.3",
"dateformat": "^5.0.3", "dateformat": "^5.0.3",
"dot-prop": "^8.0.0", "dot-prop": "^8.0.2",
"electron-debug": "^3.2.0", "electron-debug": "^3.2.0",
"electron-log": "^4.4.8", "electron-log": "^4.4.8",
"electron-store": "^8.1.0", "electron-store": "^8.1.0",
"electron-updater": "^6.1.4", "electron-updater": "^6.1.5",
"fast-deep-equal": "^3.1.3", "fast-deep-equal": "^3.1.3",
"framer-motion": "^10.12.16", "framer-motion": "^10.16.4",
"fs-extra": "^11.1.1", "fs-extra": "^11.1.1",
"history": "^5.3.0", "history": "^5.3.0",
"jszip": "^3.10.1", "jszip": "^3.10.1",
"md5-file": "^5.0.0", "md5-file": "^5.0.0",
"node-abi": "^3.47.0",
"node-fetch": "^2.6.7", "node-fetch": "^2.6.7",
"node-stream-zip": "^1.15.0", "node-stream-zip": "^1.15.0",
"pako": "^2.1.0",
"ps-list": "^7.2.0", "ps-list": "^7.2.0",
"qrcode.react": "^3.1.0", "qrcode.react": "^3.1.0",
"react": "^18.2.0", "react": "^18.2.0",
@@ -261,7 +268,8 @@
"rfdc": "^1.3.0", "rfdc": "^1.3.0",
"rxjs": "^7.8.0", "rxjs": "^7.8.0",
"sanitize-filename": "^1.6.3", "sanitize-filename": "^1.6.3",
"semver": "^7.5.1", "semver": "^7.5.4",
"serialize-error": "^8.1.0",
"striptags": "^4.0.0-alpha.4", "striptags": "^4.0.0-alpha.4",
"tailwind-scrollbar-hide": "^1.1.7", "tailwind-scrollbar-hide": "^1.1.7",
"tailwindcss-scoped-groups": "^2.0.0", "tailwindcss-scoped-groups": "^2.0.0",
+855 -246
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -1,6 +1,6 @@
{ {
"name": "bs-manager", "name": "bs-manager",
"version": "1.3.0", "version": "1.4.0",
"description": "BSManager", "description": "BSManager",
"main": "./dist/main/main.js", "main": "./dist/main/main.js",
"author": { "author": {
@@ -14,8 +14,8 @@
"postinstall": "npm run electron-rebuild && npm run link-modules" "postinstall": "npm run electron-rebuild && npm run link-modules"
}, },
"dependencies": { "dependencies": {
"@resvg/resvg-js": "^2.4.1", "ps-list": "^7.2.0",
"ps-list": "^7.2.0" "sharp": "^0.32.6"
}, },
"license": "MIT" "license": "MIT"
} }
+1
View File
@@ -3,6 +3,7 @@ import path from "path";
export const BS_EXECUTABLE = "Beat Saber.exe"; export const BS_EXECUTABLE = "Beat Saber.exe";
export const OCULUS_BS_DIR = "hyperbolic-magnetism-beat-saber"; export const OCULUS_BS_DIR = "hyperbolic-magnetism-beat-saber";
export const OCULUS_BS_BACKUP_DIR = `${OCULUS_BS_DIR}.bsmbak`;
export const BS_APP_ID = "620980"; export const BS_APP_ID = "620980";
export const BS_DEPOT = "620981"; export const BS_DEPOT = "620981";
export const APP_NAME = "BSManager"; export const APP_NAME = "BSManager";
+82 -2
View File
@@ -1,9 +1,10 @@
import { CopyOptions, copy, ensureDir, move, symlink } from "fs-extra"; import { CopyOptions, copy, createReadStream, ensureDir, move, realpath, stat, symlink } from "fs-extra";
import { access, mkdir, rm, readdir, unlink, lstat, readlink } from "fs/promises"; import { access, mkdir, rm, readdir, unlink, lstat, readlink } from "fs/promises";
import path from "path"; import path from "path";
import { Observable } from "rxjs"; import { Observable, concatMap, from } from "rxjs";
import log from "electron-log"; import log from "electron-log";
import { BsmException } from "shared/models/bsm-exception.model"; import { BsmException } from "shared/models/bsm-exception.model";
import crypto from "crypto";
export async function pathExist(path: string): Promise<boolean> { export async function pathExist(path: string): Promise<boolean> {
try { try {
@@ -153,8 +154,87 @@ export async function copyDirectoryWithJunctions(src: string, dest: string, opti
} }
} }
export function hashFile(filePath: string, algorithm = "sha256"): Promise<string> {
return new Promise((resolve, reject) => {
const shasum = crypto.createHash(algorithm);
const stream = createReadStream(filePath);
stream.on("data", data => shasum.update(data));
stream.on("error", reject);
stream.on("close", () => resolve(shasum.digest("hex")));
});
}
export async function dirSize(dirPath: string): Promise<number>{
const entries = await readdir(dirPath);
const paths = entries.map(async entry => {
const fullPath = path.join(dirPath, entry);
const realPath = await realpath(fullPath);
const stat = await lstat(realPath);
if (stat.isDirectory()) {
return dirSize(fullPath);
}
if (stat.isFile()) {
return stat.size;
}
return 0;
});
return (await Promise.all(paths)).flat(Infinity).reduce((acc, size ) => acc + size, 0);
}
export function rxCopy(src: string, dest: string, option?: CopyOptions): Observable<Progression> {
const dirSizePromise = dirSize(src).catch(err => {
log.error("dirSizePromise", err);
return 0;
});
return from(dirSizePromise).pipe(
concatMap(totalSize => {
const progress: Progression = { current: 0, total: totalSize };
return new Observable<Progression>(sub => {
sub.next(progress);
copy(src, dest, {...option, filter: (src) => {
stat(src).then(stats => {
progress.current += stats.size;
sub.next(progress);
});
return true;
}})
.then(() => sub.complete()).catch(err => sub.error(err))
})
})
);
}
export async function ensurePathNotAlreadyExist(path: string): Promise<string> {
let destPath = path;
let folderExist = await pathExist(destPath);
let i = 0;
while (folderExist) {
i++;
destPath = `${path} (${i})`;
folderExist = await pathExist(destPath);
}
return destPath;
}
export async function isJunction(path: string): Promise<boolean>{
const [stats, lstats] = await Promise.all([stat(path), lstat(path)]);
return lstats.isSymbolicLink() && stats.isDirectory();
}
export interface Progression<T = unknown> { export interface Progression<T = unknown> {
total: number; total: number;
current: number; current: number;
diff?: number;
data?: T; data?: T;
} }
+13
View File
@@ -0,0 +1,13 @@
import log from "electron-log";
import psList from "ps-list";
export async function taskRunning(task: string): Promise<boolean> {
try {
const processes = await psList();
return processes.some(process => process.name?.includes(task) || process.cmd?.includes(task));
}
catch(error){
log.error(error);
return false;
}
}
-51
View File
@@ -1,51 +0,0 @@
import { BSInstallerService, DownloadInfo } from "../services/bs-installer.service";
import { InstallationLocationService } from "../services/installation-location.service";
import { IpcService } from "../services/ipc.service";
import { from, of } from "rxjs";
const ipc = IpcService.getInstance();
ipc.on("is-dotnet-6-installed", (_, reply) => {
const installer = BSInstallerService.getInstance();
reply(from(installer.isDotNet6Installed()));
});
ipc.on("bs-download.installation-folder", (_, reply) => {
const installLocation = InstallationLocationService.getInstance();
reply(of(installLocation.installationDirectory));
});
ipc.on<string>("bs-download.set-installation-folder", (req, reply) => {
const installerService = InstallationLocationService.getInstance();
reply(from(installerService.setInstallationDirectory(req.args)));
});
ipc.on<string>("bs-download.import-version", (req, reply) => {
const installer = BSInstallerService.getInstance();
reply(from(installer.importVersion(req.args)));
});
ipc.on<DownloadInfo>("auto-download-bs-version", (req, reply) => {
const bsInstaller = BSInstallerService.getInstance();
reply(bsInstaller.autoDownloadBsVersion(req.args));
});
ipc.on<DownloadInfo>("download-bs-version", (req, reply) => {
const bsInstaller = BSInstallerService.getInstance();
reply(bsInstaller.downloadBsVersion(req.args))
});
ipc.on<DownloadInfo>("download-bs-version-qr", (req, reply) => {
const bsInstaller = BSInstallerService.getInstance();
reply(bsInstaller.downloadBsVersionWithQRCode(req.args))
});
ipc.on("stop-download-bs-version", (_, reply) => {
const bsInstaller = BSInstallerService.getInstance();
reply(of(bsInstaller.stopDownload()));
});
ipc.on<string>("send-input-bs-download", (req, reply) => {
const bsInstaller = BSInstallerService.getInstance();
reply(of(bsInstaller.sendInput(req.args)));
});
+16 -1
View File
@@ -1,8 +1,10 @@
import { LaunchOption } from "shared/models/bs-launch"; import { LaunchOption } from "shared/models/bs-launch";
import { BSLauncherService } from "../services/bs-launcher.service" import { BSLauncherService } from "../services/bs-launcher/bs-launcher.service"
import { IpcService } from '../services/ipc.service'; import { IpcService } from '../services/ipc.service';
import { from } from "rxjs"; import { from } from "rxjs";
import { SteamLauncherService } from "../services/bs-launcher/steam-launcher.service";
import { OculusLauncherService } from "../services/bs-launcher/oculus-launcher.service";
const ipc = IpcService.getInstance(); const ipc = IpcService.getInstance();
@@ -15,3 +17,16 @@ ipc.on<LaunchOption>("create-launch-shortcut", (req, reply) => {
const bsLauncher = BSLauncherService.getInstance(); const bsLauncher = BSLauncherService.getInstance();
reply(from(bsLauncher.createLaunchShortcut(req.args))); reply(from(bsLauncher.createLaunchShortcut(req.args)));
}); });
ipc.on<void>("bs-launch.restore-steamvr", (_, reply) => {
const steamLauncher = SteamLauncherService.getInstance();
reply(from(steamLauncher.restoreSteamVR()));
});
ipc.on<void>("restore-original-oculus-folder", (_, reply) => {
const oculusLauncher = OculusLauncherService.getInstance();
reply(from(
oculusLauncher.deleteBsSymlinks().then(() => oculusLauncher.restoreOriginalBeatSaber())
));
})
+2
View File
@@ -6,6 +6,7 @@ import { BsmLocalMap } from "shared/models/maps/bsm-local-map.interface";
import { BsvMapDetail } from "shared/models/maps"; import { BsvMapDetail } from "shared/models/maps";
import { IpcService } from "../services/ipc.service"; import { IpcService } from "../services/ipc.service";
import { from } from "rxjs"; import { from } from "rxjs";
import log from "electron-log"
const ipc = IpcService.getInstance(); const ipc = IpcService.getInstance();
@@ -71,6 +72,7 @@ ipc.on("one-click-install-map", async (request: IpcRequest<BsvMapDetail>) => {
utils.ipcSend(request.responceChannel, { success: true }); utils.ipcSend(request.responceChannel, { success: true });
}) })
.catch(err => { .catch(err => {
log.error(err);
utils.ipcSend(request.responceChannel, { success: false, error: err }); utils.ipcSend(request.responceChannel, { success: false, error: err });
}); });
}); });
+5 -11
View File
@@ -2,19 +2,13 @@ import { ipcMain } from "electron";
import { IpcRequest } from "shared/models/ipc"; import { IpcRequest } from "shared/models/ipc";
import { LocalPlaylistsManagerService } from "../services/additional-content/local-playlists-manager.service"; import { LocalPlaylistsManagerService } from "../services/additional-content/local-playlists-manager.service";
import { UtilsService } from "../services/utils.service"; import { UtilsService } from "../services/utils.service";
import { IpcService } from "../services/ipc.service";
ipcMain.on("one-click-install-playlist", async (event, request: IpcRequest<string>) => { const ipc = IpcService.getInstance();
const utils = UtilsService.getInstance();
const playlists = LocalPlaylistsManagerService.getInstance();
playlists ipc.on<string>("one-click-install-playlist", (req, reply) => {
.oneClickInstallPlaylist(request.args) const mapsManager = LocalPlaylistsManagerService.getInstance();
.then(() => { reply(mapsManager.oneClickInstallPlaylist(req.args));
utils.ipcSend(request.responceChannel, { success: true });
})
.catch(e => {
utils.ipcSend(request.responceChannel, { success: false, error: e });
});
}); });
ipcMain.on("register-playlists-deep-link", async (event, request: IpcRequest<void>) => { ipcMain.on("register-playlists-deep-link", async (event, request: IpcRequest<void>) => {
@@ -0,0 +1,86 @@
import { BsOculusDownloaderService } from "../../services/bs-version-download/bs-oculus-downloader.service";
import { BsSteamDownloaderService, DownloadInfo, DownloadSteamInfo } from "../../services/bs-version-download/bs-steam-downloader.service";
import { InstallationLocationService } from "../../services/installation-location.service";
import { IpcService } from "../../services/ipc.service";
import { from, of } from "rxjs";
import { BSLocalVersionService, ImportVersionOptions } from "../../services/bs-local-version.service";
const ipc = IpcService.getInstance();
ipc.on<ImportVersionOptions>("import-version", (req, reply) => {
const versionManager = BSLocalVersionService.getInstance();
reply(versionManager.importVersion(req.args));
});
// #region Steam
ipc.on("is-dotnet-6-installed", (_, reply) => {
const installer = BsSteamDownloaderService.getInstance();
reply(from(installer.isDotNet6Installed()));
});
ipc.on("bs-download.installation-folder", (_, reply) => {
const installLocation = InstallationLocationService.getInstance();
reply(from(installLocation.installationDirectory()));
});
ipc.on<string>("bs-download.set-installation-folder", (req, reply) => {
const installerService = InstallationLocationService.getInstance();
reply(from(installerService.setInstallationDirectory(req.args)));
});
ipc.on<DownloadSteamInfo>("auto-download-bs-version", (req, reply) => {
const bsInstaller = BsSteamDownloaderService.getInstance();
reply(bsInstaller.autoDownloadBsVersion(req.args));
});
ipc.on<DownloadSteamInfo>("download-bs-version", (req, reply) => {
const bsInstaller = BsSteamDownloaderService.getInstance();
reply(bsInstaller.downloadBsVersion(req.args))
});
ipc.on<DownloadSteamInfo>("download-bs-version-qr", (req, reply) => {
const bsInstaller = BsSteamDownloaderService.getInstance();
reply(bsInstaller.downloadBsVersionWithQRCode(req.args))
});
ipc.on("stop-download-bs-version", (_, reply) => {
const bsInstaller = BsSteamDownloaderService.getInstance();
reply(of(bsInstaller.stopDownload()));
});
ipc.on<string>("send-input-bs-download", (req, reply) => {
const bsInstaller = BsSteamDownloaderService.getInstance();
reply(of(bsInstaller.sendInput(req.args)));
});
// #endregion
// #region Oculus
ipc.on<DownloadInfo>("bs-oculus-download", async (req, reply) => {
const oculusDownloader = BsOculusDownloaderService.getInstance();
reply(oculusDownloader.downloadVersion(req.args));
});
ipc.on<DownloadInfo>("bs-oculus-auto-download", async (req, reply) => {
const oculusDownloader = BsOculusDownloaderService.getInstance();
reply(oculusDownloader.autoDownloadVersion(req.args));
});
ipc.on("bs-oculus-stop-download", async (_, reply) => {
const oculusDownloader = BsOculusDownloaderService.getInstance();
reply(of(oculusDownloader.stopDownload()));
});
ipc.on("bs-oculus-has-auth-token", async (_, reply) => {
const oculusDownloader = BsOculusDownloaderService.getInstance();
reply(from(oculusDownloader.getAuthToken().then(token => !!token)));
});
ipc.on("bs-oculus-clear-auth-token", async (_, reply) => {
const oculusDownloader = BsOculusDownloaderService.getInstance();
reply(from(oculusDownloader.clearAuthToken()));
});
// #endregion
+1 -1
View File
@@ -1,4 +1,3 @@
import "./bs-download-ipcs";
import "./os-controls-ipcs"; import "./os-controls-ipcs";
import "./bs-launcher-ipcs"; import "./bs-launcher-ipcs";
import "./bs-version-ipcs"; import "./bs-version-ipcs";
@@ -12,3 +11,4 @@ import "./beat-saver-ipcs";
import "./bs-playlist-ipcs"; import "./bs-playlist-ipcs";
import "./model-saber.ipcs"; import "./model-saber.ipcs";
import "./bs-model-ipcs"; import "./bs-model-ipcs";
import "./bs-version-download/bs-download-ipcs";
+2 -18
View File
@@ -1,4 +1,4 @@
import { ipcMain, shell, dialog, app } from "electron"; import { ipcMain, shell, dialog, app, BrowserWindow } from "electron";
import { UtilsService } from "../services/utils.service"; import { UtilsService } from "../services/utils.service";
import { IpcRequest } from "shared/models/ipc"; import { IpcRequest } from "shared/models/ipc";
import { SystemNotificationOptions } from "shared/models/notification/system-notification.model"; import { SystemNotificationOptions } from "shared/models/notification/system-notification.model";
@@ -11,21 +11,6 @@ import { from, of } from "rxjs";
const ipc = IpcService.getInstance(); const ipc = IpcService.getInstance();
ipcMain.on("window.maximize", async () => {
const utils = UtilsService.getInstance();
utils.getMainWindows("index.html")?.maximize();
});
ipcMain.on("window.minimize", async () => {
const utils = UtilsService.getInstance();
utils.getMainWindows("index.html")?.minimize();
});
ipcMain.on("window.reset", async () => {
const utils = UtilsService.getInstance();
utils.getMainWindows("index.html")?.restore();
});
ipcMain.on("new-window", async (event, request: IpcRequest<string>) => { ipcMain.on("new-window", async (event, request: IpcRequest<string>) => {
shell.openExternal(request.args); shell.openExternal(request.args);
}); });
@@ -35,8 +20,7 @@ ipc.on<string>("choose-folder", async (req, reply) => {
}); });
ipcMain.on("window.progression", async (event, request: IpcRequest<number>) => { ipcMain.on("window.progression", async (event, request: IpcRequest<number>) => {
const utils = UtilsService.getInstance(); BrowserWindow.fromWebContents(event.sender)?.setProgressBar(request.args / 100);
utils.getMainWindows("index.html")?.setProgressBar(request.args / 100);
}); });
ipcMain.on("save-file", async (event, request: IpcRequest<{ filename?: string; filters?: Electron.FileFilter[] }>) => { ipcMain.on("save-file", async (event, request: IpcRequest<{ filename?: string; filters?: Electron.FileFilter[] }>) => {
+20 -15
View File
@@ -1,12 +1,29 @@
import { WindowManagerService } from "../services/window-manager.service"; import { WindowManagerService } from "../services/window-manager.service";
import { AppWindow } from "shared/models/window-manager/app-window.model"; import { AppWindow } from "shared/models/window-manager/app-window.model";
import { BSLauncherService } from "../services/bs-launcher.service";
import { IpcService } from "../services/ipc.service"; import { IpcService } from "../services/ipc.service";
import { from, of } from "rxjs"; import { from } from "rxjs";
import { BrowserWindow, ipcMain } from "electron";
const launcher = BSLauncherService.getInstance();
const ipc = IpcService.getInstance(); const ipc = IpcService.getInstance();
// Native windows control, do not pass through IPC service
ipcMain.on("close-window", async (event) => {
BrowserWindow.fromWebContents(event.sender)?.close();
});
ipcMain.on("maximise-window", async (event) => {
BrowserWindow.fromWebContents(event.sender)?.maximize();
});
ipcMain.on("minimise-window", async (event) => {
BrowserWindow.fromWebContents(event.sender)?.minimize();
});
ipcMain.on("unmaximise-window", async (event) => {
BrowserWindow.fromWebContents(event.sender)?.unmaximize();
});
ipc.on<AppWindow>("open-window-then-close-all", (req, reply) => { ipc.on<AppWindow>("open-window-then-close-all", (req, reply) => {
const windowManager = WindowManagerService.getInstance(); const windowManager = WindowManagerService.getInstance();
@@ -17,18 +34,6 @@ ipc.on<AppWindow>("open-window-then-close-all", (req, reply) => {
reply(from(res)); reply(from(res));
}); });
ipc.on<AppWindow>("close-all-windows", async (req, reply) => {
await launcher.restoreSteamVR();
const windowManager = WindowManagerService.getInstance();
reply(of(windowManager.closeAllWindows(req.args)));
});
ipc.on<AppWindow[]>("close-windows", async (req, reply) => {
await launcher.restoreSteamVR();
const windowManager = WindowManagerService.getInstance();
reply(of(windowManager.close(...req.args)));
});
ipc.on<AppWindow>("open-window-or-focus", (req, reply) => { ipc.on<AppWindow>("open-window-or-focus", (req, reply) => {
const windowManager = WindowManagerService.getInstance(); const windowManager = WindowManagerService.getInstance();
reply(from(windowManager.openWindowOrFocus(req.args))); reply(from(windowManager.openWindowOrFocus(req.args)));
+10 -3
View File
@@ -17,8 +17,10 @@ import { LocalMapsManagerService } from "./services/additional-content/local-map
import { LocalPlaylistsManagerService } from "./services/additional-content/local-playlists-manager.service"; import { LocalPlaylistsManagerService } from "./services/additional-content/local-playlists-manager.service";
import { LocalModelsManagerService } from "./services/additional-content/local-models-manager.service"; import { LocalModelsManagerService } from "./services/additional-content/local-models-manager.service";
import { APP_NAME } from "./constants"; import { APP_NAME } from "./constants";
import { BSLauncherService } from "./services/bs-launcher.service"; import { BSLauncherService } from "./services/bs-launcher/bs-launcher.service";
import { IpcRequest } from "shared/models/ipc"; import { IpcRequest } from "shared/models/ipc";
import { LivShortcut } from "./services/liv/liv-shortcut.service";
import { SteamLauncherService } from "./services/bs-launcher/steam-launcher.service";
const isDebug = process.env.NODE_ENV === "development" || process.env.DEBUG_PROD === "true"; const isDebug = process.env.NODE_ENV === "development" || process.env.DEBUG_PROD === "true";
@@ -63,7 +65,7 @@ const initServicesMustBeInitialized = () => {
LocalMapsManagerService.getInstance(); LocalMapsManagerService.getInstance();
LocalPlaylistsManagerService.getInstance(); LocalPlaylistsManagerService.getInstance();
LocalModelsManagerService.getInstance(); LocalModelsManagerService.getInstance();
LivShortcut.getInstance();
BSLauncherService.getInstance(); BSLauncherService.getInstance();
} }
@@ -82,6 +84,11 @@ if (!gotTheLock) {
DeepLinkService.getInstance().dispatchLinkOpened(deepLink); DeepLinkService.getInstance().dispatchLinkOpened(deepLink);
}); });
app.on("window-all-closed", () => {
if (process.platform === "darwin") { return; }
app.quit();
})
app.whenReady().then(() => { app.whenReady().then(() => {
app.setAppUserModelId(APP_NAME); app.setAppUserModelId(APP_NAME);
@@ -96,7 +103,7 @@ if (!gotTheLock) {
DeepLinkService.getInstance().dispatchLinkOpened(deepLink); DeepLinkService.getInstance().dispatchLinkOpened(deepLink);
} }
BSLauncherService.getInstance().restoreSteamVR(); SteamLauncherService.getInstance().restoreSteamVR();
// Log renderer errors // Log renderer errors
ipcMain.on("log-error", (_, args: IpcRequest<unknown>) => { ipcMain.on("log-error", (_, args: IpcRequest<unknown>) => {
+1 -1
View File
@@ -1,6 +1,6 @@
import { ChildProcessWithoutNullStreams, SpawnOptionsWithoutStdio, spawn } from "child_process"; import { ChildProcessWithoutNullStreams, SpawnOptionsWithoutStdio, spawn } from "child_process";
import { Observable, ReplaySubject, Subscriber, filter, map, share } from "rxjs"; import { Observable, ReplaySubject, Subscriber, filter, map, share } from "rxjs";
import { DepotDownloaderArgsOptions, DepotDownloaderErrorEvent, DepotDownloaderEvent, DepotDownloaderEventType, DepotDownloaderEventTypes, DepotDownloaderInfoEvent, DepotDownloaderWarningEvent } from "../../shared/models/depot-downloader.model"; import { DepotDownloaderArgsOptions, DepotDownloaderErrorEvent, DepotDownloaderEvent, DepotDownloaderEventType, DepotDownloaderEventTypes, DepotDownloaderInfoEvent, DepotDownloaderWarningEvent } from "../../shared/models/bs-version-download/depot-downloader.model";
export class DepotDownloader { export class DepotDownloader {
+245
View File
@@ -0,0 +1,245 @@
import JSZip from "jszip";
import fetch from "node-fetch";
import { CustomError } from "../../shared/models/exceptions/custom-error.class";
import { mkdirs, createWriteStream, pathExists, WriteStream } from "fs-extra";
import path from "path";
import { inflate } from "pako"
import { EMPTY, Observable, ReplaySubject, Subscriber, catchError, filter, from, lastValueFrom, mergeMap, scan, share, tap } from "rxjs";
import { Progression, hashFile } from "../helpers/fs.helpers";
import { OculusDownloaderErrorCodes } from "../../shared/models/bs-version-download/oculus-download.model";
export class OculusDownloader {
private options: OculusDownloaderOptions;
private isDownloading: boolean;
private downloadSubscriber: Subscriber<Progression>;
private getDownloadManifestUrl(token: string, binaryId: string): string {
return `https://securecdn.oculus.com/binaries/download/?id=${binaryId}&access_token=${token}&get_manifest=1`;
}
private getDownloadSegmentUrl(token: string, binaryId: string, segmentSha256: string): string {
return `https://securecdn.oculus.com/binaries/segment/?access_token=${token}&binary_id=${binaryId}&segment_sha256=${segmentSha256}`;
}
private async downloadManifestZip(manifestUrl: string): Promise<JSZip> {
const response = await fetch(manifestUrl);
const arrBuffer = await response.arrayBuffer();
return JSZip.loadAsync(arrBuffer);
}
private async getManifest(): Promise<OculusManifest> {
const downloadUrl = this.getDownloadManifestUrl(this.options.accessToken, this.options.binaryId);
const manifestZip = await this.downloadManifestZip(downloadUrl).catch(err => CustomError.throw(err, "DOWNLOAD_MANIFEST_FAILED"));
const manifestFile = manifestZip.file("manifest.json");
if(!manifestFile){
throw new CustomError("Manifest file not found", "MANIFEST_FILE_NOT_FOUND");
}
return manifestFile.async("text").then(JSON.parse).catch(err => CustomError.throw(err, "PARSE_MANIFEST_FILE_FAILED"));
}
private downloadManifestFile(file: OculusManifestFile, destination: string): Observable<Progression<OculusManifestFile>> {
const downloadSegment = async (segment: OculusManifestFileSegment): Promise<ArrayBuffer> => {
const segmentUrl = this.getDownloadSegmentUrl(this.options.accessToken, this.options.binaryId, segment[1]);
const response = await fetch(segmentUrl);
return response.arrayBuffer();
}
const totalSegmentSize = file.segments.reduce((acc, segment) => acc + segment[2], 0);
const progress: Progression<OculusManifestFile> = { current: 0, total: totalSegmentSize, diff: 0, data: file };
return new Observable<Progression<OculusManifestFile>>(sub => {
let canceled = false;
let writeStream: WriteStream;
(async () => {
await mkdirs(path.dirname(destination));
writeStream = createWriteStream(destination);
for (const segment of file.segments) {
if(canceled || !writeStream.writable || !this.isDownloading){ return; }
const arrBuffer = await downloadSegment(segment);
const inflated = inflate(arrBuffer);
await writeStream.write(inflated);
progress.current += inflated.byteLength;
progress.diff = inflated.byteLength;
sub.next(progress);
}
})().catch(err => sub.error(err)).finally(() => {
sub.complete();
writeStream?.end();
});
return () => {
canceled = true;
writeStream?.end();
}
});
}
private isFileIntegrityValid(file: OculusFileWithName, folder: string): Promise<boolean> {
const [fileName, fileData] = file;
const destination = path.join(folder, fileName);
return pathExists(destination).then(exists => {
if(!exists){ return false; }
return hashFile(destination, "sha256").then(hash => hash === fileData.sha256);
});
}
private verifyIntegrity(manifest: OculusManifest, folder: string): Observable<Progression<OculusFileWithName[]>> {
return new Observable<Progression<OculusFileWithName[]>>(sub => {
const files = Object.entries(manifest.files);
const progress: Progression<OculusFileWithName[]> = { current: 0, total: files.length, data: [] };
const wrongFiles: OculusFileWithName[] = [];
let canceled = false;
(async () => {
for(const oculusFile of files){
if(canceled){ return; }
if(!(await this.isFileIntegrityValid(oculusFile, folder))){
wrongFiles.push(oculusFile);
}
progress.current++;
sub.next(progress);
}
progress.data = wrongFiles;
sub.next(progress);
})().then(() => sub.complete()).catch(err => sub.error(err));
return () => {
canceled = true;
}
}).pipe(share({connector: () => new ReplaySubject(1)}));
}
public downloadApp(options: OculusDownloaderOptions): Observable<Progression>{
return new Observable<Progression>(subscriber => {
this.downloadSubscriber = subscriber;
if(this.isDownloading){
throw new CustomError("Already downloading", "ALREADY_DOWNLOADING");
}
this.options = options;
this.isDownloading = true;
const progress: Progression = { current: 0, total: 0 };
(async () => {
const manifest = await this.getManifest().catch(err => CustomError.throw(err, "UNABLE_TO_GET_MANIFEST"));
const files = Object.entries(manifest.files);
progress.total = files.reduce((acc, file) => { return acc + file[1].size }, 0)
subscriber.next(progress);
const filesDownloadObservable = from(files).pipe(
filter(() => this.isDownloading),
mergeMap(([filename, file]) => (
this.isFileIntegrityValid([filename, file], options.destination)).then(isValid => ({ filename, file, isValid })
)),
mergeMap(({ filename, file, isValid }) => {
if(isValid){
const res: Progression<OculusManifestFile> = { current: file.size, total: file.size, diff: file.size, data: file };
return from([res])
}
const target = path.join(options.destination, filename);
return this.downloadManifestFile(file, target).pipe(
catchError(err => {
this.options.logger?.error(err);
return EMPTY;
})
);
}, 15),
scan((acc, curr) => acc + curr.diff, 0),
);
await lastValueFrom(filesDownloadObservable.pipe(tap({
next: download => {
progress.current = download;
subscriber.next(progress);
},
})));
const integrity = await lastValueFrom(this.verifyIntegrity(manifest, options.destination)).catch(err => CustomError.throw(err, "VERIFY_INTEGRITY_FAILED"));
if(integrity.data.length > 0){
throw new CustomError("Some files failed to download", "SOME_FILES_FAILED_TO_DOWNLOAD", integrity.data);
}
})().then(() => subscriber.complete()).catch(err => subscriber.error(err));
return () => {
this.isDownloading = false;
}
}).pipe(share({connector: () => new ReplaySubject(1)}));
}
public stopDownload(){
this.isDownloading = false;
this.downloadSubscriber?.error(CustomError.fromError(new Error("Download canceled"), OculusDownloaderErrorCodes.DOWNLOAD_CANCELLED));
}
}
interface OculusDownloaderOptions {
binaryId: Readonly<string>;
accessToken: Readonly<string>;
destination: Readonly<string>;
logger?: Readonly<Logger>;
}
interface OculusManifest {
appId: Readonly<string>;
canonicalName: Readonly<string>;
isCore: Readonly<boolean>;
packageType: Readonly<string>;
launchFile: Readonly<string>;
launchParameters: Readonly<string>;
launchFile2D: Readonly<string>;
launchParameters2D: Readonly<string>;
version: Readonly<string>;
versionCode: Readonly<string>;
redistributables: Readonly<unknown>;
files: Readonly<Record<string, OculusManifestFile>>;
firewallExceptionsRequired: Readonly<boolean>;
parentCanonicalName: Readonly<string>;
manifestVersion: Readonly<number>;
};
interface OculusManifestFile {
sha256: Readonly<string>;
size: number;
segmentSize: number;
segments: OculusManifestFileSegment[];
}
type OculusManifestFileSegment = [number, string, number];
type OculusFileWithName = [string, OculusManifestFile];
interface Logger {
info: (...args: unknown[]) => void;
warn: (...args: unknown[]) => void;
error: (...args: unknown[]) => void;
}
+8 -1
View File
@@ -26,5 +26,12 @@ contextBridge.exposeInMainWorld("electron", {
join: (...args: string[]): string => { join: (...args: string[]): string => {
return args.join(sep); return args.join(sep);
} }
},
window: {
close: () => { ipcRenderer.send("close-window"); },
minimise: () => { ipcRenderer.send("minimise-window"); },
maximise: () => { ipcRenderer.send("maximise-window"); },
unmaximise: () => { ipcRenderer.send("unmaximise-window"); },
} }
});
});
@@ -6,23 +6,22 @@ import { BSLocalVersionService } from "../bs-local-version.service";
import { InstallationLocationService } from "../installation-location.service"; import { InstallationLocationService } from "../installation-location.service";
import { UtilsService } from "../utils.service"; import { UtilsService } from "../utils.service";
import crypto from "crypto"; import crypto from "crypto";
import { lstatSync, unlinkSync } from "fs"; import { lstatSync } from "fs";
import { copySync, createReadStream } from "fs-extra"; import { copy, createReadStream, ensureDir, realpath, unlink } from "fs-extra";
import StreamZip from "node-stream-zip"; import StreamZip from "node-stream-zip";
import { RequestService } from "../request.service"; import { RequestService } from "../request.service";
import sanitize from "sanitize-filename"; import sanitize from "sanitize-filename";
import { DeepLinkService } from "../deep-link.service"; import { DeepLinkService } from "../deep-link.service";
import log from "electron-log"; import log from "electron-log";
import { WindowManagerService } from "../window-manager.service"; import { WindowManagerService } from "../window-manager.service";
import { ipcMain } from "electron"; import { Observable, lastValueFrom, of } from "rxjs";
import { IpcRequest } from "shared/models/ipc";
import { Observable, lastValueFrom } from "rxjs";
import { Archive } from "../../models/archive.class"; import { Archive } from "../../models/archive.class";
import { deleteFolder, ensureFolderExist, getFilesInFolder, getFoldersInFolder, pathExist } from "../../helpers/fs.helpers"; import { deleteFolder, ensureFolderExist, getFilesInFolder, getFoldersInFolder, pathExist } from "../../helpers/fs.helpers";
import { readFile } from "fs/promises"; import { readFile } from "fs/promises";
import { FolderLinkerService } from "../folder-linker.service"; import { FolderLinkerService } from "../folder-linker.service";
import { allSettled } from "../../../shared/helpers/promise.helpers"; import { allSettled } from "../../../shared/helpers/promise.helpers";
import { splitIntoChunk } from "../../../shared/helpers/array.helpers"; import { splitIntoChunk } from "../../../shared/helpers/array.helpers";
import { IpcService } from "../ipc.service";
export class LocalMapsManagerService { export class LocalMapsManagerService {
private static instance: LocalMapsManagerService; private static instance: LocalMapsManagerService;
@@ -49,6 +48,7 @@ export class LocalMapsManagerService {
private readonly reqService: RequestService; private readonly reqService: RequestService;
private readonly deepLink: DeepLinkService; private readonly deepLink: DeepLinkService;
private readonly windows: WindowManagerService; private readonly windows: WindowManagerService;
private readonly ipc: IpcService;
private readonly linker = FolderLinkerService.getInstance(); private readonly linker = FolderLinkerService.getInstance();
private constructor() { private constructor() {
@@ -59,6 +59,7 @@ export class LocalMapsManagerService {
this.deepLink = DeepLinkService.getInstance(); this.deepLink = DeepLinkService.getInstance();
this.windows = WindowManagerService.getInstance(); this.windows = WindowManagerService.getInstance();
this.linker = FolderLinkerService.getInstance(); this.linker = FolderLinkerService.getInstance();
this.ipc = IpcService.getInstance();
this.deepLink.addLinkOpenedListener(this.DEEP_LINKS.BeatSaver, link => { this.deepLink.addLinkOpenedListener(this.DEEP_LINKS.BeatSaver, link => {
log.info("DEEP-LINK RECEIVED FROM", this.DEEP_LINKS.BeatSaver, link); log.info("DEEP-LINK RECEIVED FROM", this.DEEP_LINKS.BeatSaver, link);
@@ -75,7 +76,7 @@ export class LocalMapsManagerService {
if (version) { if (version) {
return path.join(await this.localVersion.getVersionPath(version), LocalMapsManagerService.LEVELS_ROOT_FOLDER, LocalMapsManagerService.CUSTOM_LEVELS_FOLDER); return path.join(await this.localVersion.getVersionPath(version), LocalMapsManagerService.LEVELS_ROOT_FOLDER, LocalMapsManagerService.CUSTOM_LEVELS_FOLDER);
} }
const sharedMapsPath = path.join(this.installLocation.sharedContentPath, LocalMapsManagerService.SHARED_MAPS_FOLDER, LocalMapsManagerService.CUSTOM_LEVELS_FOLDER); const sharedMapsPath = path.join(await this.installLocation.sharedContentPath(), LocalMapsManagerService.SHARED_MAPS_FOLDER, LocalMapsManagerService.CUSTOM_LEVELS_FOLDER);
if (!(await pathExist(sharedMapsPath))) { if (!(await pathExist(sharedMapsPath))) {
await ensureFolderExist(sharedMapsPath); await ensureFolderExist(sharedMapsPath);
} }
@@ -126,7 +127,7 @@ export class LocalMapsManagerService {
} }
private async downloadMapZip(zipUrl: string): Promise<{ zip: StreamZip.StreamZipAsync; zipPath: string }> { private async downloadMapZip(zipUrl: string): Promise<{ zip: StreamZip.StreamZipAsync; zipPath: string }> {
const fileName = path.basename(zipUrl); const fileName = `${path.basename(zipUrl, ".zip")}-${crypto.randomUUID()}.zip`;
const tempPath = this.utils.getTempPath(); const tempPath = this.utils.getTempPath();
await ensureFolderExist(this.utils.getTempPath()); await ensureFolderExist(this.utils.getTempPath());
const dest = path.join(tempPath, fileName); const dest = path.join(tempPath, fileName);
@@ -138,11 +139,15 @@ export class LocalMapsManagerService {
} }
private openOneClickDownloadMapWindow(mapId: string, isHash = false): void { private openOneClickDownloadMapWindow(mapId: string, isHash = false): void {
ipcMain.once("one-click-map-info", async (event, req: IpcRequest<void>) => { this.windows.openWindow("oneclick-download-map.html").then(window => {
this.utils.ipcSend(req.responceChannel, { success: true, data: { id: mapId, isHash } });
this.ipc.once("one-click-map-info", async (_, reply) => {
reply(of({ id: mapId, isHash }));
}, window.webContents.ipc);
}); });
this.windows.openWindow("oneclick-download-map.html");
} }
public getMaps(version?: BSVersion): Observable<BsmLocalMapsProgress> { public getMaps(version?: BSVersion): Observable<BsmLocalMapsProgress> {
@@ -252,20 +257,19 @@ export class LocalMapsManagerService {
const { zip, zipPath } = await this.downloadMapZip(zipUrl); const { zip, zipPath } = await this.downloadMapZip(zipUrl);
const mapFolderName = sanitize(`${map.id}-${map.name}`);
const mapPath = path.join(mapsFolder, mapFolderName);
if (!zip) { if (!zip) {
throw `Cannot download ${zipUrl}`; throw `Cannot download ${zipUrl}`;
} }
const mapFolderName = sanitize(`${map.id}-${map.name}`);
const mapPath = path.join(mapsFolder, mapFolderName);
await ensureFolderExist(mapPath); await ensureFolderExist(mapPath);
await zip.extract(null, mapPath); await zip.extract(null, mapPath);
await zip.close(); await zip.close();
await unlink(zipPath);
unlinkSync(zipPath);
const localMap = await this.loadMapInfoFromPath(mapPath); const localMap = await this.loadMapInfoFromPath(mapPath);
localMap.bsaverInfo = map; localMap.bsaverInfo = map;
@@ -288,20 +292,20 @@ export class LocalMapsManagerService {
} }
public async oneClickDownloadMap(map: BsvMapDetail): Promise<void> { public async oneClickDownloadMap(map: BsvMapDetail): Promise<void> {
const downloadedMap = await this.downloadMap(map);
const versions = await this.localVersion.getInstalledVersions(); const versions = await this.localVersion.getInstalledVersions();
const downloadedMap = await this.downloadMap(map, versions.pop());
const downloadedMapRealFolder = await realpath(path.dirname(downloadedMap.path));
for (const version of versions) { for (const version of versions) {
if (await this.versionIsLinked(version)) { const versionMapsPath = await this.getMapsFolderPath(version);
await ensureDir(versionMapsPath);
if((await realpath(versionMapsPath)) === downloadedMapRealFolder){
continue; continue;
} }
const versionMapsPath = await this.getMapsFolderPath(version); await copy(downloadedMap.path, path.join(versionMapsPath, path.basename(downloadedMap.path)), { overwrite: true });
await ensureFolderExist(versionMapsPath);
copySync(downloadedMap.path, path.join(versionMapsPath, path.basename(downloadedMap.path)), { overwrite: true });
} }
} }
@@ -314,6 +318,6 @@ export class LocalMapsManagerService {
} }
public isDeepLinksEnabled(): boolean { public isDeepLinksEnabled(): boolean {
return Array.from(Object.values(this.DEEP_LINKS)).every(link => this.deepLink.isDeepLinkRegistred(link)); return Array.from(Object.values(this.DEEP_LINKS)).every(link => this.deepLink.isDeepLinkRegistered(link));
} }
} }
@@ -1,8 +1,5 @@
import { DeepLinkService } from "../deep-link.service"; import { DeepLinkService } from "../deep-link.service";
import log from "electron-log"; import log from "electron-log";
import { ipcMain } from "electron";
import { IpcRequest } from "shared/models/ipc";
import { UtilsService } from "../utils.service";
import { WindowManagerService } from "../window-manager.service"; import { WindowManagerService } from "../window-manager.service";
import { MSModel, MSModelType } from "../../../shared/models/models/model-saber.model"; import { MSModel, MSModelType } from "../../../shared/models/models/model-saber.model";
import { BSVersion } from "shared/bs-version.interface"; import { BSVersion } from "shared/bs-version.interface";
@@ -14,13 +11,14 @@ import sanitize from "sanitize-filename";
import { Progression, ensureFolderExist, unlinkPath } from "../../helpers/fs.helpers"; import { Progression, ensureFolderExist, unlinkPath } from "../../helpers/fs.helpers";
import { MODEL_FILE_EXTENSIONS, MODEL_TYPES, MODEL_TYPE_FOLDERS } from "../../../shared/models/models/constants"; import { MODEL_FILE_EXTENSIONS, MODEL_TYPES, MODEL_TYPE_FOLDERS } from "../../../shared/models/models/constants";
import { InstallationLocationService } from "../installation-location.service"; import { InstallationLocationService } from "../installation-location.service";
import { Observable, Subscription, lastValueFrom } from "rxjs"; import { Observable, Subscription, lastValueFrom, of } from "rxjs";
import { readdir } from "fs/promises"; import { readdir } from "fs/promises";
import md5File from "md5-file"; import md5File from "md5-file";
import { allSettled } from "../../../shared/helpers/promise.helpers"; import { allSettled } from "../../../shared/helpers/promise.helpers";
import { ModelSaberService } from "../thrid-party/model-saber/model-saber.service"; import { ModelSaberService } from "../thrid-party/model-saber/model-saber.service";
import { BsmLocalModel } from "shared/models/models/bsm-local-model.interface"; import { BsmLocalModel } from "shared/models/models/bsm-local-model.interface";
import { Archive } from "../../models/archive.class"; import { Archive } from "../../models/archive.class";
import { IpcService } from "../ipc.service";
export class LocalModelsManagerService { export class LocalModelsManagerService {
private static instance: LocalModelsManagerService; private static instance: LocalModelsManagerService;
@@ -37,21 +35,21 @@ export class LocalModelsManagerService {
}; };
private readonly deepLink: DeepLinkService; private readonly deepLink: DeepLinkService;
private readonly utils: UtilsService;
private readonly windows: WindowManagerService; private readonly windows: WindowManagerService;
private readonly localVersion: BSLocalVersionService; private readonly localVersion: BSLocalVersionService;
private readonly installPaths: InstallationLocationService; private readonly installPaths: InstallationLocationService;
private readonly request: RequestService; private readonly request: RequestService;
private readonly modelSaber: ModelSaberService; private readonly modelSaber: ModelSaberService;
private readonly ipc: IpcService;
private constructor() { private constructor() {
this.deepLink = DeepLinkService.getInstance(); this.deepLink = DeepLinkService.getInstance();
this.utils = UtilsService.getInstance();
this.windows = WindowManagerService.getInstance(); this.windows = WindowManagerService.getInstance();
this.localVersion = BSLocalVersionService.getInstance(); this.localVersion = BSLocalVersionService.getInstance();
this.request = RequestService.getInstance(); this.request = RequestService.getInstance();
this.installPaths = InstallationLocationService.getInstance(); this.installPaths = InstallationLocationService.getInstance();
this.modelSaber = ModelSaberService.getInstance(); this.modelSaber = ModelSaberService.getInstance();
this.ipc = IpcService.getInstance();
this.deepLink.addLinkOpenedListener(this.DEEP_LINKS.ModelSaber, link => { this.deepLink.addLinkOpenedListener(this.DEEP_LINKS.ModelSaber, link => {
log.info("DEEP-LINK RECEIVED FROM", this.DEEP_LINKS.ModelSaber, link); log.info("DEEP-LINK RECEIVED FROM", this.DEEP_LINKS.ModelSaber, link);
@@ -65,15 +63,17 @@ export class LocalModelsManagerService {
} }
private openOneClickDownloadModelWindow(id: string, type: string) { private openOneClickDownloadModelWindow(id: string, type: string) {
ipcMain.once("one-click-model-info", async (_event, req: IpcRequest<void>) => { this.windows.openWindow("oneclick-download-model.html").then(window => {
this.utils.ipcSend(req.responceChannel, { success: true, data: { id, type } });
});
this.windows.openWindow("oneclick-download-model.html"); this.ipc.once("one-click-model-info", (_, reply) => {
reply(of({ id, type }));
}, window.webContents.ipc);
});
} }
private async getModelFolderPath(type: MSModelType, version?: BSVersion): Promise<string> { private async getModelFolderPath(type: MSModelType, version?: BSVersion): Promise<string> {
const rootPath = version ? await this.localVersion.getVersionPath(version) : this.installPaths.sharedContentPath; const rootPath = await (version ? this.localVersion.getVersionPath(version) : this.installPaths.sharedContentPath());
const modelFolderPath = path.join(rootPath, MODEL_TYPE_FOLDERS[type]); const modelFolderPath = path.join(rootPath, MODEL_TYPE_FOLDERS[type]);
await ensureFolderExist(modelFolderPath); await ensureFolderExist(modelFolderPath);
@@ -119,23 +119,13 @@ export class LocalModelsManagerService {
} }
public async oneClickDownloadModel(model: MSModel): Promise<void> { public async oneClickDownloadModel(model: MSModel): Promise<void> {
if (!model) { if (!model) { return; }
return;
}
const versions = await this.localVersion.getInstalledVersions(); const versions = await this.localVersion.getInstalledVersions();
const downloaded = await lastValueFrom(this.downloadModel(model, versions.pop()));
if (versions?.length === 0) {
return;
}
const fisrtVersion = versions.shift();
const downloaded = await lastValueFrom(this.downloadModel(model, fisrtVersion));
for (const version of versions) { for (const version of versions) {
const modelDest = path.join(await this.getModelFolderPath(model.type, version), path.basename(downloaded.data.path)); const modelDest = path.join(await this.getModelFolderPath(model.type, version), path.basename(downloaded.data.path));
copyFileSync(downloaded.data.path, modelDest); copyFileSync(downloaded.data.path, modelDest);
} }
} }
@@ -242,7 +232,7 @@ export class LocalModelsManagerService {
} }
public isDeepLinksEnabled(): boolean { public isDeepLinksEnabled(): boolean {
return Array.from(Object.values(this.DEEP_LINKS)).every(link => this.deepLink.isDeepLinkRegistred(link)); return Array.from(Object.values(this.DEEP_LINKS)).every(link => this.deepLink.isDeepLinkRegistered(link));
} }
} }
@@ -1,21 +1,18 @@
import path from "path"; import path from "path";
import { BehaviorSubject, Observable, lastValueFrom } from "rxjs"; import { Observable, lastValueFrom, tap } from "rxjs";
import { BSVersion } from "shared/bs-version.interface"; import { BSVersion } from "shared/bs-version.interface";
import { BSLocalVersionService } from "../bs-local-version.service"; import { BSLocalVersionService } from "../bs-local-version.service";
import { DeepLinkService } from "../deep-link.service"; import { DeepLinkService } from "../deep-link.service";
import { RequestService } from "../request.service"; import { RequestService } from "../request.service";
import { UtilsService } from "../utils.service";
import { LocalMapsManagerService } from "./local-maps-manager.service"; import { LocalMapsManagerService } from "./local-maps-manager.service";
import log from "electron-log"; import log from "electron-log";
import { isValidUrl } from "../../../shared/helpers/url.helpers";
import { ipcMain } from "electron";
import { WindowManagerService } from "../window-manager.service"; import { WindowManagerService } from "../window-manager.service";
import { IpcRequest } from "shared/models/ipc"; import { BPList, DownloadPlaylistProgressionData } from "shared/models/playlists/playlist.interface";
import { BPList, DownloadPlaylistProgression } from "shared/models/playlists/playlist.interface"; import { readFileSync } from "fs";
import { copyFileSync, readFileSync } from "fs";
import { BeatSaverService } from "../thrid-party/beat-saver/beat-saver.service"; import { BeatSaverService } from "../thrid-party/beat-saver/beat-saver.service";
import { copySync } from "fs-extra"; import { copy, copyFile, pathExists, realpath } from "fs-extra";
import { ensureFolderExist, pathExist } from "../../helpers/fs.helpers"; import { Progression, ensureFolderExist, pathExist } from "../../helpers/fs.helpers";
import { IpcService } from "../ipc.service";
export class LocalPlaylistsManagerService { export class LocalPlaylistsManagerService {
private static instance: LocalPlaylistsManagerService; private static instance: LocalPlaylistsManagerService;
@@ -34,45 +31,29 @@ export class LocalPlaylistsManagerService {
private readonly versions: BSLocalVersionService; private readonly versions: BSLocalVersionService;
private readonly maps: LocalMapsManagerService; private readonly maps: LocalMapsManagerService;
private readonly utils: UtilsService;
private readonly request: RequestService; private readonly request: RequestService;
private readonly deepLink: DeepLinkService; private readonly deepLink: DeepLinkService;
private readonly windows: WindowManagerService; private readonly windows: WindowManagerService;
private readonly bsaver: BeatSaverService; private readonly bsaver: BeatSaverService;
private readonly ipc: IpcService;
private constructor() { private constructor() {
this.maps = LocalMapsManagerService.getInstance(); this.maps = LocalMapsManagerService.getInstance();
this.versions = BSLocalVersionService.getInstance(); this.versions = BSLocalVersionService.getInstance();
this.utils = UtilsService.getInstance();
this.request = RequestService.getInstance(); this.request = RequestService.getInstance();
this.deepLink = DeepLinkService.getInstance(); this.deepLink = DeepLinkService.getInstance();
this.windows = WindowManagerService.getInstance(); this.windows = WindowManagerService.getInstance();
this.bsaver = BeatSaverService.getInstance(); this.bsaver = BeatSaverService.getInstance();
this.ipc = IpcService.getInstance();
this.deepLink.addLinkOpenedListener(this.DEEP_LINKS.BeatSaver, link => { this.deepLink.addLinkOpenedListener(this.DEEP_LINKS.BeatSaver, link => {
log.info("DEEP-LINK RECEIVED FROM", this.DEEP_LINKS.BeatSaver, link); log.info("DEEP-LINK RECEIVED FROM", this.DEEP_LINKS.BeatSaver, link);
const url = new URL(link); const url = new URL(link);
const bplistUrl = url.host === "playlist" ? url.pathname.replace("/", "") : ""; const bplistUrl = url.host === "playlist" ? url.pathname.replace("/", "") : "";
this.openOneClickDownloadPlaylistWindow(bplistUrl); this.openOneClickDownloadPlaylistWindow(bplistUrl);
}); });
} }
private getPlaylistIdFromDownloadUrl(url: string): string {
if (!isValidUrl(url)) {
return "";
}
const splited = url.split("/");
const idIndex = splited.indexOf("id");
if (idIndex < 0) {
return "";
}
return splited[idIndex + 1];
}
private async getPlaylistsFolder(version?: BSVersion) { private async getPlaylistsFolder(version?: BSVersion) {
if (!version) { if (!version) {
throw "Playlists are not available to be linked yet"; throw "Playlists are not available to be linked yet";
@@ -87,19 +68,18 @@ export class LocalPlaylistsManagerService {
return folder; return folder;
} }
private async installBPListFile(bpListUrlOrPath: string, version: BSVersion): Promise<string> { private async installBPListFile(bslistSource: string, version: BSVersion): Promise<string> {
const playlistFolder = await this.getPlaylistsFolder(version); const playlistFolder = await this.getPlaylistsFolder(version);
const isLocalFile = await pathExists(bslistSource).catch(e => { log.error(e); return false; });
const filename = isLocalFile ? path.basename(bslistSource) : new URL(bslistSource).pathname.split('/').pop()
const destFile = path.join(playlistFolder, filename);
const bpListDest = path.join(playlistFolder, path.basename(bpListUrlOrPath)); if (isLocalFile) {
return copyFile(bslistSource, destFile).then(() => destFile);
if (await pathExist(bpListUrlOrPath)) {
copyFileSync(bpListUrlOrPath, bpListDest);
} else {
await lastValueFrom(this.request.downloadFile(bpListUrlOrPath, bpListDest));
} }
return lastValueFrom(this.request.downloadFile(bslistSource, destFile)).then(res => res.data);
return bpListDest;
} }
private async readPlaylistFile(path: string): Promise<BPList> { private async readPlaylistFile(path: string): Promise<BPList> {
if (!(await pathExist(path))) { if (!(await pathExist(path))) {
@@ -112,93 +92,87 @@ export class LocalPlaylistsManagerService {
} }
private openOneClickDownloadPlaylistWindow(downloadUrl: string): void { private openOneClickDownloadPlaylistWindow(downloadUrl: string): void {
ipcMain.once("one-click-playlist-info", async (event, req: IpcRequest<void>) => { this.windows.openWindow(`oneclick-download-playlist.html?playlistUrl=${downloadUrl}`);
this.utils.ipcSend(req.responceChannel, { success: true, data: { bpListUrl: downloadUrl, id: this.getPlaylistIdFromDownloadUrl(downloadUrl) } });
});
this.windows.openWindow("oneclick-download-playlist.html");
} }
public downloadPlaylist(bpListUrl: string, version: BSVersion): Observable<DownloadPlaylistProgression> { public downloadPlaylist(bpListUrl: string, version: BSVersion): Observable<Progression<DownloadPlaylistProgressionData>> {
const res = new BehaviorSubject<DownloadPlaylistProgression>({ progression: 0, current: null, downloadedMaps: [], mapsPath: [], bpListPath: "" });
const sub = res.subscribe( return new Observable<Progression<DownloadPlaylistProgressionData>>(obs => {
process => { (async () => {
this.utils.ipcSend("download-playlist-progress", { success: true, data: process });
},
err => {
this.utils.ipcSend("download-playlist-progress", { success: false, error: err });
}
);
const observer = async () => { const bpListFilePath = await this.installBPListFile(bpListUrl, version);
try { const bpList = await this.readPlaylistFile(bpListFilePath);
const bpListPath = await this.installBPListFile(bpListUrl, version);
const progress: Progression<DownloadPlaylistProgressionData> = {
total: bpList.songs.length,
current: 0,
data: {
downloadedMaps: [],
currentDownload: null,
playlistInfos: bpList,
playlistPath: bpListFilePath,
}
};
res.next({ ...res.value, bpListPath }); obs.next(progress);
const bpList = await this.readPlaylistFile(bpListPath);
for (const song of bpList.songs) { for (const song of bpList.songs) {
if (!song.key) { const [ mapDetail ] = await this.bsaver.getMapDetailsFromHashs([song.hash]);
if(!mapDetail) {
continue; continue;
} }
const map = await this.bsaver.getMapDetailsById(song.key); const downloadedMap = await this.maps.downloadMap(mapDetail, version);
res.next({ progress.data.downloadedMaps.push(downloadedMap);
...res.value, progress.data.currentDownload = mapDetail;
current: map, progress.current += 1;
progression: ((res.value.downloadedMaps.length + 0.5) / bpList.songs.length) * 100, obs.next(progress);
});
const mapPath = await this.maps.downloadMap(map, version);
const progression = ((res.value.downloadedMaps.length + 1) / bpList.songs.length) * 100;
res.next({
...res.value,
current: null,
downloadedMaps: [...res.value.downloadedMaps, map],
mapsPath: [...res.value.mapsPath, mapPath.path],
progression,
});
} }
} catch (e) {
res.error(e);
}
res.complete(); })()
}; .catch(err => obs.error(err))
.finally(() => obs.complete());
});
observer().finally(() => sub.unsubscribe());
return res.asObservable();
} }
public async oneClickInstallPlaylist(bpListUrl: string): Promise<void> { public oneClickInstallPlaylist(bpListUrl: string): Observable<Progression<DownloadPlaylistProgressionData>> {
const versions = await this.versions.getInstalledVersions();
const firstVersion = versions.shift(); return new Observable<Progression<DownloadPlaylistProgressionData>>(obs => {
const fistVersionLinked = await this.maps.versionIsLinked(firstVersion); (async () => {
const versions = await this.versions.getInstalledVersions();
const { bpListPath, mapsPath } = await this.downloadPlaylist(bpListUrl, firstVersion).toPromise(); const download$ = this.downloadPlaylist(bpListUrl, versions.pop()).pipe(tap({
next: progress => obs.next(progress),
error: err => obs.error(err),
}));
for (const version of versions) { const { data: {downloadedMaps, playlistPath} } = await lastValueFrom(download$);
await this.installBPListFile(bpListPath, version);
const versionIsLinked = await this.maps.versionIsLinked(version); if(downloadedMaps?.length === 0 || !playlistPath) { return; }
if (fistVersionLinked && versionIsLinked) { const realSourceMapsFolder = await realpath(path.dirname(downloadedMaps[0].path));
continue;
}
for (const mapPath of mapsPath) { for (const version of versions) {
const versionMapsFolder = await this.maps.getMapsFolderPath(version); await this.installBPListFile(playlistPath, version);
const mapDest = path.join(versionMapsFolder, path.basename(mapPath));
copySync(mapPath, mapDest, { overwrite: true }); const versionMapsFolder = await this.maps.getMapsFolderPath(version);
} const realDestMapsFolder = await realpath(versionMapsFolder);
}
if(realSourceMapsFolder === realDestMapsFolder) { continue; }
for (const mapPath of downloadedMaps) {
const mapDest = path.join(versionMapsFolder, path.basename(mapPath.path));
await copy(mapPath.path, mapDest, { overwrite: true });
}
}
})()
.catch(err => obs.error(err))
.finally(() => obs.complete());
});
} }
public enableDeepLinks(): boolean { public enableDeepLinks(): boolean {
@@ -210,6 +184,6 @@ export class LocalPlaylistsManagerService {
} }
public isDeepLinksEnabled(): boolean { public isDeepLinksEnabled(): boolean {
return Array.from(Object.values(this.DEEP_LINKS)).every(link => this.deepLink.isDeepLinkRegistred(link)); return Array.from(Object.values(this.DEEP_LINKS)).every(link => this.deepLink.isDeepLinkRegistered(link));
} }
} }
@@ -0,0 +1,63 @@
import { LaunchOption } from "shared/models/bs-launch";
import { BSLocalVersionService } from "../bs-local-version.service";
import { ChildProcessWithoutNullStreams, SpawnOptionsWithoutStdio, spawn } from "child_process";
import path from "path";
import log from "electron-log";
export abstract class AbstractLauncherService {
protected readonly localVersions = BSLocalVersionService.getInstance();
constructor(){
this.localVersions = BSLocalVersionService.getInstance();
}
protected buildBsLaunchArgs(launchOptions: LaunchOption): string[]{
const launchArgs = ["--no-yeet"];
if (launchOptions.oculus) {
launchArgs.push("-vrmode");
launchArgs.push("oculus");
}
if (launchOptions.desktop) {
launchArgs.push("fpfc");
}
if (launchOptions.debug) {
launchArgs.push("--verbose");
}
if (launchOptions.additionalArgs) {
launchArgs.push(...launchOptions.additionalArgs);
}
return Array.from(new Set(launchArgs).values());
}
protected launchBSProcess(bsExePath: string, args: string[], options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams {
const spawnOptions: SpawnOptionsWithoutStdio = { detached: true, cwd: path.dirname(bsExePath), ...(options || {}) };
if(args.includes("--verbose")){
spawnOptions.windowsVerbatimArguments = true;
}
log.info(`Launch BS exe at ${bsExePath} with args ${args?.join(" ")}`);
return spawn(bsExePath, args, spawnOptions);
}
protected launchBs(bsExePath: string, args: string[], options?: SpawnOptionsWithoutStdio): Promise<number> {
return new Promise<number>((resolve, reject) => {
const bsProcess = this.launchBSProcess(bsExePath, args, options);
bsProcess.on("error", reject);
bsProcess.on("exit", resolve);
setTimeout(() => {
bsProcess.removeAllListeners("error");
bsProcess.removeAllListeners("exit");
resolve(-1);
}, 30_000);
});
}
}
@@ -1,36 +1,36 @@
import path from "path"; import path from "path";
import { LaunchOption, BSLaunchEvent, BSLaunchEventData, BSLaunchWarning, BSLaunchErrorData, BSLaunchError } from "../../shared/models/bs-launch"; import { LaunchOption, BSLaunchEventData } from "../../../shared/models/bs-launch";
import { UtilsService } from "./utils.service"; import { IMAGE_CACHE_PATH } from "../../constants";
import { BS_EXECUTABLE, BS_APP_ID, STEAMVR_APP_ID, IMAGE_CACHE_PATH } from "../constants"; import { BSLocalVersionService } from "../bs-local-version.service";
import { ChildProcessWithoutNullStreams, SpawnOptionsWithoutStdio, spawn } from "child_process";
import { SteamService } from "./steam.service";
import { BSLocalVersionService } from "./bs-local-version.service";
import { pathExist } from "../helpers/fs.helpers";
import { rename } from "fs/promises";
import log from "electron-log"; import log from "electron-log";
import { Observable, lastValueFrom, of, timer } from "rxjs"; import { Observable, of, throwError } from "rxjs";
import { BsmProtocolService } from "./bsm-protocol.service"; import { BsmProtocolService } from "../bsm-protocol.service";
import { app, shell} from "electron"; import { app, shell} from "electron";
import { Resvg } from "@resvg/resvg-js";
import Color from "color"; import Color from "color";
import { ensureDir, writeFile } from "fs-extra"; import { ensureDir, writeFile } from "fs-extra";
import toIco from "to-ico"; import toIco from "to-ico";
import { objectFromEntries } from "../../shared/helpers/object.helpers"; import { objectFromEntries } from "../../../shared/helpers/object.helpers";
import { WindowManagerService } from "./window-manager.service"; import { WindowManagerService } from "../window-manager.service";
import { IpcService } from "./ipc.service"; import { IpcService } from "../ipc.service";
import { BSVersionLibService } from "./bs-version-lib.service"; import { BSVersionLibService } from "../bs-version-lib.service";
import { execOnOs } from "../helpers/env.helpers"; import { execOnOs } from "../../helpers/env.helpers";
import sharp from "sharp";
import { StoreLauncherInterface } from "./store-launcher.interface";
import { SteamLauncherService } from "./steam-launcher.service";
import { OculusLauncherService } from "./oculus-launcher.service";
import { BSVersion } from "shared/bs-version.interface";
import { BsStore } from "../../../shared/models/bs-store.enum";
export class BSLauncherService { export class BSLauncherService {
private static instance: BSLauncherService; private static instance: BSLauncherService;
private readonly utilsService: UtilsService;
private readonly steamService: SteamService;
private readonly localVersionService: BSLocalVersionService; private readonly localVersionService: BSLocalVersionService;
private readonly bsmProtocolService: BsmProtocolService; private readonly bsmProtocolService: BsmProtocolService;
private readonly windows: WindowManagerService; private readonly windows: WindowManagerService;
private readonly ipc: IpcService; private readonly ipc: IpcService;
private readonly remoteVersion: BSVersionLibService; private readonly remoteVersion: BSVersionLibService;
private readonly steamLauncher: SteamLauncherService;
private readonly oculusLauncher: OculusLauncherService;
public static getInstance(): BSLauncherService { public static getInstance(): BSLauncherService {
if (!BSLauncherService.instance) { if (!BSLauncherService.instance) {
@@ -40,143 +40,57 @@ export class BSLauncherService {
} }
private constructor() { private constructor() {
this.utilsService = UtilsService.getInstance();
this.steamService = SteamService.getInstance();
this.localVersionService = BSLocalVersionService.getInstance(); this.localVersionService = BSLocalVersionService.getInstance();
this.bsmProtocolService = BsmProtocolService.getInstance(); this.bsmProtocolService = BsmProtocolService.getInstance();
this.windows = WindowManagerService.getInstance(); this.windows = WindowManagerService.getInstance();
this.ipc = IpcService.getInstance(); this.ipc = IpcService.getInstance();
this.remoteVersion = BSVersionLibService.getInstance(); this.remoteVersion = BSVersionLibService.getInstance();
this.steamLauncher = SteamLauncherService.getInstance();
this.oculusLauncher = OculusLauncherService.getInstance();
this.bsmProtocolService.on("launch", link => { this.bsmProtocolService.on("launch", link => {
log.info("Launch from bsm protocol", link.toString()); log.info("Launch from bsm protocol", link.toString());
const shortcutParams = objectFromEntries(link.searchParams.entries()) as ShortcutParams; this.openShortcutLaunchWindow(this.shortcutLinkToShortcutParams(link)).catch(log.error);
this.openShortcutLaunchWindow(shortcutParams).catch(log.error);
}); });
} }
private getSteamVRPath(): Promise<string> { private getStoreLauncherFromVersion(version: BSVersion): StoreLauncherInterface {
return this.steamService.getGameFolder(STEAMVR_APP_ID, "SteamVR"); if(version.steam){ return this.steamLauncher; }
} if(version.oculus){ return this.oculusLauncher; }
if(version.metadata?.store === BsStore.STEAM){ return this.steamLauncher; }
private async backupSteamVR(): Promise<void> { if(version.metadata?.store === BsStore.OCULUS){ return this.oculusLauncher; }
const steamVrFolder = await this.getSteamVRPath(); return this.steamLauncher;
if (!(await pathExist(steamVrFolder))) {
return;
}
return rename(steamVrFolder, `${steamVrFolder}.bak`).catch(log.error);
}
public async restoreSteamVR(): Promise<void> {
const steamVrFolder = await this.getSteamVRPath();
const steamVrBackup = `${steamVrFolder}.bak`;
if (!(await pathExist(steamVrBackup))) {
return;
}
return rename(steamVrBackup, steamVrFolder).catch(log.error);
}
public async isBsRunning(): Promise<boolean> {
return this.utilsService.taskRunning(BS_EXECUTABLE);
}
private buildBsLaunchArgs(launchOptions: LaunchOption): string[]{
const launchArgs = [];
if (launchOptions.oculus) {
launchArgs.push("-vrmode");
launchArgs.push("oculus");
}
if (launchOptions.desktop) {
launchArgs.push("fpfc");
}
if (launchOptions.debug) {
launchArgs.push("--verbose");
}
if (launchOptions.additionalArgs) {
launchArgs.push(...launchOptions.additionalArgs);
}
return Array.from(new Set(launchArgs).values());
}
private launchBSProcess(bsExePath: string, args: string[], debug = false): ChildProcessWithoutNullStreams{
const spawnOptions: SpawnOptionsWithoutStdio = { detached: true, cwd: path.dirname(bsExePath), env: {...process.env, "SteamAppId": BS_APP_ID} };
if(debug){
spawnOptions.windowsVerbatimArguments = true;
}
return spawn(bsExePath, args, spawnOptions);
} }
public launch(launchOptions: LaunchOption): Observable<BSLaunchEventData>{ public launch(launchOptions: LaunchOption): Observable<BSLaunchEventData>{
return new Observable<BSLaunchEventData>(obs => {(async () => { log.info("Launch version", launchOptions);
if(launchOptions.skipAlreadyRunning !== true && await this.isBsRunning()){ const launcher = this.getStoreLauncherFromVersion(launchOptions.version);
return obs.error({type: BSLaunchError.BS_ALREADY_RUNNING} as BSLaunchErrorData);
}
const bsFolderPath = await this.localVersionService.getInstalledVersionPath(launchOptions.version); if(!launcher){
const exePath = path.join(bsFolderPath, BS_EXECUTABLE); return throwError(() => new Error("Unable to get launcher for the provided version"));
}
if(!(await pathExist(exePath))){ return launcher.launch(launchOptions);
return obs.error({type: BSLaunchError.BS_NOT_FOUND} as BSLaunchErrorData); }
}
// Open Steam if not running public shortcutLinkToShortcutParams(shortcutLink: string|URL): ShortcutParams{
if(!launchOptions.version.oculus && !(await this.steamService.steamRunning())){ if(typeof shortcutLink === "string"){
obs.next({type: BSLaunchEvent.STEAM_LAUNCHING}); shortcutLink = new URL(shortcutLink);
}
await this.steamService.openSteam().then(() => { const params = objectFromEntries(shortcutLink.searchParams.entries()) as ShortcutParams;
obs.next({type: BSLaunchEvent.STEAM_LAUNCHED});
}).catch(e => {
log.error(e);
obs.next({type: BSLaunchWarning.UNABLE_TO_LAUNCH_STEAM});
});
}
// Backup SteamVR when desktop mode is enabled if(typeof params.additionalArgs === "string"){
if(!launchOptions.version.oculus && launchOptions.desktop){ params.additionalArgs = [params.additionalArgs];
await this.backupSteamVR().catch(() => { }
return this.restoreSteamVR();
});
await lastValueFrom(timer(2_000));
} else if(!launchOptions.version.oculus){
await this.restoreSteamVR();
}
const launchArgs = this.buildBsLaunchArgs(launchOptions); return params;
}
obs.next({type: BSLaunchEvent.BS_LAUNCHING}); public shortcutLinkToLaunchOptions(shortcutLink: string|URL): LaunchOption{
return this.shortcutParamsToLaunchOption(this.shortcutLinkToShortcutParams(shortcutLink));
await new Promise<number>((resolve, reject) => {
const bsProcess = this.launchBSProcess(exePath, launchArgs, launchOptions.debug);
bsProcess.on("error", reject);
bsProcess.on("exit", resolve);
setTimeout(() => {
bsProcess.removeAllListeners("error");
bsProcess.removeAllListeners("exit");
resolve(-1);
}, 4000);
}).then(exitCode => {
log.info("BS process exit code", exitCode);
}).catch(err => {
log.error(err);
obs.error({type: BSLaunchError.BS_EXIT_ERROR, data: err} as BSLaunchErrorData);
});
})().then(() => {
obs.complete();
}).catch(err => {
obs.error({type: BSLaunchError.UNKNOWN_ERROR, data: err} as BSLaunchErrorData);
})});
} }
private shortcutParamsToLaunchOption(params: ShortcutParams): LaunchOption{ private shortcutParamsToLaunchOption(params: ShortcutParams): LaunchOption{
@@ -213,19 +127,16 @@ export class BSLauncherService {
return res; return res;
} }
private createShortcutPngBuffer(color: Color): Buffer{ private createShortcutPngBuffer(color: Color): Promise<Buffer>{
const svgIcon = ` const svgBuffer = Buffer.from(`
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 406.4 406.4" height="406.4" width="406.4"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 406.4 406.4" height="406.4" width="406.4">
<rect rx="69.453" height="406.4" width="406.4" fill="${color.hex()}"/> <rect rx="69.453" height="406.4" width="406.4" fill="${color.hex()}"/>
<path d="M65.467 60.6H336.4v33.867L200.933 162.2 65.467 94.467z" fill="#fff"/> <path d="M65.467 60.6H336.4v33.867L200.933 162.2 65.467 94.467z" fill="#fff"/>
</svg> </svg>
`; `);
return new Resvg(svgIcon, {
fitTo: { mode: "width", value: 256 }
}).render().asPng();
return sharp(svgBuffer).resize(256).png().toBuffer();
} }
/** /**
@@ -251,7 +162,7 @@ export class BSLauncherService {
* @returns {Promise<string>} Path of the icon * @returns {Promise<string>} Path of the icon
*/ */
private async createShortcutIco(color: Color): Promise<string>{ private async createShortcutIco(color: Color): Promise<string>{
const pngBuffer = this.createShortcutPngBuffer(color); const pngBuffer = await this.createShortcutPngBuffer(color);
const icoBuffer = await toIco([pngBuffer]); const icoBuffer = await toIco([pngBuffer]);
await ensureDir(IMAGE_CACHE_PATH); await ensureDir(IMAGE_CACHE_PATH);
@@ -263,9 +174,13 @@ export class BSLauncherService {
return iconPath; return iconPath;
} }
public async createLaunchShortcut(launchOptions: LaunchOption): Promise<boolean>{ public createLaunchLink(launchOptions: LaunchOption): string{
const shortcutParams = this.launchOptionToShortcutParams(launchOptions); const shortcutParams = this.launchOptionToShortcutParams(launchOptions);
const shortcutUrl = this.bsmProtocolService.buildLink("launch", shortcutParams).toString(); return this.bsmProtocolService.buildLink("launch", shortcutParams).toString();
}
public async createLaunchShortcut(launchOptions: LaunchOption): Promise<boolean>{
const shortcutUrl = this.createLaunchLink(launchOptions);
const shortcutName = ["Beat Saber", launchOptions.version.BSVersion, launchOptions.version.name].join(" "); const shortcutName = ["Beat Saber", launchOptions.version.BSVersion, launchOptions.version.name].join(" ");
const shortcutIconColor = new Color(launchOptions.version.color, "hex"); const shortcutIconColor = new Color(launchOptions.version.color, "hex");
@@ -0,0 +1,171 @@
import { Observable, ReplaySubject, catchError, lastValueFrom, of, take, timeout } from "rxjs";
import { StoreLauncherInterface } from "./store-launcher.interface";
import { BSLaunchError, BSLaunchEvent, BSLaunchEventData, LaunchOption } from "../../../shared/models/bs-launch";
import { OculusService } from "../oculus.service";
import { BS_EXECUTABLE, OCULUS_BS_BACKUP_DIR, OCULUS_BS_DIR } from "../../constants";
import path from "path";
import log from "electron-log";
import { sToMs } from "../../../shared/helpers/time.helpers";
import { lstat, pathExists, readdir, readlink, rename, symlink, unlink } from "fs-extra";
import { AbstractLauncherService } from "./abstract-launcher.service";
import { taskRunning } from "../../helpers/os.helpers";
import { CustomError } from "../../../shared/models/exceptions/custom-error.class";
import { InstallationLocationService } from "../installation-location.service";
export class OculusLauncherService extends AbstractLauncherService implements StoreLauncherInterface {
public static instance: OculusLauncherService;
public static getInstance(): OculusLauncherService {
if (!OculusLauncherService.instance) {
OculusLauncherService.instance = new OculusLauncherService();
}
return OculusLauncherService.instance;
}
private readonly oculus: OculusService;
private readonly pathsService: InstallationLocationService;
private readonly oculusLib$ = new ReplaySubject<string>();
private constructor() {
super();
this.oculus = OculusService.getInstance();
this.pathsService = InstallationLocationService.getInstance();
this.oculus.tryGetGameFolder([OCULUS_BS_DIR, OCULUS_BS_BACKUP_DIR]).then(async dirPath => {
if(dirPath){ return this.oculusLib$.next( path.join(dirPath, "..") ); }
const defaultLib = ((await this.oculus.getOculusLibs()) || []).find(lib => lib.isDefault);
if(defaultLib?.path){ return this.oculusLib$.next(path.join(defaultLib.path, "Software")); }
this.oculusLib$.next(null);
}).catch(err => {
log.error("Error while getting Oculus libs", err);
this.oculusLib$.next(null);
});
}
public async deleteBsSymlinks(): Promise<void> {
const oculusLibPath = await lastValueFrom(this.oculusLib$.pipe(take(1), timeout(sToMs(30)), catchError(() => of(null))));
if(!oculusLibPath || !(await pathExists(oculusLibPath))){
throw new Error("Oculus library not found, deleteBsSymlinks");
}
const libContents = await readdir(oculusLibPath);
const symlinks = (await Promise.all(libContents.map(async dir => {
return (await lstat(path.join(oculusLibPath, dir))).isSymbolicLink() ? dir : null;
}))).filter(Boolean);
log.info("Symlinks found in Oculus library", symlinks);
const bsSymlinks = symlinks.filter(dirent => dirent.startsWith(OCULUS_BS_DIR));
const bsmSymlinks = (await Promise.all(bsSymlinks.map(async symlink => {
const symlinkPath = path.join(oculusLibPath, symlink);
const targetPath = await readlink(symlinkPath).catch(err => log.error(err));
log.info("Oculus Symlink", symlink, "target", targetPath);
if(!targetPath){ return null; }
const bsmVersionsDir = path.join(this.pathsService.INSTALLATION_FOLDER, this.pathsService.VERSIONS_FOLDER);
if(!targetPath.includes(bsmVersionsDir)){ return null; }
return symlink;
}))).filter(Boolean);
await Promise.all(bsmSymlinks.map(symlink => {
log.info("Delete symlink", symlink);
return unlink(path.join(oculusLibPath, symlink));
}));
}
private async backupOriginalBeatSaber(): Promise<void>{
const bsFolder = await this.oculus.getGameFolder(OCULUS_BS_DIR);
if(!bsFolder){ return; }
const backupPath = path.join(bsFolder, "..", OCULUS_BS_BACKUP_DIR);
log.info("Backing up original Beat Saber", bsFolder, backupPath);
return rename(bsFolder, backupPath);
}
public async restoreOriginalBeatSaber(): Promise<void>{
const bsFolderBackupPath = await this.oculus.getGameFolder(OCULUS_BS_BACKUP_DIR);
if(!(await pathExists(bsFolderBackupPath))){ return; }
const originalPath = path.join(bsFolderBackupPath, "..", OCULUS_BS_DIR);
log.info("Restoring original Beat Saber", bsFolderBackupPath, originalPath);
return rename(bsFolderBackupPath, originalPath);
}
public launch(launchOptions: LaunchOption): Observable<BSLaunchEventData> {
const prepareOriginalVersion: () => Promise<string> = async () => {
await this.restoreOriginalBeatSaber();
const bsPath = await this.oculus.getGameFolder(OCULUS_BS_DIR);
if(!bsPath){
throw new Error("Oculus Beat Saber path not found");
}
return bsPath;
}
const prepareDowngradedVersion: () => Promise<string> = async () => {
const oculusLib = await lastValueFrom(this.oculusLib$.pipe(take(1), timeout(sToMs(30)), catchError(() => of(null))));
if(!oculusLib){
throw CustomError.fromError(new Error("No Oculus library found"), BSLaunchError.OCULUS_LIB_NOT_FOUND);
}
// Backup original Beat Saber folder
await this.backupOriginalBeatSaber();
// Create symlink in the oculus library from the BSM BS version
const symlinkTarget = await this.localVersions.getInstalledVersionPath(launchOptions.version);
const symlinkPath = path.join(oculusLib, OCULUS_BS_DIR);
log.info("Creating symlink", symlinkTarget, symlinkPath);
await symlink(symlinkTarget, symlinkPath, "junction");
return symlinkPath;
}
return new Observable<BSLaunchEventData>(obs => {
(async () => {
// Cannot start multiple instances of Beat Saber with Oculus
const bsRunning = await taskRunning(BS_EXECUTABLE).catch(() => false);
if(bsRunning){
throw CustomError.fromError(new Error("Cannot start two instance of Beat Saber for Oculus"), BSLaunchError.BS_ALREADY_RUNNING);
}
// Remove previously symlinks created by BSM
await this.deleteBsSymlinks().catch(err => log.error("Error while deleting BSM symlinks", err));
const bsPath = await (launchOptions.version.oculus ? prepareOriginalVersion() : prepareDowngradedVersion());
// Launch Beat Saber
const exePath = path.join(bsPath, BS_EXECUTABLE);
if(!(await pathExists(exePath))){
throw CustomError.fromError(new Error(`BS Path not exist ${bsPath}`), BSLaunchError.BS_NOT_FOUND);
}
obs.next({type: BSLaunchEvent.BS_LAUNCHING});
return this.launchBs(exePath, this.buildBsLaunchArgs(launchOptions)).catch(err => {
throw CustomError.fromError(err, BSLaunchError.BS_EXIT_ERROR);
});
})().then(exitCode => {
log.info("BS process exit code", exitCode);
}).catch(err => {
if(err instanceof CustomError){
obs.error(err);
} else {
obs.error(CustomError.fromError(err, BSLaunchError.UNKNOWN_ERROR));
}
}).finally(() => {
obs.complete();
})
});
}
}
@@ -0,0 +1,112 @@
import { Observable } from "rxjs";
import { BSLaunchError, BSLaunchEvent, BSLaunchEventData, BSLaunchWarning, LaunchOption } from "../../../shared/models/bs-launch";
import { StoreLauncherInterface } from "./store-launcher.interface";
import { pathExists, rename } from "fs-extra";
import { SteamService } from "../steam.service";
import path from "path";
import { BS_APP_ID, BS_EXECUTABLE, STEAMVR_APP_ID } from "../../constants";
import log from "electron-log";
import { AbstractLauncherService } from "./abstract-launcher.service";
import { CustomError } from "../../../shared/models/exceptions/custom-error.class";
export class SteamLauncherService extends AbstractLauncherService implements StoreLauncherInterface{
private static instance: SteamLauncherService;
public static getInstance(): SteamLauncherService{
if(!SteamLauncherService.instance){
SteamLauncherService.instance = new SteamLauncherService();
}
return SteamLauncherService.instance;
}
private readonly steam: SteamService;
private constructor(){
super();
this.steam = SteamService.getInstance();
}
private getSteamVRPath(): Promise<string> {
return this.steam.getGameFolder(STEAMVR_APP_ID, "SteamVR");
}
private async backupSteamVR(): Promise<void> {
const steamVrFolder = await this.getSteamVRPath();
if (!(await pathExists(steamVrFolder))) {
return;
}
return rename(steamVrFolder, `${steamVrFolder}.bak`).catch(err => {
log.error("Error while create backup of SteamVR", err);
});
}
public async restoreSteamVR(): Promise<void> {
const steamVrFolder = await this.getSteamVRPath();
const steamVrBackup = `${steamVrFolder}.bak`;
if (!(await pathExists(steamVrBackup))) {
return;
}
return rename(steamVrBackup, steamVrFolder).catch(err => {
log.error("Error while restoring SteamVR", err);
});
}
public launch(launchOptions: LaunchOption): Observable<BSLaunchEventData>{
return new Observable<BSLaunchEventData>(obs => {(async () => {
const bsFolderPath = await this.localVersions.getInstalledVersionPath(launchOptions.version);
const exePath = path.join(bsFolderPath, BS_EXECUTABLE);
if(!(await pathExists(exePath))){
throw CustomError.fromError(new Error(`Path not exist : ${exePath}`), BSLaunchError.BS_NOT_FOUND);
}
// Open Steam if not running
if(!(await this.steam.steamRunning())){
obs.next({type: BSLaunchEvent.STEAM_LAUNCHING});
await this.steam.openSteam().then(() => {
obs.next({type: BSLaunchEvent.STEAM_LAUNCHED});
}).catch(e => {
log.error(e);
obs.next({type: BSLaunchWarning.UNABLE_TO_LAUNCH_STEAM});
});
}
// Backup SteamVR when desktop mode is enabled
if(launchOptions.desktop){
await this.backupSteamVR().catch(() => {
return this.restoreSteamVR();
});
} else {
await this.restoreSteamVR().catch(log.error);
}
const launchArgs = this.buildBsLaunchArgs(launchOptions);
obs.next({type: BSLaunchEvent.BS_LAUNCHING});
await this.launchBs(exePath, launchArgs, { env: {...process.env, "SteamAppId": BS_APP_ID} }).then(exitCode => {
log.info("BS process exit code", exitCode);
}).catch(err => {
throw CustomError.fromError(err, BSLaunchError.BS_EXIT_ERROR);
}).finally(() => {
this.restoreSteamVR().catch(log.error);
});
})().then(() => {
obs.complete();
}).catch(err => {
if(err instanceof CustomError){
obs.error(err);
} else {
obs.error(CustomError.fromError(err, BSLaunchError.UNKNOWN_ERROR));
}
})});
}
}
@@ -0,0 +1,6 @@
import { Observable } from "rxjs";
import { BSLaunchEventData, LaunchOption } from "shared/models/bs-launch";
export interface StoreLauncherInterface {
launch(launchOptions: LaunchOption): Observable<BSLaunchEventData>;
}
+131 -34
View File
@@ -1,8 +1,8 @@
import { BSVersionLibService } from "./bs-version-lib.service"; import { BSVersionLibService } from "./bs-version-lib.service";
import { BSVersion } from "shared/bs-version.interface"; import { BSVersion, BSVersionMetadata } from "shared/bs-version.interface";
import { InstallationLocationService } from "./installation-location.service"; import { InstallationLocationService } from "./installation-location.service";
import { SteamService } from "./steam.service"; import { SteamService } from "./steam.service";
import { BS_APP_ID, OCULUS_BS_DIR } from "../constants"; import { BS_APP_ID, OCULUS_BS_BACKUP_DIR, OCULUS_BS_DIR } from "../constants";
import path from "path"; import path from "path";
import { ConfigurationService } from "./configuration.service"; import { ConfigurationService } from "./configuration.service";
import { lstat, rename } from "fs/promises"; import { lstat, rename } from "fs/promises";
@@ -11,15 +11,19 @@ import log from "electron-log";
import { OculusService } from "./oculus.service"; import { OculusService } from "./oculus.service";
import { DownloadLinkType } from "shared/models/mods"; import { DownloadLinkType } from "shared/models/mods";
import sanitize from "sanitize-filename"; import sanitize from "sanitize-filename";
import { copyDirectoryWithJunctions, deleteFolder, getFoldersInFolder, pathExist } from "../helpers/fs.helpers"; import { Progression, copyDirectoryWithJunctions, deleteFolder, ensurePathNotAlreadyExist, getFoldersInFolder, rxCopy } from "../helpers/fs.helpers";
import { FolderLinkerService } from "./folder-linker.service"; import { FolderLinkerService } from "./folder-linker.service";
import { ReadStream, createReadStream } from "fs-extra"; import { ReadStream, createReadStream, pathExists, readFile, writeFile } from "fs-extra";
import readline from "readline"; import readline from "readline";
import { Observable, Subject, catchError, finalize, from, map, switchMap, throwError } from "rxjs";
import { BsStore } from "../../shared/models/bs-store.enum";
import { CustomError } from "../../shared/models/exceptions/custom-error.class";
export class BSLocalVersionService { export class BSLocalVersionService {
private static instance: BSLocalVersionService; private static instance: BSLocalVersionService;
private readonly CUSTOM_VERSIONS_KEY = "custom-versions"; private readonly CUSTOM_VERSIONS_KEY = "custom-versions";
private readonly METADATA_FILE = "metadata.config";
private readonly installLocationService: InstallationLocationService; private readonly installLocationService: InstallationLocationService;
private readonly steamService: SteamService; private readonly steamService: SteamService;
@@ -27,6 +31,7 @@ export class BSLocalVersionService {
private readonly remoteVersionService: BSVersionLibService; private readonly remoteVersionService: BSVersionLibService;
private readonly configService: ConfigurationService; private readonly configService: ConfigurationService;
private readonly linker: FolderLinkerService; private readonly linker: FolderLinkerService;
private readonly _loadedVersions$: Subject<BSVersion[]>;
public static getInstance(): BSLocalVersionService { public static getInstance(): BSLocalVersionService {
if (!BSLocalVersionService.instance) { if (!BSLocalVersionService.instance) {
@@ -42,11 +47,16 @@ export class BSLocalVersionService {
this.remoteVersionService = BSVersionLibService.getInstance(); this.remoteVersionService = BSVersionLibService.getInstance();
this.configService = ConfigurationService.getInstance(); this.configService = ConfigurationService.getInstance();
this.linker = FolderLinkerService.getInstance(); this.linker = FolderLinkerService.getInstance();
this._loadedVersions$ = new Subject<BSVersion[]>();
} }
private async getVersionFromGlobalGameManagerFile(versionFilePath: string): Promise<BSVersion> { private async getVersionFromGlobalGameManagerFile(versionFilePath: string): Promise<BSVersion> {
if(!(await pathExist(versionFilePath))){ return null; } if(!(await pathExists(versionFilePath))){
log.info("globalgamemanagers file not found", versionFilePath);
return null;
}
const versionsDict = await this.remoteVersionService.getAvailableVersions(); const versionsDict = await this.remoteVersionService.getAvailableVersions();
@@ -74,6 +84,8 @@ export class BSLocalVersionService {
stream?.close(); stream?.close();
} }
log.info("unable to get version from globalgamemanagers file", versionFilePath);
return null; return null;
} }
@@ -85,6 +97,8 @@ export class BSLocalVersionService {
} }
): Promise<BSVersion>{ ): Promise<BSVersion>{
log.info("getVersionOfBSFolder", bsPath, options);
if(!bsPath){ return null; } if(!bsPath){ return null; }
const versionFilePath = path.join(bsPath, 'Beat Saber_Data', 'globalgamemanagers'); const versionFilePath = path.join(bsPath, 'Beat Saber_Data', 'globalgamemanagers');
@@ -105,6 +119,8 @@ export class BSLocalVersionService {
folderVersion.ino = folderStats.ino; folderVersion.ino = folderStats.ino;
} }
folderVersion.metadata = await this.getAllVersionMetadata(folderVersion, { store: BsStore.STEAM });
const customVersion = this.getCustomVersions().find(customVersion => { const customVersion = this.getCustomVersions().find(customVersion => {
return customVersion.BSVersion === folderVersion.BSVersion && customVersion.name === folderVersion.name; return customVersion.BSVersion === folderVersion.BSVersion && customVersion.name === folderVersion.name;
}); });
@@ -112,24 +128,57 @@ export class BSLocalVersionService {
folderVersion.color = customVersion?.color; folderVersion.color = customVersion?.color;
return folderVersion; return folderVersion;
} }
private setCustomVersions(versions: BSVersion[]): void{ public getAllVersionMetadata(version: BSVersion, defaultMetadata?: BSVersionMetadata): Promise<BSVersionMetadata>{
this.configService.set(this.CUSTOM_VERSIONS_KEY, versions); return (async () => {
} const versionPath = await this.getVersionPath(version);
const contents = await readFile(path.join(versionPath, this.METADATA_FILE), "utf-8");
return JSON.parse(contents);
})().catch(e => {
log.warn("Not a critical error", e);
return {};
}).then(metadata => ({...defaultMetadata, ...metadata}));
}
private addCustomVersion(version: BSVersion): void{ public getVersionMetadata<K extends keyof BSVersionMetadata, T extends BSVersionMetadata[K]>(version: BSVersion, key: K, defaultValue?: T): Promise<T|undefined>{
this.setCustomVersions([...this.getCustomVersions() ?? [], version]); return (async () => {
} const metadata = await this.getAllVersionMetadata(version);
return metadata?.[key];
})().catch(e => {
log.warn("Not a critical error", e);
return null;
}).then(value => (value ?? defaultValue) as T);
}
private getCustomVersions(): BSVersion[]{ public setVersionMetadata<K extends keyof BSVersionMetadata, T extends BSVersionMetadata[K]>(version: BSVersion, key: K, value: T): Promise<void>{
return this.configService.get<BSVersion[]>(this.CUSTOM_VERSIONS_KEY) || []; return (async () => {
} const versionPath = await this.getVersionPath(version);
const metadataPath = path.join(versionPath, this.METADATA_FILE);
const metadata = await this.getAllVersionMetadata(version) ?? ({} as BSVersionMetadata);
metadata[key] = value;
await writeFile(metadataPath, JSON.stringify(metadata));
})().catch(e => {
log.error(e);
});
}
private deleteCustomVersion(version: BSVersion): void{ private setCustomVersions(versions: BSVersion[]): void{
const customVersions = this.getCustomVersions() || []; this.configService.set(this.CUSTOM_VERSIONS_KEY, versions);
this.setCustomVersions(customVersions.filter(v => (v.name !== version.name || v.BSVersion !== version.BSVersion || v.color !== version.color))); }
}
private addCustomVersion(version: BSVersion): void{
this.setCustomVersions([...this.getCustomVersions() ?? [], version]);
}
private getCustomVersions(): BSVersion[]{
return this.configService.get<BSVersion[]>(this.CUSTOM_VERSIONS_KEY) || [];
}
private deleteCustomVersion(version: BSVersion): void{
const customVersions = this.getCustomVersions() || [];
this.setCustomVersions(customVersions.filter(v => (v.name !== version.name || v.BSVersion !== version.BSVersion || v.color !== version.color)));
}
/** /**
@@ -139,10 +188,10 @@ export class BSLocalVersionService {
*/ */
public async getVersionPath(version: BSVersion): Promise<string>{ public async getVersionPath(version: BSVersion): Promise<string>{
if(version.steam){ return this.steamService.getGameFolder(BS_APP_ID, "Beat Saber") } if(version.steam){ return this.steamService.getGameFolder(BS_APP_ID, "Beat Saber") }
if(version.oculus){ return this.oculusService.getGameFolder(OCULUS_BS_DIR); } if(version.oculus){ return this.oculusService.tryGetGameFolder([OCULUS_BS_DIR, OCULUS_BS_BACKUP_DIR]); }
return path.join( return path.join(
this.installLocationService.versionsDirectory, await this.installLocationService.versionsDirectory(),
this.getVersionFolder(version) this.getVersionFolder(version)
); );
} }
@@ -154,9 +203,9 @@ export class BSLocalVersionService {
*/ */
public async getInstalledVersionPath(version: BSVersion): Promise<string>{ public async getInstalledVersionPath(version: BSVersion): Promise<string>{
const versionPath = await this.getVersionPath(version); const versionPath = await this.getVersionPath(version);
if(await pathExist(versionPath)){ return versionPath; } if(await pathExists(versionPath)){ return versionPath; }
const versionFolders = await getFoldersInFolder(this.installLocationService.versionsDirectory); const versionFolders = await getFoldersInFolder(await this.installLocationService.versionsDirectory());
for(const folder of versionFolders){ for(const folder of versionFolders){
const stats = await lstat(folder); const stats = await lstat(folder);
@@ -185,7 +234,7 @@ export class BSLocalVersionService {
private async getSteamVersion(): Promise<BSVersion> { private async getSteamVersion(): Promise<BSVersion> {
const steamBsFolder = await this.steamService.getGameFolder(BS_APP_ID, "Beat Saber"); const steamBsFolder = await this.steamService.getGameFolder(BS_APP_ID, "Beat Saber");
if (!steamBsFolder || !(await pathExist(steamBsFolder))) { if (!steamBsFolder || !(await pathExists(steamBsFolder))) {
return null; return null;
} }
@@ -193,7 +242,7 @@ export class BSLocalVersionService {
} }
private async getOculusVersion(): Promise<BSVersion> { private async getOculusVersion(): Promise<BSVersion> {
const oculusBsFolder = await this.oculusService.getGameFolder(OCULUS_BS_DIR); const oculusBsFolder = await this.oculusService.tryGetGameFolder([OCULUS_BS_DIR, OCULUS_BS_BACKUP_DIR]);
if (!oculusBsFolder) { if (!oculusBsFolder) {
return null; return null;
@@ -205,26 +254,35 @@ export class BSLocalVersionService {
public async getInstalledVersions(): Promise<BSVersion[]> { public async getInstalledVersions(): Promise<BSVersion[]> {
const versions: BSVersion[] = []; const versions: BSVersion[] = [];
const steamVersion = await this.getSteamVersion(); const steamVersion = await this.getSteamVersion().catch(e => {
log.error("unable to get original Steam version", e);
});
if (steamVersion) { if (steamVersion) {
versions.push(steamVersion); versions.push(steamVersion);
} }
const oculusVersion = await this.getOculusVersion(); const oculusVersion = await this.getOculusVersion().catch(e => {
log.error("unable to get original Oculus version", e);
});
if (oculusVersion) { if (oculusVersion) {
versions.push(oculusVersion); versions.push(oculusVersion);
} }
if (!(await pathExist(this.installLocationService.versionsDirectory))) { if (!(await pathExists(await this.installLocationService.versionsDirectory()))) {
return versions; return versions;
} }
const folderInInstallation = await getFoldersInFolder(this.installLocationService.versionsDirectory); const folderInInstallation = await getFoldersInFolder(await this.installLocationService.versionsDirectory());
log.info("Finded versions folders", folderInInstallation);
for (const f of folderInInstallation) { for (const f of folderInInstallation) {
log.info("try get version from folder", f);
const version = await this.getVersionOfBSFolder(f); const version = await this.getVersionOfBSFolder(f).catch(e => {
log.error("unable to get version of folder", f, e);
});
if(!version){ continue; } if(!version){ continue; }
@@ -233,13 +291,15 @@ export class BSLocalVersionService {
this.setCustomVersions(versions.filter(v => !!v.color)); this.setCustomVersions(versions.filter(v => !!v.color));
this._loadedVersions$.next(versions);
return versions; return versions;
} }
public async deleteVersion(version: BSVersion): Promise<boolean>{ public async deleteVersion(version: BSVersion): Promise<boolean>{
if(version.steam || version.oculus){ return false; } if(version.steam || version.oculus){ return false; }
const versionFolder = await this.getVersionPath(version); const versionFolder = await this.getVersionPath(version);
if(!(await pathExist(versionFolder))){ return true; } if(!(await pathExists(versionFolder))){ return true; }
return deleteFolder(versionFolder) return deleteFolder(versionFolder)
.then(() => { return true; }) .then(() => { return true; })
@@ -260,7 +320,7 @@ export class BSLocalVersionService {
return editedVersion; return editedVersion;
} }
if((await pathExist(newPath)) && newPath === oldPath){ throw {title: "VersionAlreadExist"} as BsmException; } if((await pathExists(newPath)) && newPath === oldPath){ throw {title: "VersionAlreadExist"} as BsmException; }
return rename(oldPath, newPath).then(() => { return rename(oldPath, newPath).then(() => {
this.deleteCustomVersion(version); this.deleteCustomVersion(version);
@@ -284,7 +344,7 @@ export class BSLocalVersionService {
this.addCustomVersion(cloneVersion); this.addCustomVersion(cloneVersion);
} }
if(await pathExist(newPath)){ throw {title: "VersionAlreadExist"} as BsmException; } if(await pathExists(newPath)){ throw {title: "VersionAlreadExist"} as BsmException; }
return copyDirectoryWithJunctions(originPath, newPath).then(() => { return copyDirectoryWithJunctions(originPath, newPath).then(() => {
this.addCustomVersion(cloneVersion); this.addCustomVersion(cloneVersion);
@@ -295,6 +355,34 @@ export class BSLocalVersionService {
}) })
} }
public importVersion(opt: ImportVersionOptions): Observable<Progression<BSVersion>>{
const { fromPath, store } = opt;
let failed = false;
let versionDest: {version: BSVersion, dest: string} = null;
return from(this.getVersionOfBSFolder(fromPath)).pipe(
map(version => version || CustomError.throw(new Error("Unable to get BS version of path"), "NOT_BS_FOLDER")),
switchMap(version => this.getVersionPath(version).then(dest => ({version, dest}))),
switchMap(({version, dest}) => ensurePathNotAlreadyExist(dest).then(uniquePath => {
const res = dest === uniquePath ? {version, dest} : {version: {...version, name: path.basename(uniquePath)}, dest: uniquePath} as {version: BSVersion, dest: string};
versionDest = res;
return res;
})),
switchMap(({version, dest}) => rxCopy(fromPath, dest, { dereference: true }).pipe(
map(progress => ({...progress, data: version}))
)),
catchError(err => {
failed = true;
return throwError(() => err);
}),
finalize(async () => {
if(failed){ return; }
await this.setVersionMetadata(versionDest.version, "store", store);
})
);
}
public async getLinkedFolders(version: BSVersion): Promise<string[]>{ public async getLinkedFolders(version: BSVersion): Promise<string[]>{
const versionPath = await this.getVersionPath(version); const versionPath = await this.getVersionPath(version);
const [rootFolders, beatSaberDataFolders] = await Promise.all([getFoldersInFolder(versionPath), getFoldersInFolder(path.join(versionPath, "Beat Saber_Data"))]); const [rootFolders, beatSaberDataFolders] = await Promise.all([getFoldersInFolder(versionPath), getFoldersInFolder(path.join(versionPath, "Beat Saber_Data"))]);
@@ -310,4 +398,13 @@ export class BSLocalVersionService {
return (await linkedFolder).filter(folder => folder); return (await linkedFolder).filter(folder => folder);
} }
public get loadedVersions$(): Observable<BSVersion[]>{
return this._loadedVersions$.asObservable();
}
}
export interface ImportVersionOptions {
fromPath: string;
store: BsStore
} }
@@ -0,0 +1,187 @@
import { BSVersion } from "../../../shared/bs-version.interface";
import { WindowManagerService } from "../window-manager.service";
import { minToMs, msToS } from "../../../shared/helpers/time.helpers";
import log from "electron-log";
import { CustomError } from "../../../shared/models/exceptions/custom-error.class";
import { OculusDownloader } from "../../models/oculus-downloader.class";
import { Cookie, session } from "electron";
import { Progression, ensurePathNotAlreadyExist } from "../../helpers/fs.helpers";
import { BSLocalVersionService } from "../bs-local-version.service";
import { Observable, finalize, from, map, of, switchMap } from "rxjs";
import path from "path";
import { DownloadInfo } from "./bs-steam-downloader.service";
import { BsStore } from "../../../shared/models/bs-store.enum";
import { isOculusTokenValid } from "../../../shared/helpers/oculus.helpers";
export class BsOculusDownloaderService {
private static instance: BsOculusDownloaderService;
public static getInstance(): BsOculusDownloaderService {
if (!BsOculusDownloaderService.instance) {
BsOculusDownloaderService.instance = new BsOculusDownloaderService();
}
return BsOculusDownloaderService.instance;
}
private readonly oculusDownloader: OculusDownloader;
private readonly windows: WindowManagerService;
private readonly versions: BSLocalVersionService;
private constructor() {
this.windows = WindowManagerService.getInstance();
this.versions = BSLocalVersionService.getInstance();
this.oculusDownloader = new OculusDownloader();
}
private isUserTokenValid(token: string): boolean{
return isOculusTokenValid(token, log.info);
}
private isCookieValid(cookie: Cookie): boolean {
if(!cookie){
return false;
}
return cookie.expirationDate > msToS(Date.now());
}
public async getAuthToken(): Promise<string | undefined> {
const cookie = await session.defaultSession.cookies.get({ name: "oc_www_at" }).then(a => a?.at(0));
if(this.isCookieValid(cookie) && this.isUserTokenValid(cookie.value)){
return cookie.value;
}
return undefined;
}
private async getUserTokenFromMetaAuth(keepToken: boolean): Promise<string>{
const redirectUrl = "https://developer.oculus.com/manage/";
const loginUrl = `https://auth.oculus.com/login/?redirect_uri=${encodeURIComponent(redirectUrl)}`;
const window = await this.windows.openWindow(loginUrl, { frame: true, width: 650, height: 800 });
let timout: NodeJS.Timeout;
const promise = new Promise<string>((resolve, reject) => {
timout = setTimeout(() => {
reject(new CustomError("Trying to get Oculus user token timed out", "META_LOGIN_TIMED_OUT"));
window.close();
}, minToMs(5));
window.webContents.on("did-navigate", async (_, url) => {
if(!url.startsWith(redirectUrl)){ return; }
const token = (await window.webContents.session.cookies.get({ name: "oc_www_at" })).at(0)?.value;
if(!this.isUserTokenValid(token)){
return;
}
resolve(token);
});
window.on("closed", () => {
reject(new CustomError("Oculus login window closed by user", "META_LOGIN_WINDOW_CLOSED_BY_USER"));
});
}).finally(() => {
clearTimeout(timout);
if(!keepToken){
this.clearAuthToken();
}
if(!window.isDestroyed() && window.isClosable()){
window.close();
}
});
return promise;
}
private async createDownloadVersion(version: BSVersion): Promise<{version: BSVersion, dest: string}>{
const dest = await ensurePathNotAlreadyExist(await this.versions.getVersionPath(version));
return {
version: {
...version,
...(path.basename(dest) !== version.BSVersion && { name: path.basename(dest) }),
metadata: { store: BsStore.OCULUS }
},
dest
};
}
public stopDownload(){
this.oculusDownloader.stopDownload();
}
public downloadVersion(downloadInfo: DownloadInfo): Observable<Progression<BSVersion>>{
let downloadVersion: BSVersion
const tokenObs$ = downloadInfo.token ? of(downloadInfo.token) : from(this.getUserTokenFromMetaAuth(downloadInfo.stay));
return tokenObs$.pipe(
switchMap(token => {
if(!downloadInfo.isVerification){
return this.createDownloadVersion(downloadInfo.bsVersion).then(({version, dest}) => ({token, version, dest}))
}
return this.versions.getVersionPath(downloadInfo.bsVersion).then(path => ({token, version: downloadInfo.bsVersion, dest: path}));
}),
switchMap(({token, version, dest}) => {
downloadVersion = version;
return this.oculusDownloader.downloadApp({ accessToken: token, binaryId: version.OculusBinaryId, destination: dest }).pipe(map(
progress => ({...progress, data: version})
));
}),
finalize(() => downloadVersion && this.versions.setVersionMetadata(downloadVersion, "store", BsStore.OCULUS)),
finalize(() => this.oculusDownloader.stopDownload())
);
}
public autoDownloadVersion(downloadInfo: DownloadInfo): Observable<Progression<BSVersion>>{
let downloadVersion: BSVersion
const tokenObs$ = downloadInfo.token ? of(downloadInfo.token) : from(this.getAuthToken());
return tokenObs$.pipe(
map(token => {
if(!token){
throw new CustomError("No Meta auth token was found in cookies for auto download", "NO_META_AUTH_TOKEN");
}
return token;
}),
switchMap(token => {
if(!downloadInfo.isVerification){
return this.createDownloadVersion(downloadInfo.bsVersion).then(({version, dest}) => ({token, version, dest}));
}
return this.versions.getVersionPath(downloadInfo.bsVersion).then(path => ({token, version: downloadInfo.bsVersion, dest: path}));
}),
switchMap(({token, version, dest}) => {
downloadVersion = version;
return this.oculusDownloader.downloadApp({ accessToken: token, binaryId: version.OculusBinaryId, destination: dest }).pipe(
map(progress => ({...progress, data: version})),
);
}),
finalize(() => downloadVersion && this.versions.setVersionMetadata(downloadVersion, "store", BsStore.OCULUS)),
finalize(() => this.oculusDownloader.stopDownload()),
);
}
public clearAuthToken(): Promise<void>{
return session.defaultSession.clearStorageData({ storages: ["cookies"], origin: ".oculus.com" })
}
}
export interface OculusDownloadInfo {
version: BSVersion;
stay?: boolean;
}
@@ -1,25 +1,25 @@
import { BS_APP_ID, BS_DEPOT } from "../constants"; import { BS_APP_ID, BS_DEPOT } from "../../constants";
import path from "path"; import path from "path";
import { BSVersion } from "shared/bs-version.interface"; import { BSVersion } from "shared/bs-version.interface";
import { UtilsService } from "./utils.service"; import { UtilsService } from "../utils.service";
import { spawnSync } from "child_process"; import { spawnSync } from "child_process";
import log from "electron-log"; import log from "electron-log";
import { InstallationLocationService } from "./installation-location.service"; import { InstallationLocationService } from "../installation-location.service";
import { BSLocalVersionService } from "./bs-local-version.service"; import { BSLocalVersionService } from "../bs-local-version.service";
import { WindowManagerService } from "./window-manager.service"; import { ensureDir } from "fs-extra";
import { copy, ensureDir } from "fs-extra"; import { ensurePathNotAlreadyExist } from "../../helpers/fs.helpers";
import { pathExist } from "../helpers/fs.helpers"; import { Observable, finalize, map } from "rxjs";
import { Observable, map } from "rxjs"; import { DepotDownloaderArgsOptions, DepotDownloaderErrorEvent, DepotDownloaderEvent, DepotDownloaderEventType, DepotDownloaderInfoEvent } from "../../../shared/models/bs-version-download/depot-downloader.model";
import { DepotDownloaderArgsOptions, DepotDownloaderErrorEvent, DepotDownloaderEvent, DepotDownloaderEventType, DepotDownloaderInfoEvent } from "../../shared/models/depot-downloader.model"; import { DepotDownloader } from "../../models/depot-downloader.class";
import { DepotDownloader } from "../models/depot-downloader.class"; import { app } from "electron";
import { BsStore } from "../../../shared/models/bs-store.enum";
export class BSInstallerService { export class BsSteamDownloaderService {
private static instance: BSInstallerService; private static instance: BsSteamDownloaderService;
private readonly utils: UtilsService; private readonly utils: UtilsService;
private readonly installLocationService: InstallationLocationService; private readonly installLocationService: InstallationLocationService;
private readonly localVersionService: BSLocalVersionService; private readonly localVersionService: BSLocalVersionService;
private readonly windows: WindowManagerService;
private depotDownloader: DepotDownloader; private depotDownloader: DepotDownloader;
@@ -27,18 +27,17 @@ export class BSInstallerService {
this.utils = UtilsService.getInstance(); this.utils = UtilsService.getInstance();
this.installLocationService = InstallationLocationService.getInstance(); this.installLocationService = InstallationLocationService.getInstance();
this.localVersionService = BSLocalVersionService.getInstance(); this.localVersionService = BSLocalVersionService.getInstance();
this.windows = WindowManagerService.getInstance();
this.windows.getWindow("index.html")?.on("close", () => { app.on("before-quit", () => {
this.depotDownloader?.stop(); this.depotDownloader?.stop();
}); });
} }
public static getInstance() { public static getInstance() {
if (!BSInstallerService.instance) { if (!BsSteamDownloaderService.instance) {
BSInstallerService.instance = new BSInstallerService(); BsSteamDownloaderService.instance = new BsSteamDownloaderService();
} }
return BSInstallerService.instance; return BsSteamDownloaderService.instance;
} }
private getDepotDownloaderExePath(): string { private getDepotDownloaderExePath(): string {
@@ -61,11 +60,15 @@ export class BSInstallerService {
} }
} }
private async buildDepotDownloaderInstance(downloadInfos: DownloadInfo, qr?: boolean): Promise<DepotDownloader> { private async buildDepotDownloaderInstance(downloadInfos: DownloadSteamInfo, qr?: boolean): Promise<{depotDownloader: DepotDownloader, depotDownloaderOptions: DepotDownloaderArgsOptions, version: BSVersion}> {
const versionPath = await this.localVersionService.getVersionPath(downloadInfos.bsVersion); const versionPath = await this.localVersionService.getVersionPath(downloadInfos.bsVersion);
const dest = downloadInfos.isVerification ? versionPath : await this.getPathNotAleardyExist(versionPath); const dest = downloadInfos.isVerification ? versionPath : await ensurePathNotAlreadyExist(versionPath);
const downloadVersion: BSVersion = { ...downloadInfos.bsVersion, ...(path.basename(dest) !== downloadInfos.bsVersion.BSVersion && { name: path.basename(dest) }) }; const downloadVersion: BSVersion = {
...downloadInfos.bsVersion,
...(path.basename(dest) !== downloadInfos.bsVersion.BSVersion && { name: path.basename(dest) }),
metadata: { store: BsStore.STEAM }
};
const depotDownloaderOptions: DepotDownloaderArgsOptions = { const depotDownloaderOptions: DepotDownloaderArgsOptions = {
app: BS_APP_ID, app: BS_APP_ID,
@@ -79,26 +82,28 @@ export class BSInstallerService {
qr qr
} }
await ensureDir(this.installLocationService.versionsDirectory); await ensureDir(await this.installLocationService.versionsDirectory());
const isLinux = process.platform === 'linux'; const isLinux = process.platform === 'linux';
const exePath = this.getDepotDownloaderExePath(); const exePath = this.getDepotDownloaderExePath();
const args = DepotDownloader.buildArgs(depotDownloaderOptions); const args = DepotDownloader.buildArgs(depotDownloaderOptions);
return new DepotDownloader({ const depotDownloader = new DepotDownloader({
command: isLinux ? 'dotnet' : exePath, command: isLinux ? 'dotnet' : exePath,
args: isLinux ? [exePath, ...args] : args, args: isLinux ? [exePath, ...args] : args,
options: { cwd: this.installLocationService.versionsDirectory }, options: { cwd: await this.installLocationService.versionsDirectory() },
echoStartData: downloadVersion echoStartData: downloadVersion
}, log); }, log);
return { depotDownloader, depotDownloaderOptions, version: downloadVersion }
} }
private buildDepotDownloaderObservable(downloadInfos: DownloadInfo, qr?: boolean): Observable<DepotDownloaderEvent> { private buildDepotDownloaderObservable(downloadInfos: DownloadSteamInfo, qr?: boolean): Observable<DepotDownloaderEvent> {
return new Observable(sub => { return new Observable(sub => {
const depotDownloaderBuildPromise = this.buildDepotDownloaderInstance(downloadInfos, qr); const depotDownloaderBuildPromise = this.buildDepotDownloaderInstance(downloadInfos, qr);
depotDownloaderBuildPromise.then(depotDownloader => { depotDownloaderBuildPromise.then(({ depotDownloader, version }) => {
if(this.depotDownloader?.running){ if(this.depotDownloader?.running){
this.depotDownloader.stop(); this.depotDownloader.stop();
@@ -106,12 +111,15 @@ export class BSInstallerService {
this.depotDownloader = depotDownloader; this.depotDownloader = depotDownloader;
depotDownloader.$events().pipe(map(event => { depotDownloader.$events().pipe(
if(event.type === DepotDownloaderEventType.Error){ map(event => {
throw event; if(event.type === DepotDownloaderEventType.Error){
} throw event;
return event; }
})).subscribe(sub); return event;
}),
finalize(() => this.localVersionService.setVersionMetadata(version, "store", BsStore.STEAM))
).subscribe(sub);
}).catch(err => sub.error({ }).catch(err => sub.error({
type: DepotDownloaderEventType.Error, type: DepotDownloaderEventType.Error,
@@ -120,16 +128,16 @@ export class BSInstallerService {
} as DepotDownloaderEvent)); } as DepotDownloaderEvent));
return () => { return () => {
depotDownloaderBuildPromise.then(depotDownloader => depotDownloader.stop()); depotDownloaderBuildPromise.then(({ depotDownloader }) => depotDownloader.stop());
} }
}); });
} }
public downloadBsVersion(downloadInfos: DownloadInfo): Observable<DepotDownloaderEvent> { public downloadBsVersion(downloadInfos: DownloadSteamInfo): Observable<DepotDownloaderEvent> {
return this.buildDepotDownloaderObservable(downloadInfos); return this.buildDepotDownloaderObservable(downloadInfos);
} }
public autoDownloadBsVersion(downloadInfos: DownloadInfo): Observable<DepotDownloaderEvent> { public autoDownloadBsVersion(downloadInfos: DownloadSteamInfo): Observable<DepotDownloaderEvent> {
return this.buildDepotDownloaderObservable({...downloadInfos, password: null, stay: true}).pipe(map(event => { return this.buildDepotDownloaderObservable({...downloadInfos, password: null, stay: true}).pipe(map(event => {
if(event.type === DepotDownloaderEventType.Info && event.subType === DepotDownloaderInfoEvent.Password){ if(event.type === DepotDownloaderEventType.Info && event.subType === DepotDownloaderInfoEvent.Password){
throw new Error("Ask for password while auto download"); throw new Error("Ask for password while auto download");
@@ -138,7 +146,7 @@ export class BSInstallerService {
})); }));
} }
public downloadBsVersionWithQRCode(downloadInfos: DownloadInfo): Observable<DepotDownloaderEvent> { public downloadBsVersionWithQRCode(downloadInfos: DownloadSteamInfo): Observable<DepotDownloaderEvent> {
return this.buildDepotDownloaderObservable(downloadInfos, true); return this.buildDepotDownloaderObservable(downloadInfos, true);
} }
@@ -149,42 +157,18 @@ export class BSInstallerService {
public stopDownload(): void { public stopDownload(): void {
this.depotDownloader?.stop(); this.depotDownloader?.stop();
} }
private async getPathNotAleardyExist(path: string): Promise<string> {
let destPath = path;
let folderExist = await pathExist(destPath);
let i = 0;
while (folderExist) {
i++;
destPath = `${path} (${i})`;
folderExist = await pathExist(destPath);
}
return destPath;
}
public async importVersion(path: string): Promise<BSVersion> {
const version = await this.localVersionService.getVersionOfBSFolder(path);
if (!version) {
throw new Error("NOT_BS_FOLDER");
}
const destPath = await this.getPathNotAleardyExist(await this.localVersionService.getVersionPath(version));
await copy(path, destPath, { dereference: true });
return version;
}
} }
export interface DownloadInfo { export interface DownloadInfo {
bsVersion: BSVersion; bsVersion: BSVersion;
isVerification?: boolean;
stay?: boolean;
token?: string;
}
export interface DownloadSteamInfo extends DownloadInfo {
username?: string; username?: string;
password?: string; password?: string;
stay?: boolean;
isVerification?: boolean;
} }
export interface DownloadEvent { export interface DownloadEvent {
+1 -2
View File
@@ -1,6 +1,5 @@
import { Subject, Subscription, filter } from "rxjs"; import { Subject, Subscription, filter } from "rxjs";
import { DeepLinkService } from "./deep-link.service"; import { DeepLinkService } from "./deep-link.service";
import { URL } from "url";
import { buildUrl, isValidUrl } from "../../shared/helpers/url.helpers"; import { buildUrl, isValidUrl } from "../../shared/helpers/url.helpers";
export class BsmProtocolService { export class BsmProtocolService {
@@ -30,7 +29,7 @@ export class BsmProtocolService {
} }
private registerBsmProtocol(): boolean{ private registerBsmProtocol(): boolean{
if(this.deepLink.isDeepLinkRegistred(this.BSM_PROTOCOL)){ return true; } if(this.deepLink.isDeepLinkRegistered(this.BSM_PROTOCOL)){ return true; }
return this.deepLink.registerDeepLink(this.BSM_PROTOCOL); return this.deepLink.registerDeepLink(this.BSM_PROTOCOL);
} }
+3 -3
View File
@@ -19,11 +19,11 @@ export class ConfigurationService {
this.locations = InstallationLocationService.getInstance(); this.locations = InstallationLocationService.getInstance();
this.initStore(); this.initStore();
this.locations.onInstallLocationUpdate(() => this.initStore()); this.locations.onInstallLocationUpdate(() => { this.initStore() });
} }
private initStore() { private async initStore() {
const contentPath = this.locations.installationDirectory; const contentPath = await this.locations.installationDirectory();
this.store = new ElectronStore({ this.store = new ElectronStore({
cwd: contentPath, cwd: contentPath,
name: "config", name: "config",
+1 -1
View File
@@ -35,7 +35,7 @@ export class DeepLinkService {
return app.removeAsDefaultProtocolClient(protocol); return app.removeAsDefaultProtocolClient(protocol);
} }
public isDeepLinkRegistred(protocol: string): boolean { public isDeepLinkRegistered(protocol: string): boolean {
if (process.defaultApp && process.argv.length >= 2) { if (process.defaultApp && process.argv.length >= 2) {
return app.isDefaultProtocolClient(protocol, process.execPath, [path.resolve(process.argv[1])]); return app.isDefaultProtocolClient(protocol, process.execPath, [path.resolve(process.argv[1])]);
} }
+6 -6
View File
@@ -21,12 +21,12 @@ export class FolderLinkerService {
this.installLocationService = InstallationLocationService.getInstance(); this.installLocationService = InstallationLocationService.getInstance();
} }
private get sharedFolder(): string { private async sharedFolder(): Promise<string> {
return this.installLocationService.sharedContentPath; return this.installLocationService.sharedContentPath();
} }
private getSharedFolder(folderPath: string, intermediateFolder?: string): string { private async getSharedFolder(folderPath: string, intermediateFolder?: string): Promise<string> {
return path.join(this.sharedFolder, intermediateFolder ?? "", path.basename(folderPath)); return path.join(await this.sharedFolder(), intermediateFolder ?? "", path.basename(folderPath));
} }
private getBackupFolder(folderPath: string): string { private getBackupFolder(folderPath: string): string {
@@ -50,7 +50,7 @@ export class FolderLinkerService {
} }
public async linkFolder(folderPath: string, options?: LinkOptions): Promise<void> { public async linkFolder(folderPath: string, options?: LinkOptions): Promise<void> {
const sharedPath = this.getSharedFolder(folderPath, options?.intermediateFolder); const sharedPath = await this.getSharedFolder(folderPath, options?.intermediateFolder);
if (await this.isFolderSymlink(folderPath)) { if (await this.isFolderSymlink(folderPath)) {
const isTargetedToSharedPath = await readlink(folderPath) const isTargetedToSharedPath = await readlink(folderPath)
@@ -86,7 +86,7 @@ export class FolderLinkerService {
} }
await unlinkPath(folderPath); await unlinkPath(folderPath);
const sharedPath = this.getSharedFolder(folderPath, options?.intermediateFolder); const sharedPath = await this.getSharedFolder(folderPath, options?.intermediateFolder);
await ensureFolderExist(folderPath); await ensureFolderExist(folderPath);
@@ -1,7 +1,7 @@
import path from "path"; import path from "path";
import { app } from "electron"; import { app } from "electron";
import ElectronStore from "electron-store"; import ElectronStore from "electron-store";
import { copyDirectoryWithJunctions, deleteFolder, ensureFolderExist } from "../helpers/fs.helpers"; import { copyDirectoryWithJunctions, deleteFolder, ensureFolderExist, pathExist } from "../helpers/fs.helpers";
export class InstallationLocationService { export class InstallationLocationService {
private static instance: InstallationLocationService; private static instance: InstallationLocationService;
@@ -13,8 +13,8 @@ export class InstallationLocationService {
return InstallationLocationService.instance; return InstallationLocationService.instance;
} }
private readonly INSTALLATION_FOLDER = "BSManager"; public readonly INSTALLATION_FOLDER = "BSManager";
private readonly VERSIONS_FOLDER = "BSInstances"; public readonly VERSIONS_FOLDER = "BSInstances";
private readonly SHARED_CONTENT_FOLDER = "SharedContent"; private readonly SHARED_CONTENT_FOLDER = "SharedContent";
@@ -27,51 +27,65 @@ export class InstallationLocationService {
private constructor() { private constructor() {
this.installPathConfig = new ElectronStore({ watch: true }); this.installPathConfig = new ElectronStore({ watch: true });
this.initInstallationLocation();
this.installPathConfig.onDidChange(this.STORE_INSTALLATION_PATH_KEY, () => { this.installPathConfig.onDidChange(this.STORE_INSTALLATION_PATH_KEY, () => {
this.triggerListeners(); this.triggerListeners();
}); });
} }
private initInstallationLocation(): void {
this._installationDirectory = (this.installPathConfig.get<string>(this.STORE_INSTALLATION_PATH_KEY) as string) || app.getPath("documents");
}
private triggerListeners(): void { private triggerListeners(): void {
this.updateListeners.forEach(listener => listener()); this.updateListeners.forEach(listener => listener());
} }
public async setInstallationDirectory(newDir: string): Promise<string> { public async setInstallationDirectory(newDir: string): Promise<string> {
const oldDir = this.installationDirectory; newDir = path.basename(newDir) === this.INSTALLATION_FOLDER ? path.join(newDir, "..") : newDir;
const newDest = path.join(newDir, this.INSTALLATION_FOLDER); const oldDir = await this.installationDirectory();
await ensureFolderExist(oldDir); await ensureFolderExist(oldDir);
await copyDirectoryWithJunctions(oldDir, path.join(newDir, this.INSTALLATION_FOLDER), { overwrite: true });
await copyDirectoryWithJunctions(oldDir, newDest, { overwrite: true });
this._installationDirectory = newDir; this._installationDirectory = newDir;
this.installPathConfig.set(this.STORE_INSTALLATION_PATH_KEY, newDir); this.installPathConfig.set(this.STORE_INSTALLATION_PATH_KEY, newDir);
deleteFolder(oldDir); deleteFolder(oldDir);
return this.installationDirectory; return this.installationDirectory();
} }
public onInstallLocationUpdate(fn: Listener) { public onInstallLocationUpdate(fn: Listener) {
this.updateListeners.add(fn); this.updateListeners.add(fn);
} }
public get installationDirectory(): string { public async installationDirectory(): Promise<string> {
const installParentPath = async () => {
if(this._installationDirectory) {
return this._installationDirectory;
}
if(this.installPathConfig.has(this.STORE_INSTALLATION_PATH_KEY)) {
return this.installPathConfig.get(this.STORE_INSTALLATION_PATH_KEY) as string;
}
const oldPath = path.join(app.getPath("documents"), this.INSTALLATION_FOLDER);
if(await pathExist(oldPath)){
return app.getPath("documents");
}
return app.getPath("home");
};
this._installationDirectory = await installParentPath();
return path.join(this._installationDirectory, this.INSTALLATION_FOLDER); return path.join(this._installationDirectory, this.INSTALLATION_FOLDER);
} }
public get versionsDirectory(): string { public async versionsDirectory(): Promise<string> {
return path.join(this.installationDirectory, this.VERSIONS_FOLDER); return path.join(await this.installationDirectory(), this.VERSIONS_FOLDER);
} }
public get sharedContentPath(): string { public async sharedContentPath(): Promise<string> {
return path.join(this.installationDirectory, this.SHARED_CONTENT_FOLDER); return path.join(await this.installationDirectory(), this.SHARED_CONTENT_FOLDER);
} }
} }
+15 -20
View File
@@ -1,10 +1,9 @@
import { IpcRequest } from "shared/models/ipc"; import { IpcRequest } from "shared/models/ipc";
import { ipcMain } from "electron"; import { BrowserWindow, ipcMain } from "electron";
import { Observable } from "rxjs"; import { Observable } from "rxjs";
import { IpcCompleteChannel, IpcErrorChannel, IpcTearDownChannel } from "shared/models/ipc/ipc-response.interface"; import { IpcCompleteChannel, IpcErrorChannel, IpcTearDownChannel } from "shared/models/ipc/ipc-response.interface";
import { AppWindow } from "shared/models/window-manager/app-window.model";
import { WindowManagerService } from "./window-manager.service";
import { IpcReplier } from "shared/models/ipc/ipc-request.interface"; import { IpcReplier } from "shared/models/ipc/ipc-request.interface";
import { serializeError } from 'serialize-error';
import log from "electron-log"; import log from "electron-log";
export class IpcService { export class IpcService {
@@ -17,11 +16,7 @@ export class IpcService {
return IpcService.instance; return IpcService.instance;
} }
private readonly windows: WindowManagerService; private constructor() {}
private constructor() {
this.windows = WindowManagerService.getInstance();
}
private getErrorChannel(channel: string): IpcErrorChannel { private getErrorChannel(channel: string): IpcErrorChannel {
return `${channel}_error`; return `${channel}_error`;
@@ -37,40 +32,40 @@ export class IpcService {
private buildProxyListener<T>(listener: IpcListener<T>) { private buildProxyListener<T>(listener: IpcListener<T>) {
return (event: Electron.IpcMainEvent, req: IpcRequest<T>) => { return (event: Electron.IpcMainEvent, req: IpcRequest<T>) => {
const window = this.windows.getAppWindowFromWebContents(event.sender); const window = BrowserWindow.fromWebContents(event.sender);
const replier = (data: Observable<unknown>) => this.connectStream(req.responceChannel, window, data); const replier = (data: Observable<unknown>) => this.connectStream(req.responceChannel, window, data);
listener(req, replier); listener(req, replier);
}; };
} }
public send<T>(channel: string, window: AppWindow, response?: T | Error): void { public send<T>(channel: string, window: BrowserWindow, response?: T | Error): void {
this.windows.getWindow(window)?.webContents?.send(channel, response); window.webContents?.send(channel, response);
} }
private connectStream(channel: string, window: AppWindow, observable: Observable<unknown>): void { private connectStream(channel: string, window: BrowserWindow, observable: Observable<unknown>): void {
const sub = observable.subscribe({ const sub = observable.subscribe({
next: data => this.send(channel, window, data), next: data => this.send(channel, window, data),
error: error => { error: error => {
log.error(error); log.error(error, error?.code);
this.send(this.getErrorChannel(channel), window, error); this.send(this.getErrorChannel(channel), window, serializeError(error));
}, },
complete: () => this.send(this.getCompleteChannel(channel), window) complete: () => this.send(this.getCompleteChannel(channel), window)
}) })
ipcMain.once(this.getTearDownChannel(channel), () => sub.unsubscribe()); window.webContents.ipc.once(this.getTearDownChannel(channel), () => sub.unsubscribe());
sub.add(() => { sub.add(() => {
ipcMain.removeAllListeners(this.getTearDownChannel(channel)); window.webContents.ipc.removeAllListeners(this.getTearDownChannel(channel));
}); });
} }
public on<T>(channel: string, listener: IpcListener<T>): void { public on<T>(channel: string, listener: IpcListener<T>, ipc = ipcMain): void {
ipcMain.on(channel, this.buildProxyListener(listener)); ipc.on(channel, this.buildProxyListener(listener));
} }
public once<T>(channel: string, listener: IpcListener<T>): void { public once<T>(channel: string, listener: IpcListener<T>, ipc = ipcMain): void {
ipcMain.once(channel, this.buildProxyListener(listener)); ipc.once(channel, this.buildProxyListener(listener));
} }
} }
@@ -0,0 +1,96 @@
import { BSLauncherService } from "../bs-launcher/bs-launcher.service";
import { LivEntry, LivService } from "./liv.service";
import { LaunchOption } from "shared/models/bs-launch";
import { app } from "electron";
import { BSLocalVersionService } from "../bs-local-version.service";
import { BSVersion } from "shared/bs-version.interface";
import { debounceTime, distinctUntilChanged, map } from "rxjs";
import equal from "fast-deep-equal";
import sanitize from "sanitize-filename";
import { tryit } from "../../../shared/helpers/error.helpers";
import log from "electron-log"
export class LivShortcut {
private static instance: LivShortcut;
public static getInstance(): LivShortcut {
if (!LivShortcut.instance) {
LivShortcut.instance = new LivShortcut();
}
return LivShortcut.instance;
}
private readonly LIV_ID_PREFIX = "BSManager";
private readonly liv: LivService;
private readonly launcher: BSLauncherService;
private readonly versionManager: BSLocalVersionService;
private constructor() {
this.liv = LivService.getInstance();
this.launcher = BSLauncherService.getInstance();
this.versionManager = BSLocalVersionService.getInstance();
this.liv.isLivInstalled().then(installed => {
if(!installed){ return; }
this.versionManager.loadedVersions$.pipe(debounceTime(1000), distinctUntilChanged((prev, curr) => equal(prev, curr)), map(versions => versions.filter(v => !v.steam))).subscribe(versions => {
(async () => {
const clearedLaunchOptions = (await this.clearLivShortcuts().catch(() => [] as LivEntry[]))?.map(entry => {
return tryit(() => this.launcher.shortcutLinkToLaunchOptions(entry.arguments)).result;
});
versions.forEach(version => this.createLivShortcut({
...(clearedLaunchOptions?.find(launchOpt => launchOpt.version.ino === version.ino) ?? {}),
version
}));
})().catch(err => log.error("Error while creating LIV shortcuts", err));
});
});
}
private buildShortcutId(version: BSVersion): string {
const name = (() => {
if(version.steam){ return "Steam"; }
if(version.oculus){ return "Oculus"; }
return version.name;
})();
return sanitize([this.LIV_ID_PREFIX, name, version.BSVersion].filter(Boolean).join("-").replaceAll(".", "-").replaceAll(" ", "-"));
}
private buildShortcutName(version: BSVersion): string {
const name = (() => {
if(version.steam){ return "Steam"; }
if(version.oculus){ return "Oculus"; }
return version.name;
})();
return ["Beat Saber", name, `v${version.BSVersion}`].filter(Boolean).join(" ");
}
private async buildLivEntry(launchOptions: LaunchOption): Promise<LivEntry> {
return {
id: this.buildShortcutId(launchOptions.version),
name: this.buildShortcutName(launchOptions.version),
installPath: await this.versionManager.getInstalledVersionPath(launchOptions.version),
executable: app.getPath("exe"),
arguments: this.launcher.createLaunchLink(launchOptions)
};
}
private createLivShortcut(launchOptions: LaunchOption): Promise<void>{
return this.buildLivEntry(launchOptions).then(entry => this.liv.createLivShortcut(entry));
}
private async clearLivShortcuts(): Promise<LivEntry[]>{
const bsmShortcuts = (await this.liv.getLivShortcuts()).reduce((acc, shortcut) => {
if(shortcut.id?.startsWith(this.LIV_ID_PREFIX)){
acc.push(shortcut);
}
return acc;
}, [] as LivEntry[]);
return this.liv.deleteLivShortcuts(bsmShortcuts.map(shortcut => shortcut.id)).then(() => bsmShortcuts);
}
}
+110
View File
@@ -0,0 +1,110 @@
import { execOnOs } from "../../helpers/env.helpers";
import path from "path";
import regedit from "regedit";
export class LivService {
private static instance: LivService;
public static getInstance(): LivService {
if (!LivService.instance) {
LivService.instance = new LivService();
}
return LivService.instance;
}
private readonly livRegeditKey: string = path.join("HKCU", "SOFTWARE", "LIV.App");
private readonly livExternalAppsRegeditKey: string = path.join(this.livRegeditKey, "ExternalApplications");
private constructor() {
}
public async isLivInstalled(): Promise<boolean> {
return execOnOs({
win32: async () => {
const regRes = await regedit.promisified.list([this.livRegeditKey]).then(res => res[this.livRegeditKey]);
return regRes?.exists;
},
}, true);
}
public async createLivShortcut(entry: LivEntry): Promise<void> {
return execOnOs({
win32: async () => {
const livExternalAppRegeditKey = path.join(this.livExternalAppsRegeditKey, entry.id);
await regedit.promisified.createKey([livExternalAppRegeditKey]);
await regedit.promisified.putValue({
[livExternalAppRegeditKey]: {
"InstallPath": {
value: entry.installPath,
type: "REG_SZ"
},
"Executable": {
value: entry.executable,
type: "REG_SZ"
},
"Arguments": {
value: entry.arguments,
type: "REG_SZ"
},
"Name": {
value: entry.name,
type: "REG_SZ"
}
}
});
}
});
}
public async deleteLivShortcuts(ids: string[]): Promise<void> {
return execOnOs({
win32: async () => {
const shotcutsKeys = ids.map(id => path.join(this.livExternalAppsRegeditKey, id));
return regedit.promisified.deleteKey(shotcutsKeys);
}
})
}
public getLivShortcuts(): Promise<LivEntry[]> {
return execOnOs({
win32: async () => {
const regRes = await regedit.promisified.list([this.livExternalAppsRegeditKey]).then(res => res[this.livExternalAppsRegeditKey]);
if(!regRes.exists){
return [];
}
const promises = regRes.keys.map(async key => {
const shortcutKey = path.join(this.livExternalAppsRegeditKey, key);
const entries = await regedit.promisified.list([shortcutKey]).then(res => res[shortcutKey]);
if(!entries.exists){
return undefined;
}
return {
id: key,
name: entries.values.Name.value,
installPath: entries.values.InstallPath.value,
executable: entries.values.Executable.value,
arguments: entries.values.Arguments.value
} as LivEntry;
});
return Promise.all(promises).then(entries => entries.filter(Boolean));
}
});
}
}
export interface LivEntry {
id: string,
name: string,
installPath: string,
executable: string,
arguments: string
}
@@ -9,11 +9,13 @@ import { RequestService } from "../request.service";
import { spawn } from "child_process"; import { spawn } from "child_process";
import { BS_EXECUTABLE } from "../../constants"; import { BS_EXECUTABLE } from "../../constants";
import log from "electron-log"; import log from "electron-log";
import { deleteFolder, pathExist, unlinkPath, ensureFolderExist } from "../../helpers/fs.helpers"; import { deleteFolder, pathExist, unlinkPath } from "../../helpers/fs.helpers";
import { lastValueFrom } from "rxjs"; import { lastValueFrom } from "rxjs";
import JSZip from "jszip"; import JSZip from "jszip";
import { extractZip } from "../../helpers/zip.helpers"; import { extractZip } from "../../helpers/zip.helpers";
import recursiveReadDir from "recursive-readdir"; import recursiveReadDir from "recursive-readdir";
import { minToMs } from "../../../shared/helpers/time.helpers";
import { ensureDir } from "fs-extra";
export class BsModsManagerService { export class BsModsManagerService {
private static instance: BsModsManagerService; private static instance: BsModsManagerService;
@@ -121,6 +123,8 @@ export class BsModsManagerService {
private async downloadZip(zipUrl: string): Promise<JSZip> { private async downloadZip(zipUrl: string): Promise<JSZip> {
zipUrl = path.join(this.beatModsApi.BEAT_MODS_URL, zipUrl); zipUrl = path.join(this.beatModsApi.BEAT_MODS_URL, zipUrl);
log.info("Download mod zip", zipUrl);
const buffer = await lastValueFrom(this.requestService.downloadBuffer(zipUrl)) const buffer = await lastValueFrom(this.requestService.downloadBuffer(zipUrl))
.then(progress => progress.data) .then(progress => progress.data)
.catch(e => { .catch(e => {
@@ -139,24 +143,33 @@ export class BsModsManagerService {
} }
private async executeBSIPA(version: BSVersion, args: string[]): Promise<boolean> { private async executeBSIPA(version: BSVersion, args: string[]): Promise<boolean> {
log.info("executeBSIPA", version?.BSVersion, args);
const versionPath = await this.bsLocalService.getVersionPath(version); const versionPath = await this.bsLocalService.getVersionPath(version);
const ipaPath = path.join(versionPath, "IPA.exe"); const ipaPath = path.join(versionPath, "IPA.exe");
const bsExePath = path.join(versionPath, BS_EXECUTABLE); const bsExePath = path.join(versionPath, BS_EXECUTABLE);
if (!(await pathExist(ipaPath)) || !(await pathExist(bsExePath))) { if (!(await pathExist(ipaPath)) || !(await pathExist(bsExePath))) {
log.error("IPA.exe or Beat Saber.exe not found");
return false; return false;
} }
return new Promise<boolean>(resolve => { return new Promise<boolean>(resolve => {
log.info("START IPA PROCESS", `start /wait /min "" "${ipaPath}" ${args.join(" ")}`);
const processIPA = spawn(`start /wait /min "" "${ipaPath}" ${args.join(" ")}`, { cwd: versionPath, detached: true, shell: true }); const processIPA = spawn(`start /wait /min "" "${ipaPath}" ${args.join(" ")}`, { cwd: versionPath, detached: true, shell: true });
processIPA.once("exit", code => { processIPA.once("exit", code => {
if (code === 0) { if (code === 0) {
log.info("Ipa process exist with code 0");
return resolve(true); return resolve(true);
} }
log.error("IPA PROCESS", "exit code", code); log.error("Ipa process exist with non 0 code", code);
resolve(false); resolve(false);
}); });
setTimeout(() => resolve(false), 1 * 60 * 1000); // timeout 1min setTimeout(() => {
log.info("Ipa process timeout");
resolve(false)
}, minToMs(1));
}); });
} }
@@ -168,6 +181,7 @@ export class BsModsManagerService {
} }
private async installMod(mod: Mod, version: BSVersion): Promise<boolean> { private async installMod(mod: Mod, version: BSVersion): Promise<boolean> {
log.info("INSTALL MOD", mod.name, "for version", `${version.BSVersion} - ${version.name}`);
this.utilsService.ipcSend<ModInstallProgression>("mod-installed", { success: true, data: { name: mod.name, progression: ((this.nbInstalledMods + 1) / this.nbModsToInstall) * 100 } }); this.utilsService.ipcSend<ModInstallProgression>("mod-installed", { success: true, data: { name: mod.name, progression: ((this.nbInstalledMods + 1) / this.nbModsToInstall) * 100 } });
const download = this.getModDownload(mod, version); const download = this.getModDownload(mod, version);
@@ -176,7 +190,9 @@ export class BsModsManagerService {
return false; return false;
} }
log.info("Start download mod zip", mod.name, download.url);
const zip = await this.downloadZip(download.url); const zip = await this.downloadZip(download.url);
log.info("Mod zip download end", mod.name, download.url, !!zip);
if (!zip) { if (!zip) {
return false; return false;
@@ -192,7 +208,10 @@ export class BsModsManagerService {
const entryMd5 = crypto.createHash("md5").update(data).digest("hex"); const entryMd5 = crypto.createHash("md5").update(data).digest("hex");
return download.hashMd5.some(md5 => md5.hash === entryMd5) ? entry : undefined; return download.hashMd5.some(md5 => md5.hash === entryMd5) ? entry : undefined;
}) })
) ).catch(e => {
log.error("Error while checking mod zip entries", mod.name, e);
throw e;
})
).filter(entry => !!entry); ).filter(entry => !!entry);
if (checkedEntries.length !== download.hashMd5.length) { if (checkedEntries.length !== download.hashMd5.length) {
@@ -203,13 +222,16 @@ export class BsModsManagerService {
const isBSIPA = mod.name.toLowerCase() === "bsipa"; const isBSIPA = mod.name.toLowerCase() === "bsipa";
const destDir = isBSIPA ? verionPath : path.join(verionPath, ModsInstallFolder.PENDING); const destDir = isBSIPA ? verionPath : path.join(verionPath, ModsInstallFolder.PENDING);
await ensureFolderExist(destDir); await ensureDir(destDir);
log.info("Start extracting mod zip", mod.name, "to", destDir);
const extracted = await extractZip(zip, destDir) const extracted = await extractZip(zip, destDir)
.then(() => true) .then(() => true)
.catch(e => { .catch(e => {
log.error("EXTRACT MOD ZIP", e); log.error("Error while extracting mod zip", e);
return false; return false;
}); });
log.info("Mod zip extraction end", mod.name, "to", destDir, "success:", extracted);
const res = isBSIPA const res = isBSIPA
? extracted && ? extracted &&
+35 -22
View File
@@ -1,15 +1,13 @@
import { UtilsService } from "./utils.service";
import regedit from "regedit"; import regedit from "regedit";
import path from "path"; import path from "path";
import { pathExist } from "../helpers/fs.helpers"; import { pathExist } from "../helpers/fs.helpers";
import log from "electron-log"; import log from "electron-log";
import { lstat } from "fs-extra";
export class OculusService { export class OculusService {
private static instance: OculusService; private static instance: OculusService;
private readonly utils: UtilsService; private oculusLibraries: OculusLibrary[];
private oculusPaths: string[];
public static getInstance(): OculusService { public static getInstance(): OculusService {
if (!OculusService.instance) { if (!OculusService.instance) {
@@ -18,22 +16,16 @@ export class OculusService {
return OculusService.instance; return OculusService.instance;
} }
private constructor() { private constructor() {}
this.utils = UtilsService.getInstance();
}
public async oculusRunning(): Promise<boolean> { public async getOculusLibs(): Promise<OculusLibrary[]> {
return this.utils.taskRunning("OculusClient.exe");
}
public async getOculusLibsPath(): Promise<string[]> {
if (process.platform !== "win32") { if (process.platform !== "win32") {
log.info("Oculus library auto-detection not supported on non-windows platforms"); log.info("Oculus library auto-detection not supported on non-windows platforms");
return null; return null;
} }
if (this.oculusPaths) { if (this.oculusLibraries) {
return this.oculusPaths; return this.oculusLibraries;
} }
const oculusLibsRegKey = "HKCU\\SOFTWARE\\Oculus VR, LLC\\Oculus\\Libraries"; const oculusLibsRegKey = "HKCU\\SOFTWARE\\Oculus VR, LLC\\Oculus\\Libraries";
@@ -44,7 +36,9 @@ export class OculusService {
return null; return null;
} }
const libsPath = ( const defaultLibraryId = libsRegData.values.DefaultLibrary.value as string;
const libsPath: OculusLibrary[] = (
await Promise.all( await Promise.all(
libsRegData.keys.map(async key => { libsRegData.keys.map(async key => {
const originalPath = (await regedit.promisified.list([`${oculusLibsRegKey}\\${key}`]))[`${oculusLibsRegKey}\\${key}`]; const originalPath = (await regedit.promisified.list([`${oculusLibsRegKey}\\${key}`]))[`${oculusLibsRegKey}\\${key}`];
@@ -52,18 +46,18 @@ export class OculusService {
return null; return null;
} }
return originalPath.values.OriginalPath.value as string; return { id: key, path: originalPath.values.OriginalPath.value, isDefault: defaultLibraryId === key } as OculusLibrary
}, []) }, [])
) )
).filter(path => !!path); ).filter(Boolean);
this.oculusPaths = libsPath; this.oculusLibraries = libsPath;
return libsPath; return libsPath;
} }
public async getGameFolder(gameFolder: string): Promise<string> { public async getGameFolder(gameFolder: string): Promise<string> {
const libsFolders = await this.getOculusLibsPath(); const libsFolders = await this.getOculusLibs();
if (!libsFolders) { if (!libsFolders) {
return null; return null;
@@ -71,13 +65,32 @@ export class OculusService {
const rootLibDir = "Software"; const rootLibDir = "Software";
for (const lib of libsFolders) { for (const { path: libPath } of libsFolders) {
const gameFullPath = path.join(lib, rootLibDir, gameFolder); const gameFullPath = path.join(libPath, rootLibDir, gameFolder);
if (await pathExist(gameFullPath)) { if (await pathExist(gameFullPath)) {
return gameFullPath; return (await lstat(gameFullPath)).isSymbolicLink() ? null : gameFullPath;
} }
} }
return null; return null;
} }
/**
* Return the first game folder found in the list
* @param {string[]} gameFolders
*/
public async tryGetGameFolder(gameFolders: string[]): Promise<string> {
for(const gameFolder of gameFolders){
const fullPath = await this.getGameFolder(gameFolder);
if(fullPath){ return fullPath; }
}
return null;
}
}
export interface OculusLibrary {
id: string;
path: string;
isDefault?: boolean;
} }
+11 -6
View File
@@ -1,4 +1,4 @@
import { get } from "https"; import { Agent, get } from "https";
import { createWriteStream, unlink } from "fs"; import { createWriteStream, unlink } from "fs";
import { Progression } from "main/helpers/fs.helpers"; import { Progression } from "main/helpers/fs.helpers";
import { Observable, shareReplay, tap } from "rxjs"; import { Observable, shareReplay, tap } from "rxjs";
@@ -17,12 +17,17 @@ export class RequestService {
private constructor() {} private constructor() {}
private get ipv4Agent(){
return new Agent({ family: 4 });
}
public async getJSON<T = unknown>(url: RequestInfo, options?: RequestInit): Promise<T> { public async getJSON<T = unknown>(url: RequestInfo, options?: RequestInit): Promise<T> {
try { try {
const response = await fetch(url, options); const response = await fetch(url, {...options, agent: this.ipv4Agent});
if (!response.ok) { if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status} ${response}`); throw new Error(`HTTP error! status: ${response.status} ${url}`);
} }
return await response.json(); return await response.json();
@@ -45,7 +50,7 @@ export class RequestService {
}); });
file.on("error", err => unlink(dest, () => subscriber.error(err))); file.on("error", err => unlink(dest, () => subscriber.error(err)));
const req = get(url, res => { const req = get(url, { agent: this.ipv4Agent }, res => {
progress.total = parseInt(res.headers?.["content-length"] || "0", 10); progress.total = parseInt(res.headers?.["content-length"] || "0", 10);
res.on("data", chunk => { res.on("data", chunk => {
@@ -59,7 +64,7 @@ export class RequestService {
req.on("error", err => { req.on("error", err => {
subscriber.error(err); subscriber.error(err);
}); });
}).pipe(tap({ error: e => log.error(e) }), shareReplay(1)); }).pipe(tap({ error: e => log.error(e, url, dest) }), shareReplay(1));
} }
public downloadBuffer(url: string): Observable<Progression<Buffer>> { public downloadBuffer(url: string): Observable<Progression<Buffer>> {
@@ -72,7 +77,7 @@ export class RequestService {
const allChunks: Buffer[] = []; const allChunks: Buffer[] = [];
const req = get(url, res => { const req = get(url, { agent: this.ipv4Agent }, res => {
progress.total = parseInt(res.headers?.["content-length"] || "0", 10); progress.total = parseInt(res.headers?.["content-length"] || "0", 10);
res.on("data", chunk => { res.on("data", chunk => {
+2 -1
View File
@@ -6,6 +6,7 @@ import { readFile } from "fs/promises";
import { pathExist } from "../helpers/fs.helpers"; import { pathExist } from "../helpers/fs.helpers";
import log from "electron-log"; import log from "electron-log";
import { app, shell } from "electron"; import { app, shell } from "electron";
import { taskRunning } from "../helpers/os.helpers";
export class SteamService { export class SteamService {
@@ -33,7 +34,7 @@ export class SteamService {
} }
public async steamRunning(): Promise<boolean>{ public async steamRunning(): Promise<boolean>{
const steamProcessRunning = await this.utils.taskRunning("steam"); const steamProcessRunning = await taskRunning("steam");
if(process.platform === "linux") { return steamProcessRunning; } if(process.platform === "linux") { return steamProcessRunning; }
return steamProcessRunning && !!(await this.getActiveUser()); return steamProcessRunning && !!(await this.getActiveUser());
@@ -1,7 +1,6 @@
import { ApiResult } from "renderer/models/api/api.model";
import { BsvMapDetail } from "shared/models/maps"; import { BsvMapDetail } from "shared/models/maps";
import { BsvPlaylist, BsvPlaylistPage, MapFilter, SearchParams, SearchResponse } from "shared/models/maps/beat-saver.model"; import { BsvPlaylist, BsvPlaylistPage, MapFilter, SearchParams, SearchResponse } from "shared/models/maps/beat-saver.model";
import fetch from "node-fetch"; import { RequestService } from "../../request.service";
export class BeatSaverApiService { export class BeatSaverApiService {
private static instance: BeatSaverApiService; private static instance: BeatSaverApiService;
@@ -13,9 +12,13 @@ export class BeatSaverApiService {
return BeatSaverApiService.instance; return BeatSaverApiService.instance;
} }
private readonly request: RequestService;
private readonly bsaverApiUrl = "https://beatsaver.com/api"; private readonly bsaverApiUrl = "https://beatsaver.com/api";
private constructor() {} private constructor() {
this.request = RequestService.getInstance();
}
private mapFilterToUrlParams(filter: MapFilter): URLSearchParams { private mapFilterToUrlParams(filter: MapFilter): URLSearchParams {
if (!filter) { if (!filter) {
@@ -68,15 +71,13 @@ export class BeatSaverApiService {
}); });
} }
public async getMapsDetailsByHashs<T extends string>(hashs: T[]): Promise<ApiResult<Record<Lowercase<T>, BsvMapDetail>>> { public async getMapsDetailsByHashs<T extends string>(hashs: T[]): Promise<Record<Lowercase<T>, BsvMapDetail>> {
if (hashs.length > 50) { if (hashs.length > 50) {
throw "too musch map hashs"; throw "too musch map hashs";
} }
const paramsHashs = hashs.join(","); const paramsHashs = hashs.join(",");
const resp = await fetch(`${this.bsaverApiUrl}/maps/hash/${paramsHashs}`); const data = await this.request.getJSON<Record<Lowercase<T>, BsvMapDetail> | BsvMapDetail>(`${this.bsaverApiUrl}/maps/hash/${paramsHashs}`);
const data = (await resp.json()) as Record<Lowercase<T>, BsvMapDetail> | BsvMapDetail;
if ((data as BsvMapDetail).id) { if ((data as BsvMapDetail).id) {
const key = (data as BsvMapDetail).versions.at(0).hash.toLowerCase(); const key = (data as BsvMapDetail).versions.at(0).hash.toLowerCase();
@@ -84,41 +85,24 @@ export class BeatSaverApiService {
[key]: data as BsvMapDetail, [key]: data as BsvMapDetail,
} as Record<Lowercase<T>, BsvMapDetail>; } as Record<Lowercase<T>, BsvMapDetail>;
return { status: resp.status, data: parsedData }; return parsedData
} }
return { status: resp.status, data: data as Record<Lowercase<T>, BsvMapDetail> }; return data as Record<Lowercase<T>, BsvMapDetail>;
} }
public async getMapDetailsById(id: string): Promise<ApiResult<BsvMapDetail>> { public async getMapDetailsById(id: string): Promise<BsvMapDetail> {
const res = await fetch(`${this.bsaverApiUrl}/maps/id/${id}`); return this.request.getJSON<BsvMapDetail>(`${this.bsaverApiUrl}/maps/id/${id}`);
const data = (await res.json()) as BsvMapDetail;
return { status: res.status, data };
} }
public async searchMaps(search: SearchParams): Promise<ApiResult<SearchResponse>> { public async searchMaps(search: SearchParams): Promise<SearchResponse> {
const url = new URL(`${this.bsaverApiUrl}/search/text/${search?.page ?? 0}`); const url = new URL(`${this.bsaverApiUrl}/search/text/${search?.page ?? 0}`);
url.search = this.searchParamsToUrlParams(search).toString(); url.search = this.searchParamsToUrlParams(search).toString();
return this.request.getJSON<SearchResponse>(url.toString());
const res = await fetch(url.toString());
if (!res.ok) {
return { status: res.status, data: null };
}
const data = await res.json();
return { status: res.status, data };
} }
public async getPlaylistDetails(id: string): Promise<ApiResult<BsvPlaylist>> { public async getPlaylistDetails(id: string): Promise<BsvPlaylist> {
const res = await fetch(`${this.bsaverApiUrl}/playlists/id/${id}/0`); const res = await this.request.getJSON<BsvPlaylistPage>(`${this.bsaverApiUrl}/playlists/id/${id}/0`);
return res.playlist;
const data = (await res.json()) as BsvPlaylistPage;
return { status: res.status, data: data.playlist };
} }
} }
@@ -2,6 +2,7 @@ import { splitIntoChunk } from "../../../../shared/helpers/array.helpers";
import { BsvMapDetail } from "shared/models/maps"; import { BsvMapDetail } from "shared/models/maps";
import { BsvPlaylist, SearchParams } from "shared/models/maps/beat-saver.model"; import { BsvPlaylist, SearchParams } from "shared/models/maps/beat-saver.model";
import { BeatSaverApiService } from "./beat-saver-api.service"; import { BeatSaverApiService } from "./beat-saver-api.service";
import log from "electron-log";
export class BeatSaverService { export class BeatSaverService {
private static instance: BeatSaverService; private static instance: BeatSaverService;
@@ -36,12 +37,10 @@ export class BeatSaverService {
chunkHash.map(async hashs => { chunkHash.map(async hashs => {
const res = await this.bsaverApi.getMapsDetailsByHashs(hashs); const res = await this.bsaverApi.getMapsDetailsByHashs(hashs);
if (res.status === 200) { mapDetails.push(...Object.values<BsvMapDetail>(res).filter(detail => !!detail));
mapDetails.push(...Object.values<BsvMapDetail>(res.data).filter(detail => !!detail)); mapDetails.forEach(detail => {
mapDetails.forEach(detail => { this.cachedMapsDetails.set(detail.versions.at(0).hash.toLowerCase(), detail);
this.cachedMapsDetails.set(detail.versions.at(0).hash.toLowerCase(), detail); });
});
}
}) })
); );
@@ -49,23 +48,22 @@ export class BeatSaverService {
} }
public async getMapDetailsById(id: string): Promise<BsvMapDetail> { public async getMapDetailsById(id: string): Promise<BsvMapDetail> {
const res = await this.bsaverApi.getMapDetailsById(id); return this.bsaverApi.getMapDetailsById(id);
return res.data;
} }
public searchMaps(search: SearchParams): Promise<BsvMapDetail[]> { public searchMaps(search: SearchParams): Promise<BsvMapDetail[]> {
return this.bsaverApi return this.bsaverApi
.searchMaps(search) .searchMaps(search)
.then(res => { .then(res => {
return res.status === 200 ? res.data.docs : []; return res.docs;
}) })
.catch(() => { .catch(e => {
log.error(e);
return []; return [];
}); });
} }
public async getPlaylistPage(id: string): Promise<BsvPlaylist> { public async getPlaylistPage(id: string): Promise<BsvPlaylist> {
const res = await this.bsaverApi.getPlaylistDetails(id); return this.bsaverApi.getPlaylistDetails(id);
return res.data;
} }
} }
@@ -1,8 +1,8 @@
import fetch from "node-fetch";
import { ApiResult } from "renderer/models/api/api.model";
import { MSGetQuery, MSGetQueryFilter, MSGetResponse } from "../../../../shared/models/models/model-saber.model"; import { MSGetQuery, MSGetQueryFilter, MSGetResponse } from "../../../../shared/models/models/model-saber.model";
import { RequestService } from "../../request.service";
export class ModelSaberApiService { export class ModelSaberApiService {
private static instance: ModelSaberApiService; private static instance: ModelSaberApiService;
public static getInstance(): ModelSaberApiService { public static getInstance(): ModelSaberApiService {
@@ -15,7 +15,11 @@ export class ModelSaberApiService {
private readonly API_URL = "https://modelsaber.com/api/v2/"; private readonly API_URL = "https://modelsaber.com/api/v2/";
private readonly ENDPOINTS = { get: "get.php", types: "types.php" }; private readonly ENDPOINTS = { get: "get.php", types: "types.php" };
private constructor() {} private readonly request: RequestService;
private constructor() {
this.request = RequestService.getInstance();
}
private parseFilters(filters: MSGetQueryFilter[]): string { private parseFilters(filters: MSGetQueryFilter[]): string {
if (!filters) { if (!filters) {
@@ -50,19 +54,10 @@ export class ModelSaberApiService {
return new URLSearchParams(searchParams); return new URLSearchParams(searchParams);
} }
public async searchModel(query: MSGetQuery): Promise<ApiResult<MSGetResponse>> { public async searchModel(query: MSGetQuery): Promise<MSGetResponse> {
const url = new URL(this.ENDPOINTS.get, this.API_URL); const url = new URL(this.ENDPOINTS.get, this.API_URL);
url.search = this.buildUrlQuery(query).toString(); url.search = this.buildUrlQuery(query).toString();
const res = await fetch(url.toString()); return this.request.getJSON<MSGetResponse>(url.toString());
if (!res.ok) {
return { data: null, status: res.status };
}
const data = (await res.json()) as MSGetResponse;
return { data, status: res.status };
} }
} }
@@ -33,15 +33,11 @@ export class ModelSaberService {
try { try {
const res = await this.modelSaberApi.searchModel(query); const res = await this.modelSaberApi.searchModel(query);
if (res.status !== 200) { if (Object.keys(res).length === 0) {
return null; return null;
} }
if (Object.keys(res.data).length === 0) { return res[`${id}`];
return null;
}
return res.data[`${id}`];
} catch (e) { } catch (e) {
log.error(e); log.error(e);
return null; return null;
@@ -63,15 +59,11 @@ export class ModelSaberService {
try { try {
const res = await this.modelSaberApi.searchModel(query); const res = await this.modelSaberApi.searchModel(query);
if (res.status !== 200) { if (Object.keys(res).length === 0) {
return null; return null;
} }
if (Object.keys(res.data).length === 0) { const model = Array.from(Object.values(res)).at(0);
return null;
}
const model = Array.from(Object.values(res.data)).at(0);
model.name = striptags(model.name ?? ""); model.name = striptags(model.name ?? "");
model.author = striptags(model.author ?? ""); model.author = striptags(model.author ?? "");
@@ -89,11 +81,9 @@ export class ModelSaberService {
return new Observable<MSModel[]>(observer => { return new Observable<MSModel[]>(observer => {
(async () => { (async () => {
const res = await this.modelSaberApi.searchModel(query); const res = await this.modelSaberApi.searchModel(query);
if (res.status !== 200) {
observer.error(res.status);
}
observer.next( observer.next(
Object.values(res.data).map(model => { Object.values(res).map(model => {
if (!model?.name) { if (!model?.name) {
return null; return null;
} }
+1 -23
View File
@@ -2,8 +2,6 @@ import path from "path";
import { app, BrowserWindow } from "electron"; import { app, BrowserWindow } from "electron";
import { IpcResponse } from "shared/models/ipc"; import { IpcResponse } from "shared/models/ipc";
import log from "electron-log"; import log from "electron-log";
import { AppWindow } from "shared/models/window-manager/app-window.model";
import psList from "ps-list";
// TODO : REFACTOR // TODO : REFACTOR
@@ -12,8 +10,6 @@ export class UtilsService {
private assetsPath: string = app.isPackaged ? path.join(process.resourcesPath, "assets") : path.join(__dirname, "../../../assets"); private assetsPath: string = app.isPackaged ? path.join(process.resourcesPath, "assets") : path.join(__dirname, "../../../assets");
private windows: Map<AppWindow, BrowserWindow> = new Map<AppWindow, BrowserWindow>();
private constructor() {} private constructor() {}
public static getInstance() { public static getInstance() {
@@ -40,27 +36,9 @@ export class UtilsService {
return path.join(app.getPath("temp"), app.getName()); return path.join(app.getPath("temp"), app.getName());
} }
public setMainWindows(windows: Map<AppWindow, BrowserWindow>) {
this.windows = windows;
}
public getMainWindows(win: AppWindow) {
return this.windows.get(win);
}
public async taskRunning(task: string): Promise<boolean> {
try {
const processes = await psList();
return processes.some(process => process.name?.includes(task) || process.cmd?.includes(task));
}
catch(error){
log.error(error);
return null;
}
}
public ipcSend<T = unknown>(channel: string, response: IpcResponse<T>): void { public ipcSend<T = unknown>(channel: string, response: IpcResponse<T>): void {
try { try {
Array.from(this.windows.values()).forEach(window => window?.webContents?.send(channel, response)); BrowserWindow.getAllWindows().forEach(window => window?.webContents?.send(channel, response));
} catch (error) { } catch (error) {
log.error(error); log.error(error);
} }
+21 -37
View File
@@ -10,6 +10,7 @@ export class WindowManagerService {
private static instance: WindowManagerService; private static instance: WindowManagerService;
private readonly PRELOAD_PATH = app.isPackaged ? path.join(__dirname, "preload.js") : path.join(__dirname, "../../../.erb/dll/preload.js"); private readonly PRELOAD_PATH = app.isPackaged ? path.join(__dirname, "preload.js") : path.join(__dirname, "../../../.erb/dll/preload.js");
private readonly IS_DEBUG = process.env.NODE_ENV === "development" || process.env.DEBUG_PROD === "true"
private readonly utilsService: UtilsService = UtilsService.getInstance(); private readonly utilsService: UtilsService = UtilsService.getInstance();
@@ -28,11 +29,9 @@ export class WindowManagerService {
show: false, show: false,
frame: false, frame: false,
titleBarOverlay: false, titleBarOverlay: false,
webPreferences: { preload: this.PRELOAD_PATH, webSecurity: false }, webPreferences: { preload: this.PRELOAD_PATH, webSecurity: !this.IS_DEBUG },
}; };
private readonly windows: Map<AppWindow, BrowserWindow> = new Map<AppWindow, BrowserWindow>();
public static getInstance(): WindowManagerService { public static getInstance(): WindowManagerService {
if (!WindowManagerService.instance) { if (!WindowManagerService.instance) {
WindowManagerService.instance = new WindowManagerService(); WindowManagerService.instance = new WindowManagerService();
@@ -42,8 +41,7 @@ export class WindowManagerService {
private constructor() {} private constructor() {}
public openWindow(windowType: AppWindow, options?: BrowserWindowConstructorOptions): Promise<BrowserWindow> { private handleNewWindow(url: AppWindow, window: BrowserWindow){
const window = new BrowserWindow({ ...this.appWindowsOptions[windowType], ...this.baseWindowOption, ...options });
window.webContents.setWindowOpenHandler(({ url }) => { window.webContents.setWindowOpenHandler(({ url }) => {
if(isValidUrl(url)){ if(isValidUrl(url)){
@@ -51,12 +49,13 @@ export class WindowManagerService {
} }
return { action: "deny"} return { action: "deny"}
}) });
const promise = window.loadURL(resolveHtmlPath(windowType));
window.removeMenu(); window.removeMenu();
window.setMenu(null); window.setMenu(null);
const promise = window.loadURL(isValidUrl(url) ? url : resolveHtmlPath(url));
window.once("ready-to-show", () => { window.once("ready-to-show", () => {
if (!window) { if (!window) {
throw new Error('"window" is not defined'); throw new Error('"window" is not defined');
@@ -64,47 +63,32 @@ export class WindowManagerService {
window.show(); window.show();
}); });
window.once("closed", () => {
this.windows.delete(windowType);
if (!this.windows.size) {
app.quit();
}
});
this.windows.set(windowType, window);
this.utilsService.setMainWindows(this.windows);
return promise.then(() => window); return promise.then(() => window);
} }
public openWindow(url: AppWindow, options?: BrowserWindowConstructorOptions): Promise<BrowserWindow> {
const windowType = url.split("?")[0];
const window = new BrowserWindow({ ...(this.appWindowsOptions[windowType] ?? {}), ...this.baseWindowOption, ...options });
return this.handleNewWindow(url, window);
}
public closeAllWindows(except?: AppWindow) { public closeAllWindows(except?: AppWindow) {
this.windows.forEach((window, key) => { BrowserWindow.getAllWindows().forEach(window => {
if (key === except) { if (except && window.webContents.getURL().includes(except)) { return; }
return;
}
window.close(); window.close();
}); });
} }
public close(...win: AppWindow[]) { public getWindows(window: AppWindow): BrowserWindow[] {
win.forEach(window => { return BrowserWindow.getAllWindows().filter(w => w.webContents.getURL().includes(window));
this.windows.get(window)?.close();
});
}
public getWindow(window: AppWindow): BrowserWindow {
return this.windows.get(window);
}
public getAppWindowFromWebContents(sender: Electron.WebContents): AppWindow {
return Array.from(this.windows.entries()).find(([, value]) => value.webContents.id === sender.id)[0];
} }
public openWindowOrFocus(window: AppWindow): Promise<void> { public openWindowOrFocus(window: AppWindow): Promise<void> {
const win = this.getWindow(window);
const win = this.getWindows(window);
if (win) {
win.focus(); if (win.length) {
win[0].focus();
return Promise.resolve(); return Promise.resolve();
} }
+2 -3
View File
@@ -7,9 +7,8 @@ export let resolveHtmlPath: (htmlFileName: string) => string;
if (process.env.NODE_ENV === "development") { if (process.env.NODE_ENV === "development") {
const port = process.env.PORT || 1212; const port = process.env.PORT || 1212;
resolveHtmlPath = (htmlFileName: string) => { resolveHtmlPath = (htmlFileName: string) => {
const url = new URL(`http://localhost:${port}`); const url = new URL(`http://localhost:${port}/${htmlFileName}`);
url.pathname = htmlFileName; return url.toString();
return url.href;
}; };
} else { } else {
resolveHtmlPath = (htmlFileName: string) => { resolveHtmlPath = (htmlFileName: string) => {
@@ -4,12 +4,11 @@ import defaultImage from "../../../../assets/images/default-version-img.jpg";
import dateFormat from "dateformat"; import dateFormat from "dateformat";
import { BsmImage } from "../shared/bsm-image.component"; import { BsmImage } from "../shared/bsm-image.component";
import { useTranslation } from "renderer/hooks/use-translation.hook"; import { useTranslation } from "renderer/hooks/use-translation.hook";
import { BsmIcon } from "../svgs/bsm-icon.component";
import { LinkOpenerService } from "renderer/services/link-opener.service";
import { motion } from "framer-motion"; import { motion } from "framer-motion";
import { GlowEffect } from "../shared/glow-effect.component"; import { GlowEffect } from "../shared/glow-effect.component";
import { useService } from "renderer/hooks/use-service.hook";
import equal from "fast-deep-equal"; import equal from "fast-deep-equal";
import { SteamIcon } from "../svgs/icons/steam-icon.component";
import { useConstant } from "renderer/hooks/use-constant.hook";
type Props = { type Props = {
version: BSVersion; version: BSVersion;
@@ -18,21 +17,18 @@ type Props = {
} }
export const AvailableVersionItem = memo(function AvailableVersionItem({version, selected, onClick}: Props) { export const AvailableVersionItem = memo(function AvailableVersionItem({version, selected, onClick}: Props) {
const linkOpener = useService(LinkOpenerService)
const [hovered, setHovered] = useState(false);
const t = useTranslation(); const t = useTranslation();
const [hovered, setHovered] = useState(false);
const openReleasePage = () => { const formatedDate = useConstant(() => dateFormat(+version.ReleaseDate * 1000, "ddd. d mmm yyyy"));
linkOpener.open(version.ReleaseURL);
};
const formatedDate = (() => dateFormat(+version.ReleaseDate * 1000, "ddd. d mmm yyyy"))();
return ( return (
<motion.li className="group relative w-72 h-60 transition-transform active:scale-[.98]" onClick={onClick} onHoverStart={() => setHovered(true)} onHoverEnd={() => setHovered(false)}> <motion.li className="group relative w-72 h-60 active:scale-[.98]" onClick={onClick} onHoverStart={() => setHovered(true)} onHoverEnd={() => setHovered(false)}>
<GlowEffect visible={hovered || selected} className="absolute" /> <GlowEffect visible={hovered || selected} className="absolute" />
<div className={`relative flex flex-col overflow-hidden rounded-md w-72 h-60 cursor-pointer group-hover:shadow-none duration-300 bg-light-main-color-2 dark:bg-main-color-2 ${!selected && "shadow-lg shadow-gray-900"}`}> <div className={`relative flex flex-col overflow-hidden rounded-md w-72 h-60 cursor-pointer group-hover:shadow-none duration-300 bg-light-main-color-2 dark:bg-main-color-2 ${!selected && "shadow-lg shadow-gray-900"}`}>
{version.recommended && (
<span className="uppercase absolute -rotate-45 top-9 -left-[6.2rem] font-bold text-white bg-red-600 w-full text-center text-xs z-[1] shadow-sm shadow-black py-0.5" title={t("pages.available-versions.recommended-tooltip")}>{t("pages.available-versions.recommended")}</span>
)}
<BsmImage image={version.ReleaseImg ? version.ReleaseImg : defaultImage} errorImage={defaultImage} placeholder={defaultImage} className="absolute top-0 right-0 w-full h-full opacity-40 blur-xl object-cover" loading="lazy" /> <BsmImage image={version.ReleaseImg ? version.ReleaseImg : defaultImage} errorImage={defaultImage} placeholder={defaultImage} className="absolute top-0 right-0 w-full h-full opacity-40 blur-xl object-cover" loading="lazy" />
<BsmImage image={version.ReleaseImg ? version.ReleaseImg : defaultImage} errorImage={defaultImage} placeholder={defaultImage} className="bg-black w-full h-3/4 object-cover" loading="lazy" /> <BsmImage image={version.ReleaseImg ? version.ReleaseImg : defaultImage} errorImage={defaultImage} placeholder={defaultImage} className="bg-black w-full h-3/4 object-cover" loading="lazy" />
<div className="z-[1] p-2 w-full flex items-center justify-between grow"> <div className="z-[1] p-2 w-full flex items-center justify-between grow">
@@ -41,15 +37,8 @@ export const AvailableVersionItem = memo(function AvailableVersionItem({version,
<span className="text-sm text-gray-700 dark:text-gray-400">{formatedDate}</span> <span className="text-sm text-gray-700 dark:text-gray-400">{formatedDate}</span>
</div> </div>
{version.ReleaseURL && ( {version.ReleaseURL && (
// eslint-disable-next-line jsx-a11y/anchor-is-valid -- link will be reworked <a href={version.ReleaseURL} target="_blank" className="flex flex-row justify-between items-center rounded-full bg-black bg-opacity-30 text-white pb-px overflow-hidden hover:bg-opacity-50">
<a <SteamIcon className="w-[25px] h-[25px] transition-transform group-hover:rotate-[-360deg] duration-300" />
onClickCapture={e => {
e.stopPropagation();
openReleasePage();
}}
className="flex flex-row justify-between items-center rounded-full bg-black bg-opacity-30 text-white pb-px hover:bg-opacity-50"
>
<BsmIcon icon="steam" className="w-[25px] h-[25px] transition-transform group-hover:rotate-[-360deg] duration-300" />
<span className="relative -left-px text-sm w-fit max-w-0 text-center overflow-hidden h-full whitespace-nowrap pb-[3px] transition-all group-hover:max-w-[200px] group-hover:px-1 duration-300">{t("pages.available-versions.steam-release")}</span> <span className="relative -left-px text-sm w-fit max-w-0 text-center overflow-hidden h-full whitespace-nowrap pb-[3px] transition-all group-hover:max-w-[200px] group-hover:px-1 duration-300">{t("pages.available-versions.steam-release")}</span>
</a> </a>
)} )}
@@ -4,7 +4,7 @@ import { MutableRefObject, useEffect, useRef, useState } from "react";
import { MAP_TYPES } from "renderer/partials/maps/map-tags/map-types"; import { MAP_TYPES } from "renderer/partials/maps/map-tags/map-types";
import { MAP_STYLES } from "renderer/partials/maps/map-tags/map-styles"; import { MAP_STYLES } from "renderer/partials/maps/map-tags/map-styles";
import { BsmCheckbox } from "../shared/bsm-checkbox.component"; import { BsmCheckbox } from "../shared/bsm-checkbox.component";
import { minToS } from "renderer/helpers/time-utils"; import { minToS } from "../../../shared/helpers/time.helpers";
import dateFormat from "dateformat"; import dateFormat from "dateformat";
import { BsmRange } from "../shared/bsm-range.component"; import { BsmRange } from "../shared/bsm-range.component";
import { useTranslation } from "renderer/hooks/use-translation.hook"; import { useTranslation } from "renderer/hooks/use-translation.hook";
@@ -84,7 +84,7 @@ export function FilterPanel({ className, ref, playlist = false, filter, onChange
}; };
const renderLabel = (text: string | number, isMax: boolean): JSX.Element => { const renderLabel = (text: string | number, isMax: boolean): JSX.Element => {
return <span className={`bg-inherit absolute top-[calc(100%+4px)] h-5 font-bold rounded-md shadow-center shadow-black px-1 flex items-center ${isMax ? "text-lg" : "text-sm"}`}>{text}</span>; return <span className={`bg-inherit absolute top-[calc(100%+4px)] whitespace-nowrap h-5 font-bold rounded-md shadow-center shadow-black px-1 flex items-center ${isMax ? "text-lg" : "text-sm"}`}>{text}</span>;
}; };
const onNpssChange = ([min, max]: number[]) => { const onNpssChange = ([min, max]: number[]) => {
@@ -12,7 +12,6 @@ import { AudioPlayerService } from "renderer/services/audio-player.service";
import { useObservable } from "renderer/hooks/use-observable.hook"; import { useObservable } from "renderer/hooks/use-observable.hook";
import { map } from "rxjs/operators"; import { map } from "rxjs/operators";
import equal from "fast-deep-equal/es6"; import equal from "fast-deep-equal/es6";
import { getMapZipUrlFromHash } from "renderer/helpers/maps-utils";
import { BsmBasicSpinner } from "../shared/bsm-basic-spinner/bsm-basic-spinner.component"; import { BsmBasicSpinner } from "../shared/bsm-basic-spinner/bsm-basic-spinner.component";
import defaultImage from "../../../../assets/images/default-version-img.jpg"; import defaultImage from "../../../../assets/images/default-version-img.jpg";
import { useTranslation } from "renderer/hooks/use-translation.hook"; import { useTranslation } from "renderer/hooks/use-translation.hook";
@@ -73,8 +72,7 @@ export const MapItem = memo(({ hash, title, autor, songAutor, coverUrl, songUrl,
const songPlaying = useObservable(audioPlayer.playing$.pipe(map(playing => playing && audioPlayer.src === songUrl))); const songPlaying = useObservable(audioPlayer.playing$.pipe(map(playing => playing && audioPlayer.src === songUrl)));
const zipUrl = getMapZipUrlFromHash(hash); const previewUrl = mapId ? `https://allpoland.github.io/ArcViewer/?id=${mapId}` : null;
const previewUrl = mapId ? `https://skystudioapps.com/bs-viewer/?url=${zipUrl}` : null;
const mapUrl = mapId ? `https://beatsaver.com/maps/${mapId}` : null; const mapUrl = mapId ? `https://beatsaver.com/maps/${mapId}` : null;
const authorUrl = autorId ? `https://beatsaver.com/profile/${autorId}` : null; const authorUrl = autorId ? `https://beatsaver.com/profile/${autorId}` : null;
const createdDate = createdAt ? dateFormat(createdAt, "d mmm yyyy") : null; const createdDate = createdAt ? dateFormat(createdAt, "d mmm yyyy") : null;
@@ -153,7 +153,7 @@ export function MapsPlaylistsPanel({ version, isActive }: Props) {
<div className="h-full rounded-full bg-light-main-color-2 dark:bg-main-color-2 grow p-[6px]"> <div className="h-full rounded-full bg-light-main-color-2 dark:bg-main-color-2 grow p-[6px]">
<input type="text" className="h-full w-full bg-light-main-color-1 dark:bg-main-color-1 rounded-full px-2" placeholder={t("pages.version-viewer.maps.search-bar.search-placeholder")} value={tabIndex === 0 ? mapSearch : playlistSearch} onChange={e => handleSearch(e.target.value)} tabIndex={-1} /> <input type="text" className="h-full w-full bg-light-main-color-1 dark:bg-main-color-1 rounded-full px-2" placeholder={t("pages.version-viewer.maps.search-bar.search-placeholder")} value={tabIndex === 0 ? mapSearch : playlistSearch} onChange={e => handleSearch(e.target.value)} tabIndex={-1} />
</div> </div>
<BsmDropdownButton className="h-full relative z-[1] flex justify-center" buttonClassName="flex items-center justify-center h-full rounded-full px-2 py-1" icon="filter" text="pages.version-viewer.maps.search-bar.filters-btn" withBar={false}> <BsmDropdownButton className="h-full relative z-[1] flex justify-center" buttonClassName="flex items-center justify-center h-full rounded-full px-2 py-1" icon="filter" text="pages.version-viewer.maps.search-bar.filters-btn" textClassName="whitespace-nowrap" withBar={false}>
<FilterPanel className="absolute top-[calc(100%+3px)] origin-top w-[500px] h-fit p-2 rounded-md shadow-md shadow-black" filter={mapFilter} onChange={setMapFilter} /> <FilterPanel className="absolute top-[calc(100%+3px)] origin-top w-[500px] h-fit p-2 rounded-md shadow-md shadow-black" filter={mapFilter} onChange={setMapFilter} />
</BsmDropdownButton> </BsmDropdownButton>
<BsmDropdownButton className="h-full flex aspect-square relative rounded-full z-[1] bg-light-main-color-1 dark:bg-main-color-3" buttonClassName="rounded-full h-full w-full p-[6px]" icon="three-dots" withBar={false} items={dropDownItems} menuTranslationY="6px" align="center" /> <BsmDropdownButton className="h-full flex aspect-square relative rounded-full z-[1] bg-light-main-color-1 dark:bg-main-color-3" buttonClassName="rounded-full h-full w-full p-[6px]" icon="three-dots" withBar={false} items={dropDownItems} menuTranslationY="6px" align="center" />
@@ -0,0 +1,62 @@
import { ModalComponent, ModalExitCode } from "../../../../services/modale.service";
import { OculusIcon } from "renderer/components/svgs/icons/oculus-icon.component";
import { SteamIcon } from "renderer/components/svgs/icons/steam-icon.component";
import { useTranslation } from "renderer/hooks/use-translation.hook";
import { BsStore } from "shared/models/bs-store.enum";
import { useState } from "react";
import tailwindConfig from "../../../../../../tailwind.config";
import Color from "color";
import { useNavigate } from "react-router-dom";
export const ChooseStore: ModalComponent<BsStore> = ({ resolver }) => {
const t = useTranslation();
const navigate = useNavigate();
const [oculusHover, setOculusHover] = useState(false);
const [steamHover, setSteamHover] = useState(false);
const chooseStore = (store: BsStore) => {
resolver({ exitCode: ModalExitCode.COMPLETED, data: store });
}
const goToSettings = () => {
resolver({ exitCode: ModalExitCode.CANCELED });
navigate("/settings#choose-default-store");
}
const isDarkMode = document.documentElement.classList.contains("dark");
const bg = (() => {
if(isDarkMode){
return {
bright: new Color(tailwindConfig.theme.colors["main-color"][1], "hex").hex(),
dim: new Color(tailwindConfig.theme.colors["main-color"][1], "hex").darken(.2).hex()
}
}
return {
bright: new Color(tailwindConfig.theme.colors["light-main-color"][1], "hex").hex(),
dim: new Color(tailwindConfig.theme.colors["light-main-color"][1], "hex").darken(.2).hex()
}
})();
return (
<form className="flex flex-col gap-3 max-w-sm">
<h1 className="text-3xl uppercase tracking-wide w-full text-center text-gray-800 dark:text-gray-200">{t("modals.choose-store.title")}</h1>
<p className="w-auto text-gray-800 dark:text-gray-200 text-center">{t("modals.choose-store.body")}</p>
<div className="flex flex-row w-full flex-grow gap-3">
<div className="flex flex-col flex-grow basis-0 gap-2 text-center px-5 pt-3 pb-1 rounded-md border-main-color-3 border-2 cursor-pointer" onMouseEnter={() => setOculusHover(true)} onMouseLeave={() => setOculusHover(false)} onClick={() => chooseStore(BsStore.OCULUS)} style={{backgroundColor: oculusHover ? bg.dim : bg.bright}}>
<OculusIcon className="flex-grow aspect-square text-black bg-white rounded-full p-5"/>
<h2 className="font-bold">Oculus Store (PC)</h2>
</div>
<div className="flex flex-col flex-grow basis-0 gap-2 text-center px-5 pt-3 pb-1 rounded-md border-main-color-3 border-2 cursor-pointer" onMouseEnter={() => setSteamHover(true)} onMouseLeave={() => setSteamHover(false)} onClick={() => chooseStore(BsStore.STEAM)} style={{backgroundColor: steamHover ? bg.dim : bg.bright}}>
<SteamIcon className="flex-grow"/>
<h2 className="font-bold">Steam</h2>
</div>
</div>
<p onClick={goToSettings} className="text-sm italic underline cursor-pointer text-center leading-3">{t("modals.choose-store.set-in-settings")}</p>
</form>
);
};
@@ -0,0 +1,59 @@
import { BsmButton } from "renderer/components/shared/bsm-button.component";
import { ModalComponent, ModalExitCode } from "../../../../services/modale.service";
import { BsmImage } from "renderer/components/shared/bsm-image.component";
import BeatWaiting from "../../../../../../assets/images/apngs/beat-impatient.png";
import { useTranslation } from "renderer/hooks/use-translation.hook";
import { useState } from "react";
import { isOculusTokenValid } from "shared/helpers/oculus.helpers";
import { logRenderError } from "renderer";
export const EnterMetaTokenModal: ModalComponent<string> = ({resolver}) => {
const t = useTranslation();
const [token, setToken] = useState("");
const [showToken, setShowToken] = useState(false);
const submit = () => {
resolver({exitCode: ModalExitCode.COMPLETED, data: token});
}
const cancel = () => {
resolver({exitCode: ModalExitCode.CANCELED});
}
const isTokenValid = (() => {
return isOculusTokenValid(token, logRenderError);
})();
return (
<form className="flex flex-col w-80 gap-4">
<h1 className="text-3xl uppercase tracking-wide w-full text-center">{t("modals.enter-meta-token.title")}</h1>
<BsmImage className="h-20 w-20 mx-auto" image={BeatWaiting}/>
<p>{t("modals.enter-meta-token.body.need-token")}</p>
<a href="https://github.com/Zagrios/bs-manager/wiki/How-to-obtain-your-Oculus-Token" target="_blank" className="underline">{t("modals.enter-meta-token.body.how-obtain-token")}</a>
<div>
<div className="flex flex-row items-center justify-between">
<label className="font-bold cursor-pointer tracking-wide inline-block" htmlFor="meta_token">{t("modals.enter-meta-token.body.input-label")}</label>
{!isTokenValid && token.length > 0 && (
<span className="text-orange-700 dark:text-orange-400 text-xs whitespace-normal min-w-0">{t("modals.enter-meta-token.body.token-is-invalid")}</span>
)}
</div>
<div className="bg-light-main-color-1 dark:bg-main-color-1 rounded-md flex box-border h-9">
<input className="grow px-1 py-[2px] outline-none bg-transparent" onChange={e => setToken(e.target.value)} value={token} type={showToken ? "text" : "password"} name="meta_token" id="meta_token" placeholder="OCAStr43sdx2..." />
<BsmButton className="shrink-0 m-1 rounded-md p-0.5 !bg-light-main-color-3 dark:!bg-main-color-3" icon={showToken ? "eye-cross" : "eye"} withBar={false} onClick={() => setShowToken(prev => !prev)} />
</div>
</div>
<div className="flex flex-row gap-2">
<BsmButton className="rounded-md flex justify-center items-center transition-all h-9 w-full" typeColor="cancel" text="misc.cancel" withBar={false} onClick={cancel}/>
<BsmButton className="rounded-md flex justify-center items-center transition-all h-9 w-full" typeColor="primary" text="modals.enter-meta-token.valid-btn" withBar={false} onClick={submit} disabled={!isTokenValid}/>
</div>
</form>
);
}
@@ -0,0 +1,54 @@
import { ModalComponent, ModalExitCode } from "../../../../services/modale.service";
import { useState } from "react";
import { BsmButton } from "renderer/components/shared/bsm-button.component";
import { useTranslation } from "renderer/hooks/use-translation.hook";
import { MetaIcon } from "renderer/components/svgs/icons/meta-icon.component";
import { BsmCheckbox } from "renderer/components/shared/bsm-checkbox.component";
import Tippy from "@tippyjs/react";
type ReturnType = { method: MetaAuthMethod.META, stay: boolean } | { method: MetaAuthMethod.MANUAL };
export const LoginToMetaModal: ModalComponent<ReturnType> = ({ resolver }) => {
const t = useTranslation();
const [stay, setStay] = useState(false);
const submit = () => {
resolver({ exitCode: ModalExitCode.COMPLETED, data: { method: MetaAuthMethod.META, stay } });
};
const enterTokenManually = () => {
resolver({ exitCode: ModalExitCode.COMPLETED, data: { method: MetaAuthMethod.MANUAL } });
}
return (
<form className="flex flex-col justify-center items-center w-96 gap-4">
<h1 className="text-3xl uppercase tracking-wide w-full text-center">{t("modals.connect-to-meta.title")}</h1>
<div className="flex justify-center items-center h-28 aspect-square bg-white rounded-full p-4">
<MetaIcon className="w-full h-full"/>
</div>
<p className="font-bold">{t("modals.connect-to-meta.body.token-needed")}</p>
<p>{t("modals.connect-to-meta.body.need-cookie-enabled")}</p>
<div className="w-full flex flex-row justify-start items-center gap-1.5">
<BsmCheckbox className="relative z-[1] w-6 aspect-square" checked={stay} onChange={enable => setStay(() => enable)}/>
<span>{t("modals.connect-to-meta.stay")}</span>
</div>
<BsmButton className="rounded-md flex justify-center items-center transition-all h-10 w-full" typeColor="primary" text="modals.connect-to-meta.connect-to-meta" withBar={false} onClick={submit}/>
<Tippy className="!bg-neutral-900" arrow={false} content={t("modals.connect-to-meta.body.enter-token-manually-tooltip")} >
<p className="text-sm italic underline text-center -translate-y-1 leading-3 cursor-pointer" onClick={enterTokenManually}>{t("modals.connect-to-meta.body.enter-token-manually")}</p>
</Tippy>
</form>
);
};
export enum MetaAuthMethod {
MANUAL = "manual",
META = "meta"
}
@@ -2,7 +2,7 @@ import { useState, useEffect } from "react";
import { BsmButton } from "renderer/components/shared/bsm-button.component"; import { BsmButton } from "renderer/components/shared/bsm-button.component";
import { useTranslation } from "renderer/hooks/use-translation.hook"; import { useTranslation } from "renderer/hooks/use-translation.hook";
import { ModalComponent, ModalExitCode, ModalService } from "renderer/services/modale.service"; import { ModalComponent, ModalExitCode, ModalService } from "renderer/services/modale.service";
import { WhyCredentialsModal } from "./why-credentials-modal.component"; import { WhySteamCredentialsModal } from "./why-steam-credentials-modal.component";
import { useService } from "renderer/hooks/use-service.hook"; import { useService } from "renderer/hooks/use-service.hook";
import { Observable } from "rxjs"; import { Observable } from "rxjs";
import { useObservable } from "renderer/hooks/use-observable.hook"; import { useObservable } from "renderer/hooks/use-observable.hook";
@@ -10,7 +10,7 @@ import { QRCodeSVG } from "qrcode.react";
import { BsmCheckbox } from "renderer/components/shared/bsm-checkbox.component"; import { BsmCheckbox } from "renderer/components/shared/bsm-checkbox.component";
import { BsmBasicSpinner } from "renderer/components/shared/bsm-basic-spinner/bsm-basic-spinner.component"; import { BsmBasicSpinner } from "renderer/components/shared/bsm-basic-spinner/bsm-basic-spinner.component";
export const LoginModal: ModalComponent< export const LoginToSteamModal: ModalComponent<
{ username: string; password: string; stay: boolean, method: "form"|"qr" }, { username: string; password: string; stay: boolean, method: "form"|"qr" },
{ qrCode$: Observable<string>, logged$: Observable<string> } { qrCode$: Observable<string>, logged$: Observable<string> }
> = ({ resolver, data }) => { > = ({ resolver, data }) => {
@@ -47,7 +47,7 @@ export const LoginModal: ModalComponent<
}; };
const whyCredentials = () => { const whyCredentials = () => {
modal.openModal(WhyCredentialsModal); modal.openModal(WhySteamCredentialsModal);
}; };
return ( return (
@@ -1,11 +1,11 @@
import { ModalComponent, ModalExitCode } from "../../../services/modale.service"; import { ModalComponent, ModalExitCode } from "../../../../services/modale.service";
import { useState } from "react"; import { useState } from "react";
import BeatConflict from "../../../../../assets/images/apngs/beat-conflict.png"; import BeatConflict from "../../../../../../assets/images/apngs/beat-conflict.png";
import { BsmImage } from "renderer/components/shared/bsm-image.component"; import { BsmImage } from "renderer/components/shared/bsm-image.component";
import { BsmButton } from "renderer/components/shared/bsm-button.component"; import { BsmButton } from "renderer/components/shared/bsm-button.component";
import { useTranslation } from "renderer/hooks/use-translation.hook"; import { useTranslation } from "renderer/hooks/use-translation.hook";
export const GuardModal: ModalComponent<string> = ({ resolver }) => { export const SteamGuardModal: ModalComponent<string> = ({ resolver }) => {
const [guardCode, setGuardCode] = useState(""); const [guardCode, setGuardCode] = useState("");
const t = useTranslation(); const t = useTranslation();
@@ -1,6 +1,6 @@
import { ModalComponent, ModalExitCode } from "../../../services/modale.service"; import { ModalComponent, ModalExitCode } from "../../../../services/modale.service";
import BeatWaiting from "../../../../../assets/images/apngs/beat-waiting.png"; import BeatWaiting from "../../../../../../assets/images/apngs/beat-waiting.png";
import LoginMobileAuthImage from "../../../../../assets/images/steam/login_mobile_auth.png"; import LoginMobileAuthImage from "../../../../../../assets/images/steam/login_mobile_auth.png";
import { BsmImage } from "renderer/components/shared/bsm-image.component"; import { BsmImage } from "renderer/components/shared/bsm-image.component";
import { useTranslation } from "renderer/hooks/use-translation.hook"; import { useTranslation } from "renderer/hooks/use-translation.hook";
import { Observable } from "rxjs"; import { Observable } from "rxjs";
@@ -3,7 +3,7 @@ import { useTranslation } from "renderer/hooks/use-translation.hook";
import { LinkOpenerService } from "renderer/services/link-opener.service"; import { LinkOpenerService } from "renderer/services/link-opener.service";
import { ModalComponent } from "renderer/services/modale.service"; import { ModalComponent } from "renderer/services/modale.service";
export const WhyCredentialsModal: ModalComponent<void> = () => { export const WhySteamCredentialsModal: ModalComponent<void> = () => {
const t = useTranslation(); const t = useTranslation();
const linkOpener = useService(LinkOpenerService); const linkOpener = useService(LinkOpenerService);
@@ -3,18 +3,34 @@ import { BsmImage } from "renderer/components/shared/bsm-image.component";
import { useTranslation } from "renderer/hooks/use-translation.hook"; import { useTranslation } from "renderer/hooks/use-translation.hook";
import { ModalComponent, ModalExitCode } from "renderer/services/modale.service"; import { ModalComponent, ModalExitCode } from "renderer/services/modale.service";
import BeatImpatient from "../../../../../assets/images/apngs/beat-impatient.png"; import BeatImpatient from "../../../../../assets/images/apngs/beat-impatient.png";
import { BsmCheckbox } from "renderer/components/shared/bsm-checkbox.component";
import Tippy from "@tippyjs/react";
import { useState } from "react";
import { BsStore } from "shared/models/bs-store.enum";
export const ImportVersionModal: ModalComponent<void> = ({ resolver }) => { export const ImportVersionModal: ModalComponent<BsStore> = ({ resolver }) => {
const t = useTranslation(); const t = useTranslation();
const [isOculus, setIsOculus] = useState(false);
const submit = () => {
resolver({ exitCode: ModalExitCode.COMPLETED, data: isOculus ? BsStore.OCULUS : BsStore.STEAM });
}
return ( return (
<form> <form>
<h1 className="text-3xl uppercase tracking-wide w-full text-center text-gray-800 dark:text-gray-200">{t("modals.bs-import-version.title")}</h1> <h1 className="text-3xl uppercase tracking-wide w-full text-center text-gray-800 dark:text-gray-200">{t("modals.bs-import-version.title")}</h1>
<BsmImage className="mx-auto h-20" image={BeatImpatient} /> <BsmImage className="mx-auto h-20" image={BeatImpatient} />
<p className="max-w-sm text-gray-800 dark:text-gray-200">{t("modals.bs-import-version.description")}</p> <p className="max-w-sm text-gray-800 dark:text-gray-200">{t("modals.bs-import-version.description")}</p>
<div className="grid grid-flow-col grid-cols-2 gap-4 mt-4"> <Tippy content={t("modals.bs-import-version.oculus-version-tooltip")} placement="right" arrow={false} className="!bg-neutral-900 font-bold">
<div className="relative flex flex-row items-center gap-1.5 mb-4 mt-3 cursor-help w-fit">
<BsmCheckbox className="relative h-5 w-5 z-[1]" checked={isOculus} onChange={checked => setIsOculus(checked)}/>
<span className="font-bold italic">{t("modals.bs-import-version.oculus-version")}</span>
</div>
</Tippy>
<div className="grid grid-flow-col grid-cols-2 gap-4">
<BsmButton typeColor="cancel" className="rounded-md text-center transition-all" onClick={() => resolver({ exitCode: ModalExitCode.CANCELED })} withBar={false} text="misc.cancel" /> <BsmButton typeColor="cancel" className="rounded-md text-center transition-all" onClick={() => resolver({ exitCode: ModalExitCode.CANCELED })} withBar={false} text="misc.cancel" />
<BsmButton typeColor="primary" className="rounded-md text-center transition-all" onClick={() => resolver({ exitCode: ModalExitCode.COMPLETED })} withBar={false} text="modals.bs-import-version.buttons.submit" /> <BsmButton typeColor="primary" className="rounded-md text-center transition-all" onClick={submit} withBar={false} text="modals.bs-import-version.buttons.submit" />
</div> </div>
</form> </form>
); );
@@ -0,0 +1,53 @@
import { ModalComponent, ModalExitCode } from "renderer/services/modale.service"
import BeatConflict from "../../../../../assets/images/apngs/beat-conflict.png";
import { BsmButton } from "renderer/components/shared/bsm-button.component";
import { BsmImage } from "renderer/components/shared/bsm-image.component";
import { BsmCheckbox } from "renderer/components/shared/bsm-checkbox.component";
import { useState } from "react";
import { useTranslation } from "renderer/hooks/use-translation.hook";
export const OriginalOculusVersionBackupModal: ModalComponent<boolean, void> = ({ resolver }) => {
const t = useTranslation();
const [dontShowAgain, setDontShowAgain] = useState(false);
const submit = () => {
resolver({ exitCode: ModalExitCode.COMPLETED, data: dontShowAgain });
}
return (
<form className="max-w-[450px] text-gray-800 dark:text-gray-200">
<h1 className="text-3xl uppercase tracking-wide w-full text-center text-gray-800 dark:text-gray-200">{t("modals.original-version-backup-oculus.title")}</h1>
<BsmImage className="mx-auto h-20" image={BeatConflict} />
<p className="text-sm italic mb-4 font-bold">{t("modals.original-version-backup-oculus.body.must-be-installed-once")}</p>
<p className="mb-4">{t("modals.original-version-backup-oculus.body.need-backup")}</p>
<p className="mb-4">{t("modals.original-version-backup-oculus.body.can-restore-later")}</p>
<p className="text-sm italic mb-4">{t("modals.original-version-backup-oculus.body.tips-launch-oculus")}</p>
<div className="flex flex-row justify-start items-center gap-1.5 my-4" >
<BsmCheckbox className="relative z-[1] w-6 aspect-square" checked={dontShowAgain} onChange={setDontShowAgain} />
<span>{t("modals.original-version-backup-oculus.not-remind-me")}</span>
</div>
<div className="grid grid-flow-col grid-cols-2 gap-4">
<BsmButton
typeColor="cancel"
className="rounded-md transition-all h-10 flex items-center justify-center"
onClick={() => {
resolver({ exitCode: ModalExitCode.CANCELED });
}}
withBar={false}
text="misc.cancel"
/>
<BsmButton
typeColor="primary"
className="rounded-md transition-all h-10 flex items-center justify-center"
onClick={submit}
withBar={false}
text="modals.original-version-backup-oculus.understood"
/>
</div>
</form>
)
}
@@ -1,8 +1,7 @@
import { BSVersion } from "shared/bs-version.interface"; import { BSVersion } from "shared/bs-version.interface";
import { Link, useLocation } from "react-router-dom"; import { Link, useLocation } from "react-router-dom";
import { BsDownloaderService } from "renderer/services/bs-downloader.service";
import { useState } from "react"; import { useState } from "react";
import { distinctUntilChanged, map, of, Subscription, switchMap } from "rxjs"; import { distinctUntilChanged, lastValueFrom, map, of, Subscription, switchMap, take } from "rxjs";
import { BSLauncherService, LaunchMods } from "renderer/services/bs-launcher.service"; import { BSLauncherService, LaunchMods } from "renderer/services/bs-launcher.service";
import { ConfigurationService } from "renderer/services/configuration.service"; import { ConfigurationService } from "renderer/services/configuration.service";
import { BSUninstallerService } from "renderer/services/bs-uninstaller.service"; import { BSUninstallerService } from "renderer/services/bs-uninstaller.service";
@@ -15,13 +14,17 @@ import Tippy from "@tippyjs/react";
import { useService } from "renderer/hooks/use-service.hook"; import { useService } from "renderer/hooks/use-service.hook";
import equal from "fast-deep-equal"; import equal from "fast-deep-equal";
import { useOnUpdate } from "renderer/hooks/use-on-update.hook"; import { useOnUpdate } from "renderer/hooks/use-on-update.hook";
import { BsDownloaderService } from "renderer/services/bs-version-download/bs-downloader.service";
import { ProgressBarService } from "renderer/services/progress-bar.service";
export function BsVersionItem(props: { version: BSVersion }) { export function BsVersionItem(props: { version: BSVersion }) {
const downloaderService = useService(BsDownloaderService);
const bsDownloader = useService(BsDownloaderService);
const verionManagerService = useService(BSVersionManagerService); const verionManagerService = useService(BSVersionManagerService);
const launcherService = useService(BSLauncherService); const launcherService = useService(BSLauncherService);
const configService = useService(ConfigurationService); const configService = useService(ConfigurationService);
const bsUninstallerService = useService(BSUninstallerService); const bsUninstallerService = useService(BSUninstallerService);
const progressBar = useService(ProgressBarService);
const { state } = useLocation() as { state: BSVersion }; const { state } = useLocation() as { state: BSVersion };
const { fontSize, ref } = useFitText(); const { fontSize, ref } = useFitText();
@@ -33,14 +36,14 @@ export function BsVersionItem(props: { version: BSVersion }) {
useOnUpdate(() => { useOnUpdate(() => {
const subs: Subscription[] = [] const subs: Subscription[] = []
subs.push(downloaderService.currentBsVersionDownload$.pipe(map(download => equal(download, props.version)), distinctUntilChanged()).subscribe(isDownloading => { subs.push(bsDownloader.downloadingVersion$.pipe(map(download => equal(download, props.version)), distinctUntilChanged()).subscribe(isDownloading => {
setIsDownloading(() => isDownloading); setIsDownloading(() => isDownloading);
})); }));
subs.push(downloaderService.currentBsVersionDownload$.pipe( subs.push(bsDownloader.downloadingVersion$.pipe(
map(download => equal(download, props.version)), map(download => equal(download, props.version)),
distinctUntilChanged(), distinctUntilChanged(),
switchMap(isDownloading => isDownloading ? downloaderService.downloadProgress$ : of(0)), switchMap(isDownloading => isDownloading ? progressBar.progress$ : of(0)),
).subscribe(progress => { ).subscribe(progress => {
setDownloadProgress(() => progress); setDownloadProgress(() => progress);
})); }));
@@ -52,19 +55,22 @@ export function BsVersionItem(props: { version: BSVersion }) {
return props.version?.BSVersion === state?.BSVersion && props?.version.steam === state?.steam && props?.version.oculus === state?.oculus && props?.version.name === state?.name; return props.version?.BSVersion === state?.BSVersion && props?.version.steam === state?.steam && props?.version.oculus === state?.oculus && props?.version.name === state?.name;
}; };
const handleDoubleClick = () => { const handleDoubleClick = async () => {
launcherService.launch({ const downloadingVersion = await lastValueFrom(bsDownloader.downloadingVersion$.pipe(take(1)));
if(equal(downloadingVersion, props.version)){ return; }
const launch$ = launcherService.launch({
version: state, version: state,
oculus: !!configService.get<boolean>(LaunchMods.OCULUS_MOD), oculus: !!configService.get<boolean>(LaunchMods.OCULUS_MOD),
desktop: !!configService.get<boolean>(LaunchMods.DESKTOP_MOD), desktop: !!configService.get<boolean>(LaunchMods.DESKTOP_MOD),
debug: !!configService.get<boolean>(LaunchMods.DEBUG_MOD), debug: !!configService.get<boolean>(LaunchMods.DEBUG_MOD),
}); });
return lastValueFrom(launch$).catch(() => {});
}; };
const cancel = () => { const cancel = () => {
const versionDownload = downloaderService.currentBsVersionDownload$.value; const versionDownload = bsDownloader.downloadingVersion;
const wasVerification = downloaderService.isVerification; const wasVerification = bsDownloader.isVerifying;
downloaderService.stopDownload().then(() => { bsDownloader.stopDownload().then(() => {
if(wasVerification){ return; } if(wasVerification){ return; }
bsUninstallerService.uninstall(versionDownload).then(res => res && verionManagerService.askInstalledVersions()); bsUninstallerService.uninstall(versionDownload).then(res => res && verionManagerService.askInstalledVersions());
}); });
@@ -11,21 +11,37 @@ import { useThemeColor } from "renderer/hooks/use-theme-color.hook";
import Tippy from "@tippyjs/react"; import Tippy from "@tippyjs/react";
import { useTranslation } from "renderer/hooks/use-translation.hook"; import { useTranslation } from "renderer/hooks/use-translation.hook";
import { useService } from "renderer/hooks/use-service.hook"; import { useService } from "renderer/hooks/use-service.hook";
import { distinctUntilChanged } from "rxjs";
import equal from "fast-deep-equal";
import { BsDownloaderService } from "renderer/services/bs-version-download/bs-downloader.service";
export function NavBar() { export function NavBar() {
const bsVersionServoce = useService(BSVersionManagerService); const versionManager = useService(BSVersionManagerService);
const versionDownloader = useService(BsDownloaderService);
const downloadingVersion = useObservable(versionDownloader.downloadingVersion$.pipe(distinctUntilChanged(equal)));
const installedVersions = useObservable(versionManager.installedVersions$);
const installedVersions = useObservable(bsVersionServoce.installedVersions$);
const color = useThemeColor("first-color"); const color = useThemeColor("first-color");
const t = useTranslation(); const t = useTranslation();
function listVersions(){
const versions = Array.isArray(installedVersions) ? [...installedVersions] : [];
if (downloadingVersion){ versions.push(downloadingVersion); }
const sorted = BSVersionManagerService.sortVersions(versions);
return BSVersionManagerService.removeDuplicateVersions(sorted);
}
return ( return (
<nav id="nav-bar" className="z-10 flex flex-col h-full max-h-full items-center p-1"> <nav id="nav-bar" className="z-10 flex flex-col h-full max-h-full items-center p-1">
<BsManagerIcon className="relative aspect-square w-16 h-16 mb-3" /> <BsManagerIcon className="relative aspect-square w-16 h-16 mb-3" />
<ol id="versions" className="w-fit max-w-[120px] relative left-[2px] grow overflow-y-hidden scrollbar-track-transparent scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-neutral-900 hover:overflow-y-scroll"> <ol id="versions" className="w-fit max-w-[120px] relative left-[2px] grow overflow-y-hidden scrollbar-track-transparent scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-neutral-900 hover:overflow-y-scroll">
<SharedNavBarItem /> <SharedNavBarItem />
<NavBarSpliter /> <NavBarSpliter />
{installedVersions?.map(version => ( {listVersions().map(version => (
<BsVersionItem key={JSON.stringify(version)} version={version} /> <BsVersionItem key={JSON.stringify(version)} version={version} />
))} ))}
</ol> </ol>
@@ -1,24 +1,37 @@
import { motion } from "framer-motion"; import { motion } from "framer-motion";
import { useTranslation } from "renderer/hooks/use-translation.hook"; import { useTranslation } from "renderer/hooks/use-translation.hook";
import { BsmIcon, BsmIconType } from "../svgs/bsm-icon.component"; import { CSSProperties } from "react"
export function SettingRadioArray({ items, selectedItem = items[0].id, onItemSelected }: { items: RadioItem[]; selectedItem?: number; onItemSelected?: (id: number) => void }) { type Props<T> = {
id?: HTMLDivElement["id"];
items: RadioItem<T>[];
selectedItemId?: number;
selectedItemValue?: T;
direction?: CSSProperties["flexDirection"],
onItemSelected?: (item: RadioItem<T>) => void
};
export function SettingRadioArray<T>({ id, items, selectedItemId, selectedItemValue, onItemSelected, direction = "column" }: Props<T>) {
const t = useTranslation(); const t = useTranslation();
const isSelected = (item: RadioItem<T>) => {
return item.id === selectedItemId || item.value === selectedItemValue;
}
return ( return (
<div className="w-full"> <div id={id} className="w-full flex gap-1.5" style={{flexDirection: direction}}>
{items.map(i => ( {items.map(i => (
<div onClick={() => onItemSelected(i.id)} key={i.id} className={`py-3 my-[6px] w-full flex cursor-pointer justify-between items-center rounded-md px-2 transition-colors duration-200 ${i.id === selectedItem ? "bg-light-main-color-3 dark:bg-main-color-3" : "bg-light-main-color-1 dark:bg-main-color-1"}`}> <div onClick={() => onItemSelected(i)} key={i.id} className={`py-3 w-full flex cursor-pointer justify-between items-center rounded-md px-2 transition-colors duration-200 ${isSelected(i) ? "bg-light-main-color-3 dark:bg-main-color-3" : "bg-light-main-color-1 dark:bg-main-color-1"} ${i.className}`}>
<div className="flex items-center"> <div className="flex items-center">
<div className="h-5 rounded-full aspect-square border-2 border-gray-800 dark:border-white p-[3px] mr-2"> <div className="h-5 rounded-full aspect-square border-2 border-gray-800 dark:border-white p-[3px] mr-2">
<motion.span initial={{ scale: 0 }} animate={{ scale: i.id === selectedItem ? 1 : 0 }} className="h-full w-full block bg-gray-800 dark:bg-white rounded-full" /> <motion.span initial={{ scale: 0 }} animate={{ scale: isSelected(i) ? 1 : 0 }} className="h-full w-full block bg-gray-800 dark:bg-white rounded-full" />
</div> </div>
<h2 className="font-extrabold">{t(i.text)}</h2> <h2 className="font-extrabold">{t(i.text)}</h2>
</div> </div>
{i.icon && ( {i.icon && (
<div className="flex items-center"> <div className="flex items-center">
{i.textIcon && <span className="text-sm">{t(i.textIcon)}</span>} {i.textIcon && <span className="text-sm">{t(i.textIcon)}</span>}
<BsmIcon icon={i.icon} className="max-h-5 w-fit ml-2" /> {i.icon}
</div> </div>
)} )}
</div> </div>
@@ -27,10 +40,11 @@ export function SettingRadioArray({ items, selectedItem = items[0].id, onItemSel
); );
} }
export interface RadioItem { export interface RadioItem<T> {
id: number; id: number;
text: string; text: string;
icon?: BsmIconType; icon?: JSX.Element;
textIcon?: string; textIcon?: string;
value?: any; className?: string;
value?: T;
} }
@@ -21,9 +21,10 @@ type Props = {
menuTranslationY?: string | number; menuTranslationY?: string | number;
children?: JSX.Element; children?: JSX.Element;
text?: string; text?: string;
textClassName?: string;
}; };
export const BsmDropdownButton = forwardRef(({ className, items, align, withBar = true, icon = "settings", buttonClassName, menuTranslationY, children, text }: Props, fowardRed) => { export const BsmDropdownButton = forwardRef(({ className, items, align, withBar = true, icon = "settings", buttonClassName, menuTranslationY, children, text, textClassName }: Props, fowardRed) => {
const [expanded, setExpanded] = useState(false); const [expanded, setExpanded] = useState(false);
const t = useTranslation(); const t = useTranslation();
const ref = useRef(fowardRed); const ref = useRef(fowardRed);
@@ -63,7 +64,7 @@ export const BsmDropdownButton = forwardRef(({ className, items, align, withBar
return ( return (
<div ref={ref as unknown as React.LegacyRef<HTMLDivElement>} className={className}> <div ref={ref as unknown as React.LegacyRef<HTMLDivElement>} className={className}>
<BsmButton onClick={() => setExpanded(!expanded)} className={buttonClassName ?? defaultButtonClassName} icon={icon} active={expanded} onClickOutside={handleClickOutside} withBar={withBar} text={text} /> <BsmButton onClick={() => setExpanded(!expanded)} className={buttonClassName ?? defaultButtonClassName} icon={icon} active={expanded} textClassName={textClassName} onClickOutside={handleClickOutside} withBar={withBar} text={text} />
<div className={`py-1 w-fit absolute cursor-pointer top-[calc(100%-4px)] rounded-md bg-inherit text-sm text-gray-800 dark:text-gray-200 shadow-md shadow-black transition-[scale] ease-in-out ${alignClass}`} style={{ scale: expanded ? "1" : "0", translate: `0 ${menuTranslationY}` }}> <div className={`py-1 w-fit absolute cursor-pointer top-[calc(100%-4px)] rounded-md bg-inherit text-sm text-gray-800 dark:text-gray-200 shadow-md shadow-black transition-[scale] ease-in-out ${alignClass}`} style={{ scale: expanded ? "1" : "0", translate: `0 ${menuTranslationY}` }}>
{items?.map( {items?.map(
i => i =>
@@ -18,7 +18,7 @@ export function BsmIframeView() {
<div className="top-0 absolute w-screen h-screen flex content-center items-center justify-center z-[150]"> <div className="top-0 absolute w-screen h-screen flex content-center items-center justify-center z-[150]">
<motion.span className="absolute w-full h-full bg-black top-0 right-0" initial={{ opacity: 0 }} animate={{ opacity: 0.6 }} exit={{ opacity: 0 }} transition={{ duration: 0.2 }} /> <motion.span className="absolute w-full h-full bg-black top-0 right-0" initial={{ opacity: 0 }} animate={{ opacity: 0.6 }} exit={{ opacity: 0 }} transition={{ duration: 0.2 }} />
<motion.div ref={ref} className="z-[1] w-[calc(100vw-250px)] h-[calc(100vh-250px)] shadow-black shadow-md rounded-md overflow-hidden bg-black" initial={{ y: "100vh" }} animate={{ y: 0 }} exit={{ y: "100vh" }}> <motion.div ref={ref} className="z-[1] w-[calc(100vw-250px)] h-[calc(100vh-250px)] shadow-black shadow-md rounded-md overflow-hidden bg-black" initial={{ y: "100vh" }} animate={{ y: 0 }} exit={{ y: "100vh" }}>
<iframe className="w-full h-full" src={iframeUrl} /> <iframe className="w-full h-full" src={iframeUrl} allowFullScreen/>
</motion.div> </motion.div>
</div> </div>
)} )}
@@ -53,6 +53,7 @@ import { VolumeOffIcon } from "./icons/volume-off-icon.component";
import { VolumeDownIcon } from "./icons/volume-down-icon.component"; import { VolumeDownIcon } from "./icons/volume-down-icon.component";
import { GermanIcon } from "./flags/german-icon.component"; import { GermanIcon } from "./flags/german-icon.component";
import { RussianIcon } from "./flags/russian-icon.component"; import { RussianIcon } from "./flags/russian-icon.component";
import { ChineseIcon } from "./flags/chinese-icon.component";
import { MSModelType } from "shared/models/models/model-saber.model"; import { MSModelType } from "shared/models/models/model-saber.model";
import { ModelTypeAvatarIcon } from "./icons/model-type-avatar-icon.component"; import { ModelTypeAvatarIcon } from "./icons/model-type-avatar-icon.component";
import { ModelTypeSaberIcon } from "./icons/model-type-saber-icon.component"; import { ModelTypeSaberIcon } from "./icons/model-type-saber-icon.component";
@@ -61,8 +62,9 @@ import { ModelTypeBloqIcon } from "./icons/model-type-bloq-icon.component";
import { ChevronTopIcon } from "./icons/chevron-top-icon.component"; import { ChevronTopIcon } from "./icons/chevron-top-icon.component";
import { EyeCrossIcon } from "./icons/eye-cross-icon.component"; import { EyeCrossIcon } from "./icons/eye-cross-icon.component";
import { ShortcutIcon } from "./icons/shortcut-icon.component"; import { ShortcutIcon } from "./icons/shortcut-icon.component";
import { BackupRestoreIcon } from "./icons/backup-restore-icon.component";
export type BsmIconType = BsvMapCharacteristic | MSModelType | ("settings" | "trash" | "favorite" | "folder" | "bsNote" | "check" | "three-dots" | "twitch" | "eye" | "play" | "checkCircleIcon" | "discord" | "info" | "eye-cross" | "terminal" | "desktop" | "oculus" | "add" | "cross" | "task" | "github" | "close" | "thumbUpFill" | "timerFill" | "pause" | "twitter" | "sync" | "chevron-top" | "copy" | "steam" | "edit" | "export" | "patreon" | "search" | "bsMapDifficulty" | "link" | "unlink" | "download" | "filter" | "mee6" | "volume-up" | "volume-off" | "volume-down" | "shortcut" | "fr-FR-flag" | "es-ES-flag" | "en-US-flag" | "en-EN-flag" | "de-DE-flag" | "ru-RU-flag"); export type BsmIconType = BsvMapCharacteristic | MSModelType | ("settings" | "trash" | "favorite" | "folder" | "bsNote" | "check" | "three-dots" | "twitch" | "eye" | "play" | "checkCircleIcon" | "discord" | "info" | "eye-cross" | "terminal" | "desktop" | "oculus" | "add" | "cross" | "task" | "github" | "close" | "thumbUpFill" | "timerFill" | "pause" | "twitter" | "sync" | "chevron-top" | "copy" | "steam" | "edit" | "export" | "patreon" | "search" | "bsMapDifficulty" | "link" | "unlink" | "download" | "filter" | "mee6" | "volume-up" | "volume-off" | "volume-down" | "shortcut" | "backup-restore" | "fr-FR-flag" | "es-ES-flag" | "en-US-flag" | "en-EN-flag" | "de-DE-flag" | "ru-RU-flag" | "zh-CN-flag");
export const BsmIcon = memo(({ className, icon, style }: { className?: string; icon: BsmIconType; style?: CSSProperties }) => { export const BsmIcon = memo(({ className, icon, style }: { className?: string; icon: BsmIconType; style?: CSSProperties }) => {
// TODO : Very ugly very messy, need to find a better way to do this // TODO : Very ugly very messy, need to find a better way to do this
@@ -116,6 +118,9 @@ export const BsmIcon = memo(({ className, icon, style }: { className?: string; i
if (icon === "ru-RU-flag") { if (icon === "ru-RU-flag") {
return <RussianIcon className={className} style={style} />; return <RussianIcon className={className} style={style} />;
} }
if (icon === "zh-CN-flag") {
return <ChineseIcon className={className} style={style} />;
}
if (icon === "task") { if (icon === "task") {
return <TaskIcon className={className} style={style} />; return <TaskIcon className={className} style={style} />;
} }
@@ -238,6 +243,10 @@ export const BsmIcon = memo(({ className, icon, style }: { className?: string; i
return <ShortcutIcon className={className} style={style} />; return <ShortcutIcon className={className} style={style} />;
} }
if (icon === "backup-restore") {
return <BackupRestoreIcon className={className} style={style} />;
}
if (icon === MSModelType.Avatar) { if (icon === MSModelType.Avatar) {
return <ModelTypeAvatarIcon className={className} style={style} />; return <ModelTypeAvatarIcon className={className} style={style} />;
} }
@@ -0,0 +1,21 @@
import { CSSProperties } from "react";
export function ChineseIcon(props: { className?: string; style?: CSSProperties }) {
return (
<svg width="71px" height="48px" viewBox="0 0 71 48" version="1.1" xmlns="http://www.w3.org/2000/svg" className={props.className} style={props.style}>
<defs />
<g id="Flags" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd" transform="translate(-70.000000, -498.000000)">
<g transform="translate(70.000000, 70.000000)" fillRule="nonzero" id="China">
<g transform="translate(0.000000, 428.000000)">
<rect id="Rounded_Rectangle_7_copy-5" fill="#ED5565" x="0.28" y="0.98" width="70" height="47" rx="6.36" />
<path d="M12.23,26.34 C11.41,26.93 10.93,26.6 11.16,25.61 L12.05,21.93 C12.2430284,20.8254147 11.8671738,19.6978512 11.05,18.93 L8.36,16.6 C7.59,15.94 7.79,15.37 8.8,15.34 L12.57,15.23 C13.6782653,15.1750168 14.6410409,14.4499636 15,13.4 L16.18,9.4 C16.47,8.4 16.98,8.4 17.32,9.4 L18.74,13.4 C19.1553515,14.4093082 20.1106424,15.0927684 21.2,15.16 L25.04,15.16 C26.04,15.16 26.25,15.73 25.49,16.39 L22.56,18.95 C21.7650096,19.7288598 21.4350484,20.866657 21.69,21.95 L22.62,25.19 C22.9,26.19 22.43,26.53 21.57,26 L18.42,24 C17.4584774,23.4711751 16.2849442,23.5095258 15.36,24.1 L12.23,26.34 Z" id="Shape_2_copy_9" fill="#F6D660"/>
<path d="M29.37,10.78 C29.09,10.98 28.93,10.87 29.01,10.52 L29.31,9.24 C29.3656763,8.87495864 29.2472583,8.50490228 28.99,8.24 L28.08,7.43 C27.82,7.2 27.89,7 28.23,6.99 L29.5,6.99 C29.8717689,6.9586152 30.1877729,6.70581199 30.3,6.35 L30.7,4.95 C30.8,4.61 30.97,4.61 31.09,4.95 L31.57,6.33 C31.7126147,6.67114428 32.031835,6.90575195 32.4,6.94 L33.7,6.94 C34.04,6.94 34.11,7.14 33.85,7.37 L32.85,8.26 C32.5912527,8.52348971 32.4790218,8.89759264 32.55,9.26 L32.87,10.39 C32.97,10.73 32.81,10.86 32.52,10.67 L31.46,10 C31.1505989,9.82136721 30.7694011,9.82136721 30.46,10 L29.37,10.78 Z" id="Shape_2_copy_10" fill="#F6D660"/>
<path d="M29.37,30.53 C29.09,30.73 28.93,30.62 29.01,30.27 L29.31,28.99 C29.3656763,28.6249586 29.2472583,28.2549023 28.99,27.99 L28.08,27.18 C27.82,26.95 27.89,26.75 28.23,26.74 L29.5,26.74 C29.8691682,26.7101752 30.1844554,26.4618866 30.3,26.11 L30.7,24.71 C30.8,24.37 30.97,24.37 31.09,24.71 L31.57,26.09 C31.7126147,26.4311443 32.031835,26.6657519 32.4,26.7 L33.7,26.7 C34.04,26.7 34.11,26.9 33.85,27.13 L32.85,28.02 C32.5912527,28.2834897 32.4790218,28.6575926 32.55,29.02 L32.87,30.15 C32.97,30.49 32.81,30.62 32.52,30.43 L31.47,29.76 C31.1605989,29.5813672 30.7794011,29.5813672 30.47,29.76 L29.37,30.53 Z" id="Shape_2_copy_11" fill="#F6D660"/>
<path d="M36.3,25.23 C36.02,25.43 35.86,25.32 35.94,24.98 L36.24,23.7 C36.2956763,23.3349586 36.1772583,22.9649023 35.92,22.7 L35.01,21.89 C34.75,21.66 34.82,21.46 35.16,21.45 L36.43,21.45 C36.7991682,21.4201752 37.1144554,21.1718866 37.23,20.82 L37.63,19.42 C37.73,19.08 37.9,19.08 38.02,19.42 L38.5,20.8 C38.6426147,21.1411443 38.961835,21.3757519 39.33,21.41 L40.63,21.41 C40.97,21.41 41.04,21.61 40.78,21.84 L39.78,22.73 C39.5248508,22.9954093 39.4164332,23.369263 39.49,23.73 L39.81,24.86 C39.91,25.2 39.74,25.33 39.46,25.14 L38.41,24.47 C38.1005989,24.2913672 37.7194011,24.2913672 37.41,24.47 L36.3,25.23 Z" id="Shape_2_copy_12" fill="#F6D660"/>
<path d="M36.3,16.09 C36.02,16.29 35.86,16.18 35.94,15.83 L36.24,14.55 C36.2956763,14.1849586 36.1772583,13.8149023 35.92,13.55 L35,12.7 C34.74,12.47 34.81,12.27 35.15,12.26 L36.42,12.26 C36.7891682,12.2301752 37.1044554,11.9818866 37.22,11.63 L37.62,10.23 C37.72,9.89 37.89,9.89 38.01,10.23 L38.49,11.61 C38.6326147,11.9511443 38.951835,12.1857519 39.32,12.22 L40.62,12.22 C40.96,12.22 41.03,12.42 40.77,12.65 L39.77,13.54 C39.5163739,13.8062871 39.4081897,14.1793363 39.48,14.54 L39.8,15.67 C39.9,16.01 39.73,16.14 39.45,15.95 L38.4,15.28 C38.0905989,15.1013672 37.7094011,15.1013672 37.4,15.28 L36.3,16.09 Z" id="Shape_2_copy_13" fill="#F6D660"/>
</g>
</g>
</g>
</svg>
);
}
@@ -0,0 +1,9 @@
import { ComponentProps } from "react"
export function BackupRestoreIcon(props: ComponentProps<"svg">) {
return (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" {...props} fill="currentColor">
<path d="M480-120q-126 0-223-76.5T131-392q-4-15 6-27.5t27-14.5q16-2 29 6t18 24q24 90 99 147t170 57q117 0 198.5-81.5T760-480q0-117-81.5-198.5T480-760q-69 0-129 32t-101 88h70q17 0 28.5 11.5T360-600q0 17-11.5 28.5T320-560H160q-17 0-28.5-11.5T120-600v-160q0-17 11.5-28.5T160-800q17 0 28.5 11.5T200-760v54q51-64 124.5-99T480-840q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-480q0 75-28.5 140.5t-77 114q-48.5 48.5-114 77T480-120Zm0-280q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Z"/>
</svg>
)
}
@@ -0,0 +1,18 @@
import { ComponentProps } from 'react'
export function MetaIcon(props: ComponentProps<"svg">) {
return (
<svg xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink" id="Layer_1" data-name="Layer 1" viewBox="0 0 287.56 191" {...props}>
<defs>
<linearGradient id="linear-gradient" x1="62.34" y1="101.45" x2="260.34" y2="91.45" gradientTransform="matrix(1, 0, 0, -1, 0, 192)" gradientUnits="userSpaceOnUse">
<stop offset="0" stopColor="#0064e1"/><stop offset="0.4" stopColor="#0064e1"/>
<stop offset="0.83" stopColor="#0073ee"/><stop offset="1" stopColor="#0082fb"/>
</linearGradient>
<linearGradient id="linear-gradient-2" x1="41.42" y1="53" x2="41.42" y2="126" gradientTransform="matrix(1, 0, 0, -1, 0, 192)" gradientUnits="userSpaceOnUse"><stop offset="0" stopColor="#0082fb"/><stop offset="1" stopColor="#0064e0"/></linearGradient>
</defs>
<path style={{fill: "#0081fb"}} d="M31.06,126c0,11,2.41,19.41,5.56,24.51A19,19,0,0,0,53.19,160c8.1,0,15.51-2,29.79-21.76,11.44-15.83,24.92-38,34-52l15.36-23.6c10.67-16.39,23-34.61,37.18-47C181.07,5.6,193.54,0,206.09,0c21.07,0,41.14,12.21,56.5,35.11,16.81,25.08,25,56.67,25,89.27,0,19.38-3.82,33.62-10.32,44.87C271,180.13,258.72,191,238.13,191V160c17.63,0,22-16.2,22-34.74,0-26.42-6.16-55.74-19.73-76.69-9.63-14.86-22.11-23.94-35.84-23.94-14.85,0-26.8,11.2-40.23,31.17-7.14,10.61-14.47,23.54-22.7,38.13l-9.06,16c-18.2,32.27-22.81,39.62-31.91,51.75C84.74,183,71.12,191,53.19,191c-21.27,0-34.72-9.21-43-23.09C3.34,156.6,0,141.76,0,124.85Z"/>
<path style={{fill: "url(#linear-gradient)"}} d="M24.49,37.3C38.73,15.35,59.28,0,82.85,0c13.65,0,27.22,4,41.39,15.61,15.5,12.65,32,33.48,52.63,67.81l7.39,12.32c17.84,29.72,28,45,33.93,52.22,7.64,9.26,13,12,19.94,12,17.63,0,22-16.2,22-34.74l27.4-.86c0,19.38-3.82,33.62-10.32,44.87C271,180.13,258.72,191,238.13,191c-12.8,0-24.14-2.78-36.68-14.61-9.64-9.08-20.91-25.21-29.58-39.71L146.08,93.6c-12.94-21.62-24.81-37.74-31.68-45C107,40.71,97.51,31.23,82.35,31.23c-12.27,0-22.69,8.61-31.41,21.78Z"/>
<path style={{fill: "url(#linear-gradient-2)"}} d="M82.35,31.23c-12.27,0-22.69,8.61-31.41,21.78C38.61,71.62,31.06,99.34,31.06,126c0,11,2.41,19.41,5.56,24.51L10.14,167.91C3.34,156.6,0,141.76,0,124.85,0,94.1,8.44,62.05,24.49,37.3,38.73,15.35,59.28,0,82.85,0Z"/>
</svg>
)
}
@@ -1,8 +1,8 @@
import { CSSProperties } from "react"; import { HTMLProps } from "react";
export function OculusIcon(props: { className?: string; style?: CSSProperties }) { export function OculusIcon(props: HTMLProps<SVGSVGElement>) {
return ( return (
<svg className={props.className} style={props.style} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" height="19" width="32"> <svg {...props} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
<path <path
fill="currentColor" fill="currentColor"
d="M24.182 18.599c-0.427 0.297-0.901 0.474-1.411 0.552-0.51 0.083-1.016 0.068-1.521 0.068h-10.5c-0.51 0-1.016 0.021-1.526-0.068-0.51-0.083-0.979-0.255-1.411-0.552-0.854-0.604-1.365-1.563-1.365-2.604 0-1.057 0.516-2.016 1.37-2.599 0.417-0.297 0.896-0.479 1.396-0.557 0.5-0.083 1-0.083 1.526-0.083h10.5c0.5 0 1.016-0.016 1.516 0.063s0.984 0.26 1.401 0.542c0.865 0.578 1.365 1.557 1.365 2.599 0 1.036-0.526 2-1.38 2.599zM28.411 8.526c-1.125-0.906-2.417-1.531-3.818-1.865-0.802-0.193-1.604-0.281-2.432-0.307-0.599-0.021-1.198-0.010-1.818-0.010h-8.661c-0.609 0-1.224-0.010-1.833 0.010-0.823 0.026-1.63 0.109-2.432 0.307-1.401 0.339-2.698 0.964-3.818 1.865-2.281 1.823-3.599 4.568-3.599 7.474 0 2.911 1.318 5.656 3.583 7.474 1.13 0.906 2.422 1.531 3.823 1.87 0.802 0.193 1.609 0.281 2.432 0.302 0.599 0.021 1.198 0.016 1.818 0.016h8.661c0.599 0 1.219 0.005 1.818-0.016 0.823-0.021 1.62-0.109 2.417-0.302 1.401-0.344 2.682-0.969 3.823-1.87 2.307-1.823 3.625-4.568 3.625-7.474s-1.318-5.656-3.589-7.474z" d="M24.182 18.599c-0.427 0.297-0.901 0.474-1.411 0.552-0.51 0.083-1.016 0.068-1.521 0.068h-10.5c-0.51 0-1.016 0.021-1.526-0.068-0.51-0.083-0.979-0.255-1.411-0.552-0.854-0.604-1.365-1.563-1.365-2.604 0-1.057 0.516-2.016 1.37-2.599 0.417-0.297 0.896-0.479 1.396-0.557 0.5-0.083 1-0.083 1.526-0.083h10.5c0.5 0 1.016-0.016 1.516 0.063s0.984 0.26 1.401 0.542c0.865 0.578 1.365 1.557 1.365 2.599 0 1.036-0.526 2-1.38 2.599zM28.411 8.526c-1.125-0.906-2.417-1.531-3.818-1.865-0.802-0.193-1.604-0.281-2.432-0.307-0.599-0.021-1.198-0.010-1.818-0.010h-8.661c-0.609 0-1.224-0.010-1.833 0.010-0.823 0.026-1.63 0.109-2.432 0.307-1.401 0.339-2.698 0.964-3.818 1.865-2.281 1.823-3.599 4.568-3.599 7.474 0 2.911 1.318 5.656 3.583 7.474 1.13 0.906 2.422 1.531 3.823 1.87 0.802 0.193 1.609 0.281 2.432 0.302 0.599 0.021 1.198 0.016 1.818 0.016h8.661c0.599 0 1.219 0.005 1.818-0.016 0.823-0.021 1.62-0.109 2.417-0.302 1.401-0.344 2.682-0.969 3.823-1.87 2.307-1.823 3.625-4.568 3.625-7.474s-1.318-5.656-3.589-7.474z"
@@ -3,7 +3,6 @@ import { useObservable } from "renderer/hooks/use-observable.hook";
import { useThemeColor } from "renderer/hooks/use-theme-color.hook"; import { useThemeColor } from "renderer/hooks/use-theme-color.hook";
import { AudioPlayerService } from "renderer/services/audio-player.service"; import { AudioPlayerService } from "renderer/services/audio-player.service";
import { IpcService } from "renderer/services/ipc.service"; import { IpcService } from "renderer/services/ipc.service";
import { WindowManagerService } from "renderer/services/window-manager.service";
import { AppWindow } from "shared/models/window-manager/app-window.model"; import { AppWindow } from "shared/models/window-manager/app-window.model";
import { BsmButton } from "../shared/bsm-button.component"; import { BsmButton } from "../shared/bsm-button.component";
import { BsmRange } from "../shared/bsm-range.component"; import { BsmRange } from "../shared/bsm-range.component";
@@ -15,7 +14,6 @@ import { lastValueFrom } from "rxjs";
export default function TitleBar({ template = "index.html" }: { template: AppWindow }) { export default function TitleBar({ template = "index.html" }: { template: AppWindow }) {
const ipcService = useService(IpcService); const ipcService = useService(IpcService);
const windows = useService(WindowManagerService);
const audio = useService(AudioPlayerService); const audio = useService(AudioPlayerService);
const volume = useObservable(audio.volume$, audio.volume); const volume = useObservable(audio.volume$, audio.volume);
@@ -37,19 +35,19 @@ export default function TitleBar({ template = "index.html" }: { template: AppWin
const [maximized, setMaximized] = useState(false); const [maximized, setMaximized] = useState(false);
const closeWindow = () => { const closeWindow = () => {
return windows.close(template); return window.electron.window.close();
}; };
const maximizeWindow = () => { const maximizeWindow = () => {
ipcService.sendLazy("window.maximize"); window.electron.window.maximise();
}; };
const minimizeWindow = () => { const minimizeWindow = () => {
ipcService.sendLazy("window.minimize"); window.electron.window.minimise();
}; };
const resetWindow = () => { const resetWindow = () => {
ipcService.sendLazy("window.reset"); window.electron.window.unmaximise();
}; };
const toogleMaximize = () => { const toogleMaximize = () => {
@@ -119,22 +117,21 @@ export default function TitleBar({ template = "index.html" }: { template: AppWin
</header> </header>
); );
} }
if (template === "oneclick-download-map.html" || template === "oneclick-download-playlist.html" || template === "oneclick-download-model.html" || "shortcut-launch.html") {
return ( return (
<header id="titlebar" className="min-h-[22px] bg-transparent w-screen h-[22px] flex content-center items-center justify-start z-10"> <header id="titlebar" className="min-h-[22px] bg-transparent w-screen h-[22px] flex content-center items-center justify-start z-10">
<div id="drag-region" className="grow h-full"> <div id="drag-region" className="grow h-full">
<div id="window-title" className="pl-1"> <div id="window-title" className="pl-1">
<span className="text-gray-100 font-bold text-xs italic">BSManager</span> <span className="text-gray-100 font-bold text-xs italic">BSManager</span>
</div>
</div> </div>
<div id="window-controls" className="h-full flex shrink-0"> </div>
<div onClick={closeWindow} className="text-gray-200 cursor-pointer w-7 h-full shrink-0 flex justify-center items-center rounded-bl-md" id="close-button" draggable="false"> <div id="window-controls" className="h-full flex shrink-0">
<svg aria-hidden="false" width="12" height="12" viewBox="0 0 12 12"> <div onClick={closeWindow} className="text-gray-200 cursor-pointer w-7 h-full shrink-0 flex justify-center items-center rounded-bl-md" id="close-button" draggable="false">
<polygon fill="currentColor" fillRule="evenodd" points="11 1.576 6.583 6 11 10.424 10.424 11 6 6.583 1.576 11 1 10.424 5.417 6 1 1.576 1.576 1 6 5.417 10.424 1"/> <svg aria-hidden="false" width="12" height="12" viewBox="0 0 12 12">
</svg> <polygon fill="currentColor" fillRule="evenodd" points="11 1.576 6.583 6 11 10.424 10.424 11 6 6.583 1.576 11 1 10.424 5.417 6 1 1.576 1.576 1 6 5.417 10.424 1"/>
</div> </svg>
</div> </div>
</header> </div>
); </header>
} );
} }
@@ -10,6 +10,10 @@ import { LaunchModToogle } from "./launch-mod-toogle.component";
import BSLogo from "../../../../../../assets/images/apngs/bs-logo.png"; import BSLogo from "../../../../../../assets/images/apngs/bs-logo.png";
import { BsmImage } from "renderer/components/shared/bsm-image.component"; import { BsmImage } from "renderer/components/shared/bsm-image.component";
import { useService } from "renderer/hooks/use-service.hook"; import { useService } from "renderer/hooks/use-service.hook";
import { BsStore } from "shared/models/bs-store.enum";
import { lastValueFrom } from "rxjs";
import { BsDownloaderService } from "renderer/services/bs-version-download/bs-downloader.service";
import equal from "fast-deep-equal";
type Props = { version: BSVersion }; type Props = { version: BSVersion };
@@ -18,12 +22,14 @@ export function LaunchSlide({ version }: Props) {
const configService = useService(ConfigurationService); const configService = useService(ConfigurationService);
const bsLauncherService = useService(BSLauncherService); const bsLauncherService = useService(BSLauncherService);
const bsDownloader = useService(BsDownloaderService);
const [oculusMode, setOculusMode] = useState(!!configService.get<boolean>(LaunchMods.OCULUS_MOD)); const [oculusMode, setOculusMode] = useState(!!configService.get<boolean>(LaunchMods.OCULUS_MOD));
const [desktopMode, setDesktopMode] = useState(!!configService.get<boolean>(LaunchMods.DESKTOP_MOD)); const [desktopMode, setDesktopMode] = useState(!!configService.get<boolean>(LaunchMods.DESKTOP_MOD));
const [debugMode, setDebugMode] = useState(!!configService.get<boolean>(LaunchMods.DEBUG_MOD)); const [debugMode, setDebugMode] = useState(!!configService.get<boolean>(LaunchMods.DEBUG_MOD));
const [advancedLaunch, setAdvancedLaunch] = useState(false); const [advancedLaunch, setAdvancedLaunch] = useState(false);
const [additionalArgsString, setAdditionalArgsString] = useState<string>(configService.get<string>("additionnal-args") || ""); const [additionalArgsString, setAdditionalArgsString] = useState<string>(configService.get<string>("additionnal-args") || "");
const versionDownloading = useObservable(bsDownloader.downloadingVersion$);
const versionRunning = useObservable(bsLauncherService.versionRunning$); const versionRunning = useObservable(bsLauncherService.versionRunning$);
@@ -31,6 +37,11 @@ export function LaunchSlide({ version }: Props) {
configService.set("additionnal-args", additionalArgsString); configService.set("additionnal-args", additionalArgsString);
}, [additionalArgsString]); }, [additionalArgsString]);
useEffect(() => {
if(desktopMode){ return; }
bsLauncherService.restoreSteamVR();
}, [desktopMode]);
const setMode = (mode: LaunchMods, value: boolean) => { const setMode = (mode: LaunchMods, value: boolean) => {
if (mode === LaunchMods.DEBUG_MOD) { if (mode === LaunchMods.DEBUG_MOD) {
setDebugMode(value); setDebugMode(value);
@@ -52,13 +63,15 @@ export function LaunchSlide({ version }: Props) {
.filter(arg => arg.length > 0) .filter(arg => arg.length > 0)
: undefined; : undefined;
bsLauncherService.launch({ const launch$ = bsLauncherService.launch({
version, version,
oculus: version.oculus ? false : oculusMode, oculus: version.oculus ? false : oculusMode,
desktop: desktopMode, desktop: desktopMode,
debug: debugMode, debug: debugMode,
additionalArgs additionalArgs
}) });
return lastValueFrom(launch$).catch(() => {});
}; };
return ( return (
@@ -68,7 +81,7 @@ export function LaunchSlide({ version }: Props) {
<h1 className="relative text-4xl font-bold italic -top-3">{version.name ? `${version.BSVersion} - ${version.name}` : version.BSVersion}</h1> <h1 className="relative text-4xl font-bold italic -top-3">{version.name ? `${version.BSVersion} - ${version.name}` : version.BSVersion}</h1>
</div> </div>
<div className="grid grid-flow-col gap-6"> <div className="grid grid-flow-col gap-6">
{!version.oculus && <LaunchModToogle infoText="pages.version-viewer.launch-mods.oculus-description" icon="oculus" onClick={() => setMode(LaunchMods.OCULUS_MOD, !oculusMode)} active={oculusMode} text="pages.version-viewer.launch-mods.oculus" />} {!(version.oculus || version.metadata?.store === BsStore.OCULUS) && <LaunchModToogle infoText="pages.version-viewer.launch-mods.oculus-description" icon="oculus" onClick={() => setMode(LaunchMods.OCULUS_MOD, !oculusMode)} active={oculusMode} text="pages.version-viewer.launch-mods.oculus" />}
<LaunchModToogle infoText="pages.version-viewer.launch-mods.desktop-description" icon="desktop" onClick={() => setMode(LaunchMods.DESKTOP_MOD, !desktopMode)} active={desktopMode} text="pages.version-viewer.launch-mods.desktop" /> <LaunchModToogle infoText="pages.version-viewer.launch-mods.desktop-description" icon="desktop" onClick={() => setMode(LaunchMods.DESKTOP_MOD, !desktopMode)} active={desktopMode} text="pages.version-viewer.launch-mods.desktop" />
<LaunchModToogle infoText="pages.version-viewer.launch-mods.debug-description" icon="terminal" onClick={() => setMode(LaunchMods.DEBUG_MOD, !debugMode)} active={debugMode} text="pages.version-viewer.launch-mods.debug" /> <LaunchModToogle infoText="pages.version-viewer.launch-mods.debug-description" icon="terminal" onClick={() => setMode(LaunchMods.DEBUG_MOD, !debugMode)} active={debugMode} text="pages.version-viewer.launch-mods.debug" />
</div> </div>
@@ -87,7 +100,13 @@ export function LaunchSlide({ version }: Props) {
</motion.div> </motion.div>
</div> </div>
<div className='grow flex justify-center items-center'> <div className='grow flex justify-center items-center'>
<BsmButton onClick={launch} active={JSON.stringify(version) === JSON.stringify(versionRunning)} className='relative -translate-y-1/2 text-5xl text-gray-800 dark:text-gray-200 font-bold tracking-wide pt-1 pb-3 px-7 rounded-lg shadow-md italic shadow-black active:scale-90 transition-transform' text="misc.launch"/> <BsmButton
onClick={launch}
active={JSON.stringify(version) === JSON.stringify(versionRunning)}
className='relative -translate-y-1/2 text-5xl text-gray-800 dark:text-gray-200 font-bold tracking-wide pt-1 pb-3 px-7 rounded-lg shadow-md italic shadow-black active:scale-90 transition-transform'
text="misc.launch"
disabled={equal(version, versionDownloading)}
/>
</div> </div>
</div> </div>
); );
@@ -65,10 +65,10 @@ export function ModsGrid({ modsMap, installed, modsSelected, onModChange, moreIn
<span className="z-10 sticky flex items-center justify-end top-0 bg-inherit border-b-2 border-main-color-1"> <span className="z-10 sticky flex items-center justify-end top-0 bg-inherit border-b-2 border-main-color-1">
<BsmButton className="rounded-full h-6 w-6 p-[2px]" withBar={false} icon="search" onClick={handleToogleFilter} /> <BsmButton className="rounded-full h-6 w-6 p-[2px]" withBar={false} icon="search" onClick={handleToogleFilter} />
</span> </span>
<span className="z-10 sticky top-0 flex items-center bg-inherit border-main-color-1 border-b-2 h-8 px-1">{filterEnabled ? <motion.input autoFocus className="bg-main-color-1 rounded-md h-6 px-2" initial={{ width: 0 }} animate={{ width: "250px" }} transition={{ ease: "easeInOut", duration: 0.15 }} onChange={e => handleInput(e.target.value)} /> : <span className="w-full text-center">{t("pages.version-viewer.mods.mods-grid.header-bar.name")}</span>}</span> <span className="z-10 sticky top-0 flex items-center bg-inherit border-main-color-1 border-b-2 h-8 px-1 whitespace-nowrap">{filterEnabled ? <motion.input autoFocus className="bg-main-color-1 rounded-md h-6 px-2" initial={{ width: 0 }} animate={{ width: "250px" }} transition={{ ease: "easeInOut", duration: 0.15 }} onChange={e => handleInput(e.target.value)} /> : <span className="w-full text-center">{t("pages.version-viewer.mods.mods-grid.header-bar.name")}</span>}</span>
<span className="z-10 sticky flex items-center justify-center top-0 bg-inherit border-b-2 border-main-color-1 h-8 px-2">{t("pages.version-viewer.mods.mods-grid.header-bar.installed")}</span> <span className="z-10 sticky flex items-center justify-center top-0 bg-inherit border-b-2 border-main-color-1 h-8 px-2 whitespace-nowrap">{t("pages.version-viewer.mods.mods-grid.header-bar.installed")}</span>
<span className="z-10 sticky flex items-center justify-center top-0 bg-inherit border-b-2 border-main-color-1 h-8 px-2">{t("pages.version-viewer.mods.mods-grid.header-bar.latest")}</span> <span className="z-10 sticky flex items-center justify-center top-0 bg-inherit border-b-2 border-main-color-1 h-8 px-2 whitespace-nowrap">{t("pages.version-viewer.mods.mods-grid.header-bar.latest")}</span>
<span className="z-10 sticky flex items-center justify-center top-0 bg-inherit border-b-2 border-main-color-1 h-8">{t("pages.version-viewer.mods.mods-grid.header-bar.description")}</span> <span className="z-10 sticky flex items-center justify-center top-0 bg-inherit border-b-2 border-main-color-1 h-8 whitespace-nowrap">{t("pages.version-viewer.mods.mods-grid.header-bar.description")}</span>
<span className="z-10 sticky top-0 bg-inherit border-b-2 border-main-color-1 h-8 flex justify-start items-center py-1 pl-[3px] min-w-[50px]"> <span className="z-10 sticky top-0 bg-inherit border-b-2 border-main-color-1 h-8 flex justify-start items-center py-1 pl-[3px] min-w-[50px]">
<BsmDropdownButton className="h-full aspect-square relative rounded-full bg-light-main-color-1 dark:bg-main-color-3" withBar={false} icon="three-dots" buttonClassName="!rounded-full !p-[2px] !bg-light-main-color-2 dark:!bg-main-color-2 hover:!bg-light-main-color-1 dark:hover:!bg-main-color-3" menuTranslationY="5px" items={[{ text: "pages.version-viewer.mods.mods-grid.header-bar.dropdown.uninstall-all", icon: "trash", onClick: handleUninstallAll }]} /> <BsmDropdownButton className="h-full aspect-square relative rounded-full bg-light-main-color-1 dark:bg-main-color-3" withBar={false} icon="three-dots" buttonClassName="!rounded-full !p-[2px] !bg-light-main-color-2 dark:!bg-main-color-2 hover:!bg-light-main-color-1 dark:hover:!bg-main-color-3" menuTranslationY="5px" items={[{ text: "pages.version-viewer.mods.mods-grid.header-bar.dropdown.uninstall-all", icon: "trash", onClick: handleUninstallAll }]} />
</span> </span>
@@ -3,7 +3,7 @@ export const defaultConfiguration: { [key in DefaultConfigKey]: any } = {
"second-color": "#ff4444", "second-color": "#ff4444",
theme: "os", theme: "os",
language: window.navigator.language.length <= 2 ? `${window.navigator.language}-${window.navigator.language.toLocaleUpperCase()}` : window.navigator.language, language: window.navigator.language.length <= 2 ? `${window.navigator.language}-${window.navigator.language.toLocaleUpperCase()}` : window.navigator.language,
supported_languages: ["en-US", "en-EN", "fr-FR", "es-ES", "de-DE", "ru-RU"], supported_languages: ["en-US", "en-EN", "fr-FR", "es-ES", "de-DE", "ru-RU","zh-CN"],
default_mods: ["SongCore", "WhyIsThereNoLeaderboard", "BeatSaverDownloader", "BeatSaverVoting", "PlaylistManager"], default_mods: ["SongCore", "WhyIsThereNoLeaderboard", "BeatSaverDownloader", "BeatSaverVoting", "PlaylistManager"],
"default-shared-folders": [ "default-shared-folders": [
window.electron.path.join("Beat Saber_Data", "CustomLevels"), window.electron.path.join("Beat Saber_Data", "CustomLevels"),
-10
View File
@@ -1,10 +0,0 @@
import { BsvMapDetail } from "shared/models/maps";
export function getMapZipUrlFromMapDetails(map: BsvMapDetail) {
const { hash } = map.versions.at(0);
return getMapZipUrlFromHash(hash);
}
export function getMapZipUrlFromHash(hash: string) {
return `https://r2cdn.beatsaver.com/${hash}.zip`;
}
+5 -1
View File
@@ -15,7 +15,7 @@ const ipc = IpcService.getInstance();
const themeService = ThemeService.getInstance(); const themeService = ThemeService.getInstance();
window.onerror = (...data) => { window.onerror = (...data) => {
ipc.sendLazy("log-error", { args: data }); logRenderError(data);
}; };
document.addEventListener("DOMContentLoaded", () => { document.addEventListener("DOMContentLoaded", () => {
@@ -58,4 +58,8 @@ if (launcherContainer) {
}); });
} }
export function logRenderError(...params: unknown[]){
ipc.sendLazy("log-error", { args: params });
}
@@ -1,5 +1,4 @@
import { AvailableVersionsSlider } from "../components/available-versions/available-versions-slider.component"; import { AvailableVersionsSlider } from "../components/available-versions/available-versions-slider.component";
import { BsDownloaderService } from "../services/bs-downloader.service";
import { Slideshow } from "renderer/components/slideshow/slideshow.component"; import { Slideshow } from "renderer/components/slideshow/slideshow.component";
import { createContext, useMemo, useState } from "react"; import { createContext, useMemo, useState } from "react";
import { BsmButton } from "renderer/components/shared/bsm-button.component"; import { BsmButton } from "renderer/components/shared/bsm-button.component";
@@ -7,75 +6,43 @@ import { AnimatePresence, motion } from "framer-motion";
import { useTranslation } from "renderer/hooks/use-translation.hook"; import { useTranslation } from "renderer/hooks/use-translation.hook";
import { BSVersionManagerService } from "renderer/services/bs-version-manager.service"; import { BSVersionManagerService } from "renderer/services/bs-version-manager.service";
import { BsmDropdownButton } from "renderer/components/shared/bsm-dropdown-button.component"; import { BsmDropdownButton } from "renderer/components/shared/bsm-dropdown-button.component";
import { ProgressBarService } from "renderer/services/progress-bar.service";
import { ModalExitCode, ModalService } from "renderer/services/modale.service";
import { ImportVersionModal } from "renderer/components/modal/modal-types/import-version-modal.component";
import { IpcService } from "renderer/services/ipc.service";
import { NotificationService } from "renderer/services/notification.service";
import { lastValueFrom, map } from "rxjs"; import { lastValueFrom, map } from "rxjs";
import { useService } from "renderer/hooks/use-service.hook"; import { useService } from "renderer/hooks/use-service.hook";
import { BSVersion } from "shared/bs-version.interface"; import { BSVersion } from "shared/bs-version.interface";
import { useObservable } from "renderer/hooks/use-observable.hook"; import { useObservable } from "renderer/hooks/use-observable.hook";
import { BsDownloaderService } from "renderer/services/bs-version-download/bs-downloader.service";
export const AvailableVersionsContext = createContext<{ selectedVersion: BSVersion; setSelectedVersion: (version: BSVersion) => void }>(null); export const AvailableVersionsContext = createContext<{ selectedVersion: BSVersion; setSelectedVersion: (version: BSVersion) => void }>(null);
export function AvailableVersionsList() { export function AvailableVersionsList() {
const bsDownloader = useService(BsDownloaderService); const bsDownloader = useService(BsDownloaderService);
const versionManager = useService(BSVersionManagerService); const versionManager = useService(BSVersionManagerService);
const progressBar = useService(ProgressBarService);
const modal = useService(ModalService);
const ipc = useService(IpcService);
const installer = useService(BsDownloaderService);
const notification = useService(NotificationService);
const [selectedVersion, setSelectedVersion] = useState<BSVersion>(null); const [selectedVersion, setSelectedVersion] = useState<BSVersion>(null);
const contextValue = useMemo(() => ({ selectedVersion, setSelectedVersion }), [selectedVersion]); const contextValue = useMemo(() => ({ selectedVersion, setSelectedVersion }), [selectedVersion]);
const downloading = useObservable(bsDownloader.currentBsVersionDownload$.pipe(map(v => !!v))); const downloading = useObservable(bsDownloader.downloadingVersion$.pipe(map(v => !!v)));
const t = useTranslation(); const t = useTranslation();
const startDownload = () => { const startDownload = async () => {
bsDownloader.downloadBsVersion(selectedVersion)
.catch(() => {}) return bsDownloader.downloadVersion(selectedVersion)
.catch(console.log)
.finally(() => setSelectedVersion(null)); .finally(() => setSelectedVersion(null));
}; };
const importVersion = async () => { const importVersion = () => {
if (!progressBar.require()) { return lastValueFrom(versionManager.importVersion()).catch(() => {});
return;
}
const modalRes = await modal.openModal(ImportVersionModal);
if (modalRes.exitCode !== ModalExitCode.COMPLETED) {
return;
}
const folderRes = await lastValueFrom(ipc.sendV2<{ canceled: boolean; filePaths: string[] }>("choose-folder"))
if (!folderRes || folderRes.canceled || !folderRes.filePaths?.length) {
return;
}
notification.notifySuccess({ title: "notifications.bs-import-version.success.start-import.title", desc: "notifications.bs-import-version.success.start-import.desc", duration: 6_000 });
progressBar.showFake(0.008);
const toImport = folderRes.filePaths.at(0);
const imported = await installer.importVersion(toImport);
if (imported) {
versionManager.askInstalledVersions();
notification.notifySuccess({ title: "notifications.bs-import-version.success.imported.title", duration: 3_000 });
progressBar.complete();
} else {
notification.notifyError({ title: "notifications.types.error", desc: "notifications.bs-import-version.errors.import-error.desc" });
}
progressBar.hide(true);
}; };
const refreshVersions = () => {
return Promise.all([
versionManager.askAvailableVersions(),
versionManager.askInstalledVersions()
]).catch(console.log);
}
return ( return (
<div className="relative h-full w-full flex items-center flex-col pt-2"> <div className="relative h-full w-full flex items-center flex-col pt-2">
@@ -98,7 +65,7 @@ export function AvailableVersionsList() {
className="absolute top-5 right-5 h-9 w-9 bg-light-main-color-2 dark:bg-main-color-2 rounded-md" className="absolute top-5 right-5 h-9 w-9 bg-light-main-color-2 dark:bg-main-color-2 rounded-md"
icon="settings" icon="settings"
items={[ items={[
{ icon: "sync", text: "pages.available-versions.dropdown.refresh", onClick: () => versionManager.askAvailableVersions() }, { icon: "sync", text: "pages.available-versions.dropdown.refresh", onClick: refreshVersions },
{ icon: "download", text: "pages.available-versions.dropdown.import-version", onClick: importVersion }, { icon: "download", text: "pages.available-versions.dropdown.import-version", onClick: importVersion },
]} ]}
/> />
+56 -25
View File
@@ -3,10 +3,10 @@ import SettingColorChooser from "renderer/components/settings/setting-color-choo
import { SettingContainer } from "renderer/components/settings/setting-container.component"; import { SettingContainer } from "renderer/components/settings/setting-container.component";
import { RadioItem, SettingRadioArray } from "renderer/components/settings/setting-radio-array.component"; import { RadioItem, SettingRadioArray } from "renderer/components/settings/setting-radio-array.component";
import { BsmButton } from "renderer/components/shared/bsm-button.component"; import { BsmButton } from "renderer/components/shared/bsm-button.component";
import { BsmIconType } from "renderer/components/svgs/bsm-icon.component"; import { BsmIcon, BsmIconType } from "renderer/components/svgs/bsm-icon.component";
import { DefaultConfigKey, ThemeConfig } from "renderer/config/default-configuration.config"; import { DefaultConfigKey, ThemeConfig } from "renderer/config/default-configuration.config";
import { useThemeColor } from "renderer/hooks/use-theme-color.hook"; import { useThemeColor } from "renderer/hooks/use-theme-color.hook";
import { BsDownloaderService } from "renderer/services/bs-downloader.service"; import { SteamDownloaderService } from "renderer/services/bs-version-download/steam-downloader.service";
import { ConfigurationService } from "renderer/services/configuration.service"; import { ConfigurationService } from "renderer/services/configuration.service";
import { I18nService } from "renderer/services/i18n.service"; import { I18nService } from "renderer/services/i18n.service";
import { IpcService } from "renderer/services/ipc.service"; import { IpcService } from "renderer/services/ipc.service";
@@ -35,7 +35,11 @@ import { useService } from "renderer/hooks/use-service.hook";
import { lastValueFrom } from "rxjs"; import { lastValueFrom } from "rxjs";
import { BsmException } from "shared/models/bsm-exception.model"; import { BsmException } from "shared/models/bsm-exception.model";
import { useObservable } from "renderer/hooks/use-observable.hook"; import { useObservable } from "renderer/hooks/use-observable.hook";
import { AuthUserService } from "renderer/services/auth-user.service"; import { OculusDownloaderService } from "renderer/services/bs-version-download/oculus-downloader.service";
import { BsStore } from "shared/models/bs-store.enum";
import { SteamIcon } from "renderer/components/svgs/icons/steam-icon.component";
import { OculusIcon } from "renderer/components/svgs/icons/oculus-icon.component";
import { BsDownloaderService } from "renderer/services/bs-version-download/bs-downloader.service";
export function SettingsPage() { export function SettingsPage() {
@@ -43,7 +47,9 @@ export function SettingsPage() {
const themeService = useService(ThemeService); const themeService = useService(ThemeService);
const ipcService = useService(IpcService); const ipcService = useService(IpcService);
const modalService = useService(ModalService); const modalService = useService(ModalService);
const downloaderService = useService(BsDownloaderService); const bsDownloader = useService(BsDownloaderService);
const steamDownloader = useService(SteamDownloaderService);
const oculusDownloader = useService(OculusDownloaderService);
const progressBarService = useService(ProgressBarService); const progressBarService = useService(ProgressBarService);
const notificationService = useService(NotificationService); const notificationService = useService(NotificationService);
const i18nService = useService(I18nService); const i18nService = useService(I18nService);
@@ -52,38 +58,39 @@ export function SettingsPage() {
const playlistsManager = useService(PlaylistsManagerService); const playlistsManager = useService(PlaylistsManagerService);
const modelsManager = useService(ModelsManagerService); const modelsManager = useService(ModelsManagerService);
const versionLinker = useService(VersionFolderLinkerService); const versionLinker = useService(VersionFolderLinkerService);
const authService = useService(AuthUserService);
const { firstColor, secondColor } = useThemeColor(); const { firstColor, secondColor } = useThemeColor();
const themeItem: RadioItem[] = [ const themeItem: RadioItem<ThemeConfig>[] = [
{ id: 0, text: "pages.settings.appearance.themes.dark", value: "dark" as ThemeConfig }, { id: 0, text: "pages.settings.appearance.themes.dark", value: "dark" as ThemeConfig },
{ id: 1, text: "pages.settings.appearance.themes.light", value: "light" as ThemeConfig }, { id: 1, text: "pages.settings.appearance.themes.light", value: "light" as ThemeConfig },
{ id: 3, text: "pages.settings.appearance.themes.os", value: "os" as ThemeConfig }, { id: 3, text: "pages.settings.appearance.themes.os", value: "os" as ThemeConfig },
]; ];
const languagesItems: RadioItem[] = i18nService const languagesItems: RadioItem<string>[] = i18nService
.getSupportedLanguages() .getSupportedLanguages()
.map((l, index) => { .map((l, index) => {
return { id: index, text: `pages.settings.language.languages.${l}`, value: l, textIcon: `pages.settings.language.languages.translated.${l}`, icon: `${l}-flag` as BsmIconType }; return { id: index, text: `pages.settings.language.languages.${l}`, value: l, textIcon: `pages.settings.language.languages.translated.${l}`, icon: <BsmIcon icon={`${l}-flag` as BsmIconType} className="max-h-5 w-fit ml-2"/> };
}) })
.sort((a, b) => a.text.localeCompare(b.text)); .sort((a, b) => a.text.localeCompare(b.text));
const nav = useNavigate(); const nav = useNavigate();
const t = useTranslation(); const t = useTranslation();
const [themeIdSelected, setThemeIdSelected] = useState(themeItem.find(e => e.value === themeService.getTheme()).id); const themeSelected = useObservable(themeService.theme$, "os");
const [languageSelected, setLanguageSelected] = useState(languagesItems.find(e => e.value === i18nService.currentLanguage).id); const languageSelected = useObservable(i18nService.currentLanguage$, i18nService.getFallbackLanguage());
const downloadStore = useObservable(bsDownloader.defaultStore$);
const [installationFolder, setInstallationFolder] = useState(null); const [installationFolder, setInstallationFolder] = useState(null);
const [showSupporters, setShowSupporters] = useState(false); const [showSupporters, setShowSupporters] = useState(false);
const [mapDeepLinksEnabled, setMapDeepLinksEnabled] = useState(false); const [mapDeepLinksEnabled, setMapDeepLinksEnabled] = useState(false);
const [playlistsDeepLinkEnabled, setPlaylistsDeepLinkEnabled] = useState(false); const [playlistsDeepLinkEnabled, setPlaylistsDeepLinkEnabled] = useState(false);
const [modelsDeepLinkEnabled, setModelsDeepLinkEnabled] = useState(false); const [modelsDeepLinkEnabled, setModelsDeepLinkEnabled] = useState(false);
const [hasDownloaderSession, setHasDownloaderSession] = useState(false);
const appVersion = useObservable(ipcService.sendV2<string>("current-version")); const appVersion = useObservable(ipcService.sendV2<string>("current-version"));
const steamSessionExist = useObservable(authService.sessionExist$);
useEffect(() => { useEffect(() => {
loadInstallationFolder(); loadInstallationFolder();
loadDownloadersSession();
mapsManager.isDeepLinksEnabled().then(enabled => setMapDeepLinksEnabled(() => enabled)); mapsManager.isDeepLinksEnabled().then(enabled => setMapDeepLinksEnabled(() => enabled));
playlistsManager.isDeepLinksEnabled().then(enabled => setPlaylistsDeepLinkEnabled(() => enabled)); playlistsManager.isDeepLinksEnabled().then(enabled => setPlaylistsDeepLinkEnabled(() => enabled));
modelsManager.isDeepLinksEnabled().then(enabled => setModelsDeepLinkEnabled(() => enabled)); modelsManager.isDeepLinksEnabled().then(enabled => setModelsDeepLinkEnabled(() => enabled));
@@ -97,21 +104,36 @@ export function SettingsPage() {
}; };
const loadInstallationFolder = () => { const loadInstallationFolder = () => {
downloaderService.getInstallationFolder().then(res => setInstallationFolder(res)); steamDownloader.getInstallationFolder().then(res => setInstallationFolder(res));
}; };
const loadDownloadersSession = () => {
if(steamDownloader.sessionExist()){ return setHasDownloaderSession(true); }
oculusDownloader.hasAuthToken().then(hasToken => {
setHasDownloaderSession(hasToken);
});
}
const clearDownloadersSession = () => {
steamDownloader.deleteSteamSession();
oculusDownloader.clearAuthToken();
loadDownloadersSession();
}
const setFirstColorSetting = (hex: string) => configService.set("first-color", hex); const setFirstColorSetting = (hex: string) => configService.set("first-color", hex);
const setSecondColorSetting = (hex: string) => configService.set("second-color", hex); const setSecondColorSetting = (hex: string) => configService.set("second-color", hex);
const handleChangeTheme = (id: number) => { const handleChangeBsStore = (item: RadioItem<BsStore|undefined>) => {
setThemeIdSelected(id); bsDownloader.setDefaultStore(item.value);
themeService.setTheme(themeItem.find(e => e.id === id).value); }
const handleChangeTheme = (item: RadioItem<ThemeConfig>) => {
themeService.setTheme(item.value);
}; };
const handleChangeLanguage = (id: number) => { const handleChangeLanguage = (item: RadioItem<string>) => {
const selectedLanguage = languagesItems.find(l => l.id === id).value; i18nService.setLanguage(item.value);
i18nService.setLanguage(selectedLanguage);
setLanguageSelected(languagesItems.find(l => l.value === i18nService.currentLanguage).id);
}; };
const setDefaultInstallationFolder = () => { const setDefaultInstallationFolder = () => {
@@ -131,7 +153,7 @@ export function SettingsPage() {
notificationService.notifySuccess({ title: "notifications.settings.move-folder.success.titles.transfer-started", desc: "notifications.settings.move-folder.success.descs.transfer-started" }); notificationService.notifySuccess({ title: "notifications.settings.move-folder.success.titles.transfer-started", desc: "notifications.settings.move-folder.success.descs.transfer-started" });
lastValueFrom(downloaderService.setInstallationFolder(fileChooserRes.filePaths[0])).then(res => { lastValueFrom(steamDownloader.setInstallationFolder(fileChooserRes.filePaths[0])).then(res => {
progressBarService.complete(); progressBarService.complete();
progressBarService.hide(true); progressBarService.hide(true);
@@ -207,9 +229,18 @@ export function SettingsPage() {
<BsmButton className="inline-block grow-0 bg-transparent sticky h-full w-full top-20 right-20 !m-0 rounded-full p-1" onClick={() => nav(-1)} icon="close" withBar={false} /> <BsmButton className="inline-block grow-0 bg-transparent sticky h-full w-full top-20 right-20 !m-0 rounded-full p-1" onClick={() => nav(-1)} icon="close" withBar={false} />
</div> </div>
<SettingContainer title="pages.settings.steam.title" description="pages.settings.steam.description"> <SettingContainer title="pages.settings.steam-and-oculus.title" description="pages.settings.steam-and-oculus.description">
<BsmButton onClick={() => authService.deleteSteamSession()} className="w-fit px-3 py-[2px] text-white rounded-md" withBar={false} text="pages.settings.steam.logout" typeColor="error" disabled={!steamSessionExist}/> <BsmButton onClick={clearDownloadersSession} className="w-fit px-3 py-[2px] text-white rounded-md" withBar={false} text="pages.settings.steam-and-oculus.logout" typeColor="error" disabled={!hasDownloaderSession}/>
</SettingContainer>
<SettingContainer id="choose-default-store" minorTitle="pages.settings.steam-and-oculus.download-platform.title" description="pages.settings.steam-and-oculus.download-platform.desc" className="mt-3">
<SettingRadioArray items={[
{ id: 1, text: "Steam", value: BsStore.STEAM, icon: <SteamIcon className="h-6 w-6 float-left"/> },
{ id: 2, text: "Oculus Store (PC)", value: BsStore.OCULUS, icon: <OculusIcon className="h-6 w-6 float-left bg-white text-black rounded-full p-0.5"/>},
{ id: 0, text: t("pages.settings.steam-and-oculus.download-platform.always-ask"), value: undefined, },
]} selectedItemValue={downloadStore} onItemSelected={handleChangeBsStore}/>
</SettingContainer>
</SettingContainer>
<SettingContainer title="pages.settings.appearance.title" description="pages.settings.appearance.description"> <SettingContainer title="pages.settings.appearance.title" description="pages.settings.appearance.description">
<div className="relative w-full h-8 bg-light-main-color-1 dark:bg-main-color-1 flex justify-center rounded-md py-1"> <div className="relative w-full h-8 bg-light-main-color-1 dark:bg-main-color-1 flex justify-center rounded-md py-1">
@@ -220,7 +251,7 @@ export function SettingsPage() {
</div> </div>
</div> </div>
<SettingContainer minorTitle="pages.settings.appearance.sub-title" className="mt-3"> <SettingContainer minorTitle="pages.settings.appearance.sub-title" className="mt-3">
<SettingRadioArray items={themeItem} selectedItem={themeIdSelected} onItemSelected={handleChangeTheme} /> <SettingRadioArray items={themeItem} selectedItemValue={themeSelected} onItemSelected={handleChangeTheme} />
</SettingContainer> </SettingContainer>
</SettingContainer> </SettingContainer>
@@ -383,7 +414,7 @@ export function SettingsPage() {
</SettingContainer> </SettingContainer>
<SettingContainer title="pages.settings.language.title" description="pages.settings.language.description"> <SettingContainer title="pages.settings.language.title" description="pages.settings.language.description">
<SettingRadioArray items={languagesItems} selectedItem={languageSelected} onItemSelected={handleChangeLanguage} /> <SettingRadioArray items={languagesItems} selectedItemValue={languageSelected} onItemSelected={handleChangeLanguage} />
</SettingContainer> </SettingContainer>
<SettingContainer title="pages.settings.patreon.title" description="pages.settings.patreon.description"> <SettingContainer title="pages.settings.patreon.title" description="pages.settings.patreon.description">
@@ -8,7 +8,6 @@ import { BSUninstallerService } from "../services/bs-uninstaller.service";
import { BSVersionManagerService } from "../services/bs-version-manager.service"; import { BSVersionManagerService } from "../services/bs-version-manager.service";
import { ModalExitCode, ModalService } from "../services/modale.service"; import { ModalExitCode, ModalService } from "../services/modale.service";
import DefautVersionImage from "../../../assets/images/default-version-img.jpg"; import DefautVersionImage from "../../../assets/images/default-version-img.jpg";
import { BsDownloaderService } from "renderer/services/bs-downloader.service";
import { IpcService } from "renderer/services/ipc.service"; import { IpcService } from "renderer/services/ipc.service";
import { LaunchSlide } from "renderer/components/version-viewer/slides/launch/launch-slide.component"; import { LaunchSlide } from "renderer/components/version-viewer/slides/launch/launch-slide.component";
import { ModsSlide } from "renderer/components/version-viewer/slides/mods/mods-slide.component"; import { ModsSlide } from "renderer/components/version-viewer/slides/mods/mods-slide.component";
@@ -21,13 +20,14 @@ import { BSLauncherService } from "renderer/services/bs-launcher.service";
import { CreateLaunchShortcutModal } from "renderer/components/modal/modal-types/create-launch-shortcut-modal.component"; import { CreateLaunchShortcutModal } from "renderer/components/modal/modal-types/create-launch-shortcut-modal.component";
import { lastValueFrom } from "rxjs"; import { lastValueFrom } from "rxjs";
import { NotificationService } from "renderer/services/notification.service"; import { NotificationService } from "renderer/services/notification.service";
import { BsDownloaderService } from "renderer/services/bs-version-download/bs-downloader.service";
export function VersionViewer() { export function VersionViewer() {
const bsUninstallerService = useService(BSUninstallerService); const bsUninstallerService = useService(BSUninstallerService);
const bsVersionManagerService = useService(BSVersionManagerService); const bsVersionManagerService = useService(BSVersionManagerService);
const modalService = useService(ModalService); const modalService = useService(ModalService);
const bsDownloaderService = useService(BsDownloaderService); const bsDownloader = useService(BsDownloaderService);
const ipcService = useService(IpcService); const ipcService = useService(IpcService);
const bsLauncher = useService(BSLauncherService); const bsLauncher = useService(BSLauncherService);
const notification = useService(NotificationService); const notification = useService(NotificationService);
@@ -43,7 +43,7 @@ export function VersionViewer() {
navigate(`/bs-version/${version.BSVersion}`, { state: version }); navigate(`/bs-version/${version.BSVersion}`, { state: version });
}; };
const openFolder = () => ipcService.sendLazy("bs-version.open-folder", { args: state }); const openFolder = () => ipcService.sendLazy("bs-version.open-folder", { args: state });
const verifyFiles = () => bsDownloaderService.verifyBsVersionFiles(state); const verifyFiles = () => bsDownloader.verifyBsVersion(state);
const uninstall = async () => { const uninstall = async () => {
const modalCompleted = await modalService.openModal(UninstallModal, state); const modalCompleted = await modalService.openModal(UninstallModal, state);
@@ -99,6 +99,20 @@ export function VersionViewer() {
}); });
} }
const restoreOriginalOculusFolder = () => {
lastValueFrom(ipcService.sendV2("restore-original-oculus-folder")).then(() => {
notification.notifySuccess({
title: "Restauration réussie",
desc: "Le dossier a été restauré avec succès"
});
}).catch(() => {
notification.notifyError({
title: "Erreur lors de la restauration",
desc: "Le dossier n'a pas pu être restauré"
});
});
}
return ( return (
<> <>
<BsmImage className="absolute w-full h-full top-0 left-0 object-cover" image={state.ReleaseImg || DefautVersionImage} errorImage={DefautVersionImage} /> <BsmImage className="absolute w-full h-full top-0 left-0 object-cover" image={state.ReleaseImg || DefautVersionImage} errorImage={DefautVersionImage} />
@@ -117,7 +131,8 @@ export function VersionViewer() {
</div> </div>
<BsmDropdownButton className="absolute top-3 right-4 h-9 w-9 bg-light-main-color-2 dark:bg-main-color-2 rounded-md" items={[ <BsmDropdownButton className="absolute top-3 right-4 h-9 w-9 bg-light-main-color-2 dark:bg-main-color-2 rounded-md" items={[
{ text: "pages.version-viewer.dropdown.open-folder", icon: "folder", onClick: openFolder }, { text: "pages.version-viewer.dropdown.open-folder", icon: "folder", onClick: openFolder },
!state.steam && !state.oculus && { text: "pages.version-viewer.dropdown.verify-files", icon: "task", onClick: verifyFiles }, state.oculus && { text: "pages.version-viewer.dropdown.restore-oculus-folder", icon: "backup-restore", onClick: restoreOriginalOculusFolder},
{ text: "pages.version-viewer.dropdown.verify-files", icon: "task", onClick: verifyFiles },
!state.steam && !state.oculus && { text: "pages.version-viewer.dropdown.edit", icon: "edit", onClick: edit }, !state.steam && !state.oculus && { text: "pages.version-viewer.dropdown.edit", icon: "edit", onClick: edit },
!state.oculus && { text: "pages.version-viewer.dropdown.clone", icon: "copy", onClick: clone }, !state.oculus && { text: "pages.version-viewer.dropdown.clone", icon: "copy", onClick: clone },
{ text: "pages.version-viewer.dropdown.shared-folders", icon: "link", onClick: openShareFolderModal }, { text: "pages.version-viewer.dropdown.shared-folders", icon: "link", onClick: openShareFolderModal },
+6
View File
@@ -11,6 +11,12 @@ declare global {
sep: "/"|"\\"; sep: "/"|"\\";
join: (...args: string[]) => string; join: (...args: string[]) => string;
}; };
window: {
close: () => void;
minimise: () => void;
maximise: () => void;
unmaximise: () => void;
};
}; };
} }
} }
@@ -1,47 +0,0 @@
import { Observable } from "rxjs";
import { map } from "rxjs/operators";
import { ConfigurationService } from "./configuration.service";
export class AuthUserService {
private static instance: AuthUserService;
private readonly configService: ConfigurationService;
private readonly STEAM_USERNAME_KEY = "STEAM-USERNAME";
private readonly STEAM_ID_KEY = "STEAM-ID";
public static getInstance(): AuthUserService {
if (!AuthUserService.instance) {
AuthUserService.instance = new AuthUserService();
}
return AuthUserService.instance;
}
private constructor() {
this.configService = ConfigurationService.getInstance();
}
public sessionExist(): boolean {
return !!this.configService.get(this.STEAM_USERNAME_KEY);
}
public get sessionExist$(): Observable<boolean> {
return this.configService.watch(this.STEAM_USERNAME_KEY).pipe(map(v => !!v));
}
public setSteamSession(username: string, stay = true): void {
this.configService.set(this.STEAM_USERNAME_KEY, username, stay);
}
public setSteamID(steamID: string): void {
this.configService.set(this.STEAM_ID_KEY, steamID);
}
public getSteamUsername(): string {
return this.configService.get(this.STEAM_USERNAME_KEY);
}
public deleteSteamSession(): void {
this.configService.delete(this.STEAM_USERNAME_KEY);
}
}
+55 -21
View File
@@ -1,10 +1,15 @@
import { LaunchOption, BSLaunchEvent, BSLaunchWarning, BSLaunchEventData, BSLaunchErrorData, BSLaunchError } from "shared/models/bs-launch"; import { LaunchOption, BSLaunchEvent, BSLaunchWarning, BSLaunchEventData, BSLaunchError } from "shared/models/bs-launch";
import { BSVersion } from 'shared/bs-version.interface'; import { BSVersion } from 'shared/bs-version.interface';
import { IpcService } from "./ipc.service"; import { IpcService } from "./ipc.service";
import { NotificationService } from "./notification.service"; import { NotificationService } from "./notification.service";
import { BehaviorSubject, Observable, filter } from "rxjs"; import { BehaviorSubject, Observable, lastValueFrom, tap } from "rxjs";
import { ConfigurationService } from "./configuration.service"; import { ConfigurationService } from "./configuration.service";
import { ThemeService } from "./theme.service"; import { ThemeService } from "./theme.service";
import { BsStore } from "shared/models/bs-store.enum";
import { ModalExitCode, ModalService } from "./modale.service";
import { OriginalOculusVersionBackupModal } from "renderer/components/modal/modal-types/original-oculus-version-backup.modal";
import { CustomError } from "shared/models/exceptions/custom-error.class";
import { sToMs } from "shared/helpers/time.helpers";
export class BSLauncherService { export class BSLauncherService {
private static instance: BSLauncherService; private static instance: BSLauncherService;
@@ -13,6 +18,7 @@ export class BSLauncherService {
private readonly notificationService: NotificationService; private readonly notificationService: NotificationService;
private readonly config: ConfigurationService; private readonly config: ConfigurationService;
private readonly theme: ThemeService; private readonly theme: ThemeService;
private readonly modals: ModalService;
public readonly versionRunning$: BehaviorSubject<BSVersion> = new BehaviorSubject(null); public readonly versionRunning$: BehaviorSubject<BSVersion> = new BehaviorSubject(null);
@@ -26,6 +32,15 @@ export class BSLauncherService {
this.notificationService = NotificationService.getInstance(); this.notificationService = NotificationService.getInstance();
this.config = ConfigurationService.getInstance(); this.config = ConfigurationService.getInstance();
this.theme = ThemeService.getInstance(); this.theme = ThemeService.getInstance();
this.modals = ModalService.getInstance();
}
private notRewindBackupOculus(): boolean{
return this.config.get<boolean>("not-rewind-backup-oculus");
}
private setNotRewindBackupOculus(value: boolean): void{
this.config.set("not-rewind-backup-oculus", value);
} }
public getLaunchOptions(version: BSVersion): LaunchOption{ public getLaunchOptions(version: BSVersion): LaunchOption{
@@ -38,34 +53,50 @@ export class BSLauncherService {
} }
} }
private handleLaunchEvents(events$: Observable<BSLaunchEventData>): Observable<BSLaunchEventData>{
const eventToFilter = [...Object.values(BSLaunchWarning), BSLaunchEvent.STEAM_LAUNCHED]
return events$.pipe(tap({
next: event => {
if(eventToFilter.includes(event.type)){ return; }
this.notificationService.notifySuccess({title: `notifications.bs-launch.success.titles.${event.type}`, desc: `notifications.bs-launch.success.msg.${event.type}`});
},
error: (err: CustomError) => {
if(!err?.code || !Object.values(BSLaunchError).includes(err.code as BSLaunchError)){
this.notificationService.notifyError({title: "notifications.bs-launch.errors.titles.UNKNOWN_ERROR", desc: "notifications.bs-launch.errors.msg.UNKNOWN_ERROR"});
} else {
this.notificationService.notifyError({title: `notifications.bs-launch.errors.titles.${err.code}`, desc: `notifications.bs-launch.errors.msg.${err.code}`, duration: sToMs(9)})
}
}
}))
}
public doLaunch(launchOptions: LaunchOption): Observable<BSLaunchEventData>{ public doLaunch(launchOptions: LaunchOption): Observable<BSLaunchEventData>{
return this.ipcService.sendV2<BSLaunchEventData, LaunchOption>("bs-launch.launch", {args: launchOptions}); return this.ipcService.sendV2<BSLaunchEventData, LaunchOption>("bs-launch.launch", {args: launchOptions});
} }
public launch(launchOptions: LaunchOption): Observable<BSLaunchEventData> { public launch(launchOptions: LaunchOption): Observable<BSLaunchEventData> {
const launchState$ = this.doLaunch(launchOptions);
this.versionRunning$.next(launchOptions.version); return new Observable<BSLaunchEventData>(obs => {
(async () => {
launchState$.pipe(filter(event => {
const eventToFilter = [...Object.values(BSLaunchWarning), BSLaunchEvent.STEAM_LAUNCHED] if(launchOptions.version.metadata?.store === BsStore.OCULUS && !this.notRewindBackupOculus()){
return !eventToFilter.includes(event.type); const { exitCode, data: notRewind } = await this.modals.openModal(OriginalOculusVersionBackupModal);
})).subscribe({ if(exitCode !== ModalExitCode.COMPLETED){ return; }
next: event => { this.setNotRewindBackupOculus(notRewind);
this.notificationService.notifySuccess({title: `notifications.bs-launch.success.titles.${event.type}`, desc: `notifications.bs-launch.success.msg.${event.type}`});
},
error: (err: BSLaunchErrorData) => {
if(!Object.values(BSLaunchError).includes(err.type)){
this.notificationService.notifyError({title: "notifications.bs-launch.errors.titles.UNKNOWN_ERROR", desc: "notifications.bs-launch.errors.msg.UNKNOWN_ERROR"});
} else {
this.notificationService.notifyError({title: `notifications.bs-launch.errors.titles.${err.type}`, desc: `notifications.bs-launch.errors.msg.${err.type}`})
} }
}
}).add(() => { const launch$ = this.handleLaunchEvents(this.doLaunch(launchOptions));
this.versionRunning$.next(null);
await lastValueFrom(launch$);
})().then(() => {
obs.complete();
}).catch(err => {
obs.error(err);
})
}); });
return launchState$;
} }
public createLaunchShortcut(launchOptions: LaunchOption): Observable<void>{ public createLaunchShortcut(launchOptions: LaunchOption): Observable<void>{
@@ -73,6 +104,9 @@ export class BSLauncherService {
return this.ipcService.sendV2<void, LaunchOption>("create-launch-shortcut", {args: options}); return this.ipcService.sendV2<void, LaunchOption>("create-launch-shortcut", {args: options});
} }
public restoreSteamVR(): Promise<void>{
return lastValueFrom(this.ipcService.sendV2<void, void>("bs-launch.restore-steamvr"));
}
} }
export enum LaunchMods { export enum LaunchMods {
@@ -0,0 +1,16 @@
import { BehaviorSubject, Observable } from "rxjs";
import { BSVersion } from "shared/bs-version.interface";
export abstract class AbstractBsDownloaderService {
private static readonly __downloadingVersion$ = new BehaviorSubject<BSVersion>(null);
private static readonly __isVerifying$ = new BehaviorSubject<boolean>(false);
protected get _downloadingVersion$(){ return AbstractBsDownloaderService.__downloadingVersion$; }
protected get _isVerifying$(){ return AbstractBsDownloaderService.__isVerifying$; }
public get downloadingVersion$(): Observable<BSVersion>{ return this._downloadingVersion$.asObservable(); }
public get downloadingVersion(): BSVersion{ return this._downloadingVersion$.getValue(); }
public get isVerifying$(): Observable<boolean>{ return this._isVerifying$.asObservable(); }
public get isVerifying(): boolean{ return this._isVerifying$.getValue(); }
}
@@ -0,0 +1,110 @@
import { BsStore } from "shared/models/bs-store.enum";
import { ConfigurationService } from "../configuration.service";
import { BSVersion } from "shared/bs-version.interface";
import { ModalExitCode, ModalService } from "../modale.service";
import { ChooseStore } from "renderer/components/modal/modal-types/bs-downgrade/choose-store-modal.component";
import { SteamDownloaderService } from "./steam-downloader.service";
import { OculusDownloaderService } from "./oculus-downloader.service";
import { DownloaderServiceInterface } from "./bs-store-downloader.interface";
import { AbstractBsDownloaderService } from "./abstract-bs-downloader.service";
import { BSVersionManagerService } from "../bs-version-manager.service";
import { Observable } from "rxjs";
export class BsDownloaderService extends AbstractBsDownloaderService {
private static instance: BsDownloaderService;
public static getInstance(): BsDownloaderService {
if (!BsDownloaderService.instance) {
BsDownloaderService.instance = new BsDownloaderService();
}
return BsDownloaderService.instance;
}
private readonly config: ConfigurationService;
private readonly modals: ModalService;
private readonly steamDownloader: SteamDownloaderService;
private readonly oculusDownloader: OculusDownloaderService;
private readonly versionManager: BSVersionManagerService;
private readonly SELECTED_STORE_TO_DOWNLOAD_KET = "selectedStoreToDownload";
private constructor(){
super();
this.config = ConfigurationService.getInstance();
this.modals = ModalService.getInstance();
this.steamDownloader = SteamDownloaderService.getInstance();
this.oculusDownloader = OculusDownloaderService.getInstance();
this.versionManager = BSVersionManagerService.getInstance();
}
private getStoreDownloader(bsStore: BsStore): DownloaderServiceInterface{
switch(bsStore){
case BsStore.OCULUS:
return this.oculusDownloader;
case BsStore.STEAM:
return this.steamDownloader;
default:
throw new Error("Unknown store");
}
}
private resetDownloadState(){
this._downloadingVersion$.next(null);
this._isVerifying$.next(false);
}
public get defaultStore(): BsStore | undefined { return this.config.get<BsStore>(this.SELECTED_STORE_TO_DOWNLOAD_KET); }
public get defaultStore$(): Observable<BsStore | undefined> { return this.config.watch(this.SELECTED_STORE_TO_DOWNLOAD_KET); }
public setDefaultStore(store: BsStore|undefined): void {
this.config.set(this.SELECTED_STORE_TO_DOWNLOAD_KET, store);
}
public async chooseStoreToDownloadFrom(): Promise<BsStore | undefined> {
const res = await this.modals.openModal(ChooseStore);
if(res.exitCode !== ModalExitCode.COMPLETED){
return undefined;
}
return res.data;
}
public async downloadVersion(version: BSVersion, from?: BsStore): Promise<BSVersion> {
if(!from){
from = this.defaultStore ?? await this.chooseStoreToDownloadFrom();
}
return this.getStoreDownloader(from).downloadBsVersion(version).then(() => {
return this.downloadingVersion;
}).finally(() => {
this.resetDownloadState();
this.versionManager.askInstalledVersions();
});
}
public verifyBsVersion(version: BSVersion){
this._isVerifying$.next(true);
const store = (() => {
if(version.metadata?.store){ return version.metadata.store; }
return version.steam ? BsStore.STEAM : BsStore.OCULUS;
})();
return this.getStoreDownloader(store).verifyBsVersion(version).finally(() => {
this.resetDownloadState();
this.versionManager.askInstalledVersions();
});
}
public async stopDownload(): Promise<void> {
return Promise.all([
this.steamDownloader.stopDownload(),
this.oculusDownloader.stopDownload()
]).then(() => {});
}
}
@@ -0,0 +1,6 @@
import { BSVersion } from "shared/bs-version.interface";
export interface DownloaderServiceInterface {
downloadBsVersion(version: BSVersion): Promise<BSVersion>;
verifyBsVersion(version: BSVersion): Promise<BSVersion>;
}
@@ -0,0 +1,168 @@
import { Observable, Subscription, catchError, finalize, lastValueFrom, map, noop, of, take, tap } from "rxjs";
import { BSVersion } from "shared/bs-version.interface";
import { IpcService } from "../ipc.service";
import { Progression } from "main/helpers/fs.helpers";
import { ProgressBarService } from "../progress-bar.service";
import { CustomError } from "shared/models/exceptions/custom-error.class";
import { NotificationService } from "../notification.service";
import { ModalExitCode, ModalService } from "../modale.service";
import { LoginToMetaModal, MetaAuthMethod } from "renderer/components/modal/modal-types/bs-downgrade/login-to-meta-modal.component";
import { DownloaderServiceInterface } from "./bs-store-downloader.interface";
import { AbstractBsDownloaderService } from "./abstract-bs-downloader.service";
import { DownloadInfo } from "main/services/bs-version-download/bs-steam-downloader.service";
import { MetaAuthErrorCodes, OculusDownloaderErrorCodes } from "shared/models/bs-version-download/oculus-download.model";
import { EnterMetaTokenModal } from "renderer/components/modal/modal-types/bs-downgrade/enter-meta-token-modal.component";
export class OculusDownloaderService extends AbstractBsDownloaderService implements DownloaderServiceInterface{
private static instance: OculusDownloaderService;
public static getInstance(): OculusDownloaderService {
if (!OculusDownloaderService.instance) {
OculusDownloaderService.instance = new OculusDownloaderService();
}
return OculusDownloaderService.instance;
}
private readonly ipc: IpcService;
private readonly progressBar: ProgressBarService;
private readonly notifications: NotificationService;
private readonly modals: ModalService;
private readonly DISPLAYABLE_ERROR_CODES: string[] = [...Object.values(MetaAuthErrorCodes), ...Object.values(OculusDownloaderErrorCodes)];
private constructor(){
super();
this.ipc = IpcService.getInstance();
this.progressBar = ProgressBarService.getInstance();
this.notifications = NotificationService.getInstance();
this.modals = ModalService.getInstance();
}
private handleDownloadErrors(err: CustomError): Promise<void>{
if(!err?.code || !this.DISPLAYABLE_ERROR_CODES.includes(err.code)){
return this.notifications.notifyError({title: "notifications.types.error", desc: `notifications.bs-download.oculus-download.errors.msg.UNKNOWN_ERROR`}).then(noop);
}
return this.notifications.notifyError({title: "notifications.types.error", desc: `notifications.bs-download.oculus-download.errors.msg.${err.code}`}).then(noop);
}
private handleDownload(download: Observable<Progression<BSVersion>>, ingoreErrorCodes?: string[]): Observable<Progression<BSVersion>> {
const progress$ = download.pipe(map(progress => (progress.current / progress.total) * 100), catchError(() => of(0)));
this.progressBar.show(progress$, true);
const subs: Subscription[] = [];
subs.push(
download.pipe(take(1)).subscribe({ next: data => data && this._downloadingVersion$.next(data.data), error: () => {} })
)
return download.pipe(
tap({
error: (err: CustomError) => {
if(ingoreErrorCodes?.includes(err.code)){ return; }
this.handleDownloadErrors(err);
},
}),
finalize(() => subs.forEach(sub => sub.unsubscribe()))
);
}
private tryAutoDownload(downloadInfo: DownloadInfo): Observable<Progression<BSVersion>>{
const ignoreCode = [MetaAuthErrorCodes.NO_META_AUTH_TOKEN, OculusDownloaderErrorCodes.DOWNLOAD_CANCELLED];
return this.handleDownload(
this.ipc.sendV2<Progression<BSVersion>>("bs-oculus-auto-download", { args: downloadInfo }),
ignoreCode
);
}
private startDownloadBsVersion(downloadInfo: DownloadInfo): Observable<Progression<BSVersion>>{
const ignoreCode = [MetaAuthErrorCodes.META_LOGIN_WINDOW_CLOSED_BY_USER, OculusDownloaderErrorCodes.DOWNLOAD_CANCELLED];
return this.handleDownload(
this.ipc.sendV2<Progression<BSVersion>>("bs-oculus-download", { args: downloadInfo }),
ignoreCode
);
}
private async doDownloadBsVersion(bsVersion: BSVersion, isVerification: boolean): Promise<BSVersion> {
let autoDownloadFailed = false;
return (async () => {
const autoDownload = await lastValueFrom(this.tryAutoDownload({ bsVersion, isVerification })).then(() => true).catch((err: CustomError) => {
const doNotRestartCodes: string[] = [
OculusDownloaderErrorCodes.ALREADY_DOWNLOADING,
OculusDownloaderErrorCodes.SOME_FILES_FAILED_TO_DOWNLOAD,
OculusDownloaderErrorCodes.VERIFY_INTEGRITY_FAILED,
OculusDownloaderErrorCodes.DOWNLOAD_CANCELLED
];
autoDownloadFailed = true;
if(doNotRestartCodes.includes(err?.code)){
return true;
}
return false;
});
if(autoDownload){ return autoDownload; }
const {exitCode, data} = await this.modals.openModal(LoginToMetaModal)
if(exitCode !== ModalExitCode.COMPLETED){
return false
}
if(data.method === MetaAuthMethod.META){
return lastValueFrom(this.startDownloadBsVersion({ bsVersion, isVerification, stay: data.stay })).then(() => true);
}
const tokenRes = await this.modals.openModal(EnterMetaTokenModal);
if(tokenRes.exitCode !== ModalExitCode.COMPLETED){
return false;
}
return lastValueFrom(this.startDownloadBsVersion({ bsVersion, isVerification, token: tokenRes.data })).then(() => true);
})().then(res => {
console.log("aaa", res);
if(autoDownloadFailed || !res){
return bsVersion;
}
if(isVerification){
this.notifications.notifySuccess({title: "notifications.bs-download.success.titles.verification-finished"});
} else {
this.notifications.notifySuccess({title: "notifications.bs-download.success.titles.download-success"});
}
return bsVersion;
}).finally(() => this.progressBar.hide(true));
}
public downloadBsVersion(version: BSVersion): Promise<BSVersion> {
return this.doDownloadBsVersion(version, false);
}
public async verifyBsVersion(version: BSVersion): Promise<BSVersion> {
return this.doDownloadBsVersion(version, true);
}
public stopDownload(): Promise<void>{
return lastValueFrom(this.ipc.sendV2<void>("bs-oculus-stop-download"));
}
public hasAuthToken(): Promise<boolean>{
return lastValueFrom(this.ipc.sendV2<boolean>("bs-oculus-has-auth-token"));
}
public clearAuthToken(): Promise<void>{
return lastValueFrom(this.ipc.sendV2<void>("bs-oculus-clear-auth-token"));
}
}
@@ -1,71 +1,64 @@
import { DownloadInfo } from "main/services/bs-installer.service"; import { DownloadSteamInfo } from "main/services/bs-version-download/bs-steam-downloader.service";
import { BehaviorSubject, Observable, ReplaySubject, Subscription, lastValueFrom, throwError } from "rxjs"; import { BehaviorSubject, Observable, ReplaySubject, Subscription, lastValueFrom, throwError } from "rxjs";
import { distinctUntilChanged, filter, map, share, take, tap, throttleTime } from "rxjs/operators"; import { filter, map, share, take, tap, throttleTime } from "rxjs/operators";
import { BSVersion } from "shared/bs-version.interface"; import { BSVersion } from "shared/bs-version.interface";
import { AuthUserService } from "./auth-user.service"; import { IpcService } from "../ipc.service";
import { BSVersionManagerService } from "./bs-version-manager.service"; import { ModalExitCode, ModalService } from "../modale.service";
import { IpcService } from "./ipc.service"; import { NotificationService } from "../notification.service";
import { ModalExitCode, ModalService } from "./modale.service"; import { ProgressBarService } from "../progress-bar.service";
import { NotificationService } from "./notification.service"; import { LoginToSteamModal } from "renderer/components/modal/modal-types/bs-downgrade/login-to-steam-modal.component";
import { ProgressBarService } from "./progress-bar.service"; import { SteamGuardModal } from "renderer/components/modal/modal-types/bs-downgrade/steam-guard-modal.component";
import { LoginModal } from "renderer/components/modal/modal-types/login-modal.component"; import { LinkOpenerService } from "../link-opener.service";
import { GuardModal } from "renderer/components/modal/modal-types/guard-modal.component"; import { DepotDownloaderErrorEvent, DepotDownloaderEvent, DepotDownloaderEventType, DepotDownloaderInfoEvent, DepotDownloaderWarningEvent } from "../../../shared/models/bs-version-download/depot-downloader.model";
import { LinkOpenerService } from "./link-opener.service"; import { SteamMobileApproveModal } from "renderer/components/modal/modal-types/bs-downgrade/steam-mobile-approve-modal.component";
import { DepotDownloaderErrorEvent, DepotDownloaderEvent, DepotDownloaderEventType, DepotDownloaderInfoEvent, DepotDownloaderWarningEvent } from "../../shared/models/depot-downloader.model"; import { DownloaderServiceInterface } from "./bs-store-downloader.interface";
import equal from "fast-deep-equal"; import { AbstractBsDownloaderService } from "./abstract-bs-downloader.service";
import { SteamMobileApproveModal } from "renderer/components/modal/modal-types/steam-mobile-approve-modal.component";
export class BsDownloaderService { export class SteamDownloaderService extends AbstractBsDownloaderService implements DownloaderServiceInterface{
private static instance: BsDownloaderService;
private static instance: SteamDownloaderService;
public static getInstance(): SteamDownloaderService {
if (!SteamDownloaderService.instance) {
SteamDownloaderService.instance = new SteamDownloaderService();
}
return SteamDownloaderService.instance;
}
private readonly modalService: ModalService; private readonly modalService: ModalService;
private readonly ipcService: IpcService; private readonly ipcService: IpcService;
private readonly bsVersionManager: BSVersionManagerService;
private readonly authService: AuthUserService;
private readonly progressBarService: ProgressBarService; private readonly progressBarService: ProgressBarService;
private readonly notificationService: NotificationService; private readonly notificationService: NotificationService;
private readonly linkOpener: LinkOpenerService; private readonly linkOpener: LinkOpenerService;
private readonly isVerification$ = new BehaviorSubject(false); private readonly STEAM_SESSION_USERNAME_KEY = "STEAM-USERNAME";
public readonly currentBsVersionDownload$ = new BehaviorSubject<BSVersion>(null);
public readonly downloadProgress$ = new BehaviorSubject(0); public readonly downloadProgress$ = new BehaviorSubject(0);
public static getInstance(): BsDownloaderService {
if (!BsDownloaderService.instance) {
BsDownloaderService.instance = new BsDownloaderService();
}
return BsDownloaderService.instance;
}
private constructor() { private constructor() {
super();
this.ipcService = IpcService.getInstance(); this.ipcService = IpcService.getInstance();
this.modalService = ModalService.getInstance(); this.modalService = ModalService.getInstance();
this.bsVersionManager = BSVersionManagerService.getInstance();
this.authService = AuthUserService.getInstance();
this.progressBarService = ProgressBarService.getInstance(); this.progressBarService = ProgressBarService.getInstance();
this.notificationService = NotificationService.getInstance(); this.notificationService = NotificationService.getInstance();
this.linkOpener = LinkOpenerService.getInstance(); this.linkOpener = LinkOpenerService.getInstance();
this.currentBsVersionDownload$.pipe(distinctUntilChanged(equal)).subscribe(version => {
if(version) {
this.bsVersionManager.setInstalledVersions([...this.bsVersionManager.installedVersions$.value, version ]);
}
else {
this.bsVersionManager.askInstalledVersions();
}
});
} }
public isDotNet6Installed(): Promise<boolean> { public isDotNet6Installed(): Promise<boolean> {
return lastValueFrom(this.ipcService.sendV2<boolean>("is-dotnet-6-installed")); return lastValueFrom(this.ipcService.sendV2<boolean>("is-dotnet-6-installed"));
} }
private setSteamSession(username: string): void { localStorage.setItem(this.STEAM_SESSION_USERNAME_KEY, username); }
private getSteamUsername(): string { return localStorage.getItem(this.STEAM_SESSION_USERNAME_KEY); }
public deleteSteamSession(): void { localStorage.removeItem(this.STEAM_SESSION_USERNAME_KEY); }
public sessionExist(): boolean { return !!localStorage.getItem(this.STEAM_SESSION_USERNAME_KEY); }
private async showDotNetNotInstalledError(): Promise<void> { private async showDotNetNotInstalledError(): Promise<void> {
const choice = await this.notificationService.notifyError({ const choice = await this.notificationService.notifyError({
duration: 11_000, duration: 11_000,
title: "notifications.bs-download.errors.titles.dotnet-required", title: "notifications.bs-download.steam-download.errors.titles.dotnet-required",
desc: "notifications.bs-download.errors.msg.dotnet-required", desc: "notifications.bs-download.steam-download.errors.msg.dotnet-required",
actions: [{ id: "0", title: "notifications.bs-download.errors.actions.download-dotnet" }], actions: [{ id: "0", title: "notifications.bs-download.steam-download.errors.actions.download-dotnet" }],
}); });
if (choice === "0") { if (choice === "0") {
@@ -73,28 +66,14 @@ export class BsDownloaderService {
} }
} }
public get isDownloading(): boolean {
return !!this.currentBsVersionDownload$.value;
}
public async getInstallationFolder(): Promise<string> { public async getInstallationFolder(): Promise<string> {
return lastValueFrom(this.ipcService.sendV2<string>("bs-download.installation-folder")); return lastValueFrom(this.ipcService.sendV2<string>("bs-download.installation-folder"));
} }
public get isVerification(): boolean {
return this.isVerification$.value;
}
public setInstallationFolder(path: string): Observable<string> { public setInstallationFolder(path: string): Observable<string> {
return this.ipcService.sendV2<string>("bs-download.set-installation-folder", { args: path }); return this.ipcService.sendV2<string>("bs-download.set-installation-folder", { args: path });
} }
public async importVersion(pathToImport: string): Promise<boolean> {
return lastValueFrom(this.ipcService.sendV2<void>("bs-download.import-version", { args: pathToImport }))
.then(() => true)
.catch(() => false);
}
// ### Downloading // ### Downloading
private handleInfoEvents(events$: Observable<DepotDownloaderEvent>): Subscription[] { private handleInfoEvents(events$: Observable<DepotDownloaderEvent>): Subscription[] {
@@ -107,7 +86,7 @@ export class BsDownloaderService {
).subscribe(startData => { ).subscribe(startData => {
const downloadVersion = JSON.parse(startData) as BSVersion; const downloadVersion = JSON.parse(startData) as BSVersion;
if(typeof downloadVersion === "object" && downloadVersion?.BSVersion){ if(typeof downloadVersion === "object" && downloadVersion?.BSVersion){
this.currentBsVersionDownload$.next(downloadVersion); this._downloadingVersion$.next(downloadVersion);
} }
})); }));
@@ -134,7 +113,7 @@ export class BsDownloaderService {
take(1), take(1),
map(event => event.subType), map(event => event.subType),
).subscribe(async () => { ).subscribe(async () => {
const res = await this.modalService.openModal(GuardModal); const res = await this.modalService.openModal(SteamGuardModal);
if(res.exitCode !== ModalExitCode.COMPLETED){ if(res.exitCode !== ModalExitCode.COMPLETED){
return this.stopDownload(); return this.stopDownload();
} }
@@ -145,7 +124,7 @@ export class BsDownloaderService {
filter(event => event.subType === DepotDownloaderInfoEvent.Finished), filter(event => event.subType === DepotDownloaderInfoEvent.Finished),
take(1), take(1),
).subscribe(() => { ).subscribe(() => {
if(this.isVerification){ if(this.isVerifying){
return this.notificationService.notifySuccess({title: "notifications.bs-download.success.titles.verification-finished"}); return this.notificationService.notifySuccess({title: "notifications.bs-download.success.titles.verification-finished"});
} }
return this.notificationService.notifySuccess({title: "notifications.bs-download.success.titles.download-success"}); return this.notificationService.notifySuccess({title: "notifications.bs-download.success.titles.download-success"});
@@ -162,7 +141,7 @@ export class BsDownloaderService {
subs.push(events$.pipe( subs.push(events$.pipe(
filter(event => handledWarnings.includes(event.subType as DepotDownloaderWarningEvent)), filter(event => handledWarnings.includes(event.subType as DepotDownloaderWarningEvent)),
).subscribe(event => { ).subscribe(event => {
this.notificationService.notifyWarning({title: "notifications.types.warning", desc: `notifications.bs-download.warnings.msg.${event.subType}`}); this.notificationService.notifyWarning({title: "notifications.types.warning", desc: `notifications.bs-download.steam-download.warnings.msg.${event.subType}`});
})); }));
return subs; return subs;
@@ -172,10 +151,10 @@ export class BsDownloaderService {
const handledErrors = Object.values(DepotDownloaderErrorEvent); const handledErrors = Object.values(DepotDownloaderErrorEvent);
if(handledErrors.includes(errorEvent?.subType as DepotDownloaderErrorEvent)){ if(handledErrors.includes(errorEvent?.subType as DepotDownloaderErrorEvent)){
return this.notificationService.notifyError({title: "notifications.types.error", desc: `notifications.bs-download.errors.msg.${errorEvent.subType}`, duration: 10_000}); return this.notificationService.notifyError({title: "notifications.types.error", desc: `notifications.bs-download.steam-download.errors.msg.${errorEvent.subType}`, duration: 10_000});
} }
return this.notificationService.notifyError({title: "notifications.types.error", desc: `notifications.bs-download.errors.msg.${DepotDownloaderErrorEvent.Unknown}`, duration: 10_000}); return this.notificationService.notifyError({title: "notifications.types.error", desc: `notifications.bs-download.steam-download.errors.msg.${DepotDownloaderErrorEvent.Unknown}`, duration: 10_000});
} }
private wrapDownload(download$: Observable<DepotDownloaderEvent>, silent?: boolean): Observable<DepotDownloaderEvent> { private wrapDownload(download$: Observable<DepotDownloaderEvent>, silent?: boolean): Observable<DepotDownloaderEvent> {
@@ -197,7 +176,7 @@ export class BsDownloaderService {
}).pipe( }).pipe(
tap({ tap({
error: (e) => { error: (e) => {
this.authService.deleteSteamSession(); this.deleteSteamSession();
!silent && this.hanndleErrorEvent(e) !silent && this.hanndleErrorEvent(e)
} }
}), }),
@@ -206,26 +185,26 @@ export class BsDownloaderService {
} }
private tryAutoDownloadBsVersion(downloadInfo: DownloadInfo){ private tryAutoDownloadBsVersion(downloadInfo: DownloadSteamInfo){
if(!this.authService.sessionExist()){ if(!this.sessionExist()){
return throwError(() => new Error("No session")); return throwError(() => new Error("No session"));
} }
const infos: DownloadInfo = {...downloadInfo, username: this.authService.getSteamUsername()} const infos: DownloadSteamInfo = {...downloadInfo, username: this.getSteamUsername()}
return this.wrapDownload( return this.wrapDownload(
this.ipcService.sendV2<DepotDownloaderEvent>("auto-download-bs-version", { args: infos }), this.ipcService.sendV2<DepotDownloaderEvent>("auto-download-bs-version", { args: infos }),
true true
); );
} }
private startDownload(downloadInfo: DownloadInfo){ private startDownload(downloadInfo: DownloadSteamInfo){
return this.wrapDownload( return this.wrapDownload(
this.ipcService.sendV2<DepotDownloaderEvent>("download-bs-version", { args: downloadInfo }) this.ipcService.sendV2<DepotDownloaderEvent>("download-bs-version", { args: downloadInfo })
); );
} }
private startQrCodeDownload(downloadInfo: DownloadInfo){ private startQrCodeDownload(downloadInfo: DownloadSteamInfo){
return this.wrapDownload( return this.wrapDownload(
this.ipcService.sendV2<DepotDownloaderEvent>("download-bs-version-qr", { args: downloadInfo }) this.ipcService.sendV2<DepotDownloaderEvent>("download-bs-version-qr", { args: downloadInfo })
); );
@@ -238,7 +217,6 @@ export class BsDownloaderService {
} }
this.progressBarService.show(this.downloadProgress$, true); this.progressBarService.show(this.downloadProgress$, true);
this.isVerification$.next(isVerification);
const downloadPromise = (async () => { const downloadPromise = (async () => {
@@ -248,7 +226,7 @@ export class BsDownloaderService {
return Promise.reject(new Error("DotNet not installed")); return Promise.reject(new Error("DotNet not installed"));
} }
const downloadInfo: DownloadInfo = {bsVersion, isVerification} const downloadInfo: DownloadSteamInfo = {bsVersion, isVerification}
const autoDownload = await lastValueFrom(this.tryAutoDownloadBsVersion(downloadInfo)).then(() => true).catch(() => false); const autoDownload = await lastValueFrom(this.tryAutoDownloadBsVersion(downloadInfo)).then(() => true).catch(() => false);
@@ -258,14 +236,14 @@ export class BsDownloaderService {
const qrCode$ = qrCodeDownload$.pipe(filter(event => event.type === DepotDownloaderEventType.Info && event.subType === DepotDownloaderInfoEvent.QRCode), map(event => event.data as string)); const qrCode$ = qrCodeDownload$.pipe(filter(event => event.type === DepotDownloaderEventType.Info && event.subType === DepotDownloaderInfoEvent.QRCode), map(event => event.data as string));
const logged$ = qrCodeDownload$.pipe(filter(event => event.type === DepotDownloaderEventType.Info && event.subType === DepotDownloaderInfoEvent.SteamID), map(event => event.data as string), take(1)); const logged$ = qrCodeDownload$.pipe(filter(event => event.type === DepotDownloaderEventType.Info && event.subType === DepotDownloaderInfoEvent.SteamID), map(event => event.data as string), take(1));
const loginRes = await this.modalService.openModal(LoginModal, { qrCode$, logged$ }); const loginRes = await this.modalService.openModal(LoginToSteamModal, { qrCode$, logged$ });
if(loginRes.exitCode !== ModalExitCode.COMPLETED){ if(loginRes.exitCode !== ModalExitCode.COMPLETED){
return Promise.resolve(); return Promise.resolve();
} }
if(loginRes.data.stay){ if(loginRes.data.stay){
this.authService.setSteamSession(loginRes.data.username); this.setSteamSession(loginRes.data.username);
} }
const download$ = loginRes.data.method === "qr" ? qrCodeDownload$ : this.startDownload({...downloadInfo, username: loginRes.data.username, password: loginRes.data.password, stay: loginRes.data.stay}); const download$ = loginRes.data.method === "qr" ? qrCodeDownload$ : this.startDownload({...downloadInfo, username: loginRes.data.username, password: loginRes.data.password, stay: loginRes.data.stay});
@@ -278,10 +256,7 @@ export class BsDownloaderService {
return downloadPromise.then(() => {}).finally(() => { return downloadPromise.then(() => {}).finally(() => {
this.downloadProgress$.next(0); this.downloadProgress$.next(0);
this.currentBsVersionDownload$.next(null);
this.progressBarService.hide(true); this.progressBarService.hide(true);
this.isVerification$.next(false);
this.bsVersionManager.askAvailableVersions();
}); });
} }
@@ -294,10 +269,6 @@ export class BsDownloaderService {
return this.doDownloadBsVersion(version).then(() => version); return this.doDownloadBsVersion(version).then(() => version);
} }
public verifyBsVersionFiles(version: BSVersion): Promise<BSVersion> {
return this.doDownloadBsVersion(version, true).then(() => version);
}
public verifyBsVersion(version: BSVersion): Promise<BSVersion> { public verifyBsVersion(version: BSVersion): Promise<BSVersion> {
return this.doDownloadBsVersion(version, true).then(() => version); return this.doDownloadBsVersion(version, true).then(() => version);
} }
@@ -1,18 +1,23 @@
import { BSVersion } from "shared/bs-version.interface"; import { BSVersion } from "shared/bs-version.interface";
import { BehaviorSubject, Observable } from "rxjs"; import { BehaviorSubject, Observable, Subscription, lastValueFrom, map, shareReplay, throwError } from "rxjs";
import { IpcService } from "./ipc.service"; import { IpcService } from "./ipc.service";
import { ModalExitCode, ModalService } from "./modale.service"; import { ModalExitCode, ModalService } from "./modale.service";
import { NotificationService } from "./notification.service"; import { NotificationService } from "./notification.service";
import { ProgressBarService } from "./progress-bar.service"; import { ProgressBarService } from "./progress-bar.service";
import { EditVersionModal } from "renderer/components/modal/modal-types/edit-version-modal.component"; import { EditVersionModal } from "renderer/components/modal/modal-types/edit-version-modal.component";
import { popElement } from "shared/helpers/array.helpers";
import { ImportVersionModal } from "renderer/components/modal/modal-types/import-version-modal.component";
import { Progression } from "main/helpers/fs.helpers";
import { ImportVersionOptions } from "main/services/bs-local-version.service";
export class BSVersionManagerService { export class BSVersionManagerService {
private static instance: BSVersionManagerService; private static instance: BSVersionManagerService;
private readonly ipcService: IpcService; private readonly ipcService: IpcService;
private readonly modalService: ModalService; private readonly modalService: ModalService;
private readonly notificationService: NotificationService; private readonly notification: NotificationService;
private readonly progressBarService: ProgressBarService; private readonly progressBar: ProgressBarService;
private readonly modals: ModalService;
public readonly installedVersions$: BehaviorSubject<BSVersion[]> = new BehaviorSubject([]); public readonly installedVersions$: BehaviorSubject<BSVersion[]> = new BehaviorSubject([]);
public readonly availableVersions$: BehaviorSubject<BSVersion[]> = new BehaviorSubject([]); public readonly availableVersions$: BehaviorSubject<BSVersion[]> = new BehaviorSubject([]);
@@ -20,8 +25,9 @@ export class BSVersionManagerService {
private constructor() { private constructor() {
this.ipcService = IpcService.getInstance(); this.ipcService = IpcService.getInstance();
this.modalService = ModalService.getInstance(); this.modalService = ModalService.getInstance();
this.notificationService = NotificationService.getInstance(); this.notification = NotificationService.getInstance();
this.progressBarService = ProgressBarService.getInstance(); this.progressBar = ProgressBarService.getInstance();
this.modals = ModalService.getInstance();
this.askAvailableVersions().then(() => this.askInstalledVersions()); this.askAvailableVersions().then(() => this.askInstalledVersions());
} }
@@ -33,17 +39,8 @@ export class BSVersionManagerService {
} }
public setInstalledVersions(versions: BSVersion[]) { public setInstalledVersions(versions: BSVersion[]) {
const sorted: BSVersion[] = [...versions].sort((a, b) => +b.ReleaseDate - +a.ReleaseDate); const sorted = BSVersionManagerService.sortVersions(versions);
const steamIndex = sorted.findIndex(v => v.steam); this.installedVersions$.next(BSVersionManagerService.removeDuplicateVersions(sorted));
const oculusIndex = sorted.findIndex(v => v.oculus);
if (steamIndex > 0) {
[sorted[0], sorted[steamIndex]] = [sorted[steamIndex], sorted[0]];
}
if (oculusIndex > 0) {
[sorted[steamIndex > 0 ? 1 : 0], sorted[steamIndex]] = [sorted[steamIndex], sorted[steamIndex > 0 ? 1 : 0]];
}
const cleanedSort = [...new Map(sorted.map(version => [`${version.BSVersion}-${version.name}-${version.steam}-${version.oculus}`, version])).values()];
this.installedVersions$.next(cleanedSort);
} }
public getInstalledVersions(): BSVersion[] { public getInstalledVersions(): BSVersion[] {
@@ -78,7 +75,7 @@ export class BSVersionManagerService {
} }
return this.ipcService.send<BSVersion>("bs-version.edit", { args: { version, name: modalRes.data.name, color: modalRes.data.color } }).then(res => { return this.ipcService.send<BSVersion>("bs-version.edit", { args: { version, name: modalRes.data.name, color: modalRes.data.color } }).then(res => {
if (!res.success) { if (!res.success) {
this.notificationService.notifyError({ this.notification.notifyError({
title: `notifications.custom-version.errors.titles.${res.error.title}`, title: `notifications.custom-version.errors.titles.${res.error.title}`,
...(res.error.message && { desc: `notifications.custom-version.errors.msg.${res.error.message}` }), ...(res.error.message && { desc: `notifications.custom-version.errors.msg.${res.error.message}` }),
}); });
@@ -90,7 +87,7 @@ export class BSVersionManagerService {
} }
public async cloneVersion(version: BSVersion): Promise<BSVersion> { public async cloneVersion(version: BSVersion): Promise<BSVersion> {
if (!this.progressBarService.require()) { if (!this.progressBar.require()) {
return null; return null;
} }
const modalRes = await this.modalService.openModal(EditVersionModal, { version, clone: true }); const modalRes = await this.modalService.openModal(EditVersionModal, { version, clone: true });
@@ -100,23 +97,102 @@ export class BSVersionManagerService {
if (modalRes.data.name?.length < 2) { if (modalRes.data.name?.length < 2) {
return null; return null;
} }
this.progressBarService.showFake(0.01); this.progressBar.showFake(0.01);
return this.ipcService.send<BSVersion>("bs-version.clone", { args: { version, name: modalRes.data.name, color: modalRes.data.color } }).then(res => { return this.ipcService.send<BSVersion>("bs-version.clone", { args: { version, name: modalRes.data.name, color: modalRes.data.color } }).then(res => {
this.progressBarService.hide(true); this.progressBar.hide(true);
if (!res.success) { if (!res.success) {
this.notificationService.notifyError({ this.notification.notifyError({
title: `notifications.custom-version.errors.titles.${res.error.title}`, title: `notifications.custom-version.errors.titles.${res.error.title}`,
...(res.error.message && { desc: `notifications.custom-version.errors.msg.${res.error.message}` }), ...(res.error.message && { desc: `notifications.custom-version.errors.msg.${res.error.message}` }),
}); });
return null; return null;
} }
this.notificationService.notifySuccess({ title: "notifications.custom-version.success.titles.CloningFinished" }); this.notification.notifySuccess({ title: "notifications.custom-version.success.titles.CloningFinished" });
this.askInstalledVersions(); this.askInstalledVersions();
return res.data; return res.data;
}); });
} }
public importVersion(): Observable<Progression<BSVersion>> {
if(!this.progressBar.require()){
return throwError(() => new Error("Action already in progress"));
}
const obs$ = new Observable<Progression<BSVersion>>(obs => {
const subs: Subscription[] = [];
(async () => {
const resModal = await this.modals.openModal(ImportVersionModal);
if(resModal.exitCode !== ModalExitCode.COMPLETED){
return;
}
const store = resModal.data;
const folderRes = await lastValueFrom(this.ipcService.sendV2<{ canceled: boolean; filePaths: string[] }>("choose-folder"));
if(!folderRes || folderRes.canceled || !folderRes.filePaths?.length){
return;
}
const import$ = this.ipcService.sendV2<Progression<BSVersion>, ImportVersionOptions>("import-version", { args: {fromPath: folderRes.filePaths.at(0), store} });
subs.push(import$.subscribe(obs));
await lastValueFrom(import$);
this.notification.notifySuccess({ title: "notifications.bs-import-version.success.imported.title", duration: 3_000 });
})().then(() => {
obs.complete()
}).catch(err => {
this.notification.notifyError({ title: "notifications.types.error", desc: "notifications.bs-import-version.errors.import-error.desc" });
obs.error(err)
}).finally(() => {
this.askInstalledVersions();
this.progressBar.hide(true);
});
return () => {
subs.forEach(sub => sub.unsubscribe());
}
}).pipe(
shareReplay({ bufferSize: 1, refCount: true })
);
this.progressBar.show(obs$.pipe(map(progress => (progress.current / progress.total) * 100)), true);
return obs$;
}
public getVersionPath(version: BSVersion): Observable<string> { public getVersionPath(version: BSVersion): Observable<string> {
return this.ipcService.sendV2("get-version-full-path", { args: version }); return this.ipcService.sendV2("get-version-full-path", { args: version });
} }
public static sortVersions(versions: BSVersion[]): BSVersion[] {
const steamVersion = popElement(v => v.steam, versions);
const oculusVersion = popElement(v => v.oculus, versions);
const compare = (a: BSVersion, b: BSVersion) => ( +b.ReleaseDate - +a.ReleaseDate )
const sorted: BSVersion[] = versions.sort(compare);
sorted.unshift(...[steamVersion, oculusVersion].filter(Boolean).sort(compare));
return sorted;
}
public static removeDuplicateVersions(versions: BSVersion[]): BSVersion[] {
return Array.from(new Map(versions.map(version => ([
JSON.stringify([
version.BSVersion,
version.BSManifest,
version.name,
version.steam,
version.oculus
]),
version
]))).values());
}
} }

Some files were not shown because too many files have changed in this diff Show More