aboutsummaryrefslogtreecommitdiff
path: root/doc/plugins.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/plugins.md')
-rw-r--r--doc/plugins.md24
1 files changed, 15 insertions, 9 deletions
diff --git a/doc/plugins.md b/doc/plugins.md
index 5417446..dc91957 100644
--- a/doc/plugins.md
+++ b/doc/plugins.md
@@ -1,10 +1,12 @@
# Plugins
+
mt-multiserver-proxy loads all plugin files in the `plugins` directory
on startup. Any errors will be logged and do not prevent other plugins
from being loaded. Plugins **cannot** be (re)loaded at runtime, you
need to restart the proxy.
## Installing plugins
+
The recommended way to install plugins is cd'ing into the `plugins` directory,
downloading the source code (e.g. using `git clone`) into it
and starting the proxy without setting the `NoAutoPlugins` config option
@@ -14,9 +16,8 @@ The proxy will detect its own version automatically
and attempt to build the plugin against it, making this the easiest way
for end users to deal with versioning.
-This won't work in development builds.
-
### Manual installation
+
To install a plugin manually, clone the repository, cd into it and run:
```
@@ -27,6 +28,7 @@ A .so file will be created. Copy or move this file into the `plugins`
directory. Restart the proxy to load the plugin.
### Automatic version management
+
To make dealing with version issues easier for end users
the `mt-build-plugin` tool is provided. It automatically detects
the correct proxy version and builds the plugin in the working directory
@@ -39,6 +41,7 @@ mt-build-plugin
```
## Developing plugins
+
A plugin is simply a main package without a main function. Use the init
functions instead. Plugins can import
`github.com/HimbeerserverDE/mt-multiserver-proxy` and use the exported
@@ -49,6 +52,7 @@ Crucially, symbols may be renamed or deleted and fields may be deleted
from type definitions.**
## Common issues
+
If mt-multiserver-proxy prints an error similar to this:
```
@@ -74,6 +78,15 @@ My build environment can be found in
[build_env.md](https://github.com/HimbeerserverDE/mt-multiserver-proxy/blob/main/doc/build_env.md).
## Using plugins with development builds
+
+The `mt-build-plugin` tool as well as the proxy itself are capable of
+handling development versions, but the former only works if it's located
+in the same directory as the proxy executable. See
+[Automatic version management](https://github.com/HimbeerserverDE/mt-multiserver-proxy/blob/main/doc/plugins.md#automatic-version-management)
+for details.
+
+### Manual version management
+
You can build a development version by following the instructions in
[README.md](https://github.com/HimbeerserverDE/mt-multiserver-proxy/blob/main/README.md#development-builds).
@@ -84,10 +97,3 @@ edit the go.mod file of your plugin. Find the line that says
and copy everything excluding the `require `. Then append a new line:
`replace github.com/HimbeerserverDE/mt-multiserver-proxy SOMEVERSION => ../path/to/proxy/repo/`.
Now rebuild and install the plugin and it should be loaded.
-
-### Automatic development version management
-The `mt-build-plugin` tool as well as the proxy itself are capable of
-handling development versions, but the former only works if it's located
-in the same directory as the proxy executable. See
-[Automatic version management](https://github.com/HimbeerserverDE/mt-multiserver-proxy/blob/main/doc/plugins.md#automatic-version-management)
-for details.