core/sourcemod.h
author Borja Ferrer <faluco@alliedmods.net>
Fri Jan 05 00:42:22 2007 +0000 (2007-01-05)
changeset 268 d6fed4f05e07
parent 255 236589ed0c92
child 289 87ad530d141b
permissions -rw-r--r--
Fixed CPlayer init, it was called too early.
nothing important on the logger
     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 Map change hook
    27 	 */
    28 	bool LevelInit(char const *pMapName, char const *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background);
    29 
    30 	/** 
    31 	 * @brief Returns whether or not a mapload is in progress
    32 	 */
    33 	bool IsMapLoading();
    34 
    35 	/**
    36 	 * @brief Returns the base SourceMod folder.
    37 	 */
    38 	const char *GetSMBaseDir();
    39 
    40 	/**
    41 	 * @brief Returns the base folder for file natives.
    42 	 */
    43 	const char *GetBaseDir();
    44 
    45 	/**
    46 	 * @brief Returns whether our load in this map is late.
    47 	 */
    48 	bool IsLateLoadInMap();
    49 private:
    50 	/**
    51 	 * @brief Loading plugins
    52 	 */
    53 	void DoGlobalPluginLoads();
    54 private:
    55 	char m_SMBaseDir[PLATFORM_MAX_PATH+1];
    56 	bool m_IsMapLoading;
    57 	bool m_IsLateLoadInMap;
    58 };
    59 
    60 extern SourceModBase g_SourceMod;
    61 
    62 #endif //_INCLUDE_SOURCEMOD_GLOBALHEADER_H_