core/PluginSys.h
author David Anderson <dvander@alliedmods.net>
Thu Mar 05 02:06:59 2009 -0500 (2009-03-05)
changeset 2653 0ae7d8ab1de7
parent 2547 5917289f3c73
child 2675 1502dc625325
permissions -rw-r--r--
Removed -dev tag for release.
dvander@370
     1
/**
ds@653
     2
 * vim: set ts=4 :
ds@1330
     3
 * =============================================================================
dvander@1231
     4
 * SourceMod
ds@1947
     5
 * Copyright (C) 2004-2008 AlliedModders LLC.  All rights reserved.
ds@1330
     6
 * =============================================================================
dvander@370
     7
 *
ds@1330
     8
 * This program is free software; you can redistribute it and/or modify it under
ds@1330
     9
 * the terms of the GNU General Public License, version 3.0, as published by the
ds@1330
    10
 * Free Software Foundation.
dvander@1231
    11
 * 
ds@1330
    12
 * This program is distributed in the hope that it will be useful, but WITHOUT
ds@1330
    13
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
ds@1330
    14
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
ds@1330
    15
 * details.
dvander@1231
    16
 *
ds@1330
    17
 * You should have received a copy of the GNU General Public License along with
ds@1330
    18
 * this program.  If not, see <http://www.gnu.org/licenses/>.
dvander@1231
    19
 *
ds@1330
    20
 * As a special exception, AlliedModders LLC gives you permission to link the
ds@1330
    21
 * code of this program (as well as its derivative works) to "Half-Life 2," the
ds@1330
    22
 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
ds@1330
    23
 * by the Valve Corporation.  You must obey the GNU General Public License in
ds@1330
    24
 * all respects for all other code used.  Additionally, AlliedModders LLC grants
ds@1330
    25
 * this exception to all derivative works.  AlliedModders LLC defines further
ds@1330
    26
 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
ds@1330
    27
 * or <http://www.sourcemod.net/license.php>.
dvander@370
    28
 *
dvander@370
    29
 * Version: $Id$
dvander@370
    30
 */
dvander@370
    31
dvander@173
    32
#ifndef _INCLUDE_SOURCEMOD_PLUGINSYSTEM_H_
dvander@173
    33
#define _INCLUDE_SOURCEMOD_PLUGINSYSTEM_H_
dvander@173
    34
dvander@211
    35
#include <time.h>
faluco@333
    36
#include <errno.h>
faluco@333
    37
#include <sys/stat.h>
dvander@173
    38
#include <IPluginSys.h>
dvander@220
    39
#include <IHandleSys.h>
ds@611
    40
#include <IForwardSys.h>
dvander@174
    41
#include <sh_list.h>
dvander@174
    42
#include <sh_stack.h>
faluco@389
    43
#include <sh_vector.h>
dvander@601
    44
#include <sh_string.h>
dvander@173
    45
#include "sm_globals.h"
dvander@203
    46
#include "PluginInfoDatabase.h"
dvander@211
    47
#include "sm_trie.h"
dvander@220
    48
#include "sourcemod.h"
dvander@309
    49
#include <IRootConsoleMenu.h>
ds@2400
    50
#if SOURCE_ENGINE == SE_LEFT4DEAD
ds@2400
    51
#include "convar_sm_l4d.h"
ds@2400
    52
#elif SOURCE_ENGINE == SE_ORANGEBOX
faluco@1541
    53
#include "convar_sm_ob.h"
faluco@1541
    54
#else
ds@457
    55
#include "convar_sm.h"
faluco@1541
    56
#endif
dvander@2042
    57
#include "ITranslator.h"
dvander@2086
    58
#include "NativeOwner.h"
dvander@2086
    59
#include "ShareSys.h"
dvander@173
    60
dvander@2547
    61
class CPlayer;
dvander@2547
    62
dvander@174
    63
using namespace SourceHook;
dvander@174
    64
dvander@209
    65
