procon_bypass_man 0.1.21 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +9 -0
  3. data/.github/workflows/gitleacks.yml +11 -0
  4. data/.gitignore +1 -0
  5. data/CHANGELOG.md +24 -0
  6. data/Gemfile.lock +4 -4
  7. data/README.md +4 -1
  8. data/docs/getting_started.md +70 -5
  9. data/docs/setting/left-analogstick-cap.md +1 -1
  10. data/docs/setting/splatoon2_macro_dasei_cancel.md +4 -0
  11. data/docs/setting/splatoon2_macro_sokuwari_bubble.md +4 -0
  12. data/docs/setting/splatoon2_shake_tansan.md +47 -0
  13. data/docs/setup_raspi.md +0 -1
  14. data/lib/procon_bypass_man/background/jobs/post_completed_remote_macro_job.rb +17 -0
  15. data/lib/procon_bypass_man/background.rb +1 -0
  16. data/lib/procon_bypass_man/buttons_setting_configuration/layer.rb +142 -80
  17. data/lib/procon_bypass_man/buttons_setting_configuration/loader.rb +3 -1
  18. data/lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb +28 -0
  19. data/lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button_list.rb +31 -0
  20. data/lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/disable_macro_if_pressed.rb +28 -0
  21. data/lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/flip_if_pressed.rb +31 -0
  22. data/lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/force_neutral.rb +28 -0
  23. data/lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/if_pressed.rb +26 -0
  24. data/lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/if_pressed_allows_nil.rb +28 -0
  25. data/lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/open_macro_steps.rb +26 -0
  26. data/lib/procon_bypass_man/buttons_setting_configuration/param_normalizer.rb +17 -0
  27. data/lib/procon_bypass_man/buttons_setting_configuration.rb +5 -4
  28. data/lib/procon_bypass_man/{commands → bypass}/bypass_command.rb +36 -24
  29. data/lib/procon_bypass_man/bypass/usb_hid_logger.rb +4 -0
  30. data/lib/procon_bypass_man/bypass.rb +43 -23
  31. data/lib/procon_bypass_man/commands/print_boot_message_command.rb +2 -3
  32. data/lib/procon_bypass_man/commands/send_error_command.rb +2 -2
  33. data/lib/procon_bypass_man/commands.rb +0 -3
  34. data/lib/procon_bypass_man/configuration.rb +29 -3
  35. data/lib/procon_bypass_man/device_connection/command.rb +28 -0
  36. data/lib/procon_bypass_man/device_connection/executor.rb +190 -0
  37. data/lib/procon_bypass_man/device_connection/output_report_generator.rb +42 -0
  38. data/lib/procon_bypass_man/device_connection/output_report_markerable.rb +28 -0
  39. data/lib/procon_bypass_man/device_connection/output_report_sub_command_table.rb +133 -0
  40. data/lib/procon_bypass_man/device_connection/output_report_watcher.rb +41 -0
  41. data/lib/procon_bypass_man/device_connection/pre_bypass.rb +67 -0
  42. data/lib/procon_bypass_man/device_connection/procon_setting_overrider.rb +78 -0
  43. data/lib/procon_bypass_man/device_connection/spoofing_output_report_watcher.rb +39 -0
  44. data/lib/procon_bypass_man/device_connection.rb +16 -0
  45. data/lib/procon_bypass_man/device_model.rb +17 -0
  46. data/lib/procon_bypass_man/io_monitor.rb +20 -1
  47. data/lib/procon_bypass_man/plugin/splatoon2/macro/charge_tansan_bomb.rb +21 -0
  48. data/lib/procon_bypass_man/plugin/splatoon2/version.rb +1 -1
  49. data/lib/procon_bypass_man/plugins.rb +1 -0
  50. data/lib/procon_bypass_man/procon/analog_stick_cap.rb +4 -23
  51. data/lib/procon_bypass_man/procon/analog_stick_manipulator.rb +36 -0
  52. data/lib/procon_bypass_man/procon/layer_changer.rb +4 -1
  53. data/lib/procon_bypass_man/procon/macro.rb +5 -2
  54. data/lib/procon_bypass_man/procon/macro_builder.rb +20 -20
  55. data/lib/procon_bypass_man/procon/macro_plugin_map.rb +23 -0
  56. data/lib/procon_bypass_man/procon/macro_registry.rb +21 -10
  57. data/lib/procon_bypass_man/procon/suppress_rumble.rb +13 -0
  58. data/lib/procon_bypass_man/procon/user_operation.rb +29 -15
  59. data/lib/procon_bypass_man/procon/value_objects/analog_stick_position.rb +18 -0
  60. data/lib/procon_bypass_man/{domains → procon/value_objects}/binary/base.rb +0 -0
  61. data/lib/procon_bypass_man/{domains → procon/value_objects}/binary/has_immutable_binary.rb +0 -0
  62. data/lib/procon_bypass_man/{domains → procon/value_objects}/binary/has_mutable_binary.rb +0 -0
  63. data/lib/procon_bypass_man/{domains → procon/value_objects}/binary/inbound_procon_binary.rb +5 -0
  64. data/lib/procon_bypass_man/{domains → procon/value_objects}/binary/processing_procon_binary.rb +6 -1
  65. data/lib/procon_bypass_man/procon/value_objects/binary.rb +11 -0
  66. data/lib/procon_bypass_man/{domains → procon/value_objects}/bypass_mode.rb +0 -0
  67. data/lib/procon_bypass_man/procon/value_objects/rumble_binary.rb +18 -0
  68. data/lib/procon_bypass_man/procon.rb +27 -5
  69. data/lib/procon_bypass_man/remote_macro/queue_over_process.rb +62 -0
  70. data/lib/procon_bypass_man/remote_macro/remote_macro_object.rb +30 -0
  71. data/lib/procon_bypass_man/remote_macro/remote_macro_receiver.rb +37 -0
  72. data/lib/procon_bypass_man/remote_macro/remote_macro_sender.rb +8 -0
  73. data/lib/procon_bypass_man/remote_macro/task.rb +6 -0
  74. data/lib/procon_bypass_man/remote_macro/task_queue.rb +13 -0
  75. data/lib/procon_bypass_man/remote_macro.rb +14 -0
  76. data/lib/procon_bypass_man/{commands → remote_pbm_action/commands}/run_remote_pbm_action_dispatch_command.rb +0 -0
  77. data/lib/procon_bypass_man/remote_pbm_action/restore_pbm_setting.rb +7 -1
  78. data/lib/procon_bypass_man/remote_pbm_action/value_objects/remote_pbm_action_object.rb +1 -1
  79. data/lib/procon_bypass_man/remote_pbm_action.rb +2 -0
  80. data/lib/procon_bypass_man/runner.rb +13 -13
  81. data/lib/procon_bypass_man/support/cycle_sleep.rb +22 -0
  82. data/lib/procon_bypass_man/support/device_mouse_finder.rb +60 -0
  83. data/lib/procon_bypass_man/{device_procon_finder.rb → support/device_procon_finder.rb} +0 -2
  84. data/lib/procon_bypass_man/support/never_exit_accidentally.rb +3 -3
  85. data/lib/procon_bypass_man/support/remote_macro_http_client.rb +9 -0
  86. data/lib/procon_bypass_man/support/safe_timeout.rb +7 -1
  87. data/lib/procon_bypass_man/{usb_device_controller.rb → support/usb_device_controller.rb} +9 -6
  88. data/lib/procon_bypass_man/support/yaml_loader.rb +12 -0
  89. data/lib/procon_bypass_man/version.rb +1 -1
  90. data/lib/procon_bypass_man/websocket/{pbm_job_client.rb → client.rb} +32 -10
  91. data/lib/procon_bypass_man.rb +69 -46
  92. data/procon_bypass_man.gemspec +1 -1
  93. data/project_template/app.rb +19 -4
  94. data/sig/main.rbs +4 -16
  95. metadata +55 -17
  96. data/lib/procon_bypass_man/commands/connect_device_command.rb +0 -18
  97. data/lib/procon_bypass_man/device_connector.rb +0 -296
  98. data/lib/procon_bypass_man/domains.rb +0 -12
@@ -13,8 +13,15 @@ require "pbmenv"
13
13
 
14
14
  require_relative "procon_bypass_man/version"
15
15
  require_relative "procon_bypass_man/remote_pbm_action"
16
+ require_relative "procon_bypass_man/remote_macro"
17
+
18
+ require_relative "procon_bypass_man/device_connection"
19
+ require_relative "procon_bypass_man/support/usb_device_controller"
20
+ require_relative "procon_bypass_man/support/device_procon_finder"
21
+ require_relative "procon_bypass_man/support/device_mouse_finder"
16
22
  require_relative "procon_bypass_man/support/signal_handler"
17
23
  require_relative "procon_bypass_man/support/callbacks"
24
+ require_relative "procon_bypass_man/support/yaml_loader"
18
25
  require_relative "procon_bypass_man/support/yaml_writer"
19
26
  require_relative "procon_bypass_man/support/safe_timeout"
20
27
  require_relative "procon_bypass_man/support/compress_array"
@@ -22,32 +29,30 @@ require_relative "procon_bypass_man/support/uptime"
22
29
  require_relative "procon_bypass_man/support/on_memory_cache"
23
30
  require_relative "procon_bypass_man/support/http_client"
24
31
  require_relative "procon_bypass_man/support/report_http_client"
32
+ require_relative "procon_bypass_man/support/remote_macro_http_client"
25
33
  require_relative "procon_bypass_man/support/update_remote_pbm_action_status_http_client"
26
34
  require_relative "procon_bypass_man/support/send_device_stats_http_client"
27
35
  require_relative "procon_bypass_man/support/server_pool"
28
36
  require_relative "procon_bypass_man/support/analog_stick_hypotenuse_tilting_power_scaler"
29
37
  require_relative "procon_bypass_man/support/never_exit_accidentally"
38
+ require_relative "procon_bypass_man/support/cycle_sleep"
30
39
  require_relative "procon_bypass_man/background"
31
40
  require_relative "procon_bypass_man/commands"
32
41
  require_relative "procon_bypass_man/bypass"
33
- require_relative "procon_bypass_man/domains"
34
- require_relative "procon_bypass_man/device_connector"
35
- require_relative "procon_bypass_man/device_procon_finder"
36
42
  require_relative "procon_bypass_man/device_status"
37
- require_relative "procon_bypass_man/usb_device_controller"
38
43
  require_relative "procon_bypass_man/runner"
39
44
  require_relative "procon_bypass_man/processor"
40
45
  require_relative "procon_bypass_man/configuration"
41
46
  require_relative "procon_bypass_man/buttons_setting_configuration"
42
47
  require_relative "procon_bypass_man/procon"
48
+ require_relative "procon_bypass_man/device_model"
43
49
  require_relative "procon_bypass_man/procon/button"
44
- require_relative "procon_bypass_man/procon/value_objects/analog_stick"
45
- require_relative "procon_bypass_man/procon/value_objects/procon_reader"
46
50
  require_relative "procon_bypass_man/procon/analog_stick_cap"
51
+ require_relative "procon_bypass_man/procon/analog_stick_manipulator"
47
52
  require_relative "procon_bypass_man/remote_pbm_action/value_objects/remote_pbm_action_object"
48
53
  require_relative "procon_bypass_man/scheduler"
49
54
  require_relative "procon_bypass_man/plugins"
50
- require_relative "procon_bypass_man/websocket/pbm_job_client"
55
+ require_relative "procon_bypass_man/websocket/client"
51
56
  require_relative "procon_bypass_man/websocket/watchdog"
52
57
  require_relative "procon_bypass_man/websocket/forever"
53
58
 
@@ -59,55 +64,59 @@ module ProconBypassMan
59
64
  extend ProconBypassMan::NeverExitAccidentally
60
65
 
61
66
  class CouldNotLoadConfigError < StandardError; end
62
- class ConnectionError < StandardError; end
63
- class FirstConnectionError < ConnectionError; end
64
- class EternalConnectionError < ConnectionError; end
67
+ class NotFoundProconError < StandardError; end
65
68
 
66
69
  # @return [void]
67
70
  def self.run(setting_path: nil)
68
- ProconBypassMan::Scheduler.start!
69
- ProconBypassMan::Background::JobRunner.start!
70
- ProconBypassMan::Websocket::PbmJobClient.start!
71
-
72
71
  ProconBypassMan::PrintMessageCommand.execute(text: "PBMを起動しています")
73
72
  initialize_pbm
74
- ProconBypassMan::ButtonsSettingConfiguration::Loader.load(setting_path: setting_path)
75
- gadget, procon = ProconBypassMan::ConnectDeviceCommand.execute!
76
- Runner.new(gadget: gadget, procon: procon).run # ここでblockingする
77
- FileUtils.rm_rf(ProconBypassMan.pid_path)
78
- FileUtils.rm_rf(ProconBypassMan.digest_path)
79
- rescue ProconBypassMan::CouldNotLoadConfigError
80
- ProconBypassMan::SendErrorCommand.execute(error: "設定ファイルが不正です。設定ファイルの読み込みに失敗しました")
81
- ProconBypassMan::DeviceStatus.change_to_setting_syntax_error_and_shutdown!
82
- ProconBypassMan.exit_if_allow(1) do
83
- FileUtils.rm_rf(ProconBypassMan.pid_path)
84
- FileUtils.rm_rf(ProconBypassMan.digest_path)
85
- end
86
- rescue ProconBypassMan::ConnectDeviceCommand::NotFoundProconError
87
- ProconBypassMan::SendErrorCommand.execute(error: "プロコンが見つかりませんでした。")
88
- ProconBypassMan::DeviceStatus.change_to_procon_not_found_error!
89
- ProconBypassMan.exit_if_allow(1) do
90
- FileUtils.rm_rf(ProconBypassMan.pid_path)
91
- FileUtils.rm_rf(ProconBypassMan.digest_path)
73
+
74
+ begin
75
+ ProconBypassMan::ButtonsSettingConfiguration::Loader.load(setting_path: setting_path)
76
+ rescue ProconBypassMan::CouldNotLoadConfigError
77
+ ProconBypassMan::SendErrorCommand.execute(error: "設定ファイルが不正です。設定ファイルの読み込みに失敗しました")
78
+ ProconBypassMan::DeviceStatus.change_to_setting_syntax_error_and_shutdown!
79
+ # TODO シグナルトラップをしていないのでUSR2を送ったときにプロセスが停止している. 明示的にハンドリングするべき.
80
+ ProconBypassMan::NeverExitAccidentally.exit_if_allow_at_config do
81
+ terminate_pbm
82
+ end
83
+ return
92
84
  end
93
- rescue ProconBypassMan::ConnectionError
85
+
94
86
  begin
95
- raise
96
- rescue ProconBypassMan::EternalConnectionError
87
+ gadget, procon = ProconBypassMan::DeviceConnection::Command.execute!
88
+ rescue ProconBypassMan::DeviceConnection::NotFoundProconError
89
+ ProconBypassMan::SendErrorCommand.execute(error: "プロコンが見つかりませんでした。")
90
+ ProconBypassMan::DeviceStatus.change_to_procon_not_found_error!
91
+ # TODO シグナルトラップをしていないので以下の状態に、USR2を送ったときにプロセスが停止してしまう
92
+ ProconBypassMan::NeverExitAccidentally.exit_if_allow_at_config do
93
+ terminate_pbm
94
+ end
95
+ return
96
+ rescue ProconBypassMan::DeviceConnection::TimeoutError
97
97
  ProconBypassMan::SendErrorCommand.execute(error: "接続の見込みがないのでsleepしまくります")
98
98
  ProconBypassMan::DeviceStatus.change_to_connected_but_sleeping!
99
- FileUtils.rm_rf(ProconBypassMan.pid_path)
99
+ %w(TERM INT).each do |sig|
100
+ Kernel.trap(sig) { exit 0 }
101
+ end
102
+ Kernel.trap :USR2 do
103
+ exit 0 # TODO retryする
104
+ end
100
105
  eternal_sleep
101
- rescue ProconBypassMan::FirstConnectionError
102
- ProconBypassMan::SendErrorCommand.execute(error: "接続を確立できませんでした。やりなおします。")
103
- retry
106
+ return
104
107
  end
108
+
109
+ ready_pbm
110
+ Runner.new(gadget: gadget, procon: procon).run # ここでblockingする
111
+ terminate_pbm
105
112
  end
106
113
 
114
+ # 実行ファイル(app.rb)から呼び出している
115
+ # @return [void]
107
116
  def self.configure(&block)
108
117
  @@configuration = ProconBypassMan::Configuration.new
109
118
  @@configuration.instance_eval(&block)
110
- @@configuration
119
+ nil
111
120
  end
112
121
 
113
122
  # @return [ProconBypassMan::Configuration]
@@ -124,20 +133,34 @@ module ProconBypassMan
124
133
  ProconBypassMan::IOMonitor.reset!
125
134
  end
126
135
 
136
+ # @return [void]
127
137
  def self.initialize_pbm
138
+ ProconBypassMan::Scheduler.start!
139
+ ProconBypassMan::Background::JobRunner.start!
140
+ ProconBypassMan::Websocket::Client.start!
141
+ ProconBypassMan::QueueOverProcess.start!
142
+
128
143
  ProconBypassMan::WriteDeviceIdCommand.execute
129
144
  ProconBypassMan::WriteSessionIdCommand.execute
130
- system("renice -n -20 -p #{$$}")
145
+ `renice -n -20 -p #{$$}`
131
146
  File.write(pid_path, $$)
132
147
  ProconBypassMan::DeviceStatus.change_to_running!
133
148
  end
134
149
 
135
- def self.eternal_sleep
136
- sleep(999999999)
150
+ def self.ready_pbm
151
+ ProconBypassMan::PrintBootMessageCommand.execute
152
+ ProconBypassMan::ReportLoadConfigJob.perform_async(ProconBypassMan.config.raw_setting)
153
+ end
154
+
155
+ # @return [void]
156
+ def self.terminate_pbm
157
+ FileUtils.rm_rf(ProconBypassMan.pid_path)
158
+ FileUtils.rm_rf(ProconBypassMan.digest_path)
159
+ ProconBypassMan::QueueOverProcess.shutdown
137
160
  end
138
161
 
139
- # @return [Void]
140
- def self.hot_reload!
141
- Process.kill(:USR2, pid)
162
+ # @return [void]
163
+ def self.eternal_sleep
164
+ sleep(999999999)
142
165
  end
143
166
  end
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.description = spec.summary
13
13
  spec.homepage = "https://github.com/splaplapla/procon_bypass_man"
14
14
  spec.license = "MIT"
15
- spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
15
+ spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
16
16
 
17
17
  spec.metadata["homepage_uri"] = spec.homepage
18
18
  spec.metadata["source_code_uri"] = spec.homepage
@@ -2,10 +2,19 @@
2
2
 
3
3
  require 'bundler/inline'
4
4
 
5
- gemfile do
6
- source 'https://rubygems.org'
7
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
8
- gem 'procon_bypass_man', '0.1.21'
5
+ begin
6
+ gemfile do
7
+ source 'https://rubygems.org'
8
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
9
+ gem 'procon_bypass_man', '0.2.0'
10
+ end
11
+ rescue Bundler::Source::Git::GitCommandError => e
12
+ # install中に強制終了するとgitの管理ファイルが不正状態になり、次のエラーが起きるので発生したらcache directoryを削除する
13
+ #"Git error: command `git fetch --force --quiet --tags https://github.com/splaplapla/procon_bypass_man refs/heads/\\*:refs/heads/\\*` in directory /home/pi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/cache/bundler/git/procon_bypass_man-ae4c9016d76b667658c8ba66f3bbd2eebf2656af has failed.\n\nIf this error persists you could try removing the cache directory '/home/pi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/cache/bundler/git/procon_bypass_man-ae4c9016d76b667658c8ba66f3bbd2eebf2656af'"
14
+ if /try removing the cache directory '([^']+)'/ =~ e.message
15
+ FileUtils.rm_rf($1)
16
+ retry
17
+ end
9
18
  end
10
19
 
11
20
  ProconBypassMan.configure do |config|
@@ -25,6 +34,12 @@ ProconBypassMan.configure do |config|
25
34
  # pbm-cloudで使う場合はnever_exitにtrueをセットしてください. trueがセットされている場合、不慮の事故が発生してもプロセスが終了しなくなります
26
35
  config.never_exit_accidentally = true
27
36
 
37
+ # 毎秒行ったIOをログに出力するか
38
+ config.io_monitor_logging = false
39
+
40
+ # 接続に成功したらコントローラーのHOME LEDを光らせるか
41
+ config.enable_home_led_on_connect = true
42
+
28
43
  # 操作が高頻度で固まるときは、 gadget_to_procon_interval の数値は大きくしてください
29
44
  config.bypass_mode = { mode: :normal, gadget_to_procon_interval: 5 }
30
45
  end
data/sig/main.rbs CHANGED
@@ -11,12 +11,6 @@ module ProconBypassMan
11
11
  class CouldNotLoadConfigError < StandardError
12
12
  end
13
13
 
14
- class FirstConnectionError < StandardError
15
- end
16
-
17
- class EternalConnectionError < StandardError
18
- end
19
-
20
14
  def self.configure: (?setting_path: untyped? setting_path) { () -> untyped } -> untyped
21
15
 
22
16
  def self.run: (?setting_path: untyped? setting_path) { () -> untyped } -> untyped
@@ -192,6 +186,7 @@ class ProconBypassMan::Configuration
192
186
  attr_reader api_server: untyped
193
187
  attr_reader api_servers: untyped
194
188
  attr_writer never_exit_accidentally: bool
189
+ attr_writer io_monitor_logging: bool
195
190
 
196
191
  attr_accessor enable_critical_error_logging: bool
197
192
 
@@ -231,6 +226,8 @@ class ProconBypassMan::Configuration
231
226
  def verbose_bypass_log: () -> bool
232
227
 
233
228
  def never_exit_accidentally: () -> bool
229
+
230
+ def io_monitor_logging: () -> bool
234
231
  end
235
232
 
236
233
 
@@ -255,21 +252,12 @@ class ProconBypassMan::DeviceConnector
255
252
 
256
253
  def self.connect: () -> ::Array[untyped]
257
254
 
258
- def initialize: (?throw_error_if_timeout: bool throw_error_if_timeout, ?throw_error_if_mismatch: bool throw_error_if_mismatch, ?enable_at_exit: bool enable_at_exit) -> untyped
255
+ def initialize: (?throw_error_if_timeout: bool throw_error_if_timeout, ?throw_error_if_mismatch: bool throw_error_if_mismatch) -> untyped
259
256
 
260
257
  def add: (untyped values, read_from: untyped read_from) -> untyped
261
258
 
262
259
  def drain_all: () -> untyped
263
260
 
264
- # switchに任意の命令を入力して、switchから読み取る
265
- def write_switch: (untyped data, ?only_write: bool only_write) -> untyped
266
-
267
- def write_procon: (untyped data, ?only_write: bool only_write) -> untyped
268
-
269
- def read_procon: (?only_read: bool only_read) -> untyped
270
-
271
- def read_switch: (?only_read: bool only_read) -> untyped
272
-
273
261
  def from_device: (untyped item) -> untyped
274
262
 
275
263
  # fromの対になる
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.21
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jiikko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-03 00:00:00.000000000 Z
11
+ date: 2022-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pbmenv
@@ -60,6 +60,7 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - ".circleci/config.yml"
63
+ - ".github/workflows/gitleacks.yml"
63
64
  - ".github/workflows/release.yml"
64
65
  - ".github/workflows/ruby.yml"
65
66
  - ".gitignore"
@@ -82,6 +83,7 @@ files:
82
83
  - docs/setting/splatoon2_macro_dasei_cancel.md
83
84
  - docs/setting/splatoon2_macro_sokuwari_bubble.md
84
85
  - docs/setting/splatoon2_recommended_setting.md
86
+ - docs/setting/splatoon2_shake_tansan.md
85
87
  - docs/setup_raspi.md
86
88
  - docs/setup_raspi.mitamae.rb
87
89
  - docs/setup_raspi_by_mitamae.md
@@ -96,6 +98,7 @@ files:
96
98
  - lib/procon_bypass_man/background/jobs/concerns/has_external_api_setting.rb
97
99
  - lib/procon_bypass_man/background/jobs/concerns/has_internal_api_setting.rb
98
100
  - lib/procon_bypass_man/background/jobs/concerns/job_runnable.rb
101
+ - lib/procon_bypass_man/background/jobs/post_completed_remote_macro_job.rb
99
102
  - lib/procon_bypass_man/background/jobs/report_boot_job.rb
100
103
  - lib/procon_bypass_man/background/jobs/report_completed_upgrade_pbm_job.rb
101
104
  - lib/procon_bypass_man/background/jobs/report_error_job.rb
@@ -109,31 +112,41 @@ files:
109
112
  - lib/procon_bypass_man/buttons_setting_configuration.rb
110
113
  - lib/procon_bypass_man/buttons_setting_configuration/layer.rb
111
114
  - lib/procon_bypass_man/buttons_setting_configuration/loader.rb
115
+ - lib/procon_bypass_man/buttons_setting_configuration/param_normalizer.rb
116
+ - lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb
117
+ - lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button_list.rb
118
+ - lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/disable_macro_if_pressed.rb
119
+ - lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/flip_if_pressed.rb
120
+ - lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/force_neutral.rb
121
+ - lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/if_pressed.rb
122
+ - lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/if_pressed_allows_nil.rb
123
+ - lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/open_macro_steps.rb
112
124
  - lib/procon_bypass_man/buttons_setting_configuration/validator.rb
113
125
  - lib/procon_bypass_man/bypass.rb
126
+ - lib/procon_bypass_man/bypass/bypass_command.rb
114
127
  - lib/procon_bypass_man/bypass/usb_hid_logger.rb
115
128
  - lib/procon_bypass_man/commands.rb
116
- - lib/procon_bypass_man/commands/bypass_command.rb
117
- - lib/procon_bypass_man/commands/connect_device_command.rb
118
129
  - lib/procon_bypass_man/commands/print_boot_message_command.rb
119
130
  - lib/procon_bypass_man/commands/print_message_command.rb
120
- - lib/procon_bypass_man/commands/run_remote_pbm_action_dispatch_command.rb
121
131
  - lib/procon_bypass_man/commands/send_error_command.rb
122
132
  - lib/procon_bypass_man/commands/send_reload_config_event_command.rb
123
133
  - lib/procon_bypass_man/commands/write_device_id_command.rb
124
134
  - lib/procon_bypass_man/commands/write_session_id_command.rb
125
135
  - lib/procon_bypass_man/configuration.rb
126
- - lib/procon_bypass_man/device_connector.rb
127
- - lib/procon_bypass_man/device_procon_finder.rb
136
+ - lib/procon_bypass_man/device_connection.rb
137
+ - lib/procon_bypass_man/device_connection/command.rb
138
+ - lib/procon_bypass_man/device_connection/executor.rb
139
+ - lib/procon_bypass_man/device_connection/output_report_generator.rb
140
+ - lib/procon_bypass_man/device_connection/output_report_markerable.rb
141
+ - lib/procon_bypass_man/device_connection/output_report_sub_command_table.rb
142
+ - lib/procon_bypass_man/device_connection/output_report_watcher.rb
143
+ - lib/procon_bypass_man/device_connection/pre_bypass.rb
144
+ - lib/procon_bypass_man/device_connection/procon_setting_overrider.rb
145
+ - lib/procon_bypass_man/device_connection/spoofing_output_report_watcher.rb
146
+ - lib/procon_bypass_man/device_model.rb
128
147
  - lib/procon_bypass_man/device_status.rb
129
- - lib/procon_bypass_man/domains.rb
130
- - lib/procon_bypass_man/domains/binary/base.rb
131
- - lib/procon_bypass_man/domains/binary/has_immutable_binary.rb
132
- - lib/procon_bypass_man/domains/binary/has_mutable_binary.rb
133
- - lib/procon_bypass_man/domains/binary/inbound_procon_binary.rb
134
- - lib/procon_bypass_man/domains/binary/processing_procon_binary.rb
135
- - lib/procon_bypass_man/domains/bypass_mode.rb
136
148
  - lib/procon_bypass_man/io_monitor.rb
149
+ - lib/procon_bypass_man/plugin/splatoon2/macro/charge_tansan_bomb.rb
137
150
  - lib/procon_bypass_man/plugin/splatoon2/macro/dasei_cancel.rb
138
151
  - lib/procon_bypass_man/plugin/splatoon2/macro/fast_return.rb
139
152
  - lib/procon_bypass_man/plugin/splatoon2/macro/jump_to_left_key.rb
@@ -146,6 +159,7 @@ files:
146
159
  - lib/procon_bypass_man/processor.rb
147
160
  - lib/procon_bypass_man/procon.rb
148
161
  - lib/procon_bypass_man/procon/analog_stick_cap.rb
162
+ - lib/procon_bypass_man/procon/analog_stick_manipulator.rb
149
163
  - lib/procon_bypass_man/procon/button.rb
150
164
  - lib/procon_bypass_man/procon/button_collection.rb
151
165
  - lib/procon_bypass_man/procon/consts.rb
@@ -153,15 +167,34 @@ files:
153
167
  - lib/procon_bypass_man/procon/layer_changer.rb
154
168
  - lib/procon_bypass_man/procon/macro.rb
155
169
  - lib/procon_bypass_man/procon/macro_builder.rb
170
+ - lib/procon_bypass_man/procon/macro_plugin_map.rb
156
171
  - lib/procon_bypass_man/procon/macro_registry.rb
157
172
  - lib/procon_bypass_man/procon/mode_registry.rb
158
173
  - lib/procon_bypass_man/procon/press_button_aware.rb
174
+ - lib/procon_bypass_man/procon/suppress_rumble.rb
159
175
  - lib/procon_bypass_man/procon/user_operation.rb
160
176
  - lib/procon_bypass_man/procon/value_objects/analog_stick.rb
177
+ - lib/procon_bypass_man/procon/value_objects/analog_stick_position.rb
178
+ - lib/procon_bypass_man/procon/value_objects/binary.rb
179
+ - lib/procon_bypass_man/procon/value_objects/binary/base.rb
180
+ - lib/procon_bypass_man/procon/value_objects/binary/has_immutable_binary.rb
181
+ - lib/procon_bypass_man/procon/value_objects/binary/has_mutable_binary.rb
182
+ - lib/procon_bypass_man/procon/value_objects/binary/inbound_procon_binary.rb
183
+ - lib/procon_bypass_man/procon/value_objects/binary/processing_procon_binary.rb
184
+ - lib/procon_bypass_man/procon/value_objects/bypass_mode.rb
161
185
  - lib/procon_bypass_man/procon/value_objects/procon_reader.rb
