ue-mcp 0.4.25 → 0.4.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ue-mcp",
3
- "version": "0.4.25",
3
+ "version": "0.4.26",
4
4
  "description": "Unreal Engine MCP server — 19 tools, 300+ actions for AI-driven editor control",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  #include "GameThreadExecutor.h"
2
2
  #include "HAL/PlatformProcess.h"
3
- #include "Async/Async.h"
3
+ #include "Containers/Ticker.h"
4
4
 
5
5
  FMCPGameThreadExecutor::FMCPGameThreadExecutor()
6
6
  {
@@ -23,27 +23,32 @@ TSharedPtr<FJsonValue> FMCPGameThreadExecutor::ExecuteOnGameThread(FHandlerFunct
23
23
  return Handler(Params);
24
24
  }
25
25
 
26
- // Execute on game thread via AsyncTask
27
- TSharedPtr<TFuture<TSharedPtr<FJsonValue>>> Future = MakeShared<TFuture<TSharedPtr<FJsonValue>>>(
28
- Async(EAsyncExecution::TaskGraphMainThread, [Handler, Params]() -> TSharedPtr<FJsonValue>
26
+ // Use FTSTicker to run on the game thread tick loop (NOT inside TaskGraph).
27
+ // This avoids the TaskGraph recursion assertion when handlers trigger
28
+ // subsystems like InterchangeEngine that schedule their own TaskGraph work.
29
+ TSharedPtr<FJsonValue> Result;
30
+ FEvent* DoneEvent = FPlatformProcess::GetSynchEventFromPool();
31
+
32
+ FTSTicker::GetCoreTicker().AddTicker(
33
+ FTickerDelegate::CreateLambda([&Result, &Handler, &Params, DoneEvent](float) -> bool
29
34
  {
30
- return Handler(Params);
35
+ Result = Handler(Params);
36
+ DoneEvent->Trigger();
37
+ return false; // one-shot — do not re-tick
31
38
  })
32
39
  );
33
40
 
34
- // Wait for result with timeout
35
- double StartTime = FPlatformTime::Seconds();
36
- while (!Future->IsReady())
41
+ // Block calling thread until the ticker fires or timeout
42
+ uint32 TimeoutMs = static_cast<uint32>(TimeoutSeconds * 1000.0f);
43
+ bool bCompleted = DoneEvent->Wait(TimeoutMs);
44
+ FPlatformProcess::ReturnSynchEventToPool(DoneEvent);
45
+
46
+ if (!bCompleted)
37
47
  {
38
- if (FPlatformTime::Seconds() - StartTime > TimeoutSeconds)
39
- {
40
- // Timeout
41
- TSharedPtr<FJsonObject> ErrorObject = MakeShared<FJsonObject>();
42
- ErrorObject->SetStringField(TEXT("error"), TEXT("Handler execution timed out"));
43
- return MakeShared<FJsonValueObject>(ErrorObject);
44
- }
45
- FPlatformProcess::Sleep(0.01f); // 10ms sleep
48
+ TSharedPtr<FJsonObject> ErrorObject = MakeShared<FJsonObject>();
49
+ ErrorObject->SetStringField(TEXT("error"), TEXT("Handler execution timed out"));
50
+ return MakeShared<FJsonValueObject>(ErrorObject);
46
51
  }
47
52
 
48
- return Future->Get();
53
+ return Result;
49
54
  }
@@ -3,7 +3,6 @@
3
3
  #include "CoreMinimal.h"
4
4
  #include "Dom/JsonValue.h"
5
5
  #include "Dom/JsonObject.h"
6
- #include "Async/Async.h"
7
6
  #include "HAL/PlatformProcess.h"
8
7
 
9
8
  class FMCPGameThreadExecutor