Minor cleanups
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "UObject/StrongObjectPtr.h"
|
||||
#include "AssetRegistry/AssetRegistryModule.h"
|
||||
#include "AssetRegistry/IAssetRegistry.h"
|
||||
#include "Misc/OutputDeviceRedirector.h"
|
||||
#include "Serialization/JsonReader.h"
|
||||
#include "Serialization/JsonSerializer.h"
|
||||
#include "SocketSubsystem.h"
|
||||
@@ -57,7 +58,7 @@ void UWingServer::Initialize(FSubsystemCollectionBase& Collection)
|
||||
BuildWingHandlerRegistry();
|
||||
ModulesChangedHandle = FModuleManager::Get().OnModulesChanged().AddUObject(this, &UWingServer::OnModulesChanged);
|
||||
LogCapture.bEnabled = false;
|
||||
LogCapture.Install();
|
||||
GLog->AddOutputDevice(&LogCapture);
|
||||
bRunning = true;
|
||||
UE_LOG(LogTemp, Display, TEXT("UEWingman: MCP server listening on tcp://localhost:%d"), Port);
|
||||
}
|
||||
@@ -113,7 +114,7 @@ void UWingServer::Deinitialize()
|
||||
ListenSocket = nullptr;
|
||||
}
|
||||
|
||||
LogCapture.Uninstall();
|
||||
GLog->RemoveOutputDevice(&LogCapture);
|
||||
bRunning = false;
|
||||
bShuttingDown = false;
|
||||
GWingServer = nullptr;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Misc/OutputDeviceRedirector.h"
|
||||
#include "Misc/OutputDevice.h"
|
||||
|
||||
class FLogCaptureOutputDevice : public FOutputDevice
|
||||
{
|
||||
@@ -9,9 +9,6 @@ public:
|
||||
TArray<FString> CapturedErrors;
|
||||
bool bEnabled = false;
|
||||
|
||||
void Install() { GLog->AddOutputDevice(this); }
|
||||
void Uninstall() { GLog->RemoveOutputDevice(this); }
|
||||
|
||||
// If the device is marked 'CanBeUsedOnMultipleThreads,'
|
||||
// then UE_LOG will call Serialize from the current
|
||||
// thread, otherwise, it will call Serialize from the
|
||||
|
||||
@@ -18,7 +18,7 @@ class FSocket;
|
||||
*
|
||||
* Clients connect via TCP and exchange null-delimited JSON messages.
|
||||
* Request format: {"command": "tool_name", "param1": "value1", ...}
|
||||
* Response format: raw JSON result from the handler.
|
||||
* Response format: Text.
|
||||
*
|
||||
* Each connected client gets its own thread for blocking I/O;
|
||||
* tool calls are dispatched on the game thread.
|
||||
|
||||
Reference in New Issue
Block a user