From 3cf984ff658c37dbe92948bca49fda2c28e5193b Mon Sep 17 00:00:00 2001 From: jyelon Date: Mon, 4 May 2026 16:11:06 -0400 Subject: [PATCH] Fewer log messages from UE Wingman --- .../UEWingman/Source/UEWingman/Private/WingServer.cpp | 11 +++-------- .../UEWingman/Source/UEWingman/Public/WingServer.h | 3 +-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Plugins/UEWingman/Source/UEWingman/Private/WingServer.cpp b/Plugins/UEWingman/Source/UEWingman/Private/WingServer.cpp index 9a5a582a..2e630235 100644 --- a/Plugins/UEWingman/Source/UEWingman/Private/WingServer.cpp +++ b/Plugins/UEWingman/Source/UEWingman/Private/WingServer.cpp @@ -4,6 +4,7 @@ #include "UObject/StrongObjectPtr.h" #include "AssetRegistry/AssetRegistryModule.h" #include "AssetRegistry/IAssetRegistry.h" +#include "Misc/CoreDelegates.h" #include "Misc/OutputDeviceRedirector.h" #include "Serialization/JsonReader.h" #include "Serialization/JsonSerializer.h" @@ -55,8 +56,7 @@ void UWingServer::Initialize(FSubsystemCollectionBase& Collection) return; } - BuildWingHandlerRegistry(); - ModulesChangedHandle = FModuleManager::Get().OnModulesChanged().AddUObject(this, &UWingServer::OnModulesChanged); + LoadingPhasesCompleteHandle = FCoreDelegates::OnAllModuleLoadingPhasesComplete.AddUObject(this, &UWingServer::BuildWingHandlerRegistry); LogCapture.bEnabled = false; GLog->AddOutputDevice(&LogCapture); bRunning = true; @@ -65,7 +65,7 @@ void UWingServer::Initialize(FSubsystemCollectionBase& Collection) void UWingServer::Deinitialize() { - FModuleManager::Get().OnModulesChanged().Remove(ModulesChangedHandle); + FCoreDelegates::OnAllModuleLoadingPhasesComplete.Remove(LoadingPhasesCompleteHandle); if (!bRunning) { @@ -534,11 +534,6 @@ void UWingServer::BuildWingHandlerRegistry() WingHandlerRegistry.Sort([](const FWingHandlerConfig& A, const FWingHandlerConfig& B) { return A.Name < B.Name; }); } -void UWingServer::OnModulesChanged(FName ModuleName, EModuleChangeReason Reason) -{ - BuildWingHandlerRegistry(); -} - FWingHandlerConfig* UWingServer::FindHandler(const FString& Name) { int32 Index = Algo::LowerBoundBy(WingHandlerRegistry, Name, [](const FWingHandlerConfig& H) { return H.Name; }); diff --git a/Plugins/UEWingman/Source/UEWingman/Public/WingServer.h b/Plugins/UEWingman/Source/UEWingman/Public/WingServer.h index bdcad4ef..938e213c 100644 --- a/Plugins/UEWingman/Source/UEWingman/Public/WingServer.h +++ b/Plugins/UEWingman/Source/UEWingman/Public/WingServer.h @@ -76,8 +76,7 @@ private: FLogCaptureOutputDevice LogCapture; // installed once at startup, enabled per-request TArray WingHandlerRegistry; // sorted by Name void BuildWingHandlerRegistry(); - void OnModulesChanged(FName ModuleName, EModuleChangeReason Reason); - FDelegateHandle ModulesChangedHandle; + FDelegateHandle LoadingPhasesCompleteHandle; FWingHandlerConfig* FindHandler(const FString& Name); // Handle a complete JSON line and return the response JSON