7 * This file is part of Metamod.
9 * Metamod is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at
12 * your option) any later version.
14 * Metamod is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with Metamod; if not, write to the Free Software Foundation,
21 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 * In addition, as a special exception, the author gives permission to
24 * link the code of this program with the Half-Life Game Engine ("HL
25 * Engine") and Modified Game Libraries ("MODs") developed by Valve,
26 * L.L.C ("Valve"). You must obey the GNU General Public License in all
27 * respects for all of the code used other than the HL Engine and MODs
28 * from Valve. If you modify this file, you may extend this exception
29 * to your version of the file, but you are not obligated to do so. If
30 * you do not wish to do so, delete this exception statement from your
40 static DLL_FUNCTIONS gFunctionTable =
53 NULL, // pfnSaveWriteFields
54 NULL, // pfnSaveReadFields
56 NULL, // pfnSaveGlobalState
57 NULL, // pfnRestoreGlobalState
58 NULL, // pfnResetGlobalState
60 NULL, // pfnClientConnect
61 NULL, // pfnClientDisconnect
62 NULL, // pfnClientKill
63 NULL, // pfnClientPutInServer
64 NULL, // pfnClientCommand
65 NULL, // pfnClientUserInfoChanged
66 NULL, // pfnServerActivate
67 NULL, // pfnServerDeactivate
69 NULL, // pfnPlayerPreThink
70 NULL, // pfnPlayerPostThink
72 NULL, // pfnStartFrame
73 NULL, // pfnParmsNewLevel
74 NULL, // pfnParmsChangeLevel
76 NULL, // pfnGetGameDescription
77 NULL, // pfnPlayerCustomization
79 NULL, // pfnSpectatorConnect
80 NULL, // pfnSpectatorDisconnect
81 NULL, // pfnSpectatorThink
87 NULL, // pfnPM_FindTextureType
89 NULL, // pfnSetupVisibility
90 NULL, // pfnUpdateClientData
91 NULL, // pfnAddToFullPack
92 NULL, // pfnCreateBaseline
93 NULL, // pfnRegisterEncoders
94 NULL, // pfnGetWeaponData
97 NULL, // pfnConnectionlessPacket
98 NULL, // pfnGetHullBounds
99 NULL, // pfnCreateInstancedBaselines
100 NULL, // pfnInconsistentFile
101 NULL, // pfnAllowLagCompensation
104 C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable,
105 int *interfaceVersion)
107 if(!pFunctionTable) {
108 UTIL_LogPrintf("GetEntityAPI2 called with null pFunctionTable");
111 else if(*interfaceVersion != INTERFACE_VERSION) {
112 UTIL_LogPrintf("GetEntityAPI2 version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION);
113 //! Tell metamod what version we had, so it can figure out who is out of date.
114 *interfaceVersion = INTERFACE_VERSION;
117 memcpy(pFunctionTable, &gFunctionTable, sizeof(DLL_FUNCTIONS));