diff --git a/PROTOCOL.md b/PROTOCOL.md
index 5b94a404..81169e5a 100644
--- a/PROTOCOL.md
+++ b/PROTOCOL.md
@@ -342,6 +342,7 @@ __Response__ : always OK, with these additional fields :
- **"version"** (double) : OBSRemote API version. Fixed to 1.1 for retrocompatibility.
- **"obs-websocket-version"** (string) : obs-websocket version string
- **"obs-studio-version"** (string) : OBS Studio version string
+- **"available-requests"** (string) : comma-separated list of available request types
---
diff --git a/WSRequestHandler.cpp b/WSRequestHandler.cpp
index e7f5b9ec..f31c1fd1 100644
--- a/WSRequestHandler.cpp
+++ b/WSRequestHandler.cpp
@@ -18,12 +18,16 @@ with this program. If not, see
*/
#include
-#include "WSRequestHandler.h"
+
+#include
+#include
+
#include "WSEvents.h"
#include "obs-websocket.h"
#include "Config.h"
#include "Utils.h"
-#include
+
+#include "WSRequestHandler.h"
bool str_valid(const char* str) {
return (str != nullptr && strlen(str) > 0);
@@ -192,13 +196,21 @@ bool WSRequestHandler::hasField(const char* name) {
void WSRequestHandler::HandleGetVersion(WSRequestHandler* req) {
const char* obs_version = Utils::OBSVersionString();
+ QList names = req->messageMap.keys();
+ names.sort(Qt::CaseInsensitive);
+ QString requests;
+ requests += names.takeFirst();
+ for (QString reqName : names) {
+ requests += ("," + reqName);
+ }
+
obs_data_t* data = obs_data_create();
obs_data_set_double(data, "version", API_VERSION);
obs_data_set_string(data, "obs-websocket-version", OBS_WEBSOCKET_VERSION);
obs_data_set_string(data, "obs-studio-version", obs_version);
+ obs_data_set_string(data, "available-requests", requests.toUtf8().constData());
req->SendOKResponse(data);
-
obs_data_release(data);
bfree((void*)obs_version);
}
diff --git a/WSRequestHandler.h b/WSRequestHandler.h
index 64c66ef4..d51bbb74 100644
--- a/WSRequestHandler.h
+++ b/WSRequestHandler.h
@@ -20,6 +20,7 @@ with this program. If not, see
#ifndef WSREQUESTHANDLER_H
#define WSREQUESTHANDLER_H
+#include
#include
#include