void UGameEngine::PreExit() { FAVIWriter* AVIWriter = FAVIWriter::GetInstance(); if (AVIWriter) { AVIWriter->Close(); } Super::PreExit(); // Stop tracking, automatically flushes. NETWORK_PROFILER(GNetworkProfiler.EnableTracking(false)); CancelAllPending(); // Clean up world. for (int32 WorldIndex = 0; WorldIndex < WorldList.Num(); ++WorldIndex) { UWorld* const World = WorldList[WorldIndex].World(); if ( World != NULL ) { // notify the GameMode AGameMode* const GameMode = World->GetAuthGameMode(); if (GameMode != NULL) { GameMode->PreExit(); } World->FlushLevelStreaming( NULL, true ); World->CleanupWorld(); } } }
void UUnrealEdEngine::PreExit() { // Notify edit modes we're mode at exit FEditorModeRegistry::Get().Shutdown(); FAVIWriter* AVIWriter = FAVIWriter::GetInstance(); if (AVIWriter) { AVIWriter->Close(); } Super::PreExit(); }
void UGameEngine::PreExit() { FAVIWriter* AVIWriter = FAVIWriter::GetInstance(); if (AVIWriter) { AVIWriter->Close(); } Super::PreExit(); // Stop tracking, automatically flushes. NETWORK_PROFILER(GNetworkProfiler.EnableTracking(false)); CancelAllPending(); // Clean up all worlds for (int32 WorldIndex = 0; WorldIndex < WorldList.Num(); ++WorldIndex) { UWorld* const World = WorldList[WorldIndex].World(); if ( World != NULL ) { World->bIsTearingDown = true; // Cancel any pending connection to a server CancelPending(World); // Shut down any existing game connections ShutdownWorldNetDriver(World); for (FActorIterator ActorIt(World); ActorIt; ++ActorIt) { ActorIt->RouteEndPlay(EEndPlayReason::Quit); } World->GetGameInstance()->Shutdown(); World->FlushLevelStreaming(EFlushLevelStreamingType::Visibility); World->CleanupWorld(); } } }
void UUnrealEdEngine::Tick(float DeltaSeconds, bool bIdleMode) { Super::Tick( DeltaSeconds, bIdleMode ); // Increment the "seconds since last autosave" counter, then try to autosave. if (!GSlowTaskOccurred) { // Don't increment autosave count while in game/pie/automation testing or while in Matinee const bool PauseAutosave = (PlayWorld != NULL) || GIsAutomationTesting; if (!PauseAutosave && PackageAutoSaver.Get()) { PackageAutoSaver->UpdateAutoSaveCount(DeltaSeconds); } } if (!GIsSlowTask) { GSlowTaskOccurred = false; } // Display any load errors that happened while starting up the editor. static bool bFirstTick = true; if (bFirstTick) { FEditorDelegates::DisplayLoadErrors.Broadcast(); } bFirstTick = false; if(PackageAutoSaver.Get()) { PackageAutoSaver->AttemptAutoSave(); } // Try and notify the user about modified packages needing checkout AttemptModifiedPackageNotification(); // Attempt to warn about any packages that have been modified but were previously // saved with an engine version newer than the current one AttemptWarnAboutPackageEngineVersions(); // Attempt to warn about any packages that have been modified but the user // does not have permission to write them to disk AttemptWarnAboutWritePermission(); // Update lightmass UpdateBuildLighting(); FAVIWriter* AVIWriter = FAVIWriter::GetInstance(); if (AVIWriter) { AVIWriter->Update(DeltaSeconds); } ICrashTrackerModule* CrashTracker = FModuleManager::LoadModulePtr<ICrashTrackerModule>( FName("CrashTracker") ); bool bCrashTrackerEnabled = false; if (CrashTracker) { CrashTracker->Update(DeltaSeconds); bCrashTrackerEnabled = CrashTracker->IsCurrentlyCapturing(); } // Only allow live streaming if crash tracker is disabled. This is because the SlateRHIRenderer shares the same render targets // for both crash tracker and live editor streaming, and we don't want them to be thrashed every frame. if( !bCrashTrackerEnabled ) { // If the editor is configured to broadcast frames, do that now if( IEditorLiveStreaming::Get().IsBroadcastingEditor() ) { IEditorLiveStreaming::Get().BroadcastEditorVideoFrame(); } } }