tac_scribe 0.7.3.rc1-java → 0.8.1-java

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
  SHA256:
3
- metadata.gz: c20fab84fb03c699cf5a8d3e481d9544c12f88688035641f9f521a982f71c4c9
4
- data.tar.gz: 703b42b52e855e47cfc87a605adec2a6c3412628534c8c4938f25af462d10f40
3
+ metadata.gz: ee7d7ae0666c33f85103a689496371d5fc6b35dfdcf8ee09a74f338181c9a72f
4
+ data.tar.gz: e8e50c0d1c5eac3c3b9dfe3164d228eee70bbbf28e2c50be12f12863317e7fe1
5
5
  SHA512:
6
- metadata.gz: 620df5e7db0b8179c8b80a543165193a81dde91a1586f295ddc53aefea83b43b0110963f7b8990722da1afc31b62da5391dc4829b1b0c690f7d4e451bfc6e391
7
- data.tar.gz: d6ecbbd19dd8e2b89e339df37723141dfc65f7e9e21f62e2f6895161c4e3f2faa3f76bc136c5d5b03ceb14323eddd61c3439cb740be52a910dad665df72470ae
6
+ metadata.gz: 262cf2094428aa52eb6cc6bb10b96d435378bb1aaab9c89fc4763cb5216f93b4311d2d929211ad588338feb59e2c1ea5a749c42840dd8b5905134689e6358410
7
+ data.tar.gz: a8aa82e01acefc15f97d954037d384e5244e21eb4ce466aa6addf3ee57669812bf02df9f2252a0a41e7443d1ebee7240234bbadc8f8b6952ca724dff9618fc69
data/CHANGELOG.md CHANGED
@@ -6,9 +6,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ### Fixed
10
+ - Airfields retrieved using CinC will skip position localization
11
+
12
+ ## [0.8.0] - 2021-01-09
13
+ ### Changed
14
+ - Remove airfield loading from json files
15
+ - CinC is now mandatory
16
+
17
+ ### Fixed
18
+ - Aerodromes (including oilrigs... ) no longer have special position handling.
19
+ This is in relation to the removal of airfields from json files and requiring
20
+ CinC. Side effect is oilrigs will now be positioned correctly.
21
+
22
+ ## [0.7.6] - 2020-08-13
23
+ ### Changed
24
+ - Fix the default port number
25
+
26
+ ## [0.7.5] - 2020-08-12
27
+ ### Changed
28
+ - Various fixes related to airfield population using CinC
29
+
30
+ ## [0.7.4] - 2020-08-10
31
+ ### Changed
32
+ - Fix typo that was causing all objects to be registered as airbases
33
+
9
34
  ## [0.7.3] - 2020-08-10
10
35
  ### Changed
11
- - Bug fixes after adding CinC support.
36
+ - Bug fixes after adding CinC support
12
37
 
13
38
  ## [0.7.2] - 2020-08-10
14
39
  ### Added
