IPlugin Interface Documentation
The IPlugin
interface is the core contract that all plugins
must implement to integrate with Melon.
Interface Definition
public interface IPlugin
{
string Name { get; }
string Version { get; }
string Authors { get; }
string Description { get; }
IHost Host { get; set; }
IWebApi WebApi { get; set; }
Dictionary<string, string> GetHelpOptions();
void LoadMelonCommands(IHost host);
void LoadMelonServerCommands(IWebApi webapi);
int LoadUI();
int UnloadUI();
int Execute();
int Destroy();
}
Properties
- Name: Name of the plugin.
- Version: Version number.
- Authors: Comma-separated list of authors.
- Description: Brief description.
- Host: Provides access to Melon's host services.
- WebApi: Provides access to Melon's web API.
Methods
-
GetHelpOptions():
- Returns command-line options and descriptions.
-
LoadMelonCommands(IHost host):
- Called to initialize the plugin with the Melon host.
-
LoadMelonServerCommands(IWebApi webapi):
- Called to initialize the plugin with the Melon web API.
-
LoadUI():
- Load UI elements into Melon.
-
Returns: An integer indicating success
(
0
) or failure.
-
UnloadUI():
- Remove UI elements from Melon.
-
Returns: An integer indicating success
(
0
) or failure.
-
Execute():
- Start any background processes or middleware.
-
Returns: An integer indicating success
(
0
) or failure.
-
Destroy():
- Clean up resources and stop processes.
-
Returns: An integer indicating success
(
0
) or failure.