mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
EventHandler: Include required event intent in emit
This commit is contained in:
parent
78f9c93739
commit
f37edbd71c
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user