mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-13 15:44:35 +01:00
Compare commits
182 Commits
v1.0.6-alp
...
v1.0.25-al
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f0567da6a | ||
|
|
56453ff55b | ||
|
|
61c5cc8d57 | ||
|
|
7bbc7e3c10 | ||
|
|
5b7c1307d9 | ||
|
|
096992572c | ||
|
|
68f0cce154 | ||
|
|
19db69646f | ||
|
|
82f40186fe | ||
|
|
d7b2aa25cc | ||
|
|
3356bddb42 | ||
|
|
db11cf7907 | ||
|
|
891dbb41aa | ||
|
|
cf6ec3da82 | ||
|
|
b2d6f390fb | ||
|
|
a920d70e53 | ||
|
|
d2e7759eec | ||
|
|
77380e357c | ||
|
|
33ddc36741 | ||
|
|
bbd18d33e9 | ||
|
|
b66f01232b | ||
|
|
b6a2e4dbc0 | ||
|
|
45ee8fbb23 | ||
|
|
78c2a8d0c8 | ||
|
|
fe420e9837 | ||
|
|
57576f399b | ||
|
|
8d45b3d11d | ||
|
|
1ff96f9c7e | ||
|
|
e834022ca7 | ||
|
|
c72e502603 | ||
|
|
5d6bd72083 | ||
|
|
ef3ba2a045 | ||
|
|
90b86b42d0 | ||
|
|
01d12178ba | ||
|
|
b67e0992f1 | ||
|
|
a949754dce | ||
|
|
cf536b853a | ||
|
|
19c8537e91 | ||
|
|
8a62a5a8c7 | ||
|
|
d56c6bc069 | ||
|
|
ea73feb8e9 | ||
|
|
abf7a428f6 | ||
|
|
7bd3493366 | ||
|
|
20a80e5625 | ||
|
|
4a8db8eb0f | ||
|
|
f44dfeb79d | ||
|
|
098ba63066 | ||
|
|
b8255eb5bc | ||
|
|
812aa64c5e | ||
|
|
b3aaf5c5f7 | ||
|
|
9e6029faf3 | ||
|
|
b18f7a0cf6 | ||
|
|
62a97d86cb | ||
|
|
55fa0a8d3c | ||
|
|
2aac7fc022 | ||
|
|
ddaf24590c | ||
|
|
44f5cac2bf | ||
|
|
e1a519cc5f | ||
|
|
3dd1ec2674 | ||
|
|
438596f4e2 | ||
|
|
af5c9229d4 | ||
|
|
fb842ccc86 | ||
|
|
27d30a183c | ||
|
|
182943fd69 | ||
|
|
b352b16dc9 | ||
|
|
b1b18c75a1 | ||
|
|
7c53669fc4 | ||
|
|
249f07927d | ||
|
|
090e1a888d | ||
|
|
5dfa98c9ea | ||
|
|
088d007816 | ||
|
|
d49fdacf2a | ||
|
|
8efd601eda | ||
|
|
f2e3c69c0f | ||
|
|
85a16e3407 | ||
|
|
596c5b85b1 | ||
|
|
1115283df8 | ||
|
|
696a8a1dec | ||
|
|
1be06b0a6c | ||
|
|
7f71549831 | ||
|
|
08d9db05a5 | ||
|
|
cd2b8aee12 | ||
|
|
ec611f9d7d | ||
|
|
d6b1c7a613 | ||
|
|
9b1d3594ed | ||
|
|
3848c39743 | ||
|
|
7831bd48dc | ||
|
|
86d15cd335 | ||
|
|
bf880ac297 | ||
|
|
e1637cebef | ||
|
|
d7f3218657 | ||
|
|
0dede9b17c | ||
|
|
ec7b0904d2 | ||
|
|
937faf85e2 | ||
|
|
6c40044931 | ||
|
|
3d2425fb3d | ||
|
|
f7c8059f4c | ||
|
|
6206b6762a | ||
|
|
258c656815 | ||
|
|
68404f5e39 | ||
|
|
8c75541939 | ||
|
|
aa32782179 | ||
|
|
2cda891f02 | ||
|
|
9c8ed852d1 | ||
|
|
e75f65ab56 | ||
|
|
bdeda36043 | ||
|
|
151e7c3919 | ||
|
|
e6365b5592 | ||
|
|
ed76a086b6 | ||
|
|
c4526e2ff6 | ||
|
|
80c28669e1 | ||
|
|
5e48a4772e | ||
|
|
10234bed5a | ||
|
|
22d8a23386 | ||
|
|
6ef3e86820 | ||
|
|
0087801f83 | ||
|
|
55be3ebc2b | ||
|
|
7cf1b198ff | ||
|
|
fb231acaa6 | ||
|
|
827b8942c9 | ||
|
|
0fd4376e0d | ||
|
|
d6c5463619 | ||
|
|
9ade56dc6f | ||
|
|
484cd36565 | ||
|
|
1c27ae172e | ||
|
|
541352c3fd | ||
|
|
bfbf3e77a2 | ||
|
|
404e946e7c | ||
|
|
8077285e79 | ||
|
|
94c1bfd104 | ||
|
|
ed473ad659 | ||
|
|
b624ef693e | ||
|
|
c10a5cd82f | ||
|
|
25c6a70dc0 | ||
|
|
86c595abda | ||
|
|
35e6144733 | ||
|
|
565f229dac | ||
|
|
9bd4b9ccaf | ||
|
|
6750787bf9 | ||
|
|
c0770606ae | ||
|
|
4e03fec2a0 | ||
|
|
e7809be97c | ||
|
|
782e350ae5 | ||
|
|
6eab66032b | ||
|
|
c1842722b4 | ||
|
|
31aef02d5f | ||
|
|
bcdbb2ba06 | ||
|
|
ff8f35c52a | ||
|
|
a7188828fa | ||
|
|
db6917df5d | ||
|
|
8268c127a9 | ||
|
|
8fd5b895af | ||
|
|
10b9141815 | ||
|
|
d7783c5936 | ||
|
|
27122cd399 | ||
|
|
49740470ac | ||
|
|
7b693d7758 | ||
|
|
03439c3757 | ||
|
|
e83ae64714 | ||
|
|
3ecd13d1c3 | ||
|
|
28701ba007 | ||
|
|
3a84825cf9 | ||
|
|
4de8a43c3a | ||
|
|
d28e0a1bc8 | ||
|
|
bf8de40caa | ||
|
|
8e7d6ee420 | ||
|
|
d6e9bb100b | ||
|
|
374c6abbfc | ||
|
|
a728e8ba2c | ||
|
|
4371804429 | ||
|
|
fa38a22117 | ||
|
|
a7914406b4 | ||
|
|
57c1a7800c | ||
|
|
9426937a62 | ||
|
|
96d69d9ff6 | ||
|
|
defc1b43bd | ||
|
|
569c465a50 | ||
|
|
8a5e66be48 | ||
|
|
e633f7dad7 | ||
|
|
bffd089192 | ||
|
|
bf3d892af5 | ||
|
|
424dd4ff1c |
4
.gitattributes
vendored
4
.gitattributes
vendored
@@ -1 +1,3 @@
|
||||
* text=auto eol=lf
|
||||
* text=auto eol=lf
|
||||
|
||||
src-tauri/keys/* binary
|
||||
|
||||
85
.github/workflows/build.yml
vendored
Normal file
85
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/build.yml'
|
||||
- 'src-tauri/**/*'
|
||||
- 'src/**/*'
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/build.yml'
|
||||
- 'src-tauri/**/*'
|
||||
- 'src/**/*'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.ref }}-${{ github.workflow }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-win:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: setup node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
- name: Install deps and build
|
||||
run: yarn && yarn build --debug
|
||||
|
||||
- name: Compress build
|
||||
uses: vimtor/action-zip@v1
|
||||
with:
|
||||
files: src-tauri/target/debug/lang/ src-tauri/target/debug/keys/ src-tauri/target/debug/patch/ src-tauri/target/debug/Cultivation.exe src-tauri/target/debug/bundle/msi/
|
||||
recursive: true
|
||||
dest: Cultivation.zip
|
||||
|
||||
- name: Upload build
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: CultivationWin
|
||||
path: Cultivation.zip
|
||||
|
||||
build-ubuntu:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: setup node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
- name: Install libraries
|
||||
run: sudo apt install libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
|
||||
|
||||
- name: Install deps and build
|
||||
run: yarn && yarn build --debug
|
||||
|
||||
- name: Compress build
|
||||
uses: vimtor/action-zip@v1
|
||||
with:
|
||||
files: src-tauri/target/debug/lang/ src-tauri/target/debug/keys/ src-tauri/target/debug/patch/ src-tauri/target/debug/cultivation
|
||||
recursive: true
|
||||
dest: Cultivation.zip
|
||||
|
||||
- name: Upload build
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: CultivationLinux
|
||||
path: Cultivation.zip
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -17,6 +17,7 @@
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
.vs
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
yarn lint-staged
|
||||
yarn lint-staged --allow-empty
|
||||
|
||||
67
README.md
67
README.md
@@ -1,17 +1,15 @@
|
||||
# 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.
|
||||
EN | [简中](README_zh-CN.md) | [繁中](README_zh-TW.md) |
|
||||
|
||||
# Cultivation
|
||||
|
||||
A game launcher designed to easily proxy traffic from anime game to private servers.
|
||||
|
||||
While the Cultivation repository is **open**. This does **not** mean it has released.
|
||||
Please do **NOT install, download, or use pre-compiled versions of Cultivation found elsewhere**. Only use releases from this GitHub repository.
|
||||
|
||||
# Table Of Contents
|
||||
|
||||
- [Client Patching Notice](#client-patching-notice)
|
||||
- [Download](#download)
|
||||
- [Setup](#setup)
|
||||
- [Troubleshooting](#troubleshooting)
|
||||
- [Developer Quick-start](#developer-quickstart)
|
||||
- [Setup](#setup)
|
||||
- [Building](#building)
|
||||
@@ -21,11 +19,57 @@ Please do **NOT install, download, or use pre-compiled versions of Cultivation f
|
||||
- [Screenshots](#screenshots)
|
||||
- [Credits](#credits)
|
||||
|
||||
# Client Patching Notice - RSA
|
||||
|
||||
For game versions 3.1 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.
|
||||
|
||||
# Download
|
||||
|
||||
[Find release builds here!](https://github.com/Grasscutters/Cultivation/releases)
|
||||
|
||||
Once downloaded, extract somewhere and open as administrator.
|
||||
Download and open the MSI, and once installed, run Cultivation as administrator. Refer below for more [detailed setup instructions](#setup).
|
||||
|
||||
**Windows 7 Users:** You will need to download [WebView](https://developer.microsoft.com/en-us/microsoft-edge/webview2/#download-section) manually, and download the `.zip` instead of the `.msi`.
|
||||
|
||||
# Setup
|
||||
|
||||
5-minute video for those who don't like to/cannot read: https://youtu.be/e0irOYbQe7I
|
||||
|
||||
- Download Cultivation
|
||||
- If you are on Windows 10 or 11, use the MSI
|
||||
- If you are on Windows 7, or the MSI doesn't work, use the zip and download [WebView](https://developer.microsoft.com/en-us/microsoft-edge/webview2/)
|
||||
- If you are on GNU/Linux or MacOS, [help us port Windows-specific system calls to GNU/Linux and MacOS!](https://github.com/Grasscutters/Cultivation/issues/7)
|
||||
- Install or extract Cultivation
|
||||
- Open Cultivation **_as administrator_**
|
||||
- Before clicking randomly on stuff, in options (top right cog icon), set your Game Install Path.
|
||||
- If you are using an existing server installation from somewhere else, you can set the `.jar` file in settings as well. All downloads made through Culti will automatically use that path, no additional config needed.
|
||||
- If you use multiple Java versions, you can set the Java path to your Java 17 installation (only required if you are running your own server)
|
||||
- Decide if you want to download your own server, or just join a public one
|
||||
- If joining a public one, you're done. Just click "Connect with Grasscutter" and input the address and port. You do not have to continue these instructions.
|
||||
- If you are getting System Error, or 4214, ask the [Discord support channels](https://discord.gg/grasscutter)
|
||||
- Open the "Downloads" menu (top right)
|
||||
- Download "Grasscutter All-in-One" (top of the list)
|
||||
- Once that is done, click the icon next to "Launch"
|
||||
- To play on your new server:
|
||||
- Click "Connect with Grasscutter"
|
||||
- Input `localhost` as the address, and `443` as the port
|
||||
- Ensure HTTPS is disabled
|
||||
- Any generic "I am getting XYZ error!" should go in the [Discord support channels](https://discord.gg/grasscutter)
|
||||
- Any specific Cultivation issues should go in [the issues section](/issues)
|
||||
- Any Grasscutter server related issues should go in [the Grasscutter issues section](https://github.com/Grasscutters/Grasscutter)
|
||||
|
||||
# Troubleshooting
|
||||
|
||||
### White screen, insta-crash or something similar
|
||||
|
||||
- First try [running in Windows 8 compatibility mode](https://www.lifewire.com/run-older-programs-with-windows-10-compatibility-mode-4587064).
|
||||
- If that doesn't work, fully uninstall and reinstall [WebView2](https://developer.microsoft.com/en-us/microsoft-edge/webview2/#download-section).
|
||||
- If you are having trouble uninstalling it, try deleting this registry folder and uninstalling again `Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}`
|
||||
- You can also try [uninstalling from the Command Prompt](https://superuser.com/a/1743626)
|
||||
|
||||
### Internet not working after use
|
||||
|
||||
Please allow the Cultivation window to pop back up once you have quit out of the game. This tells you that it knows you closed the game, and that it has reverted your proxy settings. If you have closed Cultivation before this happens, or have had some other issue with your internet, go to your [proxy settings in Windows](https://techviral.net/check-proxy-server-settings-in-windows/) and disable the "Manual proxy setup".
|
||||
|
||||
# Developer Quickstart
|
||||
|
||||
@@ -71,11 +115,10 @@ A full theming reference can be found [here!](/THEMES.md)
|
||||
|
||||
# Screenshots
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
## Credits
|
||||
|
||||
|
||||
87
README_zh-CN.md
Normal file
87
README_zh-CN.md
Normal file
@@ -0,0 +1,87 @@
|
||||
[EN](README.md) | 简中 | [繁中](README_zh-TW.md)
|
||||
|
||||
# Cultivation
|
||||
|
||||
一个游戏启动器,旨在轻松将某动漫游戏的流量代理到私人服务器。
|
||||
|
||||
虽然此存储库是**开放的**。 但这**并不**意味着它已经发布。
|
||||
请不要**安装、下载或使用在其他地方找到的预编译版本的 Cultivation**。 仅使用此 GitHub 存储库中的版本。
|
||||
|
||||
# 目录
|
||||
|
||||
- [下载](#下载)
|
||||
- [开发人员快速入门](#开发人员快速入门)
|
||||
- [安装](#安装)
|
||||
- [编译](#编译)
|
||||
- [代码格式化与纠错](#代码格式化与纠错)
|
||||
- [生成更新项目](#生成更新项目)
|
||||
- [启动器主题](#启动器主题)
|
||||
- [画面](#画面)
|
||||
- [成员](#成员)
|
||||
|
||||
# 客户端修补通知
|
||||
|
||||
对于游戏版本为 3.1 及以上时,使用 Grasscutter 启动时,Cultivation 会自动为您的游戏客户端制作一个小补丁,并在关闭游戏时恢复它。 从理论上讲,你应该是完全安全的,但是不明确**如果您使用它连接到官方服务器,修改游戏客户端可能会导致封号**,但可能性是非常小的,并且从未接到发生过此类情况的问题,但存在这种可能性!
|
||||
|
||||
# 下载
|
||||
|
||||
[在此处查找发布版本!](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.
|
||||
87
README_zh-TW.md
Normal file
87
README_zh-TW.md
Normal file
@@ -0,0 +1,87 @@
|
||||
[EN](README.md) | [简中](README_zh-CN.md) | 繁中
|
||||
|
||||
# 客戶端修補通知
|
||||
|
||||
對於遊戲版本為 3.1 及以上時,使用 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",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.25",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^1.0.0-rc.5",
|
||||
@@ -20,14 +20,14 @@
|
||||
"scripts": {
|
||||
"start": "cross-env BROWSER=none react-scripts start",
|
||||
"postbuild:windows": "xcopy /E /H /C /I /Y \".\\src-tauri\\lang\" \".\\src-tauri\\target\\release\\lang\"",
|
||||
"postbuild:linux": "cp -r \".\\src-tauri\\lang\" \".\\lang\"",
|
||||
"postbuild:linux": "cp -r \"./src-tauri/lang\" \"./lang\"",
|
||||
"build:windows": "yarn tauri build",
|
||||
"build:linux": "yarn tauri build",
|
||||
"build": "react-scripts build && run-script-os",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject",
|
||||
"tauri": "tauri",
|
||||
"start:dev": "tauri dev",
|
||||
"start:dev": "tauri dev -- -- --no-admin",
|
||||
"format": "cargo fmt --manifest-path ./src-tauri/Cargo.toml --all && yarn prettier --write --cache --loglevel warn .",
|
||||
"lint": "cargo clippy --manifest-path ./src-tauri/Cargo.toml --no-default-features && yarn tsc --noEmit && yarn eslint src",
|
||||
"lint:fix": "cargo clippy --manifest-path ./src-tauri/Cargo.toml --no-default-features --fix --allow-dirty && yarn tsc --noEmit && yarn eslint --fix src",
|
||||
|
||||
689
src-tauri/Cargo.lock
generated
689
src-tauri/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -24,7 +24,7 @@ sudo = "0.6.0"
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
tauri = { version = "1.0.0-rc.9", features = ["api-all"] }
|
||||
tauri = { version = "1.0.7", features = ["api-all"] }
|
||||
|
||||
# Access system process info.
|
||||
sysinfo = "0.24.6"
|
||||
@@ -33,6 +33,7 @@ sysinfo = "0.24.6"
|
||||
zip-extract = "0.1.1"
|
||||
unrar = "0.4.4"
|
||||
zip = "0.6.2"
|
||||
sevenz-rust = "0.2.9"
|
||||
|
||||
# For creating a "global" downloads list.
|
||||
once_cell = "1.13.0"
|
||||
@@ -41,12 +42,15 @@ once_cell = "1.13.0"
|
||||
open = "3.0.2"
|
||||
duct = "0.13.5"
|
||||
|
||||
# Services
|
||||
windows-service = "0.6.0"
|
||||
|
||||
# Serialization.
|
||||
serde_json = "1"
|
||||
|
||||
# Dependencies for the HTTP(S) proxy.
|
||||
http = "0.2"
|
||||
hudsucker = "0.17.2"
|
||||
hudsucker = "0.19.1"
|
||||
tracing = "0.1.21"
|
||||
tokio-rustls = "0.23.0"
|
||||
tokio-tungstenite = "0.17.0"
|
||||
@@ -61,6 +65,8 @@ regex = "1"
|
||||
|
||||
# other
|
||||
file_diff = "1.0.0"
|
||||
rust-ini = "0.18.0"
|
||||
ctrlc = "3.2.3"
|
||||
|
||||
[features]
|
||||
# by default Tauri runs in production mode
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<RSAKeyValue>
|
||||
<Exponent>AQAB</Exponent>
|
||||
<Modulus>yytg/H9lz7Lm0XcA8LMqIyXPVNApYTcSepT4VDLB4qqqFC3s
|
||||
/Huv8vN7zA/P4uoREIu8KMenADFk7uwrZSxoMWwJgn6A7sbAt1cqAaUXB
|
||||
9J4NzhL0x3AFTiHEQbw86hRvm2VGkbA5sWnr0NZw8SGBBY+EODwNIt51G
|
||||
dBA7eoUQU=</Modulus>
|
||||
<RSAKeyValue>
|
||||
<Exponent>AQAB</Exponent>
|
||||
<Modulus>yytg/H9lz7Lm0XcA8LMqIyXPVNApYTcSepT4VDLB4qqqFC3s
|
||||
/Huv8vN7zA/P4uoREIu8KMenADFk7uwrZSxoMWwJgn6A7sbAt1cqAaUXB
|
||||
9J4NzhL0x3AFTiHEQbw86hRvm2VGkbA5sWnr0NZw8SGBBY+EODwNIt51G
|
||||
dBA7eoUQU=</Modulus>
|
||||
</RSAKeyValue>
|
||||
@@ -14,8 +14,9 @@
|
||||
"enabled": "已启用",
|
||||
"disabled": "已禁用",
|
||||
"game_path": "选择游戏安装路径",
|
||||
"game_command": "启动游戏的命令行",
|
||||
"game_executable": "选择游戏可执行文件",
|
||||
"recover_metadata": "紧急情况下恢复元数据文件",
|
||||
"recover_rsa": "紧急情况下删除补丁文件",
|
||||
"grasscutter_jar": "选择 Grasscutter JAR 文件",
|
||||
"toggle_encryption": "启用加密",
|
||||
"install_certificate": "安装代理证书",
|
||||
@@ -24,10 +25,14 @@
|
||||
"language": "选择语言",
|
||||
"background": "设置自定义背景(链接或文件)",
|
||||
"theme": "设置主题",
|
||||
"patch_metadata": "自动修改元数据",
|
||||
"use_proxy": "使用内置代理"
|
||||
"patch_rsa": "自动修改RSA",
|
||||
"use_proxy": "使用内置代理",
|
||||
"wipe_login": "清除登录缓存",
|
||||
"horny_mode": "Horny 模式",
|
||||
"auto_mongodb": "自动启动 MongoDB"
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "下载 Grasscutter 一体化",
|
||||
"grasscutter_stable_data": "下载 Grasscutter 稳定版数据",
|
||||
"grasscutter_latest_data": "下载 Grasscutter 开发版数据",
|
||||
"grasscutter_stable_data_update": "更新 Grasscutter 稳定版数据",
|
||||
@@ -37,7 +42,11 @@
|
||||
"grasscutter_stable_update": "更新 Grasscutter 稳定版",
|
||||
"grasscutter_latest_update": "更新 Grasscutter 开发版",
|
||||
"resources": "下载 Grasscutter 资源",
|
||||
"game": "下载游戏"
|
||||
"game": "下载游戏",
|
||||
"aio_header": "多合一下载:",
|
||||
"individual_header": "个别部分下载:",
|
||||
"mods_header": "Mods:",
|
||||
"migoto": "下载 GIMI 3dmigoto"
|
||||
},
|
||||
"download_status": {
|
||||
"downloading": "下载中",
|
||||
@@ -50,6 +59,7 @@
|
||||
"select_file": "选择文件或文件夹...",
|
||||
"select_folder": "选择文件夹...",
|
||||
"download": "下载",
|
||||
"delete": "删除",
|
||||
"install": "安装"
|
||||
},
|
||||
"news": {
|
||||
@@ -60,13 +70,17 @@
|
||||
"port_help_text": "确保这是 Dispatch 服务器端口,而不是游戏服务器端口。大部分服务器的端口都是 443。",
|
||||
"game_help_text": "你不需要另外的游戏备份来使用 Grasscutter。这是给想要降级到 2.6 或没有安装游戏的人使用的。",
|
||||
"gc_stable_jar": "下载当前的 Grasscutter 稳定版,包括 JAR 文件和数据。",
|
||||
"gc_fullbuild": "下载完整的 Grasscutter 构建版本,包括存储库、jar 和资源。 已完全设置,不需要从此菜单下载任何其他内容",
|
||||
"gc_dev_jar": "下载最新的 Grasscutter 开发版,包括 JAR 文件和数据。",
|
||||
"gc_stable_data": "下载当前的 Grasscutter 稳定版数据,不包括 JAR 文件。此选项在更新时有帮助。",
|
||||
"gc_dev_data": "下载最新的 Grasscutter 开发版数据,不包括 JAR 文件。此选项在更新时有帮助。",
|
||||
"encryption": "此项设置通常应该处于关闭状态。",
|
||||
"resources": "资源文件在运行 Grasscutter 服务器时是必要的。此选项在已经存在资源文件时不可选。",
|
||||
"emergency_metadata": "在出现意外情况时,自动将元数据恢复至原始版本",
|
||||
"emergency_rsa": "在出现意外情况时自动将 RSA 恢复到原始版本",
|
||||
"use_proxy": "使用 Cultivation 的内置代理。除非你使用 Fiddler 等软件,否则应启用此项。",
|
||||
"patch_metadata": "自动修改和恢复游戏元数据。除非要游玩旧版本/非官方版本,抑或你已经手动修改了元数据,否则应启用此项。"
|
||||
"patch_rsa": "自动修改和恢复 RSA 补丁。 除非您玩的是旧版/非官方版本,或者您手动修改了 RSA,否则应该启用此功能。",
|
||||
"add_delay": "在 3dmigoto 加载程序中设置延迟! \n这应该可以解决加载问题,但会在启动游戏时加载 3dmigoto 时增加一点延迟。 \n您现在可以再次使用 3dmigoto 启动。",
|
||||
"migoto": "用于从 GameBanana 导入模型"
|
||||
},
|
||||
"swag": {
|
||||
"akebi_name": "Akebi",
|
||||
|
||||
@@ -14,8 +14,9 @@
|
||||
"enabled": "已啟用",
|
||||
"disabled": "未啟用",
|
||||
"game_path": "選擇遊戲安裝路徑",
|
||||
"game_command": "遊戲啟動命令",
|
||||
"game_executable": "選擇遊戲執行檔",
|
||||
"recover_metadata": "緊急恢復Metadata",
|
||||
"recover_rsa": "緊急恢復RSA",
|
||||
"grasscutter_jar": "選擇伺服器JAR檔案",
|
||||
"toggle_encryption": "設定加密",
|
||||
"install_certificate": "安裝代理憑證",
|
||||
@@ -24,10 +25,14 @@
|
||||
"language": "語言",
|
||||
"background": "選擇自定義背景(網址或檔案)",
|
||||
"theme": "選擇主題",
|
||||
"patch_metadata": "自動修補Metadata",
|
||||
"use_proxy": "使用內建代理伺服器"
|
||||
"patch_rsa": "自動修補RSA",
|
||||
"use_proxy": "使用內建代理伺服器",
|
||||
"wipe_login": "擦除登錄緩存",
|
||||
"horny_mode": "Horny模式",
|
||||
"auto_mongodb": "自動啟動 MongoDB"
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "下載Grasscutter多合一下載",
|
||||
"grasscutter_stable_data": "下載Grasscutter穩定版數據(Data)",
|
||||
"grasscutter_latest_data": "下載Grasscutter開發板數據(Data)",
|
||||
"grasscutter_stable_data_update": "更新Grasscutter穩定版數據(Data)",
|
||||
@@ -37,7 +42,11 @@
|
||||
"grasscutter_stable_update": "更新Grasscutter穩定版",
|
||||
"grasscutter_latest_update": "更新Grasscutter開發板",
|
||||
"resources": "下載Grasscutter資源(Resources)",
|
||||
"game": "下載遊戲"
|
||||
"game": "下載遊戲",
|
||||
"aio_header": "多合一下載:",
|
||||
"individual_header": "個別部分下載:",
|
||||
"mods_header": "Mods:",
|
||||
"migoto": "下載GIMI 3dmigoto"
|
||||
},
|
||||
"download_status": {
|
||||
"downloading": "下載中",
|
||||
@@ -50,6 +59,7 @@
|
||||
"select_file": "選擇檔案或資料夾...",
|
||||
"select_folder": "選擇資料夾...",
|
||||
"download": "下載",
|
||||
"delete": "刪除",
|
||||
"install": "安裝"
|
||||
},
|
||||
"news": {
|
||||
@@ -60,14 +70,17 @@
|
||||
"port_help_text": "確保這是Dispatch伺服器端口,不是遊戲伺服器端口。 大部分伺服器的端口都是443。",
|
||||
"game_help_text": "您不需要另外一個遊戲備份來使用Grasscutter。這是給想要降級到2.6或者還沒安裝遊戲的人使用的。",
|
||||
"gc_stable_jar": "下載當前的Grasscutter穩定版本,包括JAR答案還有資料文件。",
|
||||
"gc_fullbuild": "下載完整的 Grasscutter 構建版本,包括存儲庫、jar 和資源。 已完全設置,不需要從此菜單下載任何其他內容",
|
||||
"gc_dev_jar": "下載當前的Grasscutter穩定版本資料文件,其中不會附帶JAR文件。這個選項在更新時很有用。",
|
||||
"gc_stable_data": "下載當前最新的Grasscutter開發版本資料文件,其中不會附帶JAR文件。這個選項在更新時很有用。",
|
||||
"gc_dev_data": "下載當前最新的Grasscutter開發版本的資料文件,其中不會附帶JAR文件。這個選項在更新時很有用。",
|
||||
"encryption": "在正常情況下,此選項應該被關閉。",
|
||||
"resources": "資源文件在架設一個Grasscutter伺服器時是必要的。 這個選項會在您已經有裡面有檔案的資源資料夾時不可選。",
|
||||
"emergency_metadata": "一旦有東西出了問題,此選項可以把您的Metadata恢復成官方版本。",
|
||||
"emergency_rsa": "一旦有東西出了問題,此選項可以把您的rsa恢復成官方版本。",
|
||||
"use_proxy": "使用Cultivation內建的代理伺服器。此選項應該被啟用,除非你使用其他的代理伺服器。",
|
||||
"patch_metadata": "自動修補和恢復Metadata。除非您的遊戲版本是舊的或者是非官方的,此選項應該被啟用。"
|
||||
"patch_rsa": "自動修補和恢復RSA。除非您的遊戲版本是舊的或者是非官方的,此選項應該被啟用。",
|
||||
"add_delay": "在 3dmigoto 加載程序中設置延遲! \n這應該可以解決加載問題,但會在啟動遊戲時加載 3dmigoto 時增加一點延遲。 \n您現在可以再次使用 3dmigoto 啟動。",
|
||||
"migoto": "用於從 GameBanana 導入模型"
|
||||
},
|
||||
"swag": {
|
||||
"akebi_name": "Akebi",
|
||||
|
||||
@@ -15,17 +15,23 @@
|
||||
"disabled": "Deaktiviert",
|
||||
"game_path": "Spielpfad",
|
||||
"game_executable": "Spiel Datei auswählen",
|
||||
"recover_metadata": "Notfall Wiederherstellung der Metadaten",
|
||||
"recover_rsa": "Notfall Wiederherstellung der RSA",
|
||||
"grasscutter_jar": "Grasscuter JAR auswählen",
|
||||
"toggle_encryption": "Verschlüsselung umschalten",
|
||||
"install_certificate": "Installeer proxy certificaat",
|
||||
"java_path": "Benutzerdefinierten Java Pfad setzen",
|
||||
"grasscutter_with_game": "Grasscutter automatisch mit dem Spiel starten",
|
||||
"language": "Sprache auswählen",
|
||||
"background": "Benutzerdefinierten Hintergrund festlegen (link oder bild)",
|
||||
"theme": "Theme auswählen",
|
||||
"patch_metadata": "Metadaten automatisch patchen"
|
||||
"patch_rsa": "RSA automatisch patchen",
|
||||
"use_proxy": "Gebruik interne proxy",
|
||||
"wipe_login": "Wis de inlogcache",
|
||||
"horny_mode": "Geile modus",
|
||||
"auto_mongodb": "Start automatisch MongoDB"
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "Alles in Einem Grasscutter Daten herunterladen",
|
||||
"grasscutter_stable_data": "Stabile Grasscutter Daten herunterladen",
|
||||
"grasscutter_latest_data": "Aktuellste Grasscutter Daten herunterladen",
|
||||
"grasscutter_stable_data_update": "Stabile Grasscutter Daten aktualisieren",
|
||||
@@ -35,7 +41,11 @@
|
||||
"grasscutter_stable_update": "Stabile Grasscutter Version aktualisieren",
|
||||
"grasscutter_latest_update": "Aktuellste Grasscutter Version aktualisieren",
|
||||
"resources": "Grasscutter Ressourcen herunterladen",
|
||||
"game": "Spiel herunterladen"
|
||||
"game": "Spiel herunterladen",
|
||||
"aio_header": "Alles in Einem herunterladen",
|
||||
"individual_header": "Einzelne Teile herunterladen:",
|
||||
"mods_header": "Mods:",
|
||||
"migoto": "GIMI 3dmigoto herunterladen"
|
||||
},
|
||||
"download_status": {
|
||||
"downloading": "Lädt herunter",
|
||||
@@ -48,6 +58,7 @@
|
||||
"select_file": "Datei oder Ordner auswählen...",
|
||||
"select_folder": "Ordner auswählen...",
|
||||
"download": "Herunterladen",
|
||||
"delete": "Löschen",
|
||||
"install": "Installieren"
|
||||
},
|
||||
"news": {
|
||||
@@ -58,13 +69,16 @@
|
||||
"port_help_text": "Vergewissern Sie sich, dass es sich um den Port des Dispatch-Servers handelt, nicht um den Port des Spiel-Servers. Dieser ist fast immer '443'.",
|
||||
"game_help_text": "Sie müssen keine separate Kopie verwenden, um mit Grasscutter zu spielen. Dies ist entweder für ein Downgrade auf die Version 2.6 oder wenn Sie das Spiel nicht installiert haben.",
|
||||
"gc_stable_jar": "Laden Sie den aktuellen stabilen Grasscutter-Build herunter, der eine Jar-Datei und Datendateien enthält.",
|
||||
"gc_fullbuild": "Download een volledige Grasscutter-build, inclusief repo, jar en bronnen. Is volledig ingesteld en vereist geen andere downloads uit dit menu",
|
||||
"gc_dev_jar": "Laden Sie die neueste Grasscutter-Entwicklungsversion herunter, welche eine Jar-Datei und Datendateien enthält.",
|
||||
"gc_stable_data": "Laden Sie die stabilen Grasscutter Daten herunter, welche keine Jar-Datei enthalten. Dies ist nützlich zum Aktualisieren.",
|
||||
"gc_dev_data": "Laden Sie die neuesten Grasscutter-Entwicklungsdateien herunter, welche keine Jar-Datei enthält. Dies ist nützlich zum Aktualisieren.",
|
||||
"resources": "Diese werden auch benötigt, um einen Grasscutter-Server auszuführen. Diese Schaltfläche ist grau, wenn Sie einen bestehenden Ressourcenordner mit Inhalten haben",
|
||||
"emergency_metadata": "Im Fall, dass etwas schief laufen sollte, kannst du deine Metadaten auf die letzte offizielle Version zurücksetzen",
|
||||
"emergency_rsa": "Im Fall, dass etwas schief laufen sollte, kannst du deine RSA auf die letzte offizielle Version zurücksetzen",
|
||||
"use_proxy": "Nutze den internen Proxy von Cultivation. Du solltest dies aktivieren, es sei denn du nutzt Programme wie Fiddler",
|
||||
"patch_metadata": "Patche und aktualisiere deine Metadaten automatisch. Solange du nicht mit einer alten/nicht offiziellen Version spielst oder deine Metadaten manuell gepatcht hast, sollte dies aktiviert sein."
|
||||
"patch_rsa": "Patche und aktualisiere deine RSA automatisch. Solange du nicht mit einer alten/nicht offiziellen Version spielst oder deine RSA manuell gepatcht hast, sollte dies aktiviert sein.",
|
||||
"add_delay": "Verzögerung im 3dmigoto-Lader einstellen! \nDies sollte die Ladeprobleme beheben, führt aber zu einer kleinen Verzögerung, wenn 3dmigoto beim Start des Spiels geladen wird. \nSie können nun wieder mit 3dmigoto starten.",
|
||||
"migoto": "Zum Importieren von Modellen von GameBanana"
|
||||
},
|
||||
"swag": {
|
||||
"akebi_name": "Akebi",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"main": {
|
||||
"title": "Cultivation",
|
||||
"launch_button": "Launch",
|
||||
"gc_enable": "Connect via Grasscutter",
|
||||
"gc_enable": "Connect to Grasscutter",
|
||||
"https_enable": "Use HTTPS",
|
||||
"ip_placeholder": "Server Address...",
|
||||
"port_placeholder": "Port...",
|
||||
@@ -14,8 +14,9 @@
|
||||
"enabled": "Enabled",
|
||||
"disabled": "Disabled",
|
||||
"game_path": "Set Game Install Path",
|
||||
"game_command": "Game Launch Command",
|
||||
"game_executable": "Set Game Executable",
|
||||
"recover_metadata": "Emergency Metadata Recovery",
|
||||
"recover_rsa": "Emergency Delete RSA",
|
||||
"grasscutter_jar": "Set Grasscutter JAR",
|
||||
"toggle_encryption": "Toggle Encryption",
|
||||
"install_certificate": "Install Proxy Certificate",
|
||||
@@ -24,10 +25,14 @@
|
||||
"language": "Select Language",
|
||||
"background": "Set Custom Background (link or image file)",
|
||||
"theme": "Set Theme",
|
||||
"patch_metadata": "Automatically Patch Metadata",
|
||||
"use_proxy": "Use Internal Proxy"
|
||||
"patch_rsa": "Automatically Patch RSA",
|
||||
"use_proxy": "Use Internal Proxy",
|
||||
"wipe_login": "Wipe Login Cache",
|
||||
"horny_mode": "Horny Mode",
|
||||
"auto_mongodb": "Automatically Start MongoDB"
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "Download Grasscutter All-in-One",
|
||||
"grasscutter_stable_data": "Download Grasscutter Stable Data",
|
||||
"grasscutter_latest_data": "Download Grasscutter Latest Data",
|
||||
"grasscutter_stable_data_update": "Update Grasscutter Stable Data",
|
||||
@@ -37,7 +42,11 @@
|
||||
"grasscutter_stable_update": "Update Grasscutter Stable",
|
||||
"grasscutter_latest_update": "Update Grasscutter Latest",
|
||||
"resources": "Download Grasscutter Resources",
|
||||
"game": "Download Game"
|
||||
"game": "Download Game",
|
||||
"aio_header": "All-in-One Downloads:",
|
||||
"individual_header": "Individual downloads:",
|
||||
"mods_header": "Mods:",
|
||||
"migoto": "Download GIMI 3dmigoto"
|
||||
},
|
||||
"download_status": {
|
||||
"downloading": "Downloading",
|
||||
@@ -50,6 +59,7 @@
|
||||
"select_file": "Select file or folder...",
|
||||
"select_folder": "Select folder...",
|
||||
"download": "Download",
|
||||
"delete": "Delete",
|
||||
"install": "Install"
|
||||
},
|
||||
"news": {
|
||||
@@ -60,20 +70,23 @@
|
||||
"port_help_text": "Ensure this is the Dispatch server port, not the Game server port. This is almost always '443'.",
|
||||
"game_help_text": "You do not need to use a separate copy to play with Grasscutter. This is for either downgrading to 2.6 or if you do not have the game installed.",
|
||||
"gc_stable_jar": "Download the current stable Grasscutter build, which includes jar file and data files.",
|
||||
"gc_fullbuild": "Download a full Grasscutter build, including repo, jar, and resources. Is fully set up and does not require any other downloads from this menu.",
|
||||
"gc_dev_jar": "Download the latest development Grasscutter build, which includes jar file and data files.",
|
||||
"gc_stable_data": "Download the current stable Grasscutter data files, which does not come with a jar file. This is useful for updating.",
|
||||
"gc_dev_data": "Download the latest development Grasscutter data files, which does not come with a jar file. This is useful for updating.",
|
||||
"encryption": "This should usually be disabled.",
|
||||
"resources": "These are also required to run a Grasscutter server. This button will be grey if you have an existing resources folder with contents inside",
|
||||
"emergency_metadata": "In case something went wrong, restore your metadata to the latest official versions metadata.",
|
||||
"emergency_rsa": "In case something went wrong, force delete RSA patch.",
|
||||
"use_proxy": "Use the Cultivation internal proxy. You should have this enabled unless you use something like Fiddler",
|
||||
"patch_metadata": "Patch and unpatch your game metadata automatically. Unless playing with old/non-official versions, or you have manually patched your metadata, this should be enabled."
|
||||
"patch_rsa": "Patch and unpatch your game RSA automatically. Unless playing with old/non-official versions (3.0 and older), this should be enabled.",
|
||||
"add_delay": "Set delay in 3dmigoto loader! \nThis should fix loading issues, but will add a small delay to when 3dmigoto is loaded upon launching the game. \nYou can now launch with 3dmigoto again.",
|
||||
"migoto": "For importing models from GameBanana"
|
||||
},
|
||||
"swag": {
|
||||
"akebi_name": "Akebi",
|
||||
"migoto_name": "Migoto",
|
||||
"reshade_name": "Reshade",
|
||||
"akebi": "Set Akebi Executable",
|
||||
"akebi": "Set Akebi/Acrepi Executable",
|
||||
"migoto": "Set 3DMigoto Executable",
|
||||
"reshade": "Set Reshade Injector"
|
||||
}
|
||||
|
||||
@@ -14,8 +14,9 @@
|
||||
"enabled": "Activado",
|
||||
"disabled": "Desactivado",
|
||||
"game_path": "Ruta de instalación del juego",
|
||||
"game_command": "Comando de lanzamiento del juego",
|
||||
"game_executable": "Establecer ejecutable del juego",
|
||||
"recover_metadata": "Recuperación de Metadatos de Emergencia",
|
||||
"recover_rsa": "Recuperación de RSA de Emergencia",
|
||||
"grasscutter_jar": "Establecer JAR de Grasscutter",
|
||||
"toggle_encryption": "Alternar Cifrado",
|
||||
"install_certificate": "Instalar Certificado Proxie",
|
||||
@@ -23,9 +24,15 @@
|
||||
"grasscutter_with_game": "Iniciar automáticamente Grasscutter con el juego",
|
||||
"language": "Seleccionar Idioma",
|
||||
"background": "Establecer Fondo Personalizado (link o archivo de imagen)",
|
||||
"theme": "Establecer Tema"
|
||||
"patch_rsa": "Parchear RSA automáticamente",
|
||||
"theme": "Establecer Tema",
|
||||
"use_proxy": "Usar proxy interno",
|
||||
"wipe_login": "Borrar caché de inicio de sesión",
|
||||
"horny_mode": "Modo cachondo",
|
||||
"auto_mongodb": "Iniciar automáticamente MongoDB"
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "Descargar Datos todo en uno de Grasscutter",
|
||||
"grasscutter_stable_data": "Descargar Datos Estables de Grasscutter",
|
||||
"grasscutter_latest_data": "Descargar Datos más Recientes de Grasscutter",
|
||||
"grasscutter_stable_data_update": "Actualizar Datos Estables de Grasscutter",
|
||||
@@ -35,7 +42,11 @@
|
||||
"grasscutter_stable_update": "Actualizar Grasscutter Estable",
|
||||
"grasscutter_latest_update": "Actualizar Grasscutter más reciente",
|
||||
"resources": "Descargar Recursos de Grasscutter",
|
||||
"game": "Descarga el juego"
|
||||
"game": "Descarga el juego",
|
||||
"aio_header": "Descargas todo en uno:",
|
||||
"individual_header": "Descargas de piezas individuales:",
|
||||
"mods_header": "Mods:",
|
||||
"migoto": "Descargar GIMI 3dmigoto"
|
||||
},
|
||||
"download_status": {
|
||||
"downloading": "Descargando",
|
||||
@@ -48,6 +59,7 @@
|
||||
"select_file": "Seleccionar el archivo o carpeta...",
|
||||
"select_folder": "Seleccionar la carpeta...",
|
||||
"download": "Descargar",
|
||||
"delete": "Borrar",
|
||||
"install": "Instalar"
|
||||
},
|
||||
"news": {
|
||||
@@ -58,10 +70,13 @@
|
||||
"port_help_text": "Asegúrese de que este sea el Dispatch server port, no el Game server port. Este es casi siempre '443'.",
|
||||
"game_help_text": "No necesitas usar una copia separada para jugar con Grasscutter. Esto es para cambiar a 2.6 o si no tienes el juego instalado.",
|
||||
"gc_stable_jar": "Descargue la versión Estable actual de Grasscutter, que incluye el archivo jar y los archivos de datos.",
|
||||
"gc_fullbuild": "Descarga una compilación completa de Grasscutter, incluyendo repo, jar y recursos. Está totalmente configurado y no requiere ninguna otra descarga desde este menú.",
|
||||
"gc_dev_jar": "Descargue la última versión de Desarrollo de Grasscutter, que incluye archivos jar y archivos de datos.",
|
||||
"gc_stable_data": "Descargue los archivos de Datos Estables actuales de Grasscutter, que no vienen con un archivo jar. Esto es útil para actualizar.",
|
||||
"gc_dev_data": "Descargue los últimos archivos de Datos de Desarrollo de Grasscutter, que no vienen con un archivo jar. Esto es útil para actualizar.",
|
||||
"resources": "Estos también son necesarios para ejecutar un servidor Grasscutter. Este botón estará gris si tiene una carpeta de recursos existente con contenido dentro."
|
||||
"resources": "Estos también son necesarios para ejecutar un servidor Grasscutter. Este botón estará gris si tiene una carpeta de recursos existente con contenido dentro.",
|
||||
"add_delay": "¡Retraso en el cargador de 3dmigoto! \nEsto debería solucionar los problemas de carga, pero añadirá un pequeño retraso cuando 3dmigoto se cargue al iniciar el juego. \nAhora puede iniciar con 3dmigoto de nuevo.",
|
||||
"migoto": "Para importar modelos de GameBanana"
|
||||
},
|
||||
"swag": {
|
||||
"akebi": "Establecer el ejecutable de Akebi"
|
||||
|
||||
@@ -13,16 +13,26 @@
|
||||
"options": {
|
||||
"enabled": "active",
|
||||
"disabled": "desactiver",
|
||||
"game_path": "Définir le chemin d'installation du jeu",
|
||||
"game_command": "Commande de lancement du jeu",
|
||||
"game_executable": "definir l'executable du jeu",
|
||||
"recover_rsa": "Récupération d'urgence des RSA",
|
||||
"grasscutter_jar": "definir le Jar Grasscutter",
|
||||
"toggle_encryption": "activer l'encryption",
|
||||
"install_certificate": "Installer le certificat du proxy",
|
||||
"java_path": "definir un chemin java personnalise",
|
||||
"grasscutter_with_game": "Lancer Grasscutter automatiquement avec le jeu",
|
||||
"language": "Choisir la langue",
|
||||
"background": "definir un arriere plan personnalise (lien ou fichier image)",
|
||||
"theme": "definir un theme"
|
||||
"theme": "definir un theme",
|
||||
"patch_rsa": "Corriger automatiquement les RSA",
|
||||
"use_proxy": "Utiliser un proxy interne",
|
||||
"wipe_login": "Effacer le cache de connexion",
|
||||
"horny_mode": "Mode excitation",
|
||||
"auto_mongodb": "Démarrer automatiquement MongoDB"
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "Telecharger Grasscutter tout-en-un",
|
||||
"grasscutter_stable_data": "Telecharger les donnees de Grasscutter (version stable)",
|
||||
"grasscutter_latest_data": "Telecharger les donnees de Grasscutter (derniere version)",
|
||||
"grasscutter_stable_data_update": "Mettre a jour les donnees de Grasscutter (version stable)",
|
||||
@@ -31,7 +41,11 @@
|
||||
"grasscutter_latest": "Telecharger Grasscutter (derniere version)",
|
||||
"grasscutter_stable_update": "Mettre a jour Grasscutter (version stable)",
|
||||
"grasscutter_latest_update": "Mettre a jour Grasscutter (derniere version)",
|
||||
"resources": "Telecharger les ressources logicielles de Grasscutter"
|
||||
"resources": "Telecharger les ressources logicielles de Grasscutter",
|
||||
"aio_header": "Telechargements tout-en-un:",
|
||||
"individual_header": "Telechargements de pièces individuelles:",
|
||||
"mods_header": "Mods:",
|
||||
"migoto": "Telecharger GIMI 3dmigoto"
|
||||
},
|
||||
"download_status": {
|
||||
"downloading": "Telechargement",
|
||||
@@ -43,7 +57,9 @@
|
||||
"components": {
|
||||
"select_file": "choisir fichier ou dossier...",
|
||||
"select_folder": "choisir dossier...",
|
||||
"download": "Telecharger"
|
||||
"download": "Telecharger",
|
||||
"delete": "Supprimer",
|
||||
"install": "Installer"
|
||||
},
|
||||
"news": {
|
||||
"latest_commits": "Recents Commits",
|
||||
@@ -53,9 +69,12 @@
|
||||
"port_help_text": "Assurez-vous que c'est le port serveur Dispatch, et non le port du serveur de jeu. C'est presque toujours '433'.",
|
||||
"game_help_text": "Vous n'avez pas besoin d'une copie differente du jeu pour jouer avec Grasscutter. Cela est ou pour retrograder en 2.6 ou si vous n'avez pas le jeu d'installe",
|
||||
"gc_stable_jar": "Telecharger le dernier build stable de Grasscutter, ce qui inclut le fichier jar et les fichiers de donnees",
|
||||
"gc_fullbuild": "Téléchargez un build complet de Grasscutter, incluant le repo, le jar et les ressources. Il est entièrement configuré et ne nécessite aucun autre téléchargement à partir de ce menu.",
|
||||
"gc_dev_jar": "Telecharger le dernier build en development de Grasscutter, ce qui inclut le fichier jar et les fichiers de donnees",
|
||||
"gc_stable_data": "Telecharger le dernier build stable de Grasscutter, ce qui n'inclut pasle fichier jar. Cela est utile pour mettre a jour",
|
||||
"gc_dev_data": "Telecharger le dernier build en development de Grasscutter, ce qui n'inclut pasle fichier jar. Cela est utile pour mettre a jour",
|
||||
"resources": "Les ressources sont aussi necessaires pour lancer un serveur Grasscutter. Ce bouton deviendra gris si vous avez deja un fichier ressources avec les donnees dedans."
|
||||
"resources": "Les ressources sont aussi necessaires pour lancer un serveur Grasscutter. Ce bouton deviendra gris si vous avez deja un fichier ressources avec les donnees dedans.",
|
||||
"add_delay": "Définir un délai dans le chargeur de 3dmigoto ! \nCela devrait résoudre les problèmes de chargement, mais ajoutera un petit délai au chargement de 3dmigoto lors du lancement du jeu. \nVous pouvez maintenant lancer le jeu avec 3dmigoto.",
|
||||
"migoto": "Pour importer des modèles depuis GameBanana"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,15 +10,28 @@
|
||||
"files_extracting": "MengExtract File: "
|
||||
},
|
||||
"options": {
|
||||
"game_executable": "Set Game Executable",
|
||||
"enabled": "Diaktifkan",
|
||||
"disabled": "Dinonaktifkan",
|
||||
"game_path": "Mengatur jalur penginstalan game",
|
||||
"game_command": "Perintah peluncuran game",
|
||||
"game_executable": "Mengatur game yang dapat dieksekusi",
|
||||
"recover_rsa": "Pemulihan RSA darurat",
|
||||
"grasscutter_jar": "Path ke Grasscutter JAR",
|
||||
"toggle_encryption": "Alihkan enkripsi",
|
||||
"install_certificate": "Instal sertifikat proxy",
|
||||
"java_path": "Atur kustom Java path",
|
||||
"grasscutter_with_game": "Otomatis Menjalankan Grasscutter Dengan Game",
|
||||
"language": "Pilih Bahasa",
|
||||
"background": "Atur Kustom Latar Belakang (link atau gambar file)",
|
||||
"theme": "Atur Tema"
|
||||
"theme": "Atur Tema",
|
||||
"patch_rsa": "Automatically Patch RSA",
|
||||
"use_proxy": "Gunakan Proxy Internal",
|
||||
"wipe_login": "Menghapus Cache Login",
|
||||
"horny_mode": "Mode Terangsang",
|
||||
"auto_mongodb": "Mulai MongoDB secara otomatis"
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "Sedang Mendownload Grasscutter Semua Dalam Satu",
|
||||
"grasscutter_stable_data": "Sedang Mendownload Grasscutter Versi Stabil",
|
||||
"grasscutter_latest_data": "Sedang Mendownload Grasscutter Data Terbaru",
|
||||
"grasscutter_stable_data_update": "Memperbaharui Grasscutter Data Stabil",
|
||||
@@ -27,7 +40,11 @@
|
||||
"grasscutter_latest": "Download Grasscutter Terbaru Version",
|
||||
"grasscutter_stable_update": "Sedang MengUpdate Grasscutter Stabil",
|
||||
"grasscutter_latest_update": "Sedang MengUpdate Grasscutter Terbaru",
|
||||
"resources": "Mendownload Grasscutter Resources"
|
||||
"resources": "Mendownload Grasscutter Resources",
|
||||
"aio_header": "Unduhan Semua Dalam Satu:",
|
||||
"individual_header": "Unduhan Bagian Individual:",
|
||||
"mods_header": "Mods:",
|
||||
"migoto": "Sedang Mendownload GIMI 3dmigoto"
|
||||
},
|
||||
"download_status": {
|
||||
"downloading": "Sedang Mendownload",
|
||||
@@ -39,7 +56,8 @@
|
||||
"components": {
|
||||
"select_file": "Pilih File Atau Folder...",
|
||||
"select_folder": "Pilih Folder...",
|
||||
"download": "download"
|
||||
"download": "download",
|
||||
"delete": "Menghapus"
|
||||
},
|
||||
"news": {
|
||||
"latest_commits": "Commit Terbaru",
|
||||
@@ -49,9 +67,12 @@
|
||||
"port_help_text": "Pastikan ini adalah port server port, bukan port server Game. ini Hampir Selalu '443'.",
|
||||
"game_help_text": "Anda tidak perlu menggunakan salinan Genshin Impact untuk bermain dengan Grasscutter. Ini untuk menurunkan versi ke 2.6 atau jika Anda belum menginstal game..",
|
||||
"gc_stable_jar": "Unduh Build Stabil Grasscutter Saat ini, Dimana Ada Jar File Dan Data File.",
|
||||
"gc_fullbuild": "Unduh versi lengkap Grasscutter, termasuk repo, jar, dan sumber daya. Sudah diatur sepenuhnya dan tidak memerlukan unduhan lain dari menu ini.",
|
||||
"gc_dev_jar": "Unduh Build Development Grasscutter saat ini, Dimana Ada Jar File Dan Data File.",
|
||||
"gc_stable_data": "Unduh file data Grasscutter stabil saat ini, dimana Tidak Ada JAR file. Ini Berguna Untuk memperbarui.",
|
||||
"gc_dev_data": "Unduh file data Grasscutter Development saat ini, dimana Tidak Ada JAR file. Ini Berguna Untuk memperbarui.",
|
||||
"resources": "Ini juga diperlukan untuk menjalankan server Grasscutter. Tombol ini akan berwarna abu-abu jika Anda memiliki folder Resource yang ada dengan File di dalamnya"
|
||||
"resources": "Ini juga diperlukan untuk menjalankan server Grasscutter. Tombol ini akan berwarna abu-abu jika Anda memiliki folder Resource yang ada dengan File di dalamnya",
|
||||
"add_delay": "Atur penundaan di pemuat 3dmigoto! \nIni akan memperbaiki masalah pemuatan, tetapi akan menambah sedikit penundaan ketika 3dmigoto dimuat saat meluncurkan game. \nAnda sekarang dapat meluncurkan dengan 3dmigoto lagi.",
|
||||
"migoto": "Untuk mengimpor model dari GameBanana"
|
||||
}
|
||||
}
|
||||
|
||||
93
src-tauri/lang/ko.json
Normal file
93
src-tauri/lang/ko.json
Normal file
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"lang_name": "한국어",
|
||||
"main": {
|
||||
"title": "Cultivation",
|
||||
"launch_button": "게임 시작",
|
||||
"gc_enable": "Grasscutter 연결",
|
||||
"https_enable": "HTTPS 사용",
|
||||
"ip_placeholder": "서버 주소",
|
||||
"port_placeholder": "포트",
|
||||
"files_downloading": "파일 다운로드 중: ",
|
||||
"files_extracting": "파일 추출 중: "
|
||||
},
|
||||
"options": {
|
||||
"enabled": "활성",
|
||||
"disabled": "비활성",
|
||||
"game_path": "게임 설치 경로 설정",
|
||||
"game_command": "게임 시작 명령",
|
||||
"game_executable": "게임 실행 파일 설정",
|
||||
"recover_rsa": "긴급 RSA 복원",
|
||||
"grasscutter_jar": "그래스커터 JAR 설정",
|
||||
"toggle_encryption": "암호화 전환",
|
||||
"install_certificate": "프록시 인증서 설치",
|
||||
"java_path": "사용자 지정 Java 경로 설정",
|
||||
"grasscutter_with_game": "게임에서 자동으로 그래스커터 실행",
|
||||
"language": "언어 선택",
|
||||
"background": "사용자 지정 배경 설정(링크 또는 이미지 파일)",
|
||||
"theme": "테마 설정",
|
||||
"patch_rsa": "RSA 패치 자동 적용",
|
||||
"use_proxy": "내부 프록시 사용",
|
||||
"wipe_login": "로그인 캐시 지우기",
|
||||
"horny_mode": "Horny 모드",
|
||||
"auto_mongodb": "MongoDB 자동 시작"
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "올인원 Grasscutter 다운로드",
|
||||
"grasscutter_stable_data": "안정적인 데이터 다운로드",
|
||||
"grasscutter_latest_data": "최신 데이터 다운로드",
|
||||
"grasscutter_stable_data_update": "안정적 데이터 업데이트",
|
||||
"grasscutter_latest_data_update": "최신 데이터 업데이트",
|
||||
"grasscutter_stable": "안정 다운로드",
|
||||
"grasscutter_latest": "최신 다운로드",
|
||||
"grasscutter_stable_update": "안정 업데이트",
|
||||
"grasscutter_latest_update": "최신 업데이트",
|
||||
"resources": "리소스 다운로드",
|
||||
"game": "게임 다운로드",
|
||||
"aio_header": "올인원 다운로드",
|
||||
"individual_header": "개별 부품 다운로드:",
|
||||
"mods_header": "Mods:",
|
||||
"migoto": "GIMI 3dmigoto 다운로드"
|
||||
},
|
||||
"download_status": {
|
||||
"downloading": "다운로드 중",
|
||||
"extracting": "추출 중",
|
||||
"error": "오류",
|
||||
"finished": "완료",
|
||||
"stopped": "중지"
|
||||
},
|
||||
"components": {
|
||||
"select_file": "파일 또는 폴더 선택...",
|
||||
"select_folder": "폴더 선택...",
|
||||
"download": "다운로드",
|
||||
"delete": "삭제",
|
||||
"install": "설치"
|
||||
},
|
||||
"news": {
|
||||
"latest_commits": "공지 사항",
|
||||
"latest_version": "최신 버전"
|
||||
},
|
||||
"help": {
|
||||
"port_help_text": "게임 서버 포트가 아닌 패치 서버 포트인지 확인하십시오. (기본 포트: 443)",
|
||||
"game_help_text": "그래스커터를 사용하기 위해 별도의 복사본을 사용할 필요가 없습니다. 이는 2.6으로 다운그레이드 하거나 게임을 설치하지 않은 경우에 적용됩니다.",
|
||||
"gc_stable_jar": "jar 파일과 데이터 파일이 포함된 현재 안정적인 Grasscuter 빌드를 다운로드합니다.",
|
||||
"gc_fullbuild": "저장소, 저장소, 리소스를 포함한 Grasscutter 정식 버전을 다운로드하세요. 모든 준비가 완료되었으며 이 메뉴에서 다른 다운로드는 필요하지 않습니다.",
|
||||
"gc_dev_jar": "jar 파일 및 데이터 파일이 포함된 최신 개발 Grasscuter 빌드를 다운로드하십시오.",
|
||||
"gc_stable_data": "jar 파일과 함께 제공되지 않는 현재 안정적인 Grasscuter 데이터 파일을 다운로드합니다. 이것은 업데이트하는 데 유용합니다.",
|
||||
"gc_dev_data": "jar 파일과 함께 제공되지 않는 최신 개발 Grasscuter 데이터 파일을 다운로드합니다. 이것은 업데이트하는 데 유용합니다.",
|
||||
"encryption": "일반적으로 이 기능을 사용하지 않도록 설정해야 합니다.",
|
||||
"resources": "또한 Grasscutter 서버를 실행하는 데도 필요합니다. 내용이 포함된 기존 리소스 폴더가 있는 경우 이 버튼은 회색으로 표시됩니다",
|
||||
"emergency_rsa": "문제가 있는 경우 RSA 패치를 제거하십시오.",
|
||||
"use_proxy": "Culturation 내부 프록시를 사용합니다. 피들러와 같은 것을 사용하지 않는 한 이 기능을 활성화해야 합니다",
|
||||
"patch_rsa": "게임 RSA를 자동으로 패치 및 패치 해제합니다. 이전/비공식 버전을 사용하거나 RSA를 수동으로 패치하지 않은 경우 이 기능을 활성화해야 합니다.",
|
||||
"add_delay": "3dmigoto 로더에서 지연을 설정하세요! \n이렇게하면 로딩 문제가 해결되지만 게임을 시작할 때 3dmigoto가로드되는시기에 약간의 지연이 추가됩니다. \n이제 3dmigoto로 다시 시작할 수 있습니다.",
|
||||
"migoto": "GameBanana에서 모델 가져오기"
|
||||
},
|
||||
"swag": {
|
||||
"akebi_name": "Akebi",
|
||||
"migoto_name": "Migoto",
|
||||
"reshade_name": "Reshade",
|
||||
"akebi": "Akebi 실행 파일 설정",
|
||||
"migoto": "3DMigoto 실행 파일 설정",
|
||||
"reshade": "Reshade 인젝터 설정"
|
||||
}
|
||||
}
|
||||
@@ -14,15 +14,23 @@
|
||||
"enabled": "Iespējots",
|
||||
"disabled": "Atspējots",
|
||||
"game_executable": "Iestatīt spēles izpildāmu",
|
||||
"recover_rsa": "Avārijas RSA atjaunošana",
|
||||
"grasscutter_jar": "Iestatiet Grasscutter JAR",
|
||||
"toggle_encryption": "Pārslēgt Šifrēšanu",
|
||||
"install_certificate": "Proxy sertifikāta instalēšana",
|
||||
"java_path": "Iestatiet pielāgotu Java ceļu",
|
||||
"grasscutter_with_game": "Automātiski palaidiet Grasscutter ar spēli",
|
||||
"language": "Izvēlēties valodu",
|
||||
"background": "Iestatīt pielāgotu fonu (saite vai attēla fails)",
|
||||
"theme": "Iestatīt tēmu"
|
||||
"theme": "Iestatīt tēmu",
|
||||
"patch_rsa": "Automātiski ielāpot RSA",
|
||||
"use_proxy": "Izmantot iekšējo starpniekserveri",
|
||||
"wipe_login": "Noslaucīt pieteikšanās kešatmiņu",
|
||||
"horny_mode": "Uzbudināts režīms",
|
||||
"auto_mongodb": "Automātiski startējiet MongoDB"
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "Lejupielādējiet Grasscutter viss vienā",
|
||||
"grasscutter_stable_data": "Lejupielādējiet Grasscutter stabilos datus",
|
||||
"grasscutter_latest_data": "Lejupielādējiet Grasscutter jaunākos datus",
|
||||
"grasscutter_stable_data_update": "Atjauniniet Grasscutter stabilos datus",
|
||||
@@ -31,7 +39,11 @@
|
||||
"grasscutter_latest": "Lejupielādēt Grasscutter jaunāko",
|
||||
"grasscutter_stable_update": "Atjauniet Grasscutter stabilo",
|
||||
"grasscutter_latest_update": "Atjauniet Grasscutter jaunāko",
|
||||
"resources": "Lejupielādējiet Grasscutter resursi"
|
||||
"resources": "Lejupielādējiet Grasscutter resursi",
|
||||
"aio_header": "Lejupielādes viss vienā",
|
||||
"individual_header": "Atsevišķu daļu lejupielādes:",
|
||||
"mods_header": "Mods:",
|
||||
"migoto": "Lejupielādēt GIMI 3dmigoto"
|
||||
},
|
||||
"download_status": {
|
||||
"downloading": "Notiek lejupielāde",
|
||||
@@ -43,7 +55,8 @@
|
||||
"components": {
|
||||
"select_file": "Izvēlēties failu vai mapu...",
|
||||
"select_folder": "Izvēlēties mapu...",
|
||||
"download": "Lejupielādēt"
|
||||
"download": "Lejupielādēt",
|
||||
"delete": "Dzēst"
|
||||
},
|
||||
"news": {
|
||||
"latest_commits": "Nesen kommitus",
|
||||
@@ -53,9 +66,12 @@
|
||||
"port_help_text": "Pārliecinieties, vai tas ir Dispatch-servera ports, nevis spēļu servera ports. Tas gandrīz vienmēr ir '443'.",
|
||||
"game_help_text": "Lai spēlētu ar Grasscutter, jums nav jāizmanto atsevišķa kopija. Tas ir izveidots, lai pazeminātu versiju uz 2.6 vai ja jums nav instalēta spēle.",
|
||||
"gc_stable_jar": "Lejupielādējiet pašreizējo stabilo Grasscutter versiju, kuram ir jar failu un datu failus.",
|
||||
"gc_fullbuild": "Lejupielādējiet pilnu Grasscutter versiju, tostarp repozitorijus, krātuves un resursus. Viss ir gatavs, un no šīs izvēlnes nav nepieciešama nekāda cita lejupielāde.",
|
||||
"gc_dev_jar": "Lejupielādējiet jaunāko izstrāde Grasscutter versiju, kuram ir jar failu un datu failus.",
|
||||
"gc_stable_data": "Lejupielādējiet pašreizējos stabilos Grasscutter datu failus, kuriem nav jar fails. Tas ir noderīgi atjaunināšanai.",
|
||||
"gc_dev_data": "Lejupielādējiet jaunāko izstrāde Grasscutter datu failus, kuriem nav pievienots jar fails. Tas ir noderīgi atjaunināšanai.",
|
||||
"resources": "Tie ir nepieciešami arī Grasscutter servera darbināšanai. Šī poga būs pelēka, ja jums ir resursu mape ar saturu."
|
||||
"resources": "Tie ir nepieciešami arī Grasscutter servera darbināšanai. Šī poga būs pelēka, ja jums ir resursu mape ar saturu.",
|
||||
"add_delay": "Iestatiet kavēšanos 3dmigoto iekrāvē! \nTam vajadzētu novērst ielādes problēmas, bet tas nedaudz aizkavēs 3dmigoto ielādēšanu, uzsākot spēli. \nTagad atkal varat sākt ar 3dmigoto.",
|
||||
"migoto": "Modeļu importēšanai no GameBanana"
|
||||
}
|
||||
}
|
||||
|
||||
92
src-tauri/lang/nl.json
Normal file
92
src-tauri/lang/nl.json
Normal file
@@ -0,0 +1,92 @@
|
||||
{
|
||||
"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_rsa": "Noodherstel Van De RSA",
|
||||
"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_rsa": "RSA Automatisch Bijwerken",
|
||||
"use_proxy": "Gebruik Interne Proxy",
|
||||
"wipe_login": "Login cache wissen",
|
||||
"horny_mode": "Geile modus",
|
||||
"auto_mongodb": "Start automatisch MongoDB"
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "Grasscutter Alles-in-één Downloaden",
|
||||
"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",
|
||||
"aio_header": "Alles-in-één Downloads:",
|
||||
"individual_header": "Downloads van afzonderlijke onderdelen:",
|
||||
"mods_header": "Mods:",
|
||||
"migoto": "Download GIMI 3dmigoto"
|
||||
},
|
||||
"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",
|
||||
"delete": "Verwijder",
|
||||
"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_fullbuild": "Download een volledige Grasscutter build, inclusief repo, jar en resources. Is volledig ingesteld en vereist geen andere downloads uit dit menu.",
|
||||
"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_rsa": "Voor het geval er iets fout is gegaan, herstel uw rsa naar de laatste offici<63>le versies rsa.",
|
||||
"use_proxy": "Gebruik de Cultivation interne proxy. U zou dit ingeschakeld moeten hebben, tenzij u iets als Fiddler gebruikt",
|
||||
"patch_rsa": "Patch en unpatch je spel rsa automatisch. Tenzij je met oude/niet-offici<63>le versies speelt, of je hebt je rsa handmatig gepatcht, zou dit ingeschakeld moeten zijn.",
|
||||
"add_delay": "Vertraging instellen in 3dmigoto loader! \nDit zou laadproblemen moeten oplossen, maar zal een kleine vertraging toevoegen aan het laden van 3dmigoto bij het opstarten van het spel. \nJe kunt nu weer starten met 3dmigoto.",
|
||||
"migoto": "Voor het importeren van modellen uit GameBanana"
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
93
src-tauri/lang/pt-br.json
Normal file
93
src-tauri/lang/pt-br.json
Normal file
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"lang_name": "Português Brasileiro",
|
||||
"main": {
|
||||
"title": "Cultivation: Edição Thorny",
|
||||
"launch_button": "Iniciar",
|
||||
"gc_enable": "Conectar ao Grasscutter",
|
||||
"https_enable": "Usar HTTPS",
|
||||
"ip_placeholder": "Endereço do Servidor...",
|
||||
"port_placeholder": "Porta...",
|
||||
"files_downloading": "Baixando Arquivos: ",
|
||||
"files_extracting": "Extraindo Arquivos: "
|
||||
},
|
||||
"options": {
|
||||
"enabled": "Habilitado",
|
||||
"disabled": "Desabilitado",
|
||||
"game_path": "Definir o Local de Instalação do Jogo",
|
||||
"game_command": "Comando de Iniciação do Jogo",
|
||||
"game_executable": "Definir o Executavel do Jogo",
|
||||
"recover_rsa": "Exclusão de Emergencia de RSA",
|
||||
"grasscutter_jar": "Definir o arquivo JAR do Grasscutter",
|
||||
"toggle_encryption": "Ativar/Desativar Criptografia",
|
||||
"install_certificate": "Instalar o Certificado de Proxy",
|
||||
"java_path": "Definir um Local Customizado do Java",
|
||||
"grasscutter_with_game": "Iniciar automaticamente o Grasscutter com o Jogo",
|
||||
"language": "Selecionar Idioma",
|
||||
"background": "Definir Fundo Customizado (link ou arquivo de imagem)",
|
||||
"theme": "Definir Tema",
|
||||
"patch_rsa": "Automaticamente Corrigir RSA",
|
||||
"use_proxy": "Usar Proxy Interno",
|
||||
"wipe_login": "Limpar Cache de Login",
|
||||
"horny_mode": "Modo com tesão",
|
||||
"auto_mongodb": "Iniciar MongoDB Automaticamente"
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "Baixar o Grasscutter Tudo-em-Um",
|
||||
"grasscutter_stable_data": "Baixar os Dados do Grasscutter Estável",
|
||||
"grasscutter_latest_data": "Baixar os Dados do Grasscutter Mais Recente",
|
||||
"grasscutter_stable_data_update": "Atualizar os Dados do Grasscutter Estável",
|
||||
"grasscutter_latest_data_update": "Atualizar os Dados do Grasscutter Mais Recente",
|
||||
"grasscutter_stable": "Baixar o Grasscutter Estável",
|
||||
"grasscutter_latest": "Baixar o Grasscutter Mais Recente",
|
||||
"grasscutter_stable_update": "Atualizar o Grasscutter Estável",
|
||||
"grasscutter_latest_update": "Atualizar o Grasscutter Mais Recente",
|
||||
"resources": "Baixar os Recursos do Grasscutter ",
|
||||
"game": "Baixar o Jogo",
|
||||
"aio_header": "Downloads Tudo-em-Um:",
|
||||
"individual_header": "Downloads Individuais:",
|
||||
"mods_header": "Mods:",
|
||||
"migoto": "Baixar o GIMI 3dmigoto"
|
||||
},
|
||||
"download_status": {
|
||||
"downloading": "Baixando",
|
||||
"extracting": "Extraindo",
|
||||
"error": "Erro",
|
||||
"finished": "Finalizado",
|
||||
"stopped": "Parado"
|
||||
},
|
||||
"components": {
|
||||
"select_file": "Selecione o arquivo ou pasta...",
|
||||
"select_folder": "Selecione a pasta...",
|
||||
"download": "Baixar",
|
||||
"delete": "Deletar",
|
||||
"install": "Instalar"
|
||||
},
|
||||
"news": {
|
||||
"latest_commits": "Commits Recentes",
|
||||
"latest_version": "Versão mais Recente"
|
||||
},
|
||||
"help": {
|
||||
"port_help_text": "Certifique-se de que esta é a porta do servidor dispatch, não a porta do jogo. Ela é quase sempre '443'.",
|
||||
"game_help_text": "Você não precisa de uma cópia do jogo separada para jogar com o Grasscutter. Isso é para, ou desatualizar para a 2.6, ou se você não tiver o jogo instalado.",
|
||||
"gc_stable_jar": "Baixar a versão atual do Grasscutter estável, que inclui o arquivo jar e os arquivos de dados.",
|
||||
"gc_fullbuild": "Baixar uma versão completa do Grasscutter, incluindo a repo, jar e recursos. Ela está totalmente configurada e não requer nenhum outro download deste menu.",
|
||||
"gc_dev_jar": "Baixar a versão de desenvolvimento mais recente do Grasscutter, que inclui o arquivo jar e os arquivos de dados.",
|
||||
"gc_stable_data": "Baixar os arquivos de dados da versão atual do Grasscutter estável, que não inclui o arquivo jar. Isso é útil para atualizações.",
|
||||
"gc_dev_data": "Baixar os arquivos de dados da versão de desenvolvimento mais recente do Grasscutter, que não vem com um arquivo jar. Isso é útil para atualizações.",
|
||||
"encryption": "Isso normalmente deve estar desativado.",
|
||||
"resources": "Esses também são necessários para usar o Grasscutter. Esse botão ficará cinza caso você já tenha uma pasta resources com coisas dentro.",
|
||||
"emergency_rsa": "Caso algo dê errado, força a exclusão da correção RSA.",
|
||||
"use_proxy": "Usa o proxy interno do Cultivation. Isso deveria estar habilitado a não ser que você utilize algo como o Fiddler.",
|
||||
"patch_rsa": "Corrigir e 'descorrigir' o RSA do seu jogo automaticamente. Isso deve estar habilitado a não ser que você esteja jogando com versões antigas (3.0 ou mais antigas) ou não oficiais.",
|
||||
"add_delay": "Atraso definido na carregadeira 3dmigoto! \nIsto deve resolver os problemas de carregamento, mas acrescentará um pequeno atraso quando o 3dmigoto for carregado no lançamento do jogo. \nAgora você pode lançar novamente com o 3dmigoto.",
|
||||
"migoto": "Para importação de modelos da GameBanana"
|
||||
},
|
||||
"swag": {
|
||||
"akebi_name": "Akebi",
|
||||
"migoto_name": "Migoto",
|
||||
"reshade_name": "Reshade",
|
||||
"akebi": "Definir o Executavel do Akebi/Acrepi",
|
||||
"migoto": "Definir o Executavel do 3DMigoto",
|
||||
"reshade": "Definir o Executavel do Reshade Injector"
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
"disabled": "Выключено",
|
||||
"game_path": "Установить путь к файлам игры",
|
||||
"game_executable": "Установить исполняемый файл игры",
|
||||
"recover_metadata": "Принудительное восстановление Метаданных",
|
||||
"recover_rsa": "Принудительное удаление RSA",
|
||||
"grasscutter_jar": "Установить Grasscutter JAR",
|
||||
"toggle_encryption": "Переключить шифрование",
|
||||
"install_certificate": "Установить сертификат для работы Прокси",
|
||||
@@ -24,10 +24,14 @@
|
||||
"language": "Установить язык",
|
||||
"background": "Установить свой фон (ссылка или файл)",
|
||||
"theme": "Установить тему",
|
||||
"patch_metadata": "Автоматический патч Метаданных при запуске",
|
||||
"use_proxy": "Использовать встроенный Прокси"
|
||||
"patch_rsa": "Автоматическое исправление RSA",
|
||||
"use_proxy": "Использовать встроенный Прокси",
|
||||
"wipe_login": "Очистить кэш входа в систему",
|
||||
"horny_mode": "роговой режим",
|
||||
"auto_mongodb": "Автоматически запускать MongoDB"
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "Скачать все в одном Grasscutter",
|
||||
"grasscutter_stable_data": "Скачать стабильные данные Grasscutter",
|
||||
"grasscutter_latest_data": "Скачать последние данные Grasscutter",
|
||||
"grasscutter_stable_data_update": "Обновить стабильные данные Grasscutter",
|
||||
@@ -37,7 +41,11 @@
|
||||
"grasscutter_stable_update": "Обновить стабильную версию Grasscutter",
|
||||
"grasscutter_latest_update": "Обновить последнюю версию Grasscutter",
|
||||
"resources": "Скачать ресурсы Grasscutter",
|
||||
"game": "Скачать Игру"
|
||||
"game": "Скачать Игру",
|
||||
"aio_header": "Все в одной загрузке:",
|
||||
"individual_header": "загрузка отдельных частей:",
|
||||
"mods_header": "Mods:",
|
||||
"migoto": "Скачать GIMI 3dmigoto"
|
||||
},
|
||||
"download_status": {
|
||||
"downloading": "Скачивание",
|
||||
@@ -50,7 +58,8 @@
|
||||
"select_file": "Выберите файл или папку...",
|
||||
"select_folder": "Выберите папку...",
|
||||
"download": "Скачать",
|
||||
"install": "Установить"
|
||||
"delete": "Удалить",
|
||||
"install": "Установить"
|
||||
},
|
||||
"news": {
|
||||
"latest_commits": "Последние коммиты",
|
||||
@@ -60,14 +69,17 @@
|
||||
"port_help_text": "Убедитесь, что это порт Dispatch-сервера, не порт игрового сервера. Обычно это '443'.",
|
||||
"game_help_text": "Вам не нужно устанавливать еще одну копию, что бы играть с Grascutter. Это нужно или для версии 2.6, или если у Вас не установлена игра.",
|
||||
"gc_stable_jar": "Скачать последнюю стабильную версию Grasscutter, которая содержит jar файл и данные.",
|
||||
"gc_fullbuild": "Загрузите полную сборку Grasscutter, включая репо, jar и ресурсы. Полностью настроена и не требует других загрузок из этого меню.",
|
||||
"gc_dev_jar": "Скачать последнюю версию для разработки Grasscutter, которая содержит jar файл и данные.",
|
||||
"gc_stable_data": "Скачать стабильные данные Grasscutter, в которой нету jar файла. Это полезно для обновления.",
|
||||
"gc_dev_data": "Скачать последнюю версию для разработки Grasscutter, в которой нету jar файла. Это полезно для обновления.",
|
||||
"encryption": "Обычно это должно быть выключено.",
|
||||
"resources": "Это необходимо для запуска сервера Grasscutter. Эта кнопка будет серой, если у Вас уже есть не пустая папка с ресурсами.",
|
||||
"emergency_metadata": "Если что-то пошло не так, восстановит Метаданные до последней официальной версии.",
|
||||
"emergency_rsa": "Если что-то пошло не так, восстановит RSA до последней официальной версии.",
|
||||
"use_proxy": "Использовать встроенный Прокси. Отключите если используете Fiddler или подобную программу",
|
||||
"patch_metadata": "Патчит и восстанавливает Метаданные автоматически. Если вы не играете на старых/модифицированых версиях, или сами в ручную патчите Метаданные, эта опция должна быть включена."
|
||||
"patch_rsa": "Патчит и восстанавливает RSA автоматически. Если вы не играете на старых/модифицированых версиях, или сами в ручную патчите Метаданные, эта опция должна быть включена.",
|
||||
"add_delay": "Установите задержку в загрузчике 3dmigoto! \nЭто должно исправить проблемы с загрузкой, но добавит небольшую задержку в момент загрузки 3dmigoto при запуске игры. \nТеперь вы снова можете запускать игру с помощью 3dmigoto.",
|
||||
"migoto": "Для импорта моделей из GameBanana"
|
||||
},
|
||||
"swag": {
|
||||
"akebi_name": "Akebi",
|
||||
|
||||
@@ -14,20 +14,25 @@
|
||||
"enabled": "Bật",
|
||||
"disabled": "Tắt",
|
||||
"game_path": "Đường dẫn cài game",
|
||||
"game_command": "Lệnh khởi chạy game",
|
||||
"game_executable": "Tập tin thực thi game",
|
||||
"recover_metadata": "Khôi phục Metadata khẩn cấp",
|
||||
"recover_rsa": "Khôi phục RSA khẩn cấp",
|
||||
"grasscutter_jar": "Tập tin JAR Grasscutter",
|
||||
"toggle_encryption": "Bật/tắt mã hóa",
|
||||
"install_certificate": "Cài chứng chỉ proxy",
|
||||
"java_path": "Đường dẫn Java tùy chỉnh",
|
||||
"grasscutter_with_game": "Tự động chạy Grasscutter cùng với game",
|
||||
"language": "Chọn ngôn ngữ",
|
||||
"language": "Ngôn ngữ",
|
||||
"background": "Hình nền tùy chỉnh (liên kết hoặc tập tin hình ảnh)",
|
||||
"theme": "Giao diện",
|
||||
"patch_metadata": "Tự động sửa Metadata",
|
||||
"use_proxy": "Sử dụng proxy nội bộ"
|
||||
"patch_rsa": "Tự động vá RSA",
|
||||
"use_proxy": "Sử dụng proxy nội bộ",
|
||||
"wipe_login": "Tẩy sạch cache đăng nhập",
|
||||
"horny_mode": "Chế độ hứng tình",
|
||||
"auto_mongodb": "Tự động khởi động MongoDB"
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "Tải Grasscutter tất cả trong một",
|
||||
"grasscutter_stable_data": "Tải dữ liệu Grasscutter bản ổn định",
|
||||
"grasscutter_latest_data": "Tải dữ liệu Grasscutter bản mới nhất",
|
||||
"grasscutter_stable_data_update": "Cập nhật dữ liệu Grasscutter bản ổn định",
|
||||
@@ -37,20 +42,25 @@
|
||||
"grasscutter_stable_update": "Cập nhật Grasscutter bản ổn định",
|
||||
"grasscutter_latest_update": "Cập nhật Grasscutter bản mới nhất",
|
||||
"resources": "Tải tài nguyên Grasscutter",
|
||||
"game": "Tải game"
|
||||
"game": "Tải game",
|
||||
"aio_header": "Tải xuống tất cả trong một:",
|
||||
"individual_header": "Tải xuống từng phần:",
|
||||
"mods_header": "Mods:",
|
||||
"migoto": "Tải GIMI 3dmigoto"
|
||||
},
|
||||
"download_status": {
|
||||
"downloading": "Đang tải xuống",
|
||||
"downloading": "Đang tải",
|
||||
"extracting": "Đang giải nén",
|
||||
"error": "Lỗi",
|
||||
"finished": "Hoàn thành",
|
||||
"finished": "Đã hoàn thành",
|
||||
"stopped": "Đã dừng"
|
||||
},
|
||||
"components": {
|
||||
"select_file": "Chọn tập tin hoặc thư mục...",
|
||||
"select_folder": "Chọn thư mục...",
|
||||
"download": "Tải xuống",
|
||||
"install": "Cài đặt"
|
||||
"download": "Tải",
|
||||
"delete": "Xóa bỏ",
|
||||
"install": "Cài"
|
||||
},
|
||||
"news": {
|
||||
"latest_commits": "Thay Đổi Gần Đây",
|
||||
@@ -60,13 +70,24 @@
|
||||
"port_help_text": "Hãy đảm bảo đây là cổng của máy chủ Dispatch, không phải cổng của máy chủ game. Thường sẽ là '443'.",
|
||||
"game_help_text": "Bạn không cần phải sử dụng một bản sao riêng để chơi với Grasscutter. Việc này chỉ xảy ra nếu bạn hạ phiên bản xuống 2.6 hoặc chưa cài game.",
|
||||
"gc_stable_jar": "Tải xuống phiên bản ổn định của Grasscutter, bao gồm tập tin jar và các tệp dữ liệu.",
|
||||
"gc_fullbuild": "Tải xuống bản dựng Grasscutter đầy đủ, bao gồm repo, jar và tài nguyên. Được thiết lập đầy đủ và không yêu cầu bất kỳ tải xuống nào khác từ menu này",
|
||||
"gc_dev_jar": "Tải xuống phiên bản phát triển mới nhất của Grasscutter, bao gồm tập tin jar và các tệp dữ liệu.",
|
||||
"gc_stable_data": "Tải xuống tệp dữ liệu phiên bản ổn định hiện hành của Grasscutter. Bản này không đi kèm với tập tin jar, hữu dụng khi muốn cập nhật.",
|
||||
"gc_dev_data": "Tải xuống tệp dữ liệu phiên bản mới nhất của Grasscutter. Bản này không đi kèm với tập tin jar, hữu dụng khi muốn cập nhật.",
|
||||
"resources": "Chúng được yêu cầu để chạy máy chủ Grasscutter. Nút này sẽ có màu xám nếu bạn đã có sẵn một thư mục tài nguyên có nội dung bên trong"
|
||||
"gc_dev_data": "Tải xuống tệp dữ liệu phiên bản mới nhất của Grasscutter. Bản này không đi kèm với tập tin jar, hữu dụng khi muốn cập nhật.",
|
||||
"encryption": "Mục này nên được tắt.",
|
||||
"resources": "Tài nguyên được yêu cầu để chạy máy chủ Grasscutter. Nút này sẽ có màu xám nếu bạn đã có sẵn một thư mục tài nguyên (resources) có nội dung bên trong",
|
||||
"emergency_rsa": "Trong trường hợp gặp vấn đề, khôi phục lại RSA về phiên bản chính thức mới nhất.",
|
||||
"use_proxy": "Sử dụng proxy nội bộ của Cultivation. Nên bật tùy chọn này trừ khi bạn đang sử dụng một ứng dụng khác, như Fiddler",
|
||||
"patch_rsa": "Tự động vá và sửa lại RSA của game. Tùy chọn này nên được bật trừ khi bạn đang sử dụng phiên bản cũ, phiên bản không chính thức hoặc bạn đã tự vá rsa rồi.",
|
||||
"add_delay": "Đặt độ trễ trong trình tải 3dmigoto! \nĐiều này sẽ khắc phục sự cố tải, nhưng sẽ thêm một độ trễ nhỏ khi 3dmigoto được tải khi khởi chạy trò chơi. \nBây giờ bạn có thể khởi chạy lại với 3dmigoto.",
|
||||
"migoto": "Để nhập mô hình từ GameBanana"
|
||||
},
|
||||
"swag": {
|
||||
"akebi_name": "Akebi",
|
||||
"migoto_name": "Migoto",
|
||||
"reshade_name": "Reshade",
|
||||
"akebi": "Tập tin thực thi Akebi",
|
||||
"migoto": "Tập tin thực thi 3dMigoto"
|
||||
"migoto": "Tập tin thực thi 3dMigoto",
|
||||
"reshade": "Tập tin inject Reshade"
|
||||
}
|
||||
}
|
||||
|
||||
BIN
src-tauri/patch/version.dll
Normal file
BIN
src-tauri/patch/version.dll
Normal file
Binary file not shown.
22
src-tauri/src/admin.rs
Normal file
22
src-tauri/src/admin.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
#[cfg(windows)]
|
||||
pub fn reopen_as_admin() {
|
||||
use std::process::{exit, Command};
|
||||
|
||||
let install = std::env::current_exe().unwrap();
|
||||
|
||||
println!("Opening as admin: {}", install.to_str().unwrap());
|
||||
|
||||
Command::new("powershell.exe")
|
||||
.arg("powershell")
|
||||
.arg(format!(
|
||||
"-command \"&{{Start-Process -filepath '{}' -verb runas}}\"",
|
||||
install.to_str().unwrap()
|
||||
))
|
||||
.spawn()
|
||||
.expect("Error starting exec as admin");
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
pub fn reopen_as_admin() {}
|
||||
@@ -1,6 +1,7 @@
|
||||
use file_diff::diff;
|
||||
use std::fs;
|
||||
use std::io::{Read, Write};
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[tauri::command]
|
||||
pub fn rename(path: String, new_name: String) {
|
||||
@@ -16,9 +17,9 @@ pub fn rename(path: String, new_name: String) {
|
||||
new_path = path.replace('\\', "/");
|
||||
}
|
||||
|
||||
let path_replaced = &path.replace(&new_path.split('/').last().unwrap(), &new_name);
|
||||
let path_replaced = &path.replace(new_path.split('/').last().unwrap(), &new_name);
|
||||
|
||||
match fs::rename(&path, &path_replaced) {
|
||||
match fs::rename(&path, path_replaced) {
|
||||
Ok(_) => {
|
||||
println!("Renamed {} to {}", &path, path_replaced);
|
||||
}
|
||||
@@ -35,19 +36,19 @@ pub fn dir_create(path: String) {
|
||||
|
||||
#[tauri::command]
|
||||
pub fn dir_exists(path: &str) -> bool {
|
||||
let path_buf = std::path::PathBuf::from(path);
|
||||
let path_buf = PathBuf::from(path);
|
||||
fs::metadata(path_buf).is_ok()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn dir_is_empty(path: &str) -> bool {
|
||||
let path_buf = std::path::PathBuf::from(path);
|
||||
let path_buf = PathBuf::from(path);
|
||||
fs::read_dir(path_buf).unwrap().count() == 0
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn dir_delete(path: &str) {
|
||||
let path_buf = std::path::PathBuf::from(path);
|
||||
let path_buf = PathBuf::from(path);
|
||||
fs::remove_dir_all(path_buf).unwrap();
|
||||
}
|
||||
|
||||
@@ -59,16 +60,15 @@ pub fn are_files_identical(path1: &str, path2: &str) -> bool {
|
||||
#[tauri::command]
|
||||
pub fn copy_file(path: String, new_path: String) -> bool {
|
||||
let filename = &path.split('/').last().unwrap();
|
||||
let mut new_path_buf = std::path::PathBuf::from(&new_path);
|
||||
let path_buf = std::path::PathBuf::from(&path);
|
||||
let path_buf = PathBuf::from(&path);
|
||||
|
||||
// If the new path doesn't exist, create it.
|
||||
if !dir_exists(new_path_buf.pop().to_string().as_str()) {
|
||||
if !dir_exists(PathBuf::from(&new_path).pop().to_string().as_str()) {
|
||||
std::fs::create_dir_all(&new_path).unwrap();
|
||||
}
|
||||
|
||||
// Copy old to new
|
||||
match std::fs::copy(&path_buf, format!("{}/{}", new_path, filename)) {
|
||||
match std::fs::copy(path_buf, format!("{}/{}", new_path, filename)) {
|
||||
Ok(_) => true,
|
||||
Err(e) => {
|
||||
println!("Failed to copy file: {}", e);
|
||||
@@ -81,11 +81,11 @@ pub fn copy_file(path: String, new_path: String) -> bool {
|
||||
|
||||
#[tauri::command]
|
||||
pub fn copy_file_with_new_name(path: String, new_path: String, new_name: String) -> bool {
|
||||
let mut new_path_buf = std::path::PathBuf::from(&new_path);
|
||||
let path_buf = std::path::PathBuf::from(&path);
|
||||
let mut new_path_buf = PathBuf::from(&new_path);
|
||||
let path_buf = PathBuf::from(&path);
|
||||
|
||||
// If the new path doesn't exist, create it.
|
||||
if !dir_exists(new_path_buf.pop().to_string().as_str()) {
|
||||
if !dir_exists(PathBuf::from(&new_path).pop().to_string().as_str()) {
|
||||
match std::fs::create_dir_all(&new_path) {
|
||||
Ok(_) => {}
|
||||
Err(e) => {
|
||||
@@ -95,8 +95,10 @@ pub fn copy_file_with_new_name(path: String, new_path: String, new_name: String)
|
||||
};
|
||||
}
|
||||
|
||||
new_path_buf.push(new_name);
|
||||
|
||||
// Copy old to new
|
||||
match std::fs::copy(&path_buf, format!("{}/{}", new_path, new_name)) {
|
||||
match std::fs::copy(path_buf, &new_path_buf) {
|
||||
Ok(_) => true,
|
||||
Err(e) => {
|
||||
println!("Failed to copy file: {}", e);
|
||||
@@ -109,7 +111,7 @@ pub fn copy_file_with_new_name(path: String, new_path: String, new_name: String)
|
||||
|
||||
#[tauri::command]
|
||||
pub fn delete_file(path: String) -> bool {
|
||||
let path_buf = std::path::PathBuf::from(&path);
|
||||
let path_buf = PathBuf::from(&path);
|
||||
|
||||
match std::fs::remove_file(path_buf) {
|
||||
Ok(_) => true,
|
||||
@@ -124,13 +126,18 @@ pub fn delete_file(path: String) -> bool {
|
||||
|
||||
#[tauri::command]
|
||||
pub fn read_file(path: String) -> String {
|
||||
let path_buf = std::path::PathBuf::from(&path);
|
||||
let path_buf = PathBuf::from(&path);
|
||||
|
||||
let mut file = match fs::File::open(path_buf) {
|
||||
Ok(file) => file,
|
||||
Err(e) => {
|
||||
println!("Failed to open file: {}", e);
|
||||
return String::new();
|
||||
if path.contains("config") {
|
||||
// Server.ts won't print the error so handle the message here for the user
|
||||
println!("Server config not found or invalid. Be sure to run the server at least once to generate it before making edits.");
|
||||
} else {
|
||||
println!("Failed to open file: {}", e);
|
||||
}
|
||||
return String::new(); // Send back error for handling by the caller
|
||||
}
|
||||
};
|
||||
|
||||
@@ -142,10 +149,10 @@ pub fn read_file(path: String) -> String {
|
||||
|
||||
#[tauri::command]
|
||||
pub fn write_file(path: String, contents: String) {
|
||||
let path_buf = std::path::PathBuf::from(&path);
|
||||
let path_buf = PathBuf::from(&path);
|
||||
|
||||
// Create file if it exists, otherwise just open and rewrite
|
||||
let mut file = match fs::File::create(&path_buf) {
|
||||
let mut file = match fs::File::create(path_buf) {
|
||||
Ok(file) => file,
|
||||
Err(e) => {
|
||||
println!("Failed to open file: {}", e);
|
||||
|
||||
@@ -9,23 +9,19 @@ static SITE_URL: &str = "https://gamebanana.com";
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn get_download_links(mod_id: String) -> String {
|
||||
let res = web::query(format!("{}/apiv9/Mod/{}/DownloadPage", SITE_URL, mod_id).as_str()).await;
|
||||
|
||||
res
|
||||
web::query(format!("{}/apiv9/Mod/{}/DownloadPage", SITE_URL, mod_id).as_str()).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn list_submissions(mode: String) -> String {
|
||||
let res = web::query(
|
||||
pub async fn list_submissions(mode: String, page: String) -> String {
|
||||
web::query(
|
||||
format!(
|
||||
"{}/apiv9/Util/Game/Submissions?_idGameRow=8552&_nPage=1&_nPerpage=50&_sMode={}",
|
||||
SITE_URL, mode
|
||||
"{}/apiv9/Util/Game/Submissions?_idGameRow=8552&_nPage={}&_nPerpage=50&_sMode={}",
|
||||
SITE_URL, page, mode
|
||||
)
|
||||
.as_str(),
|
||||
)
|
||||
.await;
|
||||
|
||||
res
|
||||
.await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::system_helpers::*;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::path::{ Path, PathBuf };
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn get_lang(window: tauri::Window, lang: String) -> String {
|
||||
@@ -9,7 +9,7 @@ pub async fn get_lang(window: tauri::Window, lang: String) -> String {
|
||||
let lang_path: PathBuf = [&install_location(), "lang", &format!("{}.json", lang)]
|
||||
.iter()
|
||||
.collect();
|
||||
match std::fs::read_to_string(&lang_path) {
|
||||
match std::fs::read_to_string(lang_path) {
|
||||
Ok(x) => x,
|
||||
Err(e) => {
|
||||
emit_lang_err(window, format!("Failed to read language file: {}", e));
|
||||
@@ -28,7 +28,12 @@ pub async fn get_languages() -> std::collections::HashMap<String, String> {
|
||||
for entry in lang_files {
|
||||
let entry = entry.unwrap();
|
||||
let path = entry.path();
|
||||
let filename = path.file_name().unwrap().to_str().unwrap();
|
||||
let filename = path
|
||||
.file_name()
|
||||
.unwrap_or_else(|| panic!("Failed to get filename from path: {:?}", path))
|
||||
.to_str()
|
||||
.unwrap_or_else(|| panic!("Failed to convert filename to string: {:?}", path))
|
||||
.to_string();
|
||||
|
||||
let content = match std::fs::read_to_string(&path) {
|
||||
Ok(x) => x,
|
||||
@@ -50,4 +55,4 @@ pub fn emit_lang_err(window: tauri::Window, msg: String) {
|
||||
res_hash.insert("error".to_string(), msg);
|
||||
|
||||
window.emit("lang_error", &res_hash).unwrap();
|
||||
}
|
||||
}
|
||||
@@ -3,75 +3,142 @@
|
||||
windows_subsystem = "windows"
|
||||
)]
|
||||
|
||||
use file_helpers::dir_exists;
|
||||
use once_cell::sync::Lazy;
|
||||
use std::fs;
|
||||
use std::io::Write;
|
||||
use std::{collections::HashMap, sync::Mutex};
|
||||
use system_helpers::is_elevated;
|
||||
use tauri::api::path::data_dir;
|
||||
use tauri::async_runtime::block_on;
|
||||
|
||||
use std::thread;
|
||||
use structs::APIQuery;
|
||||
use sysinfo::{System, SystemExt};
|
||||
use sysinfo::{Pid, ProcessExt, System, SystemExt};
|
||||
|
||||
use crate::admin::reopen_as_admin;
|
||||
|
||||
mod admin;
|
||||
mod downloader;
|
||||
mod file_helpers;
|
||||
mod gamebanana;
|
||||
mod lang;
|
||||
mod metadata_patcher;
|
||||
mod proxy;
|
||||
mod structs;
|
||||
mod system_helpers;
|
||||
mod unzip;
|
||||
mod web;
|
||||
|
||||
static WATCH_GAME_PROCESS: Lazy<Mutex<String>> = Lazy::new(|| Mutex::new(String::new()));
|
||||
static WATCH_GRASSCUTTER_PROCESS: Lazy<Mutex<String>> = Lazy::new(|| Mutex::new(String::new()));
|
||||
static GC_PID: std::sync::Mutex<usize> = Mutex::new(696969);
|
||||
|
||||
fn try_flush() {
|
||||
std::io::stdout().flush().unwrap_or(())
|
||||
}
|
||||
|
||||
fn has_arg(args: &[String], arg: &str) -> bool {
|
||||
args.contains(&arg.to_string())
|
||||
}
|
||||
|
||||
async fn arg_handler(args: &[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() {
|
||||
let args: Vec<String> = std::env::args().collect();
|
||||
|
||||
if !is_elevated() && !has_arg(&args, "--no-admin") {
|
||||
println!("===============================================================================");
|
||||
println!("You running as a non-elevated user. Some stuff will almost definitely not work.");
|
||||
println!("===============================================================================");
|
||||
|
||||
reopen_as_admin();
|
||||
}
|
||||
|
||||
// Setup datadir/cultivation just in case something went funky and it wasn't made
|
||||
if !dir_exists(data_dir().unwrap().join("cultivation").to_str().unwrap()) {
|
||||
fs::create_dir_all(data_dir().unwrap().join("cultivation")).unwrap();
|
||||
}
|
||||
|
||||
// Always set CWD to the location of the executable.
|
||||
let mut exe_path = std::env::current_exe().unwrap();
|
||||
exe_path.pop();
|
||||
std::env::set_current_dir(&exe_path).unwrap();
|
||||
|
||||
tauri::Builder::default()
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
enable_process_watcher,
|
||||
connect,
|
||||
disconnect,
|
||||
req_get,
|
||||
get_bg_file,
|
||||
is_game_running,
|
||||
get_theme_list,
|
||||
system_helpers::run_command,
|
||||
system_helpers::run_program,
|
||||
system_helpers::run_program_relative,
|
||||
system_helpers::run_jar,
|
||||
system_helpers::open_in_browser,
|
||||
system_helpers::install_location,
|
||||
system_helpers::is_elevated,
|
||||
proxy::set_proxy_addr,
|
||||
proxy::generate_ca_files,
|
||||
unzip::unzip,
|
||||
file_helpers::rename,
|
||||
file_helpers::dir_create,
|
||||
file_helpers::dir_exists,
|
||||
file_helpers::dir_is_empty,
|
||||
file_helpers::dir_delete,
|
||||
file_helpers::copy_file,
|
||||
file_helpers::copy_file_with_new_name,
|
||||
file_helpers::delete_file,
|
||||
file_helpers::are_files_identical,
|
||||
file_helpers::read_file,
|
||||
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");
|
||||
block_on(arg_handler(&args));
|
||||
|
||||
// For disabled GUI
|
||||
ctrlc::set_handler(|| {
|
||||
disconnect();
|
||||
std::process::exit(0);
|
||||
})
|
||||
.unwrap_or(());
|
||||
|
||||
if !has_arg(&args, "--no-gui") {
|
||||
tauri::Builder::default()
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
enable_process_watcher,
|
||||
enable_grasscutter_watcher,
|
||||
connect,
|
||||
disconnect,
|
||||
req_get,
|
||||
is_game_running,
|
||||
is_grasscutter_running,
|
||||
restart_grasscutter,
|
||||
get_theme_list,
|
||||
system_helpers::run_command,
|
||||
system_helpers::run_program,
|
||||
system_helpers::run_program_relative,
|
||||
system_helpers::start_service,
|
||||
system_helpers::service_status,
|
||||
system_helpers::stop_service,
|
||||
system_helpers::run_jar,
|
||||
system_helpers::open_in_browser,
|
||||
system_helpers::install_location,
|
||||
system_helpers::is_elevated,
|
||||
system_helpers::set_migoto_target,
|
||||
system_helpers::set_migoto_delay,
|
||||
system_helpers::wipe_registry,
|
||||
system_helpers::get_platform,
|
||||
proxy::set_proxy_addr,
|
||||
proxy::generate_ca_files,
|
||||
unzip::unzip,
|
||||
file_helpers::rename,
|
||||
file_helpers::dir_create,
|
||||
file_helpers::dir_exists,
|
||||
file_helpers::dir_is_empty,
|
||||
file_helpers::dir_delete,
|
||||
file_helpers::copy_file,
|
||||
file_helpers::copy_file_with_new_name,
|
||||
file_helpers::delete_file,
|
||||
file_helpers::are_files_identical,
|
||||
file_helpers::read_file,
|
||||
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
|
||||
])
|
||||
.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]
|
||||
@@ -94,12 +161,13 @@ fn enable_process_watcher(window: tauri::Window, process: String) {
|
||||
|
||||
thread::spawn(move || {
|
||||
// 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();
|
||||
|
||||
loop {
|
||||
thread::sleep(std::time::Duration::from_secs(5));
|
||||
// Shorten loop timer to avoid user closing Cultivation before unpatching/proxy disconnecting
|
||||
thread::sleep(std::time::Duration::from_secs(2));
|
||||
|
||||
// Refresh system info
|
||||
system.refresh_all();
|
||||
@@ -126,6 +194,104 @@ fn enable_process_watcher(window: tauri::Window, process: String) {
|
||||
});
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn is_grasscutter_running() -> bool {
|
||||
// Grab the grasscutter process name
|
||||
let proc = WATCH_GRASSCUTTER_PROCESS.lock().unwrap().to_string();
|
||||
|
||||
!proc.is_empty()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn restart_grasscutter(window: tauri::Window) -> bool {
|
||||
let pid: usize = *GC_PID.lock().unwrap();
|
||||
let system = System::new_all();
|
||||
// Get the process
|
||||
if let Some(process) = system.process(Pid::from(pid)) {
|
||||
// Kill it
|
||||
if process.kill() {
|
||||
// Also kill the cmd it was open in
|
||||
if let Some(parent) = system.process(Pid::from(process.parent().unwrap())) {
|
||||
parent.kill();
|
||||
}
|
||||
for process_gc in system.processes_by_name("java") {
|
||||
if process_gc.cmd().last().unwrap().contains(&"grasscutter") {
|
||||
process_gc.kill();
|
||||
}
|
||||
}
|
||||
window.emit("disable_grasscutter_watcher", &()).unwrap();
|
||||
thread::sleep(std::time::Duration::from_secs(2));
|
||||
// Start again
|
||||
window.emit("start_grasscutter", &()).unwrap();
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn enable_grasscutter_watcher(window: tauri::Window, process: String) {
|
||||
let grasscutter_name = process.clone();
|
||||
let mut gc_pid = Pid::from(696969);
|
||||
|
||||
*WATCH_GRASSCUTTER_PROCESS.lock().unwrap() = process;
|
||||
|
||||
window.listen("disable_grasscutter_watcher", |_e| {
|
||||
*WATCH_GRASSCUTTER_PROCESS.lock().unwrap() = "".to_string();
|
||||
});
|
||||
|
||||
println!("Starting grasscutter watcher...");
|
||||
|
||||
thread::spawn(move || {
|
||||
// Initial sleep for 1 second while Grasscutter opens
|
||||
std::thread::sleep(std::time::Duration::from_secs(3));
|
||||
|
||||
let mut system = System::new_all();
|
||||
|
||||
for process_gc in system.processes_by_name("java") {
|
||||
if process_gc.cmd().last().unwrap().contains(&grasscutter_name) {
|
||||
gc_pid = process_gc.pid();
|
||||
*GC_PID.lock().unwrap() = gc_pid.into();
|
||||
window
|
||||
.emit("grasscutter_started", gc_pid.to_string())
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
loop {
|
||||
// Shorten loop timer to avoid user closing Cultivation before automatic stuff
|
||||
thread::sleep(std::time::Duration::from_secs(2));
|
||||
|
||||
// Refresh system info
|
||||
system.refresh_all();
|
||||
|
||||
// Grab the grasscutter process name
|
||||
let proc = WATCH_GRASSCUTTER_PROCESS.lock().unwrap().to_string();
|
||||
|
||||
if !proc.is_empty() {
|
||||
let mut exists = true;
|
||||
|
||||
if system.process(gc_pid).is_none() {
|
||||
exists = false;
|
||||
}
|
||||
|
||||
// If the grasscutter process closes.
|
||||
if !exists {
|
||||
println!("Grasscutter closed");
|
||||
|
||||
*WATCH_GRASSCUTTER_PROCESS.lock().unwrap() = "".to_string();
|
||||
|
||||
window.emit("grasscutter_closed", &()).unwrap();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
async fn connect(port: u16, certificate_path: String) {
|
||||
// Log message to console.
|
||||
@@ -188,53 +354,3 @@ async fn get_theme_list(data_dir: String) -> Vec<HashMap<String, String>> {
|
||||
|
||||
themes
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
// TODO: Replace with downloading the background file & saving it.
|
||||
async fn get_bg_file(bg_path: String, appdata: String) -> String {
|
||||
let copy_loc = appdata;
|
||||
let query = web::query("https://api.grasscutter.io/cultivation/query").await;
|
||||
let response_data: APIQuery = match serde_json::from_str(&query) {
|
||||
Ok(data) => data,
|
||||
Err(e) => {
|
||||
println!("Failed to parse response: {}", e);
|
||||
return "".to_string();
|
||||
}
|
||||
};
|
||||
|
||||
let file_name = response_data.bg_file.to_string();
|
||||
|
||||
// First we see if the file already exists in our local bg folder.
|
||||
if file_helpers::dir_exists(format!("{}\\bg\\{}", copy_loc, file_name).as_str()) {
|
||||
return format!("{}\\{}", copy_loc, response_data.bg_file.as_str());
|
||||
}
|
||||
|
||||
// Now we check if the bg folder, which is one directory above the game_path, exists.
|
||||
let bg_img_path = format!("{}\\{}", &bg_path, &file_name);
|
||||
|
||||
// If it doesn't, then we do not have backgrounds to grab.
|
||||
if !file_helpers::dir_exists(&bg_path) {
|
||||
return "".to_string();
|
||||
}
|
||||
|
||||
// BG folder does exist, lets see if the image exists.
|
||||
if !file_helpers::dir_exists(&bg_img_path) {
|
||||
// Image doesn't exist
|
||||
return "".to_string();
|
||||
}
|
||||
|
||||
// The image exists, lets copy it to our local '\bg' folder.
|
||||
let bg_img_path_local = format!("{}\\bg\\{}", copy_loc, file_name.as_str());
|
||||
|
||||
match std::fs::copy(bg_img_path, bg_img_path_local) {
|
||||
Ok(_) => {
|
||||
// Copy was successful, lets return true.
|
||||
format!("{}\\{}", copy_loc, response_data.bg_file)
|
||||
}
|
||||
Err(e) => {
|
||||
// Copy failed, lets return false
|
||||
println!("Failed to copy background image: {}", e);
|
||||
"".to_string()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,149 +0,0 @@
|
||||
use regex::Regex;
|
||||
use std::fs::File;
|
||||
use std::fs::OpenOptions;
|
||||
use std::io::Read;
|
||||
use std::io::Write;
|
||||
|
||||
// For these two functions, a non-zero return value indicates failure.
|
||||
extern "C" {
|
||||
fn decrypt_global_metadata(data: *mut u8, size: usize) -> i32;
|
||||
fn encrypt_global_metadata(data: *mut u8, size: usize) -> i32;
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn patch_metadata(metadata_folder: &str) -> bool {
|
||||
let metadata_file = &(metadata_folder.to_owned() + "\\global-metadata-unpatched.dat");
|
||||
println!("Patching metadata file: {}", metadata_file);
|
||||
let decrypted = decrypt_metadata(metadata_file);
|
||||
if do_vecs_match(&decrypted, &Vec::new()) {
|
||||
println!("Failed to decrypt metadata file.");
|
||||
return false;
|
||||
}
|
||||
|
||||
let modified = replace_keys(&decrypted);
|
||||
if do_vecs_match(&modified, &Vec::new()) {
|
||||
println!("Failed to replace keys in metadata file.");
|
||||
return false;
|
||||
}
|
||||
|
||||
let encrypted = encrypt_metadata(&modified);
|
||||
if do_vecs_match(&encrypted, &Vec::new()) {
|
||||
println!("Failed to re-encrypt metadata file.");
|
||||
return false;
|
||||
}
|
||||
|
||||
//write encrypted to file
|
||||
let mut file = match OpenOptions::new()
|
||||
.create(true)
|
||||
.write(true)
|
||||
.open(&(metadata_folder.to_owned() + "\\global-metadata-patched.dat"))
|
||||
{
|
||||
Ok(file) => file,
|
||||
Err(e) => {
|
||||
println!("Failed to open global-metadata: {}", e);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
file.write_all(&encrypted).unwrap();
|
||||
|
||||
true
|
||||
}
|
||||
|
||||
fn decrypt_metadata(file_path: &str) -> Vec<u8> {
|
||||
let mut file = match File::open(file_path) {
|
||||
Ok(file) => file,
|
||||
Err(e) => {
|
||||
println!("Failed to open global-metadata: {}", e);
|
||||
return Vec::new();
|
||||
}
|
||||
};
|
||||
let mut data = Vec::new();
|
||||
|
||||
// Read metadata file
|
||||
match file.read_to_end(&mut data) {
|
||||
Ok(_) => (),
|
||||
Err(e) => {
|
||||
println!("Failed to read global-metadata: {}", e);
|
||||
return Vec::new();
|
||||
}
|
||||
}
|
||||
|
||||
// Decrypt metadata file
|
||||
let success = unsafe { decrypt_global_metadata(data.as_mut_ptr(), data.len()) } == 0;
|
||||
if success {
|
||||
println!("Successfully decrypted global-metadata");
|
||||
data
|
||||
} else {
|
||||
println!("Failed to decrypt global-metadata");
|
||||
Vec::new()
|
||||
}
|
||||
}
|
||||
|
||||
fn replace_keys(data: &[u8]) -> Vec<u8> {
|
||||
let mut new_data = String::new();
|
||||
|
||||
unsafe {
|
||||
let data_str = String::from_utf8_unchecked(data.to_vec());
|
||||
|
||||
let re = Regex::new(r"<RSAKeyValue>((.|\n|\r)*?)</RSAKeyValue>").unwrap();
|
||||
let matches = re.find_iter(&data_str);
|
||||
|
||||
// dispatch key is index 3
|
||||
// password key is index 2
|
||||
|
||||
for (i, rmatch) in matches.enumerate() {
|
||||
let key = rmatch.as_str();
|
||||
|
||||
if i == 2 {
|
||||
println!("Replacing password key");
|
||||
new_data = replace_rsa_key(&data_str, key, "passwordKey.txt");
|
||||
} else if i == 3 {
|
||||
println!("Replacing dispatch key");
|
||||
new_data = replace_rsa_key(&new_data, key, "dispatchKey.txt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new_data.as_bytes().to_vec();
|
||||
}
|
||||
|
||||
fn replace_rsa_key(old_data: &str, to_replace: &str, file_name: &str) -> String {
|
||||
// Read dispatch key file
|
||||
unsafe {
|
||||
// Get key folder from exe path
|
||||
let mut exe_path = std::env::current_exe().unwrap();
|
||||
exe_path.pop();
|
||||
|
||||
let key_folder = exe_path.to_str().unwrap().to_string();
|
||||
let mut new_key_file = match File::open(format!("{}/keys/{}", key_folder, file_name)) {
|
||||
Ok(file) => file,
|
||||
Err(e) => {
|
||||
println!("Failed to open keys/{}: {}", file_name, e);
|
||||
return String::new();
|
||||
}
|
||||
};
|
||||
let mut key_data = Vec::new();
|
||||
new_key_file.read_to_end(&mut key_data).unwrap();
|
||||
let new_key = String::from_utf8_unchecked(key_data.to_vec());
|
||||
|
||||
// Replace old key with new key
|
||||
old_data.replace(to_replace, &new_key)
|
||||
}
|
||||
}
|
||||
|
||||
fn encrypt_metadata(old_data: &[u8]) -> Vec<u8> {
|
||||
let mut data = old_data.to_vec();
|
||||
let success = unsafe { encrypt_global_metadata(data.as_mut_ptr(), data.len()) } == 0;
|
||||
if success {
|
||||
println!("Successfully encrypted global-metadata");
|
||||
data
|
||||
} else {
|
||||
println!("Failed to encrypt global-metadata");
|
||||
Vec::new()
|
||||
}
|
||||
}
|
||||
|
||||
fn do_vecs_match<T: PartialEq>(a: &Vec<T>, b: &Vec<T>) -> bool {
|
||||
a == b
|
||||
}
|
||||
@@ -3,13 +3,16 @@
|
||||
* https://github.com/omjadas/hudsucker/blob/main/examples/log.rs
|
||||
*/
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
use crate::system_helpers::run_command;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::{str::FromStr, sync::Mutex};
|
||||
use std::{path::PathBuf, str::FromStr, sync::Mutex};
|
||||
|
||||
use hudsucker::{
|
||||
async_trait::async_trait,
|
||||
certificate_authority::RcgenAuthority,
|
||||
hyper::{Body, Request, Response},
|
||||
hyper::{Body, Request, Response, StatusCode},
|
||||
*,
|
||||
};
|
||||
use rcgen::*;
|
||||
@@ -19,7 +22,7 @@ use std::net::SocketAddr;
|
||||
use std::path::Path;
|
||||
|
||||
use rustls_pemfile as pemfile;
|
||||
use tauri::http::Uri;
|
||||
use tauri::{api::path::data_dir, http::Uri};
|
||||
|
||||
#[cfg(windows)]
|
||||
use registry::{Data, Hive, Security};
|
||||
@@ -45,21 +48,33 @@ pub fn set_proxy_addr(addr: String) {
|
||||
impl HttpHandler for ProxyHandler {
|
||||
async fn handle_request(
|
||||
&mut self,
|
||||
_context: &HttpContext,
|
||||
mut request: Request<Body>,
|
||||
_ctx: &HttpContext,
|
||||
mut req: Request<Body>,
|
||||
) -> RequestOrResponse {
|
||||
let uri = request.uri().to_string();
|
||||
let uri_path = request.uri().path();
|
||||
let uri = req.uri().to_string();
|
||||
|
||||
if uri.contains("hoyoverse.com") || uri.contains("mihoyo.com") || uri.contains("yuanshen.com") {
|
||||
// Create new URI.
|
||||
let new_uri =
|
||||
Uri::from_str(format!("{}{}", SERVER.lock().unwrap(), uri_path).as_str()).unwrap();
|
||||
// Set request URI to the new one.
|
||||
*request.uri_mut() = new_uri;
|
||||
// Handle CONNECTs
|
||||
if req.method().as_str() == "CONNECT" {
|
||||
let builder = Response::builder()
|
||||
.header("DecryptEndpoint", "Created")
|
||||
.status(StatusCode::OK);
|
||||
let res = builder.body(()).unwrap();
|
||||
|
||||
// Respond to CONNECT
|
||||
*res.body()
|
||||
} else {
|
||||
let uri_path_and_query = req.uri().path_and_query().unwrap().as_str();
|
||||
// Create new URI.
|
||||
let new_uri =
|
||||
Uri::from_str(format!("{}{}", SERVER.lock().unwrap(), uri_path_and_query).as_str())
|
||||
.unwrap();
|
||||
// Set request URI to the new one.
|
||||
*req.uri_mut() = new_uri;
|
||||
}
|
||||
}
|
||||
|
||||
RequestOrResponse::Request(request)
|
||||
req.into()
|
||||
}
|
||||
|
||||
async fn handle_response(
|
||||
@@ -69,17 +84,48 @@ impl HttpHandler for ProxyHandler {
|
||||
) -> Response<Body> {
|
||||
response
|
||||
}
|
||||
|
||||
async fn should_intercept(&mut self, _ctx: &HttpContext, _req: &Request<Body>) -> bool {
|
||||
let uri = _req.uri().to_string();
|
||||
|
||||
if uri.contains("hoyoverse.com") || uri.contains("mihoyo.com") || uri.contains("yuanshen.com") {
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts an HTTP(S) proxy server.
|
||||
*/
|
||||
pub async fn create_proxy(proxy_port: u16, certificate_path: String) {
|
||||
let cert_path = PathBuf::from(certificate_path);
|
||||
let pk_path = cert_path.join("private.key");
|
||||
let ca_path = cert_path.join("cert.crt");
|
||||
|
||||
// Get the certificate and private key.
|
||||
let mut private_key_bytes: &[u8] =
|
||||
&fs::read(format!("{}\\private.key", certificate_path)).expect("Could not read private key");
|
||||
let mut ca_cert_bytes: &[u8] =
|
||||
&fs::read(format!("{}\\cert.crt", certificate_path)).expect("Could not read certificate");
|
||||
let mut private_key_bytes: &[u8] = &match fs::read(&pk_path) {
|
||||
// Try regenerating the CA stuff and read it again. If that doesn't work, quit.
|
||||
Ok(b) => b,
|
||||
Err(e) => {
|
||||
println!("Encountered {}. Regenerating CA cert and retrying...", e);
|
||||
generate_ca_files(&data_dir().unwrap().join("cultivation"));
|
||||
|
||||
fs::read(&pk_path).expect("Could not read private key")
|
||||
}
|
||||
};
|
||||
|
||||
let mut ca_cert_bytes: &[u8] = &match fs::read(&ca_path) {
|
||||
// Try regenerating the CA stuff and read it again. If that doesn't work, quit.
|
||||
Ok(b) => b,
|
||||
Err(e) => {
|
||||
println!("Encountered {}. Regenerating CA cert and retrying...", e);
|
||||
generate_ca_files(&data_dir().unwrap().join("cultivation"));
|
||||
|
||||
fs::read(&ca_path).expect("Could not read certificate")
|
||||
}
|
||||
};
|
||||
|
||||
// Parse the private key and certificate.
|
||||
let private_key = rustls::PrivateKey(
|
||||
@@ -125,7 +171,8 @@ pub fn connect_to_proxy(proxy_port: u16) {
|
||||
let settings = Hive::CurrentUser
|
||||
.open(
|
||||
r"Software\Microsoft\Windows\CurrentVersion\Internet Settings",
|
||||
Security::Write,
|
||||
// Only write should be needed but too many cases of Culti not being able to read/write proxy settings
|
||||
Security::AllAccess,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
@@ -138,9 +185,29 @@ pub fn connect_to_proxy(proxy_port: u16) {
|
||||
println!("Connected to the proxy.");
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
#[cfg(unix)]
|
||||
pub fn connect_to_proxy(proxy_port: u16) {
|
||||
// Edit /etc/environment to set $http_proxy and $https_proxy
|
||||
let mut env_file = match fs::read_to_string("/etc/environment") {
|
||||
Ok(f) => f,
|
||||
Err(e) => {
|
||||
println!("Error opening /etc/environment: {}", e);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
// Append the proxy configuration.
|
||||
// We will not remove the current proxy config if it exists, so we can just remove these last lines when we disconnect
|
||||
env_file += format!("\nhttps_proxy=127.0.0.1:{}", proxy_port).as_str();
|
||||
env_file += format!("\nhttp_proxy=127.0.0.1:{}", proxy_port).as_str();
|
||||
|
||||
// Save
|
||||
fs::write("/etc/environment", env_file).unwrap();
|
||||
}
|
||||
|
||||
#[cfg(target_od = "macos")]
|
||||
pub fn connect_to_proxy(_proxy_port: u16) {
|
||||
println!("Connecting to the proxy is not implemented on this platform.");
|
||||
println!("No Mac support yet. Someone mail me a Macbook and I will do it B)")
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -152,7 +219,7 @@ pub fn disconnect_from_proxy() {
|
||||
let settings = Hive::CurrentUser
|
||||
.open(
|
||||
r"Software\Microsoft\Windows\CurrentVersion\Internet Settings",
|
||||
Security::Write,
|
||||
Security::AllAccess,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
@@ -162,7 +229,26 @@ pub fn disconnect_from_proxy() {
|
||||
println!("Disconnected from proxy.");
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
#[cfg(target_os = "linux")]
|
||||
pub fn disconnect_from_proxy() {
|
||||
println!("Re-writing environment variables");
|
||||
|
||||
let regexp = regex::Regex::new(
|
||||
// This has to be specific as possible or we risk fuckin up their environment LOL
|
||||
r"(https|http)_proxy=.*127.0.0.1:.*",
|
||||
)
|
||||
.unwrap();
|
||||
let environment = &fs::read_to_string("/etc/environment").expect("Failed to open environment");
|
||||
|
||||
let new_environment = regexp.replace_all(environment, "").to_string();
|
||||
|
||||
// Write new environment
|
||||
fs::write("/etc/environment", new_environment.trim_end()).expect(
|
||||
"Could not write environment, remove proxy declarations manually if they are still set",
|
||||
);
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
pub fn disconnect_from_proxy() {}
|
||||
|
||||
/*
|
||||
@@ -260,11 +346,27 @@ pub fn install_ca_files(cert_path: &Path) {
|
||||
"/Library/Keychains/System.keychain",
|
||||
cert_path.to_str().unwrap(),
|
||||
],
|
||||
None,
|
||||
);
|
||||
println!("Installed certificate.");
|
||||
}
|
||||
|
||||
#[cfg(not(any(windows, target_os = "macos")))]
|
||||
// If this is borked on non-debian platforms, so be it
|
||||
#[cfg(target_os = "linux")]
|
||||
pub fn install_ca_files(cert_path: &Path) {
|
||||
let usr_certs = PathBuf::from("/usr/local/share/ca-certificates");
|
||||
let usr_cert_path = usr_certs.join("cultivation.crt");
|
||||
|
||||
// Create dir if it doesn't exist
|
||||
fs::create_dir_all(&usr_certs).expect("Unable to create local certificate directory");
|
||||
|
||||
fs::copy(cert_path, usr_cert_path).expect("Unable to copy cert to local certificate directory");
|
||||
run_command("update-ca-certificates", vec![], None);
|
||||
|
||||
println!("Installed certificate.");
|
||||
}
|
||||
|
||||
#[cfg(not(any(windows, target_os = "macos", target_os = "linux")))]
|
||||
pub fn install_ca_files(_cert_path: &Path) {
|
||||
println!("Certificate installation is not supported on this platform.");
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub(crate) struct APIQuery {
|
||||
pub bg_file: String,
|
||||
}
|
||||
@@ -1,9 +1,17 @@
|
||||
use duct::cmd;
|
||||
use ini::Ini;
|
||||
use std::ffi::OsStr;
|
||||
use std::path::PathBuf;
|
||||
use windows_service::service::{ServiceAccess, ServiceState::Stopped};
|
||||
use windows_service::service_manager::{ServiceManager, ServiceManagerAccess};
|
||||
|
||||
#[cfg(windows)]
|
||||
use registry::{Data, Hive, Security};
|
||||
|
||||
#[tauri::command]
|
||||
pub fn run_program(path: String, args: Option<String>) {
|
||||
// Without unwrap_or, this can crash when UAC prompt is denied
|
||||
open::that(format!("{} {}", &path, &args.unwrap_or("".into()))).unwrap_or(());
|
||||
open::that(format!("{} {}", &path, &args.unwrap_or_else(|| "".into()))).unwrap_or(());
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -19,10 +27,10 @@ pub fn run_program_relative(path: String, args: Option<String>) {
|
||||
std::env::set_current_dir(&path_buf).unwrap();
|
||||
|
||||
// Without unwrap_or, this can crash when UAC prompt is denied
|
||||
open::that(format!("{} {}", &path, args.unwrap_or("".into()))).unwrap_or(());
|
||||
open::that(format!("{} {}", &path, args.unwrap_or_else(|| "".into()))).unwrap_or(());
|
||||
|
||||
// Restore the original working directory
|
||||
std::env::set_current_dir(&cwd).unwrap();
|
||||
std::env::set_current_dir(cwd).unwrap();
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -47,7 +55,7 @@ pub fn run_command(program: &str, args: Vec<&str>, relative: Option<bool>) {
|
||||
cmd(prog, args).run().unwrap();
|
||||
|
||||
// Restore the original working directory
|
||||
std::env::set_current_dir(&cwd).unwrap();
|
||||
std::env::set_current_dir(cwd).unwrap();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -88,6 +96,173 @@ pub fn install_location() -> String {
|
||||
return exe_path.to_str().unwrap().to_string();
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn set_migoto_target(window: tauri::Window, migoto_path: String) -> bool {
|
||||
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;
|
||||
}
|
||||
};
|
||||
|
||||
window.emit("migoto_set", &()).unwrap();
|
||||
|
||||
// Set options
|
||||
conf
|
||||
.with_section(Some("Loader"))
|
||||
.set("target", "GenshinImpact.exe");
|
||||
|
||||
// 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 set_migoto_delay(migoto_path: String) -> bool {
|
||||
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("delay", "20");
|
||||
|
||||
// Write file
|
||||
match conf.write_to_file(&migoto_pathbuf) {
|
||||
Ok(_) => {
|
||||
println!("Wrote delay!");
|
||||
true
|
||||
}
|
||||
Err(e) => {
|
||||
println!("Error writing delay: {}", e);
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[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)]
|
||||
#[tauri::command]
|
||||
pub fn service_status(service: String) -> bool {
|
||||
let manager = match ServiceManager::local_computer(None::<&str>, ServiceManagerAccess::CONNECT) {
|
||||
Ok(manager) => manager,
|
||||
Err(_e) => return false,
|
||||
};
|
||||
let my_service = match manager.open_service(service.clone(), ServiceAccess::QUERY_STATUS) {
|
||||
Ok(my_service) => my_service,
|
||||
Err(_e) => {
|
||||
println!("{} service not found! Not installed?", service);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
let status_result = my_service.query_status();
|
||||
if status_result.is_ok() {
|
||||
let status = status_result.unwrap();
|
||||
println!("{} service status: {:?}", service, status.current_state);
|
||||
if status.current_state == Stopped {
|
||||
// Start the service if it is stopped
|
||||
start_service(service);
|
||||
}
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[tauri::command]
|
||||
pub fn start_service(service: String) -> bool {
|
||||
println!("Starting service: {}", service);
|
||||
let manager = match ServiceManager::local_computer(None::<&str>, ServiceManagerAccess::CONNECT) {
|
||||
Ok(manager) => manager,
|
||||
Err(_e) => return false,
|
||||
};
|
||||
let my_service = match manager.open_service(service, ServiceAccess::START) {
|
||||
Ok(my_service) => my_service,
|
||||
Err(_e) => return false,
|
||||
};
|
||||
match my_service.start(&[OsStr::new("Started service!")]) {
|
||||
Ok(_s) => true,
|
||||
Err(_e) => return false,
|
||||
};
|
||||
true
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[tauri::command]
|
||||
pub fn stop_service(service: String) -> bool {
|
||||
println!("Stopping service: {}", service);
|
||||
let manager = match ServiceManager::local_computer(None::<&str>, ServiceManagerAccess::CONNECT) {
|
||||
Ok(manager) => manager,
|
||||
Err(_e) => return false,
|
||||
};
|
||||
let my_service = match manager.open_service(service, ServiceAccess::STOP) {
|
||||
Ok(my_service) => my_service,
|
||||
Err(_e) => return false,
|
||||
};
|
||||
match my_service.stop() {
|
||||
Ok(_s) => true,
|
||||
Err(_e) => return false,
|
||||
};
|
||||
true
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
#[tauri::command]
|
||||
pub fn wipe_registry(_exec_name: String) {}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[tauri::command]
|
||||
pub fn is_elevated() -> bool {
|
||||
@@ -99,3 +274,8 @@ pub fn is_elevated() -> bool {
|
||||
pub fn is_elevated() -> bool {
|
||||
sudo::check() == sudo::RunningAs::Root
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn get_platform() -> &'static str {
|
||||
std::env::consts::OS
|
||||
}
|
||||
|
||||
@@ -58,38 +58,39 @@ pub fn unzip(
|
||||
}
|
||||
};
|
||||
|
||||
full_path = new_path.clone();
|
||||
full_path = new_path;
|
||||
}
|
||||
|
||||
println!("Is rar file? {}", zipfile.ends_with(".rar"));
|
||||
|
||||
let name;
|
||||
let success;
|
||||
|
||||
// If file ends in zip, OR is unknown, extract as zip, otherwise extract as rar
|
||||
if zipfile.ends_with(".rar") {
|
||||
extract_rar(
|
||||
&window,
|
||||
&zipfile,
|
||||
&f,
|
||||
&full_path,
|
||||
top_level.unwrap_or(false),
|
||||
);
|
||||
success = extract_rar(&zipfile, &f, &full_path, top_level.unwrap_or(true));
|
||||
|
||||
let archive = Archive::new(zipfile.clone());
|
||||
name = archive.list().unwrap().next().unwrap().unwrap().filename;
|
||||
} else if zipfile.ends_with(".7z") {
|
||||
success = extract_7z(&zipfile, &f, &full_path, top_level.unwrap_or(true));
|
||||
|
||||
name = String::from("banana");
|
||||
} else {
|
||||
extract_zip(
|
||||
&window,
|
||||
&zipfile,
|
||||
&f,
|
||||
&full_path,
|
||||
top_level.unwrap_or(false),
|
||||
);
|
||||
success = extract_zip(&zipfile, &f, &full_path, top_level.unwrap_or(true));
|
||||
|
||||
// Get the name of the inenr file in the zip file
|
||||
let mut zip = zip::ZipArchive::new(&f).unwrap();
|
||||
let file = zip.by_index(0).unwrap();
|
||||
name = file.name().to_string().clone();
|
||||
name = file.name().to_string();
|
||||
}
|
||||
|
||||
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
|
||||
@@ -99,44 +100,48 @@ pub fn unzip(
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
// If downloading full build, emit that the jar was extracted with it
|
||||
if zipfile.contains("GrasscutterCulti") {
|
||||
window
|
||||
.emit("jar_extracted", destpath.to_string() + "grasscutter.jar")
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
if zipfile.contains("GIMI") {
|
||||
window
|
||||
.emit("migoto_extracted", destpath.to_string() + "3DMigoto Loader.exe")
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
// Delete zip file
|
||||
match std::fs::remove_file(&zipfile) {
|
||||
Ok(_) => {
|
||||
// Get any new directory that could have been created
|
||||
let mut new_dir: String = String::new();
|
||||
for entry in read_dir(&write_path).unwrap() {
|
||||
let entry = entry.unwrap();
|
||||
let entry_path = entry.path();
|
||||
if entry_path.is_dir() && !dirs.contains(&entry_path) {
|
||||
new_dir = entry_path.to_str().unwrap().to_string();
|
||||
}
|
||||
}
|
||||
|
||||
let mut res_hash = std::collections::HashMap::new();
|
||||
res_hash.insert("file", zipfile.to_string());
|
||||
res_hash.insert("new_folder", new_dir);
|
||||
|
||||
window.emit("extract_end", &res_hash).unwrap();
|
||||
println!("Deleted zip file: {}", zipfile);
|
||||
}
|
||||
Err(e) => {
|
||||
println!("Failed to delete zip file: {}", e);
|
||||
}
|
||||
};
|
||||
|
||||
// Get any new directory that could have been created
|
||||
let mut new_dir: String = String::new();
|
||||
for entry in read_dir(&write_path).unwrap() {
|
||||
let entry = entry.unwrap();
|
||||
let entry_path = entry.path();
|
||||
if entry_path.is_dir() {
|
||||
if !dirs.contains(&entry_path) {
|
||||
new_dir = entry_path.to_str().unwrap().to_string();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let mut res_hash = std::collections::HashMap::new();
|
||||
res_hash.insert("file", zipfile.to_string());
|
||||
res_hash.insert("new_folder", new_dir.to_string());
|
||||
|
||||
window.emit("extract_end", &res_hash).unwrap();
|
||||
});
|
||||
}
|
||||
|
||||
fn extract_rar(
|
||||
window: &tauri::Window,
|
||||
rarfile: &String,
|
||||
_f: &File,
|
||||
full_path: &path::PathBuf,
|
||||
_top_level: bool,
|
||||
) {
|
||||
let archive = Archive::new(rarfile.clone());
|
||||
fn extract_rar(rarfile: &str, _f: &File, full_path: &path::Path, _top_level: bool) -> bool {
|
||||
let archive = Archive::new(rarfile.to_string());
|
||||
|
||||
let mut open_archive = archive
|
||||
.extract_to(full_path.to_str().unwrap().to_string())
|
||||
@@ -148,41 +153,46 @@ fn extract_rar(
|
||||
"Extracted rar file to: {}",
|
||||
full_path.to_str().unwrap_or("Error")
|
||||
);
|
||||
|
||||
true
|
||||
}
|
||||
Err(e) => {
|
||||
println!("Failed to extract rar file: {}", e);
|
||||
let mut res_hash = std::collections::HashMap::new();
|
||||
|
||||
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();
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn extract_zip(
|
||||
window: &tauri::Window,
|
||||
zipfile: &String,
|
||||
f: &File,
|
||||
full_path: &path::PathBuf,
|
||||
top_level: bool,
|
||||
) {
|
||||
fn extract_zip(_zipfile: &str, f: &File, full_path: &path::Path, top_level: bool) -> bool {
|
||||
match zip_extract::extract(f, full_path, top_level) {
|
||||
Ok(_) => {
|
||||
println!(
|
||||
"Extracted zip file to: {}",
|
||||
full_path.to_str().unwrap_or("Error")
|
||||
);
|
||||
|
||||
true
|
||||
}
|
||||
Err(e) => {
|
||||
println!("Failed to extract zip file: {}", e);
|
||||
let mut res_hash = std::collections::HashMap::new();
|
||||
|
||||
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();
|
||||
false
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
fn extract_7z(sevenzfile: &str, _f: &File, full_path: &path::Path, _top_level: bool) -> bool {
|
||||
match sevenz_rust::decompress_file(sevenzfile, full_path) {
|
||||
Ok(_) => {
|
||||
println!(
|
||||
"Extracted 7zip file to: {}",
|
||||
full_path.to_str().unwrap_or("Error")
|
||||
);
|
||||
|
||||
true
|
||||
}
|
||||
Err(e) => {
|
||||
println!("Failed to extract 7zip file: {}", e);
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,13 @@ pub(crate) async fn query(site: &str) -> String {
|
||||
.header(CONTENT_TYPE, "application/json")
|
||||
.send()
|
||||
.await
|
||||
.unwrap();
|
||||
response.text().await.unwrap()
|
||||
.ok();
|
||||
|
||||
if response.is_some() {
|
||||
response.unwrap().text().await.unwrap()
|
||||
} else {
|
||||
false.to_string()
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -23,9 +28,13 @@ pub(crate) async fn valid_url(url: String) -> bool {
|
||||
.header(USER_AGENT, "cultivation")
|
||||
.send()
|
||||
.await
|
||||
.unwrap();
|
||||
.ok();
|
||||
|
||||
response.status().as_str() == "200"
|
||||
if response.is_some() {
|
||||
return response.unwrap().status().as_str() == "200";
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
},
|
||||
"package": {
|
||||
"productName": "Cultivation",
|
||||
"version": "1.0.6"
|
||||
"version": "1.0.25"
|
||||
},
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
@@ -40,7 +40,7 @@
|
||||
"providerShortName": null,
|
||||
"signingIdentity": null
|
||||
},
|
||||
"resources": ["lang/*.json", "keys/*"],
|
||||
"resources": ["lang/*.json", "keys/*", "patch/*"],
|
||||
"targets": "all",
|
||||
"windows": {
|
||||
"allowDowngrades": false,
|
||||
|
||||
BIN
src/resources/icons/FALLBACK_BG.jpg
Normal file
BIN
src/resources/icons/FALLBACK_BG.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 642 KiB |
@@ -5,10 +5,12 @@ import DownloadHandler from '../utils/download'
|
||||
import { getConfigOption } from '../utils/configuration'
|
||||
import { getTheme, loadTheme } from '../utils/themes'
|
||||
import { convertFileSrc, invoke } from '@tauri-apps/api/tauri'
|
||||
import { dataDir } from '@tauri-apps/api/path'
|
||||
import { Main } from './Main'
|
||||
import { Mods } from './Mods'
|
||||
|
||||
// From https://www.pixiv.net/en/artworks/93995273
|
||||
import FALLBACK_BG from '../resources/icons/FALLBACK_BG.jpg'
|
||||
|
||||
interface IState {
|
||||
page: string
|
||||
bgFile: string
|
||||
@@ -28,10 +30,6 @@ class App extends React.Component<Readonly<unknown>, IState> {
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const game_exe = await getConfigOption('game_install_path')
|
||||
const game_path = game_exe?.substring(0, game_exe.replace(/\\/g, '/').lastIndexOf('/')) || ''
|
||||
const root_path = game_path?.substring(0, game_path.replace(/\\/g, '/').lastIndexOf('/')) || ''
|
||||
|
||||
// Load a theme if it exists
|
||||
const theme = await getConfigOption('theme')
|
||||
if (theme && theme !== 'default') {
|
||||
@@ -42,23 +40,7 @@ class App extends React.Component<Readonly<unknown>, IState> {
|
||||
// Get custom bg AFTER theme is loaded !! important !!
|
||||
const custom_bg = await getConfigOption('customBackground')
|
||||
|
||||
if (!custom_bg || !/png|jpg|jpeg$/.test(custom_bg)) {
|
||||
if (game_path) {
|
||||
// Get the bg by invoking, then set the background to that bg.
|
||||
const bgLoc: string = await invoke('get_bg_file', {
|
||||
bgPath: root_path,
|
||||
appdata: await dataDir(),
|
||||
})
|
||||
|
||||
bgLoc &&
|
||||
this.setState(
|
||||
{
|
||||
bgFile: bgLoc,
|
||||
},
|
||||
this.forceUpdate
|
||||
)
|
||||
}
|
||||
} else {
|
||||
if (custom_bg) {
|
||||
const isUrl = /^http(s)?:\/\//gm.test(custom_bg)
|
||||
|
||||
if (!isUrl) {
|
||||
@@ -85,6 +67,18 @@ class App extends React.Component<Readonly<unknown>, IState> {
|
||||
this.forceUpdate
|
||||
)
|
||||
}
|
||||
} else {
|
||||
// Check if api bg is accessible
|
||||
const isDefaultValid = await invoke('valid_url', {
|
||||
url: DEFAULT_BG,
|
||||
})
|
||||
|
||||
this.setState(
|
||||
{
|
||||
bgFile: isDefaultValid ? DEFAULT_BG : FALLBACK_BG,
|
||||
},
|
||||
this.forceUpdate
|
||||
)
|
||||
}
|
||||
|
||||
window.addEventListener('changePage', (e) => {
|
||||
|
||||
@@ -17,7 +17,7 @@ import { invoke } from '@tauri-apps/api'
|
||||
import { listen } from '@tauri-apps/api/event'
|
||||
import { dataDir } from '@tauri-apps/api/path'
|
||||
import { appWindow } from '@tauri-apps/api/window'
|
||||
import { unpatchGame } from '../utils/metadata'
|
||||
import { unpatchGame } from '../utils/rsa'
|
||||
import DownloadHandler from '../utils/download'
|
||||
|
||||
// Graphics
|
||||
@@ -65,21 +65,44 @@ export class Main extends React.Component<IProps, IState> {
|
||||
setConfigOption('grasscutter_path', payload)
|
||||
})
|
||||
|
||||
// Emitted for metadata replacing-purposes
|
||||
listen('migoto_extracted', ({ payload }: { payload: string }) => {
|
||||
setConfigOption('migoto_path', payload)
|
||||
|
||||
invoke('set_migoto_target', {
|
||||
migotoPath: payload,
|
||||
})
|
||||
})
|
||||
|
||||
// Emitted for rsa replacing-purposes
|
||||
listen('game_closed', async () => {
|
||||
const wasPatched = await getConfigOption('patch_metadata')
|
||||
const wasPatched = await getConfigOption('patch_rsa')
|
||||
|
||||
if (wasPatched) {
|
||||
const unpatched = await unpatchGame()
|
||||
|
||||
if (!unpatched) {
|
||||
alert(
|
||||
`Could not unpatch game! (You should be able to find your metadata backup in ${await dataDir()}\\cultivation\\)`
|
||||
)
|
||||
if (unpatched) {
|
||||
alert(`Could not unpatch game! (Delete version.dll in your game folder)`)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
listen('migoto_set', async () => {
|
||||
this.setState({
|
||||
migotoSet: !!(await getConfigOption('migoto_path')),
|
||||
})
|
||||
|
||||
window.location.reload()
|
||||
})
|
||||
|
||||
// Emitted for automatic processes
|
||||
listen('grasscutter_closed', async () => {
|
||||
const autoService = await getConfigOption('auto_mongodb')
|
||||
|
||||
if (autoService) {
|
||||
await invoke('stop_service', { service: 'MongoDB' })
|
||||
}
|
||||
})
|
||||
|
||||
let min = false
|
||||
|
||||
// periodically check if we need to min/max based on whether the game is open
|
||||
@@ -114,6 +137,10 @@ export class Main extends React.Component<IProps, IState> {
|
||||
await setConfigOption('cert_generated', true)
|
||||
}
|
||||
|
||||
// Ensure old configs are updated to use RSA
|
||||
const updatedConfig = await getConfigOption('patch_rsa')
|
||||
await setConfigOption('patch_rsa', updatedConfig)
|
||||
|
||||
// Period check to only show progress bar when downloading files
|
||||
setInterval(() => {
|
||||
this.setState({
|
||||
|
||||
@@ -12,8 +12,9 @@ import Plus from '../../resources/icons/plus.svg'
|
||||
|
||||
import './ServerLaunchSection.css'
|
||||
import { dataDir } from '@tauri-apps/api/path'
|
||||
import { getGameExecutable } from '../../utils/game'
|
||||
import { patchGame, unpatchGame } from '../../utils/metadata'
|
||||
import { getGameExecutable, getGameVersion, getGrasscutterJar } from '../../utils/game'
|
||||
import { patchGame, unpatchGame } from '../../utils/rsa'
|
||||
import { listen } from '@tauri-apps/api/event'
|
||||
|
||||
interface IProps {
|
||||
openExtras: (playGame: () => void) => void
|
||||
@@ -25,6 +26,7 @@ interface IState {
|
||||
checkboxLabel: string
|
||||
ip: string
|
||||
port: string
|
||||
launchServer: (proc_name?: string) => void
|
||||
|
||||
ipPlaceholder: string
|
||||
portPlaceholder: string
|
||||
@@ -54,6 +56,9 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
||||
portHelpText: '',
|
||||
httpsLabel: '',
|
||||
httpsEnabled: false,
|
||||
launchServer: () => {
|
||||
alert('Error launching grasscutter')
|
||||
},
|
||||
swag: false,
|
||||
akebiSet: false,
|
||||
migotoSet: false,
|
||||
@@ -64,6 +69,11 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
||||
this.setIp = this.setIp.bind(this)
|
||||
this.setPort = this.setPort.bind(this)
|
||||
this.toggleHttps = this.toggleHttps.bind(this)
|
||||
this.launchServer = this.launchServer.bind(this)
|
||||
|
||||
listen('start_grasscutter', async () => {
|
||||
this.launchServer()
|
||||
})
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
@@ -109,11 +119,31 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
||||
|
||||
// Connect to proxy
|
||||
if (config.toggle_grasscutter) {
|
||||
if (config.patch_metadata) {
|
||||
if (config.patch_rsa) {
|
||||
const gameVersion = await getGameVersion()
|
||||
console.log(gameVersion)
|
||||
|
||||
if (gameVersion == null) {
|
||||
alert(
|
||||
'Game version could not be determined. Please make sure you have the game correctly selected and try again.'
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
if (gameVersion?.major == 2 && gameVersion?.minor < 9) {
|
||||
alert('Game version is too old for RSA patching. Please disable RSA patching in the settings and try again.')
|
||||
return
|
||||
}
|
||||
|
||||
if (gameVersion?.major == 3 && gameVersion?.minor < 1) {
|
||||
alert('Game version is too old for RSA patching. Please disable RSA patching in the settings and try again.')
|
||||
return
|
||||
}
|
||||
|
||||
const patched = await patchGame()
|
||||
|
||||
if (!patched) {
|
||||
alert('Could not patch game!')
|
||||
alert('Could not patch! Try launching again, or patching manually.')
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -139,26 +169,18 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
||||
|
||||
// Open server as well if the options are set
|
||||
if (config.grasscutter_with_game) {
|
||||
const jarFolderArr = config.grasscutter_path.replace(/\\/g, '/').split('/')
|
||||
jarFolderArr.pop()
|
||||
|
||||
const jarFolder = jarFolderArr.join('/')
|
||||
|
||||
await invoke('run_jar', {
|
||||
path: config.grasscutter_path,
|
||||
executeIn: jarFolder,
|
||||
javaPath: config.java_path || '',
|
||||
})
|
||||
this.launchServer()
|
||||
}
|
||||
} else {
|
||||
const unpatched = await unpatchGame()
|
||||
await unpatchGame()
|
||||
}
|
||||
|
||||
if (!unpatched) {
|
||||
alert(
|
||||
`Could not unpatch game, aborting launch! (You can find your metadata backup in ${await dataDir()}\\cultivation\\)`
|
||||
)
|
||||
return
|
||||
}
|
||||
if (config.wipe_login) {
|
||||
// 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
|
||||
@@ -170,11 +192,24 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
||||
else alert('Game not found! At: ' + (exe || config.game_install_path))
|
||||
}
|
||||
|
||||
async launchServer() {
|
||||
async launchServer(proc_name?: string) {
|
||||
if (await invoke('is_grasscutter_running')) {
|
||||
alert('Grasscutter already running!')
|
||||
return
|
||||
}
|
||||
const config = await getConfig()
|
||||
|
||||
if (!config.grasscutter_path) return alert('Grasscutter not installed or set!')
|
||||
|
||||
if (config.auto_mongodb) {
|
||||
const grasscutter_jar = await getGrasscutterJar()
|
||||
await invoke('enable_grasscutter_watcher', {
|
||||
process: proc_name || grasscutter_jar,
|
||||
})
|
||||
// Check if MongoDB is running and start it if not
|
||||
await invoke('service_status', { service: 'MongoDB' })
|
||||
}
|
||||
|
||||
let jarFolder = config.grasscutter_path
|
||||
|
||||
if (jarFolder.includes('/')) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.DirInput {
|
||||
display: flex;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
32
src/ui/components/common/SmallButton.css
Normal file
32
src/ui/components/common/SmallButton.css
Normal file
@@ -0,0 +1,32 @@
|
||||
.SmallButtonSection {
|
||||
display: inline-block;
|
||||
margin-left: 20px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.SmallButtonButton {
|
||||
height: 20px;
|
||||
filter: drop-shadow(0px 0px 5px rgb(0 0 0 / 20%));
|
||||
}
|
||||
|
||||
.SmallButtonButton:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.SmallButtonButton img {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.SmallButtonContents {
|
||||
text-align: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.SmallButtonContents .MiniDialog {
|
||||
position: absolute;
|
||||
|
||||
bottom: 40px;
|
||||
right: -450%;
|
||||
width: 200px;
|
||||
height: 120px;
|
||||
}
|
||||
39
src/ui/components/common/SmallButton.tsx
Normal file
39
src/ui/components/common/SmallButton.tsx
Normal file
@@ -0,0 +1,39 @@
|
||||
import React from 'react'
|
||||
|
||||
import './SmallButton.css'
|
||||
import Wrench from '../../../resources/icons/wrench.svg'
|
||||
import { translate } from '../../../utils/language'
|
||||
|
||||
interface IProps {
|
||||
children?: React.ReactNode[] | React.ReactNode
|
||||
onClick: () => unknown
|
||||
id?: string
|
||||
contents?: string
|
||||
}
|
||||
|
||||
export default class SmallButton extends React.Component<IProps> {
|
||||
constructor(props: IProps) {
|
||||
super(props)
|
||||
|
||||
this.handleClick = this.handleClick.bind(this)
|
||||
}
|
||||
|
||||
async showAlert() {
|
||||
if (this.props.contents) alert(await translate(this.props.contents))
|
||||
}
|
||||
|
||||
handleClick() {
|
||||
this.props.onClick()
|
||||
this.showAlert()
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="SmallButtonSection">
|
||||
<div className="SmallButtonButton" onClick={this.handleClick}>
|
||||
<img src={Wrench} />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,16 @@
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.HeaderText {
|
||||
font-size: 18px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
margin-bottom: 10px;
|
||||
text-decoration-line: underline;
|
||||
}
|
||||
|
||||
.DownloadValue .BigButton {
|
||||
height: 100%;
|
||||
min-height: 30px;
|
||||
|
||||
@@ -13,11 +13,14 @@ import { invoke } from '@tauri-apps/api'
|
||||
import { listen } from '@tauri-apps/api/event'
|
||||
import HelpButton from '../common/HelpButton'
|
||||
|
||||
const FULL_BUILD_DOWNLOAD = 'https://github.com/NotThorny/Grasscutter/releases/download/culti-aio/GrasscutterCulti.zip' // Change to link that can be updated without modifying here
|
||||
const STABLE_REPO_DOWNLOAD = 'https://github.com/Grasscutters/Grasscutter/archive/refs/heads/stable.zip'
|
||||
const DEV_REPO_DOWNLOAD = 'https://github.com/Grasscutters/Grasscutter/archive/refs/heads/development.zip'
|
||||
const STABLE_DOWNLOAD = 'https://nightly.link/Grasscutters/Grasscutter/workflows/build/stable/Grasscutter.zip'
|
||||
const DEV_DOWNLOAD = 'https://nightly.link/Grasscutters/Grasscutter/workflows/build/development/Grasscutter.zip'
|
||||
const RESOURCES_DOWNLOAD = 'https://gitlab.com/yukiz/GrasscutterResources/-/archive/3.0/GrasscutterResources-3.0.zip'
|
||||
const RESOURCES_DOWNLOAD = 'https://gitlab.com/YuukiPS/GC-Resources/-/archive/3.5/GC-Resources-3.5.zip' // Use Yuuki res as grasscutter crepe res are broken
|
||||
const MIGOTO_DOWNLOAD =
|
||||
'https://github.com/SilentNightSound/GI-Model-Importer/releases/download/V6.0/3dmigoto-GIMI-for-playing-mods.zip'
|
||||
|
||||
interface IProps {
|
||||
closeFn: () => void
|
||||
@@ -25,11 +28,14 @@ interface IProps {
|
||||
}
|
||||
|
||||
interface IState {
|
||||
fullbuild_downloading: boolean
|
||||
grasscutter_downloading: boolean
|
||||
resources_downloading: boolean
|
||||
repo_downloading: boolean
|
||||
migoto_downloading: boolean
|
||||
grasscutter_set: boolean
|
||||
resources_exist: boolean
|
||||
swag: boolean
|
||||
}
|
||||
|
||||
export default class Downloads extends React.Component<IProps, IState> {
|
||||
@@ -37,24 +43,34 @@ export default class Downloads extends React.Component<IProps, IState> {
|
||||
super(props)
|
||||
|
||||
this.state = {
|
||||
fullbuild_downloading: this.props.downloadManager.downloadingFullBuild(),
|
||||
grasscutter_downloading: this.props.downloadManager.downloadingJar(),
|
||||
resources_downloading: this.props.downloadManager.downloadingResources(),
|
||||
repo_downloading: this.props.downloadManager.downloadingRepo(),
|
||||
migoto_downloading: this.props.downloadManager.downloadingMigoto(),
|
||||
grasscutter_set: false,
|
||||
resources_exist: false,
|
||||
swag: false,
|
||||
}
|
||||
|
||||
this.getGrasscutterFolder = this.getGrasscutterFolder.bind(this)
|
||||
this.downloadGrasscutterFullBuild = this.downloadGrasscutterFullBuild.bind(this)
|
||||
this.downloadGrasscutterStableRepo = this.downloadGrasscutterStableRepo.bind(this)
|
||||
this.downloadGrasscutterDevRepo = this.downloadGrasscutterDevRepo.bind(this)
|
||||
this.downloadGrasscutterStable = this.downloadGrasscutterStable.bind(this)
|
||||
this.downloadGrasscutterLatest = this.downloadGrasscutterLatest.bind(this)
|
||||
this.downloadResources = this.downloadResources.bind(this)
|
||||
this.downloadMigoto = this.downloadMigoto.bind(this)
|
||||
this.toggleButtons = this.toggleButtons.bind(this)
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const gc_path = await getConfigOption('grasscutter_path')
|
||||
const swag = await getConfigOption('swag_mode')
|
||||
|
||||
this.setState({
|
||||
swag: swag || false,
|
||||
})
|
||||
|
||||
listen('jar_extracted', () => {
|
||||
this.setState({ grasscutter_set: true }, this.forceUpdate)
|
||||
@@ -109,6 +125,22 @@ export default class Downloads extends React.Component<IProps, IState> {
|
||||
return folderPath
|
||||
}
|
||||
|
||||
async getCultivationFolder() {
|
||||
const folderPath = (await dataDir()) + 'cultivation'
|
||||
|
||||
return folderPath
|
||||
}
|
||||
|
||||
async downloadGrasscutterFullBuild() {
|
||||
const folder = await this.getGrasscutterFolder()
|
||||
this.props.downloadManager.addDownload(FULL_BUILD_DOWNLOAD, folder + '\\GrasscutterCulti.zip', async () => {
|
||||
await unzip(folder + '\\GrasscutterCulti.zip', folder + '\\', true)
|
||||
this.toggleButtons()
|
||||
})
|
||||
|
||||
this.toggleButtons()
|
||||
}
|
||||
|
||||
async downloadGrasscutterStableRepo() {
|
||||
const folder = await this.getGrasscutterFolder()
|
||||
this.props.downloadManager.addDownload(STABLE_REPO_DOWNLOAD, folder + '\\grasscutter_repo.zip', async () => {
|
||||
@@ -158,6 +190,11 @@ export default class Downloads extends React.Component<IProps, IState> {
|
||||
async downloadResources() {
|
||||
const folder = await this.getGrasscutterFolder()
|
||||
this.props.downloadManager.addDownload(RESOURCES_DOWNLOAD, folder + '\\resources.zip', async () => {
|
||||
// Tell the user this takes some time
|
||||
alert(
|
||||
'Extracting resources can take time! If your resources appear to be "stuck" extracting for less than 15-20 mins, they likely still are extracting.'
|
||||
)
|
||||
|
||||
// Delete the existing folder if it exists
|
||||
if (
|
||||
await invoke('dir_exists', {
|
||||
@@ -182,14 +219,30 @@ export default class Downloads extends React.Component<IProps, IState> {
|
||||
this.toggleButtons()
|
||||
}
|
||||
|
||||
async downloadMigoto() {
|
||||
const folder = (await this.getCultivationFolder()) + '\\3dmigoto'
|
||||
await invoke('dir_create', {
|
||||
path: folder,
|
||||
})
|
||||
|
||||
this.props.downloadManager.addDownload(MIGOTO_DOWNLOAD, folder + '\\GIMI-3dmigoto.zip', async () => {
|
||||
await unzip(folder + '\\GIMI-3dmigoto.zip', folder + '\\', true)
|
||||
this.toggleButtons()
|
||||
})
|
||||
|
||||
this.toggleButtons()
|
||||
}
|
||||
|
||||
async toggleButtons() {
|
||||
const gc_path = await getConfigOption('grasscutter_path')
|
||||
|
||||
// Set states since we know we are downloading something if this is called
|
||||
this.setState({
|
||||
fullbuild_downloading: this.props.downloadManager.downloadingFullBuild(),
|
||||
grasscutter_downloading: this.props.downloadManager.downloadingJar(),
|
||||
resources_downloading: this.props.downloadManager.downloadingResources(),
|
||||
repo_downloading: this.props.downloadManager.downloadingRepo(),
|
||||
migoto_downloading: this.props.downloadManager.downloadingMigoto(),
|
||||
grasscutter_set: gc_path !== '',
|
||||
})
|
||||
}
|
||||
@@ -197,7 +250,30 @@ export default class Downloads extends React.Component<IProps, IState> {
|
||||
render() {
|
||||
return (
|
||||
<Menu closeFn={this.props.closeFn} className="Downloads" heading="Downloads">
|
||||
<div className="DownloadMenuSection" id="downloadMenuContainerGCStable">
|
||||
<Divider />
|
||||
|
||||
<div className="HeaderText" id="downloadMenuAIOHeader">
|
||||
<Tr text="downloads.aio_header" />
|
||||
</div>
|
||||
<div className="DownloadMenuSection" id="downloadMenuContainerGCFullBuild">
|
||||
<div className="DownloadLabel" id="downloadMenuLabelGCFullBuild">
|
||||
<Tr text={'downloads.grasscutter_fullbuild'} />
|
||||
<HelpButton contents="help.gc_fullbuild" />
|
||||
</div>
|
||||
<div className="DownloadValue" id="downloadMenuButtonGCFullBuild">
|
||||
<BigButton
|
||||
disabled={this.state.grasscutter_downloading}
|
||||
onClick={this.downloadGrasscutterFullBuild}
|
||||
id="grasscutterFullBuildBtn"
|
||||
>
|
||||
<Tr text="components.download" />
|
||||
</BigButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Divider />
|
||||
|
||||
{/* <div className="DownloadMenuSection" id="downloadMenuContainerGCStable">
|
||||
<div className="DownloadLabel" id="downloadMenuLabelGCStable">
|
||||
<Tr
|
||||
text={this.state.grasscutter_set ? 'downloads.grasscutter_stable' : 'downloads.grasscutter_stable_update'}
|
||||
@@ -213,6 +289,9 @@ export default class Downloads extends React.Component<IProps, IState> {
|
||||
<Tr text="components.download" />
|
||||
</BigButton>
|
||||
</div>
|
||||
</div> */}
|
||||
<div className="HeaderText" id="downloadMenuIndividualHeader">
|
||||
<Tr text="downloads.individual_header" />
|
||||
</div>
|
||||
<div className="DownloadMenuSection" id="downloadMenuContainerGCDev">
|
||||
<div className="DownloadLabel" id="downloadMenuLabelGCDev">
|
||||
@@ -232,9 +311,7 @@ export default class Downloads extends React.Component<IProps, IState> {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Divider />
|
||||
|
||||
<div className="DownloadMenuSection" id="downloadMenuContainerGCStableData">
|
||||
{/* <div className="DownloadMenuSection" id="downloadMenuContainerGCStableData">
|
||||
<div className="DownloadLabel" id="downloadMenuLabelGCStableData">
|
||||
<Tr
|
||||
text={
|
||||
@@ -254,7 +331,7 @@ export default class Downloads extends React.Component<IProps, IState> {
|
||||
<Tr text="components.download" />
|
||||
</BigButton>
|
||||
</div>
|
||||
</div>
|
||||
</div> */}
|
||||
<div className="DownloadMenuSection" id="downloadMenuContainerGCDevData">
|
||||
<div className="DownloadLabel" id="downloadMenuLabelGCDevData">
|
||||
<Tr
|
||||
@@ -277,8 +354,6 @@ export default class Downloads extends React.Component<IProps, IState> {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Divider />
|
||||
|
||||
<div className="DownloadMenuSection" id="downloadMenuContainerResources">
|
||||
<div className="DownloadLabel" id="downloadMenuLabelResources">
|
||||
<Tr text="downloads.resources" />
|
||||
@@ -294,6 +369,26 @@ export default class Downloads extends React.Component<IProps, IState> {
|
||||
</BigButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{this.state.swag && (
|
||||
<>
|
||||
<Divider />
|
||||
<div className="HeaderText" id="downloadMenuModsHeader">
|
||||
<Tr text="downloads.mods_header" />
|
||||
</div>
|
||||
<div className="DownloadMenuSection" id="downloadMenuContainerMigoto">
|
||||
<div className="DownloadLabel" id="downloadMenuLabelMigoto">
|
||||
<Tr text={'downloads.migoto'} />
|
||||
<HelpButton contents="help.migoto" />
|
||||
</div>
|
||||
<div className="DownloadValue" id="downloadMenuButtonMigoto">
|
||||
<BigButton disabled={this.state.migoto_downloading} onClick={this.downloadMigoto} id="migotoBtn">
|
||||
<Tr text="components.download" />
|
||||
</BigButton>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</Menu>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ import { invoke } from '@tauri-apps/api'
|
||||
import { dataDir } from '@tauri-apps/api/path'
|
||||
import DirInput from '../common/DirInput'
|
||||
import Menu from './Menu'
|
||||
import Tr, { getLanguages, translate } from '../../../utils/language'
|
||||
import { setConfigOption, getConfig, getConfigOption } from '../../../utils/configuration'
|
||||
import Tr, { getLanguages } from '../../../utils/language'
|
||||
import { setConfigOption, getConfig, getConfigOption, Configuration } from '../../../utils/configuration'
|
||||
import Checkbox from '../common/Checkbox'
|
||||
import Divider from './Divider'
|
||||
import { getThemeList } from '../../../utils/themes'
|
||||
@@ -13,8 +13,10 @@ import * as server from '../../../utils/server'
|
||||
import './Options.css'
|
||||
import BigButton from '../common/BigButton'
|
||||
import DownloadHandler from '../../../utils/download'
|
||||
import * as meta from '../../../utils/metadata'
|
||||
import * as meta from '../../../utils/rsa'
|
||||
import HelpButton from '../common/HelpButton'
|
||||
import TextInput from '../common/TextInput'
|
||||
import SmallButton from '../common/SmallButton'
|
||||
|
||||
interface IProps {
|
||||
closeFn: () => void
|
||||
@@ -32,9 +34,13 @@ interface IState {
|
||||
themes: string[]
|
||||
theme: string
|
||||
encryption: boolean
|
||||
patch_metadata: boolean
|
||||
patch_rsa: boolean
|
||||
use_internal_proxy: boolean
|
||||
wipe_login: boolean
|
||||
horny_mode: boolean
|
||||
auto_mongodb: boolean
|
||||
swag: boolean
|
||||
platform: string
|
||||
|
||||
// Swag stuff
|
||||
akebi_path: string
|
||||
@@ -57,9 +63,13 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
themes: ['default'],
|
||||
theme: '',
|
||||
encryption: false,
|
||||
patch_metadata: false,
|
||||
patch_rsa: false,
|
||||
use_internal_proxy: false,
|
||||
wipe_login: false,
|
||||
horny_mode: false,
|
||||
swag: false,
|
||||
auto_mongodb: false,
|
||||
platform: '',
|
||||
|
||||
// Swag stuff
|
||||
akebi_path: '',
|
||||
@@ -75,20 +85,22 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
this.toggleGrasscutterWithGame = this.toggleGrasscutterWithGame.bind(this)
|
||||
this.setCustomBackground = this.setCustomBackground.bind(this)
|
||||
this.toggleEncryption = this.toggleEncryption.bind(this)
|
||||
this.restoreMetadata = this.restoreMetadata.bind(this)
|
||||
this.toggleMetadata = this.toggleMetadata.bind(this)
|
||||
this.toggleProxy = this.toggleProxy.bind(this)
|
||||
this.removeRSA = this.removeRSA.bind(this)
|
||||
this.addMigotoDelay = this.addMigotoDelay.bind(this)
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const config = await getConfig()
|
||||
const languages = await getLanguages()
|
||||
const platform: string = await invoke('get_platform')
|
||||
|
||||
// Remove jar from path
|
||||
const path = config.grasscutter_path.replace(/\\/g, '/')
|
||||
const folderPath = path.substring(0, path.lastIndexOf('/'))
|
||||
const encEnabled = await server.encryptionEnabled(folderPath + '/config.json')
|
||||
|
||||
console.log(platform)
|
||||
|
||||
this.setState({
|
||||
game_install_path: config.game_install_path || '',
|
||||
grasscutter_path: config.grasscutter_path || '',
|
||||
@@ -99,10 +111,14 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
bg_url_or_path: config.customBackground || '',
|
||||
themes: (await getThemeList()).map((t) => t.name),
|
||||
theme: config.theme || 'default',
|
||||
encryption: await translate(encEnabled ? 'options.enabled' : 'options.disabled'),
|
||||
patch_metadata: config.patch_metadata || false,
|
||||
encryption: encEnabled || false,
|
||||
patch_rsa: config.patch_rsa || false,
|
||||
use_internal_proxy: config.use_internal_proxy || false,
|
||||
wipe_login: config.wipe_login || false,
|
||||
horny_mode: config.horny_mode || false,
|
||||
swag: config.swag_mode || false,
|
||||
auto_mongodb: config.auto_mongodb || false,
|
||||
platform,
|
||||
|
||||
// Swag stuff
|
||||
akebi_path: config.akebi_path || '',
|
||||
@@ -116,17 +132,40 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
setGameExecutable(value: string) {
|
||||
setConfigOption('game_install_path', value)
|
||||
|
||||
// I hope this stops people setting launcher.exe because oml it's annoying
|
||||
if (value.endsWith('launcher.exe')) {
|
||||
const pathArr = value.replace(/\\/g, '/').split('/')
|
||||
pathArr.pop()
|
||||
const path = pathArr.join('/') + '/Genshin Impact Game/'
|
||||
|
||||
alert(
|
||||
`You have set your game execuatable to "launcher.exe". You should not do this. Your game executable is located in:\n\n${path}`
|
||||
)
|
||||
}
|
||||
|
||||
this.setState({
|
||||
game_install_path: value,
|
||||
})
|
||||
}
|
||||
|
||||
setGrasscutterJar(value: string) {
|
||||
async setGrasscutterJar(value: string) {
|
||||
setConfigOption('grasscutter_path', value)
|
||||
|
||||
this.setState({
|
||||
grasscutter_path: value,
|
||||
})
|
||||
|
||||
const config = await getConfig()
|
||||
const path = config.grasscutter_path.replace(/\\/g, '/')
|
||||
const folderPath = path.substring(0, path.lastIndexOf('/'))
|
||||
const encEnabled = await server.encryptionEnabled(folderPath + '/config.json')
|
||||
|
||||
// Update encryption button when setting new jar
|
||||
this.setState({
|
||||
encryption: encEnabled,
|
||||
})
|
||||
|
||||
window.location.reload()
|
||||
}
|
||||
|
||||
setJavaPath(value: string) {
|
||||
@@ -151,6 +190,11 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
this.setState({
|
||||
migoto_path: value,
|
||||
})
|
||||
|
||||
// Set game exe in Migoto ini
|
||||
invoke('set_migoto_target', {
|
||||
migotoPath: value,
|
||||
})
|
||||
}
|
||||
|
||||
setReshade(value: string) {
|
||||
@@ -220,14 +264,24 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
await server.toggleEncryption(folderPath + '/config.json')
|
||||
|
||||
this.setState({
|
||||
encryption: await translate(
|
||||
(await server.encryptionEnabled(folderPath + '/config.json')) ? 'options.enabled' : 'options.disabled'
|
||||
),
|
||||
encryption: await server.encryptionEnabled(folderPath + '/config.json'),
|
||||
})
|
||||
|
||||
// Check if Grasscutter is running, and restart if so to apply changes
|
||||
if (await invoke('is_grasscutter_running')) {
|
||||
alert('Automatically restarting Grasscutter to apply encryption changes!')
|
||||
await invoke('restart_grasscutter')
|
||||
}
|
||||
}
|
||||
|
||||
async restoreMetadata() {
|
||||
await meta.restoreMetadata(this.props.downloadManager)
|
||||
async removeRSA() {
|
||||
await meta.unpatchGame()
|
||||
}
|
||||
|
||||
async addMigotoDelay() {
|
||||
invoke('set_migoto_delay', {
|
||||
migotoPath: this.state.migoto_path,
|
||||
})
|
||||
}
|
||||
|
||||
async installCert() {
|
||||
@@ -236,55 +290,57 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
})
|
||||
}
|
||||
|
||||
async toggleMetadata() {
|
||||
const changedVal = !(await getConfigOption('patch_metadata'))
|
||||
async toggleOption(opt: keyof Configuration) {
|
||||
const changedVal = !(await getConfigOption(opt))
|
||||
|
||||
await setConfigOption('patch_metadata', changedVal)
|
||||
await setConfigOption(opt, changedVal)
|
||||
|
||||
// @ts-expect-error shut up bitch
|
||||
this.setState({
|
||||
patch_metadata: changedVal,
|
||||
})
|
||||
}
|
||||
|
||||
async toggleProxy() {
|
||||
const changedVal = !(await getConfigOption('use_internal_proxy'))
|
||||
|
||||
await setConfigOption('use_internal_proxy', changedVal)
|
||||
|
||||
this.setState({
|
||||
use_internal_proxy: changedVal,
|
||||
[opt]: changedVal,
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Menu closeFn={this.props.closeFn} className="Options" heading="Options">
|
||||
<div className="OptionSection" id="menuOptionsContainerGamePath">
|
||||
<div className="OptionLabel" id="menuOptionsLabelGamePath">
|
||||
<Tr text="options.game_path" />
|
||||
{!this.state.platform || this.state.platform === 'windows' ? (
|
||||
<div className="OptionSection" id="menuOptionsContainerGamePath">
|
||||
<div className="OptionLabel" id="menuOptionsLabelGamePath">
|
||||
<Tr text="options.game_path" />
|
||||
</div>
|
||||
<div className="OptionValue" id="menuOptionsDirGamePath">
|
||||
<DirInput onChange={this.setGameExecutable} value={this.state?.game_install_path} extensions={['exe']} />
|
||||
</div>
|
||||
</div>
|
||||
<div className="OptionValue" id="menuOptionsDirGamePath">
|
||||
<DirInput onChange={this.setGameExecutable} value={this.state?.game_install_path} extensions={['exe']} />
|
||||
) : (
|
||||
<div className="OptionSection" id="menuOptionsContainerGameCommand">
|
||||
<div className="OptionLabel" id="menuOptionsLabelGameCommand">
|
||||
<Tr text="options.game_command" />
|
||||
</div>
|
||||
<div className="OptionValue" id="menuOptionsGameCommand">
|
||||
<TextInput />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<div className="OptionSection" id="menuOptionsContainermetaDownload">
|
||||
<div className="OptionLabel" id="menuOptionsLabelmetaDownload">
|
||||
<Tr text="options.recover_metadata" />
|
||||
<HelpButton contents="help.emergency_metadata" />
|
||||
<Tr text="options.recover_rsa" />
|
||||
<HelpButton contents="help.emergency_rsa" />
|
||||
</div>
|
||||
<div className="OptionValue" id="menuOptionsButtonmetaDownload">
|
||||
<BigButton onClick={this.restoreMetadata} id="metaDownload">
|
||||
<Tr text="components.download" />
|
||||
<BigButton onClick={this.removeRSA} id="metaDownload">
|
||||
<Tr text="components.delete" />
|
||||
</BigButton>
|
||||
</div>
|
||||
</div>
|
||||
<div className="OptionSection" id="menuOptionsContainerPatchMeta">
|
||||
<div className="OptionLabel" id="menuOptionsLabelPatchMeta">
|
||||
<Tr text="options.patch_metadata" />
|
||||
<HelpButton contents="help.patch_metadata" />
|
||||
<Tr text="options.patch_rsa" />
|
||||
<HelpButton contents="help.patch_rsa" />
|
||||
</div>
|
||||
<div className="OptionValue" id="menuOptionsCheckboxPatchMeta">
|
||||
<Checkbox onChange={this.toggleMetadata} checked={this.state?.patch_metadata} id="patchMeta" />
|
||||
<Checkbox onChange={() => this.toggleOption('patch_rsa')} checked={this.state?.patch_rsa} id="patchMeta" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="OptionSection" id="menuOptionsContainerUseProxy">
|
||||
@@ -293,7 +349,35 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
<HelpButton contents="help.use_proxy" />
|
||||
</div>
|
||||
<div className="OptionValue" id="menuOptionsCheckboxUseProxy">
|
||||
<Checkbox onChange={this.toggleProxy} checked={this.state?.use_internal_proxy} id="useProxy" />
|
||||
<Checkbox
|
||||
onChange={() => this.toggleOption('use_internal_proxy')}
|
||||
checked={this.state?.use_internal_proxy}
|
||||
id="useProxy"
|
||||
/>
|
||||
</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.toggleOption('wipe_login')}
|
||||
checked={this.state?.wipe_login}
|
||||
id="wipeLogin"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="OptionSection" id="menuOptionsContainerAutoMongodb">
|
||||
<div className="OptionLabel" id="menuOptionsLabelAutoMongodb">
|
||||
<Tr text="options.auto_mongodb" />
|
||||
</div>
|
||||
<div className="OptionValue" id="menuOptionsCheckboxAutoMongodb">
|
||||
<Checkbox
|
||||
onChange={() => this.toggleOption('auto_mongodb')}
|
||||
checked={this.state?.auto_mongodb}
|
||||
id="autoMongodb"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -313,9 +397,7 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
<HelpButton contents="help.encryption" />
|
||||
</div>
|
||||
<div className="OptionValue" id="menuOptionsButtonToggleEnc">
|
||||
<BigButton onClick={this.toggleEncryption} id="toggleEnc">
|
||||
{this.state.encryption}
|
||||
</BigButton>
|
||||
<Checkbox onChange={() => this.toggleEncryption()} checked={this.state.encryption} id="toggleEnc" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="OptionSection" id="menuOptionsContainerInstallCert">
|
||||
@@ -344,6 +426,7 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
<Tr text="swag.migoto" />
|
||||
</div>
|
||||
<div className="OptionValue" id="menuOptionsDirMigoto">
|
||||
<SmallButton onClick={this.addMigotoDelay} id="migotoDelay" contents="help.add_delay"></SmallButton>
|
||||
<DirInput onChange={this.setMigoto} value={this.state?.migoto_path} extensions={['exe']} />
|
||||
</div>
|
||||
</div>
|
||||
@@ -366,12 +449,26 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
</div>
|
||||
<div className="OptionValue" id="menuOptionsCheckboxGCWGame">
|
||||
<Checkbox
|
||||
onChange={this.toggleGrasscutterWithGame}
|
||||
onChange={() => this.toggleOption('grasscutter_with_game')}
|
||||
checked={this.state?.grasscutter_with_game}
|
||||
id="gcWithGame"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
{this.state.swag ? (
|
||||
<div className="OptionSection" id="menuOptionsContainerHorny">
|
||||
<div className="OptionLabel" id="menuOptionsLabelHorny">
|
||||
<Tr text="options.horny_mode" />
|
||||
</div>
|
||||
<div className="OptionValue" id="menuOptionsCheckboxHorny">
|
||||
<Checkbox
|
||||
onChange={() => this.toggleOption('horny_mode')}
|
||||
checked={this.state?.horny_mode}
|
||||
id="hornyMode"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
<Divider />
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react'
|
||||
import { getConfigOption } from '../../../utils/configuration'
|
||||
import { getInstalledMods, getMods, ModData, PartialModData } from '../../../utils/gamebanana'
|
||||
import { LoadingCircle } from './LoadingCircle'
|
||||
|
||||
@@ -11,6 +12,7 @@ interface IProps {
|
||||
}
|
||||
|
||||
interface IState {
|
||||
horny: boolean
|
||||
modList: ModData[] | null
|
||||
installedList:
|
||||
| {
|
||||
@@ -25,6 +27,7 @@ export class ModList extends React.Component<IProps, IState> {
|
||||
super(props)
|
||||
|
||||
this.state = {
|
||||
horny: false,
|
||||
modList: null,
|
||||
installedList: null,
|
||||
}
|
||||
@@ -60,8 +63,10 @@ export class ModList extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
const mods = await getMods(this.props.mode)
|
||||
const horny = await getConfigOption('horny_mode')
|
||||
|
||||
this.setState({
|
||||
horny,
|
||||
modList: mods,
|
||||
})
|
||||
}
|
||||
@@ -78,10 +83,16 @@ export class ModList extends React.Component<IProps, IState> {
|
||||
<div className="ModListInner">
|
||||
{this.props.mode === 'installed'
|
||||
? this.state.installedList?.map((mod) => (
|
||||
<ModTile path={mod.path} mod={mod.info} key={mod.info.name} onClick={this.downloadMod} />
|
||||
<ModTile
|
||||
horny={this.state.horny}
|
||||
path={mod.path}
|
||||
mod={mod.info}
|
||||
key={mod.info.name}
|
||||
onClick={this.downloadMod}
|
||||
/>
|
||||
))
|
||||
: this.state.modList?.map((mod: ModData) => (
|
||||
<ModTile mod={mod} key={mod.id} onClick={this.downloadMod} />
|
||||
<ModTile horny={this.state.horny} mod={mod} key={mod.id} onClick={this.downloadMod} />
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React from 'react'
|
||||
import { ModData, PartialModData } from '../../../utils/gamebanana'
|
||||
import { getConfigOption } from '../../../utils/configuration'
|
||||
|
||||
import './ModTile.css'
|
||||
import Like from '../../../resources/icons/like.svg'
|
||||
@@ -12,11 +13,13 @@ import { disableMod, enableMod, modIsEnabled } from '../../../utils/mods'
|
||||
|
||||
interface IProps {
|
||||
mod: ModData | PartialModData
|
||||
horny?: boolean
|
||||
path?: string
|
||||
onClick: (mod: ModData) => void
|
||||
}
|
||||
|
||||
interface IState {
|
||||
horny: boolean
|
||||
hover: boolean
|
||||
modEnabled: boolean
|
||||
}
|
||||
@@ -26,6 +29,7 @@ export class ModTile extends React.Component<IProps, IState> {
|
||||
super(props)
|
||||
|
||||
this.state = {
|
||||
horny: false,
|
||||
hover: false,
|
||||
modEnabled: false,
|
||||
}
|
||||
@@ -43,10 +47,13 @@ export class ModTile extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const horny = await getConfigOption('horny_mode')
|
||||
|
||||
if (!('id' in this.props.mod)) {
|
||||
// Partial mod
|
||||
this.setState({
|
||||
modEnabled: await modIsEnabled(this.props.mod.name),
|
||||
horny,
|
||||
})
|
||||
|
||||
return
|
||||
@@ -54,6 +61,7 @@ export class ModTile extends React.Component<IProps, IState> {
|
||||
|
||||
this.setState({
|
||||
modEnabled: await modIsEnabled(String(this.props.mod.id)),
|
||||
horny,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -65,6 +73,7 @@ export class ModTile extends React.Component<IProps, IState> {
|
||||
this.setState(
|
||||
{
|
||||
modEnabled: !this.state.modEnabled,
|
||||
horny: !this.state.horny,
|
||||
},
|
||||
() => {
|
||||
if (this.state.modEnabled) {
|
||||
@@ -107,7 +116,9 @@ export class ModTile extends React.Component<IProps, IState> {
|
||||
))}
|
||||
<img
|
||||
src={mod.images[0]}
|
||||
className={`ModImageInner ${'id' in mod && mod.nsfw ? 'nsfw' : ''} ${this.state.hover ? 'blur' : ''}`}
|
||||
className={`ModImageInner ${'id' in mod && !this.state.horny && mod.nsfw ? 'nsfw' : ''} ${
|
||||
this.state.hover ? 'blur' : ''
|
||||
}`}
|
||||
/>
|
||||
</div>
|
||||
<div className="ModInner">
|
||||
|
||||
@@ -50,6 +50,7 @@ export default class NewsSection extends React.Component<IProps, IState> {
|
||||
componentDidMount() {
|
||||
// Call showNews off the bat
|
||||
this.showNews()
|
||||
this.setSelected('commits')
|
||||
}
|
||||
|
||||
setSelected(item: string) {
|
||||
@@ -59,51 +60,52 @@ export default class NewsSection extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
async showLatestCommits() {
|
||||
if (!this.state.commitList) {
|
||||
const response: string = await invoke('req_get', { url: 'https://api.grasscutter.io/cultivation/query' })
|
||||
let grasscutterApiResponse: GrasscutterAPIResponse | null = null
|
||||
// Just use official API
|
||||
const response: string = await invoke('req_get', {
|
||||
url: 'https://api.github.com/repos/Grasscutters/Grasscutter/commits',
|
||||
})
|
||||
let grasscutterApiResponse: GrasscutterAPIResponse | null = null
|
||||
|
||||
try {
|
||||
grasscutterApiResponse = JSON.parse(response)
|
||||
} catch (e) {
|
||||
grasscutterApiResponse = null
|
||||
}
|
||||
|
||||
let commits: CommitResponse[]
|
||||
if (grasscutterApiResponse?.commits == null) {
|
||||
// If it didn't work, use official API
|
||||
const response: string = await invoke('req_get', {
|
||||
url: 'https://api.github.com/repos/Grasscutters/Grasscutter/commits',
|
||||
})
|
||||
commits = JSON.parse(response)
|
||||
} else {
|
||||
commits = grasscutterApiResponse.commits.gc_stable
|
||||
}
|
||||
|
||||
// Probably rate-limited
|
||||
if (!Array.isArray(commits)) return
|
||||
|
||||
// Get only first 5
|
||||
const commitsList = commits.slice(0, 10)
|
||||
const commitsListHtml = commitsList.map((commitResponse: CommitResponse) => {
|
||||
return (
|
||||
<tr className="Commit" id="newsCommitsTable" key={commitResponse.sha}>
|
||||
<td className="CommitAuthor">
|
||||
<span>{commitResponse.commit.author.name}</span>
|
||||
</td>
|
||||
<td className="CommitMessage">
|
||||
<span>{commitResponse.commit.message}</span>
|
||||
</td>
|
||||
</tr>
|
||||
)
|
||||
})
|
||||
|
||||
this.setState({
|
||||
commitList: commitsListHtml,
|
||||
news: <>{commitsListHtml}</>,
|
||||
})
|
||||
try {
|
||||
grasscutterApiResponse = JSON.parse(response)
|
||||
} catch (e) {
|
||||
grasscutterApiResponse = null
|
||||
}
|
||||
|
||||
let commits: CommitResponse[]
|
||||
if (grasscutterApiResponse?.commits == null) {
|
||||
// If it didn't work, try again anyways
|
||||
const response: string = await invoke('req_get', {
|
||||
url: 'https://api.github.com/repos/Grasscutters/Grasscutter/commits',
|
||||
})
|
||||
commits = JSON.parse(response)
|
||||
} else {
|
||||
commits = grasscutterApiResponse.commits.gc_stable
|
||||
}
|
||||
|
||||
// Probably rate-limited
|
||||
if (!Array.isArray(commits)) return
|
||||
|
||||
// Get only first 5
|
||||
const commitsList = commits.slice(0, 10)
|
||||
const commitsListHtml = commitsList.map((commitResponse: CommitResponse) => {
|
||||
return (
|
||||
<tr className="Commit" id="newsCommitsTable" key={commitResponse.sha}>
|
||||
<td className="CommitAuthor">
|
||||
<span>{commitResponse.commit.author.name}</span>
|
||||
</td>
|
||||
<td className="CommitMessage">
|
||||
<span>{commitResponse.commit.message}</span>
|
||||
</td>
|
||||
</tr>
|
||||
)
|
||||
})
|
||||
|
||||
this.setState({
|
||||
commitList: commitsListHtml,
|
||||
news: <>{commitsListHtml}</>,
|
||||
})
|
||||
|
||||
return this.state.commitList
|
||||
}
|
||||
|
||||
@@ -122,7 +124,7 @@ export default class NewsSection extends React.Component<IProps, IState> {
|
||||
case 'latest_version':
|
||||
news = (
|
||||
<tr>
|
||||
<td>Latest version</td>
|
||||
<td>Latest version: Grasscutter 1.4.6 - Cultivation 1.0.10</td>
|
||||
</tr>
|
||||
)
|
||||
break
|
||||
|
||||
@@ -5,7 +5,7 @@ let configFilePath: string
|
||||
let defaultConfig: Configuration
|
||||
;(async () => {
|
||||
defaultConfig = {
|
||||
toggle_grasscutter: false,
|
||||
toggle_grasscutter: true,
|
||||
game_install_path: 'C:\\Program Files\\Genshin Impact\\Genshin Impact game\\GenshinImpact.exe',
|
||||
grasscutter_with_game: false,
|
||||
grasscutter_path: '',
|
||||
@@ -20,8 +20,11 @@ let defaultConfig: Configuration
|
||||
theme: 'default',
|
||||
https_enabled: false,
|
||||
debug_enabled: false,
|
||||
patch_metadata: true,
|
||||
patch_rsa: true,
|
||||
use_internal_proxy: true,
|
||||
wipe_login: false,
|
||||
horny_mode: false,
|
||||
auto_mongodb: false,
|
||||
}
|
||||
})()
|
||||
|
||||
@@ -44,9 +47,12 @@ export interface Configuration {
|
||||
theme: string
|
||||
https_enabled: boolean
|
||||
debug_enabled: boolean
|
||||
patch_metadata: boolean
|
||||
patch_rsa: boolean
|
||||
use_internal_proxy: boolean
|
||||
wipe_login: boolean
|
||||
horny_mode: boolean
|
||||
swag_mode?: boolean
|
||||
auto_mongodb: boolean
|
||||
|
||||
// Swag stuff
|
||||
akebi_path?: string
|
||||
|
||||
@@ -77,14 +77,20 @@ export default class DownloadHandler {
|
||||
|
||||
// Extraction events
|
||||
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)
|
||||
this.downloads[index].status = 'extracting'
|
||||
})
|
||||
|
||||
listen('extract_end', ({ payload }) => {
|
||||
// Find the download that is no extracting and set it's status as such
|
||||
const index = this.downloads.findIndex((download) => download.path === payload)
|
||||
// @ts-expect-error shut up typescript
|
||||
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'
|
||||
})
|
||||
}
|
||||
@@ -98,6 +104,11 @@ export default class DownloadHandler {
|
||||
return this.downloads.some((d) => d.path.includes('grasscutter.zip'))
|
||||
}
|
||||
|
||||
downloadingFullBuild() {
|
||||
// Kinda hacky but it works
|
||||
return this.downloads.some((d) => d.path.includes('GrasscutterCulti'))
|
||||
}
|
||||
|
||||
downloadingResources() {
|
||||
// Kinda hacky but it works
|
||||
return this.downloads.some((d) => d.path.includes('resources'))
|
||||
@@ -107,6 +118,10 @@ export default class DownloadHandler {
|
||||
return this.downloads.some((d) => d.path.includes('grasscutter_repo.zip'))
|
||||
}
|
||||
|
||||
downloadingMigoto() {
|
||||
return this.downloads.some((d) => d.path.includes('3dmigoto'))
|
||||
}
|
||||
|
||||
addDownload(url: string, path: string, onFinish?: () => void) {
|
||||
// Begin download from rust backend, don't add if the download addition fails
|
||||
invoke('download_file', { url, path })
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { invoke } from '@tauri-apps/api'
|
||||
import { getConfig } from './configuration'
|
||||
|
||||
export async function getGameExecutable() {
|
||||
@@ -11,6 +12,17 @@ export async function getGameExecutable() {
|
||||
return pathArr[pathArr.length - 1]
|
||||
}
|
||||
|
||||
export async function getGrasscutterJar() {
|
||||
const config = await getConfig()
|
||||
|
||||
if (!config.grasscutter_path) {
|
||||
return null
|
||||
}
|
||||
|
||||
const pathArr = config.grasscutter_path.replace(/\\/g, '/').split('/')
|
||||
return pathArr[pathArr.length - 1]
|
||||
}
|
||||
|
||||
export async function getGameFolder() {
|
||||
const config = await getConfig()
|
||||
|
||||
@@ -25,3 +37,36 @@ export async function getGameFolder() {
|
||||
|
||||
return path
|
||||
}
|
||||
|
||||
export async function getGameDataFolder() {
|
||||
const gameExec = await getGameExecutable()
|
||||
|
||||
if (!gameExec) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (await getGameFolder()) + '\\' + gameExec.replace('.exe', '_Data')
|
||||
}
|
||||
|
||||
export async function getGameVersion() {
|
||||
const GameData = await getGameDataFolder()
|
||||
|
||||
if (!GameData) {
|
||||
return null
|
||||
}
|
||||
|
||||
const settings = JSON.parse(
|
||||
await invoke('read_file', {
|
||||
path: GameData + '\\StreamingAssets\\asb_settings.json',
|
||||
})
|
||||
)
|
||||
|
||||
const versionRaw = settings.variance.split('.')
|
||||
const version = {
|
||||
major: parseInt(versionRaw[0]),
|
||||
minor: parseInt(versionRaw[1].split('_')[0]),
|
||||
release: parseInt(versionRaw[1].split('_')[1]),
|
||||
}
|
||||
|
||||
return version
|
||||
}
|
||||
|
||||
@@ -118,13 +118,30 @@ interface ModDownload {
|
||||
}
|
||||
|
||||
export async function getMods(mode: string) {
|
||||
const resp = JSON.parse(
|
||||
await invoke('list_submissions', {
|
||||
mode,
|
||||
})
|
||||
)
|
||||
let modList: GamebananaResponse[] = []
|
||||
let hadMods = true
|
||||
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[]) {
|
||||
|
||||
@@ -1,234 +0,0 @@
|
||||
import { invoke } from '@tauri-apps/api'
|
||||
import { dataDir } from '@tauri-apps/api/path'
|
||||
import DownloadHandler from './download'
|
||||
import { getGameExecutable, getGameFolder } from './game'
|
||||
|
||||
export async function patchMetadata() {
|
||||
const metadataExists = await invoke('dir_exists', {
|
||||
path: (await getGameMetadataPath()) + '\\global-metadata.dat',
|
||||
})
|
||||
|
||||
if (!metadataExists) {
|
||||
return false
|
||||
}
|
||||
|
||||
console.log('Copying unpatched metadata to backup location')
|
||||
|
||||
// Copy unpatched metadata to backup location
|
||||
const copiedMeta = await invoke('copy_file_with_new_name', {
|
||||
path: (await getGameMetadataPath()) + '\\global-metadata.dat',
|
||||
newPath: await getBackupMetadataPath(),
|
||||
newName: 'global-metadata-unpatched.dat',
|
||||
})
|
||||
|
||||
if (!copiedMeta) {
|
||||
console.log(await getBackupMetadataPath())
|
||||
return false
|
||||
}
|
||||
|
||||
// backup was successful! Time to patch
|
||||
|
||||
console.log('Patching backedup metadata')
|
||||
|
||||
const patchedMeta = await invoke('patch_metadata', {
|
||||
metadataFolder: await getBackupMetadataPath(),
|
||||
})
|
||||
|
||||
if (!patchedMeta) {
|
||||
return false
|
||||
}
|
||||
|
||||
// Patch also worked! Time to replace
|
||||
console.log('Replacing unpatched game metadata with patched metadata')
|
||||
|
||||
const replacedMeta = await invoke('copy_file_with_new_name', {
|
||||
path: (await getBackupMetadataPath()) + '\\global-metadata-patched.dat',
|
||||
newPath: await getGameMetadataPath(),
|
||||
newName: 'global-metadata.dat',
|
||||
})
|
||||
|
||||
if (!replacedMeta) {
|
||||
return false
|
||||
}
|
||||
|
||||
console.log('Replacement successful!')
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
export async function patchGame() {
|
||||
const backupExists = await invoke('dir_exists', {
|
||||
path: (await getBackupMetadataPath()) + '\\global-metadata-unpatched.dat',
|
||||
})
|
||||
|
||||
if (!backupExists) {
|
||||
// No backup found? Patching creates one
|
||||
const patched = await patchMetadata()
|
||||
|
||||
if (!patched) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// Do we have a patch already?
|
||||
const patchedExists = await invoke('dir_exists', {
|
||||
path: (await getBackupMetadataPath()) + '\\global-metadata-patched.dat',
|
||||
})
|
||||
|
||||
if (!patchedExists) {
|
||||
// No patch found? Patching creates one
|
||||
const patched = await patchMetadata()
|
||||
|
||||
if (!patched) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// Are we already patched? If so, that's fine, just continue as normal
|
||||
const gameIsPatched = await invoke('are_files_identical', {
|
||||
path1: (await getBackupMetadataPath()) + '\\global-metadata-patched.dat',
|
||||
path2: (await getGameMetadataPath()) + '\\global-metadata.dat',
|
||||
})
|
||||
|
||||
if (gameIsPatched) {
|
||||
return true
|
||||
}
|
||||
|
||||
// Is the current backup the same as the games current metadata?
|
||||
const backupIsCurrent = await invoke('are_files_identical', {
|
||||
path1: (await getBackupMetadataPath()) + '\\global-metadata-unpatched.dat',
|
||||
path2: (await getGameMetadataPath()) + '\\global-metadata.dat',
|
||||
})
|
||||
|
||||
// Game has probably been updated. We need to repatch the game...
|
||||
if (!backupIsCurrent) {
|
||||
const deletedOldBackup = await invoke('delete_file', {
|
||||
path: (await getBackupMetadataPath()) + '\\global-metadata-unpatched.dat',
|
||||
})
|
||||
const deletedOldPatched = await invoke('delete_file', {
|
||||
path: (await getBackupMetadataPath()) + '\\global-metadata-patched.dat',
|
||||
})
|
||||
|
||||
// It's fine if these deletes fail. The game will be replaced anyway.
|
||||
if (!deletedOldBackup) {
|
||||
console.log('Warning: Failed to delete old backup!')
|
||||
}
|
||||
|
||||
if (!deletedOldPatched) {
|
||||
console.log('Warning: Failed to delete old patched metadata!')
|
||||
}
|
||||
|
||||
console.log('Patching Metadata')
|
||||
|
||||
const patched = await patchMetadata()
|
||||
|
||||
if (!patched) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
console.log('Metadata is not patched')
|
||||
console.log('Replacing unpatched metadata')
|
||||
|
||||
// Finally, replace the unpatched metadata with the patched one
|
||||
const replaced = await invoke('copy_file_with_new_name', {
|
||||
path: (await getBackupMetadataPath()) + '\\global-metadata-patched.dat',
|
||||
newPath: await getGameMetadataPath(),
|
||||
newName: 'global-metadata.dat',
|
||||
})
|
||||
|
||||
if (!replaced) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
export async function unpatchGame() {
|
||||
const backupExists = await invoke('dir_exists', {
|
||||
path: (await getBackupMetadataPath()) + '\\global-metadata-unpatched.dat',
|
||||
})
|
||||
|
||||
if (!backupExists) {
|
||||
// Let's just hope the game isn't on a patched metadata since we don't have a backup...
|
||||
return true
|
||||
}
|
||||
|
||||
const replaced = await invoke('copy_file_with_new_name', {
|
||||
path: (await getBackupMetadataPath()) + '\\global-metadata-unpatched.dat',
|
||||
newPath: await getGameMetadataPath(),
|
||||
newName: 'global-metadata.dat',
|
||||
})
|
||||
|
||||
return replaced
|
||||
}
|
||||
|
||||
export async function getGameMetadataPath() {
|
||||
const gameExec = await getGameExecutable()
|
||||
|
||||
if (!gameExec) {
|
||||
return null
|
||||
}
|
||||
|
||||
return ((await getGameFolder()) + '\\' + gameExec.replace('.exe', '_Data') + '\\Managed\\Metadata').replace(
|
||||
/\\/g,
|
||||
'/'
|
||||
)
|
||||
}
|
||||
|
||||
export async function getBackupMetadataPath() {
|
||||
return (await dataDir()) + 'cultivation\\metadata'
|
||||
}
|
||||
|
||||
export async function globalMetadataLink() {
|
||||
const versionAPIUrl =
|
||||
'https://sdk-os-static.mihoyo.com/hk4e_global/mdk/launcher/api/resource?channel_id=1&key=gcStgarh&launcher_id=10&sub_channel_id=0'
|
||||
|
||||
// Get versions from API
|
||||
const versions = JSON.parse(
|
||||
await invoke('web_get', {
|
||||
url: versionAPIUrl,
|
||||
})
|
||||
)
|
||||
|
||||
if (!versions || versions.retcode !== 0) {
|
||||
console.log('Failed to get versions from API')
|
||||
return null
|
||||
}
|
||||
|
||||
// Get latest version
|
||||
const latest = versions.data.game.latest
|
||||
|
||||
return (latest.decompressed_path as string) + '/GenshinImpact_Data/Managed/Metadata/global-metadata.dat'
|
||||
}
|
||||
|
||||
export async function restoreMetadata(manager: DownloadHandler) {
|
||||
const metaLink = await globalMetadataLink()
|
||||
|
||||
if (!metaLink) {
|
||||
console.log('Could not get global metadata link!')
|
||||
return false
|
||||
}
|
||||
|
||||
// Should make sure metadata path exists since the user may have deleted it
|
||||
await invoke('dir_create', {
|
||||
path: await getBackupMetadataPath(),
|
||||
})
|
||||
|
||||
// It is possible the unpatched backup is mistakenly patched
|
||||
await invoke('delete_file', {
|
||||
path: (await getBackupMetadataPath()) + '\\global-metadata-unpatched.dat',
|
||||
})
|
||||
|
||||
// Download the file
|
||||
manager.addDownload(metaLink, (await getBackupMetadataPath()) + '\\global-metadata-unpatched.dat', () => {
|
||||
unpatchGame()
|
||||
})
|
||||
console.log('Restoring backedup metadata')
|
||||
|
||||
await unpatchGame()
|
||||
|
||||
return true
|
||||
}
|
||||
85
src/utils/rsa.ts
Normal file
85
src/utils/rsa.ts
Normal file
@@ -0,0 +1,85 @@
|
||||
import { invoke } from '@tauri-apps/api'
|
||||
import { dataDir } from '@tauri-apps/api/path'
|
||||
import { getGameFolder } from './game'
|
||||
|
||||
export async function patchGame() {
|
||||
// Do we have a patch already?
|
||||
const patchedExists = await invoke('dir_exists', {
|
||||
path: (await getBackupRSAPath()) + '\\version.dll',
|
||||
})
|
||||
|
||||
if (!patchedExists) {
|
||||
// No patch found? Patching creates one
|
||||
const patched = await downloadRSA()
|
||||
|
||||
if (!patched) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// Are we already patched with mhypbase? If so, that's fine, just continue as normal
|
||||
const gameIsPatched = await invoke('are_files_identical', {
|
||||
path1: (await getBackupRSAPath()) + '\\version.dll',
|
||||
path2: (await getGameRSAPath()) + '\\mhypbase.dll',
|
||||
})
|
||||
|
||||
// Tell user they won't be unpatched with manual mhypbase patch
|
||||
if (gameIsPatched) {
|
||||
console.log('You are already patched using mhypbase, so you will not be auto patched and unpatched!')
|
||||
return true
|
||||
}
|
||||
|
||||
// Copy the patch to game files
|
||||
const replaced = await invoke('copy_file_with_new_name', {
|
||||
path: (await getBackupRSAPath()) + '\\version.dll',
|
||||
newPath: await getGameRSAPath(),
|
||||
newName: 'version.dll',
|
||||
})
|
||||
|
||||
if (!replaced) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
export async function unpatchGame() {
|
||||
// Just delete patch since it's not replacing any existing file
|
||||
const deleted = await invoke('delete_file', {
|
||||
path: (await getGameRSAPath()) + '\\version.dll',
|
||||
})
|
||||
|
||||
return deleted
|
||||
}
|
||||
|
||||
export async function getGameRSAPath() {
|
||||
const gameData = await getGameFolder()
|
||||
|
||||
if (!gameData) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (gameData + '\\').replace(/\\/g, '/')
|
||||
}
|
||||
|
||||
export async function getBackupRSAPath() {
|
||||
return (await dataDir()) + 'cultivation\\rsa'
|
||||
}
|
||||
|
||||
export async function downloadRSA() {
|
||||
// Patch file from: https://github.com/34736384/RSAPatch/
|
||||
|
||||
// Should make sure rsa path exists
|
||||
await invoke('dir_create', {
|
||||
path: await getBackupRSAPath(),
|
||||
})
|
||||
|
||||
// Copy patch from local for offline compatibility
|
||||
await invoke('copy_file_with_new_name', {
|
||||
path: (await invoke('install_location')) + '\\patch\\version.dll',
|
||||
newPath: await getBackupRSAPath(),
|
||||
newName: 'version.dll',
|
||||
})
|
||||
|
||||
return true
|
||||
}
|
||||
@@ -10,7 +10,7 @@ export async function toggleEncryption(path: string) {
|
||||
})
|
||||
)
|
||||
} catch (e) {
|
||||
console.log(`Server config at ${path} not found or invalid`)
|
||||
console.log(`Server config at ${path} not found or invalid. Be sure to run the server at least once to generate it`)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ export async function encryptionEnabled(path: string) {
|
||||
})
|
||||
)
|
||||
} catch (e) {
|
||||
console.log(`Server config at ${path} not found or invalid`)
|
||||
console.log(`Server config at ${path} not found or invalid. Be sure to run the server at least once to generate it`)
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,9 @@ export function unzip(
|
||||
})
|
||||
|
||||
listen('extract_end', ({ payload }) => {
|
||||
console.log(payload)
|
||||
console.log(file)
|
||||
|
||||
// @ts-expect-error Payload is an object
|
||||
if (payload?.file === file) {
|
||||
resolve(payload as UnzipPayload)
|
||||
|
||||
@@ -6002,9 +6002,9 @@ loader-runner@^4.2.0:
|
||||
integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==
|
||||
|
||||
loader-utils@^2.0.0:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.2.tgz#d6e3b4fb81870721ae4e0868ab11dd638368c129"
|
||||
integrity sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.4.tgz#8b5cb38b5c34a9a018ee1fc0e6a066d1dfcc528c"
|
||||
integrity sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==
|
||||
dependencies:
|
||||
big.js "^5.2.2"
|
||||
emojis-list "^3.0.0"
|
||||
|
||||
Reference in New Issue
Block a user