-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmeta_api.cpp
More file actions
59 lines (50 loc) · 1.93 KB
/
Copy pathmeta_api.cpp
File metadata and controls
59 lines (50 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include <extdll.h>
#include <meta_api.h>
#include "ex_rehlds_api.h"
meta_globals_t *gpMetaGlobals;
gamedll_funcs_t *gpGamedllFuncs;
mutil_funcs_t *gpMetaUtilFuncs;
enginefuncs_t *g_pengfuncsTable;
plugin_info_t Plugin_info =
{
META_INTERFACE_VERSION, // ifvers
"Example plugin", // name
"0.1", // version
__DATE__, // date
"Author", // author
"https://github.com/FWGS/metamod-plugin-template", // url
"EXAMPLE", // logtag
PT_ANYTIME, // (when) loadable
PT_ANYTIME, // (when) unloadable
};
C_DLLEXPORT int Meta_Query(char *interfaceVersion, plugin_info_t **plinfo, mutil_funcs_t *pMetaUtilFuncs)
{
*plinfo = &Plugin_info;
gpMetaUtilFuncs = pMetaUtilFuncs;
return TRUE;
}
META_FUNCTIONS gMetaFunctionTable =
{
NULL, // pfnGetEntityAPI HL SDK; called before game DLL
NULL, // pfnGetEntityAPI_Post META; called after game DLL
GetEntityAPI2, // pfnGetEntityAPI2 HL SDK2; called before game DLL
GetEntityAPI2_Post, // pfnGetEntityAPI2_Post META; called after game DLL
GetNewDLLFunctions, // pfnGetNewDLLFunctions HL SDK2; called before game DLL
GetNewDLLFunctions_Post, // pfnGetNewDLLFunctions_Post META; called after game DLL
GetEngineFunctions, // pfnGetEngineFunctions META; called before HL engine
GetEngineFunctions_Post, // pfnGetEngineFunctions_Post META; called after HL engine
};
C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs)
{
gpMetaGlobals = pMGlobals;
gpGamedllFuncs = pGamedllFuncs;
g_engfuncs.pfnServerPrint("\n################\n# Hello World! #\n################\n\n");
if (meta_init_rehlds_api())
g_engfuncs.pfnServerPrint("ReHLDS API successfully initialized.\n");
memcpy(pFunctionTable, &gMetaFunctionTable, sizeof(META_FUNCTIONS));
return TRUE;
}
C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason)
{
return TRUE;
}