Introduce integrated package manager

This commit introduces an integrated package manager into TShock
for the purpose of fetching and installing plugins and their dependencies
from NuGet repositories.

This makes getting new plugins easier for users, as well as simplifiying
more advanced deployment scenarios.
This commit is contained in:
Janet Blackquill 2022-10-20 19:15:57 -04:00
parent 4e59087e7c
commit be8e51959f
13 changed files with 849 additions and 8 deletions

View file

@ -84,6 +84,7 @@ Use past tense when adding new entries; sign your name off when you add or chang
* Improved rejection message and code duplication in `OnPlayerBuff` (@drunderscore)
* This will make it so Bouncer rejections regarding `PlayerAddBuff` will now always include the sender index, buff type, receiver index, and time in ticks, allowing much faster triage of buff whitelist issues.
* Allowed Digging Molecart and bomb fish to break tiles and place tracks (@sgkoishi)
* Add built-in package management capabilities for plugins
## TShock 5.1.3
* Added support for Terraria 1.4.4.9 via OTAPI 3.1.20. (@SignatureBeef)

13
docs/packages-help.txt Normal file
View file

@ -0,0 +1,13 @@
Description:
Manage plugins and their requirements
Usage:
TShock.Server [command] [options]
Options:
--version Show version information
-?, -h, --help Show help and usage information
Commands:
sync Install the plugins as specified in the plugins.json

32
docs/packages.md Normal file
View file

@ -0,0 +1,32 @@
TShock supports downloading and installing plugins from NuGet repositories.
This allows it to automatically download the plugin as well as all of the extra things that the plugin needs.
For developers, this makes distributing plugins easier.
This functionality is accessible via the TShock.Server executable used to run the server normally.
Under Linux:
```
./TShock.Server plugins
```
Under Windows (cmd.exe):
```
TShock.Server plugins
```
The documentation for the commands is included in the help functionality.
A copy of the help output in English can be found in [packages-help.txt](packages-help.txt).
This file primarily exists to document the `packages.json`.
The file format is currently simple, including only a single object, containing a key `packages` that has a map of package IDs to their versions.
An example `packages.json` is shown below:
```
{
"packages": {
"Commandy.20.10.22.Test": "0.0.1"
}
}
```
The name of the plugin is specified as the key, with the version as the value.