openra 3.0.1 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -1
- data/lib/openra-commands.rb +2 -0
- data/lib/openra/cli/commands/replay_metadata.rb +0 -2
- data/lib/openra/commands/replays/extract_data.rb +3 -0
- data/lib/openra/commands/replays/extract_metadata.rb +3 -0
- data/lib/openra/replays.rb +1 -0
- data/lib/openra/replays/file.rb +4 -0
- data/lib/openra/replays/order.rb +16 -9
- data/lib/openra/replays/replay.rb +4 -0
- data/lib/openra/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffa865d3e9489b00e005822cb07c6d586bdeab1f16475a81a0fc752920e46192
|
4
|
+
data.tar.gz: cc8166eeb9d81ba373bd8e570e5ddb82122a2657044321e853683a32de4f7946
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70b0c4a280854133fb7cbb4ea961075393966a781ec1310bb1e33f6cf7198e29c0655a167cdb24731eea1055111e43a0d01210e3db89b1f69ea062873381390a
|
7
|
+
data.tar.gz: be5f4bbbb31afa430c8a78d6987ed7441dcc27107add02583bf66ce7322b1bb2891dd8ae3f5c29afa5d60ab0a1bd1ece4f62f03b26bec6722443d9b03513351d
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
## Unreleased
|
2
2
|
|
3
|
-
[Compare
|
3
|
+
[Compare v4.0.0...HEAD](https://github.com/AMHOL/openra-ruby/compare/v3.0.0...HEAD)
|
4
|
+
|
5
|
+
## v4.0.0
|
6
|
+
|
7
|
+
* [maint] Support playtest-20201213 - drops support for all older clients
|
8
|
+
* [core] Generate file hash in replay-data and replay-metadata commands
|
9
|
+
|
10
|
+
[Compare v3.0.1...v4.0.0](https://github.com/AMHOL/openra-ruby/compare/v3.0.1...v4.0.0)
|
4
11
|
|
5
12
|
## v3.0.1
|
6
13
|
|
data/lib/openra-commands.rb
CHANGED
data/lib/openra/replays.rb
CHANGED
data/lib/openra/replays/file.rb
CHANGED
@@ -24,6 +24,10 @@ module Openra
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
+
def generate_hash
|
28
|
+
Digest::SHA256.hexdigest(file.read)
|
29
|
+
end
|
30
|
+
|
27
31
|
def metadata
|
28
32
|
# https://github.com/OpenRA/OpenRA/blob/23b3c237b7071fd308c4664b0b6c5d719c0f3c74/OpenRA.Game/FileFormats/ReplayMetadata.cs#L96
|
29
33
|
@metadata ||= begin
|
data/lib/openra/replays/order.rb
CHANGED
@@ -6,19 +6,22 @@ module Openra
|
|
6
6
|
class Order < BinData::Record
|
7
7
|
HEX_FE = ?\xFE.dup.force_encoding('ASCII-8BIT').freeze
|
8
8
|
HEX_FF = ?\xFF.dup.force_encoding('ASCII-8BIT').freeze
|
9
|
-
|
9
|
+
|
10
10
|
IS_STANDARD_ORDER = -> { order_type == HEX_FF }
|
11
11
|
IS_IMMEDIATE_ORDER = -> { order_type == HEX_FE }
|
12
|
-
HAS_TARGET = -> { instance_exec(&IS_STANDARD_ORDER) && (flags &
|
12
|
+
HAS_TARGET = -> { instance_exec(&IS_STANDARD_ORDER) && (flags & 0x01) == 0x01 }
|
13
|
+
HAS_EXTRA_ACTORS = -> { instance_exec(&IS_STANDARD_ORDER) && (flags & 0x02) == 0x02 }
|
13
14
|
TARGET_IS_ACTOR = -> { instance_exec(&HAS_TARGET) && target_type == 1 }
|
14
15
|
TARGET_IS_TERRAIN = -> { instance_exec(&HAS_TARGET) && target_type == 2 }
|
15
16
|
TARGET_IS_FROZEN_ACTOR = -> { instance_exec(&HAS_TARGET) && target_type == 3 }
|
16
|
-
TARGET_IS_CELL = -> { instance_exec(&TARGET_IS_TERRAIN) && (flags &
|
17
|
-
TARGET_NOT_CELL = -> { instance_exec(&TARGET_IS_TERRAIN) && (flags &
|
18
|
-
HAS_SUBJECT = -> { instance_exec(&IS_STANDARD_ORDER) && (flags &
|
19
|
-
HAS_TARGET_STRING = -> { instance_exec(&IS_STANDARD_ORDER) && (flags &
|
20
|
-
HAS_EXTRA_LOCATION = -> { instance_exec(&IS_STANDARD_ORDER) && (flags &
|
21
|
-
HAS_EXTRA_DATA = -> { instance_exec(&IS_STANDARD_ORDER) && (flags &
|
17
|
+
TARGET_IS_CELL = -> { instance_exec(&TARGET_IS_TERRAIN) && (flags & 0x40) == 0x40 }
|
18
|
+
TARGET_NOT_CELL = -> { instance_exec(&TARGET_IS_TERRAIN) && (flags & 0x40) != 0x40 }
|
19
|
+
HAS_SUBJECT = -> { instance_exec(&IS_STANDARD_ORDER) && (flags & 0x80) == 0x80 }
|
20
|
+
HAS_TARGET_STRING = -> { instance_exec(&IS_STANDARD_ORDER) && (flags & 0x04) == 0x04 }
|
21
|
+
HAS_EXTRA_LOCATION = -> { instance_exec(&IS_STANDARD_ORDER) && (flags & 0x10) == 0x10 }
|
22
|
+
HAS_EXTRA_DATA = -> { instance_exec(&IS_STANDARD_ORDER) && (flags & 0x20) == 0x20 }
|
23
|
+
# IS_QUEUED = -> { instance_exec(&IS_STANDARD_ORDER) && (flags & 0x08) == 0x08 }
|
24
|
+
IS_GROUPED = -> { instance_exec(&IS_STANDARD_ORDER) && (flags & 0x100) == 0x100 }
|
22
25
|
|
23
26
|
endian :little
|
24
27
|
# Common
|
@@ -27,7 +30,7 @@ module Openra
|
|
27
30
|
# Immediate Order Data
|
28
31
|
pascal_string :immediate_order_target, onlyif: IS_IMMEDIATE_ORDER
|
29
32
|
# Standard Order Data
|
30
|
-
|
33
|
+
int16 :flags, onlyif: IS_STANDARD_ORDER
|
31
34
|
uint32 :subject_id, onlyif: HAS_SUBJECT
|
32
35
|
uint8 :target_type, onlyif: HAS_TARGET
|
33
36
|
uint32 :actor_id, onlyif: TARGET_IS_ACTOR
|
@@ -39,8 +42,12 @@ module Openra
|
|
39
42
|
int32 :pos_y, onlyif: TARGET_NOT_CELL
|
40
43
|
int32 :pos_z, onlyif: TARGET_NOT_CELL
|
41
44
|
pascal_string :standard_order_target, onlyif: HAS_TARGET_STRING
|
45
|
+
int32 :extra_actors_count, onlyif: HAS_EXTRA_ACTORS
|
46
|
+
array :extra_actor_ids, type: :uint32, initial_length: :extra_actors_count, onlyif: HAS_EXTRA_ACTORS
|
42
47
|
int32 :extra_cell, onlyif: HAS_EXTRA_LOCATION
|
43
48
|
uint32 :extra_data, onlyif: HAS_EXTRA_DATA
|
49
|
+
int32 :grouped_actors_count, onlyif: IS_GROUPED
|
50
|
+
array :grouped_actor_ids, type: :uint32, initial_length: :grouped_actors_count, onlyif: IS_GROUPED
|
44
51
|
|
45
52
|
def target
|
46
53
|
standard? ? standard_order_target : immediate_order_target
|
data/lib/openra/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Holland
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|