Updated no-obs-ws

Added check to see if _auth_required is already connected to.
This commit is contained in:
Mario Steele 2026-03-02 01:59:52 -06:00
parent e4637479e9
commit 3804940b22

View file

@ -24,10 +24,14 @@ signal event_received(event: Message)
signal _auth_required()
func is_open() -> bool:
return _ws != null and _ws.get_ready_state() == WebSocketPeer.STATE_OPEN
func connect_to_obsws(port: int, host: String = "127.0.0.1", password: String = "") -> void:
_ws = WebSocketPeer.new()
_ws.connect_to_url(WS_URL % [host,port])
_auth_required.connect(_authenticate.bind(password))
if not _auth_required.is_connected(_authenticate):
_auth_required.connect(_authenticate.bind(password))
func disconnect_from_obsws() -> void: