|
darope@0
|
1 |
// vi: set ts=4 sw=4 : |
|
darope@0
|
2 |
// vim: set tw=75 : |
|
darope@0
|
3 |
|
|
darope@0
|
4 |
// plugin.cpp - generic plugin operation |
|
darope@0
|
5 |
|
|
darope@0
|
6 |
/* |
|
darope@0
|
7 |
* Copyright (c) 2001-2003 Will Day <[email protected]> |
|
darope@0
|
8 |
* |
|
darope@0
|
9 |
* This file is part of Metamod. |
|
darope@0
|
10 |
* |
|
darope@0
|
11 |
* Metamod is free software; you can redistribute it and/or modify it |
|
darope@0
|
12 |
* under the terms of the GNU General Public License as published by the |
|
darope@0
|
13 |
* Free Software Foundation; either version 2 of the License, or (at |
|
darope@0
|
14 |
* your option) any later version. |
|
darope@0
|
15 |
* |
|
darope@0
|
16 |
* Metamod is distributed in the hope that it will be useful, but |
|
darope@0
|
17 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
|
darope@0
|
18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
darope@0
|
19 |
* General Public License for more details. |
|
darope@0
|
20 |
* |
|
darope@0
|
21 |
* You should have received a copy of the GNU General Public License |
|
darope@0
|
22 |
* along with Metamod; if not, write to the Free Software Foundation, |
|
darope@0
|
23 |
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
darope@0
|
24 |
* |
|
darope@0
|
25 |
* In addition, as a special exception, the author gives permission to |
|
darope@0
|
26 |
* link the code of this program with the Half-Life Game Engine ("HL |
|
darope@0
|
27 |
* Engine") and Modified Game Libraries ("MODs") developed by Valve, |
|
darope@0
|
28 |
* L.L.C ("Valve"). You must obey the GNU General Public License in all |
|
darope@0
|
29 |
* respects for all of the code used other than the HL Engine and MODs |
|
darope@0
|
30 |
* from Valve. If you modify this file, you may extend this exception |
|
darope@0
|
31 |
* to your version of the file, but you are not obligated to do so. If |
|
darope@0
|
32 |
* you do not wish to do so, delete this exception statement from your |
|
darope@0
|
33 |
* version. |
|
darope@0
|
34 |
* |
|
darope@0
|
35 |
*/ |
|
darope@0
|
36 |
|
|
darope@0
|
37 |
#include <extdll.h> |
|
darope@0
|
38 |
|
|
darope@0
|
39 |
#include <meta_api.h> |
|
darope@0
|
40 |
|
|
darope@0
|
41 |
#include "plugin.h" |
|
darope@0
|
42 |
#include "log_plugin.h" |
|
darope@0
|
43 |
#include "trace_api.h" |
|
darope@0
|
44 |
|
|
darope@0
|
45 |
// Must provide at least one of these.. |
|
darope@0
|
46 |
META_FUNCTIONS gMetaFunctionTable = { |
|
darope@0
|
47 |
NULL, // pfnGetEntityAPI HL SDK; called before game DLL |
|
darope@0
|
48 |
NULL, // pfnGetEntityAPI_Post META; called after game DLL |
|
darope@0
|
49 |
GetEntityAPI2, // pfnGetEntityAPI2 HL SDK2; called before game DLL |
|
darope@0
|
50 |
GetEntityAPI2_Post, // pfnGetEntityAPI2_Post META; called after game DLL |
|
darope@0
|
51 |
GetNewDLLFunctions, // pfnGetNewDLLFunctions HL SDK2; called before game DLL |
|
darope@0
|
52 |
GetNewDLLFunctions_Post, // pfnGetNewDLLFunctions_Post META; called after game DLL |
|
darope@0
|
53 |
GetEngineFunctions, // pfnGetEngineFunctions META; called before HL engine |
|
darope@0
|
54 |
GetEngineFunctions_Post, // pfnGetEngineFunctions_Post META; called after HL engine |
|
darope@0
|
55 |
}; |
|
darope@0
|
56 |
|
|
darope@0
|
57 |
cvar_t init_plugin_debug = {"trace_debug", "0", FCVAR_EXTDLL, 0, NULL}; |
|
darope@0
|
58 |
|
|
darope@0
|
59 |
|
|
darope@0
|
60 |
// Meta_Query, any desired checks for valid use. |
|
darope@0
|
61 |
int plugin_query(void) { |
|
darope@0
|
62 |
return(TRUE); |
|
darope@0
|
63 |
} |
|
darope@0
|
64 |
|
|
darope@0
|
65 |
// Meta_Attach. Plugin startup. Register commands and cvars. |
|
darope@0
|
66 |
int plugin_attach(void) { |
|
darope@0
|
67 |
log_init("trace_debug"); |
|
darope@0
|
68 |
trace_init(); |
|
darope@0
|
69 |
return(TRUE); |
|
darope@0
|
70 |
} |
|
darope@0
|
71 |
|
|
darope@0
|
72 |
// Meta_Detach. Cleaning up. |
|
darope@0
|
73 |
int plugin_detach(void) { |
|
darope@0
|
74 |
return(TRUE); |
|
darope@0
|
75 |
} |