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