krpc 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/krpc.gemspec +7 -7
- data/lib/krpc/krpc.pb.rb +219 -195
- data/lib/krpc/service.rb +7 -0
- data/lib/krpc/streaming.rb +8 -1
- data/lib/krpc/version.rb +3 -2
- metadata +16 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4cc79391e6464734da36d5394e3dd7d2a33530fbc170a74d24f8f22db91fb892
|
4
|
+
data.tar.gz: e8e5caa33a90f611effd0d17a466e633daf9504095488e8247f7e480fdbdf13c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 459faf66013b0bea822510f261228af16b2ff1ec9014d4b33df10f7a5f5be261096166eed404b9642b0812e16b3b935a491510ab599359744d379dce66694977
|
7
|
+
data.tar.gz: 2aa96e79974c0288573ea7f3f51e0dc427aa6f3964961ffe003baa0610ca9261474cd202a4ab7dabff76d5391a70bd7fe115f96a35131745a16f55081563fd35
|
data/krpc.gemspec
CHANGED
@@ -22,14 +22,14 @@ Gem::Specification.new do |s|
|
|
22
22
|
"--title" << "kRPC-rb API Docs" <<
|
23
23
|
"--main" << "README.md"
|
24
24
|
|
25
|
-
s.required_ruby_version = ">= 2.
|
25
|
+
s.required_ruby_version = ">= 2.3.0"
|
26
26
|
|
27
|
-
s.add_runtime_dependency "google-protobuf", "~> 3.
|
27
|
+
s.add_runtime_dependency "google-protobuf", "~> 3.11"
|
28
28
|
s.add_runtime_dependency "colorize", "~> 0.8"
|
29
|
-
s.add_runtime_dependency "nokogiri", "~> 1.
|
30
|
-
s.add_development_dependency "bundler", "~> 1
|
31
|
-
s.add_development_dependency "pry", "~> 0.
|
32
|
-
s.add_development_dependency "rspec", "~> 3.
|
33
|
-
s.add_development_dependency "rake", "~>
|
29
|
+
s.add_runtime_dependency "nokogiri", "~> 1.10"
|
30
|
+
s.add_development_dependency "bundler", "~> 2.1"
|
31
|
+
s.add_development_dependency "pry", "~> 0.13"
|
32
|
+
s.add_development_dependency "rspec", "~> 3.9"
|
33
|
+
s.add_development_dependency "rake", "~> 13.0"
|
34
34
|
s.add_development_dependency "hanna-nouveau", "~> 1.0"
|
35
35
|
end
|
data/lib/krpc/krpc.pb.rb
CHANGED
@@ -4,205 +4,229 @@
|
|
4
4
|
require 'google/protobuf'
|
5
5
|
|
6
6
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
7
|
+
add_file("krpc.proto", :syntax => :proto3) do
|
8
|
+
add_message "krpc.schema.ConnectionRequest" do
|
9
|
+
optional :type, :enum, 1, "krpc.schema.ConnectionRequest.Type"
|
10
|
+
optional :client_name, :string, 2
|
11
|
+
optional :client_identifier, :bytes, 3
|
12
|
+
end
|
13
|
+
add_enum "krpc.schema.ConnectionRequest.Type" do
|
14
|
+
value :RPC, 0
|
15
|
+
value :STREAM, 1
|
16
|
+
end
|
17
|
+
add_message "krpc.schema.ConnectionResponse" do
|
18
|
+
optional :status, :enum, 1, "krpc.schema.ConnectionResponse.Status"
|
19
|
+
optional :message, :string, 2
|
20
|
+
optional :client_identifier, :bytes, 3
|
21
|
+
end
|
22
|
+
add_enum "krpc.schema.ConnectionResponse.Status" do
|
23
|
+
value :OK, 0
|
24
|
+
value :MALFORMED_MESSAGE, 1
|
25
|
+
value :TIMEOUT, 2
|
26
|
+
value :WRONG_TYPE, 3
|
27
|
+
end
|
28
|
+
add_message "krpc.schema.Request" do
|
29
|
+
repeated :calls, :message, 1, "krpc.schema.ProcedureCall"
|
30
|
+
end
|
31
|
+
add_message "krpc.schema.ProcedureCall" do
|
32
|
+
optional :service, :string, 1
|
33
|
+
optional :procedure, :string, 2
|
34
|
+
optional :service_id, :uint32, 4
|
35
|
+
optional :procedure_id, :uint32, 5
|
36
|
+
repeated :arguments, :message, 3, "krpc.schema.Argument"
|
37
|
+
end
|
38
|
+
add_message "krpc.schema.Argument" do
|
39
|
+
optional :position, :uint32, 1
|
40
|
+
optional :value, :bytes, 2
|
41
|
+
end
|
42
|
+
add_message "krpc.schema.Response" do
|
43
|
+
optional :error, :message, 1, "krpc.schema.Error"
|
44
|
+
repeated :results, :message, 2, "krpc.schema.ProcedureResult"
|
45
|
+
end
|
46
|
+
add_message "krpc.schema.ProcedureResult" do
|
47
|
+
optional :error, :message, 1, "krpc.schema.Error"
|
48
|
+
optional :value, :bytes, 2
|
49
|
+
end
|
50
|
+
add_message "krpc.schema.Error" do
|
51
|
+
optional :service, :string, 1
|
52
|
+
optional :name, :string, 2
|
53
|
+
optional :description, :string, 3
|
54
|
+
optional :stack_trace, :string, 4
|
55
|
+
end
|
56
|
+
add_message "krpc.schema.StreamUpdate" do
|
57
|
+
repeated :results, :message, 1, "krpc.schema.StreamResult"
|
58
|
+
end
|
59
|
+
add_message "krpc.schema.StreamResult" do
|
60
|
+
optional :id, :uint64, 1
|
61
|
+
optional :result, :message, 2, "krpc.schema.ProcedureResult"
|
62
|
+
end
|
63
|
+
add_message "krpc.schema.Services" do
|
64
|
+
repeated :services, :message, 1, "krpc.schema.Service"
|
65
|
+
end
|
66
|
+
add_message "krpc.schema.Service" do
|
67
|
+
optional :name, :string, 1
|
68
|
+
repeated :procedures, :message, 2, "krpc.schema.Procedure"
|
69
|
+
repeated :classes, :message, 3, "krpc.schema.Class"
|
70
|
+
repeated :enumerations, :message, 4, "krpc.schema.Enumeration"
|
71
|
+
repeated :exceptions, :message, 5, "krpc.schema.Exception"
|
72
|
+
optional :documentation, :string, 6
|
73
|
+
end
|
74
|
+
add_message "krpc.schema.Procedure" do
|
75
|
+
optional :name, :string, 1
|
76
|
+
repeated :parameters, :message, 2, "krpc.schema.Parameter"
|
77
|
+
optional :return_type, :message, 3, "krpc.schema.Type"
|
78
|
+
optional :return_is_nullable, :bool, 4
|
79
|
+
repeated :game_scenes, :enum, 6, "krpc.schema.Procedure.GameScene"
|
80
|
+
optional :documentation, :string, 5
|
81
|
+
end
|
82
|
+
add_enum "krpc.schema.Procedure.GameScene" do
|
83
|
+
value :SPACE_CENTER, 0
|
84
|
+
value :FLIGHT, 1
|
85
|
+
value :TRACKING_STATION, 2
|
86
|
+
value :EDITOR_VAB, 3
|
87
|
+
value :EDITOR_SPH, 4
|
88
|
+
value :MISSION_BUILDER, 5
|
89
|
+
end
|
90
|
+
add_message "krpc.schema.Parameter" do
|
91
|
+
optional :name, :string, 1
|
92
|
+
optional :type, :message, 2, "krpc.schema.Type"
|
93
|
+
optional :default_value, :bytes, 3
|
94
|
+
end
|
95
|
+
add_message "krpc.schema.Class" do
|
96
|
+
optional :name, :string, 1
|
97
|
+
optional :documentation, :string, 2
|
98
|
+
end
|
99
|
+
add_message "krpc.schema.Enumeration" do
|
100
|
+
optional :name, :string, 1
|
101
|
+
repeated :values, :message, 2, "krpc.schema.EnumerationValue"
|
102
|
+
optional :documentation, :string, 3
|
103
|
+
end
|
104
|
+
add_message "krpc.schema.EnumerationValue" do
|
105
|
+
optional :name, :string, 1
|
106
|
+
optional :value, :int32, 2
|
107
|
+
optional :documentation, :string, 3
|
108
|
+
end
|
109
|
+
add_message "krpc.schema.Exception" do
|
110
|
+
optional :name, :string, 1
|
111
|
+
optional :documentation, :string, 2
|
112
|
+
end
|
113
|
+
add_message "krpc.schema.Type" do
|
114
|
+
optional :code, :enum, 1, "krpc.schema.Type.TypeCode"
|
115
|
+
optional :service, :string, 2
|
116
|
+
optional :name, :string, 3
|
117
|
+
repeated :types, :message, 4, "krpc.schema.Type"
|
118
|
+
end
|
119
|
+
add_enum "krpc.schema.Type.TypeCode" do
|
120
|
+
value :NONE, 0
|
121
|
+
value :DOUBLE, 1
|
122
|
+
value :FLOAT, 2
|
123
|
+
value :SINT32, 3
|
124
|
+
value :SINT64, 4
|
125
|
+
value :UINT32, 5
|
126
|
+
value :UINT64, 6
|
127
|
+
value :BOOL, 7
|
128
|
+
value :STRING, 8
|
129
|
+
value :BYTES, 9
|
130
|
+
value :CLASS, 100
|
131
|
+
value :ENUMERATION, 101
|
132
|
+
value :EVENT, 200
|
133
|
+
value :PROCEDURE_CALL, 201
|
134
|
+
value :STREAM, 202
|
135
|
+
value :STATUS, 203
|
136
|
+
value :SERVICES, 204
|
137
|
+
value :TUPLE, 300
|
138
|
+
value :LIST, 301
|
139
|
+
value :SET, 302
|
140
|
+
value :DICTIONARY, 303
|
141
|
+
end
|
142
|
+
add_message "krpc.schema.Tuple" do
|
143
|
+
repeated :items, :bytes, 1
|
144
|
+
end
|
145
|
+
add_message "krpc.schema.List" do
|
146
|
+
repeated :items, :bytes, 1
|
147
|
+
end
|
148
|
+
add_message "krpc.schema.Set" do
|
149
|
+
repeated :items, :bytes, 1
|
150
|
+
end
|
151
|
+
add_message "krpc.schema.Dictionary" do
|
152
|
+
repeated :entries, :message, 1, "krpc.schema.DictionaryEntry"
|
153
|
+
end
|
154
|
+
add_message "krpc.schema.DictionaryEntry" do
|
155
|
+
optional :key, :bytes, 1
|
156
|
+
optional :value, :bytes, 2
|
157
|
+
end
|
158
|
+
add_message "krpc.schema.Stream" do
|
159
|
+
optional :id, :uint64, 1
|
160
|
+
end
|
161
|
+
add_message "krpc.schema.Event" do
|
162
|
+
optional :stream, :message, 1, "krpc.schema.Stream"
|
163
|
+
end
|
164
|
+
add_message "krpc.schema.Status" do
|
165
|
+
optional :version, :string, 1
|
166
|
+
optional :bytes_read, :uint64, 2
|
167
|
+
optional :bytes_written, :uint64, 3
|
168
|
+
optional :bytes_read_rate, :float, 4
|
169
|
+
optional :bytes_written_rate, :float, 5
|
170
|
+
optional :rpcs_executed, :uint64, 6
|
171
|
+
optional :rpc_rate, :float, 7
|
172
|
+
optional :one_rpc_per_update, :bool, 8
|
173
|
+
optional :max_time_per_update, :uint32, 9
|
174
|
+
optional :adaptive_rate_control, :bool, 10
|
175
|
+
optional :blocking_recv, :bool, 11
|
176
|
+
optional :recv_timeout, :uint32, 12
|
177
|
+
optional :time_per_rpc_update, :float, 13
|
178
|
+
optional :poll_time_per_rpc_update, :float, 14
|
179
|
+
optional :exec_time_per_rpc_update, :float, 15
|
180
|
+
optional :stream_rpcs, :uint32, 16
|
181
|
+
optional :stream_rpcs_executed, :uint64, 17
|
182
|
+
optional :stream_rpc_rate, :float, 18
|
183
|
+
optional :time_per_stream_update, :float, 19
|
184
|
+
end
|
185
|
+
add_message "krpc.schema.MultiplexedRequest" do
|
186
|
+
optional :connection_request, :message, 1, "krpc.schema.ConnectionRequest"
|
187
|
+
optional :request, :message, 2, "krpc.schema.Request"
|
188
|
+
end
|
189
|
+
add_message "krpc.schema.MultiplexedResponse" do
|
190
|
+
optional :response, :message, 1, "krpc.schema.Response"
|
191
|
+
optional :stream_update, :message, 2, "krpc.schema.StreamUpdate"
|
192
|
+
end
|
172
193
|
end
|
173
194
|
end
|
174
195
|
|
175
196
|
module KRPC
|
176
197
|
module PB
|
177
|
-
ConnectionRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.ConnectionRequest").msgclass
|
178
|
-
ConnectionRequest::Type = Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.ConnectionRequest.Type").enummodule
|
179
|
-
ConnectionResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.ConnectionResponse").msgclass
|
180
|
-
ConnectionResponse::Status = Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.ConnectionResponse.Status").enummodule
|
181
|
-
Request = Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Request").msgclass
|
182
|
-
ProcedureCall = Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.ProcedureCall").msgclass
|
183
|
-
Argument = Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Argument").msgclass
|
184
|
-
Response = Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Response").msgclass
|
185
|
-
ProcedureResult = Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.ProcedureResult").msgclass
|
186
|
-
Error = Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Error").msgclass
|
187
|
-
StreamUpdate = Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.StreamUpdate").msgclass
|
188
|
-
StreamResult = Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.StreamResult").msgclass
|
189
|
-
Services = Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Services").msgclass
|
190
|
-
Service = Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Service").msgclass
|
191
|
-
Procedure = Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Procedure").msgclass
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
Type
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
198
|
+
ConnectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.ConnectionRequest").msgclass
|
199
|
+
ConnectionRequest::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.ConnectionRequest.Type").enummodule
|
200
|
+
ConnectionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.ConnectionResponse").msgclass
|
201
|
+
ConnectionResponse::Status = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.ConnectionResponse.Status").enummodule
|
202
|
+
Request = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Request").msgclass
|
203
|
+
ProcedureCall = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.ProcedureCall").msgclass
|
204
|
+
Argument = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Argument").msgclass
|
205
|
+
Response = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Response").msgclass
|
206
|
+
ProcedureResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.ProcedureResult").msgclass
|
207
|
+
Error = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Error").msgclass
|
208
|
+
StreamUpdate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.StreamUpdate").msgclass
|
209
|
+
StreamResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.StreamResult").msgclass
|
210
|
+
Services = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Services").msgclass
|
211
|
+
Service = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Service").msgclass
|
212
|
+
Procedure = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Procedure").msgclass
|
213
|
+
Procedure::GameScene = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Procedure.GameScene").enummodule
|
214
|
+
Parameter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Parameter").msgclass
|
215
|
+
Class = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Class").msgclass
|
216
|
+
Enumeration = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Enumeration").msgclass
|
217
|
+
EnumerationValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.EnumerationValue").msgclass
|
218
|
+
Exception = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Exception").msgclass
|
219
|
+
Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Type").msgclass
|
220
|
+
Type::TypeCode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Type.TypeCode").enummodule
|
221
|
+
Tuple = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Tuple").msgclass
|
222
|
+
List = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.List").msgclass
|
223
|
+
Set = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Set").msgclass
|
224
|
+
Dictionary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Dictionary").msgclass
|
225
|
+
DictionaryEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.DictionaryEntry").msgclass
|
226
|
+
Stream = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Stream").msgclass
|
227
|
+
Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Event").msgclass
|
228
|
+
Status = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.Status").msgclass
|
229
|
+
MultiplexedRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.MultiplexedRequest").msgclass
|
230
|
+
MultiplexedResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("krpc.schema.MultiplexedResponse").msgclass
|
207
231
|
end
|
208
232
|
end
|
data/lib/krpc/service.rb
CHANGED
@@ -93,6 +93,13 @@ module KRPC
|
|
93
93
|
params: [PB::Parameter.new(name: 'id', type: PB::Type.new(code: :UINT64))],
|
94
94
|
xmldoc: "<doc>\n<summary>\nStart a previously added streaming request.\n</summary>\n</doc>",
|
95
95
|
**opts
|
96
|
+
include_rpc_method 'KRPC', 'SetStreamRate',
|
97
|
+
params: [
|
98
|
+
PB::Parameter.new(name: 'id', type: PB::Type.new(code: :UINT64)),
|
99
|
+
PB::Parameter.new(name: 'rate', type: PB::Type.new(code: :FLOAT))
|
100
|
+
],
|
101
|
+
xmldoc: "<doc>\n<summary>\nSet the update rate for a stream in Hz.\n</summary>\n</doc>",
|
102
|
+
**opts
|
96
103
|
include_rpc_method 'KRPC', 'RemoveStream',
|
97
104
|
params: [PB::Parameter.new(name: 'id', type: PB::Type.new(code: :UINT64))],
|
98
105
|
xmldoc: "<doc>\n<summary>\nRemove a streaming request.\n</summary>\n</doc>",
|
data/lib/krpc/streaming.rb
CHANGED
@@ -80,7 +80,7 @@ module KRPC
|
|
80
80
|
end
|
81
81
|
|
82
82
|
class Stream
|
83
|
-
attr_reader :id, :method, :args, :kwargs, :return_type, :manager
|
83
|
+
attr_reader :id, :method, :args, :kwargs, :return_type, :rate, :manager
|
84
84
|
attr_writer :value
|
85
85
|
|
86
86
|
def initialize(manager, id, return_type, value, method, *args, **kwargs)
|
@@ -89,6 +89,7 @@ module KRPC
|
|
89
89
|
@return_type, @value = return_type, value
|
90
90
|
@method, @args, @kwargs = method, args, kwargs
|
91
91
|
@active = true
|
92
|
+
@rate = 0
|
92
93
|
end
|
93
94
|
|
94
95
|
# Get the current stream value. Has alias method `value`.
|
@@ -111,6 +112,11 @@ module KRPC
|
|
111
112
|
# WARNING: This method does not remove the stream. To remove the stream call Stream#remove instead.
|
112
113
|
def mark_as_inactive; @active = false end
|
113
114
|
|
115
|
+
def rate=(rate)
|
116
|
+
manager.client.core.set_stream_rate(id, rate)
|
117
|
+
@rate = rate
|
118
|
+
end
|
119
|
+
|
114
120
|
def to_s
|
115
121
|
inspect.gsub(/\n|\t/," ").squeeze(" ").uncolorize
|
116
122
|
end
|
@@ -127,6 +133,7 @@ module KRPC
|
|
127
133
|
"#<#{self.class}".green +
|
128
134
|
" @id" + "=".green + id.to_s.bold.blue +
|
129
135
|
" @active" + "=".green + @active.to_s.bold.light_cyan +
|
136
|
+
" @rate" + "=".green + rate.to_s.bold.blue +
|
130
137
|
"\n\t@method" + "=".green + method.inspect.green +
|
131
138
|
(args.empty? ? "" : "\n\t@args" + "=".green + coderay(args)) +
|
132
139
|
(kwargs.empty? ? "" : "\n\t@kwargs" + "=".green + coderay(kwargs)) +
|
data/lib/krpc/version.rb
CHANGED
@@ -3,9 +3,10 @@ module KRPC
|
|
3
3
|
# Dear krpc-rb developer: Before bumping version below, please ensure that protobuf schema is up to date.
|
4
4
|
MAJOR = 0
|
5
5
|
MINOR = 4
|
6
|
-
PATCH =
|
6
|
+
PATCH = 1
|
7
7
|
LABEL = nil
|
8
|
+
IS_STABLE = true
|
8
9
|
end
|
9
10
|
|
10
|
-
VERSION = ([Version::MAJOR, Version::MINOR, Version::PATCH, Version::LABEL].compact * '.').freeze
|
11
|
+
VERSION = ([Version::MAJOR, Version::MINOR, Version::PATCH, Version::LABEL, Version::IS_STABLE ? nil : "next"].compact * '.').freeze
|
11
12
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: krpc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomasz Więch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-protobuf
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '3.
|
19
|
+
version: '3.11'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '3.
|
26
|
+
version: '3.11'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: colorize
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,70 +44,70 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '1.
|
47
|
+
version: '1.10'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '1.
|
54
|
+
version: '1.10'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '1
|
61
|
+
version: '2.1'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '1
|
68
|
+
version: '2.1'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: pry
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0.
|
75
|
+
version: '0.13'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0.
|
82
|
+
version: '0.13'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '3.
|
89
|
+
version: '3.9'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '3.
|
96
|
+
version: '3.9'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rake
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '13.0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '13.0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: hanna-nouveau
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -171,15 +171,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
171
171
|
requirements:
|
172
172
|
- - ">="
|
173
173
|
- !ruby/object:Gem::Version
|
174
|
-
version: 2.
|
174
|
+
version: 2.3.0
|
175
175
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
176
176
|
requirements:
|
177
177
|
- - ">="
|
178
178
|
- !ruby/object:Gem::Version
|
179
179
|
version: '0'
|
180
180
|
requirements: []
|
181
|
-
|
182
|
-
rubygems_version: 2.6.8
|
181
|
+
rubygems_version: 3.0.8
|
183
182
|
signing_key:
|
184
183
|
specification_version: 4
|
185
184
|
summary: Client library for kRPC
|