openra 1.1.0 → 1.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: ab7a16c3f01e989e67ae2aa310703ffff750855b
4
- data.tar.gz: 1b0a85ea770c2d1a9f3e2914f900da66949eb50d
3
+ metadata.gz: b4aa503f2dda6d282ec8bac4712589703d0be5ca
4
+ data.tar.gz: 244a1b4a23b706868b9b76e699b3a933bfa6836b
5
5
  SHA512:
6
- metadata.gz: 4b5e36e2e31a514e081dc0f2d990f201d7db44de8d0c34eb6f47e13eff28d7a3753b0762580fe55d99483f1acd3904a4e5c68f84e7f939f07d91b56523530715
7
- data.tar.gz: 9bab1534a3739e98b9b0182f98ca147890ef17646ba8b5523be0c9d219275f1d727a72ca461f1c43a4e09a52c9f45824824c8ac2c44c6c1a3938ecdc726345b6
6
+ metadata.gz: d03fd2b0a66d2f4990de25c0e56b1b5f90028536c86db43410cab828493e4279ef1a38a140fd8c5a9700d787ed9a04f66d8f5d15571954df0de8bc8d67ed2575
7
+ data.tar.gz: d73bc9568db824a77b259377052f423735d2a2fec980e0682c52cb9e9da5f8009a3553aadf71eb0c75b7404bbde1f822d9eb297824099c9aa5dd6a1c4c627e7f
data/CHANGELOG.md CHANGED
@@ -2,10 +2,19 @@
2
2
 
3
3
  ## Fixed
4
4
 
5
+ [replay-data] Use SyncLobbyClients to get chat names ([AMHOL](https://github.com/AMHOL))
6
+ [replay-data] Make client IP optional in client struct (fixes parsing replays with bots) ([AMHOL](https://github.com/AMHOL))
7
+
8
+ [Compare v1.1.0...HEAD](https://github.com/AMHOL/openra-ruby/compare/v1.1.0...HEAD)
9
+
10
+ ## v1.1.0
11
+
12
+ ## Fixed
13
+
5
14
  * [replay-data] Make chat messages show name at time of message ([AMHOL](https://github.com/AMHOL))
6
15
  * [replay-data] Only include clients present at game start ([AMHOL](https://github.com/AMHOL))
7
16
 
8
- [Compare v1.0.1...HEAD](https://github.com/AMHOL/openra-ruby/compare/v1.0.1...HEAD)
17
+ [Compare v1.0.1...v1.1.0](https://github.com/AMHOL/openra-ruby/compare/v1.0.1...v1.1.0)
9
18
 
10
19
  ## v1.0.1
11
20
 
data/lib/openra/cli.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'securerandom'
2
- require 'ostruct'
3
2
  require 'yaml'
4
3
  require 'json'
5
4
  require 'hanami/cli'
@@ -79,20 +79,18 @@ module Openra
79
79
  chat: []
80
80
  }
81
81
 
82
- current_sync_info = OpenStruct.new(
83
- clients: []
84
- )
82
+ current_sync_clients = []
85
83
 
86
84
  replay.orders.each do |order|
87
- client = current_sync_info.clients.find do |candidate|
85
+ client = current_sync_clients.find do |candidate|
88
86
  candidate.index == order.client_index.to_s
89
87
  end
90
88
 
91
89
  case order.command
92
- when 'SyncInfo'
93
- current_sync_info = Openra::Struct::SyncInfo.new(
90
+ when 'SyncLobbyClients'
91
+ current_sync_clients = Openra::Struct::SyncLobbyClients.new(
94
92
  Openra::YAML.load(order.target)
95
- )
93
+ ).clients
96
94
  when 'PlaceBuilding'
97
95
  client_hash = replay_data[:clients].find do |candidate|
98
96
  candidate[:index] == order.client_index.to_s
data/lib/openra/struct.rb CHANGED
@@ -46,4 +46,5 @@ require 'openra/struct/game_options/string_option'
46
46
  require 'openra/struct/game_options'
47
47
  require 'openra/struct/global_settings'
48
48
  require 'openra/struct/sync_info'
49
+ require 'openra/struct/sync_lobby_clients'
49
50
  require 'openra/struct/metadata'
@@ -8,7 +8,7 @@ module Openra
8
8
  attribute :faction_name, Types::Strict::String.meta(from: 'Faction')
9
9
  attribute :spawn_point, Types::Strict::String.meta(from: 'SpawnPoint')
10
10
  attribute :name, Types::Strict::String.meta(from: 'Name')
11
- attribute :ip, Types::Strict::String.meta(from: 'IpAddress')
11
+ attribute :ip, Types::Strict::String.meta(from: 'IpAddress').optional.default(nil)
12
12
  attribute :state, Types::Strict::String.meta(from: 'State')
13
13
  attribute :team, Types::Strict::String.meta(from: 'Team')
14
14
  attribute :slot, Types::Strict::String.meta(from: 'Slot', omittable: true)
@@ -0,0 +1,9 @@
1
+ module Openra
2
+ class Struct < Dry::Struct
3
+ class SyncLobbyClients < Openra::Struct
4
+ define do
5
+ attribute :clients, Types::Strict::Array.of(Client).meta(sequence: 'Client')
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module Openra
2
- VERSION = '1.1.0'.freeze
2
+ VERSION = '1.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: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Holland
@@ -158,6 +158,7 @@ files:
158
158
  - lib/openra/struct/player.rb
159
159
  - lib/openra/struct/pre_processor.rb
160
160
  - lib/openra/struct/sync_info.rb
161
+ - lib/openra/struct/sync_lobby_clients.rb
161
162
  - lib/openra/types.rb
162
163
  - lib/openra/version.rb
163
164
  - lib/openra/yaml.rb