Get up and running with the War Thunder mock API in 5 minutes.
- Mockoon Desktop App (free)
- OR Mockoon CLI via npm
- Download and install Mockoon
- Launch Mockoon
- Click "Open environment" → "Import from file"
- Select
war-thunder-environment.jsonfrom this directory - Click the green "Start server" button
- The mock API is now running on
http://localhost:8111✅
# Install Mockoon CLI globally
npm install -g @mockoon/cli
# Start the mock server
cd mockoon
mockoon-cli start --data war-thunder-environment.jsonOpen a browser or use curl:
curl http://localhost:8111/state
curl http://localhost:8111/indicatorsYou should see JSON responses with telemetry data.
Create a simple C# console app:
using GamesDat.Core;
using GamesDat.Core.Telemetry.Sources.WarThunder;
// Create a session with both War Thunder sources
await using var session = new GameSession()
.AddSource(WarThunderSources.CreateStateSource(hz: 60)) // 60Hz polling
.AddSource(WarThunderSources.CreateIndicatorsSource(hz: 10)) // 10Hz polling
.OnData<StateData>(data =>
{
if (data.Valid == 1)
{
Console.WriteLine($"[State] Speed: {data.IndicatedAirspeed:F1} km/h | " +
$"Alt: {data.Altitude:F1}m | " +
$"Fuel: {data.Fuel:F0}kg");
}
})
.OnData<IndicatorsData>(data =>
{
if (data.Valid == 1)
{
Console.WriteLine($"[Indicators] Oil: {data.OilTemp:F1}°C | " +
$"Water: {data.WaterTemp:F1}°C | " +
$"RPM: {data.RpmMin:F0}");
}
})
.AutoOutput();
Console.WriteLine("Recording War Thunder telemetry (Mock API)");
Console.WriteLine("Press Ctrl+C to stop...");
await session.StartAsync();Run it and you'll see:
Recording War Thunder telemetry (Mock API)
Press Ctrl+C to stop...
[State] Speed: 425.8 km/h | Alt: 2845.6m | Fuel: 542kg
[Indicators] Oil: 95.3°C | Water: 88.7°C | RPM: 2650
[State] Speed: 431.2 km/h | Alt: 2867.1m | Fuel: 541kg
[Indicators] Oil: 96.1°C | Water: 89.2°C | RPM: 2655
...
- Dynamic values that change on each request
- Realistic flight parameters (speed, altitude, G-force)
- Position and velocity vectors
- Engine data (throttle, RPM, power)
- Control surfaces (flaps, gear, airbrake)
- Fuel and navigation
- Dynamic instrument readings
- Engine temperatures (oil, water)
- Attitude indicator (roll, pitch)
- Altimeter readings
- Vertical speed
- Clock time
- Click on an endpoint (
/stateor/indicators) - In the right panel, select a different response:
- Flying - Dynamic Values (default) - Active flight with random data
- On Ground - Idle - Aircraft on the ground
- Not in Match - In hangar/menu (valid=0)
- Click the star icon to "Set as default"
Test Takeoff:
- Switch
/stateto "On Ground - Idle" - Watch your app handle
valid=1but zero velocity - Switch to "Flying" to simulate takeoff
- See the transition in your telemetry
Test Connection Loss:
- Start recording with "Flying" response
- Stop the Mockoon server (simulates game crash)
- Watch your app's retry logic kick in
- Restart the server (simulates recovery)
- See automatic reconnection
Test Invalid Data:
- Switch to "Not in Match" response
- Your app should check
valid==0and skip processing - Useful for testing data validation logic
Check the examples/ directory for static JSON samples:
state-flying.json- Aircraft in flightstate-ground.json- Aircraft on groundindicators-flying.json- Active instrumentsindicators-ground.json- Idle instruments
These are useful for:
- Understanding the data format
- Creating test fixtures
- Designing custom responses in Mockoon
The mock API can easily handle:
- ✅ 60Hz
/statepolling - ✅ 10Hz
/indicatorspolling - ✅ Both simultaneously
- ✅ Multiple concurrent sessions
Typical overhead: <1% CPU, ~10MB memory
- Customize responses - Edit the Mockoon environment to add your own scenarios
- Add custom fields - Modify JSON to test edge cases
- Test error handling - Use Mockoon's rules to simulate HTTP errors
- Build dashboards - Use the realtime callbacks to create live visualizations
- Analyze data - Let sessions write to disk and analyze the binary files
- ✅ Ensure Mockoon server is running (green "Started" indicator)
- ✅ Check it's on port 8111
- ✅ Try accessing http://localhost:8111/state in a browser
If another app is using 8111:
- In Mockoon, click the environment settings (gear icon)
- Change "Port" to another value (e.g., 8112)
- Update your code:
WarThunderSources.CreateStateSource(baseUrl: "http://localhost:8112")
- ✅ Ensure "Disable templating" is unchecked on the response
- ✅ Try restarting the Mockoon server
- ✅ You're using the "Not in Match" response
- ✅ Switch to "Flying" or "On Ground" response
- Full README - Detailed documentation
- War Thunder Integration Docs - Integration guide
- Mockoon Documentation - Mock server features
Happy Testing! 🎮
Now you can develop and test your War Thunder integration without needing the game running. The mock API provides realistic, dynamic data that matches the real War Thunder HTTP API format.