2007-01-25 23:36:38 +01:00
|
|
|
/**
|
2007-03-22 22:50:20 +01:00
|
|
|
* vim: set ts=4 :
|
2007-01-25 23:36:38 +01:00
|
|
|
* ===============================================================
|
|
|
|
* SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
|
|
|
|
* ===============================================================
|
|
|
|
*
|
|
|
|
* This file is not open source and may not be copied without explicit
|
|
|
|
* written permission of AlliedModders LLC. This file may not be redistributed
|
|
|
|
* in whole or significant part.
|
|
|
|
* For information, see LICENSE.txt or http://www.sourcemod.net/license.php
|
|
|
|
*
|
|
|
|
* Version: $Id$
|
|
|
|
*/
|
|
|
|
|
2006-11-08 08:32:44 +01:00
|
|
|
#ifndef _INCLUDE_SOURCEMOD_GLOBALS_H_
|
|
|
|
#define _INCLUDE_SOURCEMOD_GLOBALS_H_
|
|
|
|
|
2006-11-08 08:44:26 +01:00
|
|
|
/**
|
|
|
|
* @file Contains global headers that most files in SourceMod will need.
|
|
|
|
*/
|
|
|
|
|
2006-11-08 08:32:44 +01:00
|
|
|
#include <sp_vm_types.h>
|
|
|
|
#include <sp_vm_api.h>
|
|
|
|
#include "sm_platform.h"
|
2007-01-19 06:33:04 +01:00
|
|
|
#include <IShareSys.h>
|
2006-11-08 08:32:44 +01:00
|
|
|
|
|
|
|
using namespace SourcePawn;
|
|
|
|
using namespace SourceMod;
|
|
|
|
|
2007-04-05 05:02:00 +02:00
|
|
|
/**
|
|
|
|
* @brief Lists error codes possible from attempting to set a core configuration option.
|
|
|
|
*/
|
|
|
|
enum CoreConfigErr
|
|
|
|
{
|
|
|
|
CoreConfig_Okay = 0, /**< No error */
|
|
|
|
CoreConfig_NoRuntime = 1, /**< Cannot set config option while SourceMod is running */
|
|
|
|
CoreConfig_InvalidValue = 2, /**< Invalid value specified for config option */
|
|
|
|
CoreConfig_InvalidOption = 3, /**< Invalid config option specified */
|
|
|
|
/* -------------------- */
|
|
|
|
CoreConfig_TOTAL /**< Total number of core config error codes */
|
|
|
|
};
|
|
|
|
|
2006-12-30 00:18:13 +01:00
|
|
|
/**
|
|
|
|
* @brief Any class deriving from this will be automatically initiated/shutdown by SourceMod
|
|
|
|
*/
|
|
|
|
class SMGlobalClass
|
|
|
|
{
|
|
|
|
friend class SourceModBase;
|
2007-04-05 05:02:00 +02:00
|
|
|
friend class CoreConfig;
|
2006-12-30 00:18:13 +01:00
|
|
|
public:
|
|
|
|
SMGlobalClass();
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief Called when SourceMod is initially loading
|
|
|
|
*/
|
|
|
|
virtual void OnSourceModStartup(bool late)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Called after all global classes have initialized
|
|
|
|
*/
|
|
|
|
virtual void OnSourceModAllInitialized()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Called when SourceMod is shutting down
|
|
|
|
*/
|
|
|
|
virtual void OnSourceModShutdown()
|
|
|
|
{
|
|
|
|
}
|
2007-01-11 02:11:24 +01:00
|
|
|
|
|
|
|
/**
|
2007-04-05 05:02:00 +02:00
|
|
|
* @brief Called after SourceMod is completely shut down
|
|
|
|
*/
|
2007-01-11 02:11:24 +01:00
|
|
|
virtual void OnSourceModAllShutdown()
|
|
|
|
{
|
|
|
|
}
|
2007-04-05 05:02:00 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Called when a core config option is changed.
|
|
|
|
* @note This is called once BEFORE OnSourceModStartup() when SourceMod is loading
|
|
|
|
* @note It can then be called again when the 'sm config' command is used
|
|
|
|
*/
|
|
|
|
virtual CoreConfigErr OnSourceModConfigChanged(const char *option, const char *value)
|
|
|
|
{
|
|
|
|
return CoreConfig_InvalidOption;
|
|
|
|
}
|
2006-12-30 00:18:13 +01:00
|
|
|
private:
|
|
|
|
SMGlobalClass *m_pGlobalClassNext;
|
|
|
|
static SMGlobalClass *head;
|
|
|
|
};
|
|
|
|
|
2006-11-08 08:32:44 +01:00
|
|
|
extern ISourcePawnEngine *g_pSourcePawn;
|
|
|
|
extern IVirtualMachine *g_pVM;
|
2007-01-01 20:50:16 +01:00
|
|
|
extern IdentityToken_t *g_pCoreIdent;
|
2006-11-08 08:32:44 +01:00
|
|
|
|
2006-12-30 08:23:17 +01:00
|
|
|
#include "sm_autonatives.h"
|
|
|
|
|
2006-11-08 08:32:44 +01:00
|
|
|
#endif //_INCLUDE_SOURCEMOD_GLOBALS_H_
|