core/sourcemod.h
author David Anderson <dvander@alliedmods.net>
Wed Jan 17 06:49:59 2007 +0000 (2007-01-17)
changeset 308 f0e65f92cb34
parent 289 87ad530d141b
child 315 5f48300aa103
permissions -rw-r--r--
Redesigned how server commands work. The "plugins" command will be back soon.
     1 #ifndef _INCLUDE_SOURCEMOD_GLOBALHEADER_H_
     2 #define _INCLUDE_SOURCEMOD_GLOBALHEADER_H_
     3 
     4 #include "sm_globals.h"
     5 
     6 /**
     7  * @brief Implements SourceMod's global overall management, API, and logic
     8  */
     9 
    10 class SourceModBase
    11 {
    12 public:
    13 	SourceModBase();
    14 public:
    15 	/**
    16 	 * @brief Initializes SourceMod, or returns an error on failure.
    17 	 */
    18 	bool InitializeSourceMod(char *error, size_t err_max, bool late);
    19 
    20 	/** 
    21 	 * @brief Starts everything SourceMod needs to run
    22 	 */
    23 	void StartSourceMod(bool late);
    24 
    25 	/** 
    26 	* @brief Shuts down all SourceMod components
    27 	*/
    28 	void CloseSourceMod();
    29 
    30 	/**
    31 	 * @brief Map change hook
    32 	 */
    33 	bool LevelInit(char const *pMapName, char const *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background);
    34 
    35 	/** 
    36 	 * @brief Returns whether or not a mapload is in progress
    37 	 */
    38 	bool IsMapLoading();
    39 
    40 	/**
    41 	 * @brief Returns the base SourceMod folder.
    42 	 */
    43 	const char *GetSMBaseDir();
    44 
    45 	/**
    46 	 * @brief Returns the base folder for file natives.
    47 	 */
    48 	const char *GetBaseDir();
    49 
    50 	/**
    51 	 * @brief Returns whether our load in this map is late.
    52 	 */
    53 	bool IsLateLoadInMap();
    54 private:
    55 	/**
    56 	 * @brief Loading plugins
    57 	 */
    58 	void DoGlobalPluginLoads();
    59 private:
    60 	char m_SMBaseDir[PLATFORM_MAX_PATH+1];
    61 	bool m_IsMapLoading;
    62 	bool m_IsLateLoadInMap;
    63 };
    64 
    65 extern SourceModBase g_SourceMod;
    66 
    67 #endif //_INCLUDE_SOURCEMOD_GLOBALHEADER_H_