WebSocketServer: Remove ignoreNonFatalRequestChecks from session params

This commit is contained in:
tt2468 2021-09-04 10:57:00 -07:00
parent e89c0c2b05
commit b9b8e38998
4 changed files with 0 additions and 27 deletions

View File

@ -317,13 +317,11 @@ Authentication is not required
"rpcVersion": number,
"authentication": string(optional),
"ignoreInvalidMessages": bool(optional) = false,
"ignoreNonFatalRequestChecks": bool(optional) = false,
"eventSubscriptions": number(optional) = (EventSubscription::All)
}
```
- `rpcVersion` is the version number that the client would like the obs-websocket server to use.
- When `ignoreInvalidMessages` is true, the socket will not be closed for [`WebSocketCloseCode`](#websocketclosecode-enum): `MessageDecodeError`, `UnknownOpCode`, or `MissingDataKey`. Instead, the message will be logged and ignored.
- When `ignoreNonFatalRequestChecks` is true, requests will ignore checks which are not critical to the function of the request. Eg calling `DeleteScene` when the target scene does not exist would still return [`RequestStatus::Success`](#requeststatus-enum) if this flag is enabled.
- `eventSubscriptions` is a bitmask of [`EventSubscriptions`](#eventsubscriptions-enum) items to subscribe to events and event categories at will. By default, all event categories are subscribed, except for events marked as high volume. High volume events must be explicitly subscribed to.
**Example Message:**
@ -374,7 +372,6 @@ Authentication is not required
```
{
"ignoreInvalidMessages": bool(optional) = false,
"ignoreNonFatalRequestChecks": bool(optional) = false,
"eventSubscriptions": number(optional) = (EventSubscription::All)
}
```

View File

@ -39,15 +39,6 @@ void WebSocketServer::SetSessionParameters(SessionPtr session, ProcessResult &re
session->SetIgnoreInvalidMessages(payloadData["ignoreInvalidMessages"]);
}
if (payloadData.contains("ignoreNonFatalRequestChecks")) {
if (!payloadData["ignoreNonFatalRequestChecks"].is_boolean()) {
ret.closeCode = WebSocketCloseCode::InvalidDataKeyType;
ret.closeReason = "Your `ignoreNonFatalRequestChecks` is not a boolean.";
return;
}
session->SetIgnoreNonFatalRequestChecks(payloadData["ignoreNonFatalRequestChecks"]);
}
if (payloadData.contains("eventSubscriptions")) {
if (!payloadData["eventSubscriptions"].is_number_unsigned()) {
ret.closeCode = WebSocketCloseCode::InvalidDataKeyType;

View File

@ -11,7 +11,6 @@ WebSocketSession::WebSocketSession() :
_rpcVersion(OBS_WEBSOCKET_RPC_VERSION),
_isIdentified(false),
_ignoreInvalidMessages(false),
_ignoreNonFatalRequestChecks(false),
_eventSubscriptions(EventSubscription::All)
{
}
@ -135,16 +134,6 @@ void WebSocketSession::SetIgnoreInvalidMessages(bool ignore)
_ignoreInvalidMessages.store(ignore);
}
bool WebSocketSession::IgnoreNonFatalRequestChecks()
{
return _ignoreNonFatalRequestChecks.load();
}
void WebSocketSession::SetIgnoreNonFatalRequestChecks(bool ignore)
{
_ignoreNonFatalRequestChecks.store(ignore);
}
uint64_t WebSocketSession::EventSubscriptions()
{
return _eventSubscriptions.load();

View File

@ -48,9 +48,6 @@ class WebSocketSession
bool IgnoreInvalidMessages();
void SetIgnoreInvalidMessages(bool ignore);
bool IgnoreNonFatalRequestChecks();
void SetIgnoreNonFatalRequestChecks(bool ignore);
uint64_t EventSubscriptions();
void SetEventSubscriptions(uint64_t subscriptions);
@ -71,6 +68,5 @@ class WebSocketSession
std::atomic<uint8_t> _rpcVersion;
std::atomic<bool> _isIdentified;
std::atomic<bool> _ignoreInvalidMessages;
std::atomic<bool> _ignoreNonFatalRequestChecks;
std::atomic<uint64_t> _eventSubscriptions;
};