/**
dvander@209
    66
 * NOTES:
dvander@209
    67
 *
dvander@1923
    68
 * UPDATE 2008-03-11: These comments are horribly out of date.  They paint a good overall 
dvander@1923
    69
 * picture of how PluginSys works, but things like dependencies and fake natives have 
dvander@1923
    70
 * complicated things quite a bit.
dvander@1923
    71
 *
dvander@209
    72
 *  Currently this system needs a lot of work but it's good skeletally.  Plugin creation 
dvander@209
    73
 * is done without actually compiling anything.  This is done by Load functions in the 
dvander@209
    74
 * manager.  This will need a rewrite when we add context switching.
dvander@209
    75
 *
dvander@209
    76
 *  The plugin object itself has a few things to note.  The most important is that it stores
dvander@209
    77
 * a table of function objects.  The manager marshals allocation and freeing of these objects.
dvander@209
    78
 * The plugin object can be in erroneous states, they are:
dvander@209
    79
 *   Plugin_Error   --> Some error occurred any time during or after compilation.
dvander@209
    80
 *						This error can be cleared since the plugin itself is valid.
dvander@209
    81
 *						However, the state itself being set prevents any runtime action.
dvander@209
    82
 *   Plugin_BadLoad	--> The plugin failed to load entirely and nothing can be done to save it.
dvander@209
    83
 *
dvander@209
    84
 *  If a plugin fails to load externally, it is never added to the internal tracker.  However, 
dvander@209
    85
 * plugins that failed to load from the internal loading mechanism are always tracked.  This 
dvander@209
    86
 * allows users to see which automatically loaded plugins failed, and makes the interface a bit
dvander@209
    87
 * more flexible.
dvander@211
    88
 *
dvander@211
    89
 *  Once a plugin is compiled, it sets its own state to Plugin_Created.  This state is still invalid
dvander@211
    90
 * for execution.  SourceMod is a two pass system, and even though the second pass is not implemented
dvander@211
    91
 * yet, it is structured so Plugin_Created must be switched to Plugin_Running in the second pass.  When
dvander@211
    92
 * implemented, a Created plugin will be switched to Error in the second pass if it not loadable.
dvander@211
    93
 *
dvander@211
    94
 *  The two pass loading mechanism is described below.  Modules/natives are not implemented yet.
dvander@211
    95
 * PASS ONE: All loadable plugins are found and have the following steps performed:
dvander@211
    96
 *			 1.  Loading and compilation is attempted.
dvander@211
    97
 *			 2.  If successful, all natives from Core are added.
dvander@211
    98
 *			 3.  OnPluginLoad() is called.
dvander@211
    99
 *			 4.  If failed, any user natives are scrapped and the process halts here.
dvander@211
   100
 *			 5.  If successful, the plugin is ready for Pass 2.
dvander@211
   101
 * INTERMEDIATE:
dvander@211
   102
 *			 1.  All forced modules are loaded.
dvander@211
   103
 * PASS TWO: All loaded plugins are found and have these steps performed:
dvander@211
   104
 *			 1. Any modules referenced in the plugin that are not already loaded, are loaded.
dvander@211
   105
 *			 2. If any module fails to load and the plugin requires it, load fails and jump to step 6.
dvander@211
   106
 *			 3. If any natives are unresolved, check if they are found in the user-natives pool.
dvander@211
   107
 *			 4. If yes, load succeeds.  If not, natives are passed through a native acceptance filter.
dvander@211
   108
 *			 5. If the filter fails, the plugin is marked as failed.
dvander@211
   109
 *			 6. If the plugin has failed to load at this point, any dynamic natives it has added are scrapped.
dvander@211
   110
 *			    Furthermore, any plugin that referenced these natives must now have pass 2 re-ran.
dvander@211
   111
 * PASS THREE (not a real pass):
ds@426
   112
 *			 7. Once all plugins are deemed to be loaded, OnPluginStart() is called
dvander@209
   113
 */
dvander@209
   114
faluco@383
   115
enum LoadRes
faluco@383
   116
{
faluco@383
   117
	LoadRes_Successful,
faluco@383
   118
	LoadRes_AlreadyLoaded,
dvander@1436
   119
	LoadRes_Failure,
dvander@1436
   120
	LoadRes_NeverLoad
faluco@383
   121
};
faluco@383
   122
dvander@978
   123
struct AutoConfig
dvander@978
   124
{
dvander@978
   125
	String autocfg;
dvander@978
   126
	String folder;
dvander@978
   127
	bool create;
dvander@978
   128
};
dvander@978
   129
faluco@1112
   130
class CPlugin;
faluco@1112
   131
dvander@2086
   132
class CPlugin : 
dvander@2086
   133
	public IPlugin,
dvander@2086
   134
	public CNativeOwner
