vault_coh 2.0.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bdbd7e919eda17b55ac97b058087b32094c56066a612ddff20d78ade238b2797
4
- data.tar.gz: 2cdc54cbc219eace927ec8e58d586c012c1a97933636e1ad1207adcf7acd0343
3
+ metadata.gz: d592cf204ea2ac142d3a8a3451fc5c6f2af2b2b1667c63182c31a968104b80ff
4
+ data.tar.gz: 3b3d78276b036144d13321007080a4c4b207549c3181728d0c71d36d13128182
5
5
  SHA512:
6
- metadata.gz: e989e5dc6f37f6730a6e406e29d35acb7eb6b779e48b8e36d156df2abfd825bb2fd5909c1f7875c155a167d5d7eb7cebf690014eb853e9389c917069ba5a41ce
7
- data.tar.gz: 9aaa7fee672a3a617b03151b2967c122503ab67d3fe197b7df615b151bc79b6ca9889203bad6b82c4d5689548c102921922fbcb28e5c5633093d60370a4d9fb2
6
+ metadata.gz: 5e652ab1d2dd9df9cfab540012512a9d099955498d1d69951c222e15e4717676db8a5c3d47c74163b543de277d61091dd531ad792fa1cfb6de730357476fea63
7
+ data.tar.gz: 606019499e3af6298b8ff1b07004740f0dff1a2339601f61ab1b3c74debca39d67e5bc91e2837e87b5bab6f38c013d834e4e4a2611265481981ecf949babc4fb
data/Cargo.lock CHANGED
@@ -28,7 +28,7 @@ dependencies = [
28
28
  "regex",
29
29
  "rustc-hash",
30
30
  "shlex",
31
- "syn 2.0.38",
31
+ "syn 2.0.39",
32
32
  ]
33
33
 
34
34
  [[package]]
@@ -95,9 +95,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
95
95
 
96
96
  [[package]]
97
97
  name = "libc"
98
- version = "0.2.149"
98
+ version = "0.2.150"
99
99
  source = "registry+https://github.com/rust-lang/crates.io-index"
100
- checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b"
100
+ checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
101
101
 
102
102
  [[package]]
103
103
  name = "libloading"
@@ -129,7 +129,7 @@ checksum = "5968c820e2960565f647819f5928a42d6e874551cab9d88d75e3e0660d7f71e3"
129
129
  dependencies = [
130
130
  "proc-macro2",
131
131
  "quote",
132
- "syn 2.0.38",
132
+ "syn 2.0.39",
133
133
  ]
134
134
 
135
135
  [[package]]
@@ -231,7 +231,7 @@ dependencies = [
231
231
  "quote",
232
232
  "regex",
233
233
  "shell-words",
234
- "syn 2.0.38",
234
+ "syn 2.0.39",
235
235
  ]
236
236
 
237
237
  [[package]]
