mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-14 08:04:52 +01:00
Compare commits
21 Commits
v1.0.6-alp
...
v1.0.8-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a84825cf9 | ||
|
|
4de8a43c3a | ||
|
|
d28e0a1bc8 | ||
|
|
bf8de40caa | ||
|
|
8e7d6ee420 | ||
|
|
d6e9bb100b | ||
|
|
374c6abbfc | ||
|
|
a728e8ba2c | ||
|
|
4371804429 | ||
|
|
fa38a22117 | ||
|
|
a7914406b4 | ||
|
|
57c1a7800c | ||
|
|
9426937a62 | ||
|
|
96d69d9ff6 | ||
|
|
defc1b43bd | ||
|
|
569c465a50 | ||
|
|
8a5e66be48 | ||
|
|
e633f7dad7 | ||
|
|
bffd089192 | ||
|
|
bf3d892af5 | ||
|
|
424dd4ff1c |
@@ -1,3 +1,5 @@
|
|||||||
|
EN | [简中](README_zh-CN.md) | [繁中](README_zh-TW.md) |
|
||||||
|
|
||||||
# Client Patching Notice
|
# Client Patching Notice
|
||||||
|
|
||||||
For game versions 2.8 and above, Cultivation automatically makes a small patch to your game client when launching using Grasscutter, and restores it upon closing the game. In theory, you should still be totally safe, however it would be dishonest to not explicitly state that **modifying the game client could, theoretically, lead to a ban if you connect to official servers with it**. It is extremely unlikely AND there are no instances known of it happening, but the possibility exists.
|
For game versions 2.8 and above, Cultivation automatically makes a small patch to your game client when launching using Grasscutter, and restores it upon closing the game. In theory, you should still be totally safe, however it would be dishonest to not explicitly state that **modifying the game client could, theoretically, lead to a ban if you connect to official servers with it**. It is extremely unlikely AND there are no instances known of it happening, but the possibility exists.
|
||||||
|
|||||||
88
README_zh-CN.md
Normal file
88
README_zh-CN.md
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
[EN](README.md) | 简中 | [繁中](README_zh-TW.md)
|
||||||
|
|
||||||
|
# 客户端修补通知
|
||||||
|
|
||||||
|
对于游戏版本为 2.8 及以上时,使用 Grasscutter 启动时,Cultivation 会自动为您的游戏客户端制作一个小补丁,并在关闭游戏时恢复它。 从理论上讲,你应该是完全安全的,但是不明确**如果您使用它连接到官方服务器,修改游戏客户端可能会导致封号**,但可能性是非常小的,并且从未接到发生过此类情况的问题,但存在这种可能性!
|
||||||
|
|
||||||
|
# Cultivation
|
||||||
|
|
||||||
|
一个游戏启动器,旨在轻松将某动漫游戏的流量代理到私人服务器。
|
||||||
|
|
||||||
|
虽然此存储库是**开放的**。 但这**并不**意味着它已经发布。
|
||||||
|
请不要**安装、下载或使用在其他地方找到的预编译版本的 Cultivation**。 仅使用此 GitHub 存储库中的版本。
|
||||||
|
|
||||||
|
# 目录
|
||||||
|
|
||||||
|
- [下载](#下载)
|
||||||
|
- [开发人员快速入门](#开发人员快速入门)
|
||||||
|
- [安装](#安装)
|
||||||
|
- [编译](#编译)
|
||||||
|
- [代码格式化与纠错](#代码格式化与纠错)
|
||||||
|
- [生成更新项目](#生成更新项目)
|
||||||
|
- [启动器主题](#启动器主题)
|
||||||
|
- [画面](#画面)
|
||||||
|
- [成员](#成员)
|
||||||
|
|
||||||
|
# 下载
|
||||||
|
|
||||||
|
[在此处查找发布版本!](https://github.com/Grasscutters/Cultivation/releases)
|
||||||
|
|
||||||
|
下载后,从某个位置解压缩并以管理员身份打开。
|
||||||
|
|
||||||
|
# 开发人员快速入门
|
||||||
|
|
||||||
|
### 安装
|
||||||
|
|
||||||
|
- 安装 [NodeJS >12](https://nodejs.org/en/)
|
||||||
|
- 安装 [yarn](https://classic.yarnpkg.com/lang/en/docs/install)
|
||||||
|
- 安装 [Rust](https://www.rust-lang.org/tools/install)
|
||||||
|
- `yarn install`
|
||||||
|
- `yarn start:dev`
|
||||||
|
|
||||||
|
### 编译
|
||||||
|
|
||||||
|
发布版本,
|
||||||
|
|
||||||
|
- `yarn build`
|
||||||
|
|
||||||
|
调试版本,
|
||||||
|
|
||||||
|
- `yarn build --debug`
|
||||||
|
|
||||||
|
### 代码格式化与纠错
|
||||||
|
|
||||||
|
格式化:
|
||||||
|
|
||||||
|
- `yarn format`
|
||||||
|
|
||||||
|
纠错, 修复(一些)错误:
|
||||||
|
|
||||||
|
- `yarn lint`, `yarn lint:fix`
|
||||||
|
|
||||||
|
### 生成更新项目
|
||||||
|
|
||||||
|
- 将 `TAURI_PRIVATE_KEY` 添加到环境变量,其中包含私钥的路径。
|
||||||
|
- 将 `TAURI_KEY_PASSWORD` 添加到环境变量,其中包含私钥的密码。
|
||||||
|
- `yarn build`
|
||||||
|
|
||||||
|
更新将生成在 `src-tauri/target/(release|debug)/msi/Cultivation_X.X.X_x64_xx-XX.msi.zip`
|
||||||
|
|
||||||
|
# 启动器主题
|
||||||
|
|
||||||
|
完整的主题参考可以[在这里找到!](/THEMES.md)
|
||||||
|
|
||||||
|
# 画面
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
## 成员
|
||||||
|
|
||||||
|
- [SpikeHD](https://github.com/SpikeHD): For originally creating **GrassClipper** and creating the amazing UI of Cultivation.
|
||||||
|
- [KingRainbow44](https://github.com/KingRainbow44): For building a proxy daemon from scratch and integrating it with Cultivation.
|
||||||
|
- [Benj](https://github.com/4Benj): For assistance in client patching.
|
||||||
|
- [lilmayofuksu](https://github.com/lilmayofuksu): For assistance in client patching.
|
||||||
|
- [Tauri](https://tauri.app): For providing an amazing, efficient, and simple desktop application framework/library.
|
||||||
88
README_zh-TW.md
Normal file
88
README_zh-TW.md
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
[EN](README.md) | [简中](README_zh-CN.md) | 繁中
|
||||||
|
|
||||||
|
# 客戶端修補通知
|
||||||
|
|
||||||
|
對於遊戲版本為 2.8 及以上時,使用 Grasscutter 啟動時,Cultivation 會自動為您的遊戲客戶端製作一個小修補,並在關閉遊戲時恢復它。 從理論上講,你應該是完全安全的,但是不明確**如果您使用它連接到官方伺服器,修改遊戲客戶端可能會導致封號**,但可能性是非常小的,並且從未接到發生過此類情況的問題,但存在這種可能性!
|
||||||
|
|
||||||
|
# Cultivation
|
||||||
|
|
||||||
|
一個遊戲啟動器,旨在輕松將某動漫遊戲的流量代理到私人伺服器。
|
||||||
|
|
||||||
|
雖然此存儲庫是**開放的**。 但這**並不**意味著它已經發布。
|
||||||
|
請不要**安裝、下載或使用在其他地方找到的預編譯版本的 Cultivation**。 僅使用此 GitHub 存儲庫中的版本。
|
||||||
|
|
||||||
|
# 目錄
|
||||||
|
|
||||||
|
- [下載](#下載)
|
||||||
|
- [開發人員快速入門](#開發人員快速入門)
|
||||||
|
- [安裝](#安裝)
|
||||||
|
- [編譯](#編譯)
|
||||||
|
- [代碼格式化與糾錯](#代碼格式化與糾錯)
|
||||||
|
- [生成更新項目](#生成更新項目)
|
||||||
|
- [啟動器主題](#啟動器主題)
|
||||||
|
- [畫面](#畫面)
|
||||||
|
- [成員](#成員)
|
||||||
|
|
||||||
|
# 下載
|
||||||
|
|
||||||
|
[在此處查找發布版本!](https://github.com/Grasscutters/Cultivation/releases)
|
||||||
|
|
||||||
|
下載後,從某個位置解壓縮並以管理員身份打開。
|
||||||
|
|
||||||
|
# 開發人員快速入門
|
||||||
|
|
||||||
|
### 安裝
|
||||||
|
|
||||||
|
- 安裝 [NodeJS >12](https://nodejs.org/en/)
|
||||||
|
- 安裝 [yarn](https://classic.yarnpkg.com/lang/en/docs/install) (`npm`愛好者去哭吧!(滑稽))
|
||||||
|
- 安裝 [Rust](https://www.rust-lang.org/tools/install)
|
||||||
|
- `yarn install`
|
||||||
|
- `yarn start:dev`
|
||||||
|
|
||||||
|
### 編譯
|
||||||
|
|
||||||
|
發布版本,
|
||||||
|
|
||||||
|
- `yarn build`
|
||||||
|
|
||||||
|
調試版本,
|
||||||
|
|
||||||
|
- `yarn build --debug`
|
||||||
|
|
||||||
|
### 代碼格式化與糾錯
|
||||||
|
|
||||||
|
格式化:
|
||||||
|
|
||||||
|
- `yarn format`
|
||||||
|
|
||||||
|
糾錯, 修復(一些)錯誤:
|
||||||
|
|
||||||
|
- `yarn lint`, `yarn lint:fix`
|
||||||
|
|
||||||
|
### 生成更新項目
|
||||||
|
|
||||||
|
- 將 `TAURI_PRIVATE_KEY` 添加到環境變數,其中包含私鑰的路徑。
|
||||||
|
- 將 `TAURI_KEY_PASSWORD` 添加到環境變數,其中包含私鑰的密碼。
|
||||||
|
- `yarn build`
|
||||||
|
|
||||||
|
更新將生成在 `src-tauri/target/(release|debug)/msi/Cultivation_X.X.X_x64_xx-XX.msi.zip`
|
||||||
|
|
||||||
|
# 啟動器主題
|
||||||
|
|
||||||
|
完整的主題參考可以[在這裏找到!](/THEMES.md)
|
||||||
|
|
||||||
|
# 畫面
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
## 成員
|
||||||
|
|
||||||
|
- [SpikeHD](https://github.com/SpikeHD): For originally creating **GrassClipper** and creating the amazing UI of Cultivation.
|
||||||
|
- [KingRainbow44](https://github.com/KingRainbow44): For building a proxy daemon from scratch and integrating it with Cultivation.
|
||||||
|
- [Benj](https://github.com/4Benj): For assistance in client patching.
|
||||||
|
- [lilmayofuksu](https://github.com/lilmayofuksu): For assistance in client patching.
|
||||||
|
- [Tauri](https://tauri.app): For providing an amazing, efficient, and simple desktop application framework/library.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cultivation",
|
"name": "cultivation",
|
||||||
"version": "1.0.6",
|
"version": "1.0.8",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "^1.0.0-rc.5",
|
"@tauri-apps/api": "^1.0.0-rc.5",
|
||||||
|
|||||||
68
src-tauri/Cargo.lock
generated
68
src-tauri/Cargo.lock
generated
@@ -26,6 +26,17 @@ dependencies = [
|
|||||||
"opaque-debug",
|
"opaque-debug",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ahash"
|
||||||
|
version = "0.7.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47"
|
||||||
|
dependencies = [
|
||||||
|
"getrandom 0.2.7",
|
||||||
|
"once_cell",
|
||||||
|
"version_check",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "aho-corasick"
|
name = "aho-corasick"
|
||||||
version = "0.7.18"
|
version = "0.7.18"
|
||||||
@@ -702,6 +713,16 @@ dependencies = [
|
|||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ctrlc"
|
||||||
|
version = "3.2.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1d91974fbbe88ec1df0c24a4f00f99583667a7e2e6272b2b92d294d81e462173"
|
||||||
|
dependencies = [
|
||||||
|
"nix",
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cty"
|
name = "cty"
|
||||||
version = "0.2.2"
|
version = "0.2.2"
|
||||||
@@ -713,6 +734,7 @@ name = "cultivation"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
|
"ctrlc",
|
||||||
"duct",
|
"duct",
|
||||||
"file_diff",
|
"file_diff",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
@@ -725,6 +747,7 @@ dependencies = [
|
|||||||
"regex",
|
"regex",
|
||||||
"registry",
|
"registry",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
|
"rust-ini",
|
||||||
"rustls-pemfile",
|
"rustls-pemfile",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
@@ -888,6 +911,12 @@ dependencies = [
|
|||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "dlv-list"
|
||||||
|
version = "0.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0688c2a7f92e427f44895cd63841bff7b29f8d7a1648b9e7e07a4a365b2e1257"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dtoa"
|
name = "dtoa"
|
||||||
version = "0.4.8"
|
version = "0.4.8"
|
||||||
@@ -1481,6 +1510,9 @@ name = "hashbrown"
|
|||||||
version = "0.12.3"
|
version = "0.12.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
|
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
|
||||||
|
dependencies = [
|
||||||
|
"ahash",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "heck"
|
name = "heck"
|
||||||
@@ -1889,9 +1921,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.126"
|
version = "0.2.132"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836"
|
checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libdbus-sys"
|
name = "libdbus-sys"
|
||||||
@@ -2151,6 +2183,18 @@ version = "1.0.4"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54"
|
checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nix"
|
||||||
|
version = "0.25.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e322c04a9e3440c327fca7b6c8a63e6890a32fa2ad689db972425f07e0d22abb"
|
||||||
|
dependencies = [
|
||||||
|
"autocfg",
|
||||||
|
"bitflags",
|
||||||
|
"cfg-if 1.0.0",
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nodrop"
|
name = "nodrop"
|
||||||
version = "0.1.14"
|
version = "0.1.14"
|
||||||
@@ -2451,6 +2495,16 @@ dependencies = [
|
|||||||
"vcpkg",
|
"vcpkg",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ordered-multimap"
|
||||||
|
version = "0.4.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ccd746e37177e1711c20dd619a1620f34f5c8b569c53590a72dedd5344d8924a"
|
||||||
|
dependencies = [
|
||||||
|
"dlv-list",
|
||||||
|
"hashbrown",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "os_info"
|
name = "os_info"
|
||||||
version = "3.4.0"
|
version = "3.4.0"
|
||||||
@@ -3223,6 +3277,16 @@ dependencies = [
|
|||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rust-ini"
|
||||||
|
version = "0.18.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f6d5f2436026b4f6e79dc829837d467cc7e9a55ee40e750d716713540715a2df"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if 1.0.0",
|
||||||
|
"ordered-multimap",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustc-serialize"
|
name = "rustc-serialize"
|
||||||
version = "0.3.24"
|
version = "0.3.24"
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ regex = "1"
|
|||||||
|
|
||||||
# other
|
# other
|
||||||
file_diff = "1.0.0"
|
file_diff = "1.0.0"
|
||||||
|
rust-ini = "0.18.0"
|
||||||
|
ctrlc = "3.2.3"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
# by default Tauri runs in production mode
|
# by default Tauri runs in production mode
|
||||||
|
|||||||
@@ -25,7 +25,8 @@
|
|||||||
"background": "Set Custom Background (link or image file)",
|
"background": "Set Custom Background (link or image file)",
|
||||||
"theme": "Set Theme",
|
"theme": "Set Theme",
|
||||||
"patch_metadata": "Automatically Patch Metadata",
|
"patch_metadata": "Automatically Patch Metadata",
|
||||||
"use_proxy": "Use Internal Proxy"
|
"use_proxy": "Use Internal Proxy",
|
||||||
|
"wipe_login": "Wipe Login Cache"
|
||||||
},
|
},
|
||||||
"downloads": {
|
"downloads": {
|
||||||
"grasscutter_stable_data": "Download Grasscutter Stable Data",
|
"grasscutter_stable_data": "Download Grasscutter Stable Data",
|
||||||
|
|||||||
80
src-tauri/lang/nl.json
Normal file
80
src-tauri/lang/nl.json
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
{
|
||||||
|
"lang_name": "Nederlands",
|
||||||
|
"main": {
|
||||||
|
"title": "Cultivation",
|
||||||
|
"launch_button": "Start",
|
||||||
|
"gc_enable": "Verbind Met Grasscutter",
|
||||||
|
"https_enable": "Gebruik HTTPS",
|
||||||
|
"ip_placeholder": "Server Address...",
|
||||||
|
"port_placeholder": "Poort...",
|
||||||
|
"files_downloading": "Bestanden Aan Downloaden: ",
|
||||||
|
"files_extracting": "Bestanden Uitpakken: "
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"enabled": "Ingeschakeld",
|
||||||
|
"disabled": "Uitgeschakeld",
|
||||||
|
"game_path": "Spel Installatie Pad Instellen",
|
||||||
|
"game_executable": "Stel De Exe Van Het Spel In",
|
||||||
|
"recover_metadata": "Noodherstel Van De Metadata",
|
||||||
|
"grasscutter_jar": "Stel De Grasscutter JAR In",
|
||||||
|
"toggle_encryption": "Versleuteling Inschakelen",
|
||||||
|
"install_certificate": "Proxy-certificaat installeren",
|
||||||
|
"java_path": "Aangepast Java-pad Instellen",
|
||||||
|
"grasscutter_with_game": "Start Automatisch Grasscutter Met Spel",
|
||||||
|
"language": "Selecteer Taal",
|
||||||
|
"background": "Aangepaste Achtergrond Instellen (link of afbeeldingsbestand)",
|
||||||
|
"theme": "Thema instellen",
|
||||||
|
"patch_metadata": "Metadata Automatisch Bijwerken",
|
||||||
|
"use_proxy": "Gebruik Interne Proxy"
|
||||||
|
},
|
||||||
|
"downloads": {
|
||||||
|
"grasscutter_stable_data": "Download Stabiele Gegevens Van Grasscutter",
|
||||||
|
"grasscutter_latest_data": "Download De Nieuwste Gegevens Van Grasscutter",
|
||||||
|
"grasscutter_stable_data_update": "Stabiele gegevens Van Grasscutter bijwerken",
|
||||||
|
"grasscutter_latest_data_update": "Nieuwste gegevens Van Grasscutter bijwerken",
|
||||||
|
"grasscutter_stable": "Download Stabiele Versie Van Grasscutter",
|
||||||
|
"grasscutter_latest": "Download De Nieuwste Versie Van Grasscutter",
|
||||||
|
"grasscutter_stable_update": "Update Grasscutter Naar De Stabiele Versie",
|
||||||
|
"grasscutter_latest_update": "Update Grasscutter Naar De Nieuwste Versie",
|
||||||
|
"resources": "Download Grasscutter bronnen",
|
||||||
|
"game": "Download Spel"
|
||||||
|
},
|
||||||
|
"download_status": {
|
||||||
|
"downloading": "Aan Het Downloading",
|
||||||
|
"extracting": "Uitpakken",
|
||||||
|
"error": "Fout",
|
||||||
|
"finished": "Voltooid",
|
||||||
|
"stopped": "Gestopt"
|
||||||
|
},
|
||||||
|
"components": {
|
||||||
|
"select_file": "Select file or folder...",
|
||||||
|
"select_folder": "Select folder...",
|
||||||
|
"download": "Download",
|
||||||
|
"install": "Install"
|
||||||
|
},
|
||||||
|
"news": {
|
||||||
|
"latest_commits": "Recente Opdrachten",
|
||||||
|
"latest_version": "Nieuwste Versie"
|
||||||
|
},
|
||||||
|
"help": {
|
||||||
|
"port_help_text": "Zorg ervoor dat dit de Dispatch server poort is, niet de Game server poort. Dit is bijna altijd '443'.",
|
||||||
|
"game_help_text": "U hoeft geen aparte kopie te gebruiken om met Grasscutter te spelen. Dit is voor downgraden naar 2.6 of als u het spel niet geinstalleerd heeft.",
|
||||||
|
"gc_stable_jar": "Download de huidige stabiele Grasscutter build, die jar file en data bestanden bevat.",
|
||||||
|
"gc_dev_jar": "Download de laatste ontwikkeling Grasscutter build, die jar file en data bestanden bevat.",
|
||||||
|
"gc_stable_data": "Download de huidige stabiele versie van de Grasscutter data bestanden, die niet met een jar file komen. Dit is handig voor het bijwerken.",
|
||||||
|
"gc_dev_data": "Download de nieuwste versie van de Grasscutter data bestanden, die niet met een jar file komen. Dit is handig voor het bijwerken.",
|
||||||
|
"encryption": "Dit wordt meestal uitgeschakeld.",
|
||||||
|
"resources": "Deze zijn ook nodig om een Grasscutter server te draaien. Deze knop zal grijs zijn als u een bestaande resources map heeft met inhoud erin",
|
||||||
|
"emergency_metadata": "Voor het geval er iets fout is gegaan, herstel uw metadata naar de laatste offici<63>le versies metadata.",
|
||||||
|
"use_proxy": "Gebruik de Cultivation interne proxy. U zou dit ingeschakeld moeten hebben, tenzij u iets als Fiddler gebruikt",
|
||||||
|
"patch_metadata": "Patch en unpatch je spel metadata automatisch. Tenzij je met oude/niet-offici<63>le versies speelt, of je hebt je metadata handmatig gepatcht, zou dit ingeschakeld moeten zijn."
|
||||||
|
},
|
||||||
|
"swag": {
|
||||||
|
"akebi_name": "Akebi",
|
||||||
|
"migoto_name": "Migoto",
|
||||||
|
"reshade_name": "Reshade",
|
||||||
|
"akebi": "Stel Akebi Exe Bestand In",
|
||||||
|
"migoto": "Stel 3DMigoto Exe Bestand In",
|
||||||
|
"reshade": "Stel Reshade Injector In"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
"language": "Установить язык",
|
"language": "Установить язык",
|
||||||
"background": "Установить свой фон (ссылка или файл)",
|
"background": "Установить свой фон (ссылка или файл)",
|
||||||
"theme": "Установить тему",
|
"theme": "Установить тему",
|
||||||
"patch_metadata": "Автоматический патч Метаданных при запуске",
|
"patch_metadata": "Автоматический патч Метаданных при запуске",
|
||||||
"use_proxy": "Использовать встроенный Прокси"
|
"use_proxy": "Использовать встроенный Прокси"
|
||||||
},
|
},
|
||||||
"downloads": {
|
"downloads": {
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
"grasscutter_stable_update": "Обновить стабильную версию Grasscutter",
|
"grasscutter_stable_update": "Обновить стабильную версию Grasscutter",
|
||||||
"grasscutter_latest_update": "Обновить последнюю версию Grasscutter",
|
"grasscutter_latest_update": "Обновить последнюю версию Grasscutter",
|
||||||
"resources": "Скачать ресурсы Grasscutter",
|
"resources": "Скачать ресурсы Grasscutter",
|
||||||
"game": "Скачать Игру"
|
"game": "Скачать Игру"
|
||||||
},
|
},
|
||||||
"download_status": {
|
"download_status": {
|
||||||
"downloading": "Скачивание",
|
"downloading": "Скачивание",
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
"select_file": "Выберите файл или папку...",
|
"select_file": "Выберите файл или папку...",
|
||||||
"select_folder": "Выберите папку...",
|
"select_folder": "Выберите папку...",
|
||||||
"download": "Скачать",
|
"download": "Скачать",
|
||||||
"install": "Установить"
|
"install": "Установить"
|
||||||
},
|
},
|
||||||
"news": {
|
"news": {
|
||||||
"latest_commits": "Последние коммиты",
|
"latest_commits": "Последние коммиты",
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
"gc_dev_data": "Скачать последнюю версию для разработки Grasscutter, в которой нету jar файла. Это полезно для обновления.",
|
"gc_dev_data": "Скачать последнюю версию для разработки Grasscutter, в которой нету jar файла. Это полезно для обновления.",
|
||||||
"encryption": "Обычно это должно быть выключено.",
|
"encryption": "Обычно это должно быть выключено.",
|
||||||
"resources": "Это необходимо для запуска сервера Grasscutter. Эта кнопка будет серой, если у Вас уже есть не пустая папка с ресурсами.",
|
"resources": "Это необходимо для запуска сервера Grasscutter. Эта кнопка будет серой, если у Вас уже есть не пустая папка с ресурсами.",
|
||||||
"emergency_metadata": "Если что-то пошло не так, восстановит Метаданные до последней официальной версии.",
|
"emergency_metadata": "Если что-то пошло не так, восстановит Метаданные до последней официальной версии.",
|
||||||
"use_proxy": "Использовать встроенный Прокси. Отключите если используете Fiddler или подобную программу",
|
"use_proxy": "Использовать встроенный Прокси. Отключите если используете Fiddler или подобную программу",
|
||||||
"patch_metadata": "Патчит и восстанавливает Метаданные автоматически. Если вы не играете на старых/модифицированых версиях, или сами в ручную патчите Метаданные, эта опция должна быть включена."
|
"patch_metadata": "Патчит и восстанавливает Метаданные автоматически. Если вы не играете на старых/модифицированых версиях, или сами в ручную патчите Метаданные, эта опция должна быть включена."
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ pub async fn get_download_links(mod_id: String) -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub async fn list_submissions(mode: String) -> String {
|
pub async fn list_submissions(mode: String, page: String) -> String {
|
||||||
let res = web::query(
|
let res = web::query(
|
||||||
format!(
|
format!(
|
||||||
"{}/apiv9/Util/Game/Submissions?_idGameRow=8552&_nPage=1&_nPerpage=50&_sMode={}",
|
"{}/apiv9/Util/Game/Submissions?_idGameRow=8552&_nPage={}&_nPerpage=50&_sMode={}",
|
||||||
SITE_URL, mode
|
SITE_URL, page, mode
|
||||||
)
|
)
|
||||||
.as_str(),
|
.as_str(),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,7 +4,9 @@
|
|||||||
)]
|
)]
|
||||||
|
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
|
use std::io::Write;
|
||||||
use std::{collections::HashMap, sync::Mutex};
|
use std::{collections::HashMap, sync::Mutex};
|
||||||
|
use tauri::async_runtime::block_on;
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use structs::APIQuery;
|
use structs::APIQuery;
|
||||||
@@ -23,55 +25,94 @@ mod web;
|
|||||||
|
|
||||||
static WATCH_GAME_PROCESS: Lazy<Mutex<String>> = Lazy::new(|| Mutex::new(String::new()));
|
static WATCH_GAME_PROCESS: Lazy<Mutex<String>> = Lazy::new(|| Mutex::new(String::new()));
|
||||||
|
|
||||||
|
fn try_flush() {
|
||||||
|
std::io::stdout().flush().unwrap_or(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn has_arg(args: &Vec<String>, arg: &str) -> bool {
|
||||||
|
args.contains(&arg.to_string())
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn arg_handler(args: &Vec<String>) {
|
||||||
|
if has_arg(args, "--proxy") {
|
||||||
|
let mut pathbuf = tauri::api::path::data_dir().unwrap();
|
||||||
|
pathbuf.push("cultivation");
|
||||||
|
pathbuf.push("ca");
|
||||||
|
|
||||||
|
connect(8035, pathbuf.to_str().unwrap().to_string()).await;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// Always set CWD to the location of the executable.
|
// Always set CWD to the location of the executable.
|
||||||
let mut exe_path = std::env::current_exe().unwrap();
|
let mut exe_path = std::env::current_exe().unwrap();
|
||||||
exe_path.pop();
|
exe_path.pop();
|
||||||
std::env::set_current_dir(&exe_path).unwrap();
|
std::env::set_current_dir(&exe_path).unwrap();
|
||||||
|
|
||||||
tauri::Builder::default()
|
let args: Vec<String> = std::env::args().collect();
|
||||||
.invoke_handler(tauri::generate_handler![
|
|
||||||
enable_process_watcher,
|
block_on(arg_handler(&args));
|
||||||
connect,
|
|
||||||
disconnect,
|
// For disabled GUI
|
||||||
req_get,
|
ctrlc::set_handler(|| {
|
||||||
get_bg_file,
|
std::process::exit(0);
|
||||||
is_game_running,
|
})
|
||||||
get_theme_list,
|
.unwrap_or(());
|
||||||
system_helpers::run_command,
|
|
||||||
system_helpers::run_program,
|
if !has_arg(&args, "--no-gui") {
|
||||||
system_helpers::run_program_relative,
|
tauri::Builder::default()
|
||||||
system_helpers::run_jar,
|
.invoke_handler(tauri::generate_handler![
|
||||||
system_helpers::open_in_browser,
|
enable_process_watcher,
|
||||||
system_helpers::install_location,
|
connect,
|
||||||
system_helpers::is_elevated,
|
disconnect,
|
||||||
proxy::set_proxy_addr,
|
req_get,
|
||||||
proxy::generate_ca_files,
|
get_bg_file,
|
||||||
unzip::unzip,
|
is_game_running,
|
||||||
file_helpers::rename,
|
get_theme_list,
|
||||||
file_helpers::dir_create,
|
system_helpers::run_command,
|
||||||
file_helpers::dir_exists,
|
system_helpers::run_program,
|
||||||
file_helpers::dir_is_empty,
|
system_helpers::run_program_relative,
|
||||||
file_helpers::dir_delete,
|
system_helpers::run_jar,
|
||||||
file_helpers::copy_file,
|
system_helpers::open_in_browser,
|
||||||
file_helpers::copy_file_with_new_name,
|
system_helpers::install_location,
|
||||||
file_helpers::delete_file,
|
system_helpers::is_elevated,
|
||||||
file_helpers::are_files_identical,
|
system_helpers::set_migoto_target,
|
||||||
file_helpers::read_file,
|
system_helpers::wipe_registry,
|
||||||
file_helpers::write_file,
|
proxy::set_proxy_addr,
|
||||||
downloader::download_file,
|
proxy::generate_ca_files,
|
||||||
downloader::stop_download,
|
unzip::unzip,
|
||||||
lang::get_lang,
|
file_helpers::rename,
|
||||||
lang::get_languages,
|
file_helpers::dir_create,
|
||||||
web::valid_url,
|
file_helpers::dir_exists,
|
||||||
web::web_get,
|
file_helpers::dir_is_empty,
|
||||||
gamebanana::get_download_links,
|
file_helpers::dir_delete,
|
||||||
gamebanana::list_submissions,
|
file_helpers::copy_file,
|
||||||
gamebanana::list_mods,
|
file_helpers::copy_file_with_new_name,
|
||||||
metadata_patcher::patch_metadata
|
file_helpers::delete_file,
|
||||||
])
|
file_helpers::are_files_identical,
|
||||||
.run(tauri::generate_context!())
|
file_helpers::read_file,
|
||||||
.expect("error while running tauri application");
|
file_helpers::write_file,
|
||||||
|
downloader::download_file,
|
||||||
|
downloader::stop_download,
|
||||||
|
lang::get_lang,
|
||||||
|
lang::get_languages,
|
||||||
|
web::valid_url,
|
||||||
|
web::web_get,
|
||||||
|
gamebanana::get_download_links,
|
||||||
|
gamebanana::list_submissions,
|
||||||
|
gamebanana::list_mods,
|
||||||
|
metadata_patcher::patch_metadata
|
||||||
|
])
|
||||||
|
.run(tauri::generate_context!())
|
||||||
|
.expect("error while running tauri application");
|
||||||
|
} else {
|
||||||
|
try_flush();
|
||||||
|
println!("Press enter or CTRL-C twice to quit...");
|
||||||
|
std::io::stdin().read_line(&mut String::new()).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Always disconnect upon closing the program
|
||||||
|
disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
@@ -94,7 +135,7 @@ fn enable_process_watcher(window: tauri::Window, process: String) {
|
|||||||
|
|
||||||
thread::spawn(move || {
|
thread::spawn(move || {
|
||||||
// Initial sleep for 8 seconds, since running 20 different injectors or whatever can take a while
|
// Initial sleep for 8 seconds, since running 20 different injectors or whatever can take a while
|
||||||
std::thread::sleep(std::time::Duration::from_secs(8));
|
std::thread::sleep(std::time::Duration::from_secs(10));
|
||||||
|
|
||||||
let mut system = System::new_all();
|
let mut system = System::new_all();
|
||||||
|
|
||||||
@@ -197,7 +238,8 @@ async fn get_bg_file(bg_path: String, appdata: String) -> String {
|
|||||||
let response_data: APIQuery = match serde_json::from_str(&query) {
|
let response_data: APIQuery = match serde_json::from_str(&query) {
|
||||||
Ok(data) => data,
|
Ok(data) => data,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
println!("Failed to parse response: {}", e);
|
println!("Failed to get bg file response: {}", e);
|
||||||
|
println!("^ please stop reporting this as an error it's so annoying LMFAO");
|
||||||
return "".to_string();
|
return "".to_string();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
use duct::cmd;
|
use duct::cmd;
|
||||||
|
use ini::Ini;
|
||||||
|
use std::path::PathBuf;
|
||||||
|
|
||||||
|
#[cfg(windows)]
|
||||||
|
use registry::{Data, Hive, Security};
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub fn run_program(path: String, args: Option<String>) {
|
pub fn run_program(path: String, args: Option<String>) {
|
||||||
@@ -88,6 +93,65 @@ pub fn install_location() -> String {
|
|||||||
return exe_path.to_str().unwrap().to_string();
|
return exe_path.to_str().unwrap().to_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub fn set_migoto_target(path: String, migoto_path: String) -> bool {
|
||||||
|
let pathbuf = PathBuf::from(path);
|
||||||
|
let mut migoto_pathbuf = PathBuf::from(migoto_path);
|
||||||
|
|
||||||
|
migoto_pathbuf.pop();
|
||||||
|
migoto_pathbuf.push("d3dx.ini");
|
||||||
|
|
||||||
|
let mut conf = match Ini::load_from_file(&migoto_pathbuf) {
|
||||||
|
Ok(c) => {
|
||||||
|
println!("Loaded migoto ini");
|
||||||
|
c
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
println!("Error loading migoto config: {}", e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Set options
|
||||||
|
conf
|
||||||
|
.with_section(Some("Loader"))
|
||||||
|
.set("target", pathbuf.to_str().unwrap());
|
||||||
|
|
||||||
|
// Write file
|
||||||
|
match conf.write_to_file(&migoto_pathbuf) {
|
||||||
|
Ok(_) => {
|
||||||
|
println!("Wrote config!");
|
||||||
|
true
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
println!("Error writing config: {}", e);
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub fn wipe_registry(exec_name: String) {
|
||||||
|
// Fetch the 'Internet Settings' registry key.
|
||||||
|
let settings =
|
||||||
|
match Hive::CurrentUser.open(format!("Software\\miHoYo\\{}", exec_name), Security::Write) {
|
||||||
|
Ok(s) => s,
|
||||||
|
Err(e) => {
|
||||||
|
println!("Error getting registry setting: {}", e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Wipe login cache
|
||||||
|
match settings.set_value(
|
||||||
|
"MIHOYOSDK_ADL_PROD_OVERSEA_h1158948810",
|
||||||
|
&Data::String("".parse().unwrap()),
|
||||||
|
) {
|
||||||
|
Ok(_) => (),
|
||||||
|
Err(e) => println!("Error wiping registry: {}", e),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub fn is_elevated() -> bool {
|
pub fn is_elevated() -> bool {
|
||||||
|
|||||||
@@ -64,27 +64,16 @@ pub fn unzip(
|
|||||||
println!("Is rar file? {}", zipfile.ends_with(".rar"));
|
println!("Is rar file? {}", zipfile.ends_with(".rar"));
|
||||||
|
|
||||||
let name;
|
let name;
|
||||||
|
let success;
|
||||||
|
|
||||||
// If file ends in zip, OR is unknown, extract as zip, otherwise extract as rar
|
// If file ends in zip, OR is unknown, extract as zip, otherwise extract as rar
|
||||||
if zipfile.ends_with(".rar") {
|
if zipfile.ends_with(".rar") {
|
||||||
extract_rar(
|
success = extract_rar(&zipfile, &f, &full_path, top_level.unwrap_or(true));
|
||||||
&window,
|
|
||||||
&zipfile,
|
|
||||||
&f,
|
|
||||||
&full_path,
|
|
||||||
top_level.unwrap_or(false),
|
|
||||||
);
|
|
||||||
|
|
||||||
let archive = Archive::new(zipfile.clone());
|
let archive = Archive::new(zipfile.clone());
|
||||||
name = archive.list().unwrap().next().unwrap().unwrap().filename;
|
name = archive.list().unwrap().next().unwrap().unwrap().filename;
|
||||||
} else {
|
} else {
|
||||||
extract_zip(
|
success = extract_zip(&zipfile, &f, &full_path, top_level.unwrap_or(true));
|
||||||
&window,
|
|
||||||
&zipfile,
|
|
||||||
&f,
|
|
||||||
&full_path,
|
|
||||||
top_level.unwrap_or(false),
|
|
||||||
);
|
|
||||||
|
|
||||||
// Get the name of the inenr file in the zip file
|
// Get the name of the inenr file in the zip file
|
||||||
let mut zip = zip::ZipArchive::new(&f).unwrap();
|
let mut zip = zip::ZipArchive::new(&f).unwrap();
|
||||||
@@ -92,6 +81,14 @@ pub fn unzip(
|
|||||||
name = file.name().to_string().clone();
|
name = file.name().to_string().clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !success {
|
||||||
|
let mut res_hash = std::collections::HashMap::new();
|
||||||
|
|
||||||
|
res_hash.insert("path".to_string(), zipfile.to_string());
|
||||||
|
|
||||||
|
window.emit("download_error", &res_hash).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
// If the contents is a jar file, emit that we have extracted a new jar file
|
// If the contents is a jar file, emit that we have extracted a new jar file
|
||||||
if name.ends_with(".jar") {
|
if name.ends_with(".jar") {
|
||||||
window
|
window
|
||||||
@@ -129,13 +126,7 @@ pub fn unzip(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn extract_rar(
|
fn extract_rar(rarfile: &String, _f: &File, full_path: &path::PathBuf, _top_level: bool) -> bool {
|
||||||
window: &tauri::Window,
|
|
||||||
rarfile: &String,
|
|
||||||
_f: &File,
|
|
||||||
full_path: &path::PathBuf,
|
|
||||||
_top_level: bool,
|
|
||||||
) {
|
|
||||||
let archive = Archive::new(rarfile.clone());
|
let archive = Archive::new(rarfile.clone());
|
||||||
|
|
||||||
let mut open_archive = archive
|
let mut open_archive = archive
|
||||||
@@ -148,41 +139,29 @@ fn extract_rar(
|
|||||||
"Extracted rar file to: {}",
|
"Extracted rar file to: {}",
|
||||||
full_path.to_str().unwrap_or("Error")
|
full_path.to_str().unwrap_or("Error")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
true
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
println!("Failed to extract rar file: {}", e);
|
println!("Failed to extract rar file: {}", e);
|
||||||
let mut res_hash = std::collections::HashMap::new();
|
false
|
||||||
|
|
||||||
res_hash.insert("error".to_string(), e.to_string());
|
|
||||||
res_hash.insert("path".to_string(), rarfile.to_string());
|
|
||||||
|
|
||||||
window.emit("download_error", &res_hash).unwrap();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn extract_zip(
|
fn extract_zip(_zipfile: &String, f: &File, full_path: &path::PathBuf, top_level: bool) -> bool {
|
||||||
window: &tauri::Window,
|
|
||||||
zipfile: &String,
|
|
||||||
f: &File,
|
|
||||||
full_path: &path::PathBuf,
|
|
||||||
top_level: bool,
|
|
||||||
) {
|
|
||||||
match zip_extract::extract(f, full_path, top_level) {
|
match zip_extract::extract(f, full_path, top_level) {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
println!(
|
println!(
|
||||||
"Extracted zip file to: {}",
|
"Extracted zip file to: {}",
|
||||||
full_path.to_str().unwrap_or("Error")
|
full_path.to_str().unwrap_or("Error")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
true
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
println!("Failed to extract zip file: {}", e);
|
println!("Failed to extract zip file: {}", e);
|
||||||
let mut res_hash = std::collections::HashMap::new();
|
false
|
||||||
|
|
||||||
res_hash.insert("error".to_string(), e.to_string());
|
|
||||||
res_hash.insert("path".to_string(), zipfile.to_string());
|
|
||||||
|
|
||||||
window.emit("download_error", &res_hash).unwrap();
|
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
},
|
},
|
||||||
"package": {
|
"package": {
|
||||||
"productName": "Cultivation",
|
"productName": "Cultivation",
|
||||||
"version": "1.0.6"
|
"version": "1.0.8"
|
||||||
},
|
},
|
||||||
"tauri": {
|
"tauri": {
|
||||||
"allowlist": {
|
"allowlist": {
|
||||||
|
|||||||
@@ -161,6 +161,12 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// First wipe registry if we have to
|
||||||
|
await invoke('wipe_registry', {
|
||||||
|
// The exe is always PascalCase so we can get the dir using regex
|
||||||
|
execName: (await getGameExecutable())?.split('.exe')[0].replace(/([a-z\d])([A-Z])/g, '$1 $2'),
|
||||||
|
})
|
||||||
|
|
||||||
// Launch the program
|
// Launch the program
|
||||||
const gameExists = await invoke('dir_exists', {
|
const gameExists = await invoke('dir_exists', {
|
||||||
path: exe || config.game_install_path,
|
path: exe || config.game_install_path,
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ interface IState {
|
|||||||
encryption: boolean
|
encryption: boolean
|
||||||
patch_metadata: boolean
|
patch_metadata: boolean
|
||||||
use_internal_proxy: boolean
|
use_internal_proxy: boolean
|
||||||
|
wipe_login: boolean
|
||||||
swag: boolean
|
swag: boolean
|
||||||
|
|
||||||
// Swag stuff
|
// Swag stuff
|
||||||
@@ -59,6 +60,7 @@ export default class Options extends React.Component<IProps, IState> {
|
|||||||
encryption: false,
|
encryption: false,
|
||||||
patch_metadata: false,
|
patch_metadata: false,
|
||||||
use_internal_proxy: false,
|
use_internal_proxy: false,
|
||||||
|
wipe_login: false,
|
||||||
swag: false,
|
swag: false,
|
||||||
|
|
||||||
// Swag stuff
|
// Swag stuff
|
||||||
@@ -78,6 +80,7 @@ export default class Options extends React.Component<IProps, IState> {
|
|||||||
this.restoreMetadata = this.restoreMetadata.bind(this)
|
this.restoreMetadata = this.restoreMetadata.bind(this)
|
||||||
this.toggleMetadata = this.toggleMetadata.bind(this)
|
this.toggleMetadata = this.toggleMetadata.bind(this)
|
||||||
this.toggleProxy = this.toggleProxy.bind(this)
|
this.toggleProxy = this.toggleProxy.bind(this)
|
||||||
|
this.toggleLoginWipe = this.toggleLoginWipe.bind(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
async componentDidMount() {
|
async componentDidMount() {
|
||||||
@@ -102,6 +105,7 @@ export default class Options extends React.Component<IProps, IState> {
|
|||||||
encryption: await translate(encEnabled ? 'options.enabled' : 'options.disabled'),
|
encryption: await translate(encEnabled ? 'options.enabled' : 'options.disabled'),
|
||||||
patch_metadata: config.patch_metadata || false,
|
patch_metadata: config.patch_metadata || false,
|
||||||
use_internal_proxy: config.use_internal_proxy || false,
|
use_internal_proxy: config.use_internal_proxy || false,
|
||||||
|
wipe_login: config.wipe_login || false,
|
||||||
swag: config.swag_mode || false,
|
swag: config.swag_mode || false,
|
||||||
|
|
||||||
// Swag stuff
|
// Swag stuff
|
||||||
@@ -151,6 +155,12 @@ export default class Options extends React.Component<IProps, IState> {
|
|||||||
this.setState({
|
this.setState({
|
||||||
migoto_path: value,
|
migoto_path: value,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Set game exe in Migoto ini
|
||||||
|
invoke('set_migoto_target', {
|
||||||
|
path: this.state.game_install_path,
|
||||||
|
migotoPath: value,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
setReshade(value: string) {
|
setReshade(value: string) {
|
||||||
@@ -256,6 +266,16 @@ export default class Options extends React.Component<IProps, IState> {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async toggleLoginWipe() {
|
||||||
|
const changedVal = !(await getConfigOption('wipe_login'))
|
||||||
|
|
||||||
|
await setConfigOption('wipe_login', changedVal)
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
wipe_login: changedVal,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<Menu closeFn={this.props.closeFn} className="Options" heading="Options">
|
<Menu closeFn={this.props.closeFn} className="Options" heading="Options">
|
||||||
@@ -296,6 +316,14 @@ export default class Options extends React.Component<IProps, IState> {
|
|||||||
<Checkbox onChange={this.toggleProxy} checked={this.state?.use_internal_proxy} id="useProxy" />
|
<Checkbox onChange={this.toggleProxy} checked={this.state?.use_internal_proxy} id="useProxy" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="OptionSection" id="menuOptionsContainerWipeLogin">
|
||||||
|
<div className="OptionLabel" id="menuOptionsLabelWipeLogin">
|
||||||
|
<Tr text="options.wipe_login" />
|
||||||
|
</div>
|
||||||
|
<div className="OptionValue" id="menuOptionsCheckboxWipeLogin">
|
||||||
|
<Checkbox onChange={this.toggleLoginWipe} checked={this.state?.wipe_login} id="wipeLogin" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ let defaultConfig: Configuration
|
|||||||
debug_enabled: false,
|
debug_enabled: false,
|
||||||
patch_metadata: true,
|
patch_metadata: true,
|
||||||
use_internal_proxy: true,
|
use_internal_proxy: true,
|
||||||
|
wipe_login: false,
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
|
|
||||||
@@ -46,6 +47,7 @@ export interface Configuration {
|
|||||||
debug_enabled: boolean
|
debug_enabled: boolean
|
||||||
patch_metadata: boolean
|
patch_metadata: boolean
|
||||||
use_internal_proxy: boolean
|
use_internal_proxy: boolean
|
||||||
|
wipe_login: boolean
|
||||||
swag_mode?: boolean
|
swag_mode?: boolean
|
||||||
|
|
||||||
// Swag stuff
|
// Swag stuff
|
||||||
|
|||||||
@@ -77,14 +77,20 @@ export default class DownloadHandler {
|
|||||||
|
|
||||||
// Extraction events
|
// Extraction events
|
||||||
listen('extract_start', ({ payload }) => {
|
listen('extract_start', ({ payload }) => {
|
||||||
// Find the download that is no extracting and set it's status as such
|
// Find the download that is extracting and set it's status as such
|
||||||
const index = this.downloads.findIndex((download) => download.path === payload)
|
const index = this.downloads.findIndex((download) => download.path === payload)
|
||||||
this.downloads[index].status = 'extracting'
|
this.downloads[index].status = 'extracting'
|
||||||
})
|
})
|
||||||
|
|
||||||
listen('extract_end', ({ payload }) => {
|
listen('extract_end', ({ payload }) => {
|
||||||
// Find the download that is no extracting and set it's status as such
|
// @ts-expect-error shut up typescript
|
||||||
const index = this.downloads.findIndex((download) => download.path === payload)
|
const obj: {
|
||||||
|
file: string
|
||||||
|
new_folder: string
|
||||||
|
} = payload
|
||||||
|
|
||||||
|
// Find the download that is not extracting and set it's status as such
|
||||||
|
const index = this.downloads.findIndex((download) => download.path === obj.file || obj.new_folder)
|
||||||
this.downloads[index].status = 'finished'
|
this.downloads[index].status = 'finished'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,13 +118,30 @@ interface ModDownload {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function getMods(mode: string) {
|
export async function getMods(mode: string) {
|
||||||
const resp = JSON.parse(
|
let modList: GamebananaResponse[] = []
|
||||||
await invoke('list_submissions', {
|
let hadMods = true
|
||||||
mode,
|
let page = 1
|
||||||
})
|
|
||||||
)
|
|
||||||
|
|
||||||
return formatGamebananaData(resp)
|
while (hadMods) {
|
||||||
|
const resp = JSON.parse(
|
||||||
|
await invoke('list_submissions', {
|
||||||
|
mode,
|
||||||
|
page: '' + page,
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
if (resp.length === 0) hadMods = false
|
||||||
|
|
||||||
|
modList = [...modList, ...resp]
|
||||||
|
page++
|
||||||
|
|
||||||
|
console.log(page)
|
||||||
|
console.log(resp)
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(modList)
|
||||||
|
|
||||||
|
return formatGamebananaData(modList)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function formatGamebananaData(obj: GamebananaResponse[]) {
|
export async function formatGamebananaData(obj: GamebananaResponse[]) {
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ export function unzip(
|
|||||||
})
|
})
|
||||||
|
|
||||||
listen('extract_end', ({ payload }) => {
|
listen('extract_end', ({ payload }) => {
|
||||||
|
console.log(payload)
|
||||||
|
console.log(file)
|
||||||
|
|
||||||
// @ts-expect-error Payload is an object
|
// @ts-expect-error Payload is an object
|
||||||
if (payload?.file === file) {
|
if (payload?.file === file) {
|
||||||
resolve(payload as UnzipPayload)
|
resolve(payload as UnzipPayload)
|
||||||
|
|||||||
Reference in New Issue
Block a user