Skip to content

Add War Thunder realtime source#14

Merged
codegefluester merged 4 commits intomainfrom
feat/add-war-thunder-realtime-source
Feb 12, 2026
Merged

Add War Thunder realtime source#14
codegefluester merged 4 commits intomainfrom
feat/add-war-thunder-realtime-source

Conversation

@codegefluester
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings February 11, 2026 16:04
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 adds comprehensive War Thunder HTTP telemetry integration to GamesDat, including a generic HttpPollingSourceBase<T> for reusable HTTP polling functionality. The PR introduces telemetry capture from War Thunder's local HTTP API endpoints (/state and /indicators) with configurable polling rates, retry logic, and includes extensive testing support via Mockoon mock API configurations.

Changes:

  • Added generic HTTP polling infrastructure (HttpPollingSourceBase<T>, HttpPollingSourceOptions) for reusable HTTP-based telemetry sources
  • Implemented War Thunder-specific sources (StateSource, IndicatorsSource) with factory methods and data structures
  • Created comprehensive Mockoon mock API environment with example JSON files for testing without the game
  • Updated documentation with War Thunder integration guide, quick start, and mock API setup instructions

Reviewed changes

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

Show a summary per file
File Description
GamesDat/Telemetry/Sources/HttpPollingSourceBase.cs Abstract base class for HTTP polling telemetry sources with retry logic and JSON deserialization
GamesDat/Telemetry/Sources/HttpPollingSourceOptions.cs Configuration options for HTTP polling sources including timeouts and retry settings
GamesDat/Telemetry/Sources/WarThunder/WarThunderSources.cs Factory methods for creating War Thunder telemetry sources with sensible defaults
GamesDat/Telemetry/Sources/WarThunder/StateSource.cs Concrete implementation for War Thunder's /state endpoint
GamesDat/Telemetry/Sources/WarThunder/IndicatorsSource.cs Concrete implementation for War Thunder's /indicators endpoint
GamesDat/Telemetry/Sources/WarThunder/StateData.cs Data structure for /state endpoint telemetry
GamesDat/Telemetry/Sources/WarThunder/IndicatorsData.cs Data structure for /indicators endpoint telemetry
GamesDat/Telemetry/Sources/WarThunder/WarThunderHttpClient.cs Shared HttpClient singleton to prevent socket exhaustion
docs/WarThunder.md Comprehensive integration documentation with examples and API reference
mockoon/war-thunder-environment.json Mockoon environment with dynamic faker.js templates for realistic mock data
mockoon/README.md Detailed mock API documentation and testing scenarios
mockoon/QUICKSTART.md Quick start guide for mock API setup
mockoon/examples/*.json Static JSON examples for flying and ground states
mockoon/.gitignore Git ignore patterns for Mockoon files
README.md Updated game support table and added War Thunder examples
GamesDat.Demo/Program.cs Added War Thunder capture example
Examples/WarThunderExample.cs Comprehensive examples demonstrating various usage patterns

💡 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 comments in this thread

Copy link
Contributor

Copilot AI commented Feb 11, 2026

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

…ion (#15)

* Initial plan

* Address code review comments

Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>

* Remove redundant TaskCanceledException catch

Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>

* Clarify timeout cancellation comment

Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>
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

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


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

Comment on lines +18 to +22
public static StateSource CreateStateSource(string? baseUrl = null, int hz = 60)
{
var pollInterval = TimeSpan.FromMilliseconds(1000.0 / hz);
return new StateSource(baseUrl ?? DefaultBaseUrl, pollInterval);
}
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

hz is used as a divisor to compute pollInterval. If a caller passes hz <= 0, this will throw (divide-by-zero) or produce an invalid interval. Add validation (e.g., throw ArgumentOutOfRangeException) to ensure hz is positive.

Copilot uses AI. Check for mistakes.
Comment on lines +40 to +44
public static IndicatorsSource CreateIndicatorsSource(string? baseUrl = null, int hz = 10)
{
var pollInterval = TimeSpan.FromMilliseconds(1000.0 / hz);
return new IndicatorsSource(baseUrl ?? DefaultBaseUrl, pollInterval);
}
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

Same hz validation issue as above: hz <= 0 will cause divide-by-zero/invalid interval. Validate hz and fail fast with a clear exception.

Copilot uses AI. Check for mistakes.
@codegefluester
Copy link
Owner Author

@copilot open a new pull request to apply changes based on this feedback and this feedback

Copy link
Contributor

Copilot AI commented Feb 12, 2026

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

@codegefluester codegefluester merged commit 3d9615f into main Feb 12, 2026
1 check passed
@codegefluester codegefluester deleted the feat/add-war-thunder-realtime-source branch February 12, 2026 10:55
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