Version: SU_XX (MSFS 2024 ā 1.6.19.0)
Frequency: Consistently
Severity: Blocker
Context: WASM module loaded from Community folder
Bug description:
- Module type: Custom WASM (standalone module)
- Loaded from: Community
- Tested both in main menu and in flight
- Function triggered via
fsCommBusRegisterfrom a JavaScript UI - Purpose: Retrieve list of available aircraft and liveries
When calling:
SimConnect_EnumerateSimObjectsAndLiveries(g_hSimConnect, REQUEST_ENUMERATE, SIMCONNECT_SIMOBJECT_TYPE_AIRCRAFT);
from a WASM module, the call fails and triggers:
SimConnect Exception 44 (Cannot find any matching simobject category)
even though valid aircraft are available in the sim.
This same code works perfectly when run from a standalone SimConnect client (native EXE), so the issue might be specific to the WASM sandbox environment ā or perhaps I am doing something incorrectly in the WASM setup.
Iām not sure if this is an SDK/WASM limitation or a bug, but Iād appreciate any confirmation or clarification.
**
Repro steps:
**
Build and load the minimal WASM module below.
- Start MSFS 2024 and load any flight.
- Watch the WASM console or SimConnect Inspector.
Minimal Repro Code:
#include <stdio.h>
#include <MSFS/MSFS.h>
#include <MSFS/MSFS_WindowsTypes.h>
#include <MSFS/MSFS_CommBus.h>
#include <SimConnect.h>
static HANDLE g_hSimConnect = 0;
enum REQUEST_ID { REQUEST_ENUMERATE = 1 };
void CALLBACK SimConnectDispatchProc(SIMCONNECT_RECV* pData, DWORD cbData, void* pContext) {
switch (pData->dwID) {
case SIMCONNECT_RECV_ID_ENUMERATE_SIMOBJECT_AND_LIVERY_LIST: {
auto* pEnum = (SIMCONNECT_RECV_ENUMERATE_SIMOBJECT_AND_LIVERY_LIST*)pData;
printf("RequestID=%lu, page %lu/%lu with %lu entries\n",
(unsigned long)pEnum->dwRequestID,
(unsigned long)(pEnum->dwEntryNumber + 1),
(unsigned long)pEnum->dwOutOf,
(unsigned long)pEnum->dwArraySize);
break;
}
}
}
static void EnumerateSimObjectsFromJS(const char* args, unsigned int size, void* ctx) {
if (g_hSimConnect == 0)
SimConnect_Open(&g_hSimConnect, "EnumTest", (HWND)0, 0, 0, 0);
SimConnect_EnumerateSimObjectsAndLiveries(
g_hSimConnect,
REQUEST_ENUMERATE,
SIMCONNECT_SIMOBJECT_TYPE_AIRCRAFT
);
}
extern "C" MSFS_CALLBACK void module_init(void) {
fsCommBusRegister("EnumerateSimObjects", EnumerateSimObjectsFromJS, nullptr);
}
extern "C" MSFS_CALLBACK void Update_StandAlone(float dTime) {
if (g_hSimConnect != 0)
SimConnect_CallDispatch(g_hSimConnect, SimConnectDispatchProc, nullptr);
}
extern "C" MSFS_CALLBACK void module_deinit(void) {
if (g_hSimConnect != 0)
SimConnect_Close(g_hSimConnect);
}
Console Output:
[WASM_SpawnWorldObject.wasm] [SpawnModule] Starting SimObjects enumeration...
[WASM_SpawnWorldObject.wasm] [SpawnModule] Enumeration request sent with RequestID=1
[WASM_SpawnWorldObject.wasm] [SpawnModule] Dispatch received: dwID=1, dwSize=24
[WASM_SpawnWorldObject.wasm] [SpawnModule] SimConnect Exception: 44 (SendID: 2)
SimConnect Inspector:
EnumerateSimObjectsAndLiveries: ID = 1 Type=-1750743312 EXCEPTION Cannot find any matching simobject category
Works fine from an external SimConnect EXE.
- Always fails from WASM.
- Possibly due to a sandbox or context limitation.
- Might also be a usage mistake on my side ā Iād appreciate any insight or confirmation from the SDK team.