data/exe/tac_scribe CHANGED
@@ -11,7 +11,7 @@ options = {
11
11
  tacview_password: nil,
12
12
  tacview_client_name: 'TacScribe',
13
13
  cinc_enabled: false,
14
- cinc_port: 9000,
14
+ cinc_port: 9001,
15
15
  db_host: 'localhost',
16
16
  db_port: 5432,
17
17
  db_name: 'tac_scribe',
@@ -46,10 +46,6 @@ OptionParser.new do |opts|
46
46
  end
47
47
 
48
48
  opts.separator "\nCommander-In-Chief Options"
49
- opts.on('-b', '--enable-cinc',
50
- 'Is Cinc enabled? (Default: false)') do |_v|
51
- options[:cinc_enabled] = true
52
- end
53
49
  opts.on('-m', '--cinc-port=port',
54
50
  'Cinc server port (Default: 9001)') do |v|
55
51
  options[:cinc_port] = v
@@ -78,10 +74,6 @@ OptionParser.new do |opts|
78
74
  options[:db_name] = v
79
75
  end
80
76
  opts.separator "\nMisc options"
81
- opts.on('-f', '--populate-airfields',
82
- 'Populate DCS airfield locations') do |_v|
83
- options[:populate_airfields] = true
84
- end
85
77
  opts.on('-t', '--threads=threads',
86
78
  'Thread Count (Default: 1)') do |v|
87
79
  options[:threads] = v
@@ -122,8 +114,6 @@ TacScribe::Daemon.new(
122
114
  db_password: options[:db_password],
123
115
  verbose_logging: options[:verbose],
124
116
  thread_count: options[:threads].to_i,
125
- populate_airfields: options[:populate_airfields],
126
117
  whitelist: options[:whitelist],
127
- cinc_enabled: options[:cinc_enabled],
128
118
  cinc_port: options[:cinc_port]
129
119
  ).start_processing
@@ -23,7 +23,9 @@ module TacScribe
23
23
  end
24
24
 
25
25
  def write_object(object)
26
- if (reference_latitude != 0 || reference_longitude != 0) && object[:type] != "Ground+Static+Aerodrome"
26
+ if (object.has_key? :skip_localization)
27
+ object.delete(:skip_localization)
28
+ elsif (reference_latitude != 0 || reference_longitude != 0)
27
29
  localize_position(object)
28
30
  end
29
31
 
@@ -53,9 +55,9 @@ module TacScribe
53
55
  end
54
56
  end
55
57
 
56
- if object[:type] = "Ground+Static+Aerodrome"
57
- object[:heading] = object[:wind_heading] ? object[:wind_heading] : 0
58
- object[:speed] = object[:wind_speed] ? object[:wind_speec] : 0
58
+ if object[:type] == "Ground+Static+Aerodrome"
59
+ object[:heading] = object[:wind_heading] ? object[:wind_heading] : -1
60
+ object[:speed] = object[:wind_speed] ? object[:wind_speed] : 0
59
61
  object.delete(:wind_heading)
60
62
  object.delete(:wind_speed)
61
63
  object.delete(:category)
@@ -71,6 +73,10 @@ module TacScribe
71
73
  cache_object = object
72
74
  end
73
75
 
76
+ # Hack to make sure the :name field is present so that it is included
77
+ # in the SQL
78
+ cache_object[:name] = nil unless cache_object.has_key?(:name)
79
+
74
80
  if !cache_object.key?(:altitude) || !cache_object[:altitude]
75
81
  cache_object[:altitude] = 0
76
82
  end
@@ -16,7 +16,7 @@ module TacScribe
16
16
  def initialize(db_host:, db_port:, db_name:, db_user:, db_password:,
17
17
  tacview_host:, tacview_port:, tacview_password:,
18
18
  tacview_client_name:, verbose_logging:, thread_count:,
19
- populate_airfields:, whitelist: nil, cinc_enabled:, cinc_port:)
19
+ whitelist: nil, cinc_port:)
20
20
  Datastore.instance.configure do |config|
21
21
  config.host = db_host
22
22
  config.port = db_port
@@ -30,7 +30,6 @@ module TacScribe
30
30
 
31
31
  @verbose_logging = verbose_logging
32
32
 
33
- @populate_airfields = populate_airfields
34
33
  @thread_count = thread_count
35
34
  @threads = {}
36
35
  @whitelist = Set.new(IO.read(whitelist).split) if whitelist
@@ -43,12 +42,10 @@ module TacScribe
43
42
  client_name: tacview_client_name
44
43
  )
45
44
 
46
- if cinc_enabled
47
- @cinc_client = Cinc::Client.new(
48
- host: tacview_host,
49
- port: cinc_port
50
- )
51
- end
45
+ @cinc_client = Cinc::Client.new(
46
+ host: tacview_host,
47
+ port: cinc_port
48
+ )
52
49
  end
53
50
 
54
51
  # Starts processing and reconnects if the client was disconnected.
@@ -66,7 +63,6 @@ module TacScribe
66
63
  start_cinc_thread
67
64
  start_db_sync_thread
68
65
  start_reporting_thread
69
- populate_airfields if @populate_airfields
70
66
  @threads.each_pair do |key, _value|
71
67
  puts "#{key} thread started"
72
68
  end
@@ -113,12 +109,13 @@ module TacScribe
113
109
  end
114
110
 
115
111
  def start_cinc_thread
