mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-13 15:44:35 +01:00
Merge pull request #181 from NotThorny/Redirect-More
Redirect more domains
This commit is contained in:
@@ -8,7 +8,8 @@
|
|||||||
"ip_placeholder": "IP 地址...",
|
"ip_placeholder": "IP 地址...",
|
||||||
"port_placeholder": "端口...",
|
"port_placeholder": "端口...",
|
||||||
"files_downloading": "文件下载中:",
|
"files_downloading": "文件下载中:",
|
||||||
"files_extracting": "文件解压中:"
|
"files_extracting": "文件解压中:",
|
||||||
|
"game_path_notify": "未找到游戏路径,请记得在设置中进行设置"
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"enabled": "已启用",
|
"enabled": "已启用",
|
||||||
@@ -30,7 +31,8 @@
|
|||||||
"wipe_login": "清除登录缓存",
|
"wipe_login": "清除登录缓存",
|
||||||
"horny_mode": "Horny 模式",
|
"horny_mode": "Horny 模式",
|
||||||
"auto_mongodb": "自动启动 MongoDB",
|
"auto_mongodb": "自动启动 MongoDB",
|
||||||
"un_elevated": "非提升运行游戏(无管理员)"
|
"un_elevated": "非提升运行游戏(无管理员)",
|
||||||
|
"redirect_more": "还可以重定向其他MHY游戏"
|
||||||
},
|
},
|
||||||
"downloads": {
|
"downloads": {
|
||||||
"grasscutter_fullbuild": "下载 Grasscutter 一体化",
|
"grasscutter_fullbuild": "下载 Grasscutter 一体化",
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
"ip_placeholder": "IP地址...",
|
"ip_placeholder": "IP地址...",
|
||||||
"port_placeholder": "通訊埠...",
|
"port_placeholder": "通訊埠...",
|
||||||
"files_downloading": "檔案下載中:",
|
"files_downloading": "檔案下載中:",
|
||||||
"files_extracting": "檔案解壓縮中:"
|
"files_extracting": "檔案解壓縮中:",
|
||||||
|
"game_path_notify": "找不到遊戲路徑,記得在設置裡設置!"
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"enabled": "已啟用",
|
"enabled": "已啟用",
|
||||||
@@ -30,7 +31,8 @@
|
|||||||
"wipe_login": "擦除登錄緩存",
|
"wipe_login": "擦除登錄緩存",
|
||||||
"horny_mode": "Horny模式",
|
"horny_mode": "Horny模式",
|
||||||
"auto_mongodb": "自動啟動 MongoDB",
|
"auto_mongodb": "自動啟動 MongoDB",
|
||||||
"un_elevated": "在不升高的情况下运行游戏(没有管理员)。"
|
"un_elevated": "在不升高的情况下运行游戏(没有管理员)。",
|
||||||
|
"redirect_more": "同時重定向其他 MHY 遊戲"
|
||||||
},
|
},
|
||||||
"downloads": {
|
"downloads": {
|
||||||
"grasscutter_fullbuild": "下載Grasscutter多合一下載",
|
"grasscutter_fullbuild": "下載Grasscutter多合一下載",
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
"ip_placeholder": "Server Adresse...",
|
"ip_placeholder": "Server Adresse...",
|
||||||
"port_placeholder": "Port...",
|
"port_placeholder": "Port...",
|
||||||
"files_downloading": "Herunterladen von Dateien: ",
|
"files_downloading": "Herunterladen von Dateien: ",
|
||||||
"files_extracting": "Extrahieren von Dateien: "
|
"files_extracting": "Extrahieren von Dateien: ",
|
||||||
|
"game_path_notify": "Spielpfad nicht gefunden, denken Sie daran, ihn in den Einstellungen festzulegen!"
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"enabled": "Aktiviert",
|
"enabled": "Aktiviert",
|
||||||
@@ -29,7 +30,8 @@
|
|||||||
"wipe_login": "Wis de inlogcache",
|
"wipe_login": "Wis de inlogcache",
|
||||||
"horny_mode": "Geile modus",
|
"horny_mode": "Geile modus",
|
||||||
"auto_mongodb": "Start automatisch MongoDB",
|
"auto_mongodb": "Start automatisch MongoDB",
|
||||||
"un_elevated": "Führen Sie das Spiel nicht erhöht aus (kein Admin)"
|
"un_elevated": "Führen Sie das Spiel nicht erhöht aus (kein Admin)",
|
||||||
|
"redirect_more": "Leiten Sie auch andere MHY-Spiele um"
|
||||||
},
|
},
|
||||||
"downloads": {
|
"downloads": {
|
||||||
"grasscutter_fullbuild": "Alles in Einem Grasscutter Daten herunterladen",
|
"grasscutter_fullbuild": "Alles in Einem Grasscutter Daten herunterladen",
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
"port_placeholder": "Port...",
|
"port_placeholder": "Port...",
|
||||||
"files_downloading": "Files Downloading: ",
|
"files_downloading": "Files Downloading: ",
|
||||||
"files_extracting": "Files Extracting: ",
|
"files_extracting": "Files Extracting: ",
|
||||||
"game_path_notify": "Game path not found, remember to set it in !"
|
"game_path_notify": "Game path not found, remember to set it in settings!"
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"enabled": "Enabled",
|
"enabled": "Enabled",
|
||||||
@@ -31,7 +31,8 @@
|
|||||||
"wipe_login": "Wipe Login Cache",
|
"wipe_login": "Wipe Login Cache",
|
||||||
"horny_mode": "Horny Mode",
|
"horny_mode": "Horny Mode",
|
||||||
"auto_mongodb": "Automatically Start MongoDB",
|
"auto_mongodb": "Automatically Start MongoDB",
|
||||||
"un_elevated": "Run the game non-elevated (no admin)"
|
"un_elevated": "Run the game non-elevated (no admin)",
|
||||||
|
"redirect_more": "Also redirect other MHY games"
|
||||||
},
|
},
|
||||||
"downloads": {
|
"downloads": {
|
||||||
"grasscutter_fullbuild": "Download Grasscutter All-in-One",
|
"grasscutter_fullbuild": "Download Grasscutter All-in-One",
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
"ip_placeholder": "Dirección del servidor...",
|
"ip_placeholder": "Dirección del servidor...",
|
||||||
"port_placeholder": "Puerto...",
|
"port_placeholder": "Puerto...",
|
||||||
"files_downloading": "Archivos Descargandose: ",
|
"files_downloading": "Archivos Descargandose: ",
|
||||||
"files_extracting": "Archivos Extrayendose: "
|
"files_extracting": "Archivos Extrayendose: ",
|
||||||
|
"game_path_notify": "Ruta de juego no encontrada, ¡recuerda configurarla en ajustes!"
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"enabled": "Activado",
|
"enabled": "Activado",
|
||||||
@@ -30,7 +31,8 @@
|
|||||||
"wipe_login": "Borrar caché de inicio de sesión",
|
"wipe_login": "Borrar caché de inicio de sesión",
|
||||||
"horny_mode": "Modo cachondo",
|
"horny_mode": "Modo cachondo",
|
||||||
"auto_mongodb": "Iniciar automáticamente MongoDB",
|
"auto_mongodb": "Iniciar automáticamente MongoDB",
|
||||||
"un_elevated": "Ejecutar el juego no elevado (no admin)"
|
"un_elevated": "Ejecutar el juego no elevado (no admin)",
|
||||||
|
"redirect_more": "También redirigir otros juegos MHY"
|
||||||
},
|
},
|
||||||
"downloads": {
|
"downloads": {
|
||||||
"grasscutter_fullbuild": "Descargar Datos todo en uno de Grasscutter",
|
"grasscutter_fullbuild": "Descargar Datos todo en uno de Grasscutter",
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
"ip_placeholder": "Adresse du serveur...",
|
"ip_placeholder": "Adresse du serveur...",
|
||||||
"port_placeholder": "Port...",
|
"port_placeholder": "Port...",
|
||||||
"files_downloading": "Fichiers en cours de telechargement: ",
|
"files_downloading": "Fichiers en cours de telechargement: ",
|
||||||
"files_extracting": "Fichiers en cours d'extraction: "
|
"files_extracting": "Fichiers en cours d'extraction: ",
|
||||||
|
"game_path_notify": "Chemin d'accès au jeu non trouvé, n'oubliez pas de le définir dans les options !"
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"enabled": "Activé",
|
"enabled": "Activé",
|
||||||
@@ -30,7 +31,8 @@
|
|||||||
"wipe_login": "Effacer le cache de connexion",
|
"wipe_login": "Effacer le cache de connexion",
|
||||||
"horny_mode": "Mode horny",
|
"horny_mode": "Mode horny",
|
||||||
"auto_mongodb": "Démarrer automatiquement MongoDB",
|
"auto_mongodb": "Démarrer automatiquement MongoDB",
|
||||||
"un_elevated": "Exécuter le jeu sans élévation (pas d'administrateur)"
|
"un_elevated": "Exécuter le jeu sans élévation (pas d'administrateur)",
|
||||||
|
"redirect_more": "Réorienter également les autres jeux MHY"
|
||||||
},
|
},
|
||||||
"downloads": {
|
"downloads": {
|
||||||
"grasscutter_fullbuild": "Telecharger Grasscutter tout-en-un",
|
"grasscutter_fullbuild": "Telecharger Grasscutter tout-en-un",
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
"ip_placeholder": "Alamat Server...",
|
"ip_placeholder": "Alamat Server...",
|
||||||
"port_placeholder": "Port...",
|
"port_placeholder": "Port...",
|
||||||
"files_downloading": "Mendownload File Yang Diperlukan: ",
|
"files_downloading": "Mendownload File Yang Diperlukan: ",
|
||||||
"files_extracting": "MengExtract File: "
|
"files_extracting": "MengExtract File: ",
|
||||||
|
"game_path_notify": "Jalur permainan tidak ditemukan, ingatlah untuk mengaturnya dalam pengaturan!"
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"enabled": "Diaktifkan",
|
"enabled": "Diaktifkan",
|
||||||
@@ -29,7 +30,8 @@
|
|||||||
"wipe_login": "Menghapus Cache Login",
|
"wipe_login": "Menghapus Cache Login",
|
||||||
"horny_mode": "Mode Terangsang",
|
"horny_mode": "Mode Terangsang",
|
||||||
"auto_mongodb": "Mulai MongoDB secara otomatis",
|
"auto_mongodb": "Mulai MongoDB secara otomatis",
|
||||||
"un_elevated": "Jalankan game yang tidak ditinggikan (tanpa admin)"
|
"un_elevated": "Jalankan game yang tidak ditinggikan (tanpa admin)",
|
||||||
|
"redirect_more": "Juga mengarahkan ulang game MHY lainnya"
|
||||||
},
|
},
|
||||||
"downloads": {
|
"downloads": {
|
||||||
"grasscutter_fullbuild": "Sedang Mendownload Grasscutter Semua Dalam Satu",
|
"grasscutter_fullbuild": "Sedang Mendownload Grasscutter Semua Dalam Satu",
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
"ip_placeholder": "서버 주소",
|
"ip_placeholder": "서버 주소",
|
||||||
"port_placeholder": "포트",
|
"port_placeholder": "포트",
|
||||||
"files_downloading": "파일 다운로드 중: ",
|
"files_downloading": "파일 다운로드 중: ",
|
||||||
"files_extracting": "파일 추출 중: "
|
"files_extracting": "파일 추출 중: ",
|
||||||
|
"game_path_notify": "게임 경로를 찾을 수 없습니다. 설정에서 설정하는 것을 잊지 마세요!"
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"enabled": "활성",
|
"enabled": "활성",
|
||||||
@@ -30,7 +31,8 @@
|
|||||||
"wipe_login": "로그인 캐시 지우기",
|
"wipe_login": "로그인 캐시 지우기",
|
||||||
"horny_mode": "Horny 모드",
|
"horny_mode": "Horny 모드",
|
||||||
"auto_mongodb": "MongoDB 자동 시작",
|
"auto_mongodb": "MongoDB 자동 시작",
|
||||||
"un_elevated": "게임 비상승 실행(관리자 없음)"
|
"un_elevated": "게임 비상승 실행(관리자 없음)",
|
||||||
|
"redirect_more": "다른 MHY 게임도 리디렉션"
|
||||||
},
|
},
|
||||||
"downloads": {
|
"downloads": {
|
||||||
"grasscutter_fullbuild": "올인원 Grasscutter 다운로드",
|
"grasscutter_fullbuild": "올인원 Grasscutter 다운로드",
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
"ip_placeholder": "Servera Adrese...",
|
"ip_placeholder": "Servera Adrese...",
|
||||||
"port_placeholder": "Ports...",
|
"port_placeholder": "Ports...",
|
||||||
"files_downloading": "Failu Lejupielāde: ",
|
"files_downloading": "Failu Lejupielāde: ",
|
||||||
"files_extracting": "Failu Izvilkšana: "
|
"files_extracting": "Failu Izvilkšana: ",
|
||||||
|
"game_path_notify": "Spēles ceļš nav atrasts, atcerieties to iestatījumos!"
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"enabled": "Iespējots",
|
"enabled": "Iespējots",
|
||||||
@@ -28,7 +29,8 @@
|
|||||||
"wipe_login": "Noslaucīt pieteikšanās kešatmiņu",
|
"wipe_login": "Noslaucīt pieteikšanās kešatmiņu",
|
||||||
"horny_mode": "Uzbudināts režīms",
|
"horny_mode": "Uzbudināts režīms",
|
||||||
"auto_mongodb": "Automātiski startējiet MongoDB",
|
"auto_mongodb": "Automātiski startējiet MongoDB",
|
||||||
"un_elevated": "Palaist spēli bez paaugstinājuma (bez administratora)"
|
"un_elevated": "Palaist spēli bez paaugstinājuma (bez administratora)",
|
||||||
|
"redirect_more": "Arī novirzīt citas MHY spēles"
|
||||||
},
|
},
|
||||||
"downloads": {
|
"downloads": {
|
||||||
"grasscutter_fullbuild": "Lejupielādējiet Grasscutter viss vienā",
|
"grasscutter_fullbuild": "Lejupielādējiet Grasscutter viss vienā",
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
"ip_placeholder": "Server Address...",
|
"ip_placeholder": "Server Address...",
|
||||||
"port_placeholder": "Poort...",
|
"port_placeholder": "Poort...",
|
||||||
"files_downloading": "Bestanden Aan Downloaden: ",
|
"files_downloading": "Bestanden Aan Downloaden: ",
|
||||||
"files_extracting": "Bestanden Uitpakken: "
|
"files_extracting": "Bestanden Uitpakken: ",
|
||||||
|
"game_path_notify": "Spelpad niet gevonden, denk eraan dit in te stellen in instellingen!"
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"enabled": "Ingeschakeld",
|
"enabled": "Ingeschakeld",
|
||||||
@@ -29,7 +30,8 @@
|
|||||||
"wipe_login": "Login cache wissen",
|
"wipe_login": "Login cache wissen",
|
||||||
"horny_mode": "Geile modus",
|
"horny_mode": "Geile modus",
|
||||||
"auto_mongodb": "Start automatisch MongoDB",
|
"auto_mongodb": "Start automatisch MongoDB",
|
||||||
"un_elevated": "Voer het spel uit zonder hoogtevrees (geen admin)"
|
"un_elevated": "Voer het spel uit zonder hoogtevrees (geen admin)",
|
||||||
|
"redirect_more": "Richt ook andere MHY-spellen"
|
||||||
},
|
},
|
||||||
"downloads": {
|
"downloads": {
|
||||||
"grasscutter_fullbuild": "Grasscutter Alles-in-één Downloaden",
|
"grasscutter_fullbuild": "Grasscutter Alles-in-één Downloaden",
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
"ip_placeholder": "Endereço do Servidor...",
|
"ip_placeholder": "Endereço do Servidor...",
|
||||||
"port_placeholder": "Porta...",
|
"port_placeholder": "Porta...",
|
||||||
"files_downloading": "Baixando Arquivos: ",
|
"files_downloading": "Baixando Arquivos: ",
|
||||||
"files_extracting": "Extraindo Arquivos: "
|
"files_extracting": "Extraindo Arquivos: ",
|
||||||
|
"game_path_notify": "Caminho do jogo não encontrado, lembre-se de defini-lo nas configurações!"
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"enabled": "Habilitado",
|
"enabled": "Habilitado",
|
||||||
@@ -30,7 +31,8 @@
|
|||||||
"wipe_login": "Limpar Cache de Login",
|
"wipe_login": "Limpar Cache de Login",
|
||||||
"horny_mode": "Modo com tesão",
|
"horny_mode": "Modo com tesão",
|
||||||
"auto_mongodb": "Iniciar MongoDB Automaticamente",
|
"auto_mongodb": "Iniciar MongoDB Automaticamente",
|
||||||
"un_elevated": "Executar o jogo não-elevated (sem admin)"
|
"un_elevated": "Executar o jogo não-elevated (sem admin)",
|
||||||
|
"redirect_more": "Também redirecionar outros jogos MHY"
|
||||||
},
|
},
|
||||||
"downloads": {
|
"downloads": {
|
||||||
"grasscutter_fullbuild": "Baixar o Grasscutter Tudo-em-Um",
|
"grasscutter_fullbuild": "Baixar o Grasscutter Tudo-em-Um",
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
"ip_placeholder": "Айпи адрес...",
|
"ip_placeholder": "Айпи адрес...",
|
||||||
"port_placeholder": "Порт...",
|
"port_placeholder": "Порт...",
|
||||||
"files_downloading": "Файлов скачано: ",
|
"files_downloading": "Файлов скачано: ",
|
||||||
"files_extracting": "Извлечено файлов: "
|
"files_extracting": "Извлечено файлов: ",
|
||||||
|
"game_path_notify": "Путь к игре не найден, не забудьте установить его в настройках!"
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"enabled": "Включено",
|
"enabled": "Включено",
|
||||||
@@ -29,7 +30,8 @@
|
|||||||
"wipe_login": "Очистить кэш входа в систему",
|
"wipe_login": "Очистить кэш входа в систему",
|
||||||
"horny_mode": "роговой режим",
|
"horny_mode": "роговой режим",
|
||||||
"auto_mongodb": "Автоматически запускать MongoDB",
|
"auto_mongodb": "Автоматически запускать MongoDB",
|
||||||
"un_elevated": "Запустите игру в неэлегантном режиме (без администратора)"
|
"un_elevated": "Запустите игру в неэлегантном режиме (без администратора)",
|
||||||
|
"redirect_more": "Также перенаправьте другие игры MHY"
|
||||||
},
|
},
|
||||||
"downloads": {
|
"downloads": {
|
||||||
"grasscutter_fullbuild": "Скачать все в одном Grasscutter",
|
"grasscutter_fullbuild": "Скачать все в одном Grasscutter",
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
"ip_placeholder": "Địa chỉ máy chủ...",
|
"ip_placeholder": "Địa chỉ máy chủ...",
|
||||||
"port_placeholder": "Cổng...",
|
"port_placeholder": "Cổng...",
|
||||||
"files_downloading": "Đang tải tập tin: ",
|
"files_downloading": "Đang tải tập tin: ",
|
||||||
"files_extracting": "Đang giải nén tập tin: "
|
"files_extracting": "Đang giải nén tập tin: ",
|
||||||
|
"game_path_notify": "Không tìm thấy đường dẫn trò chơi, hãy nhớ đặt nó trong cài đặt!"
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"enabled": "Bật",
|
"enabled": "Bật",
|
||||||
@@ -30,7 +31,8 @@
|
|||||||
"wipe_login": "Tẩy sạch cache đăng nhập",
|
"wipe_login": "Tẩy sạch cache đăng nhập",
|
||||||
"horny_mode": "Chế độ hứng tình",
|
"horny_mode": "Chế độ hứng tình",
|
||||||
"auto_mongodb": "Tự động khởi động MongoDB",
|
"auto_mongodb": "Tự động khởi động MongoDB",
|
||||||
"un_elevated": "Chạy trò chơi không nâng cao (không có quản trị viên)"
|
"un_elevated": "Chạy trò chơi không nâng cao (không có quản trị viên)",
|
||||||
|
"redirect_more": "Đồng thời chuyển hướng các trò chơi MHY khác"
|
||||||
},
|
},
|
||||||
"downloads": {
|
"downloads": {
|
||||||
"grasscutter_fullbuild": "Tải Grasscutter tất cả trong một",
|
"grasscutter_fullbuild": "Tải Grasscutter tất cả trong một",
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ pub struct Configuration {
|
|||||||
pub horny_mode: Option<bool>,
|
pub horny_mode: Option<bool>,
|
||||||
pub auto_mongodb: Option<bool>,
|
pub auto_mongodb: Option<bool>,
|
||||||
pub un_elevated: Option<bool>,
|
pub un_elevated: Option<bool>,
|
||||||
|
pub redirect_more: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn config_path() -> PathBuf {
|
pub fn config_path() -> PathBuf {
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ async fn parse_args(inp: &Vec<String>) -> Result<Args, ArgsError> {
|
|||||||
args.flag("h", "help", "Print various CLI args");
|
args.flag("h", "help", "Print various CLI args");
|
||||||
args.flag("p", "proxy", "Start the proxy server");
|
args.flag("p", "proxy", "Start the proxy server");
|
||||||
args.flag("G", "launch-game", "Launch the game");
|
args.flag("G", "launch-game", "Launch the game");
|
||||||
|
args.flag("o", "other-redirects", "Redirect other certain anime games");
|
||||||
args.flag(
|
args.flag(
|
||||||
"A",
|
"A",
|
||||||
"no-admin",
|
"no-admin",
|
||||||
@@ -142,6 +143,10 @@ async fn parse_args(inp: &Vec<String>) -> Result<Args, ArgsError> {
|
|||||||
pathbuf.push("cultivation");
|
pathbuf.push("cultivation");
|
||||||
pathbuf.push("ca");
|
pathbuf.push("ca");
|
||||||
|
|
||||||
|
if args.value_of("other_redirects")? {
|
||||||
|
proxy::set_redirect_more();
|
||||||
|
}
|
||||||
|
|
||||||
connect(8035, pathbuf.to_str().unwrap().to_string()).await;
|
connect(8035, pathbuf.to_str().unwrap().to_string()).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,6 +212,7 @@ fn main() -> Result<(), ArgsError> {
|
|||||||
system_helpers::run_un_elevated,
|
system_helpers::run_un_elevated,
|
||||||
proxy::set_proxy_addr,
|
proxy::set_proxy_addr,
|
||||||
proxy::generate_ca_files,
|
proxy::generate_ca_files,
|
||||||
|
proxy::set_redirect_more,
|
||||||
release::get_latest_release,
|
release::get_latest_release,
|
||||||
unzip::unzip,
|
unzip::unzip,
|
||||||
file_helpers::rename,
|
file_helpers::rename,
|
||||||
@@ -230,12 +236,11 @@ fn main() -> Result<(), ArgsError> {
|
|||||||
gamebanana::list_submissions,
|
gamebanana::list_submissions,
|
||||||
gamebanana::list_mods
|
gamebanana::list_mods
|
||||||
])
|
])
|
||||||
.on_window_event(|event| match event.event() {
|
.on_window_event(|event| {
|
||||||
tauri::WindowEvent::CloseRequested { api, .. } => {
|
if let tauri::WindowEvent::CloseRequested { .. } = event.event() {
|
||||||
// Ensure all proxy stuff is handled
|
// Ensure all proxy stuff is handled
|
||||||
disconnect();
|
disconnect();
|
||||||
}
|
}
|
||||||
_ => {}
|
|
||||||
})
|
})
|
||||||
.run(tauri::generate_context!())
|
.run(tauri::generate_context!())
|
||||||
.expect("error while running tauri application");
|
.expect("error while running tauri application");
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
* https://github.com/omjadas/hudsucker/blob/main/examples/log.rs
|
* https://github.com/omjadas/hudsucker/blob/main/examples/log.rs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use crate::config::get_config;
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
use crate::system_helpers::run_command;
|
use crate::system_helpers::run_command;
|
||||||
|
|
||||||
@@ -35,6 +36,7 @@ async fn shutdown_signal() {
|
|||||||
|
|
||||||
// Global ver for getting server address.
|
// Global ver for getting server address.
|
||||||
static SERVER: Lazy<Mutex<String>> = Lazy::new(|| Mutex::new("http://localhost:443".to_string()));
|
static SERVER: Lazy<Mutex<String>> = Lazy::new(|| Mutex::new("http://localhost:443".to_string()));
|
||||||
|
static REDIRECT_MORE: Lazy<Mutex<bool>> = Lazy::new(|| Mutex::new(false));
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
struct ProxyHandler;
|
struct ProxyHandler;
|
||||||
@@ -51,6 +53,11 @@ pub fn set_proxy_addr(addr: String) {
|
|||||||
println!("Set server to {}", SERVER.lock().unwrap());
|
println!("Set server to {}", SERVER.lock().unwrap());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub fn set_redirect_more() {
|
||||||
|
*REDIRECT_MORE.lock().unwrap() = true;
|
||||||
|
}
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl HttpHandler for ProxyHandler {
|
impl HttpHandler for ProxyHandler {
|
||||||
async fn handle_request(
|
async fn handle_request(
|
||||||
@@ -60,7 +67,23 @@ impl HttpHandler for ProxyHandler {
|
|||||||
) -> RequestOrResponse {
|
) -> RequestOrResponse {
|
||||||
let uri = req.uri().to_string();
|
let uri = req.uri().to_string();
|
||||||
|
|
||||||
if uri.contains("hoyoverse.com") || uri.contains("mihoyo.com") || uri.contains("yuanshen.com") {
|
let mut more = get_config().redirect_more;
|
||||||
|
|
||||||
|
if *REDIRECT_MORE.lock().unwrap() {
|
||||||
|
more = Some(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
match more {
|
||||||
|
Some(true) => {
|
||||||
|
if uri.contains("hoyoverse.com")
|
||||||
|
|| uri.contains("mihoyo.com")
|
||||||
|
|| uri.contains("yuanshen.com")
|
||||||
|
|| uri.contains("starrails.com")
|
||||||
|
|| uri.contains("bhsr.com")
|
||||||
|
|| uri.contains("bh3.com")
|
||||||
|
|| uri.contains("honkaiimpact3.com")
|
||||||
|
|| uri.contains("zenlesszonezero.com")
|
||||||
|
{
|
||||||
// Handle CONNECTs
|
// Handle CONNECTs
|
||||||
if req.method().as_str() == "CONNECT" {
|
if req.method().as_str() == "CONNECT" {
|
||||||
let builder = Response::builder()
|
let builder = Response::builder()
|
||||||
@@ -80,6 +103,59 @@ impl HttpHandler for ProxyHandler {
|
|||||||
*req.uri_mut() = new_uri;
|
*req.uri_mut() = new_uri;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Some(false) => {
|
||||||
|
if uri.contains("hoyoverse.com")
|
||||||
|
|| uri.contains("mihoyo.com")
|
||||||
|
|| uri.contains("yuanshen.com")
|
||||||
|
{
|
||||||
|
// 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Use default as fallback
|
||||||
|
None => {
|
||||||
|
if uri.contains("hoyoverse.com")
|
||||||
|
|| uri.contains("mihoyo.com")
|
||||||
|
|| uri.contains("yuanshen.com")
|
||||||
|
{
|
||||||
|
// 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
req.into()
|
req.into()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ interface IState {
|
|||||||
swag: boolean
|
swag: boolean
|
||||||
platform: string
|
platform: string
|
||||||
un_elevated: boolean
|
un_elevated: boolean
|
||||||
|
redirect_more: boolean
|
||||||
|
|
||||||
// Swag stuff
|
// Swag stuff
|
||||||
akebi_path: string
|
akebi_path: string
|
||||||
@@ -72,6 +73,7 @@ export default class Options extends React.Component<IProps, IState> {
|
|||||||
auto_mongodb: false,
|
auto_mongodb: false,
|
||||||
platform: '',
|
platform: '',
|
||||||
un_elevated: false,
|
un_elevated: false,
|
||||||
|
redirect_more: false,
|
||||||
|
|
||||||
// Swag stuff
|
// Swag stuff
|
||||||
akebi_path: '',
|
akebi_path: '',
|
||||||
@@ -123,6 +125,7 @@ export default class Options extends React.Component<IProps, IState> {
|
|||||||
auto_mongodb: config.auto_mongodb || false,
|
auto_mongodb: config.auto_mongodb || false,
|
||||||
platform,
|
platform,
|
||||||
un_elevated: config.un_elevated || false,
|
un_elevated: config.un_elevated || false,
|
||||||
|
redirect_more: config.redirect_more || false,
|
||||||
|
|
||||||
// Swag stuff
|
// Swag stuff
|
||||||
akebi_path: config.akebi_path || '',
|
akebi_path: config.akebi_path || '',
|
||||||
@@ -388,6 +391,18 @@ export default class Options extends React.Component<IProps, IState> {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="OptionSection" id="menuOptionsContainerRedirect">
|
||||||
|
<div className="OptionLabel" id="menuOptionsLabelRedirect">
|
||||||
|
<Tr text="options.redirect_more" />
|
||||||
|
</div>
|
||||||
|
<div className="OptionValue" id="menuOptionsCheckboxRedirect">
|
||||||
|
<Checkbox
|
||||||
|
onChange={() => this.toggleOption('redirect_more')}
|
||||||
|
checked={this.state?.redirect_more}
|
||||||
|
id="RedirectMore"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ let defaultConfig: Configuration
|
|||||||
horny_mode: false,
|
horny_mode: false,
|
||||||
auto_mongodb: false,
|
auto_mongodb: false,
|
||||||
un_elevated: false,
|
un_elevated: false,
|
||||||
|
redirect_more: false,
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
|
|
||||||
@@ -55,6 +56,7 @@ export interface Configuration {
|
|||||||
swag_mode?: boolean
|
swag_mode?: boolean
|
||||||
auto_mongodb: boolean
|
auto_mongodb: boolean
|
||||||
un_elevated: boolean
|
un_elevated: boolean
|
||||||
|
redirect_more: boolean
|
||||||
|
|
||||||
// Swag stuff
|
// Swag stuff
|
||||||
akebi_path?: string
|
akebi_path?: string
|
||||||
|
|||||||
Reference in New Issue
Block a user