ManiaAPI.Xml.Extensions.Hosting 2.5.0

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

ManiaAPI.Xml.Extensions.Hosting

NuGet

Provides an efficient way to inject all XML services into your application.

Setup for TMUF

using ManiaAPI.Xml.Extensions.Hosting;

builder.Services.AddMasterServerTMUF();

Setup for ManiaPlanet

using ManiaAPI.Xml.Extensions.Hosting;

builder.Services.AddMasterServerMP4();

You can now inject MasterServerMP4, as long as you're fine relying on Maniaplanet relay 2 to continue running, and use it without additional steps. Compression is enabled.

If you want to have better control over the selection of master servers, use this setup:

using ManiaAPI.Xml.Extensions.Hosting;

builder.Services.AddMasterServerMP4();

// --------------------
// Do the setup
var factory = provider.GetRequiredService<IMasterServerMP4Factory>();

// RequestWaitingParamsAsync should run at the start of your application, and when you need to refresh the master servers
var waitingParams = await factory.RequestWaitingParamsAsync();

// For example selects the first available master server (more overloads are available)
var masterServer = factory.CreateClient();

Features this setup brings:

  • You can inject IMasterServerMP4Factory to create multiple instances of MasterServerMP4 with different master servers and refresh them
  • You can inject MasterServerMP4 to get a default instance using Maniaplanet relay 2
  • You can inject InitServerMP4 to get the init server
  • All MasterServerMP4 handle GZIP compression

Setup for TMT

using ManiaAPI.Xml.Extensions.Hosting;

// Register the services
builder.Services.AddMasterServerTMT();

// --------------------
// Do the setup
var factory = provider.GetRequiredService<IMasterServerTMTFactory>();

// RequestWaitingParamsAsync should run at the start of your application, and when you need to refresh the master servers
await factory.RequestWaitingParamsAsync();

// For example selects the PC master server
var masterServerPC = factory.CreateClient(Platform.PC);

Features this last setup brings:

  • You can inject AggregatedMasterServerTMT to conveniently work with all master servers
  • You can inject IMasterServerTMTFactory to create multiple instances of MasterServerTMT with different master servers
  • You can inject ImmutableDictionary<Platform, MasterServerTMT> to get all master servers as individual instances
  • If you don't need specific platform context, you can inject IEnumerable<MasterServerTMT> to get all master servers
  • Specific InitServerTMT and MasterServerTMT can be injected using [FromKeyedServices(Platform.PC)]
  • All MasterServerTMT handle GZIP compression

If you just inject MasterServerTMT alone, it will give the last-registered one (in this case, PS4). If you need a specific platform, use [FromKeyedServices(...)].

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 is compatible.  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
2.5.0 160 10/16/2025
2.4.0 357 9/18/2025
2.2.0 388 4/6/2025