MCTUtils.Tacview
0.3.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package MCTUtils.Tacview --version 0.3.0
NuGet\Install-Package MCTUtils.Tacview -Version 0.3.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MCTUtils.Tacview" Version="0.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MCTUtils.Tacview" Version="0.3.0" />
<PackageReference Include="MCTUtils.Tacview" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MCTUtils.Tacview --version 0.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MCTUtils.Tacview, 0.3.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MCTUtils.Tacview@0.3.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MCTUtils.Tacview&version=0.3.0
#tool nuget:?package=MCTUtils.Tacview&version=0.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MCTUtils.Tacview
<br />
Tacview Real-Time Telemetry support for MCTUtils. Connects to Tacview telemetry streams, handles the handshake protocol, and provides real-time ACMI data.
dotnet add package MCTUtils.Tacview
| Target | .NET 8 |
| Version | 0.3.0 |
| Dependency | MCTUtils (core) — added automatically |
| Repository | github.com/odskee/MCTUtils |
| IntelliSense | Full XML docs for all public APIs |
| Debugging | SourceLink support |
Namespace: MCTUtils.Tacview
Two public types:
TacviewHash— CRC32 password hash computationDCSRealTimeTelemetry— TCP telemetry client
TacviewHash (static)
Computes CRC32 password hashes for Tacview protocol authentication using System.IO.Hashing.Crc32.
| Method | Return | Description |
|---|---|---|
MakePasswordHash(string password) |
string |
CRC32 of UTF-16LE encoded string. Returns "0" for empty/null. |
MakePasswordHash(byte[] password) |
string |
CRC32 of raw byte array. Returns "0" for empty. |
using MCTUtils.Tacview;
string hash = TacviewHash.MakePasswordHash("myPassword");
string hashFromBytes = TacviewHash.MakePasswordHash(
Encoding.Unicode.GetBytes("myPassword"));
DCSRealTimeTelemetry (class, implements IAsyncDisposable)
TCP client for connecting to a Tacview Real-Time Telemetry source, performing the handshake, and reading ACMI data lines as they arrive.
Constructor
| Constructor | Description |
|---|---|
DCSRealTimeTelemetry(string Host, int Port = 42674, string ClientName = "", string Password = "") |
Creates a new telemetry client. Empty client name falls back to the entry assembly name. Empty password produces hash "0". |
Properties
| Property | Type | Description |
|---|---|---|
IsConnected |
bool |
Whether the TCP connection is currently established |
Events
| Event | Type | Description |
|---|---|---|
LineReceivedEvent |
Action<string>? |
Fires for each complete ACMI line (delimited by \n) |
DisconnectedEvent |
Action<Exception>? |
Fires when the remote host closes the connection or an error occurs |
Methods
| Method | Return | Description |
|---|---|---|
ConnectToTelemetrySourceAsync(CancellationToken token) |
Task |
Connects, performs handshake, starts read loop. Requires both events to be subscribed. |
GetConnectionTime() |
TimeSpan? |
Time elapsed since connection, or null if not connected |
GetConnectionDurationSeconds() |
int |
Connection duration in seconds (rounded) |
DisposeAsync() |
ValueTask |
Cancels read loop, closes TCP connection, disposes resources |
Exceptions
| Exception | Condition |
|---|---|
EventConfigurationMismatchException |
ConnectToTelemetrySourceAsync() called without subscribing to both events |
PasswordNotAcceptedException |
Handshake failed — remote host closed connection |
Complete Example
using MCTUtils.Tacview;
await using var telemetry = new DCSRealTimeTelemetry(
host: "192.168.1.100",
port: 42674,
clientName: "MyAnalyzer",
password: "optional");
telemetry.LineReceivedEvent += line =>
{
Console.WriteLine($"ACMI: {line}");
};
telemetry.DisconnectedEvent += ex =>
{
Console.WriteLine($"Disconnected: {ex.Message}");
};
try
{
await telemetry.ConnectToTelemetrySourceAsync();
Console.WriteLine($"Connected for {telemetry.GetConnectionDurationSeconds()}s");
// Keep running — events fire on background thread
await Task.Delay(TimeSpan.FromMinutes(5));
}
catch (EventConfigurationMismatchException ex)
{
// Events not subscribed
}
catch (PasswordNotAcceptedException ex)
{
// Bad password
}
catch (SocketException ex)
{
// Connection failed
}
Dependencies
| Package | Version | Usage |
|---|---|---|
| MCTUtils | 0.3.0 | Shared exceptions and types (ProjectReference) |
| System.IO.Hashing | 8.0.0 | CRC32 hash computation |
| Microsoft.SourceLink.GitHub | 8.x | Source-level debugging (PrivateAssets) |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- MCTUtils (>= 0.3.0)
- System.IO.Hashing (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial public release.