vault_coh 2.2.0 → 4.0.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: d592cf204ea2ac142d3a8a3451fc5c6f2af2b2b1667c63182c31a968104b80ff
4
- data.tar.gz: 3b3d78276b036144d13321007080a4c4b207549c3181728d0c71d36d13128182
3
+ metadata.gz: efcd317fb3639ebb84a7fcb11f7d3b513422211d1c2b87f3e564ce4ddbf78f74
4
+ data.tar.gz: c52abcfeceab7cafcb94f15e93dad181afb600bc8bbbb29e0ebf8ea0ebe61c33
5
5
  SHA512:
6
- metadata.gz: 5e652ab1d2dd9df9cfab540012512a9d099955498d1d69951c222e15e4717676db8a5c3d47c74163b543de277d61091dd531ad792fa1cfb6de730357476fea63
7
- data.tar.gz: 606019499e3af6298b8ff1b07004740f0dff1a2339601f61ab1b3c74debca39d67e5bc91e2837e87b5bab6f38c013d834e4e4a2611265481981ecf949babc4fb
6
+ metadata.gz: 866f6b1d80b16c5a006d0f3878202225c26b08138e088c24b31990e71a698a137e5f04bc58992dd038826939dacc75f356409566c0b358a637315ebe3309e789
7
+ data.tar.gz: a5d2d75254cbeb6bdc05b23fb0adec01d9df3c379d8b862be8b4e8568f56d56eb349255b1cf4b49bd68ff76202366b7ccd22eb445abf65576cabacb2126a1a55
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.2.2
data/Cargo.lock CHANGED
@@ -362,9 +362,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
362
362
 
363
363
  [[package]]
364
364
  name = "vault"
365
- version = "5.1.1"
365
+ version = "7.0.0"
366
366
  source = "registry+https://github.com/rust-lang/crates.io-index"
