mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-02-04 05:36:12 +00:00
MoPaQ model cleanup
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
/// <summary>
|
||||
/// MPQ Header (required)
|
||||
/// </summary>
|
||||
public ArchiveHeader? ArchiveHeader { get; set; }
|
||||
public ArchiveHeader ArchiveHeader { get; set; }
|
||||
|
||||
// TODO: Files (optional)
|
||||
// TODO: Special files (optional)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
/// <summary>
|
||||
/// The MPQ archive signature
|
||||
/// </summary>
|
||||
public string? Signature { get; set; }
|
||||
public string Signature { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Size of the archive header
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace SabreTools.Data.Models.MoPaQ
|
||||
/// 'BET\x1A'
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]
|
||||
public string? Signature;
|
||||
public string Signature;
|
||||
|
||||
/// <summary>
|
||||
/// Version. Seems to be always 1
|
||||
@@ -130,7 +130,7 @@ namespace SabreTools.Data.Models.MoPaQ
|
||||
/// Followed by array of file flags. Each entry is 32-bit size and its meaning is the same like
|
||||
/// </summary>
|
||||
/// <remarks>Size from <see cref="FlagCount"/></remarks>
|
||||
public uint[]? FlagsArray { get; set; }
|
||||
public uint[] FlagsArray { get; set; }
|
||||
|
||||
// File table. Size of each entry is taken from dwTableEntrySize.
|
||||
// Size of the table is (dwTableEntrySize * dwMaxFileCount), round up to 8.
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace SabreTools.Data.Models.MoPaQ
|
||||
public const ulong BSDIFF40SignatureValue = 0x3034464649445342;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Encryption
|
||||
|
||||
/// <summary>
|
||||
@@ -80,4 +80,4 @@ namespace SabreTools.Data.Models.MoPaQ
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace SabreTools.Data.Models.MoPaQ
|
||||
/// 'HET\x1A'
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]
|
||||
public string? Signature;
|
||||
public string Signature;
|
||||
|
||||
/// <summary>
|
||||
/// Version. Seems to be always 1
|
||||
@@ -82,6 +82,6 @@ namespace SabreTools.Data.Models.MoPaQ
|
||||
/// Array of file indexes. Bit size of each entry is taken from dwTotalIndexSize.
|
||||
/// Table size is taken from dwHashTableSize.
|
||||
/// </summary>
|
||||
public byte[][]? FileIndexes { get; set; }
|
||||
public byte[][] FileIndexes { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,6 @@ namespace SabreTools.Data.Models.MoPaQ
|
||||
/// <remarks>0 entries</remarks>
|
||||
/// TODO: Determine the number of entries
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)]
|
||||
public uint[]? SectorOffsetTable;
|
||||
public uint[] SectorOffsetTable;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace SabreTools.Data.Models.MoPaQ
|
||||
/// <see cref="SignatureValue"/>
|
||||
/// <remarks>4 bytes</remarks>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]
|
||||
public string? Signature;
|
||||
public string Signature;
|
||||
|
||||
/// <summary>
|
||||
/// Maximum size of the user data
|
||||
|
||||
@@ -45,17 +45,10 @@ namespace SabreTools.Serialization.Wrappers
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, ArchiveHeader? header)
|
||||
private static void Print(StringBuilder builder, ArchiveHeader header)
|
||||
{
|
||||
builder.AppendLine(" Archive Header Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (header == null)
|
||||
{
|
||||
builder.AppendLine(" No archive header");
|
||||
builder.AppendLine();
|
||||
return;
|
||||
}
|
||||
|
||||
builder.AppendLine(header.Signature, " Signature");
|
||||
builder.AppendLine(header.HeaderSize, " Header size");
|
||||
builder.AppendLine(header.ArchiveSize, " Archive size");
|
||||
@@ -112,7 +105,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
|
||||
builder.AppendLine(" File indexes:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (table.FileIndexes == null)
|
||||
if (table.FileIndexes.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No file indexes ");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user