tac_scribe 0.7.3-java → 0.8.0-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: c39a4f860637756b22a7ce9fd09d74e2c7190478a94dbc779373ba0d213d0b35
4
- data.tar.gz: 5abb08ea5e750d3e460ade56d89924866badb2a842b62b20672df2f0c349eb53
3
+ metadata.gz: 919cea3cc82c8e3c7b1341cf39d738adc9de5fc5f6c38860a6c865f430f72afc
4
+ data.tar.gz: 6f79e789707f2d93c77460ca7407547669a5b736cad0f3e04a6678449e6c9f30
5
5
  SHA512:
6
- metadata.gz: 0d0ba804851aa3143c0f5b563d7401706dd129b826dc5398174ead33b982a22d48d0871d0d5498eb922c4ca08c83598a7c3928e3f1a69a7cd2094a3a5acf8801
7
- data.tar.gz: 641fe1a451dff87f915c69fdf6ea36a4053f4924d77141a3617d7019dcf27ff9d9f884f65894d20ae75414d3b18c0b2e40642d2248d9a022cc8061455855afd3
6
+ metadata.gz: e994f93d31d05296c77ac2e6e92203e47772041641ffb68a5a54ff2f459b069345531c0619ad0a8b3cdcf31e5011937b7001381a7da1aafc82d13824f39eeb72
7
+ data.tar.gz: 17e15f0f0906944fa2ba1570b6814b06d9510e109b0b0e2a097086f0a0b1f349a604f073f59ed45a55d79ef4da9763dfd09c06c4e59647f919d878e471a1bb4a
@@ -6,9 +6,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.8.0] - 2021-01-09
10
+ ### Changed
11
+ - Remove airfield loading from json files
12
+ - CinC is now mandatory
13
+
14
+ ### Fixed
15
+ - Aerodromes (including oilrigs... ) no longer have special position handling.
16
+ This is in relation to the removal of airfields from json files and requiring
17
+ CinC. Side effect is oilrigs will now be positioned correctly.
18
+
19
+ ## [0.7.6] - 2020-08-13
20
+ ### Changed
21
+ - Fix the default port number
22
+
23
+ ## [0.7.5] - 2020-08-12
24
+ ### Changed
25
+ - Various fixes related to airfield population using CinC
26
+
27
+ ## [0.7.4] - 2020-08-10
28
+ ### Changed
29
+ - Fix typo that was causing all objects to be registered as airbases
30
+
9
31
  ## [0.7.3] - 2020-08-10
10
32
  ### Changed
11
- - Bug fixes after adding CinC support.
33
+ - Bug fixes after adding CinC support
12
34
 
13
35
  ## [0.7.2] - 2020-08-10
14
36
  ### Added
@@ -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,7 @@ 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 (reference_latitude != 0 || reference_longitude != 0)
27
27
  localize_position(object)
28
28
  end
29
29
 
@@ -53,9 +53,9 @@ module TacScribe
53
53
  end
54
54
  end
55
55
 
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
56
+ if object[:type] == "Ground+Static+Aerodrome"
57
+ object[:heading] = object[:wind_heading] ? object[:wind_heading] : -1
58
+ object[:speed] = object[:wind_speed] ? object[:wind_speed] : 0
59
59
  object.delete(:wind_heading)
60
60
  object.delete(:wind_speed)
61
61
  object.delete(:category)
@@ -71,6 +71,10 @@ module TacScribe
71
71
  cache_object = object
72
72
  end
73
73
 
74
+ # Hack to make sure the :name field is present so that it is included
75
+ # in the SQL
76
+ cache_object[:name] = nil unless cache_object.has_key?(:name)
77
+
74
78
  if !cache_object.key?(:altitude) || !cache_object[:altitude]
75
79
  cache_object[:altitude] = 0
76
80
  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,12 @@ 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"
122
118
  @event_queue.update_object Hash[airbase.map{ |k, v| [k.to_sym, v] }]
123
119
  end
124
120
  sleep 60
@@ -174,22 +170,5 @@ module TacScribe
174
170
  reporting_thread.name = 'Reporting'
175
171
  @threads[:reporting] = reporting_thread
176
172
  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
173
  end
195
174
  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'
4
+ VERSION = '0.8.0'
5
5
  end
@@ -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
4
+ version: 0.8.0
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-01-09 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
@@ -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
- ]