3 * ===============================================================
4 * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
5 * ===============================================================
7 * This file is not open source and may not be copied without explicit
8 * written permission of AlliedModders LLC. This file may not be redistributed
9 * in whole or significant part.
10 * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
15 #ifndef _INCLUDE_SOURCEMOD_GLOBALS_H_
16 #define _INCLUDE_SOURCEMOD_GLOBALS_H_
19 * @file Contains global headers that most files in SourceMod will need.
22 #include <sp_vm_types.h>
23 #include <sp_vm_api.h>
24 #include "sm_platform.h"
25 #include <IShareSys.h>
27 using namespace SourcePawn;
28 using namespace SourceMod;
30 class IServerPluginCallbacks;
33 * @brief Lists result codes possible from attempting to set a core configuration option.
37 ConfigResult_Accept = 0, /**< Config option was successfully set */
38 ConfigResult_Reject = 1, /**< Config option was given an invalid value and was rejected */
39 ConfigResult_Ignore = 2 /**< Config option was invalid, but ignored */
43 * @brief Lists possible sources of a config option change
47 ConfigSource_File = 0, /**< Config option was set from config file (core.cfg) */
48 ConfigSource_Console = 1, /**< Config option was set from console command (sm config) */
52 * @brief Any class deriving from this will be automatically initiated/shutdown by SourceMod
56 friend class SourceMod_Core;
57 friend class SourceModBase;
58 friend class CoreConfig;
63 * @brief Called when SourceMod is initially loading
65 virtual void OnSourceModStartup(bool late)
70 * @brief Called after all global classes have initialized
72 virtual void OnSourceModAllInitialized()
77 * @brief Called when SourceMod is shutting down
79 virtual void OnSourceModShutdown()
84 * @brief Called after SourceMod is completely shut down
86 virtual void OnSourceModAllShutdown()
91 * @brief Called when a core config option is changed.
92 * @note This is called once BEFORE OnSourceModStartup() when SourceMod is loading
93 * @note It can then be called again when the 'sm config' command is used
95 virtual ConfigResult OnSourceModConfigChanged(const char *key,
101 return ConfigResult_Ignore;
105 * @brief Called when the level changes.
107 virtual void OnSourceModLevelChange(const char *mapName)
112 * @brief Called after plugins are loaded on mapchange.
114 virtual void OnSourceModPluginsLoaded()
119 * @brief Called when SourceMod receives a pointer to IServerPluginCallbacks from SourceMM
121 virtual void OnSourceModVSPReceived(IServerPluginCallbacks *iface)
125 SMGlobalClass *m_pGlobalClassNext;
126 static SMGlobalClass *head;
129 extern ISourcePawnEngine *g_pSourcePawn;
130 extern IVirtualMachine *g_pVM;
131 extern IdentityToken_t *g_pCoreIdent;
133 #include "sm_autonatives.h"
135 #endif //_INCLUDE_SOURCEMOD_GLOBALS_H_