Writing a plug-in
This page is a short guide. The full interface is described in comments in the header pb_plugin.hpp.
What you need
- Visual Studio 2022 with the “Desktop development with C++” workload, and the Windows SDK.
- The ProBoard source tree, or the SDK pack. A plug-in includes ProBoard's own headers (
proboard.hppandpb_plugin.hpp) rather than a separate copy of the data structures. This means a plug-in is built with the same toolchain and from the same sources as ProBoard itself.
The SDK pack
The release comes with three zip files:
| File | Holds |
|---|---|
PBPluginSDK.zip | The headers a plug-in needs. |
PluginTemplate.zip | A starter project. |
SamplePlugin.zip | A minimal working example. |
These are copied only if they are not already there. A new package therefore does not overwrite an SDK you have changed, and it also does not refresh an old one. If you want newer files, copy them from the package yourself.
The entry point
A plug-in exports one function:
extern "C" __declspec(dllexport) int PbPluginMain(const PbHostServices *host, int argc, char **argv);
host is a table of function pointers and read-only state, filled in by ProBoard. argc and argv are the words the sysop put in the menu data. A plug-in should check host→abiVersion against the version it was built with and refuse to run if they differ.
The target extension in the project is .p3x. The file is still a normal DLL.
The sample plug-in
SamplePlugin is the smallest useful plug-in. It greets the current user by name, reports the node number and the interface version, echoes its arguments and writes one line to the ProBoard log. It uses only the host→ functions, never an engine function directly. It is a good place to start.
What the host gives you
By interface version:
| Version | Added |
|---|---|
| 1 | Screen and keyboard input and output. |
| 2 | Time left, and raw caller input and output (carrier, byte-ready, read and send a byte or block). |
| 3 | Reading and posting messages, listing message areas, and starting a file download or upload (used by the offline mail door). |
| 4 | Host calls for a login plug-in: look up and check a caller, apply for an account, leave feedback, page the sysop, count tries (used by PBMatrix). |
| 5 | A RIPscrip call, so a plug-in can draw graphics for a RIP caller. |
Rules
- Do not call ProBoard's own functions. Use only the table you are given.
- Treat the state the host gives you (the user, the configuration, the limits) as read-only.
- Rebuild every plug-in whenever the interface version changes.