diff options
| author | info@mode42.com <info@mode42.com> | 2026-08-09 11:54:17 +0000 |
|---|---|---|
| committer | info@mode42.com <info@mode42.com> | 2026-08-09 11:54:17 +0000 |
| commit | a989bd16c40e04bba5a5404b0ef0cd22f19d2707 (patch) | |
| tree | 604a0439c7d8c022cbd483d62bdc2cfc1c8d18f8 /include/hybbx/plugin.h | |
| parent | a72e5ea7558e5172c08d397d6f1e0e0f9273e694 (diff) | |
now including entertain/chess
Diffstat (limited to 'include/hybbx/plugin.h')
| -rw-r--r-- | include/hybbx/plugin.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/hybbx/plugin.h b/include/hybbx/plugin.h index ea72a65..9a51211 100644 --- a/include/hybbx/plugin.h +++ b/include/hybbx/plugin.h @@ -9,6 +9,7 @@ extern "C" { struct hybbx_service; struct hybbx_session; +struct hybbx_parsed_command; /** * Transport plugin interface (link adapters / host-client bridges). @@ -19,6 +20,10 @@ struct hybbx_session; * Core uses TCP/IPv4+IPv6 and HBX internally. Plugins terminate the wire * to external services (telnet TCP, serial TNC, ARDOP host TCP, …) and * expose a byte stream to hybbx_session via the write callback. + * + * Optional extensions (NULL = not used): + * tick — called every ~1s from service loop (game clocks, AI, …) + * on_command — intercept "/verb" before core dispatch (entertainment, …) */ typedef struct hybbx_transport_plugin { const char *name; @@ -48,6 +53,21 @@ typedef struct hybbx_transport_plugin { hybbx_result_t (*write)(struct hybbx_session *session, const char *data, size_t len); + /** + * Periodic tick — called every ~1 second from the service loop. + * NULL → no periodic work. Used by game clocks, AI timers, etc. + */ + void (*tick)(struct hybbx_service *service); + + /** + * Command intercept — called before core command dispatch. + * Return HYBBX_OK if handled, HYBBX_ERR_NOT_FOUND to fall through. + * NULL → no command handling. + */ + hybbx_result_t (*on_command)(struct hybbx_service *service, + struct hybbx_session *session, + const struct hybbx_parsed_command *cmd); + } hybbx_transport_plugin_t; /** |
