core/systems/PluginSys.h
changeset 457 9b8a85bf4175
parent 430 ed37e9767ed4
child 486 c8aa9d25b2c0
     1.1 --- a/core/systems/PluginSys.h	Thu Feb 08 20:37:24 2007 +0000
     1.2 +++ b/core/systems/PluginSys.h	Thu Feb 08 21:41:28 2007 +0000
     1.3 @@ -28,6 +28,7 @@
     1.4  #include "sm_trie.h"
     1.5  #include "sourcemod.h"
     1.6  #include <IRootConsoleMenu.h>
     1.7 +#include "convar_sm.h"
     1.8  
     1.9  using namespace SourceHook;
    1.10  
    1.11 @@ -191,7 +192,7 @@
    1.12  	/**
    1.13  	* Get language file index based on the vector index.
    1.14  	*/
    1.15 -	unsigned int GetFileByIndex(unsigned int index) const;
    1.16 +	unsigned int GetLangFileByIndex(unsigned int index) const;
    1.17  public:
    1.18  	/**
    1.19  	* Returns the modification time during last plugin load.
    1.20 @@ -207,6 +208,21 @@
    1.21  	 * Returns true if the plugin was running, but is now invalid.
    1.22  	 */
    1.23  	bool WasRunning();
    1.24 +
    1.25 +	/**
    1.26 +	 * Adds a convar to the plugin's list
    1.27 +	 */
    1.28 +	void AddConVar(ConVar *convar);
    1.29 +
    1.30 +	/**
    1.31 +	* Get convar count for this plugin.
    1.32 +	*/
    1.33 +	size_t GetConVarCount() const;
    1.34 +
    1.35 +	/**
    1.36 +	* Get convar pointer based on the vector index.
    1.37 +	*/
    1.38 +	ConVar *GetConVarByIndex(size_t index) const;
    1.39  protected:
    1.40  	void UpdateInfo();
    1.41  	void SetTimeStamp(time_t t);
    1.42 @@ -224,6 +240,7 @@
    1.43  	Handle_t m_handle;
    1.44  	bool m_WasRunning;
    1.45  	CVector<unsigned int> m_PhraseFiles;
    1.46 +	CVector<ConVar *> m_ConVarList;
    1.47  };
    1.48  
    1.49  class CPluginManager : 
    1.50 @@ -316,6 +333,14 @@
    1.51  	 */
    1.52  	CPlugin *GetPluginByOrder(int num);
    1.53  
    1.54 +	/** 
    1.55 +	 * Internal version of FindPluginByContext()
    1.56 +	 */
    1.57 +	inline CPlugin *GetPluginByCtx(const sp_context_t *ctx)
    1.58 +	{
    1.59 +		return reinterpret_cast<CPlugin *>(ctx->user[SM_CONTEXTVAR_MYSELF]);
    1.60 +	}
    1.61 +
    1.62  	/**
    1.63  	 * Gets status text for a status code 
    1.64  	 */