mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-18 22:41:46 +00:00
Actually fixed PK3 synchronization
This commit is contained in:
parent
fa053bc097
commit
961b5fdb33
1 changed files with 16 additions and 24 deletions
|
@ -40,7 +40,6 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
private /*readonly*/ ArchiveType archivetype; //mxd
|
private /*readonly*/ ArchiveType archivetype; //mxd
|
||||||
private /*readonly*/ Dictionary<string, byte[]> sevenzipentries; //mxd
|
private /*readonly*/ Dictionary<string, byte[]> sevenzipentries; //mxd
|
||||||
private bool batchmode = true; //mxd
|
private bool batchmode = true; //mxd
|
||||||
private bool issevenzip = false;
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -103,8 +102,6 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
sevenzipentries.Add(reader.Entry.Key.ToLowerInvariant(), s.ToArray());
|
sevenzipentries.Add(reader.Entry.Key.ToLowerInvariant(), s.ToArray());
|
||||||
fileentries.Add(new DirectoryFileEntry(reader.Entry.Key));
|
fileentries.Add(new DirectoryFileEntry(reader.Entry.Key));
|
||||||
}
|
}
|
||||||
|
|
||||||
issevenzip = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -159,15 +156,15 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
//mxd
|
//mxd
|
||||||
private void UpdateArchive(bool enable)
|
private void UpdateArchive(bool enable)
|
||||||
{
|
{
|
||||||
if(archivetype == ArchiveType.SevenZip) return;
|
lock (this)
|
||||||
|
{
|
||||||
|
if (archivetype == ArchiveType.SevenZip) return;
|
||||||
|
|
||||||
if(enable && archive == null)
|
if (enable && archive == null)
|
||||||
{
|
{
|
||||||
archive = ArchiveFactory.Open(location.location);
|
archive = ArchiveFactory.Open(location.location);
|
||||||
}
|
}
|
||||||
else if(!enable && !batchmode && archive != null)
|
else if (!enable && !batchmode && archive != null)
|
||||||
{
|
|
||||||
lock (archive)
|
|
||||||
{
|
{
|
||||||
archive.Dispose();
|
archive.Dispose();
|
||||||
archive = null;
|
archive = null;
|
||||||
|
@ -513,26 +510,21 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lock(this)
|
lock (this)
|
||||||
{
|
{
|
||||||
UpdateArchive(true);
|
UpdateArchive(true);
|
||||||
|
|
||||||
lock (archive)
|
foreach (var entry in archive.Entries)
|
||||||
{
|
{
|
||||||
|
if (entry.IsDirectory) continue;
|
||||||
|
|
||||||
foreach (var entry in archive.Entries)
|
// Is this the entry we are looking for?
|
||||||
|
if (string.Compare(entry.Key, fn, true) == 0)
|
||||||
{
|
{
|
||||||
if (entry.IsDirectory) continue;
|
filedata = new MemoryStream();
|
||||||
|
entry.WriteTo(filedata);
|
||||||
// Is this the entry we are looking for?
|
break;
|
||||||
if (string.Compare(entry.Key, fn, true) == 0)
|
|
||||||
{
|
|
||||||
filedata = new MemoryStream();
|
|
||||||
entry.WriteTo(filedata);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateArchive(false);
|
UpdateArchive(false);
|
||||||
|
|
Loading…
Reference in a new issue