Version: SimConnect SDK 1.6.9
Frequency: Consistently
Severity: Low
Marketplace package name: N/A
Context: SimConnect Communication API
Similar MSFS 2020 issue: N/A
Bug description:
The SimConnect_SubscribeToCommBusEvent call lets you specify a CommBus Event name, and map it to a SIMCONNECT_CLIENT_EVENT_ID. This Id is then used in the (incoming) SIMCONNECT_RECV_COMM_BUS::uEventID field to identify to the client which event is incoming. However, the Client Event Id appears to be unregistered as such in SimConnect; I can use that same id in a call to SimConnect_MapClientEventToSimEvent without getting a SIMCONNECT_EXCEPTION_EVENT_ID_DUPLICATE.
I am a bit confused about this, as the type indicates this should clash.
Repro steps:
std::cout << "\n--- Test A: CommBus subscribe first, then map same ID as client->sim event ---\n";
SimConnect_SubscribeToCommBusEvent(hSimConnect, ID_COMMBUS_FIRST, "Sandbox.Test.CommBusEvent");
SimConnect_MapClientEventToSimEvent(hSimConnect, ID_COMMBUS_FIRST, "Exit.Program");
pumpMessages(2s);
std::cout << "\n--- Test B: map client->sim event first, then CommBus subscribe same ID ---\n";
SimConnect_MapClientEventToSimEvent(hSimConnect, ID_EVENT_FIRST, "Exit.Program");
SimConnect_SubscribeToCommBusEvent(hSimConnect, ID_EVENT_FIRST, "Sandbox.Test.CommBusEvent2");
pumpMessages(2s);
The pumpMessages function simply handles all incoming messages for the given duration. For both I would expect the exception message, but in neither case I get one.
Attachments:
Private attachments: