procon_bypass_man 0.1.14 → 0.1.15

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.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +33 -0
  3. data/CHANGELOG.md +4 -0
  4. data/Gemfile.lock +2 -2
  5. data/lib/procon_bypass_man/commands/run_remote_pbm_action_dispatch_command.rb +2 -0
  6. data/lib/procon_bypass_man/plugin/splatoon2/macro/fast_return.rb +17 -0
  7. data/lib/procon_bypass_man/plugin/splatoon2/macro/jump_to_left_key.rb +17 -0
  8. data/lib/procon_bypass_man/plugin/splatoon2/macro/jump_to_right_key.rb +17 -0
  9. data/lib/procon_bypass_man/plugin/splatoon2/macro/jump_to_up_key.rb +17 -0
  10. data/lib/procon_bypass_man/plugin/splatoon2/mode/guruguru.rb +59 -0
  11. data/lib/procon_bypass_man/plugin/splatoon2/version.rb +9 -0
  12. data/lib/procon_bypass_man/plugin.rb +11 -0
  13. data/lib/procon_bypass_man/remote_pbm_action/change_pbm_version_action.rb +4 -0
  14. data/lib/procon_bypass_man/remote_pbm_action/reboot_os_action.rb +4 -0
  15. data/lib/procon_bypass_man/remote_pbm_action/restore_pbm_setting.rb +28 -0
  16. data/lib/procon_bypass_man/remote_pbm_action/stop_pbm_action.rb +4 -0
  17. data/lib/procon_bypass_man/remote_pbm_action.rb +2 -1
  18. data/lib/procon_bypass_man/runner.rb +1 -1
  19. data/lib/procon_bypass_man/support/report_http_client.rb +3 -3
  20. data/lib/procon_bypass_man/version.rb +1 -1
  21. data/lib/procon_bypass_man.rb +26 -28
  22. data/project_template/app.rb +1 -1
  23. data/project_template/setting.yml +8 -8
  24. metadata +15 -13
  25. data/lib/procon_bypass_man/splatoon2/macro/fast_return.rb +0 -15
  26. data/lib/procon_bypass_man/splatoon2/macro/jump_to_left_key.rb +0 -15
  27. data/lib/procon_bypass_man/splatoon2/macro/jump_to_right_key.rb +0 -15
  28. data/lib/procon_bypass_man/splatoon2/macro/jump_to_up_key.rb +0 -15
  29. data/lib/procon_bypass_man/splatoon2/mode/guruguru.rb +0 -57
  30. data/lib/procon_bypass_man/splatoon2/version.rb +0 -7
  31. data/lib/procon_bypass_man/splatoon2.rb +0 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 346ad7fa333241bf5464ac38fce07caec0e0a021def6e2d456b7dc49a1f70b0a
4
- data.tar.gz: 5f9f6d94706fd00c9ecc738f9626c5a2e6418039997f487f856d2298a6a9df1c
3
+ metadata.gz: 7820b087d86ac7338128dbfdebba48f8e3100d4a2163894962296e6526ea6b6e
4
+ data.tar.gz: 43d3bd4d0b3d18a61edc2df29320ad345f6d9313de79b6bb732a2bf526a18e5a
5
5
  SHA512:
6
- metadata.gz: 792586a96060eb9adb8e7c0cf31bd56663da6343fa753709158890d47aed1025e87f24f670d176dea543d71cf6de2c6e8bb200b3bf109981f99e0f73b8eaa932
7
- data.tar.gz: 8e82db2b88efb8d5752797eab1e203379d30edf6e71fcda3ff35bdba8e46e27923e5da313442be366c50e6c38b8a0583296a36e94c35f078d648fb18f59c2a0d
6
+ metadata.gz: 78f98474a1a3d6bf7a6a6420c36c51bc4c9ba835d35361b5bcd45623b3c9c5e3b8ef173d341bd026d324f78787bc020b6536e6deff658c8f073767d3ff0f664e
7
+ data.tar.gz: 341d4645b6650594533dcf23b32e24a8e5acd8413fea428d21fa2d2a2b4af1636d312a1ebc3472d5dbcbce193157a4da459eb1314619c27342b93dd30b8a96b3
@@ -0,0 +1,33 @@
1
+ name: Publish to RubyGems
2
+
3
+ on:
4
+ [workflow_dispatch]
5
+
6
+ jobs:
7
+ release:
8
+ runs-on: ubuntu-latest
9
+ permissions:
10
+ contents: write
11
+
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ with:
15
+ token: ${{ secrets.GITHUB_TOKEN }}
16
+ - name: Set up Ruby 2.6
17
+ uses: ruby/setup-ruby@v1
18
+ with:
19
+ ruby-version: 2.6
20
+ bundler-cache: true
21
+ - name: Publish to RubyGems
22
+ run: |
23
+ git config --local user.email "action@github.com"
24
+ git config --local user.name "GitHub Action"
25
+
26
+ mkdir -p $HOME/.gem
27
+ touch $HOME/.gem/credentials
28
+ chmod 0600 $HOME/.gem/credentials
29
+ printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_TOKEN}\n" > $HOME/.gem/credentials
30
+ bundle exec rake release
31
+ env:
32
+ RUBYGEMS_API_TOKEN: "${{secrets.RUBYGEMS_API_TOKEN}}"
33
+ GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.1.15] - 2021-12-08
2
+ - 外部サーバから設定ファイルのリストアができるようになりました
3
+ - splatoon2 pluginのネームスペースを変更しました
4
+
1
5
  ## [0.1.14] - 2021-12-02
2
6
  - 外部サーバからOSの再起動やprocon_bypass_manのバージョンアップができるようになりました
3
7
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- procon_bypass_man (0.1.14)
4
+ procon_bypass_man (0.1.15)
5
5
  pbmenv
6
6
 
7
7
  GEM
@@ -31,7 +31,7 @@ GEM
31
31
  parallel (1.21.0)
32
32
  parser (3.0.2.0)
33
33
  ast (~> 2.4.1)
34
- pbmenv (0.1.5)
34
+ pbmenv (0.1.6)
35
35
  pry (0.14.1)
36
36
  coderay (~> 1.1)
37
37
  method_source (~> 1.0)
@@ -10,6 +10,8 @@ class ProconBypassMan::RunRemotePbmActionDispatchCommand
10
10
  ProconBypassMan::RemotePbmAction::StopPbmAction.new(pbm_job_uuid: uuid).run!(job_args: {})
11
11
  when ProconBypassMan::RemotePbmAction::ACTION_REBOOT_OS
12
12
  ProconBypassMan::RemotePbmAction::RebootOsAction.new(pbm_job_uuid: uuid).run!(job_args: {})
13
+ when ProconBypassMan::RemotePbmAction::ACTION_RESTORE_SETTING
14
+ ProconBypassMan::RemotePbmAction::RestorePbmSettingAction.new(pbm_job_uuid: uuid).run!(job_args: job_args)
13
15
  else
14
16
  ProconBypassMan::SendErrorCommand.execute(error: "#{action}は対応していないアクションです")
15
17
  end
@@ -0,0 +1,17 @@
1
+ module ProconBypassMan
2
+ module Plugin
3
+ module Splatoon2
4
+ module Macro
5
+ module FastReturn
6
+ def self.name
7
+ :fast_return
8
+ end
9
+
10
+ def self.steps
11
+ [:x, :down, :a, :a].freeze
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ module ProconBypassMan
2
+ module Plugin
3
+ module Splatoon2
4
+ module Macro
5
+ module JumpToLeftKey
6
+ def self.name
7
+ :jump_to_left_key
8
+ end
9
+
10
+ def self.steps
11
+ [:x, :left, :a, :a].freeze
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ module ProconBypassMan
2
+ module Plugin
3
+ module Splatoon2
4
+ module Macro
5
+ module JumpToRightKey
6
+ def self.name
7
+ :jump_to_right_key
8
+ end
9
+
10
+ def self.steps
11
+ [:x, :right, :a, :a].freeze
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ module ProconBypassMan
2
+ module Plugin
3
+ module Splatoon2
4
+ module Macro
5
+ module JumpToUpKey
6
+ def self.name
7
+ :jump_to_up_key
8
+ end
9
+
10
+ def self.steps
11
+ [:x, :up, :a, :a].freeze
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,59 @@
1
+ module ProconBypassMan
2
+ module Plugin
3
+ module Splatoon2
4
+ module Mode
5
+ module Guruguru
6
+ def self.binaries
7
+ [ "309481408000362d684658750968f71cfe2c0e51000001480053f71ffedf0d4b000a013d00caf6ecfd4c0d480003011c00000000000000000000000000000000",
8
+ "30978140800037dd6748687509fdf6adfded0d6d0081005d00eef68dfdef0d6d00830059001bf791fd140e720090005400000000000000000000000000000000",
9
+ "309a8140800038cd67495875099af821fe120e40006400880042f8fcfdfd0d470067008900d4f7e0fdf20d4e006a008c00000000000000000000000000000000",
10
+ "309c8140800036ed67466875099bf878fe4a0e35005b004c00c1f875fe400e35005d004c00c4f856fe2d0e390063006c00000000000000000000000000000000",
11
+ "30a081408000371d6847587509b9f71bfee70d22002c002300e3f73afe150e2b003500280014f854fe300e2d0038002900000000000000000000000000000000",
12
+ "30a38140800039fd6743587509def70ffea10d1a0031001f00d1f70ffeb10d19002c002200c5f711feb80d18002c002500000000000000000000000000000000",
13
+ "30a58140800037dd6746687509d8f70bfe980d270035001200ddf70dfe980d240038001900dff70ffe9b0d1f0035001a00000000000000000000000000000000",
14
+ "30a98140800037ed67484875099cf7edfdb00d310020000d009ef7eefda30d310022000c00adf7f2fd980d300028000a00000000000000000000000000000000",
15
+ "30ac8140800036ed67484875099cf709fed40d3a002400160097f7fafdd30d39002200150096f7f0fdc80d380022001400000000000000000000000000000000",
16
+ "30ae8140800038fd674558750987f72efed40d360021001c0089f729fed50d39002400180092f715fed10d390022001800000000000000000000000000000000",
17
+ "30b18140800037dd6747487509b8f705fea90d19001d002000c5f70dfeb00d210019002200bff71efec20d280018002400000000000000000000000000000000",
18
+ "30b48140800038fd684868750980f7e9fdd40d0200080024007df7f1fdba0d060011001e0084f7f8fdaa0d12001a001a00000000000000000000000000000000",
19
+ "30b7814080003fdd694958750918f6a9fd510f0d00d1ff370024f7b0fda90e0100ecff30006cf7d1fd210efffff5ff2c00000000000000000000000000000000",
20
+ "30ba81408080482d744768750963f71ffe190f5e00d9fea100ccf62dfe650f510009ff980015f702fe580f4b002eff8400000000000000000000000000000000",
21
+ "30bd814080802f7d864758750974f70efe4c0f5e00c0fea000d1f726fe1c0f5d00c5fea30028f859fe0e0f5c00cafea800000000000000000000000000000000",
22
+ "30bf8140808057cc984758750961f73afe630f99009dfeae0050f738fe710f7500adfea40050f721fe720f6e00b2fea300000000000000000000000000000000",
23
+ "30c281408080f479bd483875092ef8b6feab0f0a0180feba00f1f798fe900f000181febd00c2f77dfe7c0fdb008efebd00000000000000000000000000000000",
24
+ "30c581408080ad87d846487509e1f80000a6107e0178fea2004ef88dff54106c0185fea70063f826ffe60f520182feae00000000000000000000000000000000",
25
+ "30c8810080800797d84868750995f8e1fe4b0f7a0161fe88000df96dffd00f700149fe990035f9cdff361088016afea000000000000000000000000000000000",
26
+ "30cb810080804586d848487509cef672fe8a0f6d0217ff42002df63cfe280f1d0219ff410059f61cfe070fed01f5fe4a00000000000000000000000000000000",
27
+ "30d08100808002c5d745687509d8f5aaff830f5e03e6fe3e01fbf55bffc30f3f03e4fe100158f600ff3e102903e5fee700000000000000000000000000000000",
28
+ "30d3810080807b94d14838750991f6cd00690f9903f0fff10147f6e200560f7e038fffc60101f6c900560f71033bffa901000000000000000000000000000000",
29
+ "30d681008080b743ca475875095af7f2009c0fca03a400320242f7ca00950fb503820028020af7b000820fa4034e001a02000000000000000000000000000000",
30
+ "30d9810080805be3c047587509e7f77a03c70f0e04bb00410258f79801940f0004b800410251f74401910fd803b3003602000000000000000000000000000000",
31
+ "30dc810080808a02b245587509c0fbd5086a10710475020a03b0fb8d085d106c042102e8027efb660876106a04bc01af02000000000000000000000000000000",
32
+ "30de8100808036d2a14568750970fbbf09ad103704af038003a9fb600989105c0459036103c2fb2a097210690412034603000000000000000000000000000000",
33
+ "30e281008000cbb18d4738750989f8b40b2812380341044c0429f99e0bef11510340043704f2f93c0b7911b0033704f003000000000000000000000000000000",
34
+ "30e581008000c9c18945587509a5f7ca0a2e13e400c6024c0547f7fd0a941264011703270578f74a0b6012e40168030205000000000000000000000000000000",
35
+ "30e781008000c6618948687509acf86909e813d0fe2801a1057cf8cf09ed130fff6301990516f8710aaa13ccff13028205000000000000000000000000000000",
36
+ "30ea81008000c77189475875093af93b0762136efbaeff19060cf90107b113a9fb99ff0906e1f85b07b113bafc9fffcd05000000000000000000000000000000",
37
+ "30ed81008000c791894568750950f9ce047c1432f900026007a5f9a6051f146ef9bb013707bff99206a813fef9ce00c606000000000000000000000000000000",
38
+ "30ef81008000c6d1894558750944f8ad0358143ef81c02f10780f8b403841484f84102d107ccf801049314bcf84202ad07000000000000000000000000000000",
39
+ "30f381008000c761884868750914f72105e4134cf6d001c00743f71a05f11391f6bf01e407a0f7c904fa13faf6b3011008000000000000000000000000000000",
40
+ "30f681008000c7718344587509eaf54a04c812a6f40002500627f66d041313f2f40d02940682f6a60468133ef51a02d806000000000000000000000000000000",
41
+ "30f881008000c4e1814668750b5cf5f803b51125f3b5000d0560f50f04e8118cf33c015d057df525042c1210f4b101cc05000000000000000000000000000000",
42
+ "30fb81008000c5e1814458750b19f65a02a410acf29effb804e2f5db02df10b7f2c0ffbf04a9f55c032011dcf22400d804000000000000000000000000000000",
43
+ "30fe8100800035e2814858750b81f65c00f80f8df231fe940471f6e6001f1088f2a6fe92044ef6b1015a1092f21fffa004000000000000000000000000000000",
44
+ "3001810080004b03814868750b69f6e6fdad0ffef20efdd40479f678feb40fd9f249fdc40484f6f4fec00fb0f29ffdad04000000000000000000000000000000",
45
+ "30048100800079e47d4858750b17f64cfb5f0f46f46afb430529f6c4fb710ff1f3d4fb300538f64bfc830fbbf315fc1d05000000000000000000000000000000",
46
+ "300781008000a7057e4668750bb1f5d3f9fb0e8ef5ccf96405cdf5fcf90c0f44f52dfa6505e1f52dfa210f29f550fa6305000000000000000000000000000000",
47
+ "30098100800041f67d4668750bcdf4b0f9ab0e21f602f955057ef5adf9d00ee1f559f95f05b1f5d3f9fb0e8ef5ccf96405000000000000000000000000000000",
48
+ "300d810080003d877c4838750b84f458f7dd0c89f6d0f8fc0436f4e2f7620d83f614f8430526f4c0f8a00e71f666f85c05000000000000000000000000000000",
49
+ "30108100800058e77a4668750bf7f2c3f57c0c9cf6abfa0a0470f30ef6790c89f65dfa420414f476f67e0c80f6d0f98a04000000000000000000000000000000",
50
+ "30128100800059f77a4658750b7ef249f5580cd9f69bfaa40389f269f56c0cd1f6a9fab503a3f286f5760cacf6c9faeb03000000000000000000000000000000",
51
+ "3016810080005b177b4868750ba9f298f4450b2cf774fa3102b8f2a5f47a0b24f765fa6e02b8f2b8f4b10b1df755faac02000000000000000000000000000000",
52
+ "30198100800057777a4558750b39f258f4480a80f73efaf40016f26af4940a5ef76bfa37014ef275f4d40a46f780fa8401000000000000000000000000000000",
53
+ ].map(&:freeze).freeze
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ProconBypassMan
4
+ module Plugin
5
+ module Splatoon2
6
+ VERSION = "0.1.2"
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ require_relative "plugin/splatoon2/version"
2
+ require_relative "plugin/splatoon2/macro/fast_return"
3
+ require_relative "plugin/splatoon2/macro/jump_to_right_key"
4
+ require_relative "plugin/splatoon2/macro/jump_to_up_key"
5
+ require_relative "plugin/splatoon2/macro/jump_to_left_key"
6
+ require_relative "plugin/splatoon2/mode/guruguru"
7
+
8
+ module ProconBypassMan
9
+ module Plugin
10
+ end
11
+ end
@@ -16,6 +16,10 @@ module ProconBypassMan
16
16
  def before_action_callback
