add a little more plugin options for people who make plugins that need to be auto loaded.

This commit is contained in:
KingKDot
2026-07-31 01:47:07 -05:00
parent 486944b111
commit 76e0bc77c0
8 changed files with 59 additions and 24 deletions
+4 -2
View File
@@ -37,8 +37,8 @@ export default {
ctx.log.info("server plugin started");
},
async onEvent(ctx, event) {
ctx.log.info(`plugin event from ${event.clientId}`);
async onEvent(ctx, clientId, event, payload) {
ctx.log.info(`${event} from ${clientId}: ${JSON.stringify(payload)}`);
},
rpc: {
@@ -53,6 +53,8 @@ export default {
};
```
`onEvent` receives events emitted by that plugin's client module.
## The `ctx` Object
| Field | Description |