367
- checksum = "6254a954458cb9965b33572de19287e36c6b32c7803d1bec0f2889d8eb9d3e3c"
367
+ checksum = "c883ce2ee65509850bbf77b935dac0d6876392de077138650de1f5d109381bd8"
368
368
  dependencies = [
369
369
  "byteorder",
370
370
  "magnus",
data/Gemfile CHANGED
@@ -12,4 +12,4 @@ gem 'rb_sys'
12
12
 
13
13
  gem 'rspec', '~> 3.0'
14
14
 
15
- gem 'rubocop', '~> 1.57'
15
+ gem 'rubocop', '~> 1.59'
data/Gemfile.lock CHANGED
@@ -1,26 +1,26 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vault_coh (2.2.0)
4
+ vault_coh (4.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  ast (2.4.2)
10
10
  diff-lcs (1.5.0)
11
- json (2.6.3)
11
+ json (2.7.1)
12
12
  language_server-protocol (3.17.0.3)
13
- parallel (1.23.0)
14
- parser (3.2.2.4)
13
+ parallel (1.24.0)
14
+ parser (3.3.0.3)
15
15
  ast (~> 2.4.1)
16
16
  racc
17
- racc (1.7.2)
17
+ racc (1.7.3)
18
18
  rainbow (3.1.1)
19
19
  rake (13.1.0)
20
20
  rake-compiler (1.2.5)
21
21
  rake
22
- rb_sys (0.9.82)
23
- regexp_parser (2.8.2)
22
+ rb_sys (0.9.86)
23
+ regexp_parser (2.9.0)
24
24
  rexml (3.2.6)
25
25
  rspec (3.12.0)
26
26
  rspec-core (~> 3.12.0)
@@ -35,7 +35,7 @@ GEM
35
35
  diff-lcs (>= 1.2.0, < 2.0)
36
36
  rspec-support (~> 3.12.0)
37
37
  rspec-support (3.12.1)
38
- rubocop (1.57.2)
38
+ rubocop (1.59.0)
39
39
  json (~> 2.3)
40
40
  language_server-protocol (>= 3.17.0)
41
41
  parallel (~> 1.10)
@@ -43,7 +43,7 @@ GEM
43
43
  rainbow (>= 2.2.2, < 4.0)
44
44
  regexp_parser (>= 1.8, < 3.0)
45
45
  rexml (>= 3.2.5, < 4.0)
46
- rubocop-ast (>= 1.28.1, < 2.0)
46
+ rubocop-ast (>= 1.30.0, < 2.0)
47
47
  ruby-progressbar (~> 1.7)
48
48
  unicode-display_width (>= 2.4.0, < 3.0)
49
49
  rubocop-ast (1.30.0)
@@ -60,7 +60,7 @@ DEPENDENCIES
60
60
  rake-compiler
61
61
  rb_sys
62
62
  rspec (~> 3.0)
63
- rubocop (~> 1.57)
63
+ rubocop (~> 1.59)
64
64
  vault_coh!
65
65
 
66
66
  BUNDLED WITH
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.2.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/v4.0.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.2.0).
27
+ All information available from parsing can be found in the [documentation](https://rubydoc.info/github/ryantaylor/vault-rb/v4.0.0).
28
28
 
29
29
  ## Contributing
30
30
 
@@ -12,4 +12,4 @@ crate-type = ["cdylib"]
12
12
  [dependencies]
13
13
  magnus = { version = "0.6" }
14
14
  serde_magnus = { version = "0.8" }
15
- vault = { version = "5", features = ["magnus", "serde"] }
15
+ vault = { version = "7", features = ["magnus", "serde"] }
@@ -1,6 +1,7 @@
1
1
  use magnus::Value;
2
2
  use vault::commands::{
3
- BuildSquad, SelectBattlegroup, SelectBattlegroupAbility, Unknown, UseBattlegroupAbility,
3
+ BuildGlobalUpgrade, BuildSquad, SelectBattlegroup, SelectBattlegroupAbility, Unknown,
4
+ UseBattlegroupAbility,
4
5
  };
5
6
  use vault::{Command, Map, Message, Player, Replay};
6
7
 
@@ -38,6 +39,12 @@ impl HashExt for Command {
38
39
  }
39
40
  }
40
41
 
42
+ impl HashExt for BuildGlobalUpgrade {
43
+ fn to_h(&self) -> Value {
44
+ serde_magnus::serialize(self).unwrap()
45
+ }
46
+ }
47
+
41
48
  impl HashExt for BuildSquad {
42
49
  fn to_h(&self) -> Value {
43
50
  serde_magnus::serialize(self).unwrap()
@@ -3,7 +3,8 @@ mod hash;
3
3
  use crate::hash::HashExt;
4
4
  use magnus::{class, define_module, exception, function, method, prelude::*, Error};
5
5
  use vault::commands::{
6
- BuildSquad, SelectBattlegroup, SelectBattlegroupAbility, Unknown, UseBattlegroupAbility,
6
+ BuildGlobalUpgrade, BuildSquad, SelectBattlegroup, SelectBattlegroupAbility, Unknown,
7
+ UseBattlegroupAbility,
7
8
  };
8
9
  use vault::{Command, Faction, Map, Message, Player, Replay, Team};
9
10
 
@@ -41,6 +42,7 @@ fn init() -> Result<(), Error> {
41
42
 
42
43
  let player = module.define_class("Player", class::object())?;
43
44
  player.define_method("name", method!(Player::name, 0))?;
45
+ player.define_method("human?", method!(Player::human, 0))?;
44
46
  player.define_method("faction", method!(Player::faction, 0))?;
45
47
  player.define_method("team", method!(Player::team, 0))?;
46
48
  player.define_method("battlegroup", method!(Player::battlegroup, 0))?;
@@ -71,6 +73,17 @@ fn init() -> Result<(), Error> {
71
73
 
72
74
  let commands_module = module.define_module("Commands")?;
73
75
 
76
+ let build_global_upgrade_command =
77
+ commands_module.define_class("BuildGlobalUpgradeCommand", command)?;
78
+ build_global_upgrade_command
79
+ .define_method("value", method!(Command::extract_build_global_upgrade, 0))?;
80
+
81
+ let build_global_upgrade =
82
+ commands_module.define_class("BuildGlobalUpgrade", class::object())?;
83
+ build_global_upgrade.define_method("tick", method!(BuildGlobalUpgrade::tick, 0))?;
84
+ build_global_upgrade.define_method("pbgid", method!(BuildGlobalUpgrade::pbgid, 0))?;
85
+ build_global_upgrade.define_method("to_h", method!(BuildGlobalUpgrade::to_h, 0))?;
86
+
74
87
  let build_squad_command = commands_module.define_class("BuildSquadCommand", command)?;
75
88
  build_squad_command.define_method("value", method!(Command::extract_build_squad, 0))?;
76
89
 
@@ -6,7 +6,8 @@ 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 |
9
+ # @return [Commands::BuildGlobalUpgrade |
10
+ # Commands::BuildSquad |
10
11
  # Commands::SelectBattlegroup |
11
12
  # Commands::SelectBattlegroupAbility |
12
13
  # Commands::UseBattlegroupAbility |
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module VaultCoh
4
+ module Commands
5
+ # Data object representing information parsed from an
6
+ # upgrade construction command.
7
+ class BuildGlobalUpgrade
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 upgrade being
20
+ # built. This value can be matched to CoH3 attribute
21
+ # files in order to determine the upgrade being built.
22
+ # Note that, while rare, it is possible that this value
23
+ # may change between patches for the same upgrade.
24
+ #
25
+ # @return [Integer] unsigned, 32 bits
26
+ def pbgid; end
27
+
28
+ # Returns a hash representation of the object.
29
+ #
30
+ # @return [Hash]
31
+ def to_h; end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module VaultCoh
4
+ module Commands
5
+ # Wrapper for an upgrade construction command.
6
+ class BuildGlobalUpgradeCommand < Command
7
+ end
8
+ end
9
+ end
@@ -13,6 +13,11 @@ module VaultCoh
13
13
  # @return [String]
14
14
  def name; end
15
15
 
16
+ # Whether or not the player was a human or an AI/CPU player.
17
+ #
18
+ # @return [Boolean]
19
+ def human?; end
20
+
16
21
  # The faction selected by the player in this match.
17
22
  #
18
23
  # @return [Faction]
@@ -31,19 +36,19 @@ module VaultCoh
31
36
  # @return [Integer|NilClass]
32
37
  def battlegroup; end
33
38
 
34
- # The Steam ID of the player. This ID can be used to uniquely
35
- # identify a player between replays, and connect them to their
36
- # Steam profile.
39
+ # The Steam ID of the player, or +nil+ if the player is AI. This ID
40
+ # can be used to uniquely identify a player between replays, and
41
+ # connect them to their Steam profile.
37
42
  #
38
- # @return [Integer] unsigned, 64 bits
43
+ # @return [Integer|NilClass] unsigned, 64 bits
39
44
  def steam_id; end
40
45
 
41
- # The Relic profile ID of the player. This ID can be used to
42
- # uniquely identify a player between replays, and can be used to
43
- # query statistical information about the player from Relic’s
44
- # stats API.
46
+ # The Relic profile ID of the player, or +nil+ if the player is AI.
47
+ # This ID can be used to uniquely identify a player between replays,
48
+ # and can be used to query statistical information about the player
49
+ # from Relic’s stats API.
45
50
  #
46
- # @return [Integer] unsigned, 64 bits
51
+ # @return [Integer|NilClass] unsigned, 64 bits
47
52
  def profile_id; end
48
53
 
49
54
  # A list of all messages sent by the player in the match. Sorted
@@ -60,9 +65,9 @@ module VaultCoh
60
65
 
61
66
  # A list of only build-related commands executed by the player in
62
67
  # the match. A build command is any that enqueues the construction
63
- # of a new unit. Sorted chronologically from first to last.
68
+ # of a new unit or upgrade. Sorted chronologically from first to last.
64
69
  #
65
- # @return [Array<Commands::BuildSquad>]
70
+ # @return [Array<Command>]
66
71
  def build_commands; end
67
72
 
68
73
  # A list of only battlegroup-related commands executed by the player
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VaultCoh
4
- VERSION = '2.2.0'
4
+ VERSION = '4.0.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.2.0
4
+ version: 4.0.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-06 00:00:00.000000000 Z
11
+ date: 2024-01-21 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.
@@ -21,6 +21,7 @@ extra_rdoc_files: []
21
21
  files:
22
22
  - ".rspec"
23
23
  - ".rubocop.yml"
24
+ - ".ruby-version"
24
25
  - CHANGELOG.md
25
26
  - Cargo.lock
26
27
  - Cargo.toml
@@ -36,6 +37,8 @@ files:
36
37
  - lib/vault_coh.rb
37
38
  - lib/vault_coh/command.rb
38
39
  - lib/vault_coh/commands.rb
40
+ - lib/vault_coh/commands/build_global_upgrade.rb
41
+ - lib/vault_coh/commands/build_global_upgrade_command.rb
39
42
  - lib/vault_coh/commands/build_squad.rb
40
43
  - lib/vault_coh/commands/build_squad_command.rb
41
44
  - lib/vault_coh/commands/select_battlegroup.rb