2 * ===============================================================
3 * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
4 * ===============================================================
6 * This file is not open source and may not be copied without explicit
7 * written permission of AlliedModders LLC. This file may not be redistributed
8 * in whole or significant part.
9 * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
14 #ifndef _INCLUDE_SOURCEMOD_GLOBALHEADER_H_
15 #define _INCLUDE_SOURCEMOD_GLOBALHEADER_H_
17 #include "sm_globals.h"
18 #include <ISourceMod.h>
21 * @brief Implements SourceMod's global overall management, API, and logic
24 class SourceModBase : public ISourceMod
30 * @brief Initializes SourceMod, or returns an error on failure.
32 bool InitializeSourceMod(char *error, size_t err_max, bool late);
35 * @brief Starts everything SourceMod needs to run
37 void StartSourceMod(bool late);
40 * @brief Shuts down all SourceMod components
42 void CloseSourceMod();
45 * @brief Map change hook
47 bool LevelInit(char const *pMapName, char const *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background);
50 * @brief Level shutdown hook
55 * @brief Returns whether or not a mapload is in progress
60 * @brief Stores the global target index.
62 void SetGlobalTarget(unsigned int index);
65 * @brief Returns the global target index.
67 unsigned int GetGlobalTarget() const;
70 const char *GetModPath();
71 const char *GetSourceModPath();
72 size_t BuildPath(PathType type, char *buffer, size_t maxlength, char *format, ...);
73 void LogMessage(IExtension *pExt, const char *format, ...);
74 void LogError(IExtension *pExt, const char *format, ...);
75 size_t FormatString(char *buffer, size_t maxlength, IPluginContext *pContext, const cell_t *params, unsigned int param);
78 * @brief Loading plugins
80 void DoGlobalPluginLoads();
82 char m_SMBaseDir[PLATFORM_MAX_PATH+1];
83 char m_SMRelDir[PLATFORM_MAX_PATH+1];
85 bool m_ExecPluginReload;
86 unsigned int m_target;
89 extern SourceModBase g_SourceMod;
91 #endif //_INCLUDE_SOURCEMOD_GLOBALHEADER_H_