openra 1.0.1 → 1.1.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 +10 -1
- data/lib/openra/cli.rb +1 -0
- data/lib/openra/cli/commands/replay_data.rb +11 -1
- data/lib/openra/replays/replay.rb +6 -15
- data/lib/openra/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab7a16c3f01e989e67ae2aa310703ffff750855b
|
4
|
+
data.tar.gz: 1b0a85ea770c2d1a9f3e2914f900da66949eb50d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b5e36e2e31a514e081dc0f2d990f201d7db44de8d0c34eb6f47e13eff28d7a3753b0762580fe55d99483f1acd3904a4e5c68f84e7f939f07d91b56523530715
|
7
|
+
data.tar.gz: 9bab1534a3739e98b9b0182f98ca147890ef17646ba8b5523be0c9d219275f1d727a72ca461f1c43a4e09a52c9f45824824c8ac2c44c6c1a3938ecdc726345b6
|
data/CHANGELOG.md
CHANGED
@@ -2,10 +2,19 @@
|
|
2
2
|
|
3
3
|
## Fixed
|
4
4
|
|
5
|
+
* [replay-data] Make chat messages show name at time of message ([AMHOL](https://github.com/AMHOL))
|
6
|
+
* [replay-data] Only include clients present at game start ([AMHOL](https://github.com/AMHOL))
|
7
|
+
|
8
|
+
[Compare v1.0.1...HEAD](https://github.com/AMHOL/openra-ruby/compare/v1.0.1...HEAD)
|
9
|
+
|
10
|
+
## v1.0.1
|
11
|
+
|
12
|
+
## Fixed
|
13
|
+
|
5
14
|
* [core] Add bundler as a runtime dependency (thanks to by dragunoff) ([AMHOL](https://github.com/AMHOL))
|
6
15
|
* [replay-data] Fixed the game "type" field (by updating it to use players rather than clients array) ([AMHOL](https://github.com/AMHOL))
|
7
16
|
|
8
|
-
[Compare v1.0.0...
|
17
|
+
[Compare v1.0.0...v1.0.1](https://github.com/AMHOL/openra-ruby/compare/v1.0.0...v1.0.1)
|
9
18
|
|
10
19
|
## v1.0.0
|
11
20
|
|
data/lib/openra/cli.rb
CHANGED
@@ -79,10 +79,20 @@ module Openra
|
|
79
79
|
chat: []
|
80
80
|
}
|
81
81
|
|
82
|
+
current_sync_info = OpenStruct.new(
|
83
|
+
clients: []
|
84
|
+
)
|
85
|
+
|
82
86
|
replay.orders.each do |order|
|
83
|
-
client =
|
87
|
+
client = current_sync_info.clients.find do |candidate|
|
88
|
+
candidate.index == order.client_index.to_s
|
89
|
+
end
|
84
90
|
|
85
91
|
case order.command
|
92
|
+
when 'SyncInfo'
|
93
|
+
current_sync_info = Openra::Struct::SyncInfo.new(
|
94
|
+
Openra::YAML.load(order.target)
|
95
|
+
)
|
86
96
|
when 'PlaceBuilding'
|
87
97
|
client_hash = replay_data[:clients].find do |candidate|
|
88
98
|
candidate[:index] == order.client_index.to_s
|
@@ -54,22 +54,13 @@ module Openra
|
|
54
54
|
def sync_info
|
55
55
|
return @sync_info if @sync_info
|
56
56
|
|
57
|
-
|
58
|
-
|
57
|
+
start_game_order = orders.find { |order| order[:command] == 'StartGame' }
|
58
|
+
start_game_index = orders.index(start_game_order)
|
59
|
+
start_game_sync_order = orders[start_game_index.pred]
|
59
60
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
end
|
64
|
-
|
65
|
-
@sync_info = syncs.inject(syncs.shift) do |next_sync, sync|
|
66
|
-
next_sync.clients.each do |client|
|
67
|
-
next if sync.clients.map(&:index).include?(client.index)
|
68
|
-
sync.clients << client
|
69
|
-
end
|
70
|
-
|
71
|
-
sync
|
72
|
-
end
|
61
|
+
@sync_info = Openra::Struct::SyncInfo.new(
|
62
|
+
Openra::YAML.load(start_game_sync_order.target)
|
63
|
+
)
|
73
64
|
end
|
74
65
|
end
|
75
66
|
end
|
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: 1.0
|
4
|
+
version: 1.1.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: 2018-07-
|
11
|
+
date: 2018-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|