Exemplo n.º 1
0
        /// <summary>
        /// Unknown file, but it seems to contain history of achievements or whatever... rape it
        /// </summary>
        /// <returns></returns>
        public bool RemovePhDAT()
        {
            if (!ParseCheck())
            {
                return(false);
            }
            FileEntry x = GetFile("cache/ph.dat");

            if (x == null)
            {
                return(true);
            }
            return(x.Delete());
        }
Exemplo n.º 2
0
        private void Add(RPFLib.Common.Directory fsDirectory, byte[] data)
        {
            FileEntry newFileEntry = new FileEntry(_rpfFile.TOC);

            _rpfFile.TOC.Add(newFileEntry as TOCEntry);

            var file = new Common.File();

            file._dataLoad   = getCustom => LoadData(newFileEntry, getCustom);
            file._dataStore  = setdata => StoreData(newFileEntry, setdata);
            file._dataCustom = () => newFileEntry.CustomData != null;
            file.d1          = () => newFileEntry.getSize();
            file._Index      = nIndex => newFileEntry.setIndex(nIndex);
            file._delete     = () => newFileEntry.Delete();

            file.CompressedSize  = newFileEntry.SizeInArchive;
            file.IsCompressed    = newFileEntry.IsCompressed;
            file.Name            = GetName(newFileEntry);
            file.IsResource      = newFileEntry.IsResourceFile;
            file.ParentDirectory = fsDirectory;
            fsDirectory.AddObject(file);

            newFileEntry.SetCustomData(data);
        }