116
- return unless @cinc_client
117
112
  cinc_thread = Thread.new do
118
113
  loop do
119
114
  @cinc_client.connect
120
115
  while true
121
116
  @cinc_client.get_airbases.each do |airbase|
117
+ airbase[:type] = "Ground+Static+Aerodrome"
118
+ airbase[:skip_localization] = true
122
119
  @event_queue.update_object Hash[airbase.map{ |k, v| [k.to_sym, v] }]
123
120
  end
124
121
  sleep 60
@@ -174,22 +171,5 @@ module TacScribe
174
171
  reporting_thread.name = 'Reporting'
175
172
  @threads[:reporting] = reporting_thread
176
173
  end
177
-
178
- def populate_airfields
179
- json = File.read(File.join(File.dirname(__FILE__),
180
- '../../data/airfields.json'))
181
- airfields = JSON.parse(json)
182
- airfields.each_with_index do |airfield, i|
183
- @event_queue.update_object(
184
- object_id: (45_000_000 + i).to_s,
185
- latitude: BigDecimal(airfield['lat'].to_s),
186
- longitude: BigDecimal(airfield['lon'].to_s),
187
- altitude: BigDecimal(airfield['alt'].to_s),
188
- type: 'Ground+Static+Aerodrome',
189
- name: airfield['name'],
190
- coalition: 0 # Neutral
191
- )
192
- end
193
- end
194
174
  end
195
175
  end
@@ -68,9 +68,6 @@ module TacScribe
68
68
  def update_object(event, time)
69
69
  return if ignore_unit?(event)
70
70
 
71
- # Hack to make sure the :name field is present so that it is included
72
- # in the SQL
73
- event[:name] = nil unless event.has_key?(:name)
74
71
  event[:game_time] = time
75
72
 
76
73
  self.events_processed += 1
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TacScribe
4
- VERSION = '0.7.3.rc1'
4
+ VERSION = '0.8.1'
5
5
  end
data/tac_scribe.gemspec CHANGED
@@ -32,6 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.add_dependency 'activerecord-jdbcpostgresql-adapter'
33
33
  else
34
34
  spec.add_dependency 'pg', '~>1.1'
35
+ spec.add_development_dependency 'pry-byebug', '~>3.9'
35
36
  end
36
37
 
37
38
  spec.add_dependency 'georuby', '~>2.5'
@@ -51,5 +52,4 @@ Gem::Specification.new do |spec|
51
52
  spec.add_development_dependency 'rubocop', '~>0.73'
52
53
  spec.add_development_dependency 'simplecov', '~>0.17'
53
54
  spec.add_development_dependency 'yard', '~>0.9'
54
- spec.add_development_dependency 'pry-byebug', '~>3.9'
55
55
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tac_scribe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3.rc1
4
+ version: 0.8.1
5
5
  platform: java
6
6
  authors:
7
7
  - Jeffrey Jones
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-09 00:00:00.000000000 Z
11
+ date: 2021-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -206,20 +206,6 @@ dependencies:
206
206
  - - "~>"
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0.9'
209
- - !ruby/object:Gem::Dependency
210
- requirement: !ruby/object:Gem::Requirement
211
- requirements:
212
- - - "~>"
213
- - !ruby/object:Gem::Version
214
- version: '3.9'
215
- name: pry-byebug
216
- prerelease: false
217
- type: :development
218
- version_requirements: !ruby/object:Gem::Requirement
219
- requirements:
220
- - - "~>"
221
- - !ruby/object:Gem::Version
222
- version: '3.9'
223
209
  description: Write Tacview data to PostGIS database
224
210
  email:
225
211
  - jeff@jones.be
@@ -242,7 +228,6 @@ files:
242
228
  - Rakefile
243
229
  - bin/console
244
230
  - bin/setup
245
- - data/airfields.json
246
231
  - data/whitelist.example
247
232
  - db/001_create_unit_table.rb
248
233
  - db/README.md
@@ -272,9 +257,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
272
257
  version: '0'
273
258
  required_rubygems_version: !ruby/object:Gem::Requirement
274
259
  requirements:
275
- - - ">"
260
+ - - ">="
276
261
  - !ruby/object:Gem::Version