@@ -339,9 +339,9 @@ dependencies = [
339
339
 
340
340
  [[package]]
341
341
  name = "syn"
342
- version = "2.0.38"
342
+ version = "2.0.39"
343
343
  source = "registry+https://github.com/rust-lang/crates.io-index"
344
- checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b"
344
+ checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a"
345
345
  dependencies = [
346
346
  "proc-macro2",
347
347
  "quote",
@@ -362,9 +362,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
362
362
 
363
363
  [[package]]
364
364
  name = "vault"
365
- version = "5.0.0"
365
+ version = "5.1.1"
366
366
  source = "registry+https://github.com/rust-lang/crates.io-index"
367
- checksum = "c67502a964c8ac4301dcd55e042f7b581fb4bce681dc4236b3c75f5971a219ce"
367
+ checksum = "6254a954458cb9965b33572de19287e36c6b32c7803d1bec0f2889d8eb9d3e3c"
368
368
  dependencies = [
369
369
  "byteorder",
370
370
  "magnus",
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vault_coh (2.0.0)
4
+ vault_coh (2.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Vault
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/vault_coh.svg)](https://badge.fury.io/rb/vault_coh) [![Documentation](https://img.shields.io/badge/View-Documentation-blue.svg)](https://rubydoc.info/github/ryantaylor/vault-rb/v2.0.0)
3
+ [![Gem Version](https://badge.fury.io/rb/vault_coh.svg)](https://badge.fury.io/rb/vault_coh) [![Documentation](https://img.shields.io/badge/View-Documentation-blue.svg)](https://rubydoc.info/github/ryantaylor/vault-rb/v2.2.0)
4
4
 
5
5
  A native Ruby client wrapper for the [vault](https://github.com/ryantaylor/vault) Company of Heroes replay parser, integrated via a Rust native extension.
6
6
 
@@ -24,7 +24,7 @@ bytes = File.read('/path/to/replay.rec').unpack('C*')
24
24
  replay = VaultCoh::Replay.from_bytes(bytes)
25
25
  puts replay.version
26
26
  ```
27
- All information available from parsing can be found in the [documentation](https://rubydoc.info/github/ryantaylor/vault-rb/v2.0.0).
27
+ All information available from parsing can be found in the [documentation](https://rubydoc.info/github/ryantaylor/vault-rb/v2.2.0).
28
28
 
29
29
  ## Contributing
30
30
 
@@ -1,6 +1,8 @@
1
1
  use magnus::Value;
2
- use vault::commands::{BuildSquad, SelectBattlegroup, Unknown};
3
- use vault::{Map, Message, Player, Replay};
2
+ use vault::commands::{
3
+ BuildSquad, SelectBattlegroup, SelectBattlegroupAbility, Unknown, UseBattlegroupAbility,
4
+ };
5
+ use vault::{Command, Map, Message, Player, Replay};
4
6
 
5
7
  pub trait HashExt {
6
8
  fn to_h(&self) -> Value;
@@ -30,6 +32,12 @@ impl HashExt for Message {
30
32
  }
31
33
  }
32
34
 
35
+ impl HashExt for Command {
36
+ fn to_h(&self) -> Value {
37
+ serde_magnus::serialize(self).unwrap()
38
+ }
39
+ }
40
+
33
41
  impl HashExt for BuildSquad {
34
42
  fn to_h(&self) -> Value {
35
43
  serde_magnus::serialize(self).unwrap()
@@ -42,6 +50,18 @@ impl HashExt for SelectBattlegroup {
42
50
  }
43
51
  }
44
52
 
53
+ impl HashExt for SelectBattlegroupAbility {
54
+ fn to_h(&self) -> Value {
55
+ serde_magnus::serialize(self).unwrap()
56
+ }
57
+ }
58
+
59
+ impl HashExt for UseBattlegroupAbility {
60
+ fn to_h(&self) -> Value {
61
+ serde_magnus::serialize(self).unwrap()
62
+ }
63
+ }
64
+
45
65
  impl HashExt for Unknown {
46
66
  fn to_h(&self) -> Value {
47
67
  serde_magnus::serialize(self).unwrap()
@@ -2,7 +2,9 @@ mod hash;
2
2
 
3
3
  use crate::hash::HashExt;
4
4
  use magnus::{class, define_module, exception, function, method, prelude::*, Error};
5
- use vault::commands::{BuildSquad, SelectBattlegroup, Unknown};
5
+ use vault::commands::{
6
+ BuildSquad, SelectBattlegroup, SelectBattlegroupAbility, Unknown, UseBattlegroupAbility,
7
+ };
6
8
  use vault::{Command, Faction, Map, Message, Player, Replay, Team};
7
9
 
8
10
  #[magnus::init]
@@ -47,6 +49,10 @@ fn init() -> Result<(), Error> {
47
49
  player.define_method("messages", method!(Player::messages, 0))?;
48
50
  player.define_method("commands", method!(Player::commands, 0))?;
49
51
  player.define_method("build_commands", method!(Player::build_commands, 0))?;
52
+ player.define_method(
53
+ "battlegroup_commands",
54
+ method!(Player::battlegroup_commands, 0),
55
+ )?;
50
56
  player.define_method("to_h", method!(Player::to_h, 0))?;
51
57
 
52
58
  let message = module.define_class("Message", class::object())?;
@@ -61,6 +67,7 @@ fn init() -> Result<(), Error> {
61
67
  team.define_method("value", method!(Team::value, 0))?;
62
68
 
63
69
  let command = module.define_class("Command", class::object())?;
70
+ command.define_method("to_h", method!(Command::to_h, 0))?;
64
71
 
65
72
  let commands_module = module.define_module("Commands")?;
66
73
 
@@ -82,6 +89,33 @@ fn init() -> Result<(), Error> {
82
89
  select_battlegroup.define_method("pbgid", method!(SelectBattlegroup::pbgid, 0))?;
83
90
  select_battlegroup.define_method("to_h", method!(SelectBattlegroup::to_h, 0))?;
84
91
 
92
+ let select_battlegroup_ability_command =
93
+ commands_module.define_class("SelectBattlegroupAbilityCommand", command)?;
94
+ select_battlegroup_ability_command.define_method(
95
+ "value",
96
+ method!(Command::extract_select_battlegroup_ability, 0),
97
+ )?;
98
+
99
+ let select_battlegroup_ability =
100
+ commands_module.define_class("SelectBattlegroupAbility", class::object())?;
101
+ select_battlegroup_ability.define_method("tick", method!(SelectBattlegroupAbility::tick, 0))?;
102
+ select_battlegroup_ability
103
+ .define_method("pbgid", method!(SelectBattlegroupAbility::pbgid, 0))?;
104
+ select_battlegroup_ability.define_method("to_h", method!(SelectBattlegroupAbility::to_h, 0))?;
105
+
106
+ let use_battlegroup_ability_command =
107
+ commands_module.define_class("UseBattlegroupAbilityCommand", command)?;
108
+ use_battlegroup_ability_command.define_method(
109
+ "value",
110
+ method!(Command::extract_use_battlegroup_ability, 0),
111
+ )?;
112
+
113
+ let use_battlegroup_ability =
114
+ commands_module.define_class("UseBattlegroupAbility", class::object())?;
115
+ use_battlegroup_ability.define_method("tick", method!(UseBattlegroupAbility::tick, 0))?;
116
+ use_battlegroup_ability.define_method("pbgid", method!(UseBattlegroupAbility::pbgid, 0))?;
117
+ use_battlegroup_ability.define_method("to_h", method!(UseBattlegroupAbility::to_h, 0))?;
118
+
85
119
  let unknown_command = commands_module.define_class("UnknownCommand", command)?;
86
120
  unknown_command.define_method("value", method!(Command::extract_unknown, 0))?;
87
121
 
@@ -6,7 +6,16 @@ module VaultCoh
6
6
  # Data object that contains information specific to the
7
7
  # type of command it represents.
8
8
  #
9
- # @return [Commands::BuildSquad|Commands::SelectBattlegroup|Commands::Unknown]
9
+ # @return [Commands::BuildSquad |
10
+ # Commands::SelectBattlegroup |
11
+ # Commands::SelectBattlegroupAbility |
12
+ # Commands::UseBattlegroupAbility |
13
+ # Commands::Unknown]
10
14
  def value; end
15
+
16
+ # Returns a hash representation of the object.
17
+ #
18
+ # @return [Hash]
19
+ def to_h; end
11
20
  end
12
21
  end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module VaultCoh
4
+ module Commands
5
+ # Data object representing information parsed from a
6
+ # battlegroup ability selection command.
7
+ class SelectBattlegroupAbility
8
+ # This value is the tick at which the command was
9
+ # found while parsing the replay, which represents
10
+ # the time in the replay at which it was executed.
11
+ # Because CoH3's engine runs at 8 ticks per second,
12
+ # you can divide this value by 8 to get the number
13
+ # of seconds since the replay began, which will tell
14
+ # you when this command was executed.
15
+ #
16
+ # @return [Integer] unsigned, 32 bits
17
+ def tick; end
18
+
19
+ # Internal ID that uniquely identifies the battlegroup
20
+ # ability selected. This value can be matched to CoH3
21
+ # attribute files in order to determine the battlegroup
22
+ # ability being selected. Note that, while rare, it is
23
+ # possible that this value may change between patches
24
+ # for the same battlegroup.
25
+ #
26
+ # @return [Integer] unsigned, 32 bits
27
+ def pbgid; end
28
+
29
+ # Returns a hash representation of the object.
30
+ #
31
+ # @return [Hash]
32
+ def to_h; end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module VaultCoh
4
+ module Commands
5
+ # Wrapper for a battlegroup ability selection command.
6
+ class SelectBattlegroupAbilityCommand < Command
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module VaultCoh
4
+ module Commands
5
+ # Data object representing information parsed from a
6
+ # battlegroup ability usage command.
7
+ class UseBattlegroupAbility
8
+ # This value is the tick at which the command was
9
+ # found while parsing the replay, which represents
10
+ # the time in the replay at which it was executed.
11
+ # Because CoH3's engine runs at 8 ticks per second,
12
+ # you can divide this value by 8 to get the number
13
+ # of seconds since the replay began, which will tell
14
+ # you when this command was executed.
15
+ #
16
+ # @return [Integer] unsigned, 32 bits
17
+ def tick; end
18
+
19
+ # Internal ID that uniquely identifies the battlegroup
20
+ # ability used. This value can be matched to CoH3
21
+ # attribute files in order to determine the battlegroup
22
+ # ability being used. Note that, while rare, it is
23
+ # possible that this value may change between patches
24
+ # for the same battlegroup.
25
+ #
26
+ # @return [Integer] unsigned, 32 bits
27
+ def pbgid; end
28
+
29
+ # Returns a hash representation of the object.
30
+ #
31
+ # @return [Hash]
32
+ def to_h; end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module VaultCoh
4
+ module Commands
5
+ # Wrapper for a battlegroup ability usage command.
6
+ class UseBattlegroupAbilityCommand < Command
7
+ end
8
+ end
9
+ end
@@ -65,6 +65,16 @@ module VaultCoh
65
65
  # @return [Array<Commands::BuildSquad>]
66
66
  def build_commands; end
67
67
 
68
+ # A list of only battlegroup-related commands executed by the player
69
+ # in the match. A battlegroup command is any that involves the select
70
+ # or use of battlegroups and their abilities. Sorted chronologically
71
+ # from first to last.
72
+ #
73
+ # @return [Array<Commands::SelectBattlegroupCommand |
74
+ # Commands::SelectBattlegroupAbilityCommand |
75
+ # Commands::UseBattlegroupAbilityCommand>]
76
+ def battlegroup_commands; end
77
+
68
78
  # Returns a hash representation of the object.
69
79
  #
70
80
  # @return [Hash]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VaultCoh
4
- VERSION = '2.0.0'
4
+ VERSION = '2.2.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vault_coh
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ryantaylor
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-02 00:00:00.000000000 Z
11
+ date: 2023-11-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Company of Heroes replay parsing in Ruby using the vault parsing library
14
14
  via a Rust native extension.
@@ -39,9 +39,13 @@ files:
39
39
  - lib/vault_coh/commands/build_squad.rb
40
40
  - lib/vault_coh/commands/build_squad_command.rb
41
41
  - lib/vault_coh/commands/select_battlegroup.rb
42
+ - lib/vault_coh/commands/select_battlegroup_ability.rb
43
+ - lib/vault_coh/commands/select_battlegroup_ability_command.rb
42
44
  - lib/vault_coh/commands/select_battlegroup_command.rb
43
45
  - lib/vault_coh/commands/unknown.rb
44
46
  - lib/vault_coh/commands/unknown_command.rb
47
+ - lib/vault_coh/commands/use_battlegroup_ability.rb
48
+ - lib/vault_coh/commands/use_battlegroup_ability_command.rb
45
49
  - lib/vault_coh/faction.rb
46
50
  - lib/vault_coh/map.rb
47
51
  - lib/vault_coh/message.rb