From 7e531d78bf330bfac65cf3f208c2300b607decee Mon Sep 17 00:00:00 2001 From: Trumeet Date: Sun, 16 May 2021 19:23:13 -0700 Subject: First Commit --- plugins.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 plugins.h (limited to 'plugins.h') diff --git a/plugins.h b/plugins.h new file mode 100644 index 0000000..bb2948d --- /dev/null +++ b/plugins.h @@ -0,0 +1,45 @@ +/* + * Copyright 2019 ~ 2021 YuutaW Minecraft, All Rights Reserved. + * Proprietary and confidential. + * Unauthorized copying of any parts of this file, via any medium is strictly prohibited. + * Written by Yuuta Liang , April 2021. + */ + +#ifndef _PLUGINS_H +#define _PLUGINS_H + +#include "plugin/plugin.h" + +struct plugin_call_job_args { + int id; + char *arg1; + char *arg2; + char *arg3; + char *arg4; + char *arg5; +}; + +struct plugin { + int id; + const char *path; + void *handle; + char *name; + uint32_t version; + int (*fc_load)(struct epg_handle *); + int (*fc_unload)(struct epg_handle *); + int (*fc_player_join)(struct epg_handle *, char *); + int (*fc_player_leave)(struct epg_handle *, char *, char *); + int (*fc_player_say)(struct epg_handle *, char *, char *); + int (*fc_player_die)(struct epg_handle *, char *, char *); + int (*fc_player_achievement)(struct epg_handle *, char *, char *); + int (*fc_player_challenge)(struct epg_handle *, char *, char *); + int (*fc_player_goal)(struct epg_handle *, char *, char *); + int (*fc_server_stopping)(struct epg_handle *); + int (*fc_server_starting)(struct epg_handle *, char *); + int (*fc_server_started)(struct epg_handle *, char *); +}; + +int plugin_load(int stderr_fd, const char *path, const int id, struct plugin *out); +int plugin_unload(int stderr_fd, struct plugin *plugin); + +#endif // _PLUGINS_H -- cgit v1.2.3