ds@783: /**
ds@783: * vim: set ts=4 :
ds@1330: * =============================================================================
dvander@1233: * SourceMod SDKTools Extension
ds@1947: * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
ds@1330: * =============================================================================
ds@783: *
ds@1330: * This program is free software; you can redistribute it and/or modify it under
ds@1330: * the terms of the GNU General Public License, version 3.0, as published by the
ds@1330: * Free Software Foundation.
dvander@1233: *
ds@1330: * This program is distributed in the hope that it will be useful, but WITHOUT
ds@1330: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
ds@1330: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
ds@1330: * details.
dvander@1233: *
ds@1330: * You should have received a copy of the GNU General Public License along with
ds@1330: * this program. If not, see .
dvander@1233: *
ds@1330: * As a special exception, AlliedModders LLC gives you permission to link the
ds@1330: * code of this program (as well as its derivative works) to "Half-Life 2," the
ds@1330: * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
ds@1330: * by the Valve Corporation. You must obey the GNU General Public License in
ds@1330: * all respects for all other code used. Additionally, AlliedModders LLC grants
ds@1330: * this exception to all derivative works. AlliedModders LLC defines further
ds@1330: * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
ds@1330: * or .
ds@783: *
ds@783: * Version: $Id$
ds@783: */
ds@783:
ds@783: #ifndef _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
ds@783: #define _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
ds@783:
ds@783: /**
ds@783: * @file extension.h
ds@783: * @brief SDK Tools extension code header.
ds@783: */
ds@783:
ds@783: #include "smsdk_ext.h"
ds@783: #include
ds@783: #include
faluco@1031: #include
faluco@1075: #include
dvander@1047: #include
teame06@1236: #include
teame06@1239: #include
ds@2051: #include
ds@2051: #include
dvander@1052: #include
faluco@1769: #include
faluco@1769: #include
ds@783:
skamonkey@3280: #if SOURCE_ENGINE >= SE_ORANGEBOX
skamonkey@3280: #include
skamonkey@3280: #endif
skamonkey@3280:
ds@783: /**
ds@783: * @brief Implementation of the SDK Tools extension.
ds@783: * Note: Uncomment one of the pre-defined virtual functions in order to use it.
ds@783: */
dvander@1052: class SDKTools :
dvander@1052: public SDKExtension,
dvander@1052: public IHandleTypeDispatch,
teame06@1235: public IConCommandBaseAccessor,
dvander@1628: public IClientListener,
dvander@1628: public ICommandTargetProcessor
ds@783: {
dvander@1052: public: //public IHandleTypeDispatch
dvander@950: void OnHandleDestroy(HandleType_t type, void *object);
dvander@1052: public: //public SDKExtension
ds@783: virtual bool SDK_OnLoad(char *error, size_t maxlength, bool late);
dvander@950: virtual void SDK_OnUnload();
ds@783: virtual void SDK_OnAllLoaded();
ds@783: //virtual void SDK_OnPauseChange(bool paused);
ds@783: virtual bool QueryRunning(char *error, size_t maxlength);
dvander@1023: virtual bool QueryInterfaceDrop(SMInterface *pInterface);
dvander@1023: virtual void NotifyInterfaceDrop(SMInterface *pInterface);
faluco@1993: virtual void OnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax);
dvander@2790: const char *GetExtensionVerString();
dvander@2790: const char *GetExtensionDateString();
ds@783: public:
ds@783: #if defined SMEXT_CONF_METAMOD
ds@783: virtual bool SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool late);
ds@783: //virtual bool SDK_OnMetamodUnload(char *error, size_t maxlen);
ds@783: //virtual bool SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlen);
ds@783: #endif
dvander@1052: public: //IConCommandBaseAccessor
dvander@1052: bool RegisterConCommandBase(ConCommandBase *pVar);
teame06@1235: public: //IClientListner
pred@2711: void OnClientPutInServer(int client);
teame06@1235: void OnClientDisconnecting(int client);
teame06@1235: public: // IVoiceServer
teame06@1235: bool OnSetClientListening(int iReceiver, int iSender, bool bListen);
dvander@2044: void VoiceInit();
fyrenmoo@2796: #if SOURCE_ENGINE >= SE_ORANGEBOX
fyrenmoo@2796: void OnClientCommand(edict_t *pEntity, const CCommand &args);
fyrenmoo@2796: #else
fyrenmoo@2796: void OnClientCommand(edict_t *pEntity);
fyrenmoo@2796: #endif
fyrenmoo@2796:
dvander@1628: public: //ICommandTargetProcessor
dvander@1628: bool ProcessCommandTarget(cmd_target_info_t *info);
faluco@1262: public:
faluco@1262: bool LevelInit(char const *pMapName, char const *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background);
faluco@1613: void OnServerActivate(edict_t *pEdictList, int edictCount, int clientMax);
ds@783: };
ds@783:
teame06@1235: extern SDKTools g_SdkTools;
ds@1114: /* Interfaces from engine or gamedll */
ds@783: extern IServerGameEnts *gameents;
faluco@1075: extern IEngineTrace *enginetrace;
ds@1114: extern IEngineSound *engsound;
ds@1114: extern INetworkStringTableContainer *netstringtables;
dvander@1169: extern IServerPluginHelpers *pluginhelpers;
faluco@1219: extern IServerGameClients *serverClients;
teame06@1235: extern IVoiceServer *voiceserver;
teame06@1239: extern IPlayerInfoManager *playerinfomngr;
faluco@1560: extern ICvar *icvar;
faluco@1769: extern IServer *iserver;
ds@2400: extern CGlobalVars *gpGlobals;
skamonkey@3280: #if SOURCE_ENGINE >= SE_ORANGEBOX
skamonkey@3280: extern IServerTools *servertools;
skamonkey@3280: #endif
ds@1114: /* Interfaces from SourceMod */
ds@783: extern IBinTools *g_pBinTools;
dvander@950: extern IGameConfig *g_pGameConf;
faluco@1031: extern IGameHelpers *g_pGameHelpers;
ds@1114: /* Handle types */
dvander@950: extern HandleType_t g_CallHandle;
faluco@1075: extern HandleType_t g_TraceHandle;
faluco@1498: /* Call Wrappers */
faluco@1498: extern ICallWrapper *g_pAcceptInput;
faluco@1735: /* Call classes */
faluco@1735: extern SourceHook::CallClass *enginePatch;
faluco@1735: extern SourceHook::CallClass *enginesoundPatch;
faluco@1735:
dvander@2838: extern const char *tools_GetTeamName(int team);
dvander@2838:
ds@2400: #include
ds@2400:
faluco@1735: #define ENGINE_CALL(func) SH_CALL(enginePatch, &IVEngineServer::func)
ds@783:
ds@783: #endif //_INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_