1.1 --- a/core/sourcemod.h Fri Mar 28 06:21:34 2008 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,134 +0,0 @@
1.4 -/**
1.5 - * vim: set ts=4 :
1.6 - * =============================================================================
1.7 - * SourceMod
1.8 - * Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
1.9 - * =============================================================================
1.10 - *
1.11 - * This program is free software; you can redistribute it and/or modify it under
1.12 - * the terms of the GNU General Public License, version 3.0, as published by the
1.13 - * Free Software Foundation.
1.14 - *
1.15 - * This program is distributed in the hope that it will be useful, but WITHOUT
1.16 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
1.17 - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
1.18 - * details.
1.19 - *
1.20 - * You should have received a copy of the GNU General Public License along with
1.21 - * this program. If not, see <http://www.gnu.org/licenses/>.
1.22 - *
1.23 - * As a special exception, AlliedModders LLC gives you permission to link the
1.24 - * code of this program (as well as its derivative works) to "Half-Life 2," the
1.25 - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
1.26 - * by the Valve Corporation. You must obey the GNU General Public License in
1.27 - * all respects for all other code used. Additionally, AlliedModders LLC grants
1.28 - * this exception to all derivative works. AlliedModders LLC defines further
1.29 - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
1.30 - * or <http://www.sourcemod.net/license.php>.
1.31 - *
1.32 - * Version: $Id$
1.33 - */
1.34 -
1.35 -#ifndef _INCLUDE_SOURCEMOD_GLOBALHEADER_H_
1.36 -#define _INCLUDE_SOURCEMOD_GLOBALHEADER_H_
1.37 -
1.38 -#include "sm_globals.h"
1.39 -#include <ISourceMod.h>
1.40 -#include <sh_stack.h>
1.41 -#include "CDataPack.h"
1.42 -
1.43 -using namespace SourceHook;
1.44 -
1.45 -/**
1.46 - * @brief Implements SourceMod's global overall management, API, and logic
1.47 - */
1.48 -
1.49 -class SourceModBase :
1.50 - public ISourceMod,
1.51 - public SMGlobalClass
1.52 -{
1.53 -public:
1.54 - SourceModBase();
1.55 -public:
1.56 - /**
1.57 - * @brief Initializes SourceMod, or returns an error on failure.
1.58 - */
1.59 - bool InitializeSourceMod(char *error, size_t maxlength, bool late);
1.60 -
1.61 - /**
1.62 - * @brief Starts everything SourceMod needs to run
1.63 - */
1.64 - void StartSourceMod(bool late);
1.65 -
1.66 - /**
1.67 - * @brief Shuts down all SourceMod components
1.68 - */
1.69 - void CloseSourceMod();
1.70 -
1.71 - /**
1.72 - * @brief Map change hook
1.73 - */
1.74 - bool LevelInit(char const *pMapName, char const *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background);
1.75 -
1.76 - /**
1.77 - * @brief Level shutdown hook
1.78 - */
1.79 - void LevelShutdown();
1.80 -
1.81 - /**
1.82 - * @brief Returns whether or not a map load is in progress
1.83 - */
1.84 - bool IsMapLoading() const;
1.85 -
1.86 - /**
1.87 - * @brief Stores the global target index.
1.88 - */
1.89 - unsigned int SetGlobalTarget(unsigned int index);
1.90 -
1.91 - /**
1.92 - * @brief Returns the global target index.
1.93 - */
1.94 - unsigned int GetGlobalTarget() const;
1.95 -public: // SMGlobalClass
1.96 - ConfigResult OnSourceModConfigChanged(const char *key,
1.97 - const char *value,
1.98 - ConfigSource source,
1.99 - char *error,
1.100 - size_t maxlength);
1.101 -public: // ISourceMod
1.102 - const char *GetGamePath() const;
1.103 - const char *GetSourceModPath() const;
1.104 - size_t BuildPath(PathType type, char *buffer, size_t maxlength, const char *format, ...);
1.105 - void LogMessage(IExtension *pExt, const char *format, ...);
1.106 - void LogError(IExtension *pExt, const char *format, ...);
1.107 - size_t FormatString(char *buffer, size_t maxlength, IPluginContext *pContext, const cell_t *params, unsigned int param);
1.108 - IDataPack *CreateDataPack();
1.109 - void FreeDataPack(IDataPack *pack);
1.110 - HandleType_t GetDataPackHandleType(bool readonly=false);
1.111 - KeyValues *ReadKeyValuesHandle(Handle_t hndl, HandleError *err=NULL, bool root=false);
1.112 - const char *GetGameFolderName() const;
1.113 - ISourcePawnEngine *GetScriptingEngine();
1.114 - IVirtualMachine *GetScriptingVM();
1.115 - void AllPluginsLoaded();
1.116 - time_t GetAdjustedTime();
1.117 - void GlobalPause();
1.118 - void GlobalUnpause();
1.119 - void DoGlobalPluginLoads();
1.120 -private:
1.121 - CStack<CDataPack *> m_freepacks;
1.122 - char m_SMBaseDir[PLATFORM_MAX_PATH];
1.123 - char m_SMRelDir[PLATFORM_MAX_PATH];
1.124 - char m_ModDir[32];
1.125 - bool m_IsMapLoading;
1.126 - bool m_ExecPluginReload;
1.127 - bool m_ExecOnMapEnd;
1.128 - unsigned int m_target;
1.129 - bool m_GotBasePath;
1.130 -};
1.131 -
1.132 -extern bool g_Loaded;
1.133 -extern SourceModBase g_SourceMod;
1.134 -extern HandleType_t g_WrBitBufType; //:TODO: find a better place for this
1.135 -extern HandleType_t g_RdBitBufType; //:TODO: find a better place for this
1.136 -
1.137 -#endif //_INCLUDE_SOURCEMOD_GLOBALHEADER_H_