ultimate-unreal-engine-mcp 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +729 -0
- package/dist/build/error-parser.js +51 -0
- package/dist/build/fix-suggester.js +84 -0
- package/dist/build/ubt-runner.js +146 -0
- package/dist/cli.js +13 -0
- package/dist/config.js +8 -0
- package/dist/docs/data/ue57-api.js +228 -0
- package/dist/docs/doc-index.js +110 -0
- package/dist/docs/types.js +4 -0
- package/dist/generators/class-generator.js +363 -0
- package/dist/generators/file-modifier.js +276 -0
- package/dist/generators/uht-validator.js +177 -0
- package/dist/index.js +89 -0
- package/dist/parsers/cpp-class-index.js +230 -0
- package/dist/parsers/cpp-parser.js +369 -0
- package/dist/parsers/ini-parser.js +216 -0
- package/dist/parsers/uproject-parser.js +130 -0
- package/dist/plugin-bridge/client.js +217 -0
- package/dist/plugin-bridge/protocol.js +6 -0
- package/dist/plugin-bridge/retry.js +23 -0
- package/dist/setup.js +209 -0
- package/dist/tools/ai-systems/index.js +247 -0
- package/dist/tools/ai-systems/types.js +4 -0
- package/dist/tools/animation/index.js +241 -0
- package/dist/tools/animation/types.js +4 -0
- package/dist/tools/audio/index.js +204 -0
- package/dist/tools/audio/types.js +4 -0
- package/dist/tools/blueprint/index.js +495 -0
- package/dist/tools/blueprint/types.js +4 -0
- package/dist/tools/build/index.js +163 -0
- package/dist/tools/chaos/index.js +230 -0
- package/dist/tools/chaos/types.js +4 -0
- package/dist/tools/collision-physics/index.js +211 -0
- package/dist/tools/config/index.js +288 -0
- package/dist/tools/cpp/index.js +305 -0
- package/dist/tools/docs/index.js +251 -0
- package/dist/tools/editor/index.js +242 -0
- package/dist/tools/gas/index.js +222 -0
- package/dist/tools/gas/types.js +5 -0
- package/dist/tools/import-export/index.js +218 -0
- package/dist/tools/input/index.js +146 -0
- package/dist/tools/known-issues/index.js +88 -0
- package/dist/tools/known-issues/middleware.js +55 -0
- package/dist/tools/known-issues/store.js +125 -0
- package/dist/tools/livelink/index.js +203 -0
- package/dist/tools/livelink/types.js +4 -0
- package/dist/tools/material/index.js +190 -0
- package/dist/tools/motion-design/index.js +251 -0
- package/dist/tools/motion-design/types.js +6 -0
- package/dist/tools/movie-render/index.js +220 -0
- package/dist/tools/networking/index.js +149 -0
- package/dist/tools/pcg/index.js +164 -0
- package/dist/tools/selection/index.js +180 -0
- package/dist/tools/sequencer/index.js +218 -0
- package/dist/tools/validation/index.js +183 -0
- package/dist/tools/validation/types.js +4 -0
- package/dist/tools/viewport/index.js +310 -0
- package/dist/tools/worldpartition/index.js +226 -0
- package/dist/tools/worldpartition/types.js +4 -0
- package/dist/utils/execFileNoThrow.js +40 -0
- package/dist/utils/logger.js +27 -0
- package/dist/utils/path-guard.js +26 -0
- package/package.json +40 -0
- package/unreal-plugin/MCPBridge/MCPBridge.uplugin +29 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/MCPBridgeEditor.Build.cs +68 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPAICommands.cpp +919 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPAICommands.h +23 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPActorCommands.cpp +415 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPActorCommands.h +16 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPAnimationCommands.cpp +653 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPAnimationCommands.h +24 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPAssetCommands.cpp +290 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPAssetCommands.h +17 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPAudioCommands.cpp +624 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPAudioCommands.h +22 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPBlueprintHandlers.cpp +616 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPBlueprintHandlers.h +25 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPBlueprintWriteHandlers.cpp +744 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPBlueprintWriteHandlers.h +24 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPBridgeEditor.cpp +23 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPBridgeSubsystem.cpp +149 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPBridgeSubsystem.h +38 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPChaosCommands.cpp +771 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPChaosCommands.h +22 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPCollisionPhysicsCommands.cpp +749 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPCollisionPhysicsCommands.h +22 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPEditorStateCommands.cpp +172 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPEditorStateCommands.h +16 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPGASCommands.cpp +715 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPGASCommands.h +22 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPImportExportCommands.cpp +679 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPImportExportCommands.h +22 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPInputHandlers.cpp +381 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPInputHandlers.h +24 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPLiveLinkCommands.cpp +504 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPLiveLinkCommands.h +22 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPMaterialCommands.cpp +511 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPMaterialCommands.h +22 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPMotionDesignCommands.cpp +1110 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPMotionDesignCommands.h +28 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPMovieRenderCommands.cpp +590 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPMovieRenderCommands.h +16 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPNetworkingCommands.cpp +482 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPNetworkingCommands.h +16 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPPieCommands.cpp +338 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPPieCommands.h +16 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPSelectionCommands.cpp +677 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPSelectionCommands.h +22 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPSequencerCommands.cpp +721 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPSequencerCommands.h +16 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPValidationCommands.cpp +368 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPValidationCommands.h +22 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPViewportCommands.cpp +1208 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPViewportCommands.h +29 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPWorldPartitionCommands.cpp +822 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Private/MCPWorldPartitionCommands.h +23 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeEditor/Public/MCPBridgeEditor.h +14 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeRuntime/MCPBridgeRuntime.Build.cs +28 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeRuntime/Private/MCPBridgeRuntime.cpp +22 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeRuntime/Private/MCPCommandRouter.cpp +118 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeRuntime/Private/MCPTcpServer.cpp +196 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeRuntime/Public/MCPBridgeRuntime.h +15 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeRuntime/Public/MCPCommandRouter.h +55 -0
- package/unreal-plugin/MCPBridge/Source/MCPBridgeRuntime/Public/MCPTcpServer.h +59 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// MCPBlueprintWriteHandlers.h
|
|
2
|
+
// Declares the Blueprint write command handler registration function.
|
|
3
|
+
// Call RegisterBlueprintWriteHandlers() from UMCPBridgeSubsystem::Initialize()
|
|
4
|
+
// after the router is created.
|
|
5
|
+
//
|
|
6
|
+
// Handlers: blueprint.create, blueprint.addNode, blueprint.connectPins,
|
|
7
|
+
// blueprint.addVariable, blueprint.setDefault
|
|
8
|
+
//
|
|
9
|
+
// IMPORTANT: Every handler calls Object->Modify() before any mutation and
|
|
10
|
+
// FBlueprintEditorUtils::MarkBlueprintAsModified() after -- never skip these.
|
|
11
|
+
|
|
12
|
+
#pragma once
|
|
13
|
+
|
|
14
|
+
#include "CoreMinimal.h"
|
|
15
|
+
|
|
16
|
+
class FMCPCommandRouter;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Register blueprint.create, blueprint.addNode, blueprint.connectPins,
|
|
20
|
+
* blueprint.addVariable, and blueprint.setDefault handlers on the given router.
|
|
21
|
+
* All handlers run on the game thread (enforced by FMCPCommandRouter::Dispatch
|
|
22
|
+
* via AsyncTask).
|
|
23
|
+
*/
|
|
24
|
+
void RegisterBlueprintWriteHandlers(FMCPCommandRouter& Router);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// MCPBridgeEditor.cpp
|
|
2
|
+
// Editor module startup/shutdown.
|
|
3
|
+
// UMCPBridgeSubsystem (UEditorSubsystem) manages TCP server lifecycle
|
|
4
|
+
// and is initialized automatically by the subsystem framework after
|
|
5
|
+
// PostEngineInit -- do not manually start the TCP server here.
|
|
6
|
+
|
|
7
|
+
#include "MCPBridgeEditor.h"
|
|
8
|
+
|
|
9
|
+
#define LOCTEXT_NAMESPACE "FMCPBridgeEditorModule"
|
|
10
|
+
|
|
11
|
+
void FMCPBridgeEditorModule::StartupModule()
|
|
12
|
+
{
|
|
13
|
+
// UMCPBridgeSubsystem::Initialize() handles TCP server startup.
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
void FMCPBridgeEditorModule::ShutdownModule()
|
|
17
|
+
{
|
|
18
|
+
// UMCPBridgeSubsystem::Deinitialize() handles TCP server shutdown.
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
#undef LOCTEXT_NAMESPACE
|
|
22
|
+
|
|
23
|
+
IMPLEMENT_MODULE(FMCPBridgeEditorModule, MCPBridgeEditor)
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
// MCPBridgeSubsystem.cpp (updated by Plans 07-02, 08-01, 09-01, 09-02, 10-01, 12-01, 12-02, 13-01, 17-01, 18-01, 19-01, 20-01, 21-01, 22-01, 23-01, 25-01, 26-01, 27-01, 28-01, 29-01, 30-01)
|
|
2
|
+
// Wires FMCPCommandRouter and FMCPTcpServer into the editor subsystem lifecycle.
|
|
3
|
+
|
|
4
|
+
#include "MCPBridgeSubsystem.h"
|
|
5
|
+
#include "MCPBlueprintHandlers.h"
|
|
6
|
+
#include "MCPActorCommands.h"
|
|
7
|
+
#include "MCPAssetCommands.h"
|
|
8
|
+
#include "MCPBlueprintWriteHandlers.h"
|
|
9
|
+
#include "MCPEditorStateCommands.h"
|
|
10
|
+
#include "MCPPieCommands.h"
|
|
11
|
+
#include "MCPViewportCommands.h"
|
|
12
|
+
#include "MCPValidationCommands.h"
|
|
13
|
+
#include "MCPInputHandlers.h"
|
|
14
|
+
#include "MCPMaterialCommands.h"
|
|
15
|
+
#include "MCPSequencerCommands.h"
|
|
16
|
+
#include "MCPAnimationCommands.h"
|
|
17
|
+
#include "MCPWorldPartitionCommands.h"
|
|
18
|
+
#include "MCPAICommands.h"
|
|
19
|
+
#include "MCPSelectionCommands.h"
|
|
20
|
+
#include "MCPCollisionPhysicsCommands.h"
|
|
21
|
+
#include "MCPImportExportCommands.h"
|
|
22
|
+
#include "MCPMotionDesignCommands.h"
|
|
23
|
+
#include "MCPChaosCommands.h"
|
|
24
|
+
#include "MCPAudioCommands.h"
|
|
25
|
+
#include "MCPGASCommands.h"
|
|
26
|
+
#include "MCPLiveLinkCommands.h"
|
|
27
|
+
#include "MCPMovieRenderCommands.h"
|
|
28
|
+
#include "MCPNetworkingCommands.h"
|
|
29
|
+
#include "Misc/ConfigCacheIni.h"
|
|
30
|
+
|
|
31
|
+
void UMCPBridgeSubsystem::Initialize(FSubsystemCollectionBase& Collection)
|
|
32
|
+
{
|
|
33
|
+
Super::Initialize(Collection);
|
|
34
|
+
|
|
35
|
+
const int32 Port = GetConfiguredPort();
|
|
36
|
+
|
|
37
|
+
// Create the router (registers built-in ping handler in constructor).
|
|
38
|
+
Router = MakeUnique<FMCPCommandRouter>();
|
|
39
|
+
|
|
40
|
+
// Register Blueprint command handlers (blueprint.read, blueprint.graph, blueprint.list).
|
|
41
|
+
RegisterBlueprintHandlers(*Router);
|
|
42
|
+
|
|
43
|
+
// Register Blueprint-C++ bridge handlers (blueprint.subclasses, blueprint.cppUsage).
|
|
44
|
+
RegisterBlueprintBridgeHandlers(*Router);
|
|
45
|
+
|
|
46
|
+
// Register Actor command handlers (actor.list, actor.spawn, actor.transform, actor.delete).
|
|
47
|
+
RegisterActorCommands(*Router);
|
|
48
|
+
|
|
49
|
+
// Register Asset/Level command handlers (asset.query, asset.references, level.layout).
|
|
50
|
+
RegisterAssetCommands(*Router);
|
|
51
|
+
|
|
52
|
+
// Register Blueprint write command handlers (blueprint.create, addNode, connectPins, addVariable, setDefault).
|
|
53
|
+
RegisterBlueprintWriteHandlers(*Router);
|
|
54
|
+
|
|
55
|
+
// Register Editor State command handlers (editor.state).
|
|
56
|
+
RegisterEditorStateCommands(*Router);
|
|
57
|
+
|
|
58
|
+
// Register PIE command handlers (pie.start, pie.stop, pie.logs, pie.gameState).
|
|
59
|
+
RegisterPieCommands(*Router);
|
|
60
|
+
|
|
61
|
+
// Register Viewport command handlers (viewport.screenshot, viewport.camera, viewport.renderMode, viewport.hiresScreenshot).
|
|
62
|
+
RegisterViewportCommands(*Router);
|
|
63
|
+
|
|
64
|
+
// Register validation command handlers (validate.asset, validate.folder, validate.project, validate.blueprint).
|
|
65
|
+
RegisterValidationCommands(*Router);
|
|
66
|
+
|
|
67
|
+
// Register Enhanced Input command handlers (input.listActions, input.createAction, input.listContexts, input.addBinding).
|
|
68
|
+
RegisterInputHandlers(*Router);
|
|
69
|
+
|
|
70
|
+
// Register Material command handlers (material.params, material.createInstance, material.setParam, material.actorMaterials).
|
|
71
|
+
RegisterMaterialCommands(*Router);
|
|
72
|
+
|
|
73
|
+
// Register Sequencer command handlers (sequencer.create, tracks, addTrack, addKey, playback).
|
|
74
|
+
RegisterSequencerCommands(*Router);
|
|
75
|
+
|
|
76
|
+
// Register Animation command handlers (animation.list, inspectAnimBP, inspectMontage, inspectBlendSpace, retargetMappings).
|
|
77
|
+
RegisterAnimationCommands(*Router);
|
|
78
|
+
|
|
79
|
+
// Register World Partition command handlers (worldpartition.settings, dataLayers, streamingSources, hlod).
|
|
80
|
+
RegisterWorldPartitionCommands(*Router);
|
|
81
|
+
|
|
82
|
+
// Register AI system command handlers (ai.behaviorTree, ai.stateTree, ai.blackboard, ai.eqs, ai.navmesh).
|
|
83
|
+
RegisterAICommands(*Router);
|
|
84
|
+
|
|
85
|
+
// Register Selection command handlers (selection.select, selection.get, selection.duplicate, selection.convert).
|
|
86
|
+
RegisterSelectionCommands(*Router);
|
|
87
|
+
|
|
88
|
+
// Register Collision & Physics command handlers (collision.read, collision.set, physics.material, physics.asset).
|
|
89
|
+
RegisterCollisionPhysicsCommands(*Router);
|
|
90
|
+
|
|
91
|
+
// Register Import/Export command handlers (import.fbx, import.usd, export.mesh, import.batch).
|
|
92
|
+
RegisterImportExportCommands(*Router);
|
|
93
|
+
|
|
94
|
+
// Register Motion Design command handlers (motiondesign.sceneStates, transition, transitionLogic, remoteControl).
|
|
95
|
+
RegisterMotionDesignCommands(*Router);
|
|
96
|
+
|
|
97
|
+
// Register Chaos physics command handlers (chaos.geometryCollection, chaos.resetDestruction, chaos.cloth, chaos.physicsCache).
|
|
98
|
+
RegisterChaosCommands(*Router);
|
|
99
|
+
|
|
100
|
+
// Register Audio command handlers (audio.list, audio.metasound, audio.soundcue, audio.insights).
|
|
101
|
+
RegisterAudioCommands(*Router);
|
|
102
|
+
|
|
103
|
+
// Register GAS command handlers (gas.abilities, gas.effects, gas.attributes, gas.tags).
|
|
104
|
+
RegisterGASCommands(*Router);
|
|
105
|
+
|
|
106
|
+
// Register Live Link command handlers (livelink.sources, livelink.subjects, livelink.control, livelink.preview).
|
|
107
|
+
RegisterLiveLinkCommands(*Router);
|
|
108
|
+
|
|
109
|
+
// Register Movie Render Pipeline command handlers (movierender.queue, movierender.addJob, movierender.control, movierender.configure).
|
|
110
|
+
RegisterMovieRenderCommands(*Router);
|
|
111
|
+
|
|
112
|
+
// Register Networking command handlers (net.replication, net.properties, net.driver, net.session).
|
|
113
|
+
RegisterNetworkingCommands(*Router);
|
|
114
|
+
|
|
115
|
+
// Create and start the TCP server.
|
|
116
|
+
TcpServer = MakeUnique<FMCPTcpServer>(*Router);
|
|
117
|
+
bServerRunning = TcpServer->Start(Port);
|
|
118
|
+
|
|
119
|
+
if (!bServerRunning)
|
|
120
|
+
{
|
|
121
|
+
UE_LOG(LogTemp, Error, TEXT("[MCPBridge] Failed to start TCP server on port %d."), Port);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
void UMCPBridgeSubsystem::Deinitialize()
|
|
126
|
+
{
|
|
127
|
+
if (TcpServer.IsValid())
|
|
128
|
+
{
|
|
129
|
+
TcpServer->Stop();
|
|
130
|
+
TcpServer.Reset();
|
|
131
|
+
}
|
|
132
|
+
if (Router.IsValid())
|
|
133
|
+
{
|
|
134
|
+
Router.Reset();
|
|
135
|
+
}
|
|
136
|
+
bServerRunning = false;
|
|
137
|
+
|
|
138
|
+
Super::Deinitialize();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
int32 UMCPBridgeSubsystem::GetConfiguredPort() const
|
|
142
|
+
{
|
|
143
|
+
int32 Port = 55557;
|
|
144
|
+
if (GConfig)
|
|
145
|
+
{
|
|
146
|
+
GConfig->GetInt(TEXT("MCPBridge"), TEXT("Port"), Port, GEngineIni);
|
|
147
|
+
}
|
|
148
|
+
return Port;
|
|
149
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// MCPBridgeSubsystem.h (updated by Plan 07-02)
|
|
2
|
+
// UEditorSubsystem that owns the TCP server lifecycle.
|
|
3
|
+
// Initialize() creates the router, starts the server.
|
|
4
|
+
// Deinitialize() stops the server and resets owners.
|
|
5
|
+
//
|
|
6
|
+
// Port is read from engine config key [MCPBridge] Port= (default: 55557).
|
|
7
|
+
// Bind address is always 127.0.0.1 -- never 0.0.0.0.
|
|
8
|
+
|
|
9
|
+
#pragma once
|
|
10
|
+
|
|
11
|
+
#include "CoreMinimal.h"
|
|
12
|
+
#include "EditorSubsystem.h"
|
|
13
|
+
#include "MCPTcpServer.h"
|
|
14
|
+
#include "MCPCommandRouter.h"
|
|
15
|
+
#include "MCPBridgeSubsystem.generated.h"
|
|
16
|
+
|
|
17
|
+
UCLASS()
|
|
18
|
+
class UMCPBridgeSubsystem : public UEditorSubsystem
|
|
19
|
+
{
|
|
20
|
+
GENERATED_BODY()
|
|
21
|
+
|
|
22
|
+
public:
|
|
23
|
+
virtual void Initialize(FSubsystemCollectionBase& Collection) override;
|
|
24
|
+
virtual void Deinitialize() override;
|
|
25
|
+
|
|
26
|
+
private:
|
|
27
|
+
/** Read port from [MCPBridge] Port= in engine config, fallback to 55557. */
|
|
28
|
+
int32 GetConfiguredPort() const;
|
|
29
|
+
|
|
30
|
+
/** Command router -- registers built-in ping handler on construction. */
|
|
31
|
+
TUniquePtr<FMCPCommandRouter> Router;
|
|
32
|
+
|
|
33
|
+
/** TCP server -- bound to 127.0.0.1:Port, ticks at 20 Hz via FTSTicker. */
|
|
34
|
+
TUniquePtr<FMCPTcpServer> TcpServer;
|
|
35
|
+
|
|
36
|
+
/** True while the TCP server is running. */
|
|
37
|
+
bool bServerRunning = false;
|
|
38
|
+
};
|