vault_coh 2.1.0 → 2.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58b4566c6a716ad6a4bd8e5cf6cc34d5463f41cabebdd73fb700754306e2f755
4
- data.tar.gz: a1c6cba1f9612d76d9ff6f4ada79881cd7df6eaa05f48834c325e3c2eaa49fbb
3
+ metadata.gz: d592cf204ea2ac142d3a8a3451fc5c6f2af2b2b1667c63182c31a968104b80ff
4
+ data.tar.gz: 3b3d78276b036144d13321007080a4c4b207549c3181728d0c71d36d13128182
5
5
  SHA512:
6
- metadata.gz: 0bd7b66a16fbe5800643311bc98b0c8e68ac2a913a0a045e371819b715837cddae36dea7b1081c6ab40216604fca4a29efa3c4fb306b54a96ddaf6ae22df5b04
7
- data.tar.gz: 2f62b79798c457b68fba088de8426345a8f256c38653f06d96dce5d5e3491f00b9dad5bd68e0ab08fd3c8e5accecea6e191fb7db833b0d5a4367c993cb864123
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.1.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.1.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.1.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,5 +1,7 @@
1
1
  use magnus::Value;
2
- use vault::commands::{BuildSquad, SelectBattlegroup, Unknown};
2
+ use vault::commands::{
3
+ BuildSquad, SelectBattlegroup, SelectBattlegroupAbility, Unknown, UseBattlegroupAbility,
4
+ };
3
5
  use vault::{Command, Map, Message, Player, Replay};
4
6
 
5
7
  pub trait HashExt {
@@ -48,6 +50,18 @@ impl HashExt for SelectBattlegroup {
48
50
  }
49
51
  }
50
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
+
51
65
  impl HashExt for Unknown {
52
66
  fn to_h(&self) -> Value {
53
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())?;
@@ -83,6 +89,33 @@ fn init() -> Result<(), Error> {
83
89
  select_battlegroup.define_method("pbgid", method!(SelectBattlegroup::pbgid, 0))?;
84
90
  select_battlegroup.define_method("to_h", method!(SelectBattlegroup::to_h, 0))?;
85
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
+
86
119
  let unknown_command = commands_module.define_class("UnknownCommand", command)?;
87
120
  unknown_command.define_method("value", method!(Command::extract_unknown, 0))?;
88
121
 
@@ -6,7 +6,11 @@ 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
11
15
 
12
16
  # Returns a hash representation of the object.
@@ -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.1.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.1.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