diff --git a/.editorconfig b/.editorconfig
index 9d1d51a1..14b0f7bd 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -3,6 +3,7 @@ insert_final_newline = true
[*.{c,cpp,h,hpp}]
indent_style = tab
+indent_size = 4
[*.{yml,yaml}]
indent_style = space
diff --git a/README.md b/README.md
index df8d28e8..1a1419f4 100644
--- a/README.md
+++ b/README.md
@@ -15,6 +15,14 @@ WebSockets API for OBS Studio.
Binaries for Windows, MacOS, and Linux are available in the [Releases](https://github.com/Palakis/obs-websocket/releases) section.
+### Homebrew
+
+If you're using MacOS you can use Homebrew for installation as well:
+
+```sh
+brew install obs-websocket
+```
+
## Using obs-websocket
Here is a list of available web clients: (compatible with tablets and other touch interfaces)
@@ -40,9 +48,10 @@ Here's a list of available language APIs for obs-websocket :
- C#/VB.NET: [obs-websocket-dotnet](https://github.com/Palakis/obs-websocket-dotnet)
- Python 2 and 3: [obs-websocket-py](https://github.com/Elektordi/obs-websocket-py) by Guillaume Genty a.k.a Elektordi
- Python 3.5+ with asyncio: [obs-ws-rc](https://github.com/KirillMysnik/obs-ws-rc) by Kirill Mysnik
-- Python 3.6+ with asyncio: [simpleobsws](https://github.com/IRLToolkit/simpleobsws) by tt2468
+- Python 3.6+ with asyncio: [simpleobsws](https://github.com/IRLToolkit/simpleobsws) by tt2468
- Java 8+: [obs-websocket-java](https://github.com/Twasi/websocket-obs-java) by TwasiNET
- Golang: [go-obs-websocket](https://github.com/christopher-dG/go-obs-websocket) by Chris de Graaf
+- Rust: [obws](https://github.com/dnaka91/obws) by dnaka91
- HTTP API: [obs-websocket-http](https://github.com/IRLToolkit/obs-websocket-http) by tt2468
- CLI: [obs-cli](https://github.com/leafac/obs-cli) by leafac
@@ -80,12 +89,12 @@ These supporters have contributed financially to the project and made possible t
---
-[Support Class](http://supportclass.net) designs and develops professional livestreams, with services ranging from broadcast graphics design and integration to event organization, along many other skills.
+[Support Class](http://supportclass.net) designs and develops professional livestreams, with services ranging from broadcast graphics design and integration to event organization, along many other skills.
[](http://supportclass.net)
---
-[MediaUnit](http://www.mediaunit.no) is a Norwegian media company developing products and services for the media industry, primarly focused on web and events.
+[MediaUnit](http://www.mediaunit.no) is a Norwegian media company developing products and services for the media industry, primarly focused on web and events.
[](http://www.mediaunit.no/)
diff --git a/data/locale/ar-SA.ini b/data/locale/ar-SA.ini
index e69de29b..8b137891 100644
--- a/data/locale/ar-SA.ini
+++ b/data/locale/ar-SA.ini
@@ -0,0 +1 @@
+
diff --git a/data/locale/de-DE.ini b/data/locale/de-DE.ini
index 3cd6e23b..d2f5efc9 100644
--- a/data/locale/de-DE.ini
+++ b/data/locale/de-DE.ini
@@ -3,6 +3,7 @@ OBSWebsocket.Settings.ServerEnable="WebSockets-Server aktivieren"
OBSWebsocket.Settings.ServerPort="Server-Port"
OBSWebsocket.Settings.AuthRequired="Authentifizierung aktivieren"
OBSWebsocket.Settings.Password="Passwort"
+OBSWebsocket.Settings.LockToIPv4="Nur IPv4 verwenden (deaktiviert IPv6)"
OBSWebsocket.Settings.DebugEnable="Debug-Protokollierung aktivieren"
OBSWebsocket.Settings.AlertsEnable="Infobereichbenachrichtigungen aktivieren"
OBSWebsocket.NotifyConnect.Title="Neue Websocket-Verbindung"
@@ -10,7 +11,8 @@ OBSWebsocket.NotifyConnect.Message="Client %1 verbunden"
OBSWebsocket.NotifyDisconnect.Title="Websocket-Client getrennt"
OBSWebsocket.NotifyDisconnect.Message="Client %1 getrennt"
OBSWebsocket.Server.StartFailed.Title="Websocket-Serverfehler"
-OBSWebsocket.Server.StartFailed.Message="Der WebSockets-Server konnte nicht gestartet werden, mögliche Gründe:\n - Der TCP-Port %1 wird möglicherweise gerade von einem anderen Programm verwendet. Versuchen Sie einen anderen Port in den Websocket-Servereinstellungen zu setzen oder alle Programme zu beenden, die den Port möglicherweise verwenden.\n - Ein unbekannter Netzwerkfehler ist aufgetreten. Versuchen Sie es mit anderen Einstellungen, einem OBS-Neustart oder einem Systemneustart erneut."
+OBSWebsocket.Server.StartFailed.Message="Der WebSocket-Server konnte nicht gestartet werden, mögliche Gründe:\n - Der TCP-Port %1 wird möglicherweise gerade von einem anderen Programm verwendet. Versuchen Sie einen anderen Port in den Websocket-Servereinstellungen zu setzen oder alle Programme zu beenden, die den Port möglicherweise verwenden.\n - Fehler: %2"
OBSWebsocket.ProfileChanged.Started="WebSockets-Server in diesem Profil aktiviert. Server gestartet."
OBSWebsocket.ProfileChanged.Stopped="WebSockets-Server in diesem Profil deaktiviert. Server gestoppt."
OBSWebsocket.ProfileChanged.Restarted="WebSockets-Server in diesem Profil geändert. Server startet neu."
+
diff --git a/data/locale/es-ES.ini b/data/locale/es-ES.ini
index 511d2f91..7c82ef2b 100644
--- a/data/locale/es-ES.ini
+++ b/data/locale/es-ES.ini
@@ -1,3 +1,4 @@
+OBSWebsocket.Settings.DialogTitle="Configuración del servidor WebSocket"
OBSWebsocket.Settings.ServerEnable="Habilitar el servidor WebSockets"
OBSWebsocket.Settings.ServerPort="Puerto del Servidor"
OBSWebsocket.Settings.AuthRequired="Habilitar autenticación"
@@ -9,4 +10,7 @@ OBSWebsocket.NotifyConnect.Message="Cliente %1 conectado"
OBSWebsocket.NotifyDisconnect.Title="Cliente WebSocket desconectado"
OBSWebsocket.NotifyDisconnect.Message="Cliente %1 desconectado"
OBSWebsocket.Server.StartFailed.Title="Falla en el servidor WebSockets"
-OBSWebsocket.Server.StartFailed.Message="El servidor obs-websocket no se pudo iniciar, tal vez porque: \n - el puerto TCP %1 podría estar actualmente siendo usado este sistema, posiblemente por otra aplicación. Intente configurar un puerto TCP diferente en la configuración del servidor WebSocket, o detenga cualquier aplicación que pudiese estar utilizando este puerto \n - Un error de red desconocido ha afectado su sistema. Inténtelo de nuevo cambiando la configuración, reiniciando OBS o reiniciando su sistema."
+OBSWebsocket.ProfileChanged.Started="El servidor WebSocket esta habilitado en este perfil. El servidor ha iniciado."
+OBSWebsocket.ProfileChanged.Stopped="Servidor WebSockets deshabilitado en este perfil. Servidor detenido."
+OBSWebsocket.ProfileChanged.Restarted="Puerto del servidor WebSockets cambiado en este perfil. Servidor reiniciado."
+
diff --git a/data/locale/fr-FR.ini b/data/locale/fr-FR.ini
index b2ba9238..ed8fb085 100644
--- a/data/locale/fr-FR.ini
+++ b/data/locale/fr-FR.ini
@@ -10,7 +10,7 @@ OBSWebsocket.NotifyConnect.Message="Le client %1 s'est connecté"
OBSWebsocket.NotifyDisconnect.Title="Déconnexion WebSocket"
OBSWebsocket.NotifyDisconnect.Message="Le client %1 s'est déconnecté"
OBSWebsocket.Server.StartFailed.Title="Impossible de démarrer le serveur WebSockets"
-OBSWebsocket.Server.StartFailed.Message="Le serveur WebSockets n'a pas pu démarrer, peut-être parce que :\n - Le port TCP %1 est en cours d'utilisation sur ce système, certainement par un autre programme. Essayez un port différent dans les réglages du serveur WebSocket, ou arrêtez tout programme susceptible d'utiliser ce port.\n - Une erreur réseau inconnue est survenue. Essayez à nouveau en modifiant vos réglages, en redémarrant OBS ou en redémarrant votre ordinateur."
OBSWebsocket.ProfileChanged.Started="Serveur WebSockets actif dans ce profil."
OBSWebsocket.ProfileChanged.Stopped="Serveur WebSockets désactivé dans ce profil."
OBSWebsocket.ProfileChanged.Restarted="Le port actuel diffère du port configuré dans ce profil. Serveur WebSockets redémarré."
+
diff --git a/data/locale/hi-IN.ini b/data/locale/hi-IN.ini
index e69de29b..8b137891 100644
--- a/data/locale/hi-IN.ini
+++ b/data/locale/hi-IN.ini
@@ -0,0 +1 @@
+
diff --git a/data/locale/it-IT.ini b/data/locale/it-IT.ini
index df133462..4142ed47 100644
--- a/data/locale/it-IT.ini
+++ b/data/locale/it-IT.ini
@@ -1,7 +1,9 @@
+OBSWebsocket.Settings.DialogTitle="Impostazioni del server di WebSocket"
OBSWebsocket.Settings.ServerEnable="Abilitare il server WebSockets"
OBSWebsocket.Settings.ServerPort="Porta del server"
OBSWebsocket.Settings.AuthRequired="Abilitare l'autenticazione"
OBSWebsocket.Settings.Password="Password"
+OBSWebsocket.Settings.LockToIPv4="Blocca il server per usare solo IPv4"
OBSWebsocket.Settings.DebugEnable="Attivare la registrazione di debug"
OBSWebsocket.Settings.AlertsEnable="Attivare gli avvisi di vassoio di sistema"
OBSWebsocket.NotifyConnect.Title="Nuova connessione WebSocket"
@@ -9,4 +11,8 @@ OBSWebsocket.NotifyConnect.Message="%1 cliente collegato"
OBSWebsocket.NotifyDisconnect.Title="WebSocket cliente disconnesso"
OBSWebsocket.NotifyDisconnect.Message="%1 cliente disconnesso"
OBSWebsocket.Server.StartFailed.Title="Errore del WebSocket Server"
-OBSWebsocket.Server.StartFailed.Message="Impossibile avviare, forse perché il server di WebSockets: \n - %1 porta TCP potrebbe essere attualmente in uso altrove su questo sistema, possibilmente da un'altra applicazione. Provare a impostare una porta TCP diversa nelle impostazioni del server di WebSockets, o arrestare tutte le applicazioni che potrebbero utilizzare questa porta. \n - è verificato un errore di rete sconosciuto sul sistema. Riprova modificando le impostazioni, riavviare OBS o riavvio del sistema."
+OBSWebsocket.Server.StartFailed.Message="L'avvio del server WebSockets è fallito, forse perché:\n - La porta TCP %1 può attualmente essere in uso altrove su questo sistema, forse da un'altra applicazione. Provare a impostare una porta TCP diversa nelle impostazioni del server WebSocket o interrompere qualsiasi applicazione che potrebbe utilizzare questa porta.\n - Messaggio di errore: %2"
+OBSWebsocket.ProfileChanged.Started="Server WebSockets abilitato in questo profilo. Il server è avviato."
+OBSWebsocket.ProfileChanged.Stopped="Server WebSocket disabilitato in questo profilo. Server interrotto."
+OBSWebsocket.ProfileChanged.Restarted="La porta del server WebSocket è stata modificata in questo profilo. Il server è stato riavviato."
+
diff --git a/data/locale/ja-JP.ini b/data/locale/ja-JP.ini
index e80892a1..4218cdd7 100644
--- a/data/locale/ja-JP.ini
+++ b/data/locale/ja-JP.ini
@@ -1,3 +1,4 @@
+OBSWebsocket.Settings.DialogTitle="Websocket サーバー設定"
OBSWebsocket.Settings.ServerEnable="WebSockets サーバーを有効にする"
OBSWebsocket.Settings.ServerPort="サーバーポート"
OBSWebsocket.Settings.AuthRequired="認証を有効にする"
@@ -9,3 +10,7 @@ OBSWebsocket.NotifyConnect.Message="接続されているクライアント %1"
OBSWebsocket.NotifyDisconnect.Title="WebSocket クライアントが切断されました"
OBSWebsocket.NotifyDisconnect.Message="切断されたクライアント %1"
OBSWebsocket.Server.StartFailed.Title="WebSockets サーバー障害"
+OBSWebsocket.ProfileChanged.Started="このプロファイルでWebSocketサーバが有効になりました。サーバを起動しました。"
+OBSWebsocket.ProfileChanged.Stopped="このプロファイルでWebSocketサーバが無効になりました。サーバを停止しました。"
+OBSWebsocket.ProfileChanged.Restarted="このプロファイルでWebSocketサーバの通信ポートが変更されました。サーバを再起動しました。"
+
diff --git a/data/locale/ko-KR.ini b/data/locale/ko-KR.ini
index e69de29b..0154da74 100644
--- a/data/locale/ko-KR.ini
+++ b/data/locale/ko-KR.ini
@@ -0,0 +1,18 @@
+OBSWebsocket.Settings.DialogTitle="웹소켓 서버 설정"
+OBSWebsocket.Settings.ServerEnable="웹소켓 서버 활성화"
+OBSWebsocket.Settings.ServerPort="서버 포트"
+OBSWebsocket.Settings.AuthRequired="인증 활성화"
+OBSWebsocket.Settings.Password="비밀번호"
+OBSWebsocket.Settings.LockToIPv4="IPv4만 이용하여 서버를 연결"
+OBSWebsocket.Settings.DebugEnable="디버그 로깅 활성화"
+OBSWebsocket.Settings.AlertsEnable="시스템 트레이 알림 활성화"
+OBSWebsocket.NotifyConnect.Title="새로운 웹소켓 연결"
+OBSWebsocket.NotifyConnect.Message="클라이언트 %1 가 연결되었습니다"
+OBSWebsocket.NotifyDisconnect.Title="웹소켓 클라이언트가 연결 해제되었습니다"
+OBSWebsocket.NotifyDisconnect.Message="클라이언트 %1 가 연결이 해제되었습니다"
+OBSWebsocket.Server.StartFailed.Title="웹소켓 서버 시작이 실패하였습니다"
+OBSWebsocket.Server.StartFailed.Message="웹소켓 서버가 시작되지 못했습니다. \n 시스템 상의 다른 프로그램이 TCP 포트 %1을 사용 중인 것으로 보입니다. 다른 TCP 포트를 사용하거나, 해당 포트를 사용 중인 프로그램을 종료하고 다시 시도해주세요. \n 에러 메시지: %2"
+OBSWebsocket.ProfileChanged.Started="프로파일 설정에 따라 웹소켓 서버가 활성화되었습니다. 서버가 시작되었습니다."
+OBSWebsocket.ProfileChanged.Stopped="프로파일 설정에 따라 웹소켓 서버가 비활성화되었습니다. 서버가 중지되었습니다."
+OBSWebsocket.ProfileChanged.Restarted="프로파일 설정에 따라 웹소켓 포트가 변경되었습니다. 서버가 재시작되었습니다."
+
diff --git a/data/locale/nl-NL.ini b/data/locale/nl-NL.ini
index f3151408..29e72d61 100644
--- a/data/locale/nl-NL.ini
+++ b/data/locale/nl-NL.ini
@@ -1,4 +1,9 @@
+OBSWebsocket.Settings.DialogTitle="WebSockets Server Instellingen"
+OBSWebsocket.Settings.ServerEnable="WebSockets server inschakelen"
OBSWebsocket.Settings.ServerPort="Serverpoort"
+OBSWebsocket.Settings.AuthRequired="Verificatie inschakelen"
+OBSWebsocket.Settings.Password="Wachtwoord"
+OBSWebsocket.Settings.LockToIPv4="Server vergrendelen om alleen IPv4 te gebruiken"
OBSWebsocket.Settings.DebugEnable="Activeer debug logs"
OBSWebsocket.Settings.AlertsEnable="Systemvak waarschuwingen inschakelen"
OBSWebsocket.NotifyConnect.Title="Nieuwe WebSocket verbinding"
@@ -7,3 +12,7 @@ OBSWebsocket.NotifyDisconnect.Title="WebSocket client connectie verbroken"
OBSWebsocket.NotifyDisconnect.Message="Client %1 losgekoppeld"
OBSWebsocket.Server.StartFailed.Title="Fout in WebSocket server"
OBSWebsocket.Server.StartFailed.Message="De obs-websocket server kan niet worden gestart, misschien omdat: \n - TCP-poort %1 momenteel elders wordt gebruikt op dit systeem, eventueel door een andere toepassing. Probeer een andere TCP-poort in te stellen in de WebSocket Server-instellingen of stop elke toepassing die deze poort zou kunnen gebruiken.\n Een onbekende Netwerkfout op uw systeem. Probeer het opnieuw door de instellingen te wijzigen, OBS te herstarten of uw systeem te herstarten."
+OBSWebsocket.ProfileChanged.Started="WebSockets server ingeschakeld in dit profiel. Server gestart."
+OBSWebsocket.ProfileChanged.Stopped="WebSockets server uitgeschakeld in dit profiel. Server is gestopt."
+OBSWebsocket.ProfileChanged.Restarted="WebSockets server poort is veranderd in dit profiel. Server is herstart."
+
diff --git a/data/locale/pl-PL.ini b/data/locale/pl-PL.ini
index 984b630d..8b434cda 100644
--- a/data/locale/pl-PL.ini
+++ b/data/locale/pl-PL.ini
@@ -1,5 +1,9 @@
+OBSWebsocket.Settings.DialogTitle="Ustawienia serwera WebSockets"
OBSWebsocket.Settings.ServerEnable="Włącz serwer WebSockets"
+OBSWebsocket.Settings.ServerPort="Port serwera"
OBSWebsocket.Settings.AuthRequired="Wymagaj uwierzytelniania"
+OBSWebsocket.Settings.Password="Hasło"
+OBSWebsocket.Settings.LockToIPv4="Zablokuj serwer tylko za pomocą IPv4"
OBSWebsocket.Settings.DebugEnable="Włącz rejestrowanie debugowania"
OBSWebsocket.Settings.AlertsEnable="Włącz powiadomienia w zasobniku systemowym"
OBSWebsocket.NotifyConnect.Title="Nowe połączenie WebSocket"
@@ -7,4 +11,5 @@ OBSWebsocket.NotifyConnect.Message="Klient %1 połączony"
OBSWebsocket.NotifyDisconnect.Title="Klient WebSocket odłączony"
OBSWebsocket.NotifyDisconnect.Message="Klient %1 rozłączony"
OBSWebsocket.Server.StartFailed.Title="Awaria serwera WebSockets"
-OBSWebsocket.Server.StartFailed.Message="Nie udało się uruchomić serwera WebSockets, może a powodu: \n - TCP port %1 może być obecnie używany gdzie indziej w tym systemie, możliwie przez inną aplikację. Spróbuj ustawić inny port TCP w ustawieniach serwera WebSockets, lub zatrzymać dowolną aplikację, która może używać tego portu \n -nieznany błąd sieci wydarzył się w systemie. Spróbuj ponownie, zmieniając ustawienia, ponownie uruchamiając OBS lub ponownie uruchamiając system."
+OBSWebsocket.ProfileChanged.Started="Serwer WebSockets włączony w tym profilu. Serwer uruchomiony."
+
diff --git a/data/locale/pt-PT.ini b/data/locale/pt-PT.ini
index 211d8547..99de1931 100644
--- a/data/locale/pt-PT.ini
+++ b/data/locale/pt-PT.ini
@@ -1,7 +1,9 @@
+OBSWebsocket.Settings.DialogTitle="Configurações do servidor de WebSockets"
OBSWebsocket.Settings.ServerEnable="Habilitar servidor de WebSockets"
OBSWebsocket.Settings.ServerPort="Porta do Servidor"
OBSWebsocket.Settings.AuthRequired="Activar autenticação"
OBSWebsocket.Settings.Password="Palavra passe"
+OBSWebsocket.Settings.LockToIPv4="Forçar apenas o uso de IPv4 (desabilitar IPv6)"
OBSWebsocket.Settings.DebugEnable="Habilitar registro de debug"
OBSWebsocket.Settings.AlertsEnable="Ativar Alertas da bandeja do sistema"
OBSWebsocket.NotifyConnect.Title="Nova conexão WebSocket"
@@ -9,4 +11,8 @@ OBSWebsocket.NotifyConnect.Message="Cliente %1 conectado"
OBSWebsocket.NotifyDisconnect.Title="WebSocket cliente desconectado"
OBSWebsocket.NotifyDisconnect.Message="Cliente %1 desconectado"
OBSWebsocket.Server.StartFailed.Title="Falha do servidor de WebSocket"
-OBSWebsocket.Server.StartFailed.Message="O servidor de WebSockets falhou ao iniciar, talvez porque: \n - TCP port %1 pode estar atualmente em uso em outro lugar sobre este sistema, possivelmente por outro aplicativo. Tente definir uma porta TCP diferente nas configurações do servidor de WebSockets, ou parar qualquer aplicativo que poderia estar usando este porto \n - um erro de rede desconhecido aconteceu no seu sistema. Tente novamente alterar configurações, reiniciando OBS ou reiniciando o sistema."
+OBSWebsocket.Server.StartFailed.Message="O servidor de WebSockets falhou ao iniciar, possivelmente porque:\n - A porta TCP %1 pode já estar em uso em algum outro lugar neste sistema, possivelmente por outro aplicativo. Tente definir uma porta TCP diferente nas configurações do servidor de WebSockets, ou pare qualquer aplicativo que possa estar usando essa porta.\n - Mensagem de erro: %2"
+OBSWebsocket.ProfileChanged.Started="Servidor de WebSockets habilitado nesse perfil. Servidor iniciado."
+OBSWebsocket.ProfileChanged.Stopped="Servidor de WebSockets desabilitado nesse perfil. Servidor parado."
+OBSWebsocket.ProfileChanged.Restarted="Porta do servidor de WebSockets foi alterada neste perfil. Servidor reiniciado."
+
diff --git a/data/locale/ru-RU.ini b/data/locale/ru-RU.ini
index 782f33c0..efbf1f46 100644
--- a/data/locale/ru-RU.ini
+++ b/data/locale/ru-RU.ini
@@ -3,6 +3,7 @@ OBSWebsocket.Settings.ServerEnable="Включить сервер WebSockets"
OBSWebsocket.Settings.ServerPort="Порт сервера"
OBSWebsocket.Settings.AuthRequired="Включить авторизацию"
OBSWebsocket.Settings.Password="Пароль"
+OBSWebsocket.Settings.LockToIPv4="Блокировка сервера только с использованием IPv4"
OBSWebsocket.Settings.DebugEnable="Включить ведение журнала отладки"
OBSWebsocket.Settings.AlertsEnable="Включить оповещения в системном трее"
OBSWebsocket.NotifyConnect.Title="Новое соединение WebSocket"
@@ -10,4 +11,8 @@ OBSWebsocket.NotifyConnect.Message="Клиент %1 подключен"
OBSWebsocket.NotifyDisconnect.Title="Клиент WebSocket отключён"
OBSWebsocket.NotifyDisconnect.Message="Клиент %1 отключен"
OBSWebsocket.Server.StartFailed.Title="Сбой сервера WebSockets"
-OBSWebsocket.Server.StartFailed.Message="Ошибка запуска сервера WebSockets. Вероятные причины:\n - Возможно, TCP-порт %1 занят другим приложением в системе. Попробуйте задать другой TCP-порт в настройках сервера WebSockets или закройте приложение, которое может использовать данный порт.\n - Произошла неизвестная сетевая ошибка в системе. Попробуйте снова после изменения настроек, перезапуска OBS или системы."
+OBSWebsocket.Server.StartFailed.Message="Сервер WebSockets не запустился, возможно, потому, что:\n-TCP-порт %1 в настоящее время может использоваться в другом месте этой системы, возможно, другим приложением. Попробуйте установить другой TCP-порт в настройках сервера WebSocket или остановить любое приложение, которое может использовать этот порт.\n-сообщение об ошибке: %2"
+OBSWebsocket.ProfileChanged.Started="Сервер WebSockets включен в этом профиле. Сервер запущен."
+OBSWebsocket.ProfileChanged.Stopped="Сервер WebSockets отключен в этом профиле. Сервер остановлен."
+OBSWebsocket.ProfileChanged.Restarted="Порт сервера WebSockets изменен в этом профиле. Сервер перезапущен."
+
diff --git a/data/locale/zh-CN.ini b/data/locale/zh-CN.ini
index a40d3432..cab511cc 100644
--- a/data/locale/zh-CN.ini
+++ b/data/locale/zh-CN.ini
@@ -1,3 +1,4 @@
+OBSWebsocket.Settings.DialogTitle="WebSockets 服务器设置"
OBSWebsocket.Settings.ServerEnable="启用 WebSockets 服务器"
OBSWebsocket.Settings.ServerPort="服务器端口"
OBSWebsocket.Settings.AuthRequired="启用身份验证"
@@ -9,4 +10,7 @@ OBSWebsocket.NotifyConnect.Message="客户端 %1 已连接"
OBSWebsocket.NotifyDisconnect.Title="WebSocket 客户端已断开"
OBSWebsocket.NotifyDisconnect.Message="客户端 %1 已断开连接"
OBSWebsocket.Server.StartFailed.Title="WebSockets 服务器错误"
-OBSWebsocket.Server.StartFailed.Message="WebSockets 服务器启动失败,可能是因为:\n - TCP 端口 %1 可能被本机的另一个应用程序占用。尝试在 WebSockets 服务器设置中设置不同的 TCP 端口,或关闭任何可能使用此端口的应用程序。\n - 在您的系统上发生了未知的网络错误。请尝试更改设置、重新启动 OBS 或重新启动系统。"
+OBSWebsocket.ProfileChanged.Started="此配置文件中启用了 WebSockets 服务器。服务器已启动。"
+OBSWebsocket.ProfileChanged.Stopped="此配置文件中禁用了 WebSockets 服务器。服务器已停止。"
+OBSWebsocket.ProfileChanged.Restarted="此配置文件中的 WebSockets 服务器端口已更改。服务器已重新启动。"
+
diff --git a/data/locale/zh-TW.ini b/data/locale/zh-TW.ini
index e72077df..41cc0591 100644
--- a/data/locale/zh-TW.ini
+++ b/data/locale/zh-TW.ini
@@ -6,4 +6,4 @@ OBSWebsocket.NotifyConnect.Message="客戶端 %1 已連線"
OBSWebsocket.NotifyDisconnect.Title="WebSocket 客戶端已離線"
OBSWebsocket.NotifyDisconnect.Message="客戶端 %1 已離線"
OBSWebsocket.Server.StartFailed.Title="WebSocket 伺服器錯誤"
-OBSWebsocket.Server.StartFailed.Message="WebSockets 伺服器啟動失敗,可能的原因有:\n - TCP 連接埠 %1 被系統的其他程式所使用,試著為 WebSockets 伺服器指定不同的 TCP 連接埠,或是關閉任何可能使用此連接埠的程式。\n - 發生的未知的網路錯誤,試著更改設定、重新啟動 OBS 或是重新啟動您的系統。"
+
diff --git a/docs/generated/comments.json b/docs/generated/comments.json
index cc02464d..26798952 100644
--- a/docs/generated/comments.json
+++ b/docs/generated/comments.json
@@ -7327,7 +7327,7 @@
"level": 2,
"text": "TakeSourceScreenshot"
},
- "lead": "Takes a picture snapshot of a source and then can either or both: - Send it over as a Data URI (base64-encoded data) in the response (by specifying `embedPictureFormat` in the request) - Save it to disk (by specifying `saveToFilePath` in the request)",
+ "lead": "Takes a picture snapshot of a source and then can either or both: \t- Send it over as a Data URI (base64-encoded data) in the response (by specifying `embedPictureFormat` in the request) \t- Save it to disk (by specifying `saveToFilePath` in the request)",
"type": "class",
"examples": []
}
@@ -9424,7 +9424,7 @@
"api": "requests",
"name": "CreateScene",
"category": "scenes",
- "since": "4.8.0",
+ "since": "unreleased",
"params": [
{
"type": "String",
@@ -9447,7 +9447,7 @@
"sinces": [
{
"name": "",
- "description": "4.8.0"
+ "description": "unreleased"
}
],
"heading": {
@@ -9680,9 +9680,10 @@
"return": [
"{boolean} `streaming` Current streaming status.",
"{boolean} `recording` Current recording status.",
+ "{boolean} `recording-paused` If recording is paused.",
+ "{boolean} `preview-only` Always false. Retrocompatibility with OBSRemote.",
"{String (optional)} `stream-timecode` Time elapsed since streaming started (only present if currently streaming).",
- "{String (optional)} `rec-timecode` Time elapsed since recording started (only present if currently recording).",
- "{boolean} `preview-only` Always false. Retrocompatibility with OBSRemote."
+ "{String (optional)} `rec-timecode` Time elapsed since recording started (only present if currently recording)."
],
"api": "requests",
"name": "GetStreamingStatus",
@@ -9699,6 +9700,16 @@
"name": "recording",
"description": "Current recording status."
},
+ {
+ "type": "boolean",
+ "name": "recording-paused",
+ "description": "If recording is paused."
+ },
+ {
+ "type": "boolean",
+ "name": "preview-only",
+ "description": "Always false. Retrocompatibility with OBSRemote."
+ },
{
"type": "String (optional)",
"name": "stream-timecode",
@@ -9708,11 +9719,6 @@
"type": "String (optional)",
"name": "rec-timecode",
"description": "Time elapsed since recording started (only present if currently recording)."
- },
- {
- "type": "boolean",
- "name": "preview-only",
- "description": "Always false. Retrocompatibility with OBSRemote."
}
],
"names": [
diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md
index 9d9bd8a7..87d69c10 100644
--- a/docs/generated/protocol.md
+++ b/docs/generated/protocol.md
@@ -3700,7 +3700,7 @@ _No specified parameters._
### CreateScene
-- Added in v4.8.0
+- Unreleased
Create a new scene scene.
@@ -3825,9 +3825,10 @@ _No specified parameters._
| ---- | :---: | ------------|
| `streaming` | _boolean_ | Current streaming status. |
| `recording` | _boolean_ | Current recording status. |
+| `recording-paused` | _boolean_ | If recording is paused. |
+| `preview-only` | _boolean_ | Always false. Retrocompatibility with OBSRemote. |
| `stream-timecode` | _String (optional)_ | Time elapsed since streaming started (only present if currently streaming). |
| `rec-timecode` | _String (optional)_ | Time elapsed since recording started (only present if currently recording). |
-| `preview-only` | _boolean_ | Always false. Retrocompatibility with OBSRemote. |
---
diff --git a/src/ConnectionProperties.cpp b/src/ConnectionProperties.cpp
index 485123de..aa7c4525 100644
--- a/src/ConnectionProperties.cpp
+++ b/src/ConnectionProperties.cpp
@@ -19,16 +19,16 @@ with this program. If not, see
#include "ConnectionProperties.h"
ConnectionProperties::ConnectionProperties()
- : _authenticated(false)
+ : _authenticated(false)
{
}
bool ConnectionProperties::isAuthenticated()
{
- return _authenticated.load();
+ return _authenticated.load();
}
void ConnectionProperties::setAuthenticated(bool authenticated)
{
- _authenticated.store(authenticated);
+ _authenticated.store(authenticated);
}
\ No newline at end of file
diff --git a/src/ConnectionProperties.h b/src/ConnectionProperties.h
index a766ef6a..8bb87a27 100644
--- a/src/ConnectionProperties.h
+++ b/src/ConnectionProperties.h
@@ -23,9 +23,9 @@ with this program. If not, see
class ConnectionProperties
{
public:
- explicit ConnectionProperties();
- bool isAuthenticated();
- void setAuthenticated(bool authenticated);
+ explicit ConnectionProperties();
+ bool isAuthenticated();
+ void setAuthenticated(bool authenticated);
private:
- std::atomic _authenticated;
+ std::atomic _authenticated;
};
\ No newline at end of file
diff --git a/src/WSEvents.cpp b/src/WSEvents.cpp
index 80b565f7..38660b24 100644
--- a/src/WSEvents.cpp
+++ b/src/WSEvents.cpp
@@ -233,6 +233,7 @@ void WSEvents::FrontendEventHandler(enum obs_frontend_event event, void* private
case OBS_FRONTEND_EVENT_EXIT:
owner->unhookTransitionPlaybackEvents();
owner->OnExit();
+ owner->_srv->stop();
break;
}
}
diff --git a/src/WSRequestHandler_Recording.cpp b/src/WSRequestHandler_Recording.cpp
index db0c529d..d0a53f82 100644
--- a/src/WSRequestHandler_Recording.cpp
+++ b/src/WSRequestHandler_Recording.cpp
@@ -29,19 +29,19 @@ RpcResponse ifCanPause(const RpcRequest& request, std::function c
* @since unreleased
*/
RpcResponse WSRequestHandler::GetRecordingStatus(const RpcRequest& request) {
- auto events = GetEventsSystem();
+ auto events = GetEventsSystem();
- OBSDataAutoRelease data = obs_data_create();
- obs_data_set_bool(data, "isRecording", obs_frontend_recording_active());
- obs_data_set_bool(data, "isRecordingPaused", obs_frontend_recording_paused());
+ OBSDataAutoRelease data = obs_data_create();
+ obs_data_set_bool(data, "isRecording", obs_frontend_recording_active());
+ obs_data_set_bool(data, "isRecordingPaused", obs_frontend_recording_paused());
- if (obs_frontend_recording_active()) {
- QString recordingTimecode = events->getRecordingTimecode();
- obs_data_set_string(data, "recordTimecode", recordingTimecode.toUtf8().constData());
+ if (obs_frontend_recording_active()) {
+ QString recordingTimecode = events->getRecordingTimecode();
+ obs_data_set_string(data, "recordTimecode", recordingTimecode.toUtf8().constData());
obs_data_set_string(data, "recordingFilename", Utils::GetCurrentRecordingFilename());
- }
+ }
- return request.success(data);
+ return request.success(data);
}
/**
diff --git a/src/WSRequestHandler_ReplayBuffer.cpp b/src/WSRequestHandler_ReplayBuffer.cpp
index d4c83a27..2210fcf7 100644
--- a/src/WSRequestHandler_ReplayBuffer.cpp
+++ b/src/WSRequestHandler_ReplayBuffer.cpp
@@ -16,10 +16,10 @@
* @since unreleased
*/
RpcResponse WSRequestHandler::GetReplayBufferStatus(const RpcRequest& request) {
- OBSDataAutoRelease data = obs_data_create();
- obs_data_set_bool(data, "isReplayBufferActive", obs_frontend_replay_buffer_active());
+ OBSDataAutoRelease data = obs_data_create();
+ obs_data_set_bool(data, "isReplayBufferActive", obs_frontend_replay_buffer_active());
- return request.success(data);
+ return request.success(data);
}
/**
diff --git a/src/WSRequestHandler_Scenes.cpp b/src/WSRequestHandler_Scenes.cpp
index 9c317cdf..70734c1a 100644
--- a/src/WSRequestHandler_Scenes.cpp
+++ b/src/WSRequestHandler_Scenes.cpp
@@ -87,7 +87,7 @@ RpcResponse WSRequestHandler::GetSceneList(const RpcRequest& request) {
* @api requests
* @name CreateScene
* @category scenes
- * @since 4.8.0
+ * @since unreleased
*/
RpcResponse WSRequestHandler::CreateScene(const RpcRequest& request) {
if (!request.hasField("sceneName")) {
diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp
index a14bcb81..b72c9879 100644
--- a/src/WSRequestHandler_Sources.cpp
+++ b/src/WSRequestHandler_Sources.cpp
@@ -975,10 +975,10 @@ RpcResponse WSRequestHandler::GetTextFreetype2Properties(const RpcRequest& reque
*/
RpcResponse WSRequestHandler::SetTextFreetype2Properties(const RpcRequest& request)
{
- const char* sourceName = obs_data_get_string(request.parameters(), "source");
- if (!sourceName) {
+ const char* sourceName = obs_data_get_string(request.parameters(), "source");
+ if (!sourceName) {
return request.failed("invalid request parameters");
- }
+ }
OBSSourceAutoRelease source = obs_get_source_by_name(sourceName);
if (!source) {
@@ -1716,8 +1716,8 @@ RpcResponse WSRequestHandler::GetSourceDefaultSettings(const RpcRequest& request
/**
* Takes a picture snapshot of a source and then can either or both:
-* - Send it over as a Data URI (base64-encoded data) in the response (by specifying `embedPictureFormat` in the request)
-* - Save it to disk (by specifying `saveToFilePath` in the request)
+* - Send it over as a Data URI (base64-encoded data) in the response (by specifying `embedPictureFormat` in the request)
+* - Save it to disk (by specifying `saveToFilePath` in the request)
*
* At least `embedPictureFormat` or `saveToFilePath` must be specified.
*
diff --git a/src/WSRequestHandler_Streaming.cpp b/src/WSRequestHandler_Streaming.cpp
index 94f5b5c3..141dd8ee 100644
--- a/src/WSRequestHandler_Streaming.cpp
+++ b/src/WSRequestHandler_Streaming.cpp
@@ -11,9 +11,10 @@
*
* @return {boolean} `streaming` Current streaming status.
* @return {boolean} `recording` Current recording status.
+ * @return {boolean} `recording-paused` If recording is paused.
+ * @return {boolean} `preview-only` Always false. Retrocompatibility with OBSRemote.
* @return {String (optional)} `stream-timecode` Time elapsed since streaming started (only present if currently streaming).
* @return {String (optional)} `rec-timecode` Time elapsed since recording started (only present if currently recording).
- * @return {boolean} `preview-only` Always false. Retrocompatibility with OBSRemote.
*
* @api requests
* @name GetStreamingStatus
diff --git a/src/WSServer.cpp b/src/WSServer.cpp
index add0e1e1..6d155658 100644
--- a/src/WSServer.cpp
+++ b/src/WSServer.cpp
@@ -44,7 +44,7 @@ WSServer::WSServer()
_connections(),
_clMutex(QMutex::Recursive)
{
- _server.get_alog().clear_channels(websocketpp::log::alevel::frame_header | websocketpp::log::alevel::frame_payload | websocketpp::log::alevel::control);
+ _server.get_alog().clear_channels(websocketpp::log::alevel::frame_header | websocketpp::log::alevel::frame_payload | websocketpp::log::alevel::control);
_server.init_asio();
#ifndef _WIN32
_server.set_reuse_addr(true);
@@ -121,13 +121,11 @@ void WSServer::stop()
for (connection_hdl hdl : _connections) {
_server.close(hdl, websocketpp::close::status::going_away, "Server stopping");
}
- _connections.clear();
- _connectionProperties.clear();
_threadPool.waitForDone();
- while (!_server.stopped()) {
- std::this_thread::sleep_for(std::chrono::milliseconds(1));
+ while (_connections.size() > 0) {
+ std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
blog(LOG_INFO, "server stopped successfully");