Triggered build, something funky happened....
3 * =============================================================================
5 * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
6 * =============================================================================
8 * This program is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU General Public License, version 3.0, as published by the
10 * Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 * You should have received a copy of the GNU General Public License along with
18 * this program. If not, see <http://www.gnu.org/licenses/>.
20 * As a special exception, AlliedModders LLC gives you permission to link the
21 * code of this program (as well as its derivative works) to "Half-Life 2," the
22 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
23 * by the Valve Corporation. You must obey the GNU General Public License in
24 * all respects for all other code used. Additionally, AlliedModders LLC grants
25 * this exception to all derivative works. AlliedModders LLC defines further
26 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
27 * or <http://www.sourcemod.net/license.php>.
32 #ifndef _INCLUDE_SOURCEMOD_GLOBALHEADER_H_
33 #define _INCLUDE_SOURCEMOD_GLOBALHEADER_H_
35 #include "sm_globals.h"
36 #include <ISourceMod.h>
38 #include <sh_vector.h>
39 #include "CDataPack.h"
41 using namespace SourceHook;
44 * @brief Implements SourceMod's global overall management, API, and logic
55 * @brief Initializes SourceMod, or returns an error on failure.
57 bool InitializeSourceMod(char *error, size_t maxlength, bool late);
60 * @brief Starts everything SourceMod needs to run
62 void StartSourceMod(bool late);
65 * @brief Shuts down all SourceMod components
67 void CloseSourceMod();
70 * @brief Map change hook
72 bool LevelInit(char const *pMapName, char const *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background);
75 * @brief Level shutdown hook
80 * @brief Returns whether or not a map load is in progress
82 bool IsMapLoading() const;
85 * @brief Stores the global target index.
87 unsigned int SetGlobalTarget(unsigned int index);
90 * @brief Returns the global target index.
92 unsigned int GetGlobalTarget() const;
93 public: // SMGlobalClass
94 ConfigResult OnSourceModConfigChanged(const char *key,
100 const char *GetGamePath() const;
101 const char *GetSourceModPath() const;
102 size_t BuildPath(PathType type, char *buffer, size_t maxlength, const char *format, ...);
103 void LogMessage(IExtension *pExt, const char *format, ...);
104 void LogError(IExtension *pExt, const char *format, ...);
105 size_t FormatString(char *buffer, size_t maxlength, IPluginContext *pContext, const cell_t *params, unsigned int param);
106 IDataPack *CreateDataPack();
107 void FreeDataPack(IDataPack *pack);
108 HandleType_t GetDataPackHandleType(bool readonly=false);
109 KeyValues *ReadKeyValuesHandle(Handle_t hndl, HandleError *err=NULL, bool root=false);
110 const char *GetGameFolderName() const;
111 ISourcePawnEngine *GetScriptingEngine();
112 IVirtualMachine *GetScriptingVM();
113 void AllPluginsLoaded();
114 time_t GetAdjustedTime();
116 void GlobalUnpause();
117 void DoGlobalPluginLoads();
118 void AddGameFrameHook(GAME_FRAME_HOOK hook);
119 void RemoveGameFrameHook(GAME_FRAME_HOOK hook);
120 void ProcessGameFrameHooks(bool simulating);
122 CStack<CDataPack *> m_freepacks;
123 char m_SMBaseDir[PLATFORM_MAX_PATH];
124 char m_SMRelDir[PLATFORM_MAX_PATH];
127 bool m_ExecPluginReload;
129 unsigned int m_target;
131 CVector<GAME_FRAME_HOOK> m_frame_hooks;
134 extern bool g_Loaded;
135 extern SourceModBase g_SourceMod;
136 extern HandleType_t g_WrBitBufType; //:TODO: find a better place for this
137 extern HandleType_t g_RdBitBufType; //:TODO: find a better place for this
139 #endif //_INCLUDE_SOURCEMOD_GLOBALHEADER_H_