2007-05-13 08:37:38 +02:00
|
|
|
/**
|
|
|
|
* vim: set ts=4 :
|
2007-08-01 04:48:11 +02:00
|
|
|
* ================================================================
|
|
|
|
* SourceMod SDKTools Extension
|
|
|
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
|
|
|
* ================================================================
|
2007-05-13 08:37:38 +02:00
|
|
|
*
|
2007-08-01 04:48:11 +02:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License,
|
|
|
|
* version 3.0, as published by the Free Software Foundation.
|
|
|
|
*
|
2007-05-13 08:37:38 +02:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2007-08-01 04:48:11 +02:00
|
|
|
*
|
2007-05-13 08:37:38 +02:00
|
|
|
* You should have received a copy of the GNU General Public License
|
2007-08-01 04:48:11 +02:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* As a special exception, AlliedModders LLC gives you permission to
|
|
|
|
* link the code of this program (as well as its derivative works) to
|
|
|
|
* "Half-Life 2," the "Source Engine," the "SourcePawn JIT," and any
|
|
|
|
* Game MODs that run on software by the Valve Corporation. You must
|
|
|
|
* obey the GNU General Public License in all respects for all other
|
|
|
|
* code used. Additionally, AlliedModders LLC grants this exception
|
|
|
|
* to all derivative works. AlliedModders LLC defines further
|
|
|
|
* exceptions, found in LICENSE.txt (as of this writing, version
|
|
|
|
* JULY-31-2007), or <http://www.sourcemod.net/license.php>.
|
2007-05-13 08:37:38 +02:00
|
|
|
*
|
|
|
|
* Version: $Id$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
|
|
|
|
#define _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file extension.h
|
|
|
|
* @brief SDK Tools extension code header.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "smsdk_ext.h"
|
|
|
|
#include <IBinTools.h>
|
|
|
|
#include <IPlayerHelpers.h>
|
2007-07-02 02:25:46 +02:00
|
|
|
#include <IGameHelpers.h>
|
2007-07-08 21:39:19 +02:00
|
|
|
#include <IEngineTrace.h>
|
2007-07-07 19:46:17 +02:00
|
|
|
#include <IEngineSound.h>
|
2007-08-01 06:17:36 +02:00
|
|
|
#include <IVoiceServer.h>
|
2007-07-07 22:45:48 +02:00
|
|
|
#include <convar.h>
|
2007-05-13 08:37:38 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Implementation of the SDK Tools extension.
|
|
|
|
* Note: Uncomment one of the pre-defined virtual functions in order to use it.
|
|
|
|
*/
|
2007-07-07 22:45:48 +02:00
|
|
|
class SDKTools :
|
|
|
|
public SDKExtension,
|
|
|
|
public IHandleTypeDispatch,
|
2007-08-01 06:17:36 +02:00
|
|
|
public IConCommandBaseAccessor,
|
|
|
|
public IClientListener
|
2007-05-13 08:37:38 +02:00
|
|
|
{
|
2007-07-07 22:45:48 +02:00
|
|
|
public: //public IHandleTypeDispatch
|
2007-06-16 10:36:34 +02:00
|
|
|
void OnHandleDestroy(HandleType_t type, void *object);
|
2007-07-07 22:45:48 +02:00
|
|
|
public: //public SDKExtension
|
2007-05-13 08:37:38 +02:00
|
|
|
virtual bool SDK_OnLoad(char *error, size_t maxlength, bool late);
|
2007-06-16 10:36:34 +02:00
|
|
|
virtual void SDK_OnUnload();
|
2007-05-13 08:37:38 +02:00
|
|
|
virtual void SDK_OnAllLoaded();
|
|
|
|
//virtual void SDK_OnPauseChange(bool paused);
|
|
|
|
virtual bool QueryRunning(char *error, size_t maxlength);
|
2007-06-27 01:11:13 +02:00
|
|
|
virtual bool QueryInterfaceDrop(SMInterface *pInterface);
|
|
|
|
virtual void NotifyInterfaceDrop(SMInterface *pInterface);
|
2007-05-13 08:37:38 +02:00
|
|
|
public:
|
|
|
|
#if defined SMEXT_CONF_METAMOD
|
|
|
|
virtual bool SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool late);
|
|
|
|
//virtual bool SDK_OnMetamodUnload(char *error, size_t maxlen);
|
|
|
|
//virtual bool SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlen);
|
|
|
|
#endif
|
2007-07-07 22:45:48 +02:00
|
|
|
public: //IConCommandBaseAccessor
|
|
|
|
bool RegisterConCommandBase(ConCommandBase *pVar);
|
2007-08-01 06:17:36 +02:00
|
|
|
public: //IClientListner
|
|
|
|
void OnClientDisconnecting(int client);
|
|
|
|
public: // IVoiceServer
|
|
|
|
bool OnSetClientListening(int iReceiver, int iSender, bool bListen);
|
2007-05-13 08:37:38 +02:00
|
|
|
};
|
|
|
|
|
2007-08-01 06:17:36 +02:00
|
|
|
extern SDKTools g_SdkTools;
|
2007-07-15 09:44:17 +02:00
|
|
|
/* Interfaces from engine or gamedll */
|
2007-05-13 08:37:38 +02:00
|
|
|
extern IServerGameEnts *gameents;
|
2007-07-08 21:39:19 +02:00
|
|
|
extern IEngineTrace *enginetrace;
|
2007-07-15 09:44:17 +02:00
|
|
|
extern IEngineSound *engsound;
|
|
|
|
extern INetworkStringTableContainer *netstringtables;
|
2007-07-25 22:23:34 +02:00
|
|
|
extern IServerPluginHelpers *pluginhelpers;
|
2007-07-31 04:08:25 +02:00
|
|
|
extern IServerGameClients *serverClients;
|
2007-08-01 06:17:36 +02:00
|
|
|
extern IVoiceServer *voiceserver;
|
2007-07-15 09:44:17 +02:00
|
|
|
/* Interfaces from SourceMod */
|
2007-05-13 08:37:38 +02:00
|
|
|
extern IBinTools *g_pBinTools;
|
2007-06-16 10:36:34 +02:00
|
|
|
extern IGameConfig *g_pGameConf;
|
2007-07-02 02:25:46 +02:00
|
|
|
extern IGameHelpers *g_pGameHelpers;
|
2007-07-15 09:44:17 +02:00
|
|
|
/* Handle types */
|
2007-07-08 21:39:19 +02:00
|
|
|
extern HandleType_t g_CallHandle;
|
|
|
|
extern HandleType_t g_TraceHandle;
|
2007-05-13 08:37:38 +02:00
|
|
|
|
|
|
|
#endif //_INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
|