2006-11-08 07:30:20 +01:00
|
|
|
#ifndef _INCLUDE_SOURCEMOD_GLOBALHEADER_H_
|
|
|
|
#define _INCLUDE_SOURCEMOD_GLOBALHEADER_H_
|
|
|
|
|
2006-11-08 08:32:44 +01:00
|
|
|
#include "sm_globals.h"
|
2007-01-19 03:14:50 +01:00
|
|
|
#include <ISourceMod.h>
|
2006-11-08 07:30:20 +01:00
|
|
|
|
2006-11-08 08:44:26 +01:00
|
|
|
/**
|
|
|
|
* @brief Implements SourceMod's global overall management, API, and logic
|
|
|
|
*/
|
|
|
|
|
2007-01-19 03:14:50 +01:00
|
|
|
class SourceModBase : public ISourceMod
|
2006-11-08 08:32:44 +01:00
|
|
|
{
|
2006-12-13 12:16:20 +01:00
|
|
|
public:
|
|
|
|
SourceModBase();
|
2006-11-08 08:32:44 +01:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief Initializes SourceMod, or returns an error on failure.
|
|
|
|
*/
|
|
|
|
bool InitializeSourceMod(char *error, size_t err_max, bool late);
|
2006-12-13 12:16:20 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Starts everything SourceMod needs to run
|
|
|
|
*/
|
|
|
|
void StartSourceMod(bool late);
|
|
|
|
|
2007-01-13 05:28:13 +01:00
|
|
|
/**
|
|
|
|
* @brief Shuts down all SourceMod components
|
|
|
|
*/
|
|
|
|
void CloseSourceMod();
|
|
|
|
|
2006-12-13 12:16:20 +01:00
|
|
|
/**
|
|
|
|
* @brief Map change hook
|
|
|
|
*/
|
|
|
|
bool LevelInit(char const *pMapName, char const *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background);
|
|
|
|
|
2007-01-20 03:12:53 +01:00
|
|
|
/**
|
|
|
|
* @brief Level shutdown hook
|
|
|
|
*/
|
|
|
|
void LevelShutdown();
|
|
|
|
|
2006-12-13 12:16:20 +01:00
|
|
|
/**
|
|
|
|
* @brief Returns whether or not a mapload is in progress
|
|
|
|
*/
|
|
|
|
bool IsMapLoading();
|
|
|
|
|
2007-01-19 03:14:50 +01:00
|
|
|
public: //ISourceMod
|
|
|
|
const char *GetModPath();
|
|
|
|
const char *GetSourceModPath();
|
|
|
|
size_t BuildPath(PathType type, char *buffer, size_t maxlength, char *format, ...);
|
|
|
|
void LogMessage(IExtension *pExt, const char *format, ...);
|
|
|
|
void LogError(IExtension *pExt, const char *format, ...);
|
2006-12-13 12:16:20 +01:00
|
|
|
private:
|
|
|
|
/**
|
|
|
|
* @brief Loading plugins
|
|
|
|
*/
|
|
|
|
void DoGlobalPluginLoads();
|
|
|
|
private:
|
|
|
|
char m_SMBaseDir[PLATFORM_MAX_PATH+1];
|
|
|
|
bool m_IsMapLoading;
|
2007-01-20 03:12:53 +01:00
|
|
|
bool m_ExecPluginReload;
|
2006-12-15 14:38:04 +01:00
|
|
|
};
|
|
|
|
|
2006-11-08 08:32:44 +01:00
|
|
|
extern SourceModBase g_SourceMod;
|
2006-11-08 07:30:20 +01:00
|
|
|
|
|
|
|
#endif //_INCLUDE_SOURCEMOD_GLOBALHEADER_H_
|