tac_scribe 0.7.6 → 0.8.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
  SHA256:
3
- metadata.gz: 76f453b7dfa20a53d06f6ba792814502878629b83bb700eb64e25a8da02b0e4b
4
- data.tar.gz: a6c043ed66acb31ef14a8c486a8566e801e8c5774b3914c59ad4e830c698bcff
3
+ metadata.gz: 4cbf0042fe2314cba0425a22ce58270ef687832fdfeb17bf16e52fea2ce18a61
4
+ data.tar.gz: a187bd3661d784b9fd42fc5fb30a07485e07ff11eedbec8f1ce1350b2aadea74
5
5
  SHA512:
6
- metadata.gz: 6ff217c229d9a42e58a7ae37195bb37c20e282b78145d8c90aab130ac50c7353de912cbad0cb4892d6d987f65e11fe8dbccceb4a6a364ca3ac5daf07acbfa00e
7
- data.tar.gz: 6395e585cf49f4260960ef06098af879090dd79ba83edaa57d1ad41a548c29072332a8a1f1b492ccfb4bbb979a8e645c9e6914bd7a55e2bcc64c2a37869e826c
6
+ metadata.gz: a6ef76e6d1e6846165d143a95aef141e32d1b4a5e68af5d0eafba8e328accb15b62d2bb6b4b425bb6334dac365f66d0f47388747583005e64f13bf4b43ccffc2
7
+ data.tar.gz: ff4edf1ef01fd039276d2230ee1eb0683e49864b212721f3850539ca8905c90c0e73d2fc7954ea2a87f8a34ecd686356a2a76daa254b313b26618787b38389aa
@@ -6,6 +6,16 @@ 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
+
9
19
  ## [0.7.6] - 2020-08-13
10
20
  ### Changed
11
21
  - Fix the default port number
@@ -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
 
@@ -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,7 +109,6 @@ 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
@@ -175,22 +170,5 @@ module TacScribe
175
170
  reporting_thread.name = 'Reporting'
176
171
  @threads[:reporting] = reporting_thread
177
172
  end
178
-
179
- def populate_airfields
180
- json = File.read(File.join(File.dirname(__FILE__),
181
- '../../data/airfields.json'))
182
- airfields = JSON.parse(json)
183
- airfields.each_with_index do |airfield, i|
184
- @event_queue.update_object(
185
- object_id: (45_000_000 + i).to_s,
186
- latitude: BigDecimal(airfield['lat'].to_s),
187
- longitude: BigDecimal(airfield['lon'].to_s),
188
- altitude: BigDecimal(airfield['alt'].to_s),
189
- type: 'Ground+Static+Aerodrome',
190
- name: airfield['name'],
191
- coalition: 0 # Neutral
192
- )
193
- end
194
- end
195
173
  end
196
174
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TacScribe
4
- VERSION = '0.7.6'
4
+ VERSION = '0.8.0'
5
5
  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.6
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeffrey Jones
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-13 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
  name: pg
@@ -242,7 +242,6 @@ files:
242
242
  - Rakefile
243
243
  - bin/console
244
244
  - bin/setup
245
- - data/airfields.json
246
245
  - data/whitelist.example
247
246
  - db/001_create_unit_table.rb
248
247
  - 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
- ]