mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-31 04:40:55 +00:00
Added 7z support, thanks to Randy Heit.
This commit is contained in:
parent
6b347ad51d
commit
09a1c2ccd3
1 changed files with 13 additions and 1 deletions
|
@ -93,8 +93,20 @@ namespace CodeImp.DoomBuilder.Data
|
|||
private SevenZipExtractor OpenPK3File()
|
||||
{
|
||||
FileStream filestream = File.Open(location.location, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
||||
InArchiveFormat tryas;
|
||||
filestream.Seek(0, SeekOrigin.Begin);
|
||||
return new SevenZipExtractor(filestream, InArchiveFormat.Zip);
|
||||
tryas = InArchiveFormat.Zip;
|
||||
if (filestream.ReadByte() == (byte)'7' &&
|
||||
filestream.ReadByte() == (byte)'z' &&
|
||||
filestream.ReadByte() == 0xBC &&
|
||||
filestream.ReadByte() == 0xAF &&
|
||||
filestream.ReadByte() == 0x27 &&
|
||||
filestream.ReadByte() == 0x1C)
|
||||
{
|
||||
tryas = InArchiveFormat.SevenZip;
|
||||
}
|
||||
filestream.Seek(0, SeekOrigin.Begin);
|
||||
return new SevenZipExtractor(filestream, tryas);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
Loading…
Reference in a new issue