From 60fa3818774125af21dc492553ed1a5a389b451c Mon Sep 17 00:00:00 2001 From: lastbattle <4586194+lastbattle@users.noreply.github.com> Date: Sat, 19 Feb 2022 18:40:47 +0800 Subject: [PATCH] [MapleLib] Fix for KMS v.1.360.1.0 -- saving WZ --- MapleLib/ClientLib/MapleStoryLocalisation.cs | 11 ++++------- MapleLib/WzLib/WzFile.cs | 4 ++-- MapleLib/WzLib/WzImage.cs | 2 -- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/MapleLib/ClientLib/MapleStoryLocalisation.cs b/MapleLib/ClientLib/MapleStoryLocalisation.cs index 87f46ee4..e584053d 100644 --- a/MapleLib/ClientLib/MapleStoryLocalisation.cs +++ b/MapleLib/ClientLib/MapleStoryLocalisation.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace MapleLib.ClientLib +namespace MapleLib.ClientLib { /// /// The localisation number for each regional MapleStory version. @@ -13,7 +7,10 @@ public enum MapleStoryLocalisation : int { MapleStoryKorea = 1, MapleStoryKoreaTespia = 2, + Unknown3 = 3, + Unknown4 = 4, MapleStoryTespia = 5, + Unknown6 = 6, MapleStorySEA = 7, MapleStoryGlobal = 8, MapleStoryEurope = 9, diff --git a/MapleLib/WzLib/WzFile.cs b/MapleLib/WzLib/WzFile.cs index 186d473a..a58ed7fe 100644 --- a/MapleLib/WzLib/WzFile.cs +++ b/MapleLib/WzLib/WzFile.cs @@ -576,7 +576,7 @@ public void SaveToDisk(string path, bool? override_saveAs64BitWZ, WzMapleVersion { wzWriter.Hash = versionHash; - uint totalLen = wzDir.GetImgOffsets(wzDir.GetOffsets(Header.FStart + (bSaveAs64BitWZ ? 0 : 2u))); + uint totalLen = wzDir.GetImgOffsets(wzDir.GetOffsets(Header.FStart + (bSaveAs64BitWZ && !this.b64BitClient_withVerHeader ? 0 : 2u))); Header.FSize = totalLen - Header.FStart; for (int i = 0; i < 4; i++) { @@ -591,7 +591,7 @@ public void SaveToDisk(string path, bool? override_saveAs64BitWZ, WzMapleVersion { wzWriter.Write(new byte[(int)extraHeaderLength]); } - if (!bSaveAs64BitWZ) + if (!bSaveAs64BitWZ || this.b64BitClient_withVerHeader) wzWriter.Write(wzVersionHeader); wzWriter.Header = Header; diff --git a/MapleLib/WzLib/WzImage.cs b/MapleLib/WzLib/WzImage.cs index 1ea0a9cd..1032f381 100644 --- a/MapleLib/WzLib/WzImage.cs +++ b/MapleLib/WzLib/WzImage.cs @@ -19,8 +19,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the using System; using MapleLib.WzLib.Util; using MapleLib.WzLib.WzProperties; -using System.Diagnostics; -using MapleLib.PacketLib; namespace MapleLib.WzLib {