mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-22 14:55:11 +00:00
Add and use MPQ filename constants
This commit is contained in:
@@ -79,5 +79,29 @@ namespace SabreTools.Data.Models.MoPaQ
|
||||
public const uint MPQ_KEY_HASH_TABLE = 0xC3AF3770;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Special Entry Names
|
||||
|
||||
/// <summary>
|
||||
/// Name of internal listfile
|
||||
/// </summary>
|
||||
public const string LISTFILE_NAME = "(listfile)";
|
||||
|
||||
/// <summary>
|
||||
/// Name of internal signature
|
||||
/// </summary>
|
||||
public const string SIGNATURE_NAME = "(signature)";
|
||||
|
||||
/// <summary>
|
||||
/// Name of internal attributes file
|
||||
/// </summary>
|
||||
public const string ATTRIBUTES_NAME = "(attributes)";
|
||||
|
||||
/// <summary>
|
||||
/// Patch metadata
|
||||
/// </summary>
|
||||
public const string PATCH_METADATA_NAME = "(patch_metadata)";
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using StormLibSharp;
|
||||
using static SabreTools.Data.Models.MoPaQ.Constants;
|
||||
|
||||
namespace SabreTools.Serialization.Wrappers
|
||||
{
|
||||
@@ -24,7 +25,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
// Try to open the archive and listfile
|
||||
var mpqArchive = new MpqArchive(Filename, FileAccess.Read);
|
||||
string? listfile = null;
|
||||
MpqFileStream listStream = mpqArchive.OpenFile("(listfile)");
|
||||
MpqFileStream listStream = mpqArchive.OpenFile(LISTFILE_NAME);
|
||||
|
||||
// If we can't read the listfile, we just return
|
||||
if (!listStream.CanRead)
|
||||
|
||||
Reference in New Issue
Block a user