-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dll_api.cpp
86 lines (73 loc) · 2.24 KB
/
Dll_api.cpp
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#include <extdll.h>
#include <dllapi.h>
#include <meta_api.h>
#include "MyHandles.h"
static DLL_FUNCTIONS gFunctionTable =
{
NULL, // pfnGameInit
NULL, // pfnSpawn
NULL, // pfnThink
NULL, // pfnUse
NULL, // pfnTouch
NULL, // pfnBlocked
NULL, // pfnKeyValue
NULL, // pfnSave
NULL, // pfnRestore
NULL, // pfnSetAbsBox
NULL, // pfnSaveWriteFields
NULL, // pfnSaveReadFields
NULL, // pfnSaveGlobalState
NULL, // pfnRestoreGlobalState
NULL, // pfnResetGlobalState
ClientConnect, // pfnClientConnect
CLientDisconnect, // pfnClientDisconnect
NULL, // pfnClientKill
NULL, // pfnClientPutInServer
ClientCommand, // pfnClientCommand
NULL, // pfnClientUserInfoChanged
NULL, // pfnServerActivate
NULL, // pfnServerDeactivate
NULL, // pfnPlayerPreThink
NULL, // pfnPlayerPostThink
NULL, // pfnStartFrame
NULL, // pfnParmsNewLevel
NULL, // pfnParmsChangeLevel
NULL, // pfnGetGameDescription
NULL, // pfnPlayerCustomization
NULL, // pfnSpectatorConnect
NULL, // pfnSpectatorDisconnect
NULL, // pfnSpectatorThink
NULL, // pfnSys_Error
NULL, // pfnPM_Move
NULL, // pfnPM_Init
NULL, // pfnPM_FindTextureType
NULL, // pfnSetupVisibility
NULL, // pfnUpdateClientData
NULL, // pfnAddToFullPack
NULL, // pfnCreateBaseline
NULL, // pfnRegisterEncoders
NULL, // pfnGetWeaponData
NULL, // pfnCmdStart
NULL, // pfnCmdEnd
NULL, // pfnConnectionlessPacket
NULL, // pfnGetHullBounds
NULL, // pfnCreateInstancedBaselines
NULL, // pfnInconsistentFile
NULL, // pfnAllowLagCompensation
};
C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion)
{
if(!pFunctionTable)
{
UTIL_LogPrintf("GetEntityAPI2 called with null pFunctionTable");
return false;
}
else if(*interfaceVersion != INTERFACE_VERSION) {
UTIL_LogPrintf("GetEntityAPI2 version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION);
//! Tell metamod what version we had, so it can figure out who is out of date.
*interfaceVersion = INTERFACE_VERSION;
return false;
}
memcpy(pFunctionTable, &gFunctionTable, sizeof(DLL_FUNCTIONS));
return true;
}