KekUploadServerApi - Plugin API for KekUploadServer in C#
Create a new project in your IDE or with the dotnet CLI.
Add the KekUploadServerApi package to your project.
dotnet add package GamePowerX.KekUploadServerApi
Install-Package GamePowerX.KekUploadServerApi
Create a new class that implements the IPlugin
interface.
using KekUploadServerApi;
using Microsoft.Extensions.Logging;
namespace TestPlugin;
public class TestPlugin : IPlugin
{
private IKekUploadServer _server = null!;
private ILogger<TestPlugin> _logger = null!;
public Task Load(IKekUploadServer server)
{
_server = server;
_logger = _server.GetPluginLogger<TestPlugin>();
return Task.CompletedTask;
}
public Task Start()
{
_logger.LogInformation("TestPlugin started!");
return Task.CompletedTask;
}
public Task Unload()
{
_logger.LogInformation("TestPlugin unloaded!");
return Task.CompletedTask;
}
PluginInfo IPlugin.Info => new()
{
Name = "TestPlugin",
Version = "1.0.0-test",
Author = "GamePowerX",
Description = "A test plugin for KekUploadServer"
};
public void TestMethod()
{
_logger.LogInformation("TestPlugin.TestMethod() called!");
}
}
Build the project with your IDE or with the dotnet CLI.
Copy the plugin dll file into the plugins folder of your KekUploadServer installation.
Start the server and check the console output for errors.
The plugin should now be loaded and you can use it.
You can add dependencies to your plugin by specifying them in the PluginInfo
class.
PluginInfo IPlugin.Info => new() {
Name = "AnotherTestPlugin",
Version = "1.0.0-test",
Author = "GamePowerX",
Description = "Another test plugin for KekUploadServer",
Dependencies = new[]{"TestPlugin"}
};
You can contribute to this project by creating a pull request or by creating an issue.
This project is licensed under the MIT license. See the LICENSE file for more information.