CrystalMpq.MpqBlockEntry.OnNameDetected C# (CSharp) Method

OnNameDetected() private method

Called internally when the name has been detected.
Right now, the method will only update the seed when needed.
private OnNameDetected ( string name, bool cache = false, bool listed = false ) : void
name string Detected filename.
cache bool If set to true, remember the filename.
listed bool If set to true, the name was detected from the listfile.
return void
        internal void OnNameDetected(string name, bool cache = false, bool listed = false)
        {
            if (!string.IsNullOrEmpty(this.Name)) return;

            // TODO: Improve the name caching mechanism (Global hash table for MPQ archives ?)
            if (cache || (this.Flags & MpqFileFlags.Encrypted) != 0)
                this.Seed = ComputeSeed(name);
            if (cache || (this.Flags & MpqFileFlags.Patch) != 0)
                this.Name = name; // Always cache the filename if the file is a patch… This is needed for base file lookup.
            if (cache) this.Listed = listed;
        }