private BinaryReader OpenInstallationFile(EncodingHandler encoding, CASCEngine engine, MD5Hash hash, string errorName) { EncodingEntry entry; if (!encoding.GetEntry(hash, out entry)) { throw new FileNotFoundException(string.Format("Installation missing {0} file!", errorName)); } return(new BinaryReader(engine.OpenFile(entry.Key))); }
public void LoadFileDataComplete(CASCEngine casc) { string dbFileDataComplete = "DBFilesClient\\FileDataComplete.db2"; if (!casc.FileExists(dbFileDataComplete)) return; Log.Write("CASC: Loading entries from FileDataComplete (DB2)"); using (var stream = casc.OpenFile(dbFileDataComplete)) { DB5_Reader db = new DB5_Reader(stream); foreach (var row in db) { string path = row.Value.GetField<string>(0); string name = row.Value.GetField<string>(1); string fullName = path + name; ulong fileHash = Hasher.ComputeHash(fullName); if (!RootData.ContainsKey(fileHash)) continue; CASCFile.FileNames[fileHash] = fullName; } } }
private BinaryReader OpenEncodingFile(CASCEngine casc) { return new BinaryReader(casc.OpenFile(casc.Config.EncodingKey)); }
private BinaryReader OpenInstallationFile(EncodingHandler encoding, CASCEngine engine, MD5Hash hash, string errorName) { EncodingEntry entry; if (!encoding.GetEntry(hash, out entry)) throw new FileNotFoundException(string.Format("Installation missing {0} file!", errorName)); return new BinaryReader(engine.OpenFile(entry.Key)); }
private BinaryReader OpenEncodingFile(CASCEngine casc) { return(new BinaryReader(casc.OpenFile(casc.Config.EncodingKey))); }