void CServerPatchApplier::patchFromLive(uint32 liveVersion, uint32 installRequestVersion) { // scan the temp directory to build a file list and delete all of the files we find there CFileDescriptionContainer tempFiles; tempFiles.addFileSpec(_Directories.installDirectoryName()+"*",true); for (uint32 i=0;i<tempFiles.size();++i) { NLMISC::CFile::deleteFile(tempFiles[i].FileName); } // make sure the temp directory is now empty tempFiles.clear(); tempFiles.addFileSpec(_Directories.installDirectoryName()+"*",true); DROP_IF(!tempFiles.empty(),"Failed to delete all of the contents of the directory: "+_Directories.installDirectoryName(),return); // choose a patch direction depending on the whether we're patching forwards or backwards if (liveVersion<installRequestVersion) { _patchUpFromLive(liveVersion,installRequestVersion); } else if (liveVersion>installRequestVersion) { _patchDownFromLive(liveVersion,installRequestVersion); } }
bool CCharacterScanJob::getFileList(CFileDescriptionContainer& result) const { bool isOK=true; result.clear(); for (uint32 i=0;i<_FileListBuilders.size();++i) { isOK &= _FileListBuilders[i]->execute(result); } return isOK; }
bool CCharacterScanJob::deleteFilesInOutputDirectory() const { CFileDescriptionContainer fdc; fdc.addFileSpec(STAT_GLOBALS::getOutputFilePath(getOutputPath()+"*")); for (uint32 i=0;i<fdc.size();++i) { NLMISC::CFile::deleteFile(fdc[i].FileName); } // make sure the directory is now empty fdc.clear(); fdc.addFileSpec(STAT_GLOBALS::getOutputFilePath(getOutputPath()+"*")); return fdc.empty(); }
void CCharacterScanJob::listFilesOnly(CFileDescriptionContainer& result) { result.clear(); _FileList= &result; _ListFilesOnly=true; }