openra 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db310f9109e5d72e9c954d66f1c6e55a221f069b
4
- data.tar.gz: cfdd3cf6888eac67e326752e0124db49bdf72551
3
+ metadata.gz: 3b2745c6650b2d19d7d86501604c5a9d21be2f49
4
+ data.tar.gz: 8cba338497c93da033f472dd0bcb9bfbfd6e2765
5
5
  SHA512:
6
- metadata.gz: b0eced85bf47e6c285ab0ee65c3353b505c9666b425e6297aaa905c47eea4b6ce7ee545740f67c665807c28d49bb6950537de5187183fecf11b8673480d66258
7
- data.tar.gz: 8006b46f38bc4be193bbb7bd182d67040dd2b9af7e73f780ad720458806a4b1f26ec9c720b01f30df1e0ec2bee100caa487f9baa4401d6f6da604a6d6ec9605e
6
+ metadata.gz: 7723efc3646a9bca3fe9c473b78def3c1e7fcbac8dac2a7a9653c5e72ecea44a6041e356e0fbbd834bcef87b521d74fc33e590fc453bcbc2d82e0ff168671253
7
+ data.tar.gz: 76ef7c3987df77ef67b84a777af3919aa2b17bbbfe6b61247ba565fc510f249f27132f33bf50ef3bfebf1a6120a2f4171e6d48f135c6b328bb2b861d29a09fb1
data/CHANGELOG.md CHANGED
@@ -1,6 +1,17 @@
1
1
  ## Unreleased
2
2
 
3
- [Compare v0.5.0...HEAD](https://github.com/AMHOL/openra-ruby/compare/v0.5.0...HEAD)
3
+ ## Added
4
+
5
+ * [replay-data] Show chosen and actual faction ([AMHOL](https://github.com/AMHOL))
6
+ * [replay-data] Add spawn point info
7
+
8
+ ## Fixed
9
+
10
+ * [replay-data] Fetch team from replay metadata players hash ([AMHOL](https://github.com/AMHOL))
11
+
12
+ [Compare v0.1.0...HEAD](https://github.com/AMHOL/openra-ruby/compare/v0.1.0...HEAD)
13
+
14
+ ## v0.1.0
4
15
 
5
16
  ## Added
6
17
 
@@ -10,3 +21,5 @@
10
21
  ## Fixed
11
22
 
12
23
  * Return `null` for client team in replay data when team is not set ([AMHOL](https://github.com/AMHOL))
24
+
25
+ [Compare v0.0.5...v0.1.0](https://github.com/AMHOL/openra-ruby/compare/v0.0.5...v0.1.0)
@@ -69,18 +69,27 @@ module Openra
69
69
  sync_info.each_pair do |key, data|
70
70
  case key
71
71
  when /^Client@/
72
+ player = player_mapping.fetch(data['Index'], {})
73
+
72
74
  replay_data[:clients] << {
73
75
  index: data['Index'],
74
76
  name: utf8(data['Name']),
75
77
  preferred_color: data['PreferredColor'],
76
78
  color: data['Color'],
77
- faction: data['Faction'],
79
+ spawn: {
80
+ random: player.fetch('IsRandomSpawnPoint', 'False') == 'True',
81
+ point: player.fetch('SpawnPoint', nil)
82
+ },
83
+ faction: {
84
+ chosen: data['Faction'].downcase,
85
+ actual: player_mapping.fetch(data['Index'], {}).fetch('FactionId', nil)
86
+ },
78
87
  ip: data['IpAddress'],
79
- team: data['Team'].to_s == '0' ? nil : data['Team'],
88
+ team: player.fetch('Team', '0').to_s == '0' ? nil : data['Team'],
80
89
  is_bot: data['Bot'].nil? ? false : true,
81
90
  is_admin: data['IsAdmin'] == 'True',
82
- is_player: player_mapping.fetch(data['Index'], false) != false,
83
- is_winner: player_mapping.fetch(data['Index'], {}).fetch('Outcome', nil) == 'Won',
91
+ is_player: !player.empty?,
92
+ is_winner: player.fetch('Outcome', nil) == 'Won',
84
93
  build: []
85
94
  } unless replay_data[:clients].any? { |client| client[:index] == data['Index'] }
86
95
  when 'GlobalSettings'
@@ -1,3 +1,3 @@
1
1
  module Openra
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Holland