ManiaAPI.XmlRpc
2.9.2
See the version list below for details.
dotnet add package ManiaAPI.XmlRpc --version 2.9.2
NuGet\Install-Package ManiaAPI.XmlRpc -Version 2.9.2
<PackageReference Include="ManiaAPI.XmlRpc" Version="2.9.2" />
<PackageVersion Include="ManiaAPI.XmlRpc" Version="2.9.2" />
<PackageReference Include="ManiaAPI.XmlRpc" />
paket add ManiaAPI.XmlRpc --version 2.9.2
#r "nuget: ManiaAPI.XmlRpc, 2.9.2"
#:package ManiaAPI.XmlRpc@2.9.2
#addin nuget:?package=ManiaAPI.XmlRpc&version=2.9.2
#tool nuget:?package=ManiaAPI.XmlRpc&version=2.9.2
ManiaAPI.XmlRpc
Integrates the GBXRemote (XML-RPC) communication used between controllers and servers.
Both versions (GBXRemote 2 and GBXRemote 1) are supported.
This solution tries to be lightweight and compatible with as many Nadeo games as possible. For a better strongly-typed GBXRemote, use the GbxRemote.Net library.
This package is still experimental, the API can change drastically.
Usage
using ManiaAPI.XmlRpc;
await using var client = await XmlRpcClient.ConnectAsync("127.0.0.1");
object authenticationResult = await client.CallAsync("Authenticate", ["SuperAdmin", "SuperAdmin"]);
if (authenticationResult is not true)
{
throw new Exception("Authentication failed.");
}
string gameDataDirectory = await client.CallAsync<string>("GameDataDirectory");
Console.WriteLine($"Game data directory: {gameDataDirectory}");
For callbacks:
bool enableCallbacksResult = await client.CallAsync<bool>("EnableCallbacks", true);
if (!enableCallbacksResult)
{
throw new Exception("Failed to enable callbacks.");
}
// Subscribe to callbacks
client.Callback += async (methodName, methodParams, cancellationToken) =>
{
Console.WriteLine($"{methodName}: {string.Join(", ", methodParams)}");
};
client.On("TrackMania.PlayerConnect", async (methodParams, cancellationToken) =>
{
// ...
});
// Keep the connection until the server closes it
await client.WaitForCloseAsync();
Resilience
XmlRpcClient communicates over a raw TCP connection. Wrap ConnectAsync with a Polly pipeline to retry on transient connection failures:
using ManiaAPI.XmlRpc;
using Polly;
using Polly.Retry;
var pipeline = new ResiliencePipelineBuilder()
.AddRetry(new RetryStrategyOptions
{
MaxRetryAttempts = 5,
BackoffType = DelayBackoffType.Exponential
})
.Build();
await using var client = await pipeline.ExecuteAsync(async token =>
await XmlRpcClient.ConnectAsync("127.0.0.1", 5000, cancellationToken: token));
| 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 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 is compatible. 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. |
-
net10.0
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.2)
- MinimalXmlReader (>= 0.2.1)
- TmEssentials (>= 2.6.0)
-
net8.0
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.2)
- MinimalXmlReader (>= 0.2.1)
- TmEssentials (>= 2.6.0)
-
net9.0
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.2)
- MinimalXmlReader (>= 0.2.1)
- TmEssentials (>= 2.6.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.