/** * Find the error report folder and check it matches the app name if provided */ FPlatformErrorReport LoadErrorReport() { if (ReportDirectoryAbsolutePath.IsEmpty()) { UE_LOG(CrashReportClientLog, Warning, TEXT("No error report found")); return FPlatformErrorReport(); } FPlatformErrorReport ErrorReport(ReportDirectoryAbsolutePath); FString XMLWerFilename; ErrorReport.FindFirstReportFileWithExtension( XMLWerFilename, TEXT( ".xml" ) ); extern FCrashDescription& GetCrashDescription(); GetCrashDescription() = FCrashDescription( ReportDirectoryAbsolutePath / XMLWerFilename ); #if CRASH_REPORT_UNATTENDED_ONLY return ErrorReport; #else if( !GameNameFromCmd.IsEmpty() && GameNameFromCmd != GetCrashDescription().GameName ) { // Don't display or upload anything if it's not the report we expected ErrorReport = FPlatformErrorReport(); } return ErrorReport; #endif }
FCrashReportClientUnattended::FCrashReportClientUnattended(const FString& Directory) : ReportDirectory(Directory) , Uploader(GServerIP) { // Using GetCleanFilename to actually get directory leaf name Uploader.BeginUpload(FPaths::GetCleanFilename(ReportDirectory), FPlatformErrorReport(ReportDirectory)); StartTicker(); }
void FCrashUpload::CheckPendingReportsForFilesToUpload() { SetCurrentState(EUploadState::CheckingReport); do { if (PendingReportDirectories.Num() == 0) { // Nothing to upload UE_LOG(CrashReportClientLog, Log, TEXT("All uploads done")); SetCurrentState(EUploadState::Finished); return; } ErrorReport = FPlatformErrorReport(PendingReportDirectories.Pop()); PendingFiles = ErrorReport.GetFilesToUpload(); } while (PendingFiles.Num() == 0 || !SendCheckReportRequest()); }