2
0
mirror of https://github.com/rehlds/metamod-r.git synced 2025-01-19 01:58:18 +03:00
metamod-r/metamod/src/plinfo.h

49 lines
1.6 KiB
C
Raw Normal View History

2016-07-26 23:31:47 +07:00
#pragma once
2016-07-04 12:07:29 +06:00
// Flags for plugin to indicate when it can be be loaded/unloaded.
// NOTE: order is crucial, as greater/less comparisons are made.
2016-07-26 23:31:47 +07:00
enum PLUG_LOADTIME
{
2016-07-04 12:07:29 +06:00
PT_NEVER = 0,
2016-07-26 23:31:47 +07:00
PT_STARTUP, // should only be loaded/unloaded at initial hlds execution
2016-07-04 12:07:29 +06:00
PT_CHANGELEVEL, // can be loaded/unloaded between maps
2016-07-26 23:31:47 +07:00
PT_ANYTIME, // can be loaded/unloaded at any time
2016-07-04 12:07:29 +06:00
PT_ANYPAUSE, // can be loaded/unloaded at any time, and can be "paused" during a map
2016-07-26 23:31:47 +07:00
};
2016-07-04 12:07:29 +06:00
// Flags to indicate why the plugin is being unloaded.
2016-07-26 23:31:47 +07:00
enum PL_UNLOAD_REASON
{
2016-07-04 12:07:29 +06:00
PNL_NULL = 0,
PNL_INI_DELETED, // was deleted from plugins.ini
PNL_FILE_NEWER, // file on disk is newer than last load
PNL_COMMAND, // requested by server/console command
PNL_CMD_FORCED, // forced by server/console command
PNL_DELAYED, // delayed from previous request; can't tell origin
2016-07-26 23:31:47 +07:00
// only used for 'real_reason' on MPlugin::unload()
PNL_PLUGIN, // requested by plugin function call
2016-07-04 12:07:29 +06:00
PNL_PLG_FORCED, // forced by plugin function call
2016-07-26 23:31:47 +07:00
PNL_RELOAD, // forced unload by reload()
};
2016-07-04 12:07:29 +06:00
// Information plugin provides about itself.
2016-07-26 23:31:47 +07:00
struct plugin_info_t
{
const char *ifvers; // meta_interface version
const char *name; // full name of plugin
const char *version; // version
2016-07-26 23:31:47 +07:00
const char *date; // date
const char *author; // author name/email
const char *url; // URL
const char *logtag; // log message prefix (unused right now)
PLUG_LOADTIME loadable; // when loadable
PLUG_LOADTIME unloadable; // when unloadable
2016-07-26 23:31:47 +07:00
};
2016-07-26 07:22:47 +07:00
extern plugin_info_t Plugin_info;
2016-07-04 12:07:29 +06:00
// Plugin identifier, passed to all Meta Utility Functions.
2016-07-26 23:31:47 +07:00
typedef plugin_info_t *plid_t;
#define PLID &Plugin_info