MCTUtils.Tacview 1.0.1

dotnet add package MCTUtils.Tacview --version 1.0.1
                    
NuGet\Install-Package MCTUtils.Tacview -Version 1.0.1
                    
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="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MCTUtils.Tacview" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="MCTUtils.Tacview" />
                    
Project file
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 1.0.1
                    
#r "nuget: MCTUtils.Tacview, 1.0.1"
                    
#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@1.0.1
                    
#: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=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=MCTUtils.Tacview&version=1.0.1
                    
Install as a Cake Tool

MCTUtils.Tacview

NuGet NuGet Downloads License

Tacview Real-Time Telemetry support for MCTUtils. Connects to Tacview telemetry streams, handles the handshake protocol, and provides real-time ACMI data.

This library is NOT suitable for use in software involved with the planning, execution or analysis or real-world military or civilian operations.

dotnet add package MCTUtils.Tacview
Target .NET 8
Version 1.0.1
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 computation
  • DCSRealTimeTelemetry — 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 1.0.1 Shared exceptions and types (ProjectReference)
System.IO.Hashing 8.0.0 CRC32 hash computation
Microsoft.SourceLink.GitHub 8.x Source-level debugging (PrivateAssets)
Product 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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 87 7/15/2026
1.0.0 93 7/15/2026
0.3.2 99 7/9/2026
0.3.0 104 7/9/2026

Initial public release.