vault_coh 4.0.0 → 5.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Cargo.lock +14 -4
- data/Gemfile +2 -2
- data/Gemfile.lock +21 -20
- data/README.md +2 -2
- data/ext/vault_coh/Cargo.toml +1 -1
- data/ext/vault_coh/src/lib.rs +21 -9
- data/lib/vault_coh/faction.rb +4 -11
- data/lib/vault_coh/game_type.rb +11 -0
- data/lib/vault_coh/player.rb +2 -2
- data/lib/vault_coh/replay.rb +22 -2
- data/lib/vault_coh/team.rb +0 -7
- data/lib/vault_coh/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8de9656a5804c04b679fbfbfd747e3f14cc8e31c10922d6b6f8cb4443c6f2feb
|
4
|
+
data.tar.gz: '078bb2c422a328b69f5f47b7bbce3f1c129735b95468bfc6554d5ca04e41c095'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df873abe5efaaf394b5af18699485aea38e0c02453dc2fe683bffb16c1eddd9d9f2962bf45b05a65acda21c0df55eb43ed10c13cf3873aeaa4024ff9e5632d70
|
7
|
+
data.tar.gz: 0b988bf720eeb3cdc508cac31fd27e138c6a20097a2960fe6b82b35e757d0c944e5c77f2f030e0fe992a3925aef30bf244553597dfa0db613954b74909fbb85c
|
data/Cargo.lock
CHANGED
@@ -322,9 +322,9 @@ checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde"
|
|
322
322
|
|
323
323
|
[[package]]
|
324
324
|
name = "shlex"
|
325
|
-
version = "1.
|
325
|
+
version = "1.3.0"
|
326
326
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
327
|
-
checksum = "
|
327
|
+
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
328
328
|
|
329
329
|
[[package]]
|
330
330
|
name = "syn"
|
@@ -360,11 +360,20 @@ version = "1.0.12"
|
|
360
360
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
361
361
|
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
362
362
|
|
363
|
+
[[package]]
|
364
|
+
name = "uuid"
|
365
|
+
version = "1.7.0"
|
366
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
367
|
+
checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a"
|
368
|
+
dependencies = [
|
369
|
+
"serde",
|
370
|
+
]
|
371
|
+
|
363
372
|
[[package]]
|
364
373
|
name = "vault"
|
365
|
-
version = "
|
374
|
+
version = "8.0.1"
|
366
375
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
367
|
-
checksum = "
|
376
|
+
checksum = "a5a50439bc89d725b8d00da69ee3cdb7a18dc7b940e5f53417e131ccce7e450b"
|
368
377
|
dependencies = [
|
369
378
|
"byteorder",
|
370
379
|
"magnus",
|
@@ -372,6 +381,7 @@ dependencies = [
|
|
372
381
|
"nom-tracable",
|
373
382
|
"nom_locate",
|
374
383
|
"serde",
|
384
|
+
"uuid",
|
375
385
|
]
|
376
386
|
|
377
387
|
[[package]]
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,45 +1,45 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
vault_coh (
|
4
|
+
vault_coh (5.0.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
9
|
ast (2.4.2)
|
10
|
-
diff-lcs (1.5.
|
10
|
+
diff-lcs (1.5.1)
|
11
11
|
json (2.7.1)
|
12
12
|
language_server-protocol (3.17.0.3)
|
13
13
|
parallel (1.24.0)
|
14
|
-
parser (3.3.0.
|
14
|
+
parser (3.3.0.5)
|
15
15
|
ast (~> 2.4.1)
|
16
16
|
racc
|
17
17
|
racc (1.7.3)
|
18
18
|
rainbow (3.1.1)
|
19
19
|
rake (13.1.0)
|
20
|
-
rake-compiler (1.2.
|
20
|
+
rake-compiler (1.2.7)
|
21
21
|
rake
|
22
|
-
rb_sys (0.9.
|
22
|
+
rb_sys (0.9.87)
|
23
23
|
regexp_parser (2.9.0)
|
24
24
|
rexml (3.2.6)
|
25
|
-
rspec (3.
|
26
|
-
rspec-core (~> 3.
|
27
|
-
rspec-expectations (~> 3.
|
28
|
-
rspec-mocks (~> 3.
|
29
|
-
rspec-core (3.
|
30
|
-
rspec-support (~> 3.
|
31
|
-
rspec-expectations (3.
|
25
|
+
rspec (3.13.0)
|
26
|
+
rspec-core (~> 3.13.0)
|
27
|
+
rspec-expectations (~> 3.13.0)
|
28
|
+
rspec-mocks (~> 3.13.0)
|
29
|
+
rspec-core (3.13.0)
|
30
|
+
rspec-support (~> 3.13.0)
|
31
|
+
rspec-expectations (3.13.0)
|
32
32
|
diff-lcs (>= 1.2.0, < 2.0)
|
33
|
-
rspec-support (~> 3.
|
34
|
-
rspec-mocks (3.
|
33
|
+
rspec-support (~> 3.13.0)
|
34
|
+
rspec-mocks (3.13.0)
|
35
35
|
diff-lcs (>= 1.2.0, < 2.0)
|
36
|
-
rspec-support (~> 3.
|
37
|
-
rspec-support (3.
|
38
|
-
rubocop (1.
|
36
|
+
rspec-support (~> 3.13.0)
|
37
|
+
rspec-support (3.13.0)
|
38
|
+
rubocop (1.60.2)
|
39
39
|
json (~> 2.3)
|
40
40
|
language_server-protocol (>= 3.17.0)
|
41
41
|
parallel (~> 1.10)
|
42
|
-
parser (>= 3.
|
42
|
+
parser (>= 3.3.0.2)
|
43
43
|
rainbow (>= 2.2.2, < 4.0)
|
44
44
|
regexp_parser (>= 1.8, < 3.0)
|
45
45
|
rexml (>= 3.2.5, < 4.0)
|
@@ -53,14 +53,15 @@ GEM
|
|
53
53
|
|
54
54
|
PLATFORMS
|
55
55
|
arm64-darwin-21
|
56
|
+
arm64-darwin-23
|
56
57
|
x86_64-linux
|
57
58
|
|
58
59
|
DEPENDENCIES
|
59
60
|
rake (~> 13.0)
|
60
61
|
rake-compiler
|
61
62
|
rb_sys
|
62
|
-
rspec (~> 3.
|
63
|
-
rubocop (~> 1.
|
63
|
+
rspec (~> 3.13)
|
64
|
+
rubocop (~> 1.60)
|
64
65
|
vault_coh!
|
65
66
|
|
66
67
|
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/
|
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/v5.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/
|
27
|
+
All information available from parsing can be found in the [documentation](https://rubydoc.info/github/ryantaylor/vault-rb/v5.0.0).
|
28
28
|
|
29
29
|
## Contributing
|
30
30
|
|
data/ext/vault_coh/Cargo.toml
CHANGED
data/ext/vault_coh/src/lib.rs
CHANGED
@@ -6,7 +6,7 @@ use vault::commands::{
|
|
6
6
|
BuildGlobalUpgrade, BuildSquad, SelectBattlegroup, SelectBattlegroupAbility, Unknown,
|
7
7
|
UseBattlegroupAbility,
|
8
8
|
};
|
9
|
-
use vault::{Command,
|
9
|
+
use vault::{Command, Map, Message, Player, Replay};
|
10
10
|
|
11
11
|
#[magnus::init]
|
12
12
|
fn init() -> Result<(), Error> {
|
@@ -16,7 +16,9 @@ fn init() -> Result<(), Error> {
|
|
16
16
|
replay.define_singleton_method("from_bytes", function!(from_bytes, 1))?;
|
17
17
|
replay.define_method("version", method!(Replay::version, 0))?;
|
18
18
|
replay.define_method("timestamp", method!(Replay::timestamp, 0))?;
|
19
|
+
replay.define_method("game_type", method!(game_type_string, 0))?;
|
19
20
|
replay.define_method("matchhistory_id", method!(Replay::matchhistory_id, 0))?;
|
21
|
+
replay.define_method("mod_uuid", method!(mod_uuid_string, 0))?;
|
20
22
|
replay.define_method("map", method!(Replay::map, 0))?;
|
21
23
|
replay.define_method("map_filename", method!(Replay::map_filename, 0))?;
|
22
24
|
replay.define_method(
|
@@ -43,8 +45,8 @@ fn init() -> Result<(), Error> {
|
|
43
45
|
let player = module.define_class("Player", class::object())?;
|
44
46
|
player.define_method("name", method!(Player::name, 0))?;
|
45
47
|
player.define_method("human?", method!(Player::human, 0))?;
|
46
|
-
player.define_method("faction", method!(
|
47
|
-
player.define_method("team", method!(
|
48
|
+
player.define_method("faction", method!(faction_string, 0))?;
|
49
|
+
player.define_method("team", method!(team_value, 0))?;
|
48
50
|
player.define_method("battlegroup", method!(Player::battlegroup, 0))?;
|
49
51
|
player.define_method("steam_id", method!(Player::steam_id, 0))?;
|
50
52
|
player.define_method("profile_id", method!(Player::profile_id, 0))?;
|
@@ -62,12 +64,6 @@ fn init() -> Result<(), Error> {
|
|
62
64
|
message.define_method("message", method!(Message::message, 0))?;
|
63
65
|
message.define_method("to_h", method!(Message::to_h, 0))?;
|
64
66
|
|
65
|
-
let faction = module.define_class("Faction", class::object())?;
|
66
|
-
faction.define_method("value", method!(Faction::to_string, 0))?;
|
67
|
-
|
68
|
-
let team = module.define_class("Team", class::object())?;
|
69
|
-
team.define_method("value", method!(Team::value, 0))?;
|
70
|
-
|
71
67
|
let command = module.define_class("Command", class::object())?;
|
72
68
|
command.define_method("to_h", method!(Command::to_h, 0))?;
|
73
69
|
|
@@ -144,3 +140,19 @@ fn from_bytes(input: Vec<u8>) -> Result<Replay, Error> {
|
|
144
140
|
Replay::from_bytes(&input)
|
145
141
|
.map_err(|err| Error::new(exception::runtime_error(), err.to_string()))
|
146
142
|
}
|
143
|
+
|
144
|
+
fn mod_uuid_string(rb_self: &Replay) -> String {
|
145
|
+
rb_self.mod_uuid().to_string()
|
146
|
+
}
|
147
|
+
|
148
|
+
fn game_type_string(rb_self: &Replay) -> String {
|
149
|
+
rb_self.game_type().to_string()
|
150
|
+
}
|
151
|
+
|
152
|
+
fn faction_string(rb_self: &Player) -> String {
|
153
|
+
rb_self.faction().to_string()
|
154
|
+
}
|
155
|
+
|
156
|
+
fn team_value(rb_self: &Player) -> usize {
|
157
|
+
rb_self.team().value()
|
158
|
+
}
|
data/lib/vault_coh/faction.rb
CHANGED
@@ -3,16 +3,9 @@
|
|
3
3
|
module VaultCoh
|
4
4
|
# Identifiers for the Company of Heroes 3 factions.
|
5
5
|
class Faction
|
6
|
-
AMERICANS = '
|
7
|
-
BRITISH = '
|
8
|
-
WEHRMACHT = '
|
9
|
-
AFRIKAKORPS = '
|
10
|
-
|
11
|
-
# String identifier of the given faction.
|
12
|
-
#
|
13
|
-
# @see https://docs.rs/vault/3.0.0/vault/enum.Faction.html
|
14
|
-
#
|
15
|
-
# @return [AMERICANS|BRITISH|WEHRMACHT|AFRIKAKORPS]
|
16
|
-
def value; end
|
6
|
+
AMERICANS = 'americans'
|
7
|
+
BRITISH = 'british_africa'
|
8
|
+
WEHRMACHT = 'germans'
|
9
|
+
AFRIKAKORPS = 'afrika_korps'
|
17
10
|
end
|
18
11
|
end
|
data/lib/vault_coh/player.rb
CHANGED
@@ -20,13 +20,13 @@ module VaultCoh
|
|
20
20
|
|
21
21
|
# The faction selected by the player in this match.
|
22
22
|
#
|
23
|
-
# @return [Faction]
|
23
|
+
# @return [Faction::AMERICANS|Faction::WEHRMACHT|Faction::BRITISH|Faction::AFRIKAKORPS]
|
24
24
|
def faction; end
|
25
25
|
|
26
26
|
# The team the player was assigned to. Currently only head-to-head
|
27
27
|
# matchups are supported (max two teams).
|
28
28
|
#
|
29
|
-
# @return [Team]
|
29
|
+
# @return [Team::FIRST|Team::SECOND]
|
30
30
|
def team; end
|
31
31
|
|
32
32
|
# The pbgid of the battlegroup the player selected, or +nil+ if no
|
data/lib/vault_coh/replay.rb
CHANGED
@@ -40,14 +40,34 @@ module VaultCoh
|
|
40
40
|
# @return [String]
|
41
41
|
def timestamp; end
|
42
42
|
|
43
|
+
# The type of game this replay represents. Note that this information
|
44
|
+
# is parsed on a best-effort basis and therefore may not always be
|
45
|
+
# correct. Also note that it's currently not known if there's a way to
|
46
|
+
# differentiate between automatch and custom games for replays recorded
|
47
|
+
# before the replay system release in patch 1.4.0. Games played before
|
48
|
+
# that patch will be marked as either +skirmish+ (for local AI games) or
|
49
|
+
# +multiplayer+ (for networked custom or automatch games). Games recorded
|
50
|
+
# on or after patch 1.4.0 will properly differentiate between +custom+
|
51
|
+
# and +automatch+ games.
|
52
|
+
#
|
53
|
+
# @return [GameType::SKIRMISH|GameType::MULTIPLAYER|GameType::AUTOMATCH|GameType::CUSTOM]
|
54
|
+
def game_type; end
|
55
|
+
|
43
56
|
# The ID used by Relic to track this match on their internal servers.
|
44
57
|
# This ID can be matched with an ID of the same name returned by
|
45
58
|
# Relic’s CoH3 stats API, enabling linkage between replay files and
|
46
|
-
# statistical information for a match.
|
59
|
+
# statistical information for a match. When the game type is +skirmish+,
|
60
|
+
# there is no ID assigned by Relic, so this will be +nil+.
|
47
61
|
#
|
48
|
-
# @return [Integer] unsigned, 64 bits
|
62
|
+
# @return [Integer|NilClass] unsigned, 64 bits
|
49
63
|
def matchhistory_id; end
|
50
64
|
|
65
|
+
# The UUID of the base game mod this replay ran on. If no mod was used,
|
66
|
+
# this will be a nil UUID (all zeroes).
|
67
|
+
#
|
68
|
+
# @return [String]
|
69
|
+
def mod_uuid; end
|
70
|
+
|
51
71
|
# Map information for this match.
|
52
72
|
#
|
53
73
|
# @return [Map]
|
data/lib/vault_coh/team.rb
CHANGED
data/lib/vault_coh/version.rb
CHANGED
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:
|
4
|
+
version: 5.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ryantaylor
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-16 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.
|
@@ -50,6 +50,7 @@ files:
|
|
50
50
|
- lib/vault_coh/commands/use_battlegroup_ability.rb
|
51
51
|
- lib/vault_coh/commands/use_battlegroup_ability_command.rb
|
52
52
|
- lib/vault_coh/faction.rb
|
53
|
+
- lib/vault_coh/game_type.rb
|
53
54
|
- lib/vault_coh/map.rb
|
54
55
|
- lib/vault_coh/message.rb
|
55
56
|
- lib/vault_coh/player.rb
|
@@ -81,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
82
|
- !ruby/object:Gem::Version
|
82
83
|
version: 3.3.11
|
83
84
|
requirements: []
|
84
|
-
rubygems_version: 3.4.
|
85
|
+
rubygems_version: 3.4.10
|
85
86
|
signing_key:
|
86
87
|
specification_version: 4
|
87
88
|
summary: CoH3 replay parsing in Ruby with Rust
|