obsws 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/obsws/base.rb +13 -12
- data/lib/obsws/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 459330fa7270cc31f26449b15ceb03e53130a7499f3272a9a9d17d8ac7de0b7f
|
|
4
|
+
data.tar.gz: 46897d76b4c62720f776aabb2fea69d47fadc9a0c1d1b0041d090738e2a9c394
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a9bf8c54c209f1b18422babb02fcc631f773e0a5d46c9b8af49ba1a6e5e3077de1b89e1ce57cbc36fb5e868c41503a57d49292cc5bcb970c39127493bb1be3b5
|
|
7
|
+
data.tar.gz: 5959a9b71dceaf3af1fdbe624828e22631e45c8845e2ce232e9083565b9d62aa294690212ecc8b35f56083bb39eed94c346acf787f854414af072edbf3c9b2c8
|
data/README.md
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
[](https://badge.fury.io/rb/obsws)
|
|
1
2
|
[](https://github.com/onyx-and-iris/voicemeeter-api-ruby/blob/dev/LICENSE)
|
|
2
3
|
[](https://github.com/prettier/plugin-ruby)
|
|
3
4
|
|
data/lib/obsws/base.rb
CHANGED
|
@@ -50,10 +50,10 @@ module OBSWS
|
|
|
50
50
|
end
|
|
51
51
|
start_driver
|
|
52
52
|
WaitUtil.wait_for_condition(
|
|
53
|
-
"waiting
|
|
53
|
+
"waiting successful identification",
|
|
54
54
|
delay_sec: 0.01,
|
|
55
55
|
timeout_sec: 3
|
|
56
|
-
) { @
|
|
56
|
+
) { @identified }
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
def start_driver
|
|
@@ -74,32 +74,33 @@ module OBSWS
|
|
|
74
74
|
)
|
|
75
75
|
end
|
|
76
76
|
|
|
77
|
-
def authenticate(auth)
|
|
78
|
-
token = auth_token(**auth)
|
|
77
|
+
def authenticate(auth = nil)
|
|
79
78
|
payload = {
|
|
80
79
|
op: Mixin::OPCodes::IDENTIFY,
|
|
81
80
|
d: {
|
|
82
81
|
rpcVersion: 1,
|
|
83
|
-
authentication: token,
|
|
84
82
|
eventSubscriptions: @subs
|
|
85
83
|
}
|
|
86
84
|
}
|
|
87
|
-
|
|
85
|
+
payload[:d][:authentication] = auth_token(**auth) if auth
|
|
88
86
|
@driver.text(JSON.generate(payload))
|
|
89
87
|
end
|
|
90
88
|
|
|
91
89
|
def msg_handler(data)
|
|
92
|
-
|
|
93
|
-
case op_code
|
|
90
|
+
case data[:op]
|
|
94
91
|
when Mixin::OPCodes::HELLO
|
|
95
|
-
|
|
92
|
+
if data[:d].key? :authentication
|
|
93
|
+
LOGGER.debug("initiating authentication")
|
|
94
|
+
else
|
|
95
|
+
LOGGER.debug("authentication disabled... skipping.")
|
|
96
|
+
end
|
|
96
97
|
authenticate(data[:d][:authentication])
|
|
97
98
|
when Mixin::OPCodes::IDENTIFIED
|
|
98
|
-
LOGGER.debug("
|
|
99
|
-
@
|
|
99
|
+
LOGGER.debug("client succesfully identified with server")
|
|
100
|
+
@identified = true
|
|
100
101
|
when Mixin::OPCodes::EVENT, Mixin::OPCodes::REQUESTRESPONSE
|
|
101
102
|
changed
|
|
102
|
-
notify_observers(
|
|
103
|
+
notify_observers(data[:op], data[:d])
|
|
103
104
|
end
|
|
104
105
|
end
|
|
105
106
|
|
data/lib/obsws/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: obsws
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- onyx_online
|
|
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
146
146
|
- !ruby/object:Gem::Version
|
|
147
147
|
version: '0'
|
|
148
148
|
requirements: []
|
|
149
|
-
rubygems_version: 3.3.
|
|
149
|
+
rubygems_version: 3.3.12
|
|
150
150
|
signing_key:
|
|
151
151
|
specification_version: 4
|
|
152
152
|
summary: OBS Websocket v5 wrapper
|