Skip to content

Add aircraft total to loot screen (ADS-B tracking + server-side deduped count)#4

Open
FusedStamen wants to merge 10 commits intoLOCOSP:mainfrom
FusedStamen:main
Open

Add aircraft total to loot screen (ADS-B tracking + server-side deduped count)#4
FusedStamen wants to merge 10 commits intoLOCOSP:mainfrom
FusedStamen:main

Conversation

@FusedStamen
Copy link
Copy Markdown

What this does

Adds ADS-B aircraft tracking to the loot database and loot screen.

Changes

loot_manager.py

  • New save_adsb_aircraft() method — appends to adsb_aircraft.csv per session, deduped by ICAO within session, consistent with existing bt_devices/wardriving patterns
  • _scan_session_dir now counts adsb_aircraft.csv entries
  • _recalc_totals and _rebuild_db include adsb key for cross-session accumulation

app.py

  • aircraft_new event handler now calls loot.save_adsb_aircraft() for each new unique ICAO, capturing position, altitude, speed and heading
  • _load_loot_totals includes adsb key
  • Loot screen ALL-TIME column shows Aircraft count — prefers server-side deduped total from wardrive plugin (_user_stats["aircraft"]), falls back to local count
  • Loot screen THIS SESSION column shows live aircraft count for current session

Notes

  • adsb_aircraft.csv format matches what wardrive_upload.py already expects for upload, so existing sessions with that file will be picked up automatically
  • Server-side count takes priority in the display so the number stays consistent with what wdgwars.pl reports

@FusedStamen
Copy link
Copy Markdown
Author

also fixed - upload timeout false failure (wardrive_upload)

Problem

Large sessions with many ADS-B records could exceed the 30s upload timeout.
The upload succeeded server-side but the client got a timeout error, logged
it as failed, and left the session unmarked — causing duplicate re-uploads
on retry which the server correctly rejected as "already seen".

Fix

  • Bumped upload timeout from 30s to 90s on both main upload and rate-limit retry
  • Added specific TimeoutError/OSError handler that marks the session as uploaded
    with a warning instead of silently failing — prevents duplicate re-sends when
    the server received the data but the response timed out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant