procon_bypass_man 0.1.15 → 0.1.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +1 -0
- data/.github/workflows/release.yml +2 -2
- data/.rubocop.yml +2 -0
- data/CHANGELOG.md +17 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +29 -7
- data/README.md +32 -4
- data/Steepfile +31 -17
- data/docs/setting/left-analogstick-cap.md +60 -0
- data/docs/setting/splatoon2_macro_sokuwari_bubble.md +52 -0
- data/docs/setup_raspi.md +2 -0
- data/docs/setup_raspi.mitamae.rb +7 -8
- data/docs/setup_raspi_by_mitamae.md +37 -1
- data/docs/upgrade_pbm.md +32 -0
- data/lib/ext/em_pure_ruby.rb +25 -0
- data/lib/ext/module.rb +16 -0
- data/lib/procon_bypass_man/background.rb +0 -1
- data/lib/procon_bypass_man/buttons_setting_configuration/layer.rb +35 -13
- data/lib/procon_bypass_man/buttons_setting_configuration/loader.rb +4 -1
- data/lib/procon_bypass_man/buttons_setting_configuration/validator.rb +36 -0
- data/lib/procon_bypass_man/buttons_setting_configuration.rb +28 -13
- data/lib/procon_bypass_man/bypass/usb_hid_logger.rb +6 -4
- data/lib/procon_bypass_man/bypass.rb +13 -6
- data/lib/procon_bypass_man/commands/bypass_command.rb +2 -2
- data/lib/procon_bypass_man/commands/print_boot_message_command.rb +50 -1
- data/lib/procon_bypass_man/commands/print_message_command.rb +8 -0
- data/lib/procon_bypass_man/commands/run_remote_pbm_action_dispatch_command.rb +1 -1
- data/lib/procon_bypass_man/commands/send_reload_config_event_command.rb +1 -2
- data/lib/procon_bypass_man/commands.rb +1 -0
- data/lib/procon_bypass_man/configuration.rb +32 -1
- data/lib/procon_bypass_man/domains/binary/base.rb +25 -0
- data/lib/procon_bypass_man/domains/binary/has_immutable_binary.rb +5 -0
- data/lib/procon_bypass_man/domains/binary/has_mutable_binary.rb +5 -0
- data/lib/procon_bypass_man/domains/binary/inbound_procon_binary.rb +9 -0
- data/lib/procon_bypass_man/domains/binary/processing_procon_binary.rb +66 -0
- data/lib/procon_bypass_man/domains.rb +11 -0
- data/lib/procon_bypass_man/plugin/splatoon2/macro/fast_return.rb +1 -1
- data/lib/procon_bypass_man/plugin/splatoon2/macro/jump_to_left_key.rb +1 -1
- data/lib/procon_bypass_man/plugin/splatoon2/macro/jump_to_right_key.rb +1 -1
- data/lib/procon_bypass_man/plugin/splatoon2/macro/jump_to_up_key.rb +1 -1
- data/lib/procon_bypass_man/plugin/splatoon2/macro/sokuwari_for_splash_bomb.rb +22 -0
- data/lib/procon_bypass_man/plugin/splatoon2/version.rb +1 -1
- data/lib/procon_bypass_man/{plugin.rb → plugins.rb} +1 -0
- data/lib/procon_bypass_man/processor.rb +4 -5
- data/lib/procon_bypass_man/procon/button.rb +11 -0
- data/lib/procon_bypass_man/procon/button_collection.rb +9 -11
- data/lib/procon_bypass_man/procon/layer_changer.rb +3 -2
- data/lib/procon_bypass_man/procon/macro.rb +89 -0
- data/lib/procon_bypass_man/procon/macro_builder.rb +123 -0
- data/lib/procon_bypass_man/procon/macro_registry.rb +9 -27
- data/lib/procon_bypass_man/procon/mode_registry.rb +4 -4
- data/lib/procon_bypass_man/procon/press_button_aware.rb +9 -7
- data/lib/procon_bypass_man/procon/user_operation.rb +58 -61
- data/lib/procon_bypass_man/procon/{analog_stick.rb → value_objects/analog_stick.rb} +3 -4
- data/lib/procon_bypass_man/procon/value_objects/procon_reader.rb +34 -0
- data/lib/procon_bypass_man/procon.rb +20 -16
- data/lib/procon_bypass_man/remote_pbm_action/{lib → commands}/update_remote_pbm_action_status_command.rb +0 -0
- data/lib/procon_bypass_man/remote_pbm_action/restore_pbm_setting.rb +1 -1
- data/lib/procon_bypass_man/{value_objects → remote_pbm_action/value_objects}/remote_pbm_action_object.rb +0 -0
- data/lib/procon_bypass_man/remote_pbm_action.rb +1 -1
- data/lib/procon_bypass_man/runner.rb +3 -3
- data/lib/procon_bypass_man/scheduler.rb +0 -7
- data/lib/procon_bypass_man/support/compress_array.rb +5 -0
- data/lib/procon_bypass_man/support/http_client.rb +4 -0
- data/lib/procon_bypass_man/support/on_memory_cache.rb +3 -1
- data/lib/procon_bypass_man/support/server_pool.rb +4 -0
- data/lib/procon_bypass_man/version.rb +1 -1
- data/lib/procon_bypass_man/websocket/pbm_job_client.rb +90 -0
- data/lib/procon_bypass_man.rb +13 -6
- data/procon_bypass_man.gemspec +3 -1
- data/project_template/README.md +10 -5
- data/project_template/app.rb +3 -2
- data/sig/main.rbs +226 -41
- data/sig/on_memory_cache.rbs +16 -0
- metadata +56 -13
- data/lib/procon_bypass_man/background/jobs/fetch_and_run_remote_pbm_action_job.rb +0 -29
- data/lib/procon_bypass_man/boot_message.rb +0 -48
- data/lib/procon_bypass_man/commands/run_local_shell_command.rb +0 -6
- data/lib/procon_bypass_man/procon_reader.rb +0 -31
data/sig/main.rbs
CHANGED
@@ -34,7 +34,13 @@ module ProconBypassMan
|
|
34
34
|
|
35
35
|
def self.root=: (untyped path) -> untyped
|
36
36
|
|
37
|
+
def self.pid: () -> Integer
|
38
|
+
|
37
39
|
def self.digest_path: () -> ::String
|
40
|
+
|
41
|
+
def self.session_id: () -> ::String
|
42
|
+
|
43
|
+
def self.device_id: () -> ::String
|
38
44
|
end
|
39
45
|
|
40
46
|
class ProconBypassMan::Bypass
|
@@ -166,42 +172,60 @@ end
|
|
166
172
|
|
167
173
|
class ProconBypassMan::Configuration
|
168
174
|
module ClassMethods
|
169
|
-
def root: () ->
|
175
|
+
def root: () -> String
|
170
176
|
|
171
|
-
def logger: () ->
|
177
|
+
def logger: () -> Logger
|
172
178
|
|
173
179
|
def error_logger: () -> untyped
|
174
180
|
|
175
|
-
def pid_path: () ->
|
181
|
+
def pid_path: () -> String
|
176
182
|
|
177
|
-
def digest_path: () ->
|
183
|
+
def digest_path: () -> String
|
178
184
|
|
179
|
-
def cache: () ->
|
185
|
+
def cache: () -> ProconBypassMan::OnMemoryCache
|
180
186
|
|
181
|
-
def config: () ->
|
187
|
+
def config: () -> ProconBypassMan::Configuration
|
182
188
|
end
|
183
189
|
|
184
190
|
attr_reader api_server: untyped
|
185
191
|
attr_reader api_servers: untyped
|
186
192
|
|
187
|
-
attr_accessor enable_critical_error_logging:
|
193
|
+
attr_accessor enable_critical_error_logging: bool
|
188
194
|
|
189
|
-
def root=: (
|
195
|
+
def root=: (String path) -> ProconBypassMan::Configuration
|
190
196
|
|
191
|
-
def root: () ->
|
197
|
+
def root: () -> String
|
192
198
|
|
193
199
|
def api_server=: (untyped api_server) -> untyped
|
194
200
|
|
195
|
-
def logger=: (
|
201
|
+
def logger=: (Logger logger) -> ProconBypassMan::Configuration
|
196
202
|
|
197
|
-
def logger: () ->
|
203
|
+
def logger: () -> Logger
|
198
204
|
|
199
|
-
def error_logger: () ->
|
205
|
+
def error_logger: () -> Logger
|
200
206
|
|
201
|
-
def digest_path: () ->
|
207
|
+
def digest_path: () -> String
|
202
208
|
|
203
209
|
# @return [String] pbm-webの接続先
|
204
|
-
def
|
210
|
+
def current_server: () -> String
|
211
|
+
|
212
|
+
def current_ws_server: () -> (String | nil)
|
213
|
+
|
214
|
+
def current_ws_server_url: () -> ::String
|
215
|
+
|
216
|
+
def enable_ws?: () -> bool
|
217
|
+
|
218
|
+
def server_pool: () -> untyped
|
219
|
+
|
220
|
+
def internal_server_pool: () -> untyped
|
221
|
+
|
222
|
+
def internal_servers: () -> ::Array[string | nil]
|
223
|
+
|
224
|
+
def internal_api_servers: () -> ::Array[untyped]
|
225
|
+
|
226
|
+
def raw_setting: () -> untyped
|
227
|
+
|
228
|
+
def verbose_bypass_log: () -> bool
|
205
229
|
end
|
206
230
|
|
207
231
|
|
@@ -373,41 +397,41 @@ end
|
|
373
397
|
|
374
398
|
class ProconBypassMan::Procon::MacroRegistry
|
375
399
|
class Macro
|
376
|
-
attr_accessor name:
|
400
|
+
attr_accessor name: Symbol
|
377
401
|
|
378
402
|
attr_accessor steps: untyped
|
379
403
|
|
380
|
-
def initialize: (name: untyped
|
404
|
+
def initialize: (name: untyped Symbol, steps: Symbol) -> void
|
381
405
|
|
382
|
-
def next_step: () ->
|
406
|
+
def next_step: () -> Symbol
|
383
407
|
|
384
|
-
def finished?: () ->
|
408
|
+
def finished?: () -> bool
|
385
409
|
|
386
|
-
def ongoing?: () ->
|
410
|
+
def ongoing?: () -> bool
|
387
411
|
end
|
388
412
|
|
389
|
-
PRESETS: ::Hash[
|
413
|
+
PRESETS: ::Hash[Symbol, Array[Symbol]]
|
390
414
|
|
391
415
|
def self.install_plugin: (untyped klass) -> untyped
|
392
416
|
|
393
|
-
def self.load: (
|
417
|
+
def self.load: (Symbol name) -> untyped
|
394
418
|
|
395
|
-
def self.reset!: () ->
|
419
|
+
def self.reset!: () -> void
|
396
420
|
|
397
|
-
def self.plugins: () ->
|
421
|
+
def self.plugins: () -> ::Hash[Symbol, Array[Symbol]]
|
398
422
|
end
|
399
423
|
|
400
424
|
class ProconBypassMan::Procon::ModeRegistry
|
401
425
|
class Mode
|
402
|
-
attr_accessor name:
|
426
|
+
attr_accessor name: Symbol
|
403
427
|
|
404
|
-
attr_accessor binaries:
|
428
|
+
attr_accessor binaries: Array[String]
|
405
429
|
|
406
|
-
attr_accessor source_binaries:
|
430
|
+
attr_accessor source_binaries: Array[String]
|
407
431
|
|
408
|
-
def initialize: (name:
|
432
|
+
def initialize: (name: Symbol, binaries: Array[String]) -> void
|
409
433
|
|
410
|
-
def next_binary: () ->
|
434
|
+
def next_binary: () -> String
|
411
435
|
end
|
412
436
|
|
413
437
|
PRESETS: ::Hash[untyped, untyped]
|
@@ -421,30 +445,20 @@ class ProconBypassMan::Procon::ModeRegistry
|
|
421
445
|
def self.plugins: () -> untyped
|
422
446
|
end
|
423
447
|
|
424
|
-
module ProconBypassMan::Procon::PressedButtonHelper
|
425
|
-
module Static
|
426
|
-
def pressed_button?: (untyped button) -> untyped
|
427
|
-
end
|
428
|
-
end
|
429
|
-
|
430
448
|
class ProconBypassMan::Procon
|
431
449
|
class UserOperation
|
432
450
|
include LayerChangeable
|
433
451
|
|
434
|
-
include PressedButtonHelper::Static
|
435
|
-
|
436
452
|
attr_reader binary: untyped
|
437
453
|
|
438
454
|
def initialize: (untyped binary) -> untyped
|
439
455
|
|
440
|
-
ZERO_BIT: untyped
|
441
|
-
|
442
456
|
ASCII_ENCODING: ::String
|
443
457
|
|
444
458
|
# @depilicate
|
445
459
|
def binary=: (untyped binary) -> untyped
|
446
460
|
|
447
|
-
def set_no_action!: () ->
|
461
|
+
def set_no_action!: () -> void
|
448
462
|
|
449
463
|
def unpress_button: (untyped button) -> untyped
|
450
464
|
|
@@ -482,7 +496,7 @@ module ProconBypassMan
|
|
482
496
|
end
|
483
497
|
|
484
498
|
# 5秒後がタイムアウト
|
485
|
-
def initialize: (?timeout: untyped timeout) ->
|
499
|
+
def initialize: (?timeout: untyped timeout) -> void
|
486
500
|
|
487
501
|
def throw_if_timeout!: () -> untyped
|
488
502
|
end
|
@@ -494,7 +508,7 @@ module ProconBypassMan
|
|
494
508
|
def self.from_boot: () -> Integer
|
495
509
|
|
496
510
|
# @param [String] uptime_cmd_result
|
497
|
-
def initialize: (uptime_cmd_result: String
|
511
|
+
def initialize: (uptime_cmd_result: String) -> void
|
498
512
|
|
499
513
|
# @return [Integer]
|
500
514
|
def from_boot: () -> Integer
|
@@ -504,3 +518,174 @@ end
|
|
504
518
|
module ProconBypassMan
|
505
519
|
VERSION: ::String
|
506
520
|
end
|
521
|
+
|
522
|
+
module ProconBypassMan
|
523
|
+
module Domains
|
524
|
+
module Binary
|
525
|
+
end
|
526
|
+
end
|
527
|
+
end
|
528
|
+
|
529
|
+
class ProconBypassMan::Domains::Binary::Base
|
530
|
+
# @param [String] binary
|
531
|
+
def initialize: (binary: untyped binary) -> void
|
532
|
+
|
533
|
+
# @return [String] バイナリ
|
534
|
+
def binary: () -> untyped
|
535
|
+
|
536
|
+
# @return [String]
|
537
|
+
def raw: () -> ::String
|
538
|
+
|
539
|
+
def unpack: () -> Array[::String]
|
540
|
+
|
541
|
+
# @return [ProconBypassMan::ProconReader]
|
542
|
+
def to_procon_reader: () -> untyped
|
543
|
+
end
|
544
|
+
|
545
|
+
module ProconBypassMan::Domains::HasImmutableBinary
|
546
|
+
def binary: () -> untyped
|
547
|
+
end
|
548
|
+
|
549
|
+
module ProconBypassMan::Domains::HasMutableBinary
|
550
|
+
def binary: () -> untyped
|
551
|
+
end
|
552
|
+
|
553
|
+
class ProconBypassMan::Domains::InboundProconBinary < ProconBypassMan::Domains::Binary::Base
|
554
|
+
include ProconBypassMan::Domains::HasImmutableBinary
|
555
|
+
|
556
|
+
# @return [Boolean]
|
557
|
+
def user_operation_data?: () -> bool
|
558
|
+
end
|
559
|
+
|
560
|
+
# バイナリの書き換えのみをする
|
561
|
+
class ProconBypassMan::Domains::ProcessingProconBinary < ProconBypassMan::Domains::Binary::Base
|
562
|
+
include ProconBypassMan::Domains::HasMutableBinary
|
563
|
+
|
564
|
+
ALL_ZERO_BIT: ::String
|
565
|
+
|
566
|
+
def set_no_action!: () -> untyped
|
567
|
+
|
568
|
+
# @param [ProconBypassMan::Domains::ProcessingProconBinary]
|
569
|
+
# @return [ProconBypassMan::Domains::ProcessingProconBinary]
|
570
|
+
# アナログスティックは上書きし、ボタンだけマージする
|
571
|
+
def write_as_merge!: (untyped target_binary) -> ProconBypassMan::Domains::ProcessingProconBinary
|
572
|
+
|
573
|
+
# @param [Symbol] button
|
574
|
+
def write_as_press_button: (Symbol button) -> void
|
575
|
+
|
576
|
+
# @param [Symbol] button
|
577
|
+
def write_as_unpress_button: (Symbol button) -> void
|
578
|
+
|
579
|
+
# @param [Symbol] button
|
580
|
+
def write_as_press_button_only: (Symbol button) -> void
|
581
|
+
|
582
|
+
# @param [Integer] cap
|
583
|
+
def write_as_apply_left_analog_stick_cap: (cap: Integer cap) -> void
|
584
|
+
end
|
585
|
+
|
586
|
+
module ProconBypassMan
|
587
|
+
class HttpClient
|
588
|
+
@server_pool: untyped
|
589
|
+
@uri: ::URI
|
590
|
+
@retry_on_connection_error: false
|
591
|
+
|
592
|
+
def initialize: (path: String, server_pool: untyped, ?retry_on_connection_error: false) -> void
|
593
|
+
def get: -> nil
|
594
|
+
def post: (request_body: untyped) -> nil
|
595
|
+
def put: (request_body: untyped) -> nil
|
596
|
+
|
597
|
+
private
|
598
|
+
def process_response: (untyped response) -> untyped
|
599
|
+
def handle_request: { -> bot } -> nil
|
600
|
+
|
601
|
+
class HttpRequest
|
602
|
+
class Get
|
603
|
+
def self.request!: (uri: ::URI) -> untyped
|
604
|
+
end
|
605
|
+
|
606
|
+
class Post
|
607
|
+
def self.request!: (uri: ::URI, ?request_body: Hash[untyped, untyped]) -> untyped
|
608
|
+
end
|
609
|
+
|
610
|
+
class Put
|
611
|
+
def self.request!: (uri: ::URI, ?request_body: {hostname: String}) -> untyped
|
612
|
+
end
|
613
|
+
end
|
614
|
+
end
|
615
|
+
end
|
616
|
+
|
617
|
+
module ProconBypassMan
|
618
|
+
class SendDeviceStatsHttpClient
|
619
|
+
def post: (status: ::Symbol, pbm_session_id: String) -> untyped
|
620
|
+
end
|
621
|
+
end
|
622
|
+
|
623
|
+
module ProconBypassMan
|
624
|
+
class ReportHttpClient
|
625
|
+
def post: (body: Hash[untyped, untyped] | String, event_type: ::Symbol) -> untyped
|
626
|
+
end
|
627
|
+
end
|
628
|
+
|
629
|
+
module ProconBypassMan
|
630
|
+
class UpdateRemotePbmActionStatusHttpClient
|
631
|
+
def post: (to_status: ::Symbol) -> untyped
|
632
|
+
end
|
633
|
+
end
|
634
|
+
|
635
|
+
module ProconBypassMan
|
636
|
+
class ServerPool
|
637
|
+
@servers: Array[String]
|
638
|
+
@index: Integer?
|
639
|
+
|
640
|
+
def initialize: (servers: Array[String]) -> void
|
641
|
+
def pick: -> String?
|
642
|
+
def server: -> String?
|
643
|
+
def next!: -> nil
|
644
|
+
|
645
|
+
private
|
646
|
+
def reset: -> Integer
|
647
|
+
def inc_index: -> Integer
|
648
|
+
end
|
649
|
+
end
|
650
|
+
|
651
|
+
module ProconBypassMan
|
652
|
+
class CompressArray
|
653
|
+
@array: [String]
|
654
|
+
|
655
|
+
def initialize: ([String] array) -> void
|
656
|
+
def compress: -> Array[String?]
|
657
|
+
|
658
|
+
class CompressibleValue
|
659
|
+
@prev: String?
|
660
|
+
@current: String
|
661
|
+
|
662
|
+
def initialize: (String? prev, String current) -> void
|
663
|
+
def compress?: -> bool
|
664
|
+
def to_s_with_mark: -> String?
|
665
|
+
end
|
666
|
+
end
|
667
|
+
end
|
668
|
+
|
669
|
+
module ProconBypassMan
|
670
|
+
module Callbacks
|
671
|
+
def run_callbacks: (untyped kind) -> untyped
|
672
|
+
def get_callbacks: (untyped kind) -> untyped
|
673
|
+
def set_callbacks: (untyped name, untyped callbacks) -> untyped
|
674
|
+
|
675
|
+
class CallbacksChain
|
676
|
+
@block: nil
|
677
|
+
|
678
|
+
attr_accessor filter: untyped
|
679
|
+
attr_accessor chain_method: untyped
|
680
|
+
def initialize: (filter: untyped, chain_method: untyped, block: nil) -> void
|
681
|
+
end
|
682
|
+
|
683
|
+
module M
|
684
|
+
end
|
685
|
+
|
686
|
+
module ClassMethods
|
687
|
+
def define_callbacks: (untyped name) -> untyped
|
688
|
+
def set_callback: (untyped kind, untyped filter, untyped chain_method) -> CallbacksChain
|
689
|
+
end
|
690
|
+
end
|
691
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class ProconBypassMan::OnMemoryCache
|
2
|
+
class CacheValue
|
3
|
+
# @param [Time]
|
4
|
+
attr_accessor expired_at: Time
|
5
|
+
|
6
|
+
attr_accessor value: untyped
|
7
|
+
|
8
|
+
def initialize: (expired_at: Time, value: untyped) -> void
|
9
|
+
end
|
10
|
+
|
11
|
+
def initialize: () -> void
|
12
|
+
|
13
|
+
# @param [Integer] expires_in 秒数
|
14
|
+
# @param [String] key
|
15
|
+
def fetch: (key: string, expires_in: Time) { () -> untyped } -> untyped
|
16
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: procon_bypass_man
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jiikko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pbmenv
|
@@ -24,7 +24,35 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: action_cable_client
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: sorted_set
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: A programmable converter for Nintendo Switch Pro Controller
|
28
56
|
email:
|
29
57
|
- n905i.1214@gmail.com
|
30
58
|
executables: []
|
@@ -49,9 +77,14 @@ files:
|
|
49
77
|
- bin/dev_api_server.rb
|
50
78
|
- bin/setup
|
51
79
|
- docs/how_to_connect_procon.md
|
80
|
+
- docs/setting/left-analogstick-cap.md
|
81
|
+
- docs/setting/splatoon2_macro_sokuwari_bubble.md
|
52
82
|
- docs/setup_raspi.md
|
53
83
|
- docs/setup_raspi.mitamae.rb
|
54
84
|
- docs/setup_raspi_by_mitamae.md
|
85
|
+
- docs/upgrade_pbm.md
|
86
|
+
- lib/ext/em_pure_ruby.rb
|
87
|
+
- lib/ext/module.rb
|
55
88
|
- lib/procon_bypass_man.rb
|
56
89
|
- lib/procon_bypass_man/background.rb
|
57
90
|
- lib/procon_bypass_man/background/job_performer.rb
|
@@ -60,7 +93,6 @@ files:
|
|
60
93
|
- lib/procon_bypass_man/background/jobs/concerns/has_external_api_setting.rb
|
61
94
|
- lib/procon_bypass_man/background/jobs/concerns/has_internal_api_setting.rb
|
62
95
|
- lib/procon_bypass_man/background/jobs/concerns/job_runnable.rb
|
63
|
-
- lib/procon_bypass_man/background/jobs/fetch_and_run_remote_pbm_action_job.rb
|
64
96
|
- lib/procon_bypass_man/background/jobs/report_boot_job.rb
|
65
97
|
- lib/procon_bypass_man/background/jobs/report_error_job.rb
|
66
98
|
- lib/procon_bypass_man/background/jobs/report_event_base_job.rb
|
@@ -68,7 +100,6 @@ files:
|
|
68
100
|
- lib/procon_bypass_man/background/jobs/report_pressed_buttons_job.rb
|
69
101
|
- lib/procon_bypass_man/background/jobs/report_reload_config_job.rb
|
70
102
|
- lib/procon_bypass_man/background/jobs/sync_device_stats_job.rb
|
71
|
-
- lib/procon_bypass_man/boot_message.rb
|
72
103
|
- lib/procon_bypass_man/buttons_setting_configuration.rb
|
73
104
|
- lib/procon_bypass_man/buttons_setting_configuration/layer.rb
|
74
105
|
- lib/procon_bypass_man/buttons_setting_configuration/loader.rb
|
@@ -79,7 +110,7 @@ files:
|
|
79
110
|
- lib/procon_bypass_man/commands/bypass_command.rb
|
80
111
|
- lib/procon_bypass_man/commands/connect_device_command.rb
|
81
112
|
- lib/procon_bypass_man/commands/print_boot_message_command.rb
|
82
|
-
- lib/procon_bypass_man/commands/
|
113
|
+
- lib/procon_bypass_man/commands/print_message_command.rb
|
83
114
|
- lib/procon_bypass_man/commands/run_remote_pbm_action_dispatch_command.rb
|
84
115
|
- lib/procon_bypass_man/commands/send_error_command.rb
|
85
116
|
- lib/procon_bypass_man/commands/send_reload_config_event_command.rb
|
@@ -88,34 +119,45 @@ files:
|
|
88
119
|
- lib/procon_bypass_man/configuration.rb
|
89
120
|
- lib/procon_bypass_man/device_connector.rb
|
90
121
|
- lib/procon_bypass_man/device_status.rb
|
122
|
+
- lib/procon_bypass_man/domains.rb
|
123
|
+
- lib/procon_bypass_man/domains/binary/base.rb
|
124
|
+
- lib/procon_bypass_man/domains/binary/has_immutable_binary.rb
|
125
|
+
- lib/procon_bypass_man/domains/binary/has_mutable_binary.rb
|
126
|
+
- lib/procon_bypass_man/domains/binary/inbound_procon_binary.rb
|
127
|
+
- lib/procon_bypass_man/domains/binary/processing_procon_binary.rb
|
91
128
|
- lib/procon_bypass_man/io_monitor.rb
|
92
|
-
- lib/procon_bypass_man/plugin.rb
|
93
129
|
- lib/procon_bypass_man/plugin/splatoon2/macro/fast_return.rb
|
94
130
|
- lib/procon_bypass_man/plugin/splatoon2/macro/jump_to_left_key.rb
|
95
131
|
- lib/procon_bypass_man/plugin/splatoon2/macro/jump_to_right_key.rb
|
96
132
|
- lib/procon_bypass_man/plugin/splatoon2/macro/jump_to_up_key.rb
|
133
|
+
- lib/procon_bypass_man/plugin/splatoon2/macro/sokuwari_for_splash_bomb.rb
|
97
134
|
- lib/procon_bypass_man/plugin/splatoon2/mode/guruguru.rb
|
98
135
|
- lib/procon_bypass_man/plugin/splatoon2/version.rb
|
136
|
+
- lib/procon_bypass_man/plugins.rb
|
99
137
|
- lib/procon_bypass_man/processor.rb
|
100
138
|
- lib/procon_bypass_man/procon.rb
|
101
|
-
- lib/procon_bypass_man/procon/analog_stick.rb
|
102
139
|
- lib/procon_bypass_man/procon/analog_stick_cap.rb
|
140
|
+
- lib/procon_bypass_man/procon/button.rb
|
103
141
|
- lib/procon_bypass_man/procon/button_collection.rb
|
104
142
|
- lib/procon_bypass_man/procon/consts.rb
|
105
143
|
- lib/procon_bypass_man/procon/flip_cache.rb
|
106
144
|
- lib/procon_bypass_man/procon/layer_changer.rb
|
145
|
+
- lib/procon_bypass_man/procon/macro.rb
|
146
|
+
- lib/procon_bypass_man/procon/macro_builder.rb
|
107
147
|
- lib/procon_bypass_man/procon/macro_registry.rb
|
108
148
|
- lib/procon_bypass_man/procon/mode_registry.rb
|
109
149
|
- lib/procon_bypass_man/procon/press_button_aware.rb
|
110
150
|
- lib/procon_bypass_man/procon/user_operation.rb
|
111
|
-
- lib/procon_bypass_man/
|
151
|
+
- lib/procon_bypass_man/procon/value_objects/analog_stick.rb
|
152
|
+
- lib/procon_bypass_man/procon/value_objects/procon_reader.rb
|
112
153
|
- lib/procon_bypass_man/remote_pbm_action.rb
|
113
154
|
- lib/procon_bypass_man/remote_pbm_action/base_action.rb
|
114
155
|
- lib/procon_bypass_man/remote_pbm_action/change_pbm_version_action.rb
|
115
|
-
- lib/procon_bypass_man/remote_pbm_action/
|
156
|
+
- lib/procon_bypass_man/remote_pbm_action/commands/update_remote_pbm_action_status_command.rb
|
116
157
|
- lib/procon_bypass_man/remote_pbm_action/reboot_os_action.rb
|
117
158
|
- lib/procon_bypass_man/remote_pbm_action/restore_pbm_setting.rb
|
118
159
|
- lib/procon_bypass_man/remote_pbm_action/stop_pbm_action.rb
|
160
|
+
- lib/procon_bypass_man/remote_pbm_action/value_objects/remote_pbm_action_object.rb
|
119
161
|
- lib/procon_bypass_man/runner.rb
|
120
162
|
- lib/procon_bypass_man/scheduler.rb
|
121
163
|
- lib/procon_bypass_man/support/callbacks.rb
|
@@ -129,8 +171,8 @@ files:
|
|
129
171
|
- lib/procon_bypass_man/support/signal_handler.rb
|
130
172
|
- lib/procon_bypass_man/support/update_remote_pbm_action_status_http_client.rb
|
131
173
|
- lib/procon_bypass_man/support/uptime.rb
|
132
|
-
- lib/procon_bypass_man/value_objects/remote_pbm_action_object.rb
|
133
174
|
- lib/procon_bypass_man/version.rb
|
175
|
+
- lib/procon_bypass_man/websocket/pbm_job_client.rb
|
134
176
|
- procon_bypass_man.gemspec
|
135
177
|
- project_template/README.md
|
136
178
|
- project_template/app.rb
|
@@ -140,6 +182,7 @@ files:
|
|
140
182
|
- project_template/web.rb
|
141
183
|
- sig/README.md
|
142
184
|
- sig/main.rbs
|
185
|
+
- sig/on_memory_cache.rbs
|
143
186
|
homepage: https://github.com/splaplapla/procon_bypass_man
|
144
187
|
licenses:
|
145
188
|
- MIT
|
@@ -162,8 +205,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
205
|
- !ruby/object:Gem::Version
|
163
206
|
version: '0'
|
164
207
|
requirements: []
|
165
|
-
rubygems_version: 3.
|
208
|
+
rubygems_version: 3.2.15
|
166
209
|
signing_key:
|
167
210
|
specification_version: 4
|
168
|
-
summary:
|
211
|
+
summary: A programmable converter for Nintendo Switch Pro Controller
|
169
212
|
test_files: []
|
@@ -1,29 +0,0 @@
|
|
1
|
-
class ProconBypassMan::FetchAndRunRemotePbmActionJob < ProconBypassMan::BaseJob
|
2
|
-
extend ProconBypassMan::HasExternalApiSetting
|
3
|
-
|
4
|
-
def self.perform
|
5
|
-
pbm_jobs = ProconBypassMan::HttpClient.new(path: path, server_pool: server_pool).get
|
6
|
-
if pbm_jobs.nil? || pbm_jobs.size.zero?
|
7
|
-
# ProconBypassMan.logger.debug "remote pbm_jobsはありませんでした"
|
8
|
-
return
|
9
|
-
else
|
10
|
-
pbm_job_hash = pbm_jobs.first
|
11
|
-
begin
|
12
|
-
pbm_job_object = ProconBypassMan::RemotePbmActionObject.new(action: pbm_job_hash["action"],
|
13
|
-
status: pbm_job_hash["status"],
|
14
|
-
uuid: pbm_job_hash["uuid"],
|
15
|
-
created_at: pbm_job_hash["created_at"],
|
16
|
-
job_args: pbm_job_hash["args"])
|
17
|
-
pbm_job_object.validate!
|
18
|
-
ProconBypassMan::RunRemotePbmActionDispatchCommand.execute(action: pbm_job_object.action, uuid: pbm_job_object.uuid, job_args: pbm_job_object.job_args)
|
19
|
-
rescue ProconBypassMan::RemotePbmActionObject::ValidationError => e
|
20
|
-
ProconBypassMan::SendErrorCommand.execute(error: e)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def self.path
|
26
|
-
device_id = ProconBypassMan.device_id
|
27
|
-
"/api/devices/#{device_id}/pbm_jobs"
|
28
|
-
end
|
29
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
class ProconBypassMan::BootMessage
|
2
|
-
def initialize
|
3
|
-
@table = {}
|
4
|
-
@table[:ruby_version] = RUBY_VERSION
|
5
|
-
@table[:pbm_version] = ProconBypassMan::VERSION
|
6
|
-
@table[:pid] = $$
|
7
|
-
@table[:root_path] = ProconBypassMan.root
|
8
|
-
@table[:pid_path] = ProconBypassMan.pid_path
|
9
|
-
@table[:setting_path] = ProconBypassMan::ButtonsSettingConfiguration.instance.setting_path
|
10
|
-
@table[:uptime_from_boot] = ProconBypassMan::Uptime.from_boot
|
11
|
-
@table[:use_pbmenv] = !(!!`which pbmenv`.empty?)
|
12
|
-
@table[:session_id] = ProconBypassMan.session_id
|
13
|
-
@table[:device_id] = ProconBypassMan.device_id
|
14
|
-
|
15
|
-
# 開発中のHEADを取りたかったけど、Gem::Specification経由から取得する必要がありそう
|
16
|
-
# build_version = `git rev-parse --short HEAD`.chomp
|
17
|
-
# if build_version.empty?
|
18
|
-
# @table[:build_version] = 'release version'
|
19
|
-
# else
|
20
|
-
# @table[:build_version] = build_version
|
21
|
-
# end
|
22
|
-
|
23
|
-
# build version: #{@table[:build_version]}
|
24
|
-
end
|
25
|
-
|
26
|
-
# @return [String]
|
27
|
-
def to_s
|
28
|
-
booted_message = <<~EOF
|
29
|
-
----
|
30
|
-
RUBY_VERSION: #{@table[:ruby_version]}
|
31
|
-
ProconBypassMan::VERSION: #{@table[:pbm_version]}
|
32
|
-
pid: #{@table[:pid]}
|
33
|
-
root: #{@table[:root_path]}
|
34
|
-
pid_path: #{@table[:pid_path]}
|
35
|
-
setting_path: #{@table[:setting_path]}
|
36
|
-
uptime from boot: #{@table[:uptime_from_boot]} sec
|
37
|
-
use_pbmenv: #{@table[:use_pbmenv]}
|
38
|
-
session_id: #{ProconBypassMan.session_id}
|
39
|
-
device_id: #{ProconBypassMan.device_id}
|
40
|
-
----
|
41
|
-
EOF
|
42
|
-
end
|
43
|
-
|
44
|
-
# @return [Hash]
|
45
|
-
def to_hash
|
46
|
-
@table
|
47
|
-
end
|
48
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
class ProconBypassMan::ProconReader
|
2
|
-
def initialize(binary: )
|
3
|
-
@binary = binary
|
4
|
-
@analog_stick = ProconBypassMan::Procon::AnalogStick.new(binary: binary)
|
5
|
-
end
|
6
|
-
|
7
|
-
# @return [Array<Symbol>]
|
8
|
-
def pressed
|
9
|
-
aware = ProconBypassMan::PpressButtonAware.new(@binary)
|
10
|
-
pressed_table = ::ProconBypassMan::Procon::ButtonCollection::BUTTONS.reduce({}) do |acc, button|
|
11
|
-
acc[button] = aware.pressed_button?(button)
|
12
|
-
acc
|
13
|
-
end
|
14
|
-
pressed_table.select { |_key, value| value }.keys
|
15
|
-
end
|
16
|
-
|
17
|
-
def left_analog_stick
|
18
|
-
{ x: @analog_stick.relative_x, y: @analog_stick.relative_y }
|
19
|
-
end
|
20
|
-
|
21
|
-
def left_analog_stick_by_abs
|
22
|
-
{ x: @analog_stick.abs_x, y: @analog_stick.abs_y }
|
23
|
-
end
|
24
|
-
|
25
|
-
def to_hash
|
26
|
-
{ left_analog_stick: left_analog_stick,
|
27
|
-
left_analog_stick_by_abs: left_analog_stick_by_abs,
|
28
|
-
buttons: pressed,
|
29
|
-
}
|
30
|
-
end
|
31
|
-
end
|