From 8b85658c6160746880a26a04e8a25c5a699b3167 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Mon, 25 Apr 2022 19:43:40 -0700 Subject: [PATCH] requesthandler: Add platform info to GetVersion It can be very useful to know which platform you're connecting to in the case of things like text input modification, where Windows uses GDI while unix uses FT2. --- src/requesthandler/RequestHandler_General.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/requesthandler/RequestHandler_General.cpp b/src/requesthandler/RequestHandler_General.cpp index 97dd1483..3d8609f6 100644 --- a/src/requesthandler/RequestHandler_General.cpp +++ b/src/requesthandler/RequestHandler_General.cpp @@ -18,6 +18,7 @@ with this program. If not, see */ #include +#include #include "RequestHandler.h" #include "../websocketserver/WebSocketServer.h" @@ -34,6 +35,8 @@ with this program. If not, see * @responseField rpcVersion | Number | Current latest obs-websocket RPC version * @responseField availableRequests | Array | Array of available RPC requests for the currently negotiated RPC version * @responseField supportedImageFormats | Array | Image formats available in `GetSourceScreenshot` and `SaveSourceScreenshot` requests. + * @responseField platform | String | Name of the platform. Usually `windows`, `macos`, or `ubuntu` (linux flavor). Not guaranteed to be any of those + * @responseField platformDescription | String | Description of the platform, like `Windows 10 (10.0)` * * @requestType GetVersion * @complexity 1 @@ -57,6 +60,9 @@ RequestResult RequestHandler::GetVersion(const Request&) } responseData["supportedImageFormats"] = supportedImageFormats; + responseData["platform"] = QSysInfo::productType().toStdString(); + responseData["platformDescription"] = QSysInfo::prettyProductName().toStdString(); + return RequestResult::Success(responseData); }