vault_coh 6.0.0 → 6.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/ext/vault_coh/src/hash.rs +41 -22
- data/lib/vault_coh/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82ae68759203e352288395c3a0f4bda330ae0d7980fa89d2bd3ba19cbf716eb4
|
4
|
+
data.tar.gz: 89a5360499f6a6c2ab99ad11cc01a00793c6bfcb11862f45e2a68a6272f97ced
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4029518b8dd474f22e8dd95bfd40bb7f89680922ca8c4e784d04536fea79ab9b3cb7ca4a3209852ae792e676d21dce2cdf06ea973b27a3c71b5b0e718e6400a1
|
7
|
+
data.tar.gz: 27c73513cf4264ff967f4708403b6793ba27b5635ef0fefbbe6396ddae0deca52999fd78a8a207b80cc4953274e112de8f9b5b2494c712848a759fe224d637d6
|
data/Gemfile.lock
CHANGED
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/v6.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/v6.0.1)
|
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/v6.0.
|
27
|
+
All information available from parsing can be found in the [documentation](https://rubydoc.info/github/ryantaylor/vault-rb/v6.0.1).
|
28
28
|
|
29
29
|
## Contributing
|
30
30
|
|
data/ext/vault_coh/src/hash.rs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
use magnus::{value::ReprValue, RHash, RString, Value};
|
1
|
+
use magnus::{value::ReprValue, RHash, RString, Symbol, Value};
|
2
2
|
use vault::{Command, Map, Message, Player, Replay};
|
3
3
|
|
4
4
|
pub trait HashExt {
|
@@ -34,67 +34,86 @@ impl HashExt for Command {
|
|
34
34
|
match self {
|
35
35
|
Command::BuildGlobalUpgrade(data) => {
|
36
36
|
let hash: RHash = serde_magnus::serialize(data).unwrap();
|
37
|
-
hash.aset("type", RString::new("BuildGlobalUpgrade"))
|
37
|
+
hash.aset(Symbol::new("type"), RString::new("BuildGlobalUpgrade"))
|
38
38
|
.unwrap();
|
39
|
-
hash.aset("action_type", RString::new("CMD_Upgrade"))
|
39
|
+
hash.aset(Symbol::new("action_type"), RString::new("CMD_Upgrade"))
|
40
40
|
.unwrap();
|
41
41
|
hash.as_value()
|
42
42
|
}
|
43
43
|
Command::BuildSquad(data) => {
|
44
44
|
let hash: RHash = serde_magnus::serialize(data).unwrap();
|
45
|
-
hash.aset("type", RString::new("BuildSquad"))
|
46
|
-
|
45
|
+
hash.aset(Symbol::new("type"), RString::new("BuildSquad"))
|
46
|
+
.unwrap();
|
47
|
+
hash.aset(Symbol::new("action_type"), RString::new("CMD_BuildSquad"))
|
47
48
|
.unwrap();
|
48
49
|
hash.as_value()
|
49
50
|
}
|
50
51
|
Command::CancelConstruction(data) => {
|
51
52
|
let hash: RHash = serde_magnus::serialize(data).unwrap();
|
52
|
-
hash.aset("type", RString::new("CancelConstruction"))
|
53
|
-
.unwrap();
|
54
|
-
hash.aset("action_type", RString::new("CMD_CancelConstruction"))
|
53
|
+
hash.aset(Symbol::new("type"), RString::new("CancelConstruction"))
|
55
54
|
.unwrap();
|
55
|
+
hash.aset(
|
56
|
+
Symbol::new("action_type"),
|
57
|
+
RString::new("CMD_CancelConstruction"),
|
58
|
+
)
|
59
|
+
.unwrap();
|
56
60
|
hash.as_value()
|
57
61
|
}
|
58
62
|
Command::CancelProduction(data) => {
|
59
63
|
let hash: RHash = serde_magnus::serialize(data).unwrap();
|
60
|
-
hash.aset("type", RString::new("CancelProduction"))
|
61
|
-
hash.aset("action_type", RString::new("CMD_CancelProduction"))
|
64
|
+
hash.aset(Symbol::new("type"), RString::new("CancelProduction"))
|
62
65
|
.unwrap();
|
66
|
+
hash.aset(
|
67
|
+
Symbol::new("action_type"),
|
68
|
+
RString::new("CMD_CancelProduction"),
|
69
|
+
)
|
70
|
+
.unwrap();
|
63
71
|
hash.as_value()
|
64
72
|
}
|
65
73
|
Command::SelectBattlegroup(data) => {
|
66
74
|
let hash: RHash = serde_magnus::serialize(data).unwrap();
|
67
|
-
hash.aset("type", RString::new("SelectBattlegroup"))
|
68
|
-
.unwrap();
|
69
|
-
hash.aset("action_type", RString::new("PCMD_InstantUpgrade"))
|
75
|
+
hash.aset(Symbol::new("type"), RString::new("SelectBattlegroup"))
|
70
76
|
.unwrap();
|
77
|
+
hash.aset(
|
78
|
+
Symbol::new("action_type"),
|
79
|
+
RString::new("PCMD_InstantUpgrade"),
|
80
|
+
)
|
81
|
+
.unwrap();
|
71
82
|
hash.as_value()
|
72
83
|
}
|
73
84
|
Command::SelectBattlegroupAbility(data) => {
|
74
85
|
let hash: RHash = serde_magnus::serialize(data).unwrap();
|
75
|
-
hash.aset(
|
76
|
-
|
77
|
-
|
78
|
-
|
86
|
+
hash.aset(
|
87
|
+
Symbol::new("type"),
|
88
|
+
RString::new("SelectBattlegroupAbility"),
|
89
|
+
)
|
90
|
+
.unwrap();
|
91
|
+
hash.aset(
|
92
|
+
Symbol::new("action_type"),
|
93
|
+
RString::new("PCMD_TentativeUpgrade"),
|
94
|
+
)
|
95
|
+
.unwrap();
|
79
96
|
hash.as_value()
|
80
97
|
}
|
81
98
|
Command::Unknown(data) => {
|
82
99
|
let hash: RHash = serde_magnus::serialize(data).unwrap();
|
83
|
-
hash.aset("type", RString::new("Unknown"))
|
100
|
+
hash.aset(Symbol::new("type"), RString::new("Unknown"))
|
101
|
+
.unwrap();
|
84
102
|
hash.as_value()
|
85
103
|
}
|
86
104
|
Command::UseAbility(data) => {
|
87
105
|
let hash: RHash = serde_magnus::serialize(data).unwrap();
|
88
|
-
hash.aset("type", RString::new("UseAbility"))
|
89
|
-
|
106
|
+
hash.aset(Symbol::new("type"), RString::new("UseAbility"))
|
107
|
+
.unwrap();
|
108
|
+
hash.aset(Symbol::new("action_type"), RString::new("CMD_Ability"))
|
90
109
|
.unwrap();
|
91
110
|
hash.as_value()
|
92
111
|
}
|
93
112
|
Command::UseBattlegroupAbility(data) => {
|
94
113
|
let hash: RHash = serde_magnus::serialize(data).unwrap();
|
95
|
-
hash.aset("type", RString::new("UseBattlegroupAbility"))
|
114
|
+
hash.aset(Symbol::new("type"), RString::new("UseBattlegroupAbility"))
|
96
115
|
.unwrap();
|
97
|
-
hash.aset("action_type", RString::new("PCMD_Ability"))
|
116
|
+
hash.aset(Symbol::new("action_type"), RString::new("PCMD_Ability"))
|
98
117
|
.unwrap();
|
99
118
|
hash.as_value()
|
100
119
|
}
|
data/lib/vault_coh/version.rb
CHANGED