@@ -208,6 +208,18 @@ public static EveManager Instance
208
208
/// </summary>
209
209
public event TheraUpdatedHandler TheraUpdateEvent ;
210
210
211
+
212
+ /// <summary>
213
+ /// Turnur Connections Updated Event Handler
214
+ /// </summary>
215
+ public delegate void TurnurUpdatedHandler ( ) ;
216
+
217
+ /// <summary>
218
+ /// Turnur Updated Added Events
219
+ /// </summary>
220
+ public event TurnurUpdatedHandler TurnurUpdateEvent ;
221
+
222
+
211
223
/// <summary>
212
224
/// Storms Updated Event Handler
213
225
/// </summary>
@@ -327,6 +339,12 @@ public static EveManager Instance
327
339
/// </summary>
328
340
public List < TheraConnection > TheraConnections { get ; set ; }
329
341
342
+ /// <summary>
343
+ /// Gets or sets the current list of Turnur connections
344
+ /// </summary>
345
+ public List < TurnurConnection > TurnurConnections { get ; set ; }
346
+
347
+
330
348
public bool UseESIForCharacterPositions { get ; set ; }
331
349
332
350
public List < Storm > MetaliminalStorms { get ; set ; }
@@ -2354,6 +2372,89 @@ public async void UpdateTheraConnections()
2354
2372
}
2355
2373
}
2356
2374
2375
+ /// <summary>
2376
+ /// Update the current Turnur Connections from EVE-Scout
2377
+ /// </summary>
2378
+ public async void UpdateTurnurConnections ( )
2379
+ {
2380
+ string turnurApiURL = "https://api.eve-scout.com/v2/public/signatures?system_name=Turnur" ;
2381
+ string strContent = string . Empty ;
2382
+
2383
+ try
2384
+ {
2385
+ HttpClient hc = new HttpClient ( ) ;
2386
+ var response = await hc . GetAsync ( turnurApiURL ) ;
2387
+ response . EnsureSuccessStatusCode ( ) ;
2388
+ strContent = await response . Content . ReadAsStringAsync ( ) ;
2389
+
2390
+ JsonTextReader jsr = new JsonTextReader ( new StringReader ( strContent ) ) ;
2391
+
2392
+ TurnurConnections . Clear ( ) ;
2393
+
2394
+ /*
2395
+ new format
2396
+
2397
+ "id": "46",
2398
+ "created_at": "2023-12-02T11:24:49.000Z",
2399
+ "created_by_id": 93027866,
2400
+ "created_by_name": "Das d'Alembert",
2401
+ "updated_at": "2023-12-02T11:27:01.000Z",
2402
+ "updated_by_id": 93027866,
2403
+ "updated_by_name": "Das d'Alembert",
2404
+ "completed_at": "2023-12-02T11:27:01.000Z",
2405
+ "completed_by_id": 93027866,
2406
+ "completed_by_name": "Das d'Alembert",
2407
+ "completed": true,
2408
+ "wh_exits_outward": true,
2409
+ "wh_type": "Q063",
2410
+ "max_ship_size": "medium",
2411
+ "expires_at": "2023-12-03T04:24:49.000Z",
2412
+ "remaining_hours": 14,
2413
+ "signature_type": "wormhole",
2414
+ "out_system_id": 31000005,
2415
+ "out_system_name": "Thera",
2416
+ "out_signature": "HMM-222",
2417
+ "in_system_id": 30001715,
2418
+ "in_system_class": "hs",
2419
+ "in_system_name": "Moutid",
2420
+ "in_region_id": 10000020,
2421
+ "in_region_name": "Tash-Murkon",
2422
+ "in_signature": "LPI-677"
2423
+ */
2424
+
2425
+ while ( jsr . Read ( ) )
2426
+ {
2427
+ if ( jsr . TokenType == JsonToken . StartObject )
2428
+ {
2429
+ JObject obj = JObject . Load ( jsr ) ;
2430
+ string inSignatureId = obj [ "in_signature" ] . ToString ( ) ;
2431
+ string outSignatureId = obj [ "out_signature" ] . ToString ( ) ;
2432
+ long solarSystemId = long . Parse ( obj [ "in_system_id" ] . ToString ( ) ) ;
2433
+ string wormHoleEOL = obj [ "expires_at" ] . ToString ( ) ;
2434
+ string type = obj [ "signature_type" ] . ToString ( ) ;
2435
+
2436
+ if ( type != null && type == "wormhole" && solarSystemId != 0 && wormHoleEOL != null && SystemIDToName . ContainsKey ( solarSystemId ) )
2437
+ {
2438
+ System turnurConnectionSystem = GetEveSystemFromID ( solarSystemId ) ;
2439
+
2440
+ TurnurConnection tc = new TurnurConnection ( turnurConnectionSystem . Name , turnurConnectionSystem . Region , inSignatureId , outSignatureId , wormHoleEOL ) ;
2441
+ TurnurConnections . Add ( tc ) ;
2442
+ }
2443
+ }
2444
+ }
2445
+ }
2446
+ catch
2447
+ {
2448
+ return ;
2449
+ }
2450
+
2451
+ if ( TurnurUpdateEvent != null )
2452
+ {
2453
+ TurnurUpdateEvent ( ) ;
2454
+ }
2455
+ }
2456
+
2457
+
2357
2458
public void UpdateMetaliminalStorms ( )
2358
2459
{
2359
2460
MetaliminalStorms . Clear ( ) ;
@@ -2567,6 +2668,7 @@ private void Init()
2567
2668
LoadCharacters ( ) ;
2568
2669
2569
2670
InitTheraConnections ( ) ;
2671
+ InitTurnurConnections ( ) ;
2570
2672
2571
2673
InitMetaliminalStorms ( ) ;
2572
2674
InitFactionWarfareInfo ( ) ;
@@ -2638,6 +2740,17 @@ private void InitTheraConnections()
2638
2740
UpdateTheraConnections ( ) ;
2639
2741
}
2640
2742
2743
+ /// <summary>
2744
+ /// Initialise the Turnur Connection Data from EVE-Scout
2745
+ /// </summary>
2746
+ private void InitTurnurConnections ( )
2747
+ {
2748
+ TurnurConnections = new List < TurnurConnection > ( ) ;
2749
+ UpdateTurnurConnections ( ) ;
2750
+ }
2751
+
2752
+
2753
+
2641
2754
/// <summary>
2642
2755
/// Initialise the Zarzakh Connection Data
2643
2756
/// </summary>
@@ -3167,6 +3280,7 @@ private void StartBackgroundThread()
3167
3280
UpdateESIUniverseData ( ) ;
3168
3281
UpdateServerInfo ( ) ;
3169
3282
UpdateTheraConnections ( ) ;
3283
+ UpdateTurnurConnections ( ) ;
3170
3284
}
3171
3285
3172
3286
if ( ( NextDotlanUpdate - DateTime . Now ) . Minutes < 0 )
0 commit comments