From a75b43e179fc6e53591b9b3a12ff6351b6b9959f Mon Sep 17 00:00:00 2001 From: Alfred Shen Date: Sun, 27 Sep 2020 06:26:15 +0800 Subject: [PATCH] revert DirectoryRecord added zh-cn locale detect --- LibGGPK/Records/DirectoryRecord.cs | 4 ++-- LibGGPK/Records/FileRecord.cs | 3 +-- VPatchGGPK/Form1.cs | 12 +++++++++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/LibGGPK/Records/DirectoryRecord.cs b/LibGGPK/Records/DirectoryRecord.cs index e30f64f..e50d53d 100644 --- a/LibGGPK/Records/DirectoryRecord.cs +++ b/LibGGPK/Records/DirectoryRecord.cs @@ -113,13 +113,13 @@ public override void Write(BinaryWriter bw, Dictionary changedOffset /// Path of pack file that contains this record /// Previous name hash of entry /// New offset of entry - public void UpdateOffset(FileStream ggpkFileStream, uint nameHash, long newEntryOffset) + public void UpdateOffset(string ggpkPath, uint nameHash, long newEntryOffset) { var entry = Entries.FirstOrDefault(e => e.EntryNameHash == nameHash); if (entry.Offset == 0 ) throw new ApplicationException("Entry not found!"); - //using (var ggpkFileStream = File.Open(ggpkPath, FileMode.Open)) + using (var ggpkFileStream = File.Open(ggpkPath, FileMode.Open, FileAccess.Write, FileShare.ReadWrite)) { // Jump to the location of 'Entries' in the ggpk file and // change the entry for 'previousEntryOffset' to 'newEntryOffset' diff --git a/LibGGPK/Records/FileRecord.cs b/LibGGPK/Records/FileRecord.cs index e422a8f..74dd67f 100644 --- a/LibGGPK/Records/FileRecord.cs +++ b/LibGGPK/Records/FileRecord.cs @@ -320,8 +320,7 @@ public void ReplaceContents(string ggpkPath, byte[] replacmentData, LinkedList