17
17
  be_processed
18
18
  end
19
+
20
+ def after_action_callback
21
+ # no-op
22
+ end
19
23
  end
20
24
  end
21
25
  end
@@ -12,6 +12,10 @@ module ProconBypassMan
12
12
  def before_action_callback
13
13
  be_processed
14
14
  end
15
+
16
+ def after_action_callback
17
+ # no-op
18
+ end
15
19
  end
16
20
  end
17
21
  end
@@ -0,0 +1,28 @@
1
+ module ProconBypassMan
2
+ module RemotePbmAction
3
+ class RestorePbmSettingAction < BaseAction
4
+
5
+ def action_content(args: )
6
+ require "pbmenv"
7
+ ProconBypassMan.logger.info "execute RestorePbmSettingAction!"
8
+ setting = args["setting"] or raise(ProconBypassMan::RemotePbmAction::NeedPbmVersionError, "settingが必要です, #{args.inspect}")
9
+ File.write(
10
+ ProconBypassMan::ButtonsSettingConfiguration.instance.setting_path,
11
+ setting.to_yaml,
12
+ )
13
+ ProconBypassMan.hot_reload!
14
+ end
15
+
16
+ private
17
+
18
+ def before_action_callback
19
+ be_in_progress
20
+ end
21
+
22
+ def after_action_callback
23
+ be_processed
24
+ end
25
+ end
26
+ end
27
+ end
28
+
@@ -12,6 +12,10 @@ module ProconBypassMan
12
12
  def before_action_callback
13
13
  be_processed
14
14
  end
15
+
16
+ def after_action_callback
17
+ # no-op
18
+ end
15
19
  end
16
20
  end
17
21
  end
@@ -4,12 +4,13 @@ module ProconBypassMan
4
4
  require "procon_bypass_man/remote_pbm_action/change_pbm_version_action"
5
5
  require "procon_bypass_man/remote_pbm_action/reboot_os_action"
6
6
  require "procon_bypass_man/remote_pbm_action/stop_pbm_action"
7
+ require "procon_bypass_man/remote_pbm_action/restore_pbm_setting.rb"
7
8
  require "procon_bypass_man/remote_pbm_action/lib/update_remote_pbm_action_status_command"
8
9
 
9
10
  ACTION_CHANGE_PBM_VERSION = "change_pbm_version"
10
11
  ACTION_REBOOT_OS = "reboot_os"
11
12
  ACTION_STOP_PBM = "stop_pbm"
12
- ACTION_RESTORE_SETTING = "restore_setting" # TODO
13
+ ACTION_RESTORE_SETTING = "restore_pbm_setting"
13
14
 
14
15
  ACTIONS = [
15
16
  ACTION_CHANGE_PBM_VERSION,
@@ -27,7 +27,7 @@ class ProconBypassMan::Runner
27
27
 
28
28
  loop do
29
29
  $will_terminate_token = false
30
- # TODO forkしないでThreadでいいのでは?
30
+ # NOTE メインプロセスではThreadをいくつか起動しているので念のためパフォーマンスを優先するためにforkしていく
31
31
  main_loop_pid = Kernel.fork { ProconBypassMan::BypassCommand.new(gadget: @gadget, procon: @procon).execute }
32
32
 
33
33
  begin
@@ -1,10 +1,10 @@
1
1
  module ProconBypassMan
2
2
  class ReportHttpClient < HttpClient
3
3
  def post(body: , event_type: )
4
- if body.is_a?(String)
5
- b = { text: body }
6
- else
4
+ if body.is_a?(Hash)
7
5
  b = body
6
+ else
7
+ b = { text: body }
8
8
  end
9
9
 
10
10
  super(request_body: {
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ProconBypassMan
4
- VERSION = "0.1.14"
4
+ VERSION = "0.1.15"
5
5
  end
@@ -33,7 +33,7 @@ require_relative "procon_bypass_man/procon/analog_stick"
33
33
  require_relative "procon_bypass_man/procon/analog_stick_cap"
34
34
  require_relative "procon_bypass_man/value_objects/remote_pbm_action_object"
35
35
  require_relative "procon_bypass_man/scheduler"
36
- require_relative "procon_bypass_man/splatoon2"
36
+ require_relative "procon_bypass_man/plugin"
37
37
 
38
38
  STDOUT.sync = true
39
39
  Thread.abort_on_exception = true
@@ -42,35 +42,21 @@ module ProconBypassMan
42
42
  extend ProconBypassMan::Configuration::ClassMethods
43
43
 
44
44
  class CouldNotLoadConfigError < StandardError; end
45
- class FirstConnectionError < StandardError; end
46
45
  class NotFoundProconError < StandardError; end
47
- class EternalConnectionError < StandardError; end
48
-
49
- def self.buttons_setting_configure(setting_path: nil, &block)
50
- unless setting_path
51
- logger.warn "setting_pathが未設定です。設定ファイルのライブリロードが使えません。"
52
- end
53
-
54
- if block_given?
55
- ProconBypassMan::ButtonsSettingConfiguration.instance.instance_eval(&block)
56
- else
57
- ProconBypassMan::ButtonsSettingConfiguration::Loader.load(setting_path: setting_path)
58
- end
59
- end
46
+ class ConnectionError < StandardError; end
47
+ class FirstConnectionError < ConnectionError; end
48
+ class EternalConnectionError < ConnectionError; end
60
49
 
61
50
  # @return [void]
62
- def self.run(setting_path: nil, &block)
51
+ def self.run(setting_path: nil)
63
52
  ProconBypassMan::Scheduler.start!
64
53
  ProconBypassMan::Background::JobRunner.start!
65
54
 
66
55
  ProconBypassMan.logger.info "PBMを起動しています"
67
56
  puts "PBMを起動しています"
68
- buttons_setting_configure(setting_path: setting_path, &block)
57
+ ProconBypassMan::ButtonsSettingConfiguration::Loader.load(setting_path: setting_path)
69
58
  initialize_pbm
70
- File.write(pid_path, $$)
71
- ProconBypassMan::WriteSessionIdCommand.execute
72
59
  gadget, procon = ProconBypassMan::ConnectDeviceCommand.execute!
73
- ProconBypassMan::DeviceStatus.change_to_running!
74
60
  Runner.new(gadget: gadget, procon: procon).run
75
61
  rescue ProconBypassMan::CouldNotLoadConfigError
76
62
  ProconBypassMan::SendErrorCommand.execute(error: "設定ファイルが不正です。設定ファイルの読み込みに失敗しました")
@@ -84,14 +70,18 @@ module ProconBypassMan
84
70
  FileUtils.rm_rf(ProconBypassMan.pid_path)
85
71
  FileUtils.rm_rf(ProconBypassMan.digest_path)
86
72
  exit 1
87
- rescue ProconBypassMan::EternalConnectionError
88
- ProconBypassMan::SendErrorCommand.execute(error: "接続の見込みがないのでsleepしまくります")
89
- ProconBypassMan::DeviceStatus.change_to_connected_but_sleeping!
90
- FileUtils.rm_rf(ProconBypassMan.pid_path)
91
- eternal_sleep
92
- rescue ProconBypassMan::FirstConnectionError
93
- ProconBypassMan::SendErrorCommand.execute(error: "接続を確立できませんでした。やりなおします。")
94
- retry
73
+ rescue ProconBypassMan::ConnectionError
74
+ begin
75
+ raise
76
+ rescue ProconBypassMan::EternalConnectionError
77
+ ProconBypassMan::SendErrorCommand.execute(error: "接続の見込みがないのでsleepしまくります")
78
+ ProconBypassMan::DeviceStatus.change_to_connected_but_sleeping!
79
+ FileUtils.rm_rf(ProconBypassMan.pid_path)
80
+ eternal_sleep
81
+ rescue ProconBypassMan::FirstConnectionError
82
+ ProconBypassMan::SendErrorCommand.execute(error: "接続を確立できませんでした。やりなおします。")
83
+ retry
84
+ end
95
85
  end
96
86
 
97
87
  def self.configure(&block)
@@ -116,9 +106,17 @@ module ProconBypassMan
116
106
 
117
107
  def self.initialize_pbm
118
108
  ProconBypassMan::WriteDeviceIdCommand.execute
109
+ ProconBypassMan::WriteSessionIdCommand.execute
110
+ File.write(pid_path, $$)
111
+ ProconBypassMan::DeviceStatus.change_to_running!
119
112
  end
120
113
 
121
114
  def self.eternal_sleep
122
115
  sleep(999999999)
123
116
  end
117
+
118
+ # @return [Void]
119
+ def self.hot_reload!
120
+ Process.kill(:USR2, pid)
121
+ end
124
122
  end
@@ -5,7 +5,7 @@ require 'bundler/inline'
5
5
  gemfile do
6
6
  source 'https://rubygems.org'
7
7
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
8
- gem 'procon_bypass_man', '0.1.14'
8
+ gem 'procon_bypass_man', '0.1.15'
9
9
  end
10
10
 
11
11
  ProconBypassMan.configure do |config|
@@ -1,12 +1,12 @@
1
1
  version: 1.0
2
2
  setting: |-
3
- fast_return = ProconBypassMan::Splatoon2::Macro::FastReturn
4
- guruguru = ProconBypassMan::Splatoon2::Mode::Guruguru
3
+ fast_return = ProconBypassMan::Plugin::Splatoon2::Macro::FastReturn
4
+ guruguru = ProconBypassMan::Plugin::Splatoon2::Mode::Guruguru
5
5
 
6
6
  install_macro_plugin fast_return
7
- install_macro_plugin ProconBypassMan::Splatoon2::Macro::JumpToUpKey
8
- install_macro_plugin ProconBypassMan::Splatoon2::Macro::JumpToRightKey
9
- install_macro_plugin ProconBypassMan::Splatoon2::Macro::JumpToLeftKey
7
+ install_macro_plugin ProconBypassMan::Plugin::Splatoon2::Macro::JumpToUpKey
8
+ install_macro_plugin ProconBypassMan::Plugin::Splatoon2::Macro::JumpToRightKey
9
+ install_macro_plugin ProconBypassMan::Plugin::Splatoon2::Macro::JumpToLeftKey
10
10
  install_mode_plugin guruguru
11
11
 
12
12
  prefix_keys_for_changing_layer [:zr, :zl, :l]
@@ -18,9 +18,9 @@ setting: |-
18
18
  flip :a, if_pressed: [:a]
19
19
  flip :down, if_pressed: :down
20
20
  macro fast_return.name, if_pressed: [:y, :b, :down]
21
- macro ProconBypassMan::Splatoon2::Macro::JumpToUpKey, if_pressed: [:y, :b, :up]
22
- macro ProconBypassMan::Splatoon2::Macro::JumpToRightKey, if_pressed: [:y, :b, :right]
23
- macro ProconBypassMan::Splatoon2::Macro::JumpToLeftKey, if_pressed: [:y, :b, :left]
21
+ macro ProconBypassMan::Plugin::Splatoon2::Macro::JumpToUpKey, if_pressed: [:y, :b, :up]
22
+ macro ProconBypassMan::Plugin::Splatoon2::Macro::JumpToRightKey, if_pressed: [:y, :b, :right]
23
+ macro ProconBypassMan::Plugin::Splatoon2::Macro::JumpToLeftKey, if_pressed: [:y, :b, :left]
24
24
  remap :l, to: :zr
25
25
  end
26
26
  layer :right, mode: guruguru.name
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.14
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - jiikko
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-02 00:00:00.000000000 Z
11
+ date: 2021-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pbmenv
@@ -32,6 +32,7 @@ extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
34
  - ".circleci/config.yml"
35
+ - ".github/workflows/release.yml"
35
36
  - ".github/workflows/ruby.yml"
36
37
  - ".gitignore"
37
38
  - ".rspec"
@@ -88,6 +89,13 @@ files:
88
89
  - lib/procon_bypass_man/device_connector.rb
89
90
  - lib/procon_bypass_man/device_status.rb
90
91
  - lib/procon_bypass_man/io_monitor.rb
92
+ - lib/procon_bypass_man/plugin.rb
93
+ - lib/procon_bypass_man/plugin/splatoon2/macro/fast_return.rb
94
+ - lib/procon_bypass_man/plugin/splatoon2/macro/jump_to_left_key.rb
95
+ - lib/procon_bypass_man/plugin/splatoon2/macro/jump_to_right_key.rb
96
+ - lib/procon_bypass_man/plugin/splatoon2/macro/jump_to_up_key.rb
97
+ - lib/procon_bypass_man/plugin/splatoon2/mode/guruguru.rb
98
+ - lib/procon_bypass_man/plugin/splatoon2/version.rb
91
99
  - lib/procon_bypass_man/processor.rb
92
100
  - lib/procon_bypass_man/procon.rb
93
101
  - lib/procon_bypass_man/procon/analog_stick.rb
@@ -106,16 +114,10 @@ files:
106
114
  - lib/procon_bypass_man/remote_pbm_action/change_pbm_version_action.rb
107
115
  - lib/procon_bypass_man/remote_pbm_action/lib/update_remote_pbm_action_status_command.rb
108
116
  - lib/procon_bypass_man/remote_pbm_action/reboot_os_action.rb
117
+ - lib/procon_bypass_man/remote_pbm_action/restore_pbm_setting.rb
109
118
  - lib/procon_bypass_man/remote_pbm_action/stop_pbm_action.rb
110
119
  - lib/procon_bypass_man/runner.rb
111
120
  - lib/procon_bypass_man/scheduler.rb
112
- - lib/procon_bypass_man/splatoon2.rb
113
- - lib/procon_bypass_man/splatoon2/macro/fast_return.rb
114
- - lib/procon_bypass_man/splatoon2/macro/jump_to_left_key.rb
115
- - lib/procon_bypass_man/splatoon2/macro/jump_to_right_key.rb
116
- - lib/procon_bypass_man/splatoon2/macro/jump_to_up_key.rb
117
- - lib/procon_bypass_man/splatoon2/mode/guruguru.rb
118
- - lib/procon_bypass_man/splatoon2/version.rb
119
121
  - lib/procon_bypass_man/support/callbacks.rb
120
122
  - lib/procon_bypass_man/support/compress_array.rb
121
123
  - lib/procon_bypass_man/support/http_client.rb
@@ -145,7 +147,7 @@ metadata:
145
147
  homepage_uri: https://github.com/splaplapla/procon_bypass_man
146
148
  source_code_uri: https://github.com/splaplapla/procon_bypass_man
147
149
  changelog_uri: https://github.com/splaplapla/procon_bypass_man/blob/master/CHANGELOG.md
148
- post_install_message:
150
+ post_install_message:
149
151
  rdoc_options: []
150
152
  require_paths:
151
153
  - lib
@@ -160,8 +162,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
162
  - !ruby/object:Gem::Version
161
163
  version: '0'
162
164
  requirements: []
163
- rubygems_version: 3.2.30
164
- signing_key:
165
+ rubygems_version: 3.0.3.1
166
+ signing_key:
165
167
  specification_version: 4
166
168
  summary: An extension for Nintendo Switch Pro Controller
167
169
  test_files: []
@@ -1,15 +0,0 @@
1
- module ProconBypassMan
2
- module Splatoon2
3
- module Macro
4
- module FastReturn
5
- def self.name
6
- :fast_return
7
- end
8
-
9
- def self.steps
10
- [:x, :down, :a, :a].freeze
11
- end
12
- end
13
- end
14
- end
15
- end
@@ -1,15 +0,0 @@
1
- module ProconBypassMan
2
- module Splatoon2
3
- module Macro
4
- module JumpToLeftKey
5
- def self.name
6
- :jump_to_left_key
7
- end
8
-
9
- def self.steps
10
- [:x, :left, :a, :a].freeze
11
- end
12
- end
13
- end
14
- end
15
- end
@@ -1,15 +0,0 @@
1
- module ProconBypassMan
2
- module Splatoon2
3
- module Macro
4
- module JumpToRightKey
5
- def self.name
6
- :jump_to_right_key
7
- end
8
-
9
- def self.steps
10
- [:x, :right, :a, :a].freeze
11
- end
12
- end
13
- end
14
- end
15
- end
@@ -1,15 +0,0 @@
1
- module ProconBypassMan
2
- module Splatoon2
3
- module Macro
4
- module JumpToUpKey
5
- def self.name
6
- :jump_to_up_key
7
- end
8
-
9
- def self.steps
10
- [:x, :up, :a, :a].freeze
11
- end
12
- end
13
- end
14
- end
15
- end
@@ -1,57 +0,0 @@
1
- module ProconBypassMan
2
- module Splatoon2
3
- module Mode
4
- module Guruguru
5
- def self.binaries
6
- [ "309481408000362d684658750968f71cfe2c0e51000001480053f71ffedf0d4b000a013d00caf6ecfd4c0d480003011c00000000000000000000000000000000",
7
- "30978140800037dd6748687509fdf6adfded0d6d0081005d00eef68dfdef0d6d00830059001bf791fd140e720090005400000000000000000000000000000000",
8
- "309a8140800038cd67495875099af821fe120e40006400880042f8fcfdfd0d470067008900d4f7e0fdf20d4e006a008c00000000000000000000000000000000",
9
- "309c8140800036ed67466875099bf878fe4a0e35005b004c00c1f875fe400e35005d004c00c4f856fe2d0e390063006c00000000000000000000000000000000",
10
- "30a081408000371d6847587509b9f71bfee70d22002c002300e3f73afe150e2b003500280014f854fe300e2d0038002900000000000000000000000000000000",
11
- "30a38140800039fd6743587509def70ffea10d1a0031001f00d1f70ffeb10d19002c002200c5f711feb80d18002c002500000000000000000000000000000000",
12
- "30a58140800037dd6746687509d8f70bfe980d270035001200ddf70dfe980d240038001900dff70ffe9b0d1f0035001a00000000000000000000000000000000",
13
- "30a98140800037ed67484875099cf7edfdb00d310020000d009ef7eefda30d310022000c00adf7f2fd980d300028000a00000000000000000000000000000000",
14
- "30ac8140800036ed67484875099cf709fed40d3a002400160097f7fafdd30d39002200150096f7f0fdc80d380022001400000000000000000000000000000000",
15
- "30ae8140800038fd674558750987f72efed40d360021001c0089f729fed50d39002400180092f715fed10d390022001800000000000000000000000000000000",
16
- "30b18140800037dd6747487509b8f705fea90d19001d002000c5f70dfeb00d210019002200bff71efec20d280018002400000000000000000000000000000000",
17
- "30b48140800038fd684868750980f7e9fdd40d0200080024007df7f1fdba0d060011001e0084f7f8fdaa0d12001a001a00000000000000000000000000000000",
18
- "30b7814080003fdd694958750918f6a9fd510f0d00d1ff370024f7b0fda90e0100ecff30006cf7d1fd210efffff5ff2c00000000000000000000000000000000",
19
- "30ba81408080482d744768750963f71ffe190f5e00d9fea100ccf62dfe650f510009ff980015f702fe580f4b002eff8400000000000000000000000000000000",
20
- "30bd814080802f7d864758750974f70efe4c0f5e00c0fea000d1f726fe1c0f5d00c5fea30028f859fe0e0f5c00cafea800000000000000000000000000000000",
21
- "30bf8140808057cc984758750961f73afe630f99009dfeae0050f738fe710f7500adfea40050f721fe720f6e00b2fea300000000000000000000000000000000",
22
- "30c281408080f479bd483875092ef8b6feab0f0a0180feba00f1f798fe900f000181febd00c2f77dfe7c0fdb008efebd00000000000000000000000000000000",
23
- "30c581408080ad87d846487509e1f80000a6107e0178fea2004ef88dff54106c0185fea70063f826ffe60f520182feae00000000000000000000000000000000",
24
- "30c8810080800797d84868750995f8e1fe4b0f7a0161fe88000df96dffd00f700149fe990035f9cdff361088016afea000000000000000000000000000000000",
25
- "30cb810080804586d848487509cef672fe8a0f6d0217ff42002df63cfe280f1d0219ff410059f61cfe070fed01f5fe4a00000000000000000000000000000000",
26
- "30d08100808002c5d745687509d8f5aaff830f5e03e6fe3e01fbf55bffc30f3f03e4fe100158f600ff3e102903e5fee700000000000000000000000000000000",
27
- "30d3810080807b94d14838750991f6cd00690f9903f0fff10147f6e200560f7e038fffc60101f6c900560f71033bffa901000000000000000000000000000000",
28
- "30d681008080b743ca475875095af7f2009c0fca03a400320242f7ca00950fb503820028020af7b000820fa4034e001a02000000000000000000000000000000",
29
- "30d9810080805be3c047587509e7f77a03c70f0e04bb00410258f79801940f0004b800410251f74401910fd803b3003602000000000000000000000000000000",
30
- "30dc810080808a02b245587509c0fbd5086a10710475020a03b0fb8d085d106c042102e8027efb660876106a04bc01af02000000000000000000000000000000",
31
- "30de8100808036d2a14568750970fbbf09ad103704af038003a9fb600989105c0459036103c2fb2a097210690412034603000000000000000000000000000000",
32
- "30e281008000cbb18d4738750989f8b40b2812380341044c0429f99e0bef11510340043704f2f93c0b7911b0033704f003000000000000000000000000000000",
33
- "30e581008000c9c18945587509a5f7ca0a2e13e400c6024c0547f7fd0a941264011703270578f74a0b6012e40168030205000000000000000000000000000000",
34
- "30e781008000c6618948687509acf86909e813d0fe2801a1057cf8cf09ed130fff6301990516f8710aaa13ccff13028205000000000000000000000000000000",
35
- "30ea81008000c77189475875093af93b0762136efbaeff19060cf90107b113a9fb99ff0906e1f85b07b113bafc9fffcd05000000000000000000000000000000",
36
- "30ed81008000c791894568750950f9ce047c1432f900026007a5f9a6051f146ef9bb013707bff99206a813fef9ce00c606000000000000000000000000000000",
37
- "30ef81008000c6d1894558750944f8ad0358143ef81c02f10780f8b403841484f84102d107ccf801049314bcf84202ad07000000000000000000000000000000",
38
- "30f381008000c761884868750914f72105e4134cf6d001c00743f71a05f11391f6bf01e407a0f7c904fa13faf6b3011008000000000000000000000000000000",
39
- "30f681008000c7718344587509eaf54a04c812a6f40002500627f66d041313f2f40d02940682f6a60468133ef51a02d806000000000000000000000000000000",
40
- "30f881008000c4e1814668750b5cf5f803b51125f3b5000d0560f50f04e8118cf33c015d057df525042c1210f4b101cc05000000000000000000000000000000",
41
- "30fb81008000c5e1814458750b19f65a02a410acf29effb804e2f5db02df10b7f2c0ffbf04a9f55c032011dcf22400d804000000000000000000000000000000",
42
- "30fe8100800035e2814858750b81f65c00f80f8df231fe940471f6e6001f1088f2a6fe92044ef6b1015a1092f21fffa004000000000000000000000000000000",
43
- "3001810080004b03814868750b69f6e6fdad0ffef20efdd40479f678feb40fd9f249fdc40484f6f4fec00fb0f29ffdad04000000000000000000000000000000",
44
- "30048100800079e47d4858750b17f64cfb5f0f46f46afb430529f6c4fb710ff1f3d4fb300538f64bfc830fbbf315fc1d05000000000000000000000000000000",
45
- "300781008000a7057e4668750bb1f5d3f9fb0e8ef5ccf96405cdf5fcf90c0f44f52dfa6505e1f52dfa210f29f550fa6305000000000000000000000000000000",
46
- "30098100800041f67d4668750bcdf4b0f9ab0e21f602f955057ef5adf9d00ee1f559f95f05b1f5d3f9fb0e8ef5ccf96405000000000000000000000000000000",
47
- "300d810080003d877c4838750b84f458f7dd0c89f6d0f8fc0436f4e2f7620d83f614f8430526f4c0f8a00e71f666f85c05000000000000000000000000000000",
48
- "30108100800058e77a4668750bf7f2c3f57c0c9cf6abfa0a0470f30ef6790c89f65dfa420414f476f67e0c80f6d0f98a04000000000000000000000000000000",
49
- "30128100800059f77a4658750b7ef249f5580cd9f69bfaa40389f269f56c0cd1f6a9fab503a3f286f5760cacf6c9faeb03000000000000000000000000000000",
50
- "3016810080005b177b4868750ba9f298f4450b2cf774fa3102b8f2a5f47a0b24f765fa6e02b8f2b8f4b10b1df755faac02000000000000000000000000000000",
51
- "30198100800057777a4558750b39f258f4480a80f73efaf40016f26af4940a5ef76bfa37014ef275f4d40a46f780fa8401000000000000000000000000000000",
52
- ].map(&:freeze).freeze
53
- end
54
- end
55
- end
56
- end
57
- end
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ProconBypassMan
4
- module Splatoon2
5
- VERSION = "0.1.1"
6
- end
7
- end
@@ -1,11 +0,0 @@
1
- require_relative "splatoon2/version"
2
- require_relative "splatoon2/macro/fast_return"
3
- require_relative "splatoon2/macro/jump_to_right_key"
4
- require_relative "splatoon2/macro/jump_to_up_key"
5
- require_relative "splatoon2/macro/jump_to_left_key"
6
- require_relative "splatoon2/mode/guruguru"
7
-
8
- module ProconBypassMan
9
- module Splatoon2
10
- end
11
- end