public bool GetEncodingEntry(ulong hash, out EncodingEntry enc) { var rootInfos = RootHandler.GetEntries(hash); if (rootInfos.Any()) { return(EncodingHandler.GetEntry(rootInfos.First().MD5, out enc)); } if ((CASCConfig.LoadFlags & LoadFlags.Install) != 0) { var installInfos = Install.GetEntries().Where(e => Hasher.ComputeHash(e.Name) == hash && e.Tags.Any(t => t.Type == 1 && t.Name == RootHandler.Locale.ToString())); if (installInfos.Any()) { return(EncodingHandler.GetEntry(installInfos.First().MD5, out enc)); } installInfos = Install.GetEntries().Where(e => Hasher.ComputeHash(e.Name) == hash); if (installInfos.Any()) { return(EncodingHandler.GetEntry(installInfos.First().MD5, out enc)); } } enc = default(EncodingEntry); return(false); }
protected BinaryReader OpenRootFile(EncodingHandler enc, CASCHandlerBase casc) { if (!enc.GetEntry(casc.Config.RootMD5, out EncodingEntry encInfo)) { throw new FileNotFoundException("encoding info for root file missing!"); } //ExtractFile(encInfo.Key, ".", "root"); return(new BinaryReader(casc.OpenFile(encInfo.Key))); }