diff --git a/Game/Genshin/Settings.cs b/Game/Genshin/Settings.cs index b5459c5..83a59fe 100644 --- a/Game/Genshin/Settings.cs +++ b/Game/Genshin/Settings.cs @@ -110,8 +110,9 @@ public enum ServerRegionID os_euro = 1, os_asia = 2, os_cht = 3, - // BETA? - sg1 = 4 + // YuukiPS + sg1 = 4, + eu1 = 5 } public class GeneralDataProp diff --git a/Main.cs b/Main.cs index 86725f7..0af469c 100644 --- a/Main.cs +++ b/Main.cs @@ -455,9 +455,23 @@ public string PatchGame(bool patchit = true, bool online = true, int metode = 1, else if (MD5_UA_API_Patched != MD5_UA_LOC_Currently) { // Jika User pilih patch (MD5_UA_API_Patched doesn't match MD5_UA_LOC_Currently) + var download_patch = false; if (!File.Exists(PathfileUA_Patched)) { - // If you don't have PathfileUA_Patched, download it + download_patch = true; + } + else + { + // If UA_API_Patches_MD5 (patch file from api) matches UA_LOC_Patched_MD5 (current patch file) + if (MD5_UA_API_Patched != MD5_UA_LOC_Patched) + { + download_patch = true; + } + } + + // If you don't have PathfileUA_Patched, download it + if (download_patch) + { var DL2 = new Download(DL_Patch + "UserAssembly-patched.dll", PathfileUA_Patched); if (DL2.ShowDialog() != DialogResult.OK) { @@ -470,8 +484,11 @@ public string PatchGame(bool patchit = true, bool online = true, int metode = 1, } } - // If UA_API_Patches_MD5 (patch file from api) matches UA_LOC_Patched_MD5 (current patch file) - if (MD5_UA_API_Patched == MD5_UA_LOC_Patched) + if (MD5_UA_API_Patched != MD5_UA_LOC_Patched) + { + return "(UA) Failed because file doesn't match from md5 api"; + } + else { // Patch to PathfileUA_Now try @@ -480,16 +497,14 @@ public string PatchGame(bool patchit = true, bool online = true, int metode = 1, MD5_UA_LOC_Currently = Tool.CalculateMD5(PathfileUA_Currently); Console.WriteLine("Patch done..."); + download_patch = false; } catch (Exception x) { return "Failed Patch: " + x.ToString(); } } - else - { - return "Failed because file doesn't match from md5 api"; - } + } else { @@ -723,8 +738,26 @@ public string PatchGame(bool patchit = true, bool online = true, int metode = 1, } else if (MD5_Metadata_API_Patched != MD5_Metadata_LOC_Currently) { - // Jika User pilih patch (MD5_Metadata_API_Patched doesn't match MD5_Metadata_LOC_Currently) + // Jika md5 patch tidak cocok dengan metadata sekarang + + var download_patch = false; + + // jIka file tidak ada if (!File.Exists(PathfileMetadata_Patched)) + { + download_patch = true; + } + else + { + // If Metadata_API_Patches_MD5 (patch file from api) matches Metadata_LOC_Patched_MD5 (current patch file) + if (MD5_Metadata_API_Patched != MD5_Metadata_LOC_Patched) + { + download_patch = true; + } + } + + // re-download + if (download_patch) { // If you don't have PathfileMetadata_Patched, download it var DL2 = new Download(DL_Patch + "global-metadata-patched.dat", PathfileMetadata_Patched); @@ -739,8 +772,11 @@ public string PatchGame(bool patchit = true, bool online = true, int metode = 1, } } - // If Metadata_API_Patches_MD5 (patch file from api) matches Metadata_LOC_Patched_MD5 (current patch file) - if (MD5_Metadata_API_Patched == MD5_Metadata_LOC_Patched) + if (MD5_Metadata_API_Patched != MD5_Metadata_LOC_Patched) + { + return "(MA) Failed because file doesn't match from md5 api"; + } + else { // Patch to PathfileMetadata_Now try @@ -749,16 +785,14 @@ public string PatchGame(bool patchit = true, bool online = true, int metode = 1, MD5_Metadata_LOC_Currently = Tool.CalculateMD5(PathfileMetadata_Currently); Console.WriteLine("Patch done..."); + download_patch = false; } catch (Exception x) { return "Failed Patch: " + x.ToString(); } } - else - { - return "Failed because file doesn't match from md5 api"; - } + } else { diff --git a/YuukiPS Launcher.csproj b/YuukiPS Launcher.csproj index 039df01..e4cd245 100644 --- a/YuukiPS Launcher.csproj +++ b/YuukiPS Launcher.csproj @@ -12,8 +12,8 @@ Properties\app.manifest - 2022.10.5.0815 - 2022.10.5.0815 + 2022.10.5.1732 + 2022.10.5.1732 true YuukiPS