|
darope@0
|
1 |
// vi: set ts=4 sw=4 : |
|
darope@0
|
2 |
// vim: set tw=75 : |
|
darope@0
|
3 |
|
|
darope@0
|
4 |
/* |
|
darope@0
|
5 |
* Copyright (c) 2001-2003 Will Day <[email protected]> |
|
darope@0
|
6 |
* |
|
darope@0
|
7 |
* This file is part of Metamod. |
|
darope@0
|
8 |
* |
|
darope@0
|
9 |
* Metamod is free software; you can redistribute it and/or modify it |
|
darope@0
|
10 |
* under the terms of the GNU General Public License as published by the |
|
darope@0
|
11 |
* Free Software Foundation; either version 2 of the License, or (at |
|
darope@0
|
12 |
* your option) any later version. |
|
darope@0
|
13 |
* |
|
darope@0
|
14 |
* Metamod is distributed in the hope that it will be useful, but |
|
darope@0
|
15 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
|
darope@0
|
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
darope@0
|
17 |
* General Public License for more details. |
|
darope@0
|
18 |
* |
|
darope@0
|
19 |
* You should have received a copy of the GNU General Public License |
|
darope@0
|
20 |
* along with Metamod; if not, write to the Free Software Foundation, |
|
darope@0
|
21 |
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
darope@0
|
22 |
* |
|
darope@0
|
23 |
* In addition, as a special exception, the author gives permission to |
|
darope@0
|
24 |
* link the code of this program with the Half-Life Game Engine ("HL |
|
darope@0
|
25 |
* Engine") and Modified Game Libraries ("MODs") developed by Valve, |
|
darope@0
|
26 |
* L.L.C ("Valve"). You must obey the GNU General Public License in all |
|
darope@0
|
27 |
* respects for all of the code used other than the HL Engine and MODs |
|
darope@0
|
28 |
* from Valve. If you modify this file, you may extend this exception |
|
darope@0
|
29 |
* to your version of the file, but you are not obligated to do so. If |
|
darope@0
|
30 |
* you do not wish to do so, delete this exception statement from your |
|
darope@0
|
31 |
* version. |
|
darope@0
|
32 |
* |
|
darope@0
|
33 |
*/ |
|
darope@0
|
34 |
|
|
darope@0
|
35 |
#include <extdll.h> |
|
darope@0
|
36 |
|
|
darope@0
|
37 |
#include <dllapi.h> |
|
darope@0
|
38 |
#include <meta_api.h> |
|
darope@0
|
39 |
|
|
darope@0
|
40 |
static DLL_FUNCTIONS gFunctionTable = |
|
darope@0
|
41 |
{ |
|
darope@0
|
42 |
NULL, // pfnGameInit |
|
darope@0
|
43 |
NULL, // pfnSpawn |
|
darope@0
|
44 |
NULL, // pfnThink |
|
darope@0
|
45 |
NULL, // pfnUse |
|
darope@0
|
46 |
NULL, // pfnTouch |
|
darope@0
|
47 |
NULL, // pfnBlocked |
|
darope@0
|
48 |
NULL, // pfnKeyValue |
|
darope@0
|
49 |
NULL, // pfnSave |
|
darope@0
|
50 |
NULL, // pfnRestore |
|
darope@0
|
51 |
NULL, // pfnSetAbsBox |
|
darope@0
|
52 |
|
|
darope@0
|
53 |
NULL, // pfnSaveWriteFields |
|
darope@0
|
54 |
NULL, // pfnSaveReadFields |
|
darope@0
|
55 |
|
|
darope@0
|
56 |
NULL, // pfnSaveGlobalState |
|
darope@0
|
57 |
NULL, // pfnRestoreGlobalState |
|
darope@0
|
58 |
NULL, // pfnResetGlobalState |
|
darope@0
|
59 |
|
|
darope@0
|
60 |
NULL, // pfnClientConnect |
|
darope@0
|
61 |
NULL, // pfnClientDisconnect |
|
darope@0
|
62 |
NULL, // pfnClientKill |
|
darope@0
|
63 |
NULL, // pfnClientPutInServer |
|
darope@0
|
64 |
NULL, // pfnClientCommand |
|
darope@0
|
65 |
NULL, // pfnClientUserInfoChanged |
|
darope@0
|
66 |
NULL, // pfnServerActivate |
|
darope@0
|
67 |
NULL, // pfnServerDeactivate |
|
darope@0
|
68 |
|
|
darope@0
|
69 |
NULL, // pfnPlayerPreThink |
|
darope@0
|
70 |
NULL, // pfnPlayerPostThink |
|
darope@0
|
71 |
|
|
darope@0
|
72 |
NULL, // pfnStartFrame |
|
darope@0
|
73 |
NULL, // pfnParmsNewLevel |
|
darope@0
|
74 |
NULL, // pfnParmsChangeLevel |
|
darope@0
|
75 |
|
|
darope@0
|
76 |
NULL, // pfnGetGameDescription |
|
darope@0
|
77 |
NULL, // pfnPlayerCustomization |
|
darope@0
|
78 |
|
|
darope@0
|
79 |
NULL, // pfnSpectatorConnect |
|
darope@0
|
80 |
NULL, // pfnSpectatorDisconnect |
|
darope@0
|
81 |
NULL, // pfnSpectatorThink |
|
darope@0
|
82 |
|
|
darope@0
|
83 |
NULL, // pfnSys_Error |
|
darope@0
|
84 |
|
|
darope@0
|
85 |
NULL, // pfnPM_Move |
|
darope@0
|
86 |
NULL, // pfnPM_Init |
|
darope@0
|
87 |
NULL, // pfnPM_FindTextureType |
|
darope@0
|
88 |
|
|
darope@0
|
89 |
NULL, // pfnSetupVisibility |
|
darope@0
|
90 |
NULL, // pfnUpdateClientData |
|
darope@0
|
91 |
NULL, // pfnAddToFullPack |
|
darope@0
|
92 |
NULL, // pfnCreateBaseline |
|
darope@0
|
93 |
NULL, // pfnRegisterEncoders |
|
darope@0
|
94 |
NULL, // pfnGetWeaponData |
|
darope@0
|
95 |
NULL, // pfnCmdStart |
|
darope@0
|
96 |
NULL, // pfnCmdEnd |
|
darope@0
|
97 |
NULL, // pfnConnectionlessPacket |
|
darope@0
|
98 |
NULL, // pfnGetHullBounds |
|
darope@0
|
99 |
NULL, // pfnCreateInstancedBaselines |
|
darope@0
|
100 |
NULL, // pfnInconsistentFile |
|
darope@0
|
101 |
NULL, // pfnAllowLagCompensation |
|
darope@0
|
102 |
}; |
|
darope@0
|
103 |
|
|
darope@0
|
104 |
C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, |
|
darope@0
|
105 |
int *interfaceVersion) |
|
darope@0
|
106 |
{ |
|
darope@0
|
107 |
if(!pFunctionTable) { |
|
darope@0
|
108 |
UTIL_LogPrintf("GetEntityAPI2 called with null pFunctionTable"); |
|
darope@0
|
109 |
return(FALSE); |
|
darope@0
|
110 |
} |
|
darope@0
|
111 |
else if(*interfaceVersion != INTERFACE_VERSION) { |
|
darope@0
|
112 |
UTIL_LogPrintf("GetEntityAPI2 version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); |
|
darope@0
|
113 |
//! Tell metamod what version we had, so it can figure out who is out of date. |
|
darope@0
|
114 |
*interfaceVersion = INTERFACE_VERSION; |
|
darope@0
|
115 |
return(FALSE); |
|
darope@0
|
116 |
} |
|
darope@0
|
117 |
memcpy(pFunctionTable, &gFunctionTable, sizeof(DLL_FUNCTIONS)); |
|
darope@0
|
118 |
return(TRUE); |
|
darope@0
|
119 |
} |