dvander@173
   135
{
dvander@174
   136
	friend class CPluginManager;
dvander@176
   137
	friend class CFunction;
dvander@173
   138
public:
dvander@209
   139
	CPlugin(const char *file);
dvander@209
   140
	~CPlugin();
dvander@209
   141
public:
faluco@641
   142
	PluginType GetType();
faluco@641
   143
	SourcePawn::IPluginContext *GetBaseContext();
faluco@641
   144
	sp_context_t *GetContext();
dvander@2193
   145
	void *GetPluginStructure();
faluco@641
   146
	const char *GetFilename();
faluco@641
   147
	bool IsDebugging();
faluco@641
   148
	PluginStatus GetStatus();
dvander@2193
   149
	const sm_plugininfo_t *GetPublicInfo();
faluco@641
   150
	bool SetPauseState(bool paused);
faluco@641
   151
	unsigned int GetSerial();
faluco@641
   152
	IdentityToken_t *GetIdentity();
dvander@1766
   153
	unsigned int CalcMemUsage();
faluco@641
   154
	bool SetProperty(const char *prop, void *ptr);
faluco@641
   155
	bool GetProperty(const char *prop, void **ptr, bool remove=false);
dvander@2086
   156
	void DropEverything();
dvander@2193
   157
	SourcePawn::IPluginRuntime *GetRuntime();
dvander@173
   158
public:
dvander@209
   159
	/**
dvander@209
   160
	 * Creates a plugin object with default values.
dvander@209
   161
	 *   If an error buffer is specified, and an error occurs, the error will be copied to the buffer
dvander@209
   162
	 * and NULL will be returned.
dvander@209
   163
	 *   If an error buffer is not specified, the error will be copied to an internal buffer and 
dvander@209
   164
	 * a valid (but error-stated) CPlugin will be returned.
dvander@209
   165
	 */
dvander@209
   166
	static CPlugin *CreatePlugin(const char *file, char *error, size_t maxlength);
dvander@209
   167
public:
dvander@229
   168
dvander@209
   169
	/**
dvander@209
   170
	 * Sets an error state on the plugin
dvander@209
   171
	 */
dvander@209
   172
	void SetErrorState(PluginStatus status, const char *error_fmt, ...);
dvander@211
   173
dvander@211
   174
	/**
dvander@229
   175
	 * Initializes the plugin's identity information
dvander@229
   176
	 */
dvander@229
   177
	void InitIdentity();
dvander@229
   178
dvander@229
   179
	/**
dvander@211
   180
	 * Calls the OnPluginLoad function, and sets any failed states if necessary.
dvander@211
   181
	 * NOTE: Valid pre-states are: Plugin_Created
dvander@282
   182
	 * NOTE: If validated, plugin state is changed to Plugin_Loaded
dvander@211
   183
	 *
dvander@211
   184
	 * If the error buffer is NULL, the error message is cached locally.
dvander@211
   185
	 */
dvander@211
   186
	bool Call_AskPluginLoad(char *error, size_t maxlength);
dvander@211
   187
dvander@211
   188
	/**
ds@426
   189
	 * Calls the OnPluginStart function.
dvander@211
   190
	 * NOTE: Valid pre-states are: Plugin_Created
dvander@282
   191
	 * NOTE: Post-state will be Plugin_Running
dvander@211
   192
	 */
ds@426
   193
	void Call_OnPluginStart();
dvander@282
   194
dvander@282
   195
	/**
ds@426
   196
	 * Calls the OnPluginEnd function.
dvander@282
   197
	 */
ds@426
   198
	void Call_OnPluginEnd();
faluco@290
   199
faluco@290
   200
	/**
faluco@1221
   201
	 * Calls the OnAllPluginsLoaded function.
faluco@1221
   202
	 */
faluco@1221
   203
	void Call_OnAllPluginsLoaded();
faluco@1221
   204
faluco@1221
   205
	/**
dvander@315
   206
	 * Returns true if a plugin is usable.
dvander@315
   207
	 */
dvander@615
   208
	bool IsRunnable();
faluco@389
   209
faluco@389
   210
	/**
dvander@2042
   211
	 * Get languages info.
dvander@536
   212
	 */
dvander@2042
   213
	IPhraseCollection *GetPhrases();
dvander@211
   214
public:
faluco@333
   215
	/**
dvander@536
   216
	 * Returns the modification time during last plugin load.
dvander@536
   217
	 */
dvander@615
   218
	time_t GetTimeStamp();
faluco@333
   219
faluco@333
   220
	/**
dvander@536
   221
	 * Returns the current modification time of the plugin file.
dvander@536
   222
	 */
faluco@333
   223
	time_t GetFileTimeStamp();
dvander@282
   224
dvander@282
   225
	/** 
dvander@282
   226
	 * Returns true if the plugin was running, but is now invalid.
dvander@282
   227
	 */
dvander@282
   228
	bool WasRunning();
dvander@536
   229
dvander@536
   230
	Handle_t GetMyHandle();
dvander@978
   231
dvander@2086
   232
	bool AddFakeNative(IPluginFunction *pFunc, const char *name, SPVM_FAKENATIVE_FUNC func);
dvander@978
   233
	void AddConfig(bool autoCreate, const char *cfg, const char *folder);
dvander@978
   234
	unsigned int GetConfigCount();
dvander@978
   235
	AutoConfig *GetConfig(unsigned int i);
faluco@1112
   236
	inline void AddLibrary(const char *name)
faluco@1089
   237
	{
faluco@1112
   238
		m_Libraries.push_back(name);
faluco@1089
   239
	}
dvander@1124
   240
	void LibraryActions(bool dropping);
dvander@2342
   241
	void SyncMaxClients(int max_clients);
dvander@173
   242
protected:
dvander@2342
   243
	bool UpdateInfo();
faluco@333
   244
	void SetTimeStamp(time_t t);
dvander@605
   245
	void DependencyDropped(CPlugin *pOwner);
dvander@173
   246
private:
dvander@174
   247
	PluginType m_type;
ds@652
   248
	char m_filename[PLATFORM_MAX_PATH];
dvander@173
   249
	PluginStatus m_status;
dvander@173
   250
	unsigned int m_serial;
dvander@173
   251
	sm_plugininfo_t m_info;
dvander@209
   252
	char m_errormsg[256];
dvander@211
   253
	time_t m_LastAccess;
dvander@229
   254
	IdentityToken_t *m_ident;
dvander@220
   255
	Handle_t m_handle;
dvander@282
   256
	bool m_WasRunning;
dvander@2042
   257
	IPhraseCollection *m_pPhrases;
faluco@1112
   258
	List<String> m_RequiredLibs;
faluco@1112
   259
	List<String> m_Libraries;
dvander@486
   260
	Trie *m_pProps;
dvander@605
   261
	bool m_FakeNativesMissing;
faluco@1112
   262
	bool m_LibraryMissing;
dvander@978
   263
	CVector<AutoConfig *> m_configs;
dvander@1630
   264
	bool m_bGotAllLoaded;
dvander@2105
   265
	int m_FileVersion;
dvander@2105
   266
	char m_DateTime[256];
dvander@2193
   267
	IPluginRuntime *m_pRuntime;
dvander@2193
   268
	IPluginContext *m_pContext;
dvander@2342
   269
	sp_pubvar_t *m_MaxClientsVar;
dvander@601
   270
};
dvander@601
   271
