AternosAPI 1.0.3
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 AternosAPI --version 1.0.3
NuGet\Install-Package AternosAPI -Version 1.0.3
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="AternosAPI" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AternosAPI --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: AternosAPI, 1.0.3"
#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.
// Install AternosAPI as a Cake Addin #addin nuget:?package=AternosAPI&version=1.0.3 // Install AternosAPI as a Cake Tool #tool nuget:?package=AternosAPI&version=1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
AternosAPI
Unofficial aternos.org client to control your server(s).
Example usage:
var aternosClient = new AternosClient("<YOUR ATERNOS TOKEN>");
var success = await aternosClient.PrepareAsync();
if (!success) {
Console.WriteLine("Failed to fetch ajax token!");
return;
}
// Auto select server
success = await aternosClient.UpdateServerIdAsync();
if (!success) {
Console.WriteLine("Failed to update sever id!");
return;
}
// Start selected server
success = await aternosClient.StartSelectedServerAsync();
if (!success) {
Console.WriteLine("Failed to start the selected server!");
return;
}
// Stop selected server
success = await aternosClient.StopSelectedServerAsync();
if (!success) {
Console.WriteLine("Failed to stop the selected server!");
return;
}
// Restart selected server
success = await aternosClient.RestartSelectedServerAsync();
if (!success) {
Console.WriteLine("Failed to restart the selected server!");
return;
}
// Change a setting (max player count in this example)
success = await aternosClient.ChangeSelectedServerConfigAsync("/server.properties", "max-players", "50");
if (!success) {
Console.WriteLine("Failed to change config!");
return;
}
// Add a player to a list
success = await aternosClient.AddPlayerToListAsync(AternosList.Whitelist, "test");
if (!success) {
Console.WriteLine("Failed to add player to whitelist!");
return;
}
// Remove a player from a list
success = await aternosClient.RemovePlayerFromListAsync(AternosList.Whitelist, "test");
if (!success) {
Console.WriteLine("Failed to remove player from whitelist!");
return;
}
// Install software
success = await aternosClient.InstallSoftwareAsync("<SOFTWARE ID>", false);
if (!success) {
Console.WriteLine("Failed to install software!");
return;
}
// Install plugin
success = await aternosClient.InstallPluginAsync(AternosPluginProvider.Spigot, "<PLUGIN ID>", "<VERSION ID>");
if (!success) {
Console.WriteLine("Failed to install plugin!");
return;
}
// Delete file
success = await aternosClient.DeleteFileAsync("/plugins/Example.jar");
if (!success) {
Console.WriteLine("Failed to delete file!");
return;
}
// Get AternosLog instance
var log = await aternosClient.GetSelectedServerLogAsync();
if (log == null) {
Console.WriteLine("Failed to fetch log object!");
return;
}
If you want to run the unit tests create a text file called "aternos_token.txt" in your application data directory (%appdata%) with your token inside.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net5.0
- RequesterLib (>= 1.0.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.