Class M2ChunkedFile
A chunked .m2 shell (Legion+), abstract over the client version. Construct a concrete version with M2ChunkedFile.for_version(expansion); the per-version M2ChunkedFile* classes are subclasses. See https://wowdev.wiki/M2#Chunks.
public class M2ChunkedFile : IDisposable
- Inheritance
-
M2ChunkedFile
- Implements
- Derived
- Inherited Members
Constructors
M2ChunkedFile()
public M2ChunkedFile()
M2ChunkedFile(M2ChunkedFile)
Copy-construct: a deep copy of other (the C++ copy constructor).
public M2ChunkedFile(M2ChunkedFile other)
Parameters
otherM2ChunkedFile
Properties
Afra
AFRA (Dragonflight+); not yet observed, kept verbatim.
public ChunkBlob Afra { get; set; }
Property Value
AlphaAttenuation
Distance-based model alpha attenuation coefficients (NERF); kept verbatim.
public ChunkBlob AlphaAttenuation { get; set; }
Property Value
AnimFdids
.anim FileDataIDs (AFID), one per external (animation, variation) pair.
public Vector<AnimFileEntry> AnimFdids { get; }
Property Value
BoneFdids
.bone FileDataIDs (BFID), one per FacePose variant.
public Vector<uint> BoneFdids { get; }
Property Value
Dboc
DBOC; undocumented (16 or 32 bytes seen), kept verbatim.
public ChunkBlob Dboc { get; set; }
Property Value
Dpiv
DPIV; undocumented, kept verbatim.
public ChunkBlob Dpiv { get; set; }
Property Value
EdgeFade
Edge fade data (EDGF), applied to batches with flags2 0x8; kept verbatim.
public ChunkBlob EdgeFade { get; set; }
Property Value
ExtendedParticles
Extended particle parameters (EXPT), one per emitter; superseded by EXP2 when both exist.
public Vector<M2ExtendedParticleSimple> ExtendedParticles { get; }
Property Value
ExtendedParticles2
Extended particle parameters with alpha-cutoff ramps (EXP2), one per emitter.
public Exp2Data ExtendedParticles2 { get; set; }
Property Value
GeometryParticleModelFdids
Geometry particle model FileDataIDs (GPID), one per emitter.
public Vector<uint> GeometryParticleModelFdids { get; }
Property Value
HousingCollision
Player-housing collision mesh (PCOL); offset-based layout, kept verbatim.
public ChunkBlob HousingCollision { get; set; }
Property Value
InlinePhys
Inline physics (PFDC): a whole .phys image plus alignment padding, kept verbatim (structured PHYS is a follow-up milestone). wowdev dates it to the 9.0.1 alpha, but 8.3.7 shipped mid-alpha with the backport — 31 item M2s in the fleet client carry it.
public ChunkBlob InlinePhys { get; set; }
Property Value
LightDetails
Per-light detail overrides (DETL), kept verbatim: real 9.x files carry 16-byte records where wowdev documents 12 (see M2LightDetail for the known half).
public ChunkBlob LightDetails { get; set; }
Property Value
LodData
LOD data (LDV1); layout partially known, kept verbatim.
public ChunkBlob LodData { get; set; }
Property Value
ParentEventData
Parent event data (PEDC); offset-based track payload kept verbatim.
public ChunkBlob ParentEventData { get; set; }
Property Value
ParentSequenceBlacklist
Parent-model sequence blacklist (PABC).
public PabcData ParentSequenceBlacklist { get; set; }
Property Value
ParentSequenceBounds
Parent sequence bounds (PSBC).
public PsbcData ParentSequenceBounds { get; set; }
Property Value
ParentTextureWeights
Parent texture weights (PADC); offset-based track payload kept verbatim.
public ChunkBlob ParentTextureWeights { get; set; }
Property Value
ParticleGeosetData
Particle geoset data (PGD1), one geoset per emitter (wowdev dates it to the 1.13.2.30172 classic build — the 8.2.0 retail era).
public Pgd1Data ParticleGeosetData { get; set; }
Property Value
PhysFdid
.phys FileDataID (PFID); 0 or 1 entries.
public Vector<uint> PhysFdid { get; }
Property Value
RecursiveParticleModelFdids
Recursive (child-emitter) particle model FileDataIDs (RPID), one per emitter.
public Vector<uint> RecursiveParticleModelFdids { get; }
Property Value
SkeletonFdid
.skel FileDataID (SKID); 0 or 1 entries.
public Vector<uint> SkeletonFdid { get; }
Property Value
SkinFdids
.skin FileDataIDs (SFID): num_skin_profiles view entries, then the LOD-band skins.
public Vector<uint> SkinFdids { get; }
Property Value
TextureAc
Texture transform flags (TXAC), one 2-byte record per material then per particle emitter.
public Vector<FixedArray<byte>> TextureAc { get; }
Property Value
TextureFdids
Texture FileDataIDs (TXID), replacing the in-image texture filenames, one per texture.
public Vector<uint> TextureFdids { get; }
Property Value
WaterfallV1
Waterfall render path v1 (WFV1); undocumented, kept verbatim.
public ChunkBlob WaterfallV1 { get; set; }
Property Value
WaterfallV2
Waterfall render path v2 (WFV2); undocumented, kept verbatim.
public ChunkBlob WaterfallV2 { get; set; }
Property Value
WaterfallV3
Waterfall render path v3 (WFV3); shader parameter block, kept verbatim.
public ChunkBlob WaterfallV3 { get; set; }
Property Value
Methods
Dispose()
Release the native object now. Optional: the finalizer releases it on
collection anyway - dispose (or using) when you want native memory back
promptly.
public virtual void Dispose()
EnsureValid()
Validate and raise on the first error instead of returning a report — the assert-style face of validate().
public void EnsureValid()
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
ForVersion(ClientVersion)
A fresh M2ChunkedFile for an exact client version — the only axis that can name a Classic client, whose files follow the engine its build was cut on rather than its 1.15 / 4.4 version number.
public static M2ChunkedFile ForVersion(ClientVersion version)
Parameters
versionClientVersion
Returns
ForVersion(Expansion)
A fresh M2ChunkedFile for the given era, as the family base — the dynamic twin of the typed Era factories.
public static M2ChunkedFile ForVersion(Expansion era)
Parameters
eraExpansion
Returns
GetHashCode()
Reference-identity hash (the C++ type has no hash to mirror).
public override int GetHashCode()
Returns
Read(byte[])
Deserialize file bytes into this entity, replacing its contents. Unmodeled chunks are preserved so an unmodified entity rewrites byte-for-byte.
public void Read(byte[] data)
Parameters
databyte[]
Validate()
Check the logical integrity contracts this file must satisfy to LOAD in the client — companion-chunk counts, index ranges, flag/presence coherence — which write() deliberately never enforces. Call it before writing when you want to know the result will load. A file read from a client and left unmodified reports no errors; warnings mark states real client files ship.
public ValidationReport Validate()
Returns
Write()
Serialize this entity.
public byte[] Write()
Returns
- byte[]
Operators
operator ==(M2ChunkedFile?, M2ChunkedFile?)
public static bool operator ==(M2ChunkedFile? l, M2ChunkedFile? r)
Parameters
Returns
operator !=(M2ChunkedFile?, M2ChunkedFile?)
public static bool operator !=(M2ChunkedFile? l, M2ChunkedFile? r)