extensions/sdktools/extension.h
author Phong Dang <teame06@gmail.com>
Wed Aug 01 07:29:40 2007 +0000 (2007-08-01)
changeset 1241 2e8046793bc9
parent 1239 eed86aca8fae
child 1262 843e9ed0ff29
permissions -rw-r--r--
Added check to make sure player are alive to perform sm_slap, sm_burn, sm_slay.
     1 /**
     2  * vim: set ts=4 :
     3  * ================================================================
     4  * SourceMod SDKTools Extension
     5  * Copyright (C) 2004-2007 AlliedModders LLC.  All rights reserved.
     6  * ================================================================
     7  *
     8  * This program is free software; you can redistribute it and/or 
     9  * modify it under the terms of the GNU General Public License, 
    10  * version 3.0, as published by the Free Software Foundation.
    11  * 
    12  * This program is distributed in the hope that it will be useful,
    13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    15  * GNU General Public License for more details.
    16  *
    17  * You should have received a copy of the GNU General Public License
    18  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
    19  *
    20  * As a special exception, AlliedModders LLC gives you permission to 
    21  * link the code of this program (as well as its derivative works) to 
    22  * "Half-Life 2," the "Source Engine," the "SourcePawn JIT," and any 
    23  * Game MODs that run on software by the Valve Corporation.  You must 
    24  * obey the GNU General Public License in all respects for all other 
    25  * code used. Additionally, AlliedModders LLC grants this exception 
    26  * to all derivative works. AlliedModders LLC defines further 
    27  * exceptions, found in LICENSE.txt (as of this writing, version 
    28  * JULY-31-2007), or <http://www.sourcemod.net/license.php>.
    29  *
    30  * Version: $Id$
    31  */
    32 
    33 #ifndef _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
    34 #define _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
    35 
    36 /**
    37  * @file extension.h
    38  * @brief SDK Tools extension code header.
    39  */
    40 
    41 #include "smsdk_ext.h"
    42 #include <IBinTools.h>
    43 #include <IPlayerHelpers.h>
    44 #include <IGameHelpers.h>
    45 #include <IEngineTrace.h>
    46 #include <IEngineSound.h>
    47 #include <ivoiceserver.h>
    48 #include <iplayerinfo.h>
    49 #include <convar.h>
    50 
    51 /**
    52  * @brief Implementation of the SDK Tools extension.
    53  * Note: Uncomment one of the pre-defined virtual functions in order to use it.
    54  */
    55 class SDKTools : 
    56 	public SDKExtension, 
    57 	public IHandleTypeDispatch,
    58 	public IConCommandBaseAccessor,
    59 	public IClientListener
    60 {
    61 public: //public IHandleTypeDispatch
    62 	void OnHandleDestroy(HandleType_t type, void *object);
    63 public: //public SDKExtension
    64 	virtual bool SDK_OnLoad(char *error, size_t maxlength, bool late);
    65 	virtual void SDK_OnUnload();
    66 	virtual void SDK_OnAllLoaded();
    67 	//virtual void SDK_OnPauseChange(bool paused);
    68 	virtual bool QueryRunning(char *error, size_t maxlength);
    69 	virtual bool QueryInterfaceDrop(SMInterface *pInterface);
    70 	virtual void NotifyInterfaceDrop(SMInterface *pInterface);
    71 public:
    72 #if defined SMEXT_CONF_METAMOD
    73 	virtual bool SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool late);
    74 	//virtual bool SDK_OnMetamodUnload(char *error, size_t maxlen);
    75 	//virtual bool SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlen);
    76 #endif
    77 public: //IConCommandBaseAccessor
    78 	bool RegisterConCommandBase(ConCommandBase *pVar);
    79 public: //IClientListner
    80 	void OnClientDisconnecting(int client);
    81 public: // IVoiceServer
    82 	bool OnSetClientListening(int iReceiver, int iSender, bool bListen);
    83 };
    84 
    85 extern SDKTools g_SdkTools;
    86 /* Interfaces from engine or gamedll */
    87 extern IServerGameEnts *gameents;
    88 extern IEngineTrace *enginetrace;
    89 extern IEngineSound *engsound;
    90 extern INetworkStringTableContainer *netstringtables;
    91 extern IServerPluginHelpers *pluginhelpers;
    92 extern IServerGameClients *serverClients;
    93 extern IVoiceServer *voiceserver;
    94 extern IPlayerInfoManager *playerinfomngr;
    95 /* Interfaces from SourceMod */
    96 extern IBinTools *g_pBinTools;
    97 extern IGameConfig *g_pGameConf;
    98 extern IGameHelpers *g_pGameHelpers;
    99 /* Handle types */
   100 extern HandleType_t g_CallHandle;
   101 extern HandleType_t g_TraceHandle;
   102 
   103 #endif //_INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_