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

View File

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