277
- version: 1.3.1
262
+ version: '0'
278
263
  requirements: []
279
264
  rubyforge_project:
280
265
  rubygems_version: 2.7.10
data/data/airfields.json DELETED
@@ -1,121 +0,0 @@
1
- [{
2
- "lon": 45.01909093846007,
3
- "lat": 41.637735936261556,
4
- "alt": 464.5004577636719,
5
- "name": "Vaziani"
6
- },
7
- {
8
- "lon": 44.94687659192431,
9
- "lat": 41.67471935873423,
10
- "alt": 479.69482421875,
11
- "name": "Tbilisi-Lochini"
12
- },
13
- {
14
- "lon": 43.62488628801948,
15
- "lat": 43.50998473505967,
16
- "alt": 430.01043701171875,
17
- "name": "Nalchik"
18
- },
19
- {
20
- "lon": 38.92520230077506,
21
- "lat": 45.087429883845076,
22
- "alt": 30.010032653808594,
23
- "name": "Krasnodar-Center"
24
- },
25
- {
26
- "lon": 37.35978347755592,
27
- "lat": 45.01317473377168,
28
- "alt": 43.00004196166992,
29
- "name": "Anapa-Vityazevo"
30
- },
31
- {
32
- "lon": 41.876483823101026,
33
- "lat": 41.93210535345338,
34
- "alt": 18.01001739501953,
35
- "name": "Kobuleti"
36
- },
37
- {
38
- "lon": 43.100679733081456,
39
- "lat": 44.21864682380681,
40
- "alt": 320.01031494140625,
41
- "name": "Mineralnye Vody"
42
- },
43
- {
44
- "lon": 44.62032726210201,
45
- "lat": 43.79130325093825,
46
- "alt": 154.61184692382812,
47
- "name": "Mozdok"
48
- },
49
- {
50
- "lon": 44.94718306531669,
51
- "lat": 41.64116326678661,
52
- "alt": 449.4102478027344,
53
- "name": "Soganlug"
54
- },
55
- {
56
- "lon": 44.588922553542936,
57
- "lat": 43.20850098738094,
58
- "alt": 524.0057983398438,
59
- "name": "Beslan"
60
- },
61
- {
62
- "lon": 42.49568635853585,
63
- "lat": 42.179154028210135,
64
- "alt": 45.010047912597656,
65
- "name": "Kutaisi"
66
- },
67
- {
68
- "lon": 37.786226060479564,
69
- "lat": 44.6733296041269,
70
- "alt": 40.010040283203125,
71
- "name": "Novorossiysk"
72
- },
73
- {
74
- "lon": 40.021427482235985,
75
- "lat": 44.67144025735508,
76
- "alt": 180.01019287109375,
77
- "name": "Maykop-Khanskaya"
78
- },
79
- {
80
- "lon": 39.924231880466095,
81
- "lat": 43.43937843405085,
82
- "alt": 30.010034561157227,
83
- "name": "Sochi-Adler"
84
- },
85
- {
86
- "lon": 41.142447588488196,
87
- "lat": 42.852741071634995,
88
- "alt": 13.339526176452637,
89
- "name": "Sukhumi-Babushara"
90
- },
91
- {
92
- "lon": 42.061021312855914,
93
- "lat": 42.23872808157328,
94
- "alt": 13.23994255065918,
95
- "name": "Senaki-Kolkhi"
96
- },
97
- {
98
- "lon": 40.56417576840064,
99
- "lat": 43.124233340197144,
100
- "alt": 21.01003074645996,
101
- "name": "Gudauta"
102
- },
103
- {
104
- "lon": 37.985886938697085,
105
- "lat": 44.961383022734175,
106
- "alt": 20.010303497314453,
107
- "name": "Krymsk"
108
- },
109
- {
110
- "lon": 38.0041463505281,
111
- "lat": 44.56767458600406,
112
- "alt": 22.00992202758789,
113
- "name": "Gelendzhik"
114
- },
115
- {
116
- "lon": 39.20306690632454,
117
- "lat": 45.0460996415433,
118
- "alt": 34.01003646850586,
119
- "name": "Krasnodar-Pashkovsky"
120
- }
121
- ]