186
+ - lib/procon_bypass_man/procon/value_objects/rumble_binary.rb
187
+ - lib/procon_bypass_man/remote_macro.rb
188
+ - lib/procon_bypass_man/remote_macro/queue_over_process.rb
189
+ - lib/procon_bypass_man/remote_macro/remote_macro_object.rb
190
+ - lib/procon_bypass_man/remote_macro/remote_macro_receiver.rb
191
+ - lib/procon_bypass_man/remote_macro/remote_macro_sender.rb
192
+ - lib/procon_bypass_man/remote_macro/task.rb
193
+ - lib/procon_bypass_man/remote_macro/task_queue.rb
162
194
  - lib/procon_bypass_man/remote_pbm_action.rb
163
195
  - lib/procon_bypass_man/remote_pbm_action/base_action.rb
164
196
  - lib/procon_bypass_man/remote_pbm_action/change_pbm_version_action.rb
197
+ - lib/procon_bypass_man/remote_pbm_action/commands/run_remote_pbm_action_dispatch_command.rb
165
198
  - lib/procon_bypass_man/remote_pbm_action/commands/update_remote_pbm_action_status_command.rb
166
199
  - lib/procon_bypass_man/remote_pbm_action/reboot_os_action.rb
167
200
  - lib/procon_bypass_man/remote_pbm_action/restore_pbm_setting.rb
@@ -172,9 +205,13 @@ files:
172
205
  - lib/procon_bypass_man/support/analog_stick_hypotenuse_tilting_power_scaler.rb
173
206
  - lib/procon_bypass_man/support/callbacks.rb
174
207
  - lib/procon_bypass_man/support/compress_array.rb
208
+ - lib/procon_bypass_man/support/cycle_sleep.rb
209
+ - lib/procon_bypass_man/support/device_mouse_finder.rb
210
+ - lib/procon_bypass_man/support/device_procon_finder.rb
175
211
  - lib/procon_bypass_man/support/http_client.rb
176
212
  - lib/procon_bypass_man/support/never_exit_accidentally.rb
177
213
  - lib/procon_bypass_man/support/on_memory_cache.rb
214
+ - lib/procon_bypass_man/support/remote_macro_http_client.rb
178
215
  - lib/procon_bypass_man/support/report_http_client.rb
179
216
  - lib/procon_bypass_man/support/safe_timeout.rb
180
217
  - lib/procon_bypass_man/support/send_device_stats_http_client.rb
@@ -182,11 +219,12 @@ files:
182
219
  - lib/procon_bypass_man/support/signal_handler.rb
183
220
  - lib/procon_bypass_man/support/update_remote_pbm_action_status_http_client.rb
184
221
  - lib/procon_bypass_man/support/uptime.rb
222
+ - lib/procon_bypass_man/support/usb_device_controller.rb
223
+ - lib/procon_bypass_man/support/yaml_loader.rb
185
224
  - lib/procon_bypass_man/support/yaml_writer.rb
186
- - lib/procon_bypass_man/usb_device_controller.rb
187
225
  - lib/procon_bypass_man/version.rb
226
+ - lib/procon_bypass_man/websocket/client.rb
188
227
  - lib/procon_bypass_man/websocket/forever.rb
189
- - lib/procon_bypass_man/websocket/pbm_job_client.rb
190
228
  - lib/procon_bypass_man/websocket/watchdog.rb
191
229
  - procon_bypass_man.gemspec
192
230
  - project_template/README.md
@@ -213,7 +251,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
213
251
  requirements:
214
252
  - - ">="
215
253
  - !ruby/object:Gem::Version
216
- version: 2.4.0
254
+ version: 3.0.0
217
255
  required_rubygems_version: !ruby/object:Gem::Requirement
218
256
  requirements:
219
257
  - - ">="
@@ -1,18 +0,0 @@
1
- class ProconBypassMan::ConnectDeviceCommand
2
- class NotFoundProconError < StandardError; end
3
-
4
- # @return [void]
5
- def self.execute!
6
- gadget, procon = ProconBypassMan::DeviceConnector.connect
7
- rescue ProconBypassMan::DeviceConnector::NotFoundProconError => e
8
- ProconBypassMan.logger.error e
9
- gadget&.close
10
- procon&.close
11
- raise ProconBypassMan::ConnectDeviceCommand::NotFoundProconError
12
- rescue ProconBypassMan::SafeTimeout::Timeout
13
- ProconBypassMan.logger.error "デバイスとの通信でタイムアウトが起きて接続ができませんでした。"
14
- gadget&.close
15
- procon&.close
16
- raise ProconBypassMan::EternalConnectionError
17
- end
18
- end