Skip to content

Patch up war thunder structs#17

Merged
codegefluester merged 2 commits intomainfrom
bugfixes/war-thunder-source
Feb 13, 2026
Merged

Patch up war thunder structs#17
codegefluester merged 2 commits intomainfrom
bugfixes/war-thunder-source

Conversation

@codegefluester
Copy link
Owner

Looks like the /state endpoint is only returning data (reliably) for air battles. For ground and naval battles the response is more than often just {"valid": false}

Copilot AI review requested due to automatic review settings February 13, 2026 11:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates the War Thunder telemetry integration to handle the inconsistent /state endpoint responses, which reliably returns data for air battles but often returns {"valid": false} for ground and naval battles. The PR restructures the data models to match actual API responses and adds configuration for handling invalid frames.

Changes:

  • Changed Valid field from int (1/0) to bool (true/false) across War Thunder data structures to match actual API responses
  • Restructured StateData and IndicatorsData to support multiple vehicle types (air, ground, naval) with vehicle-specific fields
  • Added StateSourceOptions for configurable invalid frame handling
  • Enhanced error handling and debug logging in HTTP polling infrastructure
  • Updated demo and examples to display comprehensive flight telemetry dashboard

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
mockoon/war-thunder-environment.json Updated mock API responses to use boolean valid field and added vehicle-specific response examples (tank, plane) matching real API structure
GamesDat/Telemetry/Sources/WarThunder/StateSourceOptions.cs New configuration class for controlling invalid frame filtering and logging behavior
GamesDat/Telemetry/Sources/WarThunder/StateSource.cs Added constructor overloads and override for filtering invalid frames (implementation incomplete)
GamesDat/Telemetry/Sources/WarThunder/StateData.cs Complete restructure from generic XYZ coordinates to detailed aircraft telemetry fields with units in property names; removed StructLayout
GamesDat/Telemetry/Sources/WarThunder/IndicatorsData.cs Added vehicle type fields (army, type as strings), expanded to support air/ground/naval indicators; documented BinarySessionWriter incompatibility
GamesDat/Telemetry/Sources/HttpPollingSourceOptions.cs Increased MaxConsecutiveErrors default from 10 to 30, added EnableDebugLogging option
GamesDat/Telemetry/Sources/HttpPollingSourceBase.cs Removed unmanaged constraint, enhanced debug logging, changed OperationCanceledException handling to always terminate
GamesDat/GameSession.cs Improved cancellation diagnostics to distinguish expected vs unexpected cancellation
GamesDat.Demo/Program.cs Enhanced with comprehensive flight telemetry dashboard UI displaying flight parameters, controls, and engine status
Examples/WarThunderExample.cs Updated property references to match new StateData field names (e.g., IndicatedAirspeedKmh, AltitudeMeters)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codegefluester
Copy link
Owner Author

@copilot open a new pull request to apply changes based on the following feedback:

Copy link
Contributor

Copilot AI commented Feb 13, 2026

@codegefluester I've opened a new pull request, #18, to work on those changes. Once the pull request is ready, I'll request review from you.

…taVersion, combine if statements

Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>
@codegefluester codegefluester merged commit e365948 into main Feb 13, 2026
1 check passed
@codegefluester codegefluester deleted the bugfixes/war-thunder-source branch February 13, 2026 22:33
github-actions bot pushed a commit that referenced this pull request Feb 13, 2026
- Change StateData.Valid field type from int to bool (breaking change from PR #18)
- Add parameter validation documentation for hz parameter (from PR #16)
- Update troubleshooting section to reference boolean Valid field

This update reflects changes from merged PRs #14, #16, #17, and #18.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
github-actions bot pushed a commit that referenced this pull request Feb 13, 2026
- Document breaking change: Valid field changed from int to bool
- Add parameter validation section for hz parameter
- Add breaking changes section at top of document
- Update troubleshooting section to reference boolean type
- Add notes about complete field listings in source files

Addresses changes from PR #18, #16, #17, and #14.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
codegefluester pushed a commit that referenced this pull request Feb 13, 2026
- Document breaking change: Valid field changed from int to bool
- Add parameter validation section for hz parameter
- Add breaking changes section at top of document
- Update troubleshooting section to reference boolean type
- Add notes about complete field listings in source files

Addresses changes from PR #18, #16, #17, and #14.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@github-actions github-actions bot mentioned this pull request Feb 14, 2026
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.

3 participants