EventHandler: Include required event intent in emit

This commit is contained in:
tt2468 2021-08-30 01:39:46 -07:00
parent 78f9c93739
commit f37edbd71c
2 changed files with 4 additions and 0 deletions

View File

@ -460,9 +460,11 @@ Authentication is not required
```
{
"eventType": string,
"eventIntent": number,
"eventData": object(optional)
}
```
- `eventIntent` is the original intent required to be subscribed to in order to receive the event.
**Example Message:**
```json
@ -470,6 +472,7 @@ Authentication is not required
"op": 2,
"d": {
"eventType": "StudioModeStateChanged",
"eventIntent": 1,
"eventData": {
"studioModeEnabled": true
}

View File

@ -199,6 +199,7 @@ void WebSocketServer::BroadcastEvent(uint64_t requiredIntent, std::string eventT
json eventMessage;
eventMessage["op"] = 5;
eventMessage["d"]["eventType"] = eventType;
eventMessage["d"]["eventIntent"] = requiredIntent;
if (eventData.is_object())
eventMessage["d"]["eventData"] = eventData;