/// <summary> /// Initializes a new instance from existing Mythic package file. /// </summary> /// <param name="reader">Binary file (.uop source).</param> /// <param name="parent">Parent entity.</param> public MythicPackageFile(BinaryReader reader, MythicPackageBlock parent) { m_Parent = parent; m_DataBlockAddress = m_OldDataBlockAddress = reader.ReadInt64(); m_DataBlockLength = reader.ReadInt32(); m_CompressedSize = reader.ReadInt32(); m_DecompressedSize = reader.ReadInt32(); m_FileHash = reader.ReadUInt64(); if (m_FileHash != 0) { m_FileName = HashDictionary.Get(m_FileHash, true); } m_DataBlockHash = reader.ReadUInt32(); short flag = reader.ReadInt16(); switch (flag) { case 0x0: m_Compression = CompressionFlag.None; break; case 0x1: m_Compression = CompressionFlag.Zlib; break; default: throw new InvalidCompressionException(flag); } }
/// <summary> /// Reloads file names from the dictionary. /// </summary> public void RefreshFileName() { m_FileName = HashDictionary.Get(m_FileHash, false); }