SRVPro Plguins
SRVPro also support plugins for extending its functions. Developing plugins for SRVPro is highly recommended.
How to use a plugin
All installed plugins should be put in ./plugins
directory. A plugin could be a single js
file, or an entire Node package.
If the plugin to install is a...
- Single JS file: Just simply place the
js
file into./plugins
. - Node package: Clone the entire repository into
./plugins
directory. You may have to follow the instructions of the plugin's documents.
Sample plugins
Here are some sample plugins. All the plugins listed here were written in Node packages by Nanahira, and licensed under AGPL v3.
You may directly install those plugins into your server, or take those plugins as reference to make your own SRVPro plugins.
- https://github.com/purerosefallen/srvpro-coolq A QQ bot for SRVPro room list or card testing, using CoolQ HTTP SDK.
- https://github.com/purerosefallen/srvpro-pre-compat A plugin for compating pre-release cards, allowing players with official cards or pre-release cards have no trouble dueling with each other.
- https://github.com/purerosefallen/srvpro-side-restrict An SRVPro plguin, restricting changing side. This may be useful for specific tournaments.
Making your own plguins
Making a plugin for SRVPro is very simple. You may make up an entire Node package, or write a single js
file.
Entry point
If you are developing a plugin as a Node package, make sure the package.json
is inside your repository, in which the value of main
should be the entry point.
Global variables
You may access those global variables provided by SRVPro for your convenience.
-
_
The underscore library. -
log
The bunyan logger.