Compare commits

..

5 Commits

Author SHA1 Message Date
Thoronium
fcd08cace5 Bump version 2025-02-26 13:05:21 -07:00
Thoronium
0258aa006a Remove unused patch 2025-02-26 13:04:25 -07:00
Thoronium
8c10c00b53 Update file 2025-02-15 14:28:50 -07:00
Thoronium
fe094c952b Fix typo 2025-02-14 23:49:11 -07:00
Thoronium
63a883cf1d Bump version 2025-02-14 15:25:56 -07:00
10 changed files with 97 additions and 95 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "cultivation", "name": "cultivation",
"version": "1.5.5", "version": "1.5.7",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@tauri-apps/api": "^1.0.0-rc.5", "@tauri-apps/api": "^1.0.0-rc.5",

2
src-tauri/Cargo.lock generated
View File

@@ -959,7 +959,7 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"
[[package]] [[package]]
name = "cultivation" name = "cultivation"
version = "1.5.5" version = "1.5.7"
dependencies = [ dependencies = [
"anime-launcher-sdk", "anime-launcher-sdk",
"anyhow", "anyhow",

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "cultivation" name = "cultivation"
version = "1.5.5" version = "1.5.7"
description = "A custom launcher for anime game." description = "A custom launcher for anime game."
authors = ["KingRainbow44", "SpikeHD"] authors = ["KingRainbow44", "SpikeHD"]
license = "" license = ""

Binary file not shown.

Binary file not shown.

View File

@@ -50,79 +50,80 @@ struct WhatToUnpach {
#[cfg(windows)] #[cfg(windows)]
#[tauri::command] #[tauri::command]
pub async fn patch_game(newer_game: bool, version: String) -> bool { pub async fn patch_game(_newer_game: bool, version: String) -> bool {
let mut patch_path; let mut patch_path;
// Altpatch first - Now using as hoyonet switch // Altpatch first - Now using as hoyonet switch
if newer_game { // People keep using this when they shouldn't, 99.8% of people will never need it. Just remove for now.
let alt_patch_path = PathBuf::from(system_helpers::install_location()).join("altpatch"); // if newer_game {
// let alt_patch_path = PathBuf::from(system_helpers::install_location()).join("altpatch");
// Should handle overwriting backup with new version backup later // // Should handle overwriting backup with new version backup later
let backup_path = PathBuf::from(system_helpers::install_location()) // let backup_path = PathBuf::from(system_helpers::install_location())
.join("altpatch/original-mihoyonet.dll") // .join("altpatch/original-mihoyonet.dll")
.to_str() // .to_str()
.unwrap() // .unwrap()
.to_string(); // .to_string();
let backup_exists = file_helpers::does_file_exist(&backup_path); // let backup_exists = file_helpers::does_file_exist(&backup_path);
if !backup_exists { // if !backup_exists {
let backup = file_helpers::copy_file_with_new_name( // let backup = file_helpers::copy_file_with_new_name(
get_game_rsa_path().await.unwrap() // get_game_rsa_path().await.unwrap()
+ &String::from("/GenshinImpact_Data/Plugins/mihoyonet.dll"), // + &String::from("/GenshinImpact_Data/Plugins/mihoyonet.dll"),
alt_patch_path.clone().to_str().unwrap().to_string(), // alt_patch_path.clone().to_str().unwrap().to_string(),
String::from("original-mihoyonet.dll"), // String::from("original-mihoyonet.dll"),
); // );
if !backup { // if !backup {
println!("Unable to backup file!"); // println!("Unable to backup file!");
} // }
} // }
patch_path = PathBuf::from(system_helpers::install_location()).join("altpatch/mihoyonet.dll"); // patch_path = PathBuf::from(system_helpers::install_location()).join("altpatch/mihoyonet.dll");
// Copy the other part of patch to game files // // Copy the other part of patch to game files
let alt_replaced = file_helpers::copy_file_with_new_name( // let alt_replaced = file_helpers::copy_file_with_new_name(
patch_path.clone().to_str().unwrap().to_string(), // patch_path.clone().to_str().unwrap().to_string(),
get_game_rsa_path().await.unwrap() + &String::from("/GenshinImpact_Data/Plugins"), // get_game_rsa_path().await.unwrap() + &String::from("/GenshinImpact_Data/Plugins"),
String::from("mihoyonet.dll"), // String::from("mihoyonet.dll"),
); // );
if !alt_replaced { // if !alt_replaced {
return false; // return false;
} // }
/*** For replacing old backup file with new one, for example when version changes /*** For replacing old backup file with new one, for example when version changes
* Currently replaces when it shouldn't. Will figure it out when it matters * Currently replaces when it shouldn't. Will figure it out when it matters
* ***/ * ***/
// else { // else {
// // Check if game file matches backup // // Check if game file matches backup
// let matching_alt_backup = file_helpers::are_files_identical( // let matching_alt_backup = file_helpers::are_files_identical(
// &backup_path.clone(), // &backup_path.clone(),
// PathBuf::from(get_game_rsa_path().await.unwrap()) // PathBuf::from(get_game_rsa_path().await.unwrap())
// .join("/GenshinImpact_Data/Plugins/mihoyonet.dll") // .join("/GenshinImpact_Data/Plugins/mihoyonet.dll")
// .to_str() // .to_str()
// .unwrap(), // .unwrap(),
// ); // );
// let is_alt_patched = file_helpers::are_files_identical( // let is_alt_patched = file_helpers::are_files_identical(
// PathBuf::from(system_helpers::install_location()).join("altpatch/mihoyonet.dll").to_str().unwrap(), // PathBuf::from(system_helpers::install_location()).join("altpatch/mihoyonet.dll").to_str().unwrap(),
// PathBuf::from(get_game_rsa_path().await.unwrap()) // PathBuf::from(get_game_rsa_path().await.unwrap())
// .join("/GenshinImpact_Data/Plugins/mihoyonet.dll") // .join("/GenshinImpact_Data/Plugins/mihoyonet.dll")
// .to_str() // .to_str()
// .unwrap(), // .unwrap(),
// ); // );
// // Check if already alt patched // // Check if already alt patched
// if !matching_alt_backup { // if !matching_alt_backup {
// // Copy new backup if it is not patched // // Copy new backup if it is not patched
// if !is_alt_patched { // if !is_alt_patched {
// file_helpers::copy_file_with_new_name( // file_helpers::copy_file_with_new_name(
// get_game_rsa_path().await.unwrap() + &String::from("/GenshinImpact_Data/Plugins/mihoyonet.dll"), // get_game_rsa_path().await.unwrap() + &String::from("/GenshinImpact_Data/Plugins/mihoyonet.dll"),
// alt_patch_path.clone().to_str().unwrap().to_string(), // alt_patch_path.clone().to_str().unwrap().to_string(),
// String::from("original-mihoyonet.dll"), // String::from("original-mihoyonet.dll"),
// ); // );
// } // }
// } // }
// } // }
} // }
// Standard patch // Standard patch
patch_path = PathBuf::from(system_helpers::install_location()).join("patch/version.dll"); patch_path = PathBuf::from(system_helpers::install_location()).join("patch/version.dll");

View File

@@ -7,7 +7,7 @@
}, },
"package": { "package": {
"productName": "Cultivation", "productName": "Cultivation",
"version": "1.5.5" "version": "1.5.7"
}, },
"tauri": { "tauri": {
"allowlist": { "allowlist": {

View File

@@ -149,7 +149,7 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
// Connect to proxy // Connect to proxy
if (config.toggle_grasscutter) { if (config.toggle_grasscutter) {
const game_exe = await getGameExecutable() const game_exe = await getGameExecutable()
let newerGame = false const newerGame = false
const patchable = game_exe?.toLowerCase().includes('yuanshen') || game_exe?.toLowerCase().includes('genshin') const patchable = game_exe?.toLowerCase().includes('yuanshen') || game_exe?.toLowerCase().includes('genshin')
@@ -183,35 +183,36 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
const versionString = gameVersion?.major.toString() + gameVersion?.minor.toString() const versionString = gameVersion?.major.toString() + gameVersion?.minor.toString()
if ((gameVersion?.major == 4 && gameVersion?.minor > 5) || config.newer_game) { // Keeps being misused, remove for now.
newerGame = true // if ((gameVersion?.major == 4 && gameVersion?.minor > 5) || config.newer_game) {
// newerGame = true
const path = (await invoke('install_location')) as string // const path = (await invoke('install_location')) as string
const patchstring = '\\altpatch\\' // const patchstring = '\\altpatch\\'
const altPatch = path + patchstring // const altPatch = path + patchstring
const ALT_PATCH = // const ALT_PATCH =
'https://autopatchhk.yuanshen.com/client_app/download/pc_zip/20231030132335_iOEfPMcbrXpiA8Ca/ScatteredFiles/GenshinImpact_Data/Plugins/mihoyonet.dll' // 'https://autopatchhk.yuanshen.com/client_app/download/pc_zip/20231030132335_iOEfPMcbrXpiA8Ca/ScatteredFiles/GenshinImpact_Data/Plugins/mihoyonet.dll'
const pExists = (await invoke('dir_exists', { // const pExists = (await invoke('dir_exists', {
path: altPatch, // path: altPatch,
})) as boolean // })) as boolean
if (!pExists) { // if (!pExists) {
await invoke('dir_create', { // await invoke('dir_create', {
path: altPatch, // path: altPatch,
}) // })
this.props.downloadHandler.addDownload(ALT_PATCH, path + '/altpatch/mihoyonet.dll') // this.props.downloadHandler.addDownload(ALT_PATCH, path + '/altpatch/mihoyonet.dll')
await confirm('Please wait for the download in the bottom left to disappear, then click yes') // await confirm('Please wait for the download in the bottom left to disappear, then click yes')
} // }
/* For custom address patch only, used in 4.5 */ // /* For custom address patch only, used in 4.5 */
// let httpString = 'http://' // // let httpString = 'http://'
// if (this.state.httpsEnabled) { // // if (this.state.httpsEnabled) {
// httpString = 'https://' // // httpString = 'https://'
// } // // }
// config.launch_args = '-server=' + httpString + this.state.ip + ':' + this.state.port // // config.launch_args = '-server=' + httpString + this.state.ip + ':' + this.state.port
} // }
const patched = await patchGame(newerGame, versionString) const patched = await patchGame(newerGame, versionString)

View File

@@ -712,7 +712,7 @@ export default class Options extends React.Component<IProps, IState> {
</div> </div>
</div> </div>
<div className="OptionSection" id="menuOptionsContainerNewerGame"> {/* <div className="OptionSection" id="menuOptionsContainerNewerGame">
<div className="OptionLabel" id="menuOptionsLabelNewerGame"> <div className="OptionLabel" id="menuOptionsLabelNewerGame">
<Tr text="Patch Mihoyonet" /> <Tr text="Patch Mihoyonet" />
</div> </div>
@@ -723,7 +723,7 @@ export default class Options extends React.Component<IProps, IState> {
id="newerGame" id="newerGame"
/> />
</div> </div>
</div> </div> */}
<Divider /> <Divider />

View File

@@ -143,7 +143,7 @@ export default class NewsSection extends React.Component<IProps, IState> {
<tr> <tr>
<td> <td>
Work in progress area! These numbers may be outdated, so please do not use them as reference. Latest Work in progress area! These numbers may be outdated, so please do not use them as reference. Latest
version: Grasscutter 1.7.4 - Cultivation 1.5.5 version: Grasscutter 1.7.4 - Cultivation 1.5.7
</td> </td>
</tr> </tr>
) )