Add SourceHook support.

This commit is contained in:
KyleSanderson
2014-01-11 12:43:28 -07:00
parent 1b90424449
commit c38642ce51
4 changed files with 15 additions and 3 deletions
+6
View File
@@ -24,6 +24,7 @@ PROJECT = SteamWorks
#Uncomment for Metamod: Source enabled extension
#USEMETA = true
USESH = true
OBJECTS = sdk/smsdk_ext.cpp extension.cpp swgameserver.cpp swgamedata.cpp swforwards.cpp gsnatives.cpp
@@ -127,6 +128,11 @@ ifeq "$(USEMETA)" "true"
-DSE_PORTAL2=11 -DSE_CSGO=12
endif
ifeq "$(USESH)" "true"
INCLUDE += -I$(METAMOD) -I$(METAMOD)/sourcehook
CFLAGS += -DMETA_NO_HL2SDK
endif
LINK += -m32 -lm -ldl
LINK += $(STEAMWORKS)/redistributable_bin/linux32/libsteam_api.so
+1 -1
View File
@@ -56,7 +56,7 @@
* @brief Sets whether or not this plugin required Metamod.
* NOTE: Uncomment to enable, comment to disable.
*/
//#define SMEXT_CONF_METAMOD
#define SMEXT_CONF_METAMOD
/** Enable interfaces you want to use here by uncommenting lines */
#define SMEXT_ENABLE_FORWARDSYS
+4 -2
View File
@@ -306,9 +306,10 @@ PluginId g_PLID = 0; /**< Metamod plugin ID */
ISmmPlugin *g_PLAPI = NULL; /**< Metamod plugin API */
SourceHook::ISourceHook *g_SHPtr = NULL; /**< SourceHook pointer */
ISmmAPI *g_SMAPI = NULL; /**< SourceMM API pointer */
#ifndef META_NO_HL2SDK
IVEngineServer *engine = NULL; /**< IVEngineServer pointer */
IServerGameDLL *gamedll = NULL; /**< IServerGameDLL pointer */
#endif
/** Exposes the extension to Metamod */
SMM_API void *PL_EXPOSURE(const char *name, int *code)
@@ -337,7 +338,7 @@ SMM_API void *PL_EXPOSURE(const char *name, int *code)
bool SDKExtension::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late)
{
PLUGIN_SAVEVARS();
#ifndef META_NO_HL2SDK
#if !defined METAMOD_PLAPI_VERSION
GET_V_IFACE_ANY(serverFactory, gamedll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL);
GET_V_IFACE_CURRENT(engineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
@@ -345,6 +346,7 @@ bool SDKExtension::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen,
GET_V_IFACE_ANY(GetServerFactory, gamedll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL);
GET_V_IFACE_CURRENT(GetEngineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
#endif
#endif //META_NO_HL2SDK
m_SourceMMLoaded = true;
+4
View File
@@ -100,7 +100,9 @@
#if defined SMEXT_CONF_METAMOD
#include <ISmmPlugin.h>
#ifndef META_NO_HL2SDK
#include <eiface.h>
#endif // META_NO_HL2SDK
#endif
using namespace SourceMod;
@@ -313,8 +315,10 @@ extern IRootConsole *rootconsole;
#if defined SMEXT_CONF_METAMOD
PLUGIN_GLOBALVARS();
#ifndef META_NO_HL2SDK
extern IVEngineServer *engine;
extern IServerGameDLL *gamedll;
#endif //META_NO_HL2SDK
#endif
/** Creates a SourceMod interface macro pair */