Conversation
There was a problem hiding this comment.
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.
|
@copilot open a new pull request to apply changes based on the comments in this thread |
|
@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>
There was a problem hiding this comment.
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.
| public static StateSource CreateStateSource(string? baseUrl = null, int hz = 60) | ||
| { | ||
| var pollInterval = TimeSpan.FromMilliseconds(1000.0 / hz); | ||
| return new StateSource(baseUrl ?? DefaultBaseUrl, pollInterval); | ||
| } |
There was a problem hiding this comment.
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.
| public static IndicatorsSource CreateIndicatorsSource(string? baseUrl = null, int hz = 10) | ||
| { | ||
| var pollInterval = TimeSpan.FromMilliseconds(1000.0 / hz); | ||
| return new IndicatorsSource(baseUrl ?? DefaultBaseUrl, pollInterval); | ||
| } |
There was a problem hiding this comment.
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 open a new pull request to apply changes based on this feedback and this feedback |
|
@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. |
- 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>
- 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>
- 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>
No description provided.