dvander@220
   272
class CPluginManager : 
dvander@220
   273
	public IPluginManager,
dvander@220
   274
	public SMGlobalClass,
dvander@309
   275
	public IHandleTypeDispatch,
dvander@309
   276
	public IRootConsoleCommand
dvander@174
   277
{
dvander@176
   278
	friend class CPlugin;
dvander@174
   279
public:
dvander@174
   280
	CPluginManager();
dvander@176
   281
	~CPluginManager();
dvander@174
   282
public:
dvander@203
   283
	/* Implements iterator class */
dvander@174
   284
	class CPluginIterator : public IPluginIterator
dvander@174
   285
	{
dvander@174
   286
	public:
dvander@213
   287
		CPluginIterator(List<CPlugin *> *mylist);
dvander@174
   288
		virtual ~CPluginIterator();
dvander@174
   289
		virtual bool MorePlugins();
dvander@174
   290
		virtual IPlugin *GetPlugin();
dvander@174
   291
		virtual void NextPlugin();
dvander@282
   292
		void Release();
dvander@174
   293
	public:
dvander@174
   294
		void Reset();
dvander@174
   295
	private:
dvander@213
   296
		List<CPlugin *> *mylist;
dvander@213
   297
		List<CPlugin *>::iterator current;
dvander@174
   298
	};
dvander@174
   299
	friend class CPluginManager::CPluginIterator;
dvander@203
   300
public: //IPluginManager
dvander@282
   301
	IPlugin *LoadPlugin(const char *path, 
dvander@174
   302
								bool debug,
dvander@174
   303
								PluginType type,
dvander@174
   304
								char error[],
ds@755
   305
								size_t maxlength,
faluco@383
   306
								bool *wasloaded);
dvander@282
   307
	bool UnloadPlugin(IPlugin *plugin);
dvander@282
   308
	IPlugin *FindPluginByContext(const sp_context_t *ctx);
dvander@282
   309
	unsigned int GetPluginCount();
dvander@282
   310
	IPluginIterator *GetPluginIterator();
dvander@282
   311
	void AddPluginsListener(IPluginsListener *listener);
dvander@282
   312
	void RemovePluginsListener(IPluginsListener *listener);
dvander@220
   313
public: //SMGlobalClass
dvander@282
   314
	void OnSourceModAllInitialized();
dvander@282
   315
	void OnSourceModShutdown();
dvander@2342
   316
	void OnSourceModMaxPlayersChanged(int newvalue);
dvander@220
   317
public: //IHandleTypeDispatch
dvander@282
   318
	void OnHandleDestroy(HandleType_t type, void *object);
dvander@1766
   319
	bool GetHandleApproxSize(HandleType_t type, void *object, unsigned int *pSize);
dvander@309
   320
public: //IRootConsoleCommand
faluco@1541
   321
	void OnRootConsoleCommand(const char *cmdname, const CCommand &command);
dvander@190
   322
public:
dvander@203
   323
	/**
dvander@211
   324
	 * Loads all plugins not yet loaded
dvander@203
   325
	 */
dvander@211
   326
	void LoadAll_FirstPass(const char *config, const char *basedir);
dvander@211
   327
dvander@211
   328
	/**
dvander@211
   329
	 * Runs the second loading pass for all plugins
dvander@211
   330
	 */
dvander@211
   331
	void LoadAll_SecondPass();
dvander@203
   332
dvander@203
   333
	/**
dvander@203
   334
	 * Tests a plugin file mask against a local folder.
dvander@203
   335
	 * The alias is searched backwards from localdir - i.e., given this input:
dvander@203
   336
	 *   csdm/ban        csdm/ban
dvander@203
   337
	 *   ban             csdm/ban
dvander@203
   338
	 *   csdm/ban        optional/csdm/ban
dvander@203
   339
	 * All of these will return true for an alias match.  
dvander@203
   340
	 * Wildcards are allowed in the filename.
dvander@203
   341
	 */
dvander@209
   342
	bool TestAliasMatch(const char *alias, const char *localdir);
dvander@211
   343
dvander@211
   344
	/** 
dvander@211
   345
	 * Returns whether anything loaded will be a late load.
dvander@211
   346
	 */
faluco@290
   347
	bool IsLateLoadTime() const;
dvander@233
   348
dvander@233
   349
	/**
dvander@247
   350
	 * Converts a Handle to an IPlugin if possible.
dvander@247
   351
	 */
dvander@247
   352
	IPlugin *PluginFromHandle(Handle_t handle, HandleError *err);
faluco@290
   353
faluco@290
   354
	/**
dvander@309
   355
	 * Finds a plugin based on its index. (starts on index 1)
dvander@309
   356
	 */
faluco@290
   357
	CPlugin *GetPluginByOrder(int num);
dvander@309
   358
dvander@1638
   359
	int GetOrderOfPlugin(IPlugin *pl);
dvander@1638
   360
ds@457
   361
	/** 
ds@457
   362
	 * Internal version of FindPluginByContext()
ds@457
   363
	 */
dvander@2193
   364
	CPlugin *GetPluginByCtx(const sp_context_t *ctx);
ds@457
   365
dvander@309
   366
	/**
dvander@309
   367
	 * Gets status text for a status code 
dvander@309
   368
	 */
dvander@309
   369
	const char *GetStatusText(PluginStatus status);
dvander@315
   370
faluco@333
   371
	/**
faluco@333
   372
	* Reload or update plugins on level shutdown.
faluco@333
   373
	*/
faluco@333
   374
	void ReloadOrUnloadPlugins();
faluco@333
   375
ds@611
   376
	/**
ds@611
   377
	 * Add public functions from all running or paused
ds@611
   378
	 * plugins to the specified forward if the names match.
ds@611
   379
	 */
ds@611
   380
	void AddFunctionsToForward(const char *name, IChangeableForward *pForward);
ds@611
   381
faluco@1221
   382
	/**
faluco@1221
   383
	 * Iterates through plugins to call OnAllPluginsLoaded.
faluco@1221
   384
	 */
faluco@1221
   385
	void AllPluginsLoaded();
faluco@1221
   386
dvander@900
   387
	CPlugin *GetPluginFromIdentity(IdentityToken_t *pToken);
dvander@900
   388
dvander@1018
   389
	void Shutdown();
dvander@1018
   390
dvander@1572
   391
	void OnLibraryAction(const char *lib, bool is_a_plugin, bool drop);
dvander@1124
   392
dvander@1124
   393
	bool LibraryExists(const char *lib);
faluco@1348
   394
faluco@1348
   395
	bool ReloadPlugin(CPlugin *pl);
dvander@1630
   396
dvander@1630
   397
	void UnloadAll();
dvander@1902
   398
dvander@1902
   399
	CPlugin *FindPluginByConsoleArg(const char *arg);
dvander@2342
   400
dvander@2342
   401
	void SyncMaxClients(int max_clients);
dvander@2547
   402
dvander@2547
   403
	void ListPluginsToClient(CPlayer *player, const CCommand &args);
dvander@209
   404
private:
ds@755
   405
	LoadRes _LoadPlugin(CPlugin **pPlugin, const char *path, bool debug, PluginType type, char error[], size_t maxlength);
dvander@298
   406
dvander@298
   407
	void LoadAutoPlugin(const char *plugin);
dvander@298
   408
dvander@209
   409
	/**
dvander@209
   410
	 * Recursively loads all plugins in the given directory.
dvander@209
   411
	 */
dvander@209
   412
	void LoadPluginsFromDir(const char *basedir, const char *localdir);
dvander@209
   413
dvander@209
   414
	/**
dvander@211
   415
	 * Adds a plugin object.  This is wrapped by LoadPlugin functions.
dvander@211
   416
	 */
dvander@211
   417
	void AddPlugin(CPlugin *pPlugin);
dvander@211
   418
dvander@211
   419
	/**
dvander@211
   420
	 * Runs the second loading pass on a plugin.
dvander@209
   421
	 */
dvander@298
   422
	bool RunSecondPass(CPlugin *pPlugin, char *error, size_t maxlength);
dvander@211
   423
dvander@211
   424
	/**
dvander@315
   425
	 * Runs an extension pass on a plugin.
dvander@315
   426
	 */
dvander@315
   427
	bool LoadOrRequireExtensions(CPlugin *pPlugin, unsigned int pass, char *error, size_t maxlength);
faluco@430
   428
faluco@1112
   429
	/**
faluco@1112
   430
	* Manages required natives.
faluco@1112
   431
	*/
faluco@1112
   432
	bool FindOrRequirePluginDeps(CPlugin *pPlugin, char *error, size_t maxlength);
faluco@1112
   433
faluco@430
   434
	void _SetPauseState(CPlugin *pPlugin, bool pause);
dvander@174
   435
protected:
dvander@209
   436
	/**
dvander@209
   437
	 * Caching internal objects
dvander@209
   438
	 */
dvander@174
   439
	void ReleaseIterator(CPluginIterator *iter);
dvander@900
   440
public:
dvander@229
   441
	inline IdentityToken_t *GetIdentity()
dvander@229
   442
	{
dvander@229
   443
		return m_MyIdent;
dvander@229
   444
	}
dvander@601
   445
private:
faluco@1112
   446
	void TryRefreshDependencies(CPlugin *pOther);
dvander@174
   447
private:
dvander@174
   448
	List<IPluginsListener *> m_listeners;
dvander@213
   449
	List<CPlugin *> m_plugins;
dvander@174
   450
	CStack<CPluginManager::CPluginIterator *> m_iters;
dvander@203
   451
	CPluginInfoDatabase m_PluginInfo;
dvander@211
   452
	Trie *m_LoadLookup;
dvander@211
   453
	bool m_AllPluginsLoaded;
dvander@229
   454
	IdentityToken_t *m_MyIdent;
dvander@601
   455
dvander@601
   456
	/* Dynamic native stuff */
dvander@601
   457
	List<FakeNative *> m_Natives;
dvander@601
   458
dvander@1630
   459
	bool m_LoadingLocked;
dvander@174
   460
};
dvander@174
   461
dvander@211
   462
extern CPluginManager g_PluginSys;
dvander@174
   463
dvander@173
   464
#endif //_INCLUDE_SOURCEMOD_PLUGINSYSTEM_H_