ManiaAPI.GBXRemote
2.10.1
dotnet add package ManiaAPI.GBXRemote --version 2.10.1
NuGet\Install-Package ManiaAPI.GBXRemote -Version 2.10.1
<PackageReference Include="ManiaAPI.GBXRemote" Version="2.10.1" />
<PackageVersion Include="ManiaAPI.GBXRemote" Version="2.10.1" />
<PackageReference Include="ManiaAPI.GBXRemote" />
paket add ManiaAPI.GBXRemote --version 2.10.1
#r "nuget: ManiaAPI.GBXRemote, 2.10.1"
#:package ManiaAPI.GBXRemote@2.10.1
#addin nuget:?package=ManiaAPI.GBXRemote&version=2.10.1
#tool nuget:?package=ManiaAPI.GBXRemote&version=2.10.1
ManiaAPI.GBXRemote
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.
Migration from ManiaAPI.XmlRpc
Replace the package reference with ManiaAPI.GBXRemote and use the ManiaAPI.GBXRemote namespace. Types use the GBXRemote prefix in place of XmlRpc:
| Previous name | New name |
|---|---|
XmlRpcClient |
GBXRemoteClient |
XmlRpcCall |
GBXRemoteCall |
XmlRpcCallResult |
GBXRemoteCallResult |
XmlRpcCallback |
GBXRemoteCallback |
XmlRpcCallbackMessage |
GBXRemoteCallbackMessage |
Method names and the wire protocol are unchanged.
Usage
using ManiaAPI.GBXRemote;
await using var client = await GBXRemoteClient.ConnectAsync("127.0.0.1");
try
{
await client.CallAsync("Authenticate", ["SuperAdmin", "SuperAdmin"]);
}
catch (GBXRemoteFaultException ex)
{
Console.WriteLine($"Authentication failed: {ex.FaultString} ({ex.FaultCode})");
return;
}
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
GBXRemoteClient communicates over a raw TCP connection. Add Microsoft.Extensions.Resilience and wrap ConnectAsync in a retry pipeline to handle transient connection failures:
using ManiaAPI.GBXRemote;
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 GBXRemoteClient.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. net11.0 is compatible. |
-
net10.0
- Microsoft.Extensions.Logging.Abstractions (>= 11.0.0)
- MinimalXmlReader (>= 0.2.1)
- TmEssentials (>= 2.9.0)
-
net11.0
- MinimalXmlReader (>= 0.2.1)
- TmEssentials (>= 2.9.0)
-
net8.0
- Microsoft.Extensions.Logging.Abstractions (>= 11.0.0)
- MinimalXmlReader (>= 0.2.1)
- TmEssentials (>= 2.9.0)
-
net9.0
- Microsoft.Extensions.Logging.Abstractions (>= 11.0.0)
- MinimalXmlReader (>= 0.2.1)
- TmEssentials (>= 2.9.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
- Updated TmEssentials to 2.9.0