2
0
mirror of https://github.com/rehlds/metamod-r.git synced 2025-02-06 18:42:18 +03:00

49 lines
1.7 KiB
C
Raw Normal View History

2016-07-26 23:31:47 +07:00
#pragma once
#include "mplugin.h" // class MPlugin
2016-07-26 23:31:47 +07:00
#include "plinfo.h" // plid_t, etc
2016-07-26 07:22:47 +07:00
2016-07-26 23:31:47 +07:00
2016-07-26 07:22:47 +07:00
// Width required to printf above MAX, for show() functions.
#define WIDTH_MAX_PLUGINS 2
2017-06-26 18:10:34 +03:00
typedef std::list<MPlugin *> plugins_t;
2016-07-26 07:22:47 +07:00
// A list of plugins.
2017-05-09 18:34:55 +03:00
class MPluginList
{
2016-07-26 23:31:47 +07:00
public:
2017-05-09 19:31:09 +03:00
MPluginList(const char* ifile);
2016-07-26 23:31:47 +07:00
2017-06-26 18:10:34 +03:00
plugins_t* getPlugins();
2017-05-09 19:31:09 +03:00
MPlugin* find(int pindex); // find by index
MPlugin* find(const char* findpath); // find by pathname
MPlugin* find(plid_t id); // find by plid_t
MPlugin* find_memloc(void* memptr); // find by memory location
MPlugin* find_match(const char* prefix, bool& unique); // find by partial prefix match
MPlugin* find_match(MPlugin* pmatch); // find by platform_match()
MPlugin* find(module_handle_t handle); // find by handle
MPlugin* add(MPlugin* padd);
2016-07-26 23:31:47 +07:00
2016-07-30 02:03:01 +03:00
bool found_child_plugins(int source_index) const;
2016-07-26 23:31:47 +07:00
2017-05-09 19:31:09 +03:00
bool ini_startup(); // read inifile at startup
bool ini_refresh(); // re-read inifile
bool cmd_addload(const char* args); // load from console command
MPlugin* plugin_addload(plid_t plid, const char* fname, PLUG_LOADTIME now); //load from plugin
bool load(); // load the list, at startup
bool refresh(PLUG_LOADTIME now); // update from re-read inifile
void unpause_all(); // unpause any paused plugins
void retry_all(PLUG_LOADTIME now); // retry any pending plugin actions
void show(int source_index = 0); // list plugins to console
void show_client(edict_t* pEntity); // list plugins to player client
2016-07-26 23:31:47 +07:00
void clear_source_plugin_index(int source_index);
private:
2017-06-26 18:10:34 +03:00
size_t m_last_index;
plugins_t m_plugins; // array of plugins
2017-05-09 19:31:09 +03:00
char m_inifile[PATH_MAX]; // full pathname
2016-07-26 07:22:47 +07:00
};