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