1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2025-02-27 20:54:14 +01:00

Updated for similar sample_mm changes

--HG--
extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40274
This commit is contained in:
David Anderson 2006-08-14 05:49:53 +00:00
parent a66da0fe11
commit ed4411344b
5 changed files with 28 additions and 62 deletions

View File

@ -1,16 +0,0 @@
/* ======== stub_mm ========
* Copyright (C) 2004-2006 Metamod:Source Development Team
* No warranties of any kind
*
* License: zlib/libpng
*
* Author(s): David "BAILOPAN" Anderson
* ============================
*/
#ifndef _INCLUDE_META_HOOKS_H
#define _INCLUDE_META_HOOKS_H
SH_DECL_HOOK3_void(IServerGameDLL, ServerActivate, SH_NOATTRIB, 0, edict_t *, int, int);
#endif //_INCLUDE_META_HOOKS_H

View File

@ -127,9 +127,6 @@
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath="..\meta_hooks.h">
</File>
<File
RelativePath="..\stub_mm.h">
</File>

View File

@ -197,10 +197,6 @@
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\meta_hooks.h"
>
</File>
<File
RelativePath="..\stub_mm.h"
>

View File

@ -1,53 +1,42 @@
/* ======== stub_mm ========
* Copyright (C) 2004-2006 Metamod:Source Development Team
* No warranties of any kind
*
* License: zlib/libpng
*
* Author(s): David "BAILOPAN" Anderson
* ============================
*/
* Copyright (C) 2004-2006 Metamod:Source Development Team
* No warranties of any kind
*
* License: zlib/libpng
*
* Author(s): David "BAILOPAN" Anderson
* ============================
*/
#include <oslink.h>
#include "stub_mm.h"
SH_DECL_HOOK3_void(IServerGameDLL, ServerActivate, SH_NOATTRIB, 0, edict_t *, int, int);
StubPlugin g_StubPlugin;
PLUGIN_EXPOSE(SamplePlugin, g_StubPlugin);
//This has all of the necessary hook declarations. Read it!
#include "meta_hooks.h"
#define FIND_IFACE(func, assn_var, num_var, name, type) \
do { \
if ( (assn_var=(type)((ismm->func())(name, NULL))) != NULL ) { \
num_var = 0; \
break; \
} \
if (num_var >= 999) \
break; \
} while (( num_var=ismm->FormatIface(name, sizeof(name)-1) )); \
if (!assn_var) { \
if (error) \
snprintf(error, maxlen, "Could not find interface %s", name); \
return false; \
}
void ServerActivate_handler(edict_t *pEdictList, int edictCount, int clientMax)
{
META_LOG(g_PLAPI, "ServerActivate() called: edictCount=%d, clientMax=%d", edictCount, clientMax);
RETURN_META(MRES_IGNORED);
}
#define GET_V_IFACE(v_factory, v_var, v_type, v_name) \
v_var = (v_type *)ismm->VInterfaceMatch(ismm->v_factory(), v_name); \
if (!v_var) { \
if (error && maxlen) { \
snprintf(error, maxlen, "Could not find interface: %s", v_name); \
} \
return false; \
}
bool StubPlugin::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late)
{
PLUGIN_SAVEVARS();
char iface_buffer[255];
int num = 0;
strcpy(iface_buffer, "ServerGameDLL003");
FIND_IFACE(serverFactory, m_ServerDll, num, iface_buffer, IServerGameDLL *);
GET_V_IFACE(serverFactory, m_ServerDll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL);
SH_ADD_HOOK_STATICFUNC(IServerGameDLL, ServerActivate, m_ServerDll, ServerActivate_handler, true);

View File

@ -1,12 +1,12 @@
/* ======== stub_mm ========
* Copyright (C) 2004-2006 Metamod:Source Development Team
* No warranties of any kind
*
* License: zlib/libpng
*
* Author(s): David "BAILOPAN" Anderson
* ============================
*/
* Copyright (C) 2004-2006 Metamod:Source Development Team
* No warranties of any kind
*
* License: zlib/libpng
*
* Author(s): David "BAILOPAN" Anderson
* ============================
*/
#ifndef _INCLUDE_SAMPLEPLUGIN_H
#define _INCLUDE_SAMPLEPLUGIN_H