1.1 --- a/.cvsignore Fri Feb 18 20:52:34 2005 +0000
1.2 +++ b/.cvsignore Tue Aug 23 20:31:28 2005 +0000
1.3 @@ -1,2 +1,4 @@
1.4 dlls
1.5 priv
1.6 +metamod.suo
1.7 +metamod.ncb
2.1 --- a/doc/Changelog Fri Feb 18 20:52:34 2005 +0000
2.2 +++ b/doc/Changelog Tue Aug 23 20:31:28 2005 +0000
2.3 @@ -1,5 +1,21 @@
2.4 # vim: set tw=75 ft=none :
2.5
2.6 +2005/08/24 1.18
2.7 + - Added new API for loading/unloading plugins.
2.8 + - Added IS_QUERYING_CLIENT_cVAR for new client cvar engine API.
2.9 + - Added support for new HLSDK-API functions QueryClientCvarValue() and
2.10 + ClientCvar().
2.11 + - Changed cmd_doplug() to make sure a complete string was not misinterpreted
2.12 + as a number.
2.13 + - Fixed DLCLOSE() to not accept NULL handles.
2.14 + - Fixed a bug where API call wrappers were not saving global states.
2.15 + (This caused problems mainly with bot plugins.)
2.16 + - Fixed reloading failed plugins with "meta reload".
2.17 + - Bumped internal API version to 5:12 (old plugins might ask to be updated).
2.18 + - Commands "meta version" and "meta info" show ifvers for metamod/plugins.
2.19 + - Added mod recognition for Digital Paintball 2.2.
2.20 + - Added mod recognition for Firearms 3.0.
2.21 +
2.22 2005/02/20 1.17.4
2.23 - Added Mod recognition and entities for Brain Bread 1.2
2.24 - Changed Mod recognition and added entities for Snow-War 2.0
3.1 --- a/doc/TODO Fri Feb 18 20:52:34 2005 +0000
3.2 +++ b/doc/TODO Tue Aug 23 20:31:28 2005 +0000
3.3 @@ -24,6 +24,14 @@
3.4 - is_ingame
3.5 - find some way to generally allow plugins to use LINK_ENTITY_TO_CLASS,
3.6 without requiring explicit support in metamod
3.7 + - plugin reloading on mapchange may not work properly in all situations.
3.8 + recheck the state machine.
3.9 + - replace macros with templates?
3.10 + - advanced handling of QueryClientCvarValue API, serializing queries in
3.11 + a queue and using a timeout to account for dropped packets.
3.12 + - fix unloading gamedll when we get unloaded.
3.13 + - add lin32/64 description and examples to plugins.ini as well as
3.14 + "require" description and example to config.ini.
3.15
3.16 x fix stat()-related code for linux only
3.17 x remake MSVC project
4.1 --- a/doc/html/a.html Fri Feb 18 20:52:34 2005 +0000
4.2 +++ b/doc/html/a.html Tue Aug 23 20:31:28 2005 +0000
4.3 @@ -36,11 +36,11 @@
4.4 <tr><td><a href="http://www.desertcrisis.com/">Desert Crisis</a></td><td>v1.5</td><td>2003/04/09</td><td><a href="http://metamod.org/dl/metamod/ents/desertcrisis">[ents]</a></td></tr>
4.5 <tr><td><a href="-">Deathmatch Classic</a></td><td>v1.0</td><td>2001/06/07</td><td><a href="http://metamod.org/dl/metamod/ents/dmc">[ents]</a></td></tr>
4.6 <tr><td><a href="http://www.dayofdefeatmod.com/">Day of Defeat</a></td><td>v1.0</td><td>2003/05/03</td><td><a href="http://metamod.org/dl/metamod/ents/dod">[ents]</a></td></tr>
4.7 -<tr><td><a href="http://www.digitalpaintball.net/">Digital Paintball</a></td><td>v1.0</td><td>2002/10/06</td><td><a href="http://metamod.org/dl/metamod/ents/dpaintball">[ents]</a></td></tr>
4.8 +<tr><td><a href="http://www.digitalpaintball.net/">Digital Paintball</a></td><td>v2.2</td><td>2005/06/15</td><td><a href="http://metamod.org/dl/metamod/ents/dpaintball">[ents]</a></td></tr>
4.9 <tr><td><a href="http://dmz.flagrun.net/">Dragon Mod Z</a></td><td>v1.7</td><td>2002/10/06</td><td><a href="http://metamod.org/dl/metamod/ents/dragonmodz">[ents]</a></td></tr>
4.10 <tr><td><a href="http://www.esforces.com/">Earth's Special Forces</a></td><td>Beta 1.1</td><td>2003/07/30</td><td><a href="http://metamod.org/dl/metamod/ents/esforces">[ents]</a></td></tr>
4.11 <tr><td><a href="http://www.whatisexistence.com/">Existence</a></td><td>Beta 1.3</td><td>2001/09/19</td><td><a href="http://metamod.org/dl/metamod/ents/existence">[ents]</a></td></tr>
4.12 -<tr><td><a href="http://www.firearmsmod.com/">Firearms</a></td><td>v2.7</td><td>2003/03/24</td><td><a href="http://metamod.org/dl/metamod/ents/firearms">[ents]</a></td></tr>
4.13 +<tr><td><a href="http://www.firearmsmod.com/">Firearms</a></td><td>v3.0</td><td>2005/05/09</td><td><a href="http://metamod.org/dl/metamod/ents/firearms">[ents]</a></td></tr>
4.14 <tr><td><a href="http://www.firearms25mod.tk/">Retro Firearms</a></td><td>v2.5</td><td>2002/01/11</td><td><a href="http://metamod.org/dl/metamod/ents/retrofirearms">[ents]</a></td></tr>
4.15 <tr><td><a href="-">Freeze</a></td><td>-</td><td>2001/../..</td><td><a href="http://metamod.org/dl/metamod/ents/freeze">[ents]</a></td></tr>
4.16 <tr><td><a href="http://www.frontlineforce.com/">Frontline Force</a></td><td>v1.3</td><td>2001/06/10</td><td><a href="http://metamod.org/dl/metamod/ents/flf">[ents]</a></td></tr>
5.1 --- a/doc/html/coding.html Fri Feb 18 20:52:34 2005 +0000
5.2 +++ b/doc/html/coding.html Tue Aug 23 20:31:28 2005 +0000
5.3 @@ -352,6 +352,28 @@
5.4 The returned string is a pointer to a static buffer, and should be
5.5 copied by the caller to local storage.
5.6 <i>[added in 1.14]</i>
5.7 +<a name="LOAD_PLUGIN"><p><li></a>
5.8 +<tt> int <b>LOAD_PLUGIN(PLID, <i>const char *name, PLUG_LOADTIME now, void **handle</i>)</b></tt>
5.9 + <br>Attempts to load a plugin as if "meta load <name>" was passed. If
5.10 + handle is passed, it will be NULL on failure or contain the DLL handle on success.
5.11 + Returns 0 for success, non-zero Metamod error value for failure.
5.12 + <i>[added in 1.18]</i>
5.13 +<a name="UNLOAD_PLUGIN"><p><li></a>
5.14 +<tt> int <b>UNLOAD_PLUGIN(PLID, <i>const char *name, PLUG_LOADTIME now, PL_UNLOAD_REASON reason</i>)</b></tt>
5.15 + <br>Attempts to unload a plugin given by name. A plugin cannot unload itself.
5.16 + Returns 0 for success, non-zero Metamod error value for failure.
5.17 + <i>[added in 1.18]</i>
5.18 +<a name="UNLOAD_PLUGIN_BY_HANDLE"><p><li></a>
5.19 +<tt> int <b>UNLOAD_PLUGIN_BY_HANDLE(PLID, <i>void *handle, PLUG_LOADTIME now, PL_UNLOAD_REASON reason</i>)</b></tt>
5.20 + <br>Attempts to unload a plugin given by the DLL handle from LOAD_PLUGIN. A plugin cannot unload itself.
5.21 + Returns 0 for success, non-zero Metamod error value for failure.
5.22 + <i>[added in 1.18]</i>
5.23 +<a name="IS_QUERYING_CLIENT_CVAR"><p><li></a>
5.24 +<tt> const char *<b>IS_QUERYING_CLIENT_CVAR(PLID, <i>const edict_t
5.25 +*player</i>)</b></tt>
5.26 + <br>Returns the current cvar name that a client is being queried for,
5.27 + NULL if no queries are in session.
5.28 + <i>[added in 1.18]</i>
5.29 </ul>
5.30
5.31 <p><br>
6.1 --- a/doc/html/engine_notes.html Fri Feb 18 20:52:34 2005 +0000
6.2 +++ b/doc/html/engine_notes.html Tue Aug 23 20:31:28 2005 +0000
6.3 @@ -167,6 +167,7 @@
6.4 <li><a href=#ProcessTutorMessageDecayBuffer>ProcessTutorMessageDecayBuffer</a>
6.5 <li><a href=#ConstructTutorMessageDecayBuffer>ConstructTutorMessageDecayBuffer</a>
6.6 <li><a href=#ResetTutorMessageDecayData>ResetTutorMessageDecayData</a>
6.7 + <li><a href=#QueryClientCvar>QueryClientCvar</a>
6.8 </ul>
6.9
6.10 <hr><h3><tt><a name="PrecacheModel">PrecacheModel</a></tt></h3>
6.11 @@ -1697,6 +1698,18 @@
6.12 Added for HL 1xxx; no SDK update.
6.13 </blockquote>
6.14
6.15 +<hr><h3><tt><a name="QueryClientCvar">QueryClientCvar</a></tt></h3>
6.16 +<dd><tt>void (*pfnQueryClientCvarValue)( const edict_t *player, const char *cvarName );</tt><p>
6.17 +<i>from [email protected], via HLCoders</i><br>
6.18 +<blockquote><tt>
6.19 +Calling this function requests the value of cvarName from player. The
6.20 +result is returned via a callback from NEW_DLL_FUNCTIONS.
6.21 +</tt></blockquote>
6.22 +<p><i>comments:</i><br>
6.23 +<blockquote>
6.24 + Added 2005/08/11, no SDK update.
6.25 +</blockquote>
6.26 +
6.27
6.28 <p>
6.29 <hr>
7.1 --- a/doc/html/newapi_notes.html Fri Feb 18 20:52:34 2005 +0000
7.2 +++ b/doc/html/newapi_notes.html Tue Aug 23 20:31:28 2005 +0000
7.3 @@ -15,6 +15,7 @@
7.4 <li><a href=#OnFreeEntPrivateData>OnFreeEntPrivateData</a>
7.5 <li><a href=#GameShutdown>GameShutdown</a>
7.6 <li><a href=#ShouldCollide>ShouldCollide</a>
7.7 + <li><a href=#CvarValue>CvarValue</a>
7.8 </ul>
7.9
7.10 <b>NOTE</b>: No examples of these found in SDK...
7.11 @@ -55,6 +56,20 @@
7.12 <br>Added in SDK 2.0.
7.13 </blockquote>
7.14
7.15 +<hr><h3><tt><a name="CvarValue">CvarValue</a></tt></h3>
7.16 +<dd><tt>void (*pfnCvarValue)( const edict_t *pEnt, const char *value );</tt><p>
7.17 +<i>from [email protected], via HLCoders:</i><br>
7.18 +<blockquote><tt>
7.19 +When the client responds to the cvar request you will get a callback to pfnCvarValue()
7.20 +with the edict of the player who is responding and the cvars values.
7.21 +</tt></blockquote>
7.22 +<p><i>comments:</i><br>
7.23 +<blockquote>
7.24 + This API can lead to conflicts when you query more than one cvar from a player
7.25 + at a time. Use IS_QUERYING_CLIENT_CVAR to check if another plugin is querying before
7.26 + you do so.
7.27 +</blockquote>
7.28 +
7.29 <p>
7.30 <hr>
7.31
8.1 --- a/doc/html/release_notes.html Fri Feb 18 20:52:34 2005 +0000
8.2 +++ b/doc/html/release_notes.html Tue Aug 23 20:31:28 2005 +0000
8.3 @@ -10,6 +10,23 @@
8.4 <h1>Release Notes
8.5 </h1>
8.6
8.7 +<a name=major.1.18>
8.8 +<h2>Major changes with Metamod 1.18
8.9 +</h2></a>
8.10 +
8.11 +<ul>
8.12 +
8.13 +<p><li>New API version, with three new API functions for loading and
8.14 +unloading plugins from other plugins, and one new function for checking client cvar queries.
8.15 +
8.16 +<p><li>Support for new HLSDK API engine functions QueryClientCvarValue and CvarValue for querying client cvars.
8.17 +
8.18 +<p><li>Console command "meta version" shows the plugin interface version.
8.19 +
8.20 +</ul>
8.21 +
8.22 +<hr>
8.23 +
8.24 <a name=major.1.17>
8.25 <h2>Major changes with Metamod 1.17
8.26 </h2></a>
9.1 --- a/doc/html/supportedmods.html Fri Feb 18 20:52:34 2005 +0000
9.2 +++ b/doc/html/supportedmods.html Tue Aug 23 20:31:28 2005 +0000
9.3 @@ -151,8 +151,8 @@
9.4 </tr>
9.5 <tr>
9.6 <td><a href="http://www.digitalpaintball.net/">Digital Paintball</a></td>
9.7 - <td>v1.0</td>
9.8 - <td>2002/10/06</td>
9.9 + <td>v2.2</td>
9.10 + <td>2005/06/15</td>
9.11 <td><a href="http://metamod.org/dl/metamod/ents/digitalpaintball">[ents]</a></td> <!-- entlist -->
9.12 <td></td>
9.13 </tr>
9.14 @@ -179,8 +179,8 @@
9.15 </tr>
9.16 <tr>
9.17 <td><a href="http://www.firearmsmod.com/">Firearms</a></td>
9.18 - <td>v2.8</td>
9.19 - <td>2003/11/15</td>
9.20 + <td>v3.0</td>
9.21 + <td>2005/05/09</td>
9.22 <td><a href="http://metamod.org/dl/metamod/ents/firearms">[ents]</a></td> <!-- entlist -->
9.23 <td></td>
9.24 </tr>
10.1 --- a/doc/txt/a.txt Fri Feb 18 20:52:34 2005 +0000
10.2 +++ b/doc/txt/a.txt Tue Aug 23 20:31:28 2005 +0000
10.3 @@ -52,8 +52,8 @@
10.4 | Day of Defeat | v1.0 | 2003/ | [ents] | |
10.5 | (www.dayofdefeatmod.com/) | | 05/03 | | |
10.6 |--------------------------------+----------+--------+--------+----------|
10.7 -| Digital Paintball | v1.0 | 2002/ | [ents] | |
10.8 -| (www.digitalpaintball.net/) | | 10/06 | | |
10.9 +| Digital Paintball | v2.2 | 2005/ | [ents] | |
10.10 +| (www.digitalpaintball.net/) | | 06/12 | | |
10.11 |--------------------------------+----------+--------+--------+----------|
10.12 | Dragon Mod Z (dmz.flagrun.net | v1.7 | 2002/ | [ents] | |
10.13 | /) | | 10/06 | | |
10.14 @@ -64,8 +64,8 @@
10.15 | Existence | Beta 1.3 | 2001/ | [ents] | |
10.16 | (www.whatisexistence.com/) | | 09/19 | | |
10.17 |--------------------------------+----------+--------+--------+----------|
10.18 -| Firearms (www.firearmsmod.com | v2.7 | 2003/ | [ents] | |
10.19 -| /) | | 03/24 | | |
10.20 +| Firearms (www.firearmsmod.com | v3.0 | 2005/ | [ents] | |
10.21 +| /) | | 05/09 | | |
10.22 |--------------------------------+----------+--------+--------+----------|
10.23 | Retro Firearms | v2.5 | 2002/ | [ents] | |
10.24 | (www.firearms25mod.tk/) | | 01/11 | | |
11.1 --- a/doc/txt/coding.txt Fri Feb 18 20:52:34 2005 +0000
11.2 +++ b/doc/txt/coding.txt Tue Aug 23 20:31:28 2005 +0000
11.3 @@ -7,8 +7,10 @@
11.4
11.5 You'll need the Half-Life SDK, of course. In particular you'll need HL SDK
11.6 version 2.3. You can find the original SDK 2.3 at the Valve Editing
11.7 -Resource Center (VERC) (www.valve-erc.com/), and a modified version of SDK
11.8 -2.3 at metmod.org/files/sdk (metamod.org/files/sdk/).
11.9 +Resource Center (VERC)
11.10 +(www.valve-erc.com), and a modified version of SDK 2.3 at metmod.org/files
11.11 +/sdk
11.12 +(metamod.org/files/sdk).
11.13
11.14
11.15 Operation
11.16 @@ -32,7 +34,7 @@
11.17
11.18 Thus after each plugin is called, its META_RESULT flag is checked, and
11.19 action taken appropriately. Note that supercede/override only affects the
11.20 -_real_ routine; other plugins will still be called. In addition to the
11.21 +_real_ routine; other plugins will still be called. In addition to the
11.22 SUPERCEDE and OVERRIDE flags, there are two additional flags a plugin can
11.23 return:
11.24
11.25 @@ -106,7 +108,7 @@
11.26 special for this situation. Unless otherwise specified by a later
11.27 plugin, execution of routine in the gameDLL will take place. This is
11.28 valid in both normal and post routines.
11.29 -
11.30 +
11.31 - MRES_HANDLED
11.32 The plugin handled the situation, or did something with the
11.33 information. Again, this could be used to tell a subsequent plugin
11.34 @@ -114,7 +116,7 @@
11.35 recognized specially by Metamod. Unless otherwise specified by a later
11.36 plugin, execution of routine in the gameDLL will take place. This is
11.37 valid in both normal and post routines.
11.38 -
11.39 +
11.40 - MRES_OVERRIDE
11.41 The plugin is providing a return value for the routine, which should
11.42 be used in place of the return value from the gameDLL's routine (the
11.43 @@ -122,7 +124,7 @@
11.44 specified by a later plugin, the gameDLL routine will still be called.
11.45 Note this only makes sense for non-void routines. This is valid in
11.46 both normal and post routines.
11.47 -
11.48 +
11.49 - MRES_SUPERCEDE
11.50 The plugin has performed sufficient actions for the routine, and the
11.51 gameDLL's routine should NOT be called (the plugin "supercedes" the
11.52 @@ -158,44 +160,44 @@
11.53
11.54 - SET_META_RESULT(result)
11.55 Sets the META_RESULT for the plugin.
11.56 -
11.57 +
11.58 - RETURN_META(result)
11.59 Sets the META_RESULT for the plugin, and then calls return. This
11.60 assumes a void function.
11.61 -
11.62 +
11.63 - RETURN_META_VALUE(result, value)
11.64 Sets the META_RESULT for the plugin, and then returns the given value.
11.65 This assumes a non-void function, and it doesn't matter the particular
11.66 type of the return value.
11.67 -
11.68 +
11.69 - META_RESULT_STATUS
11.70 Gives the current status of META_RESULT for this routine from plugins
11.71 so far. It will return the "highest" result so far, in the order of
11.72 lesser to greater: IGNORED, HANDLED, OVERRIDE, SUPERCEDE (see also
11.73 above Operation Details)
11.74 -
11.75 +
11.76 - META_RESULT_PREVIOUS
11.77 Gives the META_RESULT of the previous plugin.
11.78 -
11.79 +
11.80 - META_RESULT_ORIG_RET(type)
11.81 Gives the "original" return value for the routine, ie the return value
11.82 of the routine from gameDLL. The type for the routine's return value
11.83 must be specified in the macro; this is used as a cast for assignment.
11.84 Note this is only valid in a "post" routine.
11.85 -
11.86 +
11.87 - META_RESULT_OVERRIDE_RET(type)
11.88 - Gives the return value from any previous plugin that specified
11.89 + Gives the return value from any previous plugin that specified
11.90 META_OVERRIDE or META_SUPERCEDE. The type for the routine's return
11.91 value must be specified in the macro; this is used as a cast for
11.92 assignment. This should only be used after checking the META_RESULT to
11.93 see if there's actually an override value available.
11.94 -
11.95 +
11.96 - MDLL_*(args)
11.97 - Calls a given DLLAPI routine in the gameDLL. For instance,
11.98 + Calls a given DLLAPI routine in the gameDLL. For instance,
11.99 MDLL_GameDLLInit(args), MDLL_Spawn(args), etc.
11.100 -
11.101 +
11.102 - MNEW_*(args)
11.103 - Calls a given NEWAPI routine in the gameDLL. For instance,
11.104 + Calls a given NEWAPI routine in the gameDLL. For instance,
11.105 MNEW_GameShutdown(args), etc.
11.106
11.107
11.108 @@ -222,54 +224,54 @@
11.109 style format string and arguments. A trailing newline is provided by
11.110 the routine and should not be specified in the string (unless you want
11.111 two newlines).
11.112 -
11.113 +
11.114 - void LOG_MESSAGE(PLID, char *fmt, ...)
11.115 Print a message line in the server logs. Message is specified as a
11.116 printf style format string and arguments. A trailing newline is
11.117 provided by the routine and should not be specified in the string. Log
11.118 message is prefixed by the logtag string in the plugin's "info"
11.119 struct, surrounded by brackets. For instance:
11.120 -
11.121 +
11.122 L 04/17/2001 - 18:00:35: [TraceAPI] Tracing Engine routine
11.123 'RegUserMsg'
11.124 -
11.125 +
11.126 - void LOG_ERROR(PLID, char *fmt, ...)
11.127 As in LOG_MESSAGE above, only marked as well with the string "ERROR:".
11.128 For example:
11.129 -
11.130 +
11.131 L 04/17/2001 - 18:03:13: [TraceAPI] ERROR: malloc failed
11.132 -
11.133 +
11.134 - void LOG_DEVELOPER(PLID, char *fmt, ...)
11.135 As in LOG_MESSAGE above, only message will be logged only if cvar
11.136 - developer is set to 1; message is marked as well with the string "dev:
11.137 - ". For example:
11.138 -
11.139 + developer is set to 1; message is marked as well with the string
11.140 + "dev:". For example:
11.141 +
11.142 L 04/17/2001 - 18:03:13: [TraceAPI] dev: called: GiveFnptrsToDll
11.143 -
11.144 +
11.145 - void CENTER_SAY(PLID, char *fmt, ...)
11.146 Prints a message on the center of all players' screens. This is like
11.147 the "centersay" of AdminMod, with pretty_say enabled, with the same
11.148 defaults (green, and a 10 second fade-in). A message is logged as
11.149 well, ie: [added in 1.06]
11.150 -
11.151 +
11.152 L 04/17/2001 - 15:44:52: [WDMISC] (centersay) random set up us the
11.153 bomb!
11.154 -
11.155 +
11.156 - void CENTER_SAY_PARMS(PLID, hudtextparms_t tparms, char *fmt, ...)
11.157 As in CENTER_SAY above, but allows specifying all the parameters. (see
11.158 SDK dlls/util.h for the struct hudtextparms_t). [added in 1.06]
11.159 -
11.160 +
11.161 - void CENTER_SAY_VARARGS(PLID, hudtextparms_t tparms, char *fmt,
11.162 va_list ap)
11.163 As in CENTER_SAY_PARMS above, only the message is passed as a
11.164 vsnprintf style varargs format string and args list. This is included
11.165 merely because both the previous CENTER_SAY functions actually call
11.166 this, and it was convenient to include it as well. [added in 1.06]
11.167 -
11.168 +
11.169 - qboolean CALL_GAME_ENTITY(PLID, char *entStr, entvars_t *pev)
11.170 Calls an entity function in the gameDLL. For instance, a bot usually
11.171 needs to call the player entity function. [added in 1.09]
11.172 -
11.173 +
11.174 - int GET_USER_MSG_ID(PLID, const char *name, int *size)
11.175 Returns the id number corresponding to the given message name, of
11.176 those messages registered by the gamedll with RegUserMsg, optionally
11.177 @@ -277,7 +279,7 @@
11.178 things like bots to access the name/id mapping without having to catch
11.179 RegUserMsg themselves, and thus have to be loaded at startup. [added
11.180 in 1.11]
11.181 -
11.182 +
11.183 - const char * GET_USER_MSG_NAME(PLID, int msgid, int *size)
11.184 Returns the name corresponding to the given msgid number, of those
11.185 messages registered by the gamedll with RegUserMsg, optionally
11.186 @@ -286,12 +288,12 @@
11.187 (SVC_TEMPENTITY, etc). The returned string is presumed to be a
11.188 compile-time constant string, stored in the text segment of the
11.189 gamedll. [added in 1.11]
11.190 -
11.191 +
11.192 - const char * GET_PLUGIN_PATH(PLID)
11.193 Returns the full pathname of the loaded dll/so file for the calling
11.194 plugin. The returned string is a pointer to a static buffer, and
11.195 should be copied by the caller to local storage. [added in 1.12]
11.196 -
11.197 +
11.198 - const char * GET_GAME_INFO(PLID, ginfo_t type)
11.199 Returns various string-based information about the running game/MOD/
11.200 gamedll. The given type can be one of:
11.201 @@ -308,6 +310,29 @@
11.202 The returned string is a pointer to a static buffer, and should be
11.203 copied by the caller to local storage. [added in 1.14]
11.204
11.205 + - int LOAD_PLUGIN(PLID, const char *name, PLUG_LOADTIME now, void
11.206 + **handle)
11.207 + Attempts to load a plugin as if "meta load <name>" was passed. If
11.208 + handle is passed, it will be NULL on failure or contain the DLL handle
11.209 + on success. Returns 0 for success, non-zero Metamod error value for
11.210 + failure. [added in 1.18]
11.211 +
11.212 + - int UNLOAD_PLUGIN(PLID, const char *name, PLUG_LOADTIME now,
11.213 + PL_UNLOAD_REASON reason)
11.214 + Attempts to unload a plugin given by name. A plugin cannot unload
11.215 + itself. Returns 0 for success, non-zero Metamod error value for
11.216 + failure. [added in 1.18]
11.217 +
11.218 + - int UNLOAD_PLUGIN_BY_HANDLE(PLID, void *handle, PLUG_LOADTIME now,
11.219 + PL_UNLOAD_REASON reason)
11.220 + Attempts to unload a plugin given by the DLL handle from LOAD_PLUGIN.
11.221 + A plugin cannot unload itself. Returns 0 for success, non-zero Metamod
11.222 + error value for failure. [added in 1.18]
11.223 +
11.224 + - const char *IS_QUERYING_CLIENT_CVAR(PLID, const edict_t *player)
11.225 + Returns the current cvar name that a client is being queried for, NULL
11.226 + if no queries are in session. [added in 1.18]
11.227 +
11.228
11.229 Plugin Loading
11.230 ==============
11.231 @@ -320,21 +345,25 @@
11.232
11.233 - dlopen() the file, store the handle
11.234 - dlsym() and call:
11.235 +
11.236 Meta_Init (if present)
11.237 GiveFnptrsToDll
11.238 Meta_Query
11.239 Meta_Attach
11.240 +
11.241 - if present, call function pointers, and store resulting function
11.242 table:
11.243 +
11.244 GetEntityAPI
11.245 GetEntityAPI2
11.246 GetNewDLLFunctions
11.247 -
11.248 +
11.249 GetEntityAPI_Post
11.250 GetEntityAPI2_Post
11.251 GetNewDLLFunctions_Post
11.252 -
11.253 +
11.254 GetEngineFunctions
11.255 GetEngineFunctions_Post
11.256
11.257 +
11.258 --------------------------------------------------------------------------
12.1 --- a/doc/txt/engine_notes.txt Fri Feb 18 20:52:34 2005 +0000
12.2 +++ b/doc/txt/engine_notes.txt Tue Aug 23 20:31:28 2005 +0000
12.3 @@ -158,6 +158,7 @@
12.4 - ProcessTutorMessageDecayBuffer
12.5 - ConstructTutorMessageDecayBuffer
12.6 - ResetTutorMessageDecayData
12.7 + - QueryClientCvar
12.8
12.9 --------------------------------------------------------------------------
12.10
12.11 @@ -333,8 +334,8 @@
12.12 FindEntityByString
12.13
12.14 from engine/eiface.h:
12.15 -edict_t *FindEntityByString(edict_t *pEdictStartSearchAfter, const char *
12.16 -pszField, const char *pszValue);
12.17 +edict_t *FindEntityByString(edict_t *pEdictStartSearchAfter, const char
12.18 +*pszField, const char *pszValue);
12.19 FIND_ENTITY_BY_STRING()
12.20
12.21 comments:
12.22 @@ -358,8 +359,8 @@
12.23 FindEntityInSphere
12.24
12.25 from engine/eiface.h:
12.26 -edict_t *FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *
12.27 -org, float rad);
12.28 +edict_t *FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float
12.29 +*org, float rad);
12.30 FIND_ENTITY_IN_SPHERE()
12.31
12.32 comments:
12.33 @@ -975,8 +976,10 @@
12.34
12.35 Returns a pointer to the base class type of the given edict. For
12.36 instance:
12.37 +
12.38 CBaseEntity *pPlayer=(CBaseEntity *)GET_PRIVATE(pEntity);
12.39 -
12.40 +
12.41 +
12.42
12.43 --------------------------------------------------------------------------
12.44
12.45 @@ -1156,7 +1159,7 @@
12.46 GameDLL, and returns a pointer to said function (much like unix dlsym
12.47 or win32 GetProcAddress?). This appears to be used in GameDLL code for
12.48 loading savegames, as the savegames contain names of exported
12.49 - functions in the GameDLL. Basically, this is the opposite of
12.50 + functions in the GameDLL. Basically, this is the opposite of
12.51 NameForFunction.
12.52
12.53 --------------------------------------------------------------------------
12.54 @@ -1216,7 +1219,7 @@
12.55
12.56 Returns the arguments for a command, as a single string. The command
12.57 string itself is not included, and must be queried with CMD_ARGV(0).
12.58 - For use in DLLAPI ClientCommand, or in the function provided to
12.59 + For use in DLLAPI ClientCommand, or in the function provided to
12.60 AddServerCommand.
12.61
12.62 --------------------------------------------------------------------------
12.63 @@ -1249,8 +1252,8 @@
12.64 GetAttachment
12.65
12.66 from engine/eiface.h:
12.67 -void GetAttachment(const edict_t *pEdict, int iAttachment, float *
12.68 -rgflOrigin, float *rgflAngles);
12.69 +void GetAttachment(const edict_t *pEdict, int iAttachment, float
12.70 +*rgflOrigin, float *rgflAngles);
12.71 GET_ATTACHMENT()
12.72
12.73 comments:
12.74 @@ -1390,7 +1393,7 @@
12.75
12.76 comments:
12.77
12.78 - Free the byte array of the given buffer which was returned by
12.79 + Free the byte array of the given buffer which was returned by
12.80 LoadFileForMe.
12.81
12.82 --------------------------------------------------------------------------
12.83 @@ -1431,7 +1434,7 @@
12.84 Copies the pathname of the game directory into the given buffer. Note
12.85 that there's no way to inform the engine how big the buffer is, so be
12.86 forewarned.
12.87 -
12.88 +
12.89 Prior to HL 1.1.1.1 (CS 1.6), this gave the full pathname of the game
12.90 directory, ie "/usr/local/half-life/cstrike" or "C:\Games\Half-Life\
12.91 cstrike". Now, it is only the string passed to hlds as the argument to
12.92 @@ -1524,12 +1527,12 @@
12.93 Returns the InfoKeyBuffer for the given edict. This is basically the
12.94 fields from "setinfo" at the client console, and includes things like
12.95 the player name.
12.96 -
12.97 +
12.98 The sourcecode comment ("passing in NULL gets the serverinfo") isn't
12.99 entirely accurate. There appear to be two server-side info buffers
12.100 available, "serverinfo" and "localinfo", both accessible from the
12.101 console by those two commands, respectively.
12.102 -
12.103 +
12.104 Calling GetInfoKeyBuffer(NULL) will return the localinfo buffer.
12.105 Calling GetInfoKeyBuffer(PEntityOfEntIndex(0)), ie passing the entity
12.106 of slot 0, will return the serverinfo buffer.
12.107 @@ -1555,7 +1558,7 @@
12.108 comments:
12.109
12.110 Adds or sets a key/value pair in the given InfoKeyBuffer. Appears to
12.111 - work for only server info, and not client info. For clients, use
12.112 + work for only server info, and not client info. For clients, use
12.113 SetClientKeyValue.
12.114
12.115 --------------------------------------------------------------------------
12.116 @@ -1633,9 +1636,9 @@
12.117 BuildSoundMsg
12.118
12.119 from engine/eiface.h:
12.120 -void BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int
12.121 -*/float volume, float attenuation, int fFlags, int pitch, int msg_dest,
12.122 -int msg_type, const float *pOrigin, edict_t *ed);
12.123 +void BuildSoundMsg(edict_t *entity, int channel, const char *sample, /
12.124 +*int*/float volume, float attenuation, int fFlags, int pitch, int
12.125 +msg_dest, int msg_type, const float *pOrigin, edict_t *ed);
12.126 BUILD_SOUND_MSG()
12.127
12.128 comments:
12.129 @@ -1911,8 +1914,8 @@
12.130 CreateInstancedBaseline
12.131
12.132 from engine/eiface.h:
12.133 -int CreateInstancedBaseline(int classname, struct entity_state_s *
12.134 -baseline);
12.135 +int CreateInstancedBaseline(int classname, struct entity_state_s
12.136 +*baseline);
12.137 ENGINE_INSTANCE_BASELINE()
12.138
12.139 comments:
12.140 @@ -1970,7 +1973,7 @@
12.141
12.142 Registers a new server console command. When the given command string
12.143 is typed at the console, the given function will be called. Arguments
12.144 - for the command can be retrieved in the function with Cmd_Args,
12.145 + for the command can be retrieved in the function with Cmd_Args,
12.146 Cmd_Argv, and Cmd_Argc.
12.147
12.148 --------------------------------------------------------------------------
12.149 @@ -2014,7 +2017,7 @@
12.150
12.151 The AuthID is a way for applications/mods to get the Authentication ID
12.152 (uniqueID) for a player. The AuthID can be a WonID or a SteamID. The
12.153 - function I've written returns the AuthID as a string. Calling
12.154 + function I've written returns the AuthID as a string. Calling
12.155 GetPlayerWONId will still work for Non-Steam players just like it
12.156 always has. If applications/mods want to get a jump start on getting
12.157 ready to support Steam players, then they can start using
12.158 @@ -2028,8 +2031,8 @@
12.159 using Steam will still have WonIDs (just like they always have). The
12.160 server now supports WonIDs\SteamIDs and banning using either of them.
12.161 WonIDs have not changed. SteamIDs use the format: STEAM_<#>:<#> where
12.162 - <#> is replaced by numbers. An example SteamID would be "STEAM_0:
12.163 - 94534".
12.164 + <#> is replaced by numbers. An example SteamID would be
12.165 + "STEAM_0:94534".
12.166
12.167 From Eric Smith <[email protected]> on hlcoders:
12.168 (list.valvesoftware.com/pipermail/hlcoders/2002-April/002925.html)
12.169 @@ -2057,8 +2060,8 @@
12.170 SequencePickSentence
12.171
12.172 from engine/eiface.h:
12.173 -void *SequencePickSentence(const char *groupName, int pickMethod, int *
12.174 -picked);
12.175 +void *SequencePickSentence(const char *groupName, int pickMethod, int
12.176 +*picked);
12.177
12.178 comments:
12.179
12.180 @@ -2164,3 +2167,19 @@
12.181 Added for HL 1xxx; no SDK update.
12.182
12.183 --------------------------------------------------------------------------
12.184 +
12.185 +QueryClientCvar
12.186 +
12.187 +void (*pfnQueryClientCvarValue)( const edict_t *player, const char
12.188 +*cvarName );
12.189 +
12.190 +from [email protected], via HLCoders
12.191 +
12.192 + Calling this function requests the value of cvarName from player. The
12.193 + result is returned via a callback from NEW_DLL_FUNCTIONS.
12.194 +
12.195 +comments:
12.196 +
12.197 + Added 2005/08/11, no SDK update.
12.198 +
12.199 +--------------------------------------------------------------------------
13.1 --- a/doc/txt/newapi_notes.txt Fri Feb 18 20:52:34 2005 +0000
13.2 +++ b/doc/txt/newapi_notes.txt Tue Aug 23 20:31:28 2005 +0000
13.3 @@ -6,6 +6,7 @@
13.4 - OnFreeEntPrivateData
13.5 - GameShutdown
13.6 - ShouldCollide
13.7 + - CvarValue
13.8
13.9 NOTE: No examples of these found in SDK...
13.10
13.11 @@ -53,3 +54,21 @@
13.12 Added in SDK 2.0.
13.13
13.14 --------------------------------------------------------------------------
13.15 +
13.16 +CvarValue
13.17 +
13.18 +void (*pfnCvarValue)( const edict_t *pEnt, const char *value );
13.19 +
13.20 +from [email protected], via HLCoders:
13.21 +
13.22 + When the client responds to the cvar request you will get a callback
13.23 + to pfnCvarValue() with the edict of the player who is responding and
13.24 + the cvars values.
13.25 +
13.26 +comments:
13.27 +
13.28 + This API can lead to conflicts when you query more than one cvar from
13.29 + a player at a time. Use IS_QUERYING_CLIENT_CVAR to check if another
13.30 + plugin is querying before you do so.
13.31 +
13.32 +--------------------------------------------------------------------------
14.1 --- a/doc/txt/release_notes.txt Fri Feb 18 20:52:34 2005 +0000
14.2 +++ b/doc/txt/release_notes.txt Tue Aug 23 20:31:28 2005 +0000
14.3 @@ -1,46 +1,59 @@
14.4 Release Notes
14.5 =-=-=-=-=-=-=
14.6
14.7 +Major changes with Metamod 1.18
14.8 +
14.9 + - New API version, with three new API functions for loading and
14.10 + unloading plugins from other plugins, and one new function for
14.11 + checking client cvar queries.
14.12 +
14.13 + - Support for new HLSDK API engine functions QueryClientCvarValue and
14.14 + CvarValue for querying client cvars.
14.15 +
14.16 + - Console command "meta version" shows the plugin interface version.
14.17 +
14.18 +--------------------------------------------------------------------------
14.19 +
14.20 Major changes with Metamod 1.17
14.21 ===============================
14.22
14.23 - New cvar "metamod_version" that can be queried from client game
14.24 browsers.
14.25 -
14.26 +
14.27 - New console commands available to clients (much like the existing
14.28 server console commands):
14.29 -
14.30 +
14.31 - "meta version" prints out version information (date, compile type,
14.32 etc).
14.33 - "meta list" shows a list of the plugins running on the server
14.34 (name, author, version, etc).
14.35 -
14.36 +
14.37 - New file config.ini to provide a more reliable and flexible method of
14.38 specifying configuration options. At the moment, the recognized
14.39 options mirror those from +localinfo, ie:
14.40 -
14.41 +
14.42 - debuglevel <number>
14.43 - gamedll <path>
14.44 - plugins_file <path>
14.45 - exec_cfg <path>
14.46 -
14.47 +
14.48 Default path is "addons/metamod/config.ini" but can be overridden with
14.49 "+localinfo mm_configfile".
14.50 -
14.51 +
14.52 Also, new console command "meta config" to display this information.
14.53 -
14.54 +
14.55 - New console command "meta require" to force the server to exit if the
14.56 specified plugin isn't loaded/running. Intended for use in server.cfg
14.57 or metaexec.cfg, to keep the server from starting up if desired
14.58 plugins don't load. For example:
14.59 -
14.60 +
14.61 - meta require adminmod
14.62 - meta require 1
14.63 -
14.64 +
14.65 The former requires that a plugin with the substring "adminmod" is
14.66 found loaded and running. The latter requires that the plugin in slot
14.67 1 is loaded and running.
14.68 -
14.69 +
14.70 - If an override gamedll is specified and found to be invalid or
14.71 missing, Metamod will now exit with an appropriate error message,
14.72 rather than just falling back to the auto-detected gamedll. This
14.73 @@ -61,16 +74,16 @@
14.74
14.75 - New config file names and locations, per the Addon Development
14.76 Standard rev 1.00, developed on the hlds_apps list.
14.77 -
14.78 +
14.79 Default config file locations are now:
14.80 - $gamedir/addons/metamod/plugins.ini
14.81 - $gamedir/addons/metamod/exec.cfg
14.82 -
14.83 +
14.84 Previous config file locations are also supported for backwards
14.85 compability:
14.86 - $gamedir/metamod.ini
14.87 - $gamedir/metaexec.cfg
14.88 -
14.89 +
14.90 Note that the pathnames in plugins.ini are unchanged, and are still
14.91 relative to the gamedir.
14.92
15.1 --- a/doc/txt/supportedmods.txt Fri Feb 18 20:52:34 2005 +0000
15.2 +++ b/doc/txt/supportedmods.txt Tue Aug 23 20:31:28 2005 +0000
15.3 @@ -71,8 +71,8 @@
15.4 | Day of Defeat | v1.2 | 2004/ | |
15.5 | (www.dayofdefeatmod.com) | | 07/30 | |
15.6 |------------------------------+----------+--------+---------------------|
15.7 -| Digital Paintball | v1.0 | 2002/ | |
15.8 -| (www.digitalpaintball.net) | | 10/06 | |
15.9 +| Digital Paintball | v2.2 | 2005/ | |
15.10 +| (www.digitalpaintball.net) | | 06/15 | |
15.11 |------------------------------+----------+--------+---------------------|
15.12 | Dragon Mod Z | v1.7 | 2002/ | |
15.13 | (dmz.flagrun.net) | | 10/06 | |
15.14 @@ -83,8 +83,8 @@
15.15 | Existence | Beta 1.3 | 2001/ | |
15.16 | | | 09/19 | |
15.17 |------------------------------+----------+--------+---------------------|
15.18 -| Firearms | v2.8 | 2003/ | |
15.19 -| (www.firearmsmod.com) | | 11/15 | |
15.20 +| Firearms | v3.0 | 2005/ | |
15.21 +| (www.firearmsmod.com) | | 05/09 | |
15.22 |------------------------------+----------+--------+---------------------|
15.23 | Retro Firearms | v2.5 | 2002/ | |
15.24 | (www.firearms25mod.tk) | | 01/11 | |
16.1 --- a/metamod/Config.mak Fri Feb 18 20:52:34 2005 +0000
16.2 +++ b/metamod/Config.mak Tue Aug 23 20:31:28 2005 +0000
16.3 @@ -4,9 +4,9 @@
16.4
16.5 SRCFILES = api_info.cpp commands_meta.cpp conf_meta.cpp dllapi.cpp \
16.6 engine_api.cpp game_support.cpp h_export.cpp linkent.cpp linkgame.cpp \
16.7 - linkplug.cpp log_meta.cpp metamod.cpp mhook.cpp mlist.cpp mplugin.cpp \
16.8 - mqueue.cpp mreg.cpp mutil.cpp osdep.cpp reg_support.cpp sdk_util.cpp \
16.9 - studioapi.cpp support_meta.cpp thread_logparse.cpp vdate.cpp
16.10 + linkplug.cpp log_meta.cpp metamod.cpp mhook.cpp mlist.cpp mplayer.cpp \
16.11 + mplugin.cpp mqueue.cpp mreg.cpp mutil.cpp osdep.cpp reg_support.cpp \
16.12 + sdk_util.cpp studioapi.cpp support_meta.cpp thread_logparse.cpp vdate.cpp
16.13
16.14 INFOFILES = info_name.h vers_meta.h
16.15 RESFILE = res_meta.rc
17.1 --- a/metamod/api_info.cpp Fri Feb 18 20:52:34 2005 +0000
17.2 +++ b/metamod/api_info.cpp Tue Aug 23 20:31:28 2005 +0000
17.3 @@ -97,6 +97,8 @@
17.4 { mFALSE, 16, "OnFreeEntPrivateData" }, // pfnOnFreeEntPrivateData
17.5 { mFALSE, 3, "GameShutdown" }, // pfnGameShutdown
17.6 { mFALSE, 14, "ShouldCollide" }, // pfnShouldCollide
17.7 + // Added 2005/08/11 (no SDK update)
17.8 + { mFALSE, 3, "CvarValue" }, // pfnCvarValue
17.9 { mFALSE, 0, NULL },
17.10 };
17.11
17.12 @@ -259,6 +261,8 @@
17.13 { mFALSE, 30, "ProcessTutorMessageDecayBuffer" }, // pfnProcessTutorMessageDecayBuffer
17.14 { mFALSE, 30, "ConstructTutorMessageDecayBuffer" }, // pfnConstructTutorMessageDecayBuffer
17.15 { mFALSE, 9, "ResetTutorMessageDecayData" }, // pfnResetTutorMessageDecayData
17.16 + // Added 2005/08/11 (no SDK update)
17.17 + { mFALSE, 3, "QueryClientCvarValue" }, //pfnQueryClientCvarValue
17.18 // end
17.19 { mFALSE, 0, NULL },
17.20 };
18.1 --- a/metamod/api_info.h Fri Feb 18 20:52:34 2005 +0000
18.2 +++ b/metamod/api_info.h Tue Aug 23 20:31:28 2005 +0000
18.3 @@ -112,6 +112,8 @@
18.4 api_info_t pfnOnFreeEntPrivateData;
18.5 api_info_t pfnGameShutdown;
18.6 api_info_t pfnShouldCollide;
18.7 + // Added 2005/08/11 (no SDK update)
18.8 + api_info_t pfnCvarValue;
18.9 api_info_t END;
18.10 } newapi_info_t;
18.11
18.12 @@ -276,6 +278,8 @@
18.13 api_info_t pfnProcessTutorMessageDecayBuffer;
18.14 api_info_t pfnConstructTutorMessageDecayBuffer;
18.15 api_info_t pfnResetTutorMessageDecayData;
18.16 + // Added 2005/08/11 (no SDK update)
18.17 + api_info_t pfnQueryClientCvarValue;
18.18 // end
18.19 api_info_t END;
18.20 } engine_info_t;
19.1 --- a/metamod/commands_meta.cpp Fri Feb 18 20:52:34 2005 +0000
19.2 +++ b/metamod/commands_meta.cpp Tue Aug 23 20:31:28 2005 +0000
19.3 @@ -35,6 +35,7 @@
19.4 */
19.5
19.6 #include <ctype.h> // isdigit()
19.7 +#include <stdlib.h> // strtol()
19.8
19.9 #include <extdll.h> // always
19.10
19.11 @@ -159,7 +160,7 @@
19.12 META_CONS("usage: meta version");
19.13 return;
19.14 }
19.15 - META_CONS("%s v%s %s", VNAME, VVERSION, VDATE);
19.16 + META_CONS("%s v%s %s (%s)", VNAME, VVERSION, VDATE, META_INTERFACE_VERSION);
19.17 META_CONS("by %s", VAUTHOR);
19.18 META_CONS(" %s", VURL);
19.19 META_CONS("compiled: %s %s (%s)", COMPILE_TIME, COMPILE_TZONE, OPT_TYPE);
19.20 @@ -171,10 +172,11 @@
19.21 META_CLIENT(pEntity, "usage: meta version");
19.22 return;
19.23 }
19.24 - META_CLIENT(pEntity, "%s v%s %s", VNAME, VVERSION, VDATE);
19.25 + META_CLIENT(pEntity, "%s v%s %s (%s)", VNAME, VVERSION, VDATE, META_INTERFACE_VERSION);
19.26 META_CLIENT(pEntity, "by %s", VAUTHOR);
19.27 META_CLIENT(pEntity, " %s", VURL);
19.28 META_CLIENT(pEntity, "compiled: %s %s (%s)", COMPILE_TIME, COMPILE_TZONE, OPT_TYPE);
19.29 + META_CLIENT(pEntity, "ifvers: %s", META_INTERFACE_VERSION);
19.30 }
19.31
19.32 // "meta gpl" console command.
19.33 @@ -243,7 +245,7 @@
19.34 META_CONS("usage: meta list");
19.35 return;
19.36 }
19.37 - Plugins->show();
19.38 + Plugins->show(0);
19.39 }
19.40
19.41 // "meta list" client command.
19.42 @@ -343,11 +345,14 @@
19.43 }
19.44 // i=2 to skip first arg, as that's the "cmd"
19.45 for(i=2; i < argc; i++) {
19.46 + int pindex;
19.47 + char *endptr;
19.48 arg=CMD_ARGV(i);
19.49
19.50 // try to match plugin id first
19.51 - if(isdigit(arg[0]))
19.52 - findp=Plugins->find(atoi(arg));
19.53 + pindex = strtol(arg, &endptr, 10);
19.54 + if (*arg != '\0' && *endptr == '\0')
19.55 + findp=Plugins->find(pindex);
19.56 // else try to match some string (prefix)
19.57 else
19.58 findp=Plugins->find_match(arg);
19.59 @@ -414,9 +419,9 @@
19.60 }
19.61 else if(pcmd==PC_UNLOAD) {
19.62 findp->action=PA_UNLOAD;
19.63 - if(findp->unload(PT_ANYTIME, PNL_COMMAND)) {
19.64 + if(findp->unload(PT_ANYTIME, PNL_COMMAND, PNL_COMMAND)) {
19.65 META_CONS("Unloaded plugin '%s'", findp->desc);
19.66 - Plugins->show();
19.67 + Plugins->show(0);
19.68 }
19.69 else if(meta_errno == ME_DELAYED)
19.70 META_CONS("Unload delayed for plugin '%s'", findp->desc);
19.71 @@ -425,9 +430,9 @@
19.72 }
19.73 else if(pcmd==PC_FORCE_UNLOAD) {
19.74 findp->action=PA_UNLOAD;
19.75 - if(findp->unload(PT_ANYTIME, PNL_CMD_FORCED)) {
19.76 + if(findp->unload(PT_ANYTIME, PNL_CMD_FORCED, PNL_CMD_FORCED)) {
19.77 META_CONS("Forced unload plugin '%s'", findp->desc);
19.78 - Plugins->show();
19.79 + Plugins->show(0);
19.80 }
19.81 else
19.82 META_CONS("Forced unload failed for plugin '%s'", findp->desc);
19.83 @@ -452,7 +457,7 @@
19.84 else if(pcmd==PC_CLEAR) {
19.85 if(findp->clear()) {
19.86 META_CONS("Cleared failed plugin '%s' from list", findp->desc);
19.87 - Plugins->show();
19.88 + Plugins->show(0);
19.89 }
19.90 else
19.91 META_CONS("Clear failed for plugin '%s'", findp->desc);
20.1 --- a/metamod/dllapi.cpp Fri Feb 18 20:52:34 2005 +0000
20.2 +++ b/metamod/dllapi.cpp Tue Aug 23 20:31:28 2005 +0000
20.3 @@ -143,10 +143,12 @@
20.4
20.5 // From SDK dlls/client.cpp:
20.6 BOOL mm_ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] ) {
20.7 + g_Players.clear_player_cvar_query(pEntity);
20.8 META_DLLAPI_HANDLE(BOOL, TRUE, FN_CLIENTCONNECT, pfnClientConnect, (pEntity, pszName, pszAddress, szRejectReason));
20.9 RETURN_API();
20.10 }
20.11 void mm_ClientDisconnect(edict_t *pEntity) {
20.12 + g_Players.clear_player_cvar_query(pEntity);
20.13 META_DLLAPI_HANDLE_void(FN_CLIENTDISCONNECT, pfnClientDisconnect, (pEntity));
20.14 RETURN_API_void();
20.15 }
20.16 @@ -191,6 +193,7 @@
20.17 Plugins->refresh(PT_CHANGELEVEL);
20.18 Plugins->unpause_all();
20.19 // Plugins->retry_all(PT_CHANGELEVEL);
20.20 + g_Players.clear_all_cvar_queries();
20.21 RETURN_API_void();
20.22 }
20.23 void mm_PlayerPreThink(edict_t *pEntity) {
20.24 @@ -321,7 +324,12 @@
20.25 META_NEWAPI_HANDLE(int, 1, FN_SHOULDCOLLIDE, pfnShouldCollide, (pentTouched, pentOther));
20.26 RETURN_API();
20.27 }
20.28 -
20.29 +// Added 2005/08/11 (no SDK update)
20.30 +void mm_CvarValue(const edict_t *pEdict, const char *value) {
20.31 + g_Players.clear_player_cvar_query(pEdict);
20.32 + META_NEWAPI_HANDLE_void(FN_CVARVALUE, pfnCvarValue, (pEdict, value));
20.33 + RETURN_API_void();
20.34 +}
20.35
20.36 // From SDK dlls/cbase.cpp:
20.37 // "(wd)" indicates my comments on the functions
20.38 @@ -454,6 +462,8 @@
20.39 mm_OnFreeEntPrivateData, //! pfnOnFreeEntPrivateData() Called right before the object's memory is freed. Calls its destructor.
20.40 mm_GameShutdown, //! pfnGameShutdown()
20.41 mm_ShouldCollide, //! pfnShouldCollide()
20.42 + // Added 2005/08/11 (no SDK update)
20.43 + mm_CvarValue, //! pfnCvarValue()
20.44 };
20.45
20.46 C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion)
20.47 @@ -475,6 +485,11 @@
20.48 *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION;
20.49 return(FALSE);
20.50 }
20.51 - memcpy(pNewFunctionTable, &gNewFunctionTable, sizeof(NEW_DLL_FUNCTIONS));
20.52 +
20.53 + // Detect old engine
20.54 + if (!IS_VALID_PTR((void *)g_engfuncs.pfnQueryClientCvarValue))
20.55 + memcpy(pNewFunctionTable, &gNewFunctionTable, sizeof(NEW_DLL_FUNCTIONS) - sizeof(FN_CVARVALUE));
20.56 + else
20.57 + memcpy(pNewFunctionTable, &gNewFunctionTable, sizeof(NEW_DLL_FUNCTIONS));
20.58 return(TRUE);
20.59 }
21.1 --- a/metamod/dllapi.h Fri Feb 18 20:52:34 2005 +0000
21.2 +++ b/metamod/dllapi.h Tue Aug 23 20:31:28 2005 +0000
21.3 @@ -119,6 +119,7 @@
21.4 extern void mm_OnFreeEntPrivateData(edict_t pEnt);
21.5 extern void mm_GameShutdown(void);
21.6 extern int mm_ShouldCollide(edict_t *pentTouched, edict_t *pentOther);
21.7 +extern void mm_CvarValue(const edict_t *pEnt, const char *value);
21.8
21.9
21.10 // Typedefs for the above functions:
21.11 @@ -180,5 +181,7 @@
21.12 typedef void (*FN_ONFREEENTPRIVATEDATA) (edict_t *pEnt);
21.13 typedef void (*FN_GAMESHUTDOWN) (void);
21.14 typedef int (*FN_SHOULDCOLLIDE) (edict_t *pentTouched, edict_t *pentOther);
21.15 +//Added 2005/08/11 (no SDK update)
21.16 +typedef void (*FN_CVARVALUE)(const edict_t *pEnt, const char *value);
21.17
21.18 #endif /* DLLAPI_H */
22.1 --- a/metamod/engine_api.cpp Fri Feb 18 20:52:34 2005 +0000
22.2 +++ b/metamod/engine_api.cpp Tue Aug 23 20:31:28 2005 +0000
22.3 @@ -452,6 +452,9 @@
22.4 META_ENGINE_HANDLE(int, 0, FN_REGUSERMSG, pfnRegUserMsg, (pszName, iSize));
22.5 // Expand the macro, since we need to do extra work.
22.6 /// RETURN_API()
22.7 + if (--CALL_API_count>0)
22.8 + /*Restore backup*/
22.9 + PublicMetaGlobals = backup_meta_globals;
22.10 if(status==MRES_OVERRIDE) {
22.11 META_DEBUG(loglevel, ("Returning (override) %s()", pfn_string));
22.12 imsgid=override_ret;
22.13 @@ -860,6 +863,19 @@
22.14 RETURN_API_void()
22.15 }
22.16
22.17 +//Added 2005/08/11 (no SDK update)
22.18 +void mm_QueryClientCvarValue(const edict_t *pEdict, const char *cvarName)
22.19 +{
22.20 + //Engine version didn't change when this API was added. Check if pointer is valid.
22.21 + if (g_engfuncs.pfnQueryClientCvarValue &&
22.22 + !IS_VALID_PTR((void *)g_engfuncs.pfnQueryClientCvarValue))
22.23 + g_engfuncs.pfnQueryClientCvarValue = 0;
22.24 +
22.25 + g_Players.set_player_cvar_query(pEdict, cvarName);
22.26 +
22.27 + META_ENGINE_HANDLE_void(FN_QUERYCLIENTCVARVALUE, pfnQueryClientCvarValue, (pEdict, cvarName));
22.28 + RETURN_API_void();
22.29 +}
22.30
22.31 enginefuncs_t meta_engfuncs = {
22.32 mm_PrecacheModel, // pfnPrecacheModel()
22.33 @@ -1064,4 +1080,9 @@
22.34 mm_ProcessTutorMessageDecayBuffer, // pfnProcessTutorMessageDecayBuffer()
22.35 mm_ConstructTutorMessageDecayBuffer, // pfnConstructTutorMessageDecayBuffer()
22.36 mm_ResetTutorMessageDecayData, // pfnResetTutorMessageDecayData()
22.37 +
22.38 + //Added 2005/08/11 (no SDK update)
22.39 + mm_QueryClientCvarValue, // pfnQueryClientCvarValue()
22.40 };
22.41 +
22.42 +
23.1 --- a/metamod/engine_api.h Fri Feb 18 20:52:34 2005 +0000
23.2 +++ b/metamod/engine_api.h Tue Aug 23 20:31:28 2005 +0000
23.3 @@ -269,6 +269,8 @@
23.4 extern void mm_ProcessTutorMessageDecayBuffer(int *buffer, int bufferLength);
23.5 extern void mm_ConstructTutorMessageDecayBuffer(int *buffer, int bufferLength);
23.6 extern void mm_ResetTutorMessageDecayData(void);
23.7 +//Added 2005/08/11 (no SDK update)
23.8 +extern void mm_QueryClientCvarValue(const edict_t *pEdict, const char *cvarName);
23.9
23.10
23.11 // Typedefs for the above functions:
23.12 @@ -445,5 +447,7 @@
23.13 typedef void (*FN_PROCESSTUTORMESSAGEDECAYBUFFER) (int *buffer, int bufferLength);
23.14 typedef void (*FN_CONSTRUCTTUTORMESSAGEDECAYBUFFER) (int *buffer, int bufferLength);
23.15 typedef void (*FN_RESETTUTORMESSAGEDECAYDATA) (void);
23.16 +//Added 2005/08/11 (no SDK update)
23.17 +typedef void (*FN_QUERYCLIENTCVARVALUE)(const edict_t *pEdict, const char *cvarName);
23.18
23.19 #endif /* ENGINE_API_H */
24.1 --- a/metamod/ents/digitalpaintball Fri Feb 18 20:52:34 2005 +0000
24.2 +++ b/metamod/ents/digitalpaintball Tue Aug 23 20:31:28 2005 +0000
24.3 @@ -5,7 +5,7 @@
24.4 //
24.5 // Gamedir: dpb
24.6 // Win32 : pb.dll
24.7 -// Linux : pg_i686.so
24.8 +// Linux : pb.i386.so
24.9
24.10 // Version 1.0
24.11 //
24.12 @@ -45,3 +45,14 @@
24.13 weapon_matrix
24.14 weapon_orracle
24.15 weapon_timmy
24.16 +
24.17 +// Version 2.2
24.18 +//
24.19 +// Linux DSO name changed from pg_i686.so to pb.i386.so
24.20 +//
24.21 +// Date: Jun 15, 2005 2:24 PM
24.22 +// From: From: Ken Jimenez <goldeneagle68@_at_gmail.com>
24.23 +weapon_a5
24.24 +weapon_blazer
24.25 +weapon_dm4
24.26 +weapon_omen
25.1 --- a/metamod/ents/firearms Fri Feb 18 20:52:34 2005 +0000
25.2 +++ b/metamod/ents/firearms Tue Aug 23 20:31:28 2005 +0000
25.3 @@ -152,6 +152,11 @@
25.4 // Date: Mon, 12 Apr 2004 15:33:56 -0400
25.5 //
25.6 env_precip
25.7 -trigger_noclaymore
25.8 trigger_reinforcements
25.9 weapon_m14
25.10 +
25.11 +// Version 3.0
25.12 +//
25.13 +// From: "[FFM2D1]Tyler_Durden" <[email protected]>
25.14 +// Date: Thu, 05 May 2005 23:21:15 +0100
25.15 +trigger_noclaymores
26.1 --- a/metamod/games.h Fri Feb 18 20:52:34 2005 +0000
26.2 +++ b/metamod/games.h Tue Aug 23 20:31:28 2005 +0000
26.3 @@ -61,7 +61,7 @@
26.4 {"dcrisis", "dc"MODARCH".so", "dc.dll", "Desert Crisis"},
26.5 {"dmc", "dmc"MODARCH".so", "dmc.dll", "Deathmatch Classic"},
26.6 {"dod", "dod"MODARCH".so", "dod.dll", "Day of Defeat"},
26.7 - {"dpb", "pb_i686.so", "pb.dll", "Digital Paintball"},
26.8 + {"dpb", "pb.i386.so", "pb.dll", "Digital Paintball"},
26.9 {"dragonmodz", "hl"MODARCH".so", "mp.dll", "Dragon Mod Z"},
26.10 {"esf", "hl"MODARCH".so", "hl.dll", "Earth's Special Forces"},
26.11 {"existence", "ex"MODARCH".so", "existence.dll", "Existence"},
27.1 --- a/metamod/info_name.h Fri Feb 18 20:52:34 2005 +0000
27.2 +++ b/metamod/info_name.h Tue Aug 23 20:31:28 2005 +0000
27.3 @@ -43,13 +43,14 @@
27.4 #define VAUTHOR "Will Day <[email protected]>"
27.5 #define VURL "http://www.metamod.org/"
27.6
27.7 -#define COPYRIGHT_YEAR "2004"
27.8 +#define COPYRIGHT_YEAR "2005"
27.9
27.10 // Various strings for the Windows DLL Resources in res_meta.rc
27.11 #define RC_COMMENTS "Metamod allows running multiple mod-like plugin DLLs, to add functionality or change the behavior of the running HLDS game mod. See " VURL
27.12 #define RC_DESC "Metamod Half-Life MOD DLL"
27.13 #define RC_FILENAME "METAMOD.DLL"
27.14 #define RC_INTERNAL "METAMOD"
27.15 -#define RC_COPYRIGHT "Copyright� 2001-" COPYRIGHT_YEAR "Will Day; licensed under the GPL"
27.16 +#define RC_COPYRIGHT "Copyright� 2001-" COPYRIGHT_YEAR " Will Day; GPL licensed"
27.17 +#define RC_LICENSE "Licensed under the GNU General Public License"
27.18
27.19 #endif /* INFO_NAME_H */
28.1 --- a/metamod/linkgame.cpp Fri Feb 18 20:52:34 2005 +0000
28.2 +++ b/metamod/linkgame.cpp Tue Aug 23 20:31:28 2005 +0000
28.3 @@ -2475,7 +2475,7 @@
28.4 LINK_ENTITY_TO_GAME(trigger_motion);
28.5 LINK_ENTITY_TO_GAME(trigger_multiple);
28.6 LINK_ENTITY_TO_GAME(trigger_music);
28.7 -LINK_ENTITY_TO_GAME(trigger_noclaymore);
28.8 +LINK_ENTITY_TO_GAME(trigger_noclaymores);
28.9 LINK_ENTITY_TO_GAME(trigger_npcarea);
28.10 LINK_ENTITY_TO_GAME(trigger_objectcapture);
28.11 LINK_ENTITY_TO_GAME(trigger_once);
28.12 @@ -2587,6 +2587,7 @@
28.13 LINK_ENTITY_TO_GAME(weapon_Revolutionnaire);
28.14 LINK_ENTITY_TO_GAME(weapon_SPchemicalgun);
28.15 LINK_ENTITY_TO_GAME(weapon_Sabre);
28.16 +LINK_ENTITY_TO_GAME(weapon_a5);
28.17 LINK_ENTITY_TO_GAME(weapon_aandagger);
28.18 LINK_ENTITY_TO_GAME(weapon_acannon);
28.19 LINK_ENTITY_TO_GAME(weapon_acidrocket);
28.20 @@ -2672,6 +2673,7 @@
28.21 LINK_ENTITY_TO_GAME(weapon_bitegun);
28.22 LINK_ENTITY_TO_GAME(weapon_bizon);
28.23 LINK_ENTITY_TO_GAME(weapon_blaster);
28.24 +LINK_ENTITY_TO_GAME(weapon_blazer);
28.25 LINK_ENTITY_TO_GAME(weapon_blink);
28.26 LINK_ENTITY_TO_GAME(weapon_blowpipe);
28.27 LINK_ENTITY_TO_GAME(weapon_bodypart);
28.28 @@ -2771,6 +2773,7 @@
28.29 LINK_ENTITY_TO_GAME(weapon_disintegrator);
28.30 LINK_ENTITY_TO_GAME(weapon_displacer);
28.31 LINK_ENTITY_TO_GAME(weapon_divinewind);
28.32 +LINK_ENTITY_TO_GAME(weapon_dm4);
28.33 LINK_ENTITY_TO_GAME(weapon_dml);
28.34 LINK_ENTITY_TO_GAME(weapon_double);
28.35 LINK_ENTITY_TO_GAME(weapon_doublemagicmisslespell);
28.36 @@ -3058,6 +3061,7 @@
28.37 LINK_ENTITY_TO_GAME(weapon_null);
28.38 LINK_ENTITY_TO_GAME(weapon_nva_grenade);
28.39 LINK_ENTITY_TO_GAME(weapon_oicw);
28.40 +LINK_ENTITY_TO_GAME(weapon_omen);
28.41 LINK_ENTITY_TO_GAME(weapon_orbital);
28.42 LINK_ENTITY_TO_GAME(weapon_orracle);
28.43 LINK_ENTITY_TO_GAME(weapon_p225);
29.1 --- a/metamod/meta_api.h Fri Feb 18 20:52:34 2005 +0000
29.2 +++ b/metamod/meta_api.h Tue Aug 23 20:31:28 2005 +0000
29.3 @@ -59,23 +59,15 @@
29.4 // Version 5:8 added GetPluginPath [v1.11]
29.5 // Version 5:9 added GetGameInfo [v1.14]
29.6 // Version 5:10 added GINFO_REALDLL_FULLPATH for GetGameInfo [v1.17]
29.7 -#define META_INTERFACE_VERSION "5:10"
29.8 +// Version 5:11 added plugin loading and unloading API [v1.18]
29.9 +// Version 5:12 added util code for checking player query status [v1.18]
29.10 +#define META_INTERFACE_VERSION "5:12"
29.11
29.12 #ifdef UNFINISHED
29.13 // Version 5:99 added event hook utility functions [v.???]
29.14 #define META_INTERFACE_VERSION "5:99"
29.15 #endif /* UNFINISHED */
29.16
29.17 -// Flags to indicate why the plugin is being unloaded.
29.18 -typedef enum {
29.19 - PNL_NULL = 0,
29.20 - PNL_INI_DELETED, // was deleted from plugins.ini
29.21 - PNL_FILE_NEWER, // file on disk is newer than last load
29.22 - PNL_COMMAND, // requested by server/console command
29.23 - PNL_CMD_FORCED, // forced by server/console command
29.24 - PNL_DELAYED, // delayed from previous request; can't tell origin
29.25 -} PL_UNLOAD_REASON;
29.26 -
29.27 // Flags returned by a plugin's api function.
29.28 // NOTE: order is crucial, as greater/less comparisons are made.
29.29 typedef enum {
29.30 @@ -238,5 +230,6 @@
29.31 #define MNEW_OnFreeEntPrivateData MNEW_FUNC->pfnOnFreeEntPrivateData
29.32 #define MNEW_GameShutdown MNEW_FUNC->pfnGameShutdown
29.33 #define MNEW_ShouldCollide MNEW_FUNC->pfnShouldCollide
29.34 +#define MNEW_CvarValue MNEW_FUNC->pfnCvarValue
29.35
29.36 #endif /* META_API_H */
30.1 --- a/metamod/metamod.cpp Fri Feb 18 20:52:34 2005 +0000
30.2 +++ b/metamod/metamod.cpp Tue Aug 23 20:31:28 2005 +0000
30.3 @@ -81,6 +81,10 @@
30.4 MRegCvarList *RegCvars;
30.5 MRegMsgList *RegMsgs;
30.6
30.7 +MPlayerList g_Players;
30.8 +
30.9 +unsigned int CALL_API_count = 0;
30.10 +
30.11 #ifdef UNFINISHED
30.12 MHookList *Hooks;
30.13 #endif /* UNFINISHED */
30.14 @@ -187,6 +191,7 @@
30.15 Engine.pl_funcs->pfnCVarRegister = meta_CVarRegister;
30.16 Engine.pl_funcs->pfnCvar_RegisterVariable = meta_CVarRegister;
30.17 Engine.pl_funcs->pfnRegUserMsg = meta_RegUserMsg;
30.18 + Engine.pl_funcs->pfnQueryClientCvarValue = meta_QueryClientCvarValue;
30.19
30.20 #ifdef UNFINISHED
30.21 // Init the list of event/logline hooks.
30.22 @@ -361,8 +366,7 @@
30.23 // Yes...another macro.
30.24 #define GET_FUNC_TABLE_FROM_GAME(gamedll, pfnGetFuncs, STR_GetFuncs, struct_field, API_TYPE, TABLE_TYPE, vers_pass, vers_int, vers_want, gotit) \
30.25 if((pfnGetFuncs = (API_TYPE) DLSYM(gamedll.handle, STR_GetFuncs))) { \
30.26 - gamedll.funcs.struct_field = (TABLE_TYPE*) malloc(sizeof(TABLE_TYPE)); \
30.27 - memset(gamedll.funcs.struct_field, 0, sizeof(gamedll.funcs.struct_field)); \
30.28 + gamedll.funcs.struct_field = (TABLE_TYPE*) calloc(1, sizeof(TABLE_TYPE)); \
30.29 if(!gamedll.funcs.struct_field) {\
30.30 META_ERROR("malloc failed for gamedll struct_field: %s", STR_GetFuncs); \
30.31 } \
30.32 @@ -425,3 +429,4 @@
30.33 META_LOG("Game DLL for '%s' loaded successfully", GameDLL.desc);
30.34 return(mTRUE);
30.35 }
30.36 +
31.1 --- a/metamod/metamod.h Fri Feb 18 20:52:34 2005 +0000
31.2 +++ b/metamod/metamod.h Tue Aug 23 20:31:28 2005 +0000
31.3 @@ -43,6 +43,7 @@
31.4 #include "conf_meta.h" // MConfig
31.5 #include "osdep.h" // NAME_MAX, etc
31.6 #include "types_meta.h" // mBOOL
31.7 +#include "mplayer.h" // MPlayerList
31.8
31.9 // file that lists plugins to load at startup
31.10 #define PLUGINS_INI "addons/metamod/plugins.ini"
31.11 @@ -58,6 +59,7 @@
31.12 // generic config file
31.13 #define CONFIG_INI "addons/metamod/config.ini"
31.14
31.15 +
31.16 // cvar to contain version
31.17 extern cvar_t meta_version;
31.18
31.19 @@ -115,6 +117,20 @@
31.20 extern meta_globals_t PublicMetaGlobals;
31.21 extern meta_globals_t PrivateMetaGlobals;
31.22
31.23 +// (patch by hullu)
31.24 +// Safety check for metamod-bot-plugin bugfix.
31.25 +// engine_api->pfnRunPlayerMove calls dllapi-functions before it returns.
31.26 +// This causes problems with bots running as metamod plugins, because
31.27 +// metamod assumed that PublicMetaGlobals is free to be used.
31.28 +// With call_count we can fix this by backuping up PublicMetaGlobals if
31.29 +// it's already being used.
31.30 +extern unsigned int CALL_API_count;
31.31 +
31.32 +// (patch by BAILOPAN)
31.33 +// Holds cached player info, right now only things for querying cvars
31.34 +// Max players is always 32, small enough that we can use a static array
31.35 +extern MPlayerList g_Players;
31.36 +
31.37 void metamod_startup(void);
31.38
31.39 mBOOL meta_init_gamedll(void);
31.40 @@ -185,7 +201,11 @@
31.41 FN_TYPE pfn_routine=NULL; \
31.42 int loglevel=api_info_table.pfnName.loglevel; \
31.43 char *pfn_string=api_info_table.pfnName.name; \
31.44 - memset(&PublicMetaGlobals, 0, sizeof(PublicMetaGlobals));
31.45 + meta_globals_t backup_meta_globals; \
31.46 + /* fix bug with metamod-bot-plugins (hullu)*/ \
31.47 + if (CALL_API_count++>0) \
31.48 + /* backup publicmetaglobals */ \
31.49 + backup_meta_globals = PublicMetaGlobals;
31.50
31.51 // call each plugin
31.52 #define CALL_PLUGIN_API_void(post, pfnName, pfn_args, api_table) \
31.53 @@ -219,6 +239,7 @@
31.54
31.55 // call "real" function, from gamedll
31.56 #define CALL_GAME_API_void(pfnName, pfn_args, api_table) \
31.57 + CALL_API_count--; \
31.58 if(status==MRES_SUPERCEDE) { \
31.59 META_DEBUG(loglevel, ("Skipped (supercede) %s:%s()", GameDLL.file, pfn_string)); \
31.60 /* don't return here; superceded game routine, but still allow \
31.61 @@ -226,8 +247,7 @@
31.62 */ \
31.63 } \
31.64 else if(GameDLL.funcs.api_table) { \
31.65 - pfn_routine=NULL; \
31.66 - if(GameDLL.funcs.api_table && (pfn_routine=GameDLL.funcs.api_table->pfnName)); \
31.67 + pfn_routine=GameDLL.funcs.api_table->pfnName; \
31.68 if(pfn_routine) { \
31.69 META_DEBUG(loglevel, ("Calling %s:%s()", GameDLL.file, pfn_string)); \
31.70 pfn_routine pfn_args; \
31.71 @@ -240,10 +260,12 @@
31.72 } \
31.73 else { \
31.74 META_DEBUG(loglevel, ("No api table defined for api call: %s:%s", GameDLL.file, pfn_string)); \
31.75 - }
31.76 + } \
31.77 + CALL_API_count++;
31.78
31.79 // call "real" function, from engine
31.80 #define CALL_ENGINE_API_void(pfnName, pfn_args) \
31.81 + CALL_API_count--; \
31.82 if(status==MRES_SUPERCEDE) { \
31.83 META_DEBUG(loglevel, ("Skipped (supercede) engine:%s()", pfn_string)); \
31.84 /* don't return here; superceded game routine, but still allow \
31.85 @@ -251,7 +273,6 @@
31.86 */ \
31.87 } \
31.88 else { \
31.89 - pfn_routine=NULL; \
31.90 pfn_routine=Engine.funcs->pfnName; \
31.91 if(pfn_routine) { \
31.92 META_DEBUG(loglevel, ("Calling engine:%s()", pfn_string)); \
31.93 @@ -261,10 +282,14 @@
31.94 META_ERROR("Couldn't find api call: engine:%s", pfn_string); \
31.95 status=MRES_UNSET; \
31.96 } \
31.97 - }
31.98 + } \
31.99 + CALL_API_count++;
31.100
31.101 // return (void)
31.102 #define RETURN_API_void() \
31.103 + if (--CALL_API_count>0) \
31.104 + /*restore backup*/ \
31.105 + PublicMetaGlobals = backup_meta_globals; \
31.106 return;
31.107
31.108
31.109 @@ -283,7 +308,11 @@
31.110 FN_TYPE pfn_routine=NULL; \
31.111 int loglevel=api_info_table.pfnName.loglevel; \
31.112 char *pfn_string=api_info_table.pfnName.name; \
31.113 - memset(&PublicMetaGlobals, 0, sizeof(PublicMetaGlobals));
31.114 + meta_globals_t backup_meta_globals; \
31.115 + /*Fix bug with metamod-bot-plugins*/ \
31.116 + if (CALL_API_count++>0) \
31.117 + /*Backup PublicMetaGlobals*/ \
31.118 + backup_meta_globals = PublicMetaGlobals;
31.119
31.120 // call each plugin
31.121 #define CALL_PLUGIN_API(post, ret_init, pfnName, pfn_args, MRES_TYPE, api_table) \
31.122 @@ -326,6 +355,7 @@
31.123
31.124 // call "real" function, from gamedll
31.125 #define CALL_GAME_API(pfnName, pfn_args, api_table) \
31.126 + CALL_API_count--; \
31.127 if(status==MRES_SUPERCEDE) { \
31.128 META_DEBUG(loglevel, ("Skipped (supercede) %s:%s()", GameDLL.file, pfn_string)); \
31.129 orig_ret = pub_orig_ret = override_ret; \
31.130 @@ -335,8 +365,7 @@
31.131 */ \
31.132 } \
31.133 else if(GameDLL.funcs.api_table) { \
31.134 - pfn_routine=NULL; \
31.135 - if(GameDLL.funcs.api_table && (pfn_routine=GameDLL.funcs.api_table->pfnName)); \
31.136 + pfn_routine=GameDLL.funcs.api_table->pfnName; \
31.137 if(pfn_routine) { \
31.138 META_DEBUG(loglevel, ("Calling %s:%s()", GameDLL.file, pfn_string)); \
31.139 dllret=pfn_routine pfn_args; \
31.140 @@ -350,10 +379,12 @@
31.141 } \
31.142 else { \
31.143 META_DEBUG(loglevel, ("No api table defined for api call: %s:%s", GameDLL.file, pfn_string)); \
31.144 - }
31.145 + } \
31.146 + CALL_API_count++;
31.147
31.148 // call "real" function, from engine
31.149 #define CALL_ENGINE_API(pfnName, pfn_args) \
31.150 + CALL_API_count--; \
31.151 if(status==MRES_SUPERCEDE) { \
31.152 META_DEBUG(loglevel, ("Skipped (supercede) engine:%s()", pfn_string)); \
31.153 orig_ret = pub_orig_ret = override_ret; \
31.154 @@ -363,7 +394,6 @@
31.155 */ \
31.156 } \
31.157 else { \
31.158 - pfn_routine=NULL; \
31.159 pfn_routine=Engine.funcs->pfnName; \
31.160 if(pfn_routine) { \
31.161 META_DEBUG(loglevel, ("Calling engine:%s()", pfn_string)); \
31.162 @@ -374,10 +404,14 @@
31.163 META_ERROR("Couldn't find api call: engine:%s", pfn_string); \
31.164 status=MRES_UNSET; \
31.165 } \
31.166 - }
31.167 + } \
31.168 + CALL_API_count++;
31.169
31.170 // return a value
31.171 #define RETURN_API() \
31.172 + if (--CALL_API_count>0) \
31.173 + /*Restore backup*/ \
31.174 + PublicMetaGlobals = backup_meta_globals; \
31.175 if(status==MRES_OVERRIDE) { \
31.176 META_DEBUG(loglevel, ("Returning (override) %s()", pfn_string)); \
31.177 return(override_ret); \
32.1 --- a/metamod/mlist.cpp Fri Feb 18 20:52:34 2005 +0000
32.2 +++ b/metamod/mlist.cpp Tue Aug 23 20:31:28 2005 +0000
32.3 @@ -62,6 +62,25 @@
32.4 endlist=0;
32.5 }
32.6
32.7 +// Find a plugin based on the plugin handle.
32.8 +// meta_errno values:
32.9 +// - ME_ARGUMENT invalid pindex
32.10 +// - ME_NOTFOUND couldn't find a matching plugin
32.11 +MPlugin *MPluginList::find(DLHANDLE handle)
32.12 +{
32.13 + int i;
32.14 +
32.15 + if(!handle)
32.16 + RETURN_ERRNO(NULL, ME_ARGUMENT);
32.17 + for(i=0; i < endlist; i++) {
32.18 + if(plist[i].status < PL_VALID)
32.19 + continue;
32.20 + if(plist[i].handle == handle)
32.21 + return(&plist[i]);
32.22 + }
32.23 + RETURN_ERRNO(NULL, ME_NOTFOUND);
32.24 +}
32.25 +
32.26 // Find a plugin based on the plugin index #.
32.27 // meta_errno values:
32.28 // - ME_ARGUMENT invalid pindex
32.29 @@ -221,6 +240,64 @@
32.30 RETURN_ERRNO(NULL, ME_NOTFOUND);
32.31 }
32.32
32.33 +MPlugin * MPluginList::plugin_addload(plid_t plid, const char *fname, PLUG_LOADTIME now)
32.34 +{
32.35 + MPlugin pl_temp;
32.36 + MPlugin *pl_found, *pl_added, *pl_loader;
32.37 +
32.38 + if ( !(pl_loader=find(plid)) )
32.39 + {
32.40 + META_DEBUG(1, ("Couldn't find plugin that gave this loading request!"));
32.41 + RETURN_ERRNO(NULL, ME_BADREQ);
32.42 + }
32.43 +
32.44 + memset(&pl_temp, 0, sizeof(pl_temp));
32.45 +
32.46 + if (!pl_temp.plugin_parseline(fname, pl_loader->index))
32.47 + {
32.48 + RETURN_ERRNO(NULL, ME_NOTFOUND);
32.49 + }
32.50 +
32.51 + if (pl_temp.resolve() != mTRUE)
32.52 + {
32.53 + META_DEBUG(1, ("Couldn't resolve given path into a file: %s", pl_temp.file));
32.54 + RETURN_ERRNO(NULL, ME_NOTFOUND);
32.55 + }
32.56 +
32.57 + if ( (pl_found=find(pl_temp.pathname)) )
32.58 + {
32.59 + META_DEBUG(1, ("Plugin '%s' already in current list; file=%s desc='%s'",
32.60 + pl_temp.file, pl_found->file, pl_found->desc));
32.61 + RETURN_ERRNO(NULL, ME_ALREADY);
32.62 + }
32.63 +
32.64 + if (!(pl_added=add(&pl_temp)))
32.65 + {
32.66 + META_DEBUG(1, ("Couldn't add plugin '%s' to list; see log", pl_temp.desc));
32.67 + return NULL;
32.68 + }
32.69 +
32.70 + pl_added->action = PA_LOAD;
32.71 + if (!pl_added->load(now))
32.72 + {
32.73 + if (meta_errno==ME_NOTALLOWED || meta_errno==ME_DELAYED)
32.74 + {
32.75 + META_DEBUG(1, ("Plugin '%s' couldn't attach; only allowed %s",
32.76 + pl_added->desc, pl_added->str_loadable(SL_ALLOWED)));
32.77 + pl_added->clear();
32.78 + } else if (pl_added->status == PL_OPENED) {
32.79 + META_DEBUG(1, ("Opened plugin '%s', but failed to attach; see log", pl_added->desc));
32.80 + } else {
32.81 + META_DEBUG(1, ("Couldn't load plugin '%s'; see log", pl_added->desc));
32.82 + }
32.83 + return NULL;
32.84 + }
32.85 +
32.86 + META_DEBUG(1, ("Loaded plugin '%s' successfully", pl_added->desc));
32.87 + meta_errno = ME_NOERROR;
32.88 +
32.89 + return pl_added;
32.90 +}
32.91
32.92 // Add a plugin to the list.
32.93 // meta_errno values:
32.94 @@ -259,7 +336,9 @@
32.95 // copy source
32.96 iplug->source=padd->source;
32.97 // copy status
32.98 - iplug->status=padd->status;
32.99 + iplug->status=padd->status;
32.100 + //copy other things
32.101 + iplug->source_plugin_index = padd->source_plugin_index;
32.102
32.103 return(iplug);
32.104 }
32.105 @@ -519,12 +598,12 @@
32.106 META_CONS("Opened plugin '%s', but failed to attach; see log", pl_added->desc);
32.107 else
32.108 META_CONS("Couldn't load plugin '%s'; see log", pl_added->desc);
32.109 - show();
32.110 + show(0);
32.111 // meta_errno should be already set in load()
32.112 return(mFALSE);
32.113 }
32.114 META_CONS("Loaded plugin '%s' successfully", pl_added->desc);
32.115 - show();
32.116 + show(0);
32.117 return(mTRUE);
32.118 }
32.119
32.120 @@ -597,7 +676,7 @@
32.121 if(iplug->source==PS_INI && iplug->status >= PL_RUNNING) {
32.122 META_DEBUG(1, ("Unloading plugin '%s'", iplug->desc));
32.123 iplug->action=PA_UNLOAD;
32.124 - if(iplug->unload(now, PNL_INI_DELETED))
32.125 + if(iplug->unload(now, PNL_INI_DELETED, PNL_INI_DELETED))
32.126 nunloaded++;
32.127 else if(meta_errno==ME_DELAYED)
32.128 ndelayed++;
32.129 @@ -663,12 +742,16 @@
32.130 // List plugins and information about them in a formatted table.
32.131 // meta_errno values:
32.132 // - none
32.133 -void MPluginList::show() {
32.134 +void MPluginList::show(int source_index) {
32.135 int i, n=0, r=0;
32.136 MPlugin *pl;
32.137 char desc[15+1], file[16+1], vers[7+1]; // plus 1 for term null
32.138
32.139 - META_CONS("Currently loaded plugins:");
32.140 + if (source_index <= 0)
32.141 + META_CONS("Currently loaded plugins:");
32.142 + else
32.143 + META_CONS("Child plugins:");
32.144 +
32.145 META_CONS(" %*s %-*s %-4s %-4s %-*s v%-*s %-3s %-5s %-5s",
32.146 WIDTH_MAX_PLUGINS, "",
32.147 sizeof(desc)-1, "description",
32.148 @@ -679,6 +762,8 @@
32.149 pl=&plist[i];
32.150 if(pl->status < PL_VALID)
32.151 continue;
32.152 + if ((source_index > 0) && (pl->source_plugin_index != source_index))
32.153 + continue;
32.154 STRNCPY(desc, pl->desc, sizeof(desc));
32.155 STRNCPY(file, pl->file, sizeof(file));
32.156 if(pl->info && pl->info->version) STRNCPY(vers, pl->info->version, sizeof(vers));
32.157 @@ -723,3 +808,37 @@
32.158 }
32.159 META_CLIENT(pEntity, "%d plugins", n);
32.160 }
32.161 +
32.162 +mBOOL MPluginList::found_child_plugins(int source_index)
32.163 +{
32.164 + int i;
32.165 +
32.166 + if (source_index <= 0)
32.167 + return mFALSE;
32.168 +
32.169 + for (i=0; i<endlist; i++)
32.170 + {
32.171 + if (plist[i].status < PL_VALID)
32.172 + continue;
32.173 + if (plist[i].source_plugin_index == source_index)
32.174 + return mTRUE;
32.175 + }
32.176 +
32.177 + return mFALSE;
32.178 +}
32.179 +
32.180 +void MPluginList::clear_source_plugin_index(int source_index)
32.181 +{
32.182 + int i;
32.183 +
32.184 + if (source_index <= 0)
32.185 + return;
32.186 +
32.187 + for (i=0; i<endlist; i++)
32.188 + {
32.189 + if (plist[i].status < PL_VALID)
32.190 + continue;
32.191 + if (plist[i].source_plugin_index == source_index)
32.192 + plist[i].source_plugin_index = -1;
32.193 + }
32.194 +}
33.1 --- a/metamod/mlist.h Fri Feb 18 20:52:34 2005 +0000
33.2 +++ b/metamod/mlist.h Tue Aug 23 20:31:28 2005 +0000
33.3 @@ -68,18 +68,23 @@
33.4 MPlugin *find_memloc(void *memptr); // find by memory location
33.5 MPlugin *find_match(const char *prefix); // find by partial prefix match
33.6 MPlugin *find_match(MPlugin *pmatch); // find by platform_match()
33.7 + MPlugin * find(DLHANDLE handle); // find by handle
33.8 MPlugin *add(MPlugin *padd);
33.9
33.10 + mBOOL found_child_plugins(int source_index);
33.11 +
33.12 mBOOL ini_startup(void); // read inifile at startup
33.13 mBOOL ini_refresh(void); // re-read inifile
33.14 mBOOL cmd_addload(const char *args); // load from console command
33.15 + MPlugin *plugin_addload(plid_t plid, const char *fname, PLUG_LOADTIME now); //load from plugin
33.16
33.17 mBOOL load(void); // load the list, at startup
33.18 mBOOL refresh(PLUG_LOADTIME now); // update from re-read inifile
33.19 void unpause_all(void); // unpause any paused plugins
33.20 void retry_all(PLUG_LOADTIME now); // retry any pending plugin actions
33.21 - void show(void); // list plugins to console
33.22 + void show(int source_index); // list plugins to console
33.23 void show_client(edict_t *pEntity); // list plugins to player client
33.24 + void clear_source_plugin_index(int source_index);
33.25 };
33.26
33.27 #endif /* MLIST_H */
34.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
34.2 +++ b/metamod/mplayer.cpp Tue Aug 23 20:31:28 2005 +0000
34.3 @@ -0,0 +1,196 @@
34.4 +// vi: set ts=4 sw=4 :
34.5 +// vim: set tw=75 :
34.6 +
34.7 +// mplayer.cpp - methods of individual player (class MPlayer) and
34.8 +// list of players (class MPlayerList).
34.9 +
34.10 +/*
34.11 + * Copyright (c) 2005 Will Day <[email protected]>
34.12 + *
34.13 + * This file is part of Metamod.
34.14 + *
34.15 + * Metamod is free software; you can redistribute it and/or modify it
34.16 + * under the terms of the GNU General Public License as published by the
34.17 + * Free Software Foundation; either version 2 of the License, or (at
34.18 + * your option) any later version.
34.19 + *
34.20 + * Metamod is distributed in the hope that it will be useful, but
34.21 + * WITHOUT ANY WARRANTY; without even the implied warranty of
34.22 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
34.23 + * General Public License for more details.
34.24 + *
34.25 + * You should have received a copy of the GNU General Public License
34.26 + * along with Metamod; if not, write to the Free Software Foundation,
34.27 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34.28 + *
34.29 + * In addition, as a special exception, the author gives permission to
34.30 + * link the code of this program with the Half-Life Game Engine ("HL
34.31 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
34.32 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
34.33 + * respects for all of the code used other than the HL Engine and MODs
34.34 + * from Valve. If you modify this file, you may extend this exception
34.35 + * to your version of the file, but you are not obligated to do so. If
34.36 + * you do not wish to do so, delete this exception statement from your
34.37 + * version.
34.38 + *
34.39 + */
34.40 +
34.41 +#include <string.h> // strdup()
34.42 +
34.43 +#include <extdll.h> // always
34.44 +
34.45 +#include "mplayer.h" // me
34.46 +#include "sdk_util.h" // ENTINDEX()
34.47 +#include "metamod.h" // gpGlobals
34.48 +
34.49 +
34.50 +// Constructor
34.51 +MPlayer::MPlayer()
34.52 + : isQueried(mFALSE),
34.53 + cvarName(NULL)
34.54 +{
34.55 +}
34.56 +
34.57 +
34.58 +// Destructor
34.59 +MPlayer::~MPlayer()
34.60 +{
34.61 + if(cvarName) {
34.62 + free(cvarName);
34.63 + }
34.64 +}
34.65 +
34.66 +
34.67 +
34.68 +// Copy constructor
34.69 +MPlayer::MPlayer(const MPlayer& rhs)
34.70 + : isQueried(rhs.isQueried),
34.71 + cvarName(NULL)
34.72 +{
34.73 + if(rhs.cvarName) {
34.74 + cvarName = strdup(rhs.cvarName);
34.75 + }
34.76 +}
34.77 +
34.78 +
34.79 +// Assignment operator
34.80 +MPlayer& MPlayer::operator=(const MPlayer& rhs)
34.81 +{
34.82 + isQueried = rhs.isQueried;
34.83 +
34.84 + if(cvarName) {
34.85 + free(cvarName);
34.86 + }
34.87 +
34.88 + cvarName = NULL;
34.89 +
34.90 + if(rhs.cvarName) {
34.91 + cvarName = strdup(rhs.cvarName);
34.92 + }
34.93 +
34.94 + return *this;
34.95 +}
34.96 +
34.97 +
34.98 +// Mark a player as querying a client cvar and stores the cvar name
34.99 +// meta_errno values:
34.100 +// - ME_ARGUMENT cvar is NULL
34.101 +void MPlayer::set_cvar_query(const char *cvar)
34.102 +{
34.103 + // Do not allow NULL as queried cvar since we use this as
34.104 + // return value in is_querying_cvar as indication if a
34.105 + // client cvar is queried.
34.106 + if(!cvar) {
34.107 + meta_errno = ME_ARGUMENT;
34.108 + return;
34.109 + }
34.110 +
34.111 +
34.112 + isQueried = mTRUE;
34.113 + if(cvarName) {
34.114 + free(cvarName);
34.115 + }
34.116 +
34.117 + cvarName = strdup(cvar);
34.118 +}
34.119 +
34.120 +
34.121 +// Unmark player as querying a client cvar
34.122 +void MPlayer::clear_cvar_query(const char* /*cvar*/)
34.123 +{
34.124 + isQueried = mFALSE;
34.125 + if(cvarName) {
34.126 + free(cvarName);
34.127 + cvarName = NULL;
34.128 + }
34.129 +}
34.130 +
34.131 +
34.132 +// Check if a client cvar is queried for this player
34.133 +// Returns NULL if not
34.134 +// or the name of the cvar.
34.135 +const char *MPlayer::is_querying_cvar(void)
34.136 +{
34.137 + if(isQueried) {
34.138 + return cvarName;
34.139 + }
34.140 +
34.141 + return NULL;
34.142 +}
34.143 +
34.144 +
34.145 +
34.146 +
34.147 +
34.148 +// Mark a player as querying a client cvar and stores the cvar name
34.149 +// meta_errno values:
34.150 +// - ME_ARGUMENT cvar is NULL
34.151 +void MPlayerList::set_player_cvar_query(const edict_t *pEntity, const char *cvar)
34.152 +{
34.153 + int indx = ENTINDEX(pEntity);
34.154 +
34.155 + if (indx < 1 || indx >= MPlayerList::NUM_SLOTS)
34.156 + return; //maybe output a message?
34.157 +
34.158 + players[indx].set_cvar_query(cvar);
34.159 +}
34.160 +
34.161 +
34.162 +// Unmark player as querying a client cvar
34.163 +void MPlayerList::clear_player_cvar_query(const edict_t *pEntity, const char *cvar)
34.164 +{
34.165 + int indx = ENTINDEX(pEntity);
34.166 +
34.167 + if (indx < 1 || indx >= MPlayerList::NUM_SLOTS)
34.168 + return; //maybe output a message?
34.169 +
34.170 + players[indx].clear_cvar_query(cvar);
34.171 +}
34.172 +
34.173 +
34.174 +void MPlayerList::clear_all_cvar_queries(void)
34.175 +{
34.176 + for(int indx=1; indx < MPlayerList::NUM_SLOTS; ++indx) {
34.177 + players[indx].clear_cvar_query();
34.178 + }
34.179 +}
34.180 +
34.181 +
34.182 +
34.183 +// Check if a client cvar is queried for this player
34.184 +// Returns NULL if not
34.185 +// or the name of the cvar.
34.186 +// meta_errno values:
34.187 +// - ME_NOTFOUND invalid entity
34.188 +const char* MPlayerList::is_querying_cvar(const edict_t *pEntity)
34.189 +{
34.190 + int indx = ENTINDEX(pEntity);
34.191 +
34.192 + if (indx < 1 || indx > gpGlobals->maxClients) {
34.193 + RETURN_ERRNO(NULL, ME_NOTFOUND);
34.194 + }
34.195 +
34.196 + return players[indx].is_querying_cvar();
34.197 +}
34.198 +
34.199 +
35.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
35.2 +++ b/metamod/mplayer.h Tue Aug 23 20:31:28 2005 +0000
35.3 @@ -0,0 +1,91 @@
35.4 +// vi: set ts=4 sw=4 :
35.5 +// vim: set tw=75 :
35.6 +
35.7 +// mplayer.h - class to keep info about a player and a class listing all
35.8 +// players
35.9 +
35.10 +/*
35.11 + * Copyright (c) 2005 Will Day <[email protected]>
35.12 + *
35.13 + * This file is part of Metamod.
35.14 + *
35.15 + * Metamod is free software; you can redistribute it and/or modify it
35.16 + * under the terms of the GNU General Public License as published by the
35.17 + * Free Software Foundation; either version 2 of the License, or (at
35.18 + * your option) any later version.
35.19 + *
35.20 + * Metamod is distributed in the hope that it will be useful, but
35.21 + * WITHOUT ANY WARRANTY; without even the implied warranty of
35.22 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
35.23 + * General Public License for more details.
35.24 + *
35.25 + * You should have received a copy of the GNU General Public License
35.26 + * along with Metamod; if not, write to the Free Software Foundation,
35.27 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
35.28 + *
35.29 + * In addition, as a special exception, the author gives permission to
35.30 + * link the code of this program with the Half-Life Game Engine ("HL
35.31 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
35.32 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
35.33 + * respects for all of the code used other than the HL Engine and MODs
35.34 + * from Valve. If you modify this file, you may extend this exception
35.35 + * to your version of the file, but you are not obligated to do so. If
35.36 + * you do not wish to do so, delete this exception statement from your
35.37 + * version.
35.38 + *
35.39 + */
35.40 +
35.41 +#ifndef INCLUDE_METAMOD_PLAYER_H
35.42 +#define INCLUDE_METAMOD_PLAYER_H
35.43 +
35.44 +#include "types_meta.h" // mBOOL
35.45 +
35.46 +
35.47 +
35.48 +// Numbers of players limit set by the engine
35.49 +#define MAX_PLAYERS 32
35.50 +
35.51 +
35.52 +
35.53 +// Info on an individual player
35.54 +class MPlayer
35.55 +{
35.56 +private:
35.57 + mBOOL isQueried; // is this player currently queried for a cvar value
35.58 + char *cvarName; // name of the cvar if getting queried
35.59 +
35.60 + MPlayer (const MPlayer&);
35.61 + MPlayer& operator=(const MPlayer&);
35.62 +
35.63 +
35.64 +public:
35.65 + MPlayer();
35.66 + ~MPlayer();
35.67 + void set_cvar_query(const char *cvar); // mark this player as querying a client cvar
35.68 + void clear_cvar_query(const char *cvar=NULL); // unmark this player as querying a client cvar
35.69 + const char *is_querying_cvar(void); // check if a player is querying a cvar. returns
35.70 + // NULL if not or the name of the cvar
35.71 +};
35.72 +
35.73 +
35.74 +
35.75 +// A list of players. The number of max players is fixed and small enough
35.76 +// to use an array.
35.77 +class MPlayerList
35.78 +{
35.79 +private:
35.80 + enum { NUM_SLOTS = MAX_PLAYERS + 1 };
35.81 +
35.82 + MPlayer players[NUM_SLOTS]; // array of players
35.83 +
35.84 +
35.85 +public:
35.86 + void set_player_cvar_query(const edict_t *pEntity, const char *cvar);
35.87 + void clear_player_cvar_query(const edict_t *pEntity, const char *cvar=NULL);
35.88 + void clear_all_cvar_queries(void);
35.89 + const char *is_querying_cvar(const edict_t *pEntity);
35.90 +};
35.91 +
35.92 +
35.93 +#endif /* INCLUDE_METAMOD_PLAYER_H */
35.94 +
36.1 --- a/metamod/mplugin.cpp Fri Feb 18 20:52:34 2005 +0000
36.2 +++ b/metamod/mplugin.cpp Tue Aug 23 20:31:28 2005 +0000
36.3 @@ -130,6 +130,85 @@
36.4 return(mTRUE);
36.5 }
36.6
36.7 +// Unload a plugin from plugin request
36.8 +// meta_errno values:
36.9 +// - errno's from unload()
36.10 +mBOOL MPlugin::plugin_unload(plid_t plid, PLUG_LOADTIME now, PL_UNLOAD_REASON reason)
36.11 +{
36.12 + PLUG_ACTION old_action;
36.13 + MPlugin *pl_unloader;
36.14 +
36.15 + if ( !(pl_unloader=Plugins->find(plid)) )
36.16 + {
36.17 + META_WARNING("dll: Not unloading plugin '%s'; plugin that requested unload is not found.", desc);
36.18 + RETURN_ERRNO(mFALSE, ME_BADREQ);
36.19 + } else if (pl_unloader->index == index) {
36.20 + META_WARNING("dll: Not unloading plugin '%s'; Plugin tried to unload itself.", desc);
36.21 + RETURN_ERRNO(mFALSE, ME_UNLOAD_SELF);
36.22 + } else if (is_unloader) {
36.23 + META_WARNING("dll: Not unloading plugin '%s'; Plugin is unloading plugin that tried to unload it.", desc);
36.24 + RETURN_ERRNO(mFALSE, ME_UNLOAD_UNLOADER);
36.25 + } else {
36.26 + unloader_index = pl_unloader->index;
36.27 + }
36.28 +
36.29 + //block unloader from being unloaded by other plugin
36.30 + pl_unloader->is_unloader = mTRUE;
36.31 +
36.32 + //try unload
36.33 + old_action = action;
36.34 + action = PA_UNLOAD;
36.35 + if (unload(now, reason, PNL_PLG_FORCED))
36.36 + {
36.37 + META_DEBUG(1,("Unloaded plugin '%s'", desc));
36.38 + pl_unloader->is_unloader = mFALSE;
36.39 + return mTRUE;
36.40 + }
36.41 +
36.42 + pl_unloader->is_unloader = mFALSE;
36.43 +
36.44 + //can't unload plugin now, set delayed
36.45 + if (meta_errno==ME_DELAYED)
36.46 + {
36.47 + action = old_action;
36.48 + meta_errno = ME_NOTALLOWED;
36.49 + META_DEBUG(2, ("dll: Failed unload plugin '%s'; can't detach now: allowed=%s; now=%s", desc, str_unloadable(), str_loadtime(PT_ANYTIME, SL_SIMPLE)));
36.50 + }
36.51 +
36.52 + return mFALSE;
36.53 +}
36.54 +
36.55 +// Parse a filename string from PEXT_LOAD_PLUGIN_BY_* function into a plugin.
36.56 +// meta_errno values:
36.57 +mBOOL MPlugin::plugin_parseline(const char *fname, int loader_index)
36.58 +{
36.59 + char *cp;
36.60 +
36.61 + source_plugin_index = loader_index;
36.62 +
36.63 + STRNCPY(filename, fname, sizeof(filename));
36.64 + normalize_pathname(filename);
36.65 +
36.66 + //store just name of the actual _file, without path
36.67 + cp = strrchr(filename, '/');
36.68 + if (cp)
36.69 + file = cp+1;
36.70 + else
36.71 + file = filename;
36.72 +
36.73 + //grab description
36.74 + //temporarily use plugin file until plugin can be queried
36.75 + snprintf(desc, sizeof(desc), "<%s>", file);
36.76 +
36.77 + //make full pathname
36.78 + full_gamedir_path(filename, pathname);
36.79 +
36.80 + source = PS_PLUGIN;
36.81 + status = PL_VALID;
36.82 +
36.83 + return mTRUE;
36.84 +}
36.85 +
36.86 // Parse a line from console "load" command into a plugin.
36.87 // meta_errno values:
36.88 // - ME_FORMAT invalid line format
36.89 @@ -479,7 +558,7 @@
36.90 RETURN_ERRNO(mFALSE, ME_BADREQ);
36.91 }
36.92
36.93 - if(status != PL_OPENED) {
36.94 + if(status < PL_OPENED) {
36.95 // query plugin; open file and get info about it
36.96 if(!query()) {
36.97 META_ERROR("dll: Skipping plugin '%s'; couldn't query", desc);
36.98 @@ -856,23 +935,25 @@
36.99 // - ME_DELAYED unload request is delayed (till changelevel?)
36.100 // - ME_NOTALLOWED plugin not unloadable after startup
36.101 // - errno's from check_input()
36.102 -mBOOL MPlugin::unload(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) {
36.103 +mBOOL MPlugin::unload(PLUG_LOADTIME now, PL_UNLOAD_REASON reason, PL_UNLOAD_REASON real_reason) {
36.104 if(!check_input()) {
36.105 // details logged, meta_errno set in check_input()
36.106 RETURN_ERRNO(mFALSE, ME_ARGUMENT);
36.107 }
36.108 if(status < PL_RUNNING) {
36.109 - META_ERROR("dll: Not unloading plugin '%s'; already unloaded (status=%s)", desc, str_status());
36.110 - RETURN_ERRNO(mFALSE, ME_ALREADY);
36.111 + if (reason != PNL_CMD_FORCED && reason != PNL_RELOAD) {
36.112 + META_ERROR("dll: Not unloading plugin '%s'; already unloaded (status=%s)", desc, str_status());
36.113 + RETURN_ERRNO(mFALSE, ME_ALREADY);
36.114 + }
36.115 }
36.116 if(action != PA_UNLOAD && action != PA_RELOAD) {
36.117 - META_ERROR("dll: Not unloading plugin '%s'; not marked for unload (action=%s)", desc, str_action());
36.118 + META_WARNING("dll: Not unloading plugin '%s'; not marked for unload (action=%s)", desc, str_action());
36.119 RETURN_ERRNO(mFALSE, ME_BADREQ);
36.120 }
36.121
36.122 // Are we allowed to detach this plugin at this time?
36.123 // If forcing unload, we disregard when plugin wants to be unloaded.
36.124 - if(info->unloadable < now) {
36.125 + if(info && info->unloadable < now) {
36.126 if(reason == PNL_CMD_FORCED) {
36.127 META_DEBUG(2, ("dll: Forced unload plugin '%s' overriding allowed times: allowed=%s; now=%s", desc, str_unloadable(), str_loadtime(now, SL_SIMPLE)));
36.128 }
36.129 @@ -899,16 +980,20 @@
36.130
36.131 // detach plugin
36.132 if(!detach(now, reason)) {
36.133 - if(reason == PNL_CMD_FORCED) {
36.134 + if (reason == PNL_RELOAD){
36.135 + META_DEBUG(2, ("dll: Reload plugin '%s' overriding failed detach", desc));
36.136 + } else if(reason == PNL_CMD_FORCED) {
36.137 META_DEBUG(2, ("dll: Forced unload plugin '%s' overriding failed detach"));
36.138 }
36.139 else {
36.140 - META_ERROR("dll: Failed to detach plugin '%s'; ", desc);
36.141 + META_WARNING("dll: Failed to detach plugin '%s'; ", desc);
36.142 // meta_errno should be already set in detach()
36.143 return(mFALSE);
36.144 }
36.145 }
36.146
36.147 + Plugins->clear_source_plugin_index(index);
36.148 +
36.149 // successful detach, or forced unload
36.150
36.151 // Unmark registered commands for this plugin (by index number).
36.152 @@ -924,9 +1009,9 @@
36.153 // Close the file. Note: after this, attempts to reference any memory
36.154 // locations in the file will produce a segfault.
36.155 if(DLCLOSE(handle) != 0) {
36.156 - META_ERROR("dll: Couldn't close plugin file '%s': %s", file, DLERROR());
36.157 - status=PL_FAILED;
36.158 - RETURN_ERRNO(mFALSE, ME_DLERROR);
36.159 + // If DLL cannot be closed, OS is badly broken or we are giving invalid handle.
36.160 + // So we don't return here but instead remove plugin from our listings.
36.161 + META_WARNING("dll: Couldn't close plugin file '%s': %s", file, DLERROR());
36.162 }
36.163 handle=NULL;
36.164
36.165 @@ -939,7 +1024,7 @@
36.166 action=PA_LOAD;
36.167 clear();
36.168 }
36.169 - META_LOG("dll: Unloaded plugin '%s' for reason '%s'", desc, str_reason(reason));
36.170 + META_LOG("dll: Unloaded plugin '%s' for reason '%s'", desc, str_reason(reason, real_reason));
36.171 return(mTRUE);
36.172 }
36.173
36.174 @@ -951,6 +1036,12 @@
36.175 int ret;
36.176 META_DETACH_FN pfn_detach;
36.177
36.178 + // If we have no handle, i.e. no dll loaded, we return true because the
36.179 + // dll is obviously detached. We shouldn't call DLSYM() with a NULL
36.180 + // handle since this will DLSYM() ourself.
36.181 + if(!handle)
36.182 + return mTRUE;
36.183 +
36.184 if(!(pfn_detach = (META_DETACH_FN) DLSYM(handle, "Meta_Detach"))) {
36.185 META_ERROR("dll: Error detach plugin '%s': Couldn't find Meta_detach(): %s", desc, DLERROR());
36.186 // caller will dlclose()
36.187 @@ -979,7 +1070,8 @@
36.188 }
36.189 // Are we allowed to load this plugin at this time?
36.190 // If we cannot load the plugin after unloading it, we keep it.
36.191 - if(info->loadable < now) {
36.192 + if (info && info->loadable < now)
36.193 + {
36.194 if(info->loadable > PT_STARTUP) {
36.195 META_DEBUG(2, ("dll: Delaying reload plugin '%s'; would not be able to reattach now: allowed=%s; now=%s", desc, str_loadable(), str_loadtime(now, SL_SIMPLE)));
36.196 // caller should give message to user
36.197 @@ -994,13 +1086,18 @@
36.198 }
36.199 }
36.200
36.201 - if(!unload(now, reason)) {
36.202 - META_ERROR("dll: Failed to unload plugin '%s' for reloading", desc);
36.203 + if (status < PL_RUNNING)
36.204 + {
36.205 + META_WARNING("dll: Plugin '%s' isn't running; Forcing unload plugin for reloading", desc);
36.206 + reason = PNL_RELOAD;
36.207 + }
36.208 + if (!unload(now, reason, reason)) {
36.209 + META_WARNING("dll: Failed to unload plugin '%s' for reloading", desc);
36.210 // meta_errno should be set already in unload()
36.211 return(mFALSE);
36.212 }
36.213 if(!load(now)) {
36.214 - META_ERROR("dll: Failed to reload plugin '%s' after unloading", desc);
36.215 + META_WARNING("dll: Failed to reload plugin '%s' after unloading", desc);
36.216 // meta_errno should be set already in load()
36.217 return(mFALSE);
36.218 }
36.219 @@ -1059,7 +1156,7 @@
36.220 else if(action==PA_ATTACH)
36.221 return(load(now));
36.222 else if(action==PA_UNLOAD)
36.223 - return(unload(now, reason));
36.224 + return(unload(now, reason, reason));
36.225 else if(action==PA_RELOAD)
36.226 return(reload(now, reason));
36.227 else {
36.228 @@ -1110,6 +1207,9 @@
36.229 engine_post_table=NULL;
36.230 gamedll_funcs.dllapi_table = NULL;
36.231 gamedll_funcs.newapi_table = NULL;
36.232 + source_plugin_index = 0;
36.233 + unloader_index = 0;
36.234 + is_unloader = mFALSE;
36.235 return(mTRUE);
36.236 }
36.237
36.238 @@ -1134,6 +1234,7 @@
36.239 META_CONS("%*s: %s", width, "author", info ? info->author : "(nil)");
36.240 META_CONS("%*s: %s", width, "url", info ? info->url : "(nil)");
36.241 META_CONS("%*s: %s", width, "logtag", info ? info->logtag : "(nil)");
36.242 + META_CONS("%*s: %s", width, "ifvers", info ? info->ifvers : "(nil)");
36.243 // ctime() includes newline at EOL
36.244 tstr=ctime(&time_loaded);
36.245 if((cp=strchr(tstr, '\n')))
36.246 @@ -1187,6 +1288,10 @@
36.247 META_CONS("No Engine-Post functions.");
36.248 RegCmds->show(index);
36.249 RegCvars->show(index);
36.250 + if (Plugins->found_child_plugins(index))
36.251 + Plugins->show(index);
36.252 + else
36.253 + META_CONS("No child plugins.");
36.254 }
36.255
36.256 // Check whether the file on disk looks like it's been updated since we
36.257 @@ -1318,8 +1423,15 @@
36.258 // Return a string describing why a plugin is to be unloaded.
36.259 // meta_errno values:
36.260 // - none
36.261 -char *MPlugin::str_reason(PL_UNLOAD_REASON preason) {
36.262 - switch(preason) {
36.263 +char *MPlugin::str_reason(PL_UNLOAD_REASON preason, PL_UNLOAD_REASON preal_reason) {
36.264 + char buf[128];
36.265 +
36.266 + if(preason == PNL_PLUGIN)
36.267 + preason = PNL_NULL;
36.268 + if(preason == PNL_PLG_FORCED)
36.269 + preason = PNL_NULL;
36.270 +
36.271 + switch(preal_reason) {
36.272 case PNL_NULL:
36.273 return("null");
36.274 case PNL_INI_DELETED:
36.275 @@ -1330,8 +1442,16 @@
36.276 return("server command");
36.277 case PNL_CMD_FORCED:
36.278 return("forced by server command");
36.279 + case PNL_PLUGIN:
36.280 + STRNCPY(buf, str_reason(PNL_NULL, preason), sizeof(buf));
36.281 + return(UTIL_VarArgs("%s (request from plugin[%d])", buf, unloader_index));
36.282 + case PNL_PLG_FORCED:
36.283 + STRNCPY(buf, str_reason(PNL_NULL, preason), sizeof(buf));
36.284 + return(UTIL_VarArgs("%s (forced request from plugin[%d])", buf, unloader_index));
36.285 + case PNL_RELOAD:
36.286 + return("reloading");
36.287 default:
36.288 - return(UTIL_VarArgs("unknown (%d)", preason));
36.289 + return(UTIL_VarArgs("unknown (%d)", preal_reason));
36.290 }
36.291 }
36.292
36.293 @@ -1346,6 +1466,16 @@
36.294 case PS_CMD:
36.295 if(fmt==SO_SHOW) return("cmd");
36.296 else return("console command");
36.297 + case PS_PLUGIN:
36.298 + if (source_plugin_index <= 0) {
36.299 + if (fmt==SO_SHOW)
36.300 + return("plUN");
36.301 + else
36.302 + return("unloaded plugin");
36.303 + } else {
36.304 + if(fmt==SO_SHOW) return(UTIL_VarArgs("pl%d", source_plugin_index));
36.305 + else return(UTIL_VarArgs("plugin [%d]", source_plugin_index));
36.306 + }
36.307 default:
36.308 if(fmt==SO_SHOW) return(UTIL_VarArgs("UNK%d", source));
36.309 else return(UTIL_VarArgs("unknown (%d)", source));
37.1 --- a/metamod/mplugin.h Fri Feb 18 20:52:34 2005 +0000
37.2 +++ b/metamod/mplugin.h Tue Aug 23 20:31:28 2005 +0000
37.3 @@ -75,6 +75,7 @@
37.4 typedef enum {
37.5 PS_INI = 0, // was loaded from the plugins.ini
37.6 PS_CMD, // was loaded via a server command
37.7 + PS_PLUGIN, // was loaded via a plugin
37.8 } PLOAD_SOURCE;
37.9
37.10 // Flags for how to word description of plugin loadtime.
37.11 @@ -126,6 +127,9 @@
37.12 DLHANDLE handle; // handle for dlopen, dlsym, etc
37.13 plugin_info_t *info; // information plugin provides about itself
37.14 time_t time_loaded; // when plugin was loaded
37.15 + int source_plugin_index; // who loaded this plugin
37.16 + int unloader_index;
37.17 + mBOOL is_unloader; // fix to prevent other plugins unload active unloader.
37.18
37.19 DLL_FUNCTIONS *dllapi_table;
37.20 DLL_FUNCTIONS *dllapi_post_table;
37.21 @@ -135,8 +139,10 @@
37.22 enginefuncs_t *engine_post_table;
37.23
37.24 // functions:
37.25 +
37.26 mBOOL ini_parseline(char *line); // parse line from inifile
37.27 mBOOL cmd_parseline(const char *line); // parse from console command
37.28 + mBOOL plugin_parseline(const char *fname, int loader_index); // parse from plugin
37.29 mBOOL check_input(void);
37.30
37.31 mBOOL resolve(void); // find a matching file on disk
37.32 @@ -147,12 +153,13 @@
37.33 mBOOL platform_match(MPlugin* plugin);
37.34
37.35 mBOOL load(PLUG_LOADTIME now);
37.36 - mBOOL unload(PLUG_LOADTIME now, PL_UNLOAD_REASON reason);
37.37 + mBOOL unload(PLUG_LOADTIME now, PL_UNLOAD_REASON reason, PL_UNLOAD_REASON real_reason);
37.38 mBOOL reload(PLUG_LOADTIME now, PL_UNLOAD_REASON reason);
37.39 mBOOL pause(void);
37.40 mBOOL unpause(void);
37.41 mBOOL retry(PLUG_LOADTIME now, PL_UNLOAD_REASON reason); // if previously failed
37.42 mBOOL clear(void);
37.43 + mBOOL plugin_unload(plid_t plid, PLUG_LOADTIME now, PL_UNLOAD_REASON reason); // other plugin unloading
37.44 void show(void); // print info about plugin to console
37.45
37.46 mBOOL newer_file(void); // check for newer file on disk
37.47 @@ -162,7 +169,7 @@
37.48 char *str_action(STR_ACTION fmt);
37.49 char *str_source(STR_SOURCE fmt);
37.50
37.51 - char *str_reason(PL_UNLOAD_REASON preason);
37.52 + char *str_reason(PL_UNLOAD_REASON preason, PL_UNLOAD_REASON preal_reason);
37.53 char *str_loadtime(PLUG_LOADTIME pallow, STR_LOADTIME fmt);
37.54
37.55 char *str_status(void) { return(str_status(ST_SIMPLE)); };
37.56 @@ -249,7 +256,8 @@
37.57 n=0; \
37.58 SHOW_IFDEF(api_table, newapi_info, pfnOnFreeEntPrivateData, pre_str, post_str); \
37.59 SHOW_IFDEF(api_table, newapi_info, pfnGameShutdown, pre_str, post_str); \
37.60 - SHOW_IFDEF(api_table, newapi_info, pfnShouldCollide, pre_str, post_str)
37.61 + SHOW_IFDEF(api_table, newapi_info, pfnShouldCollide, pre_str, post_str); \
37.62 + SHOW_IFDEF(api_table, newapi_info, pfnCvarValue, pre_str, post_str);
37.63
37.64 #define SHOW_DEF_ENGINE(api_table, pre_str, post_str) \
37.65 n=0; \
37.66 @@ -408,6 +416,7 @@
37.67 SHOW_IFDEF(api_table, engine_info, pfnProcessTutorMessageDecayBuffer, pre_str, post_str); \
37.68 SHOW_IFDEF(api_table, engine_info, pfnConstructTutorMessageDecayBuffer, pre_str, post_str); \
37.69 SHOW_IFDEF(api_table, engine_info, pfnResetTutorMessageDecayData, pre_str, post_str); \
37.70 + SHOW_IFDEF(api_table, engine_info, pfnQueryClientCvarValue, pre_str, post_str);
37.71
37.72
37.73 #endif /* MPLUGIN_H */
38.1 --- a/metamod/msvc/metamod.vcproj Fri Feb 18 20:52:34 2005 +0000
38.2 +++ b/metamod/msvc/metamod.vcproj Tue Aug 23 20:31:28 2005 +0000
38.3 @@ -416,6 +416,9 @@
38.4 </FileConfiguration>
38.5 </File>
38.6 <File
38.7 + RelativePath="..\mplayer.cpp">
38.8 + </File>
38.9 + <File
38.10 RelativePath="..\mplugin.cpp">
38.11 <FileConfiguration
38.12 Name="Debug|Win32">
38.13 @@ -653,9 +656,6 @@
38.14 RelativePath="..\h_export.h">
38.15 </File>
38.16 <File
38.17 - RelativePath="..\info_name.h">
38.18 - </File>
38.19 - <File
38.20 RelativePath="..\linkent.h">
38.21 </File>
38.22 <File
38.23 @@ -674,6 +674,9 @@
38.24 RelativePath="..\mlist.h">
38.25 </File>
38.26 <File
38.27 + RelativePath="..\mplayer.h">
38.28 + </File>
38.29 + <File
38.30 RelativePath="..\mplugin.h">
38.31 </File>
38.32 <File
39.1 --- a/metamod/mutil.cpp Fri Feb 18 20:52:34 2005 +0000
39.2 +++ b/metamod/mutil.cpp Tue Aug 23 20:31:28 2005 +0000
39.3 @@ -36,6 +36,7 @@
39.4
39.5 #include <stdio.h> // vsnprintf(), etc
39.6 #include <stdarg.h> // vs_start(), etc
39.7 +#include <stdlib.h> // strtol()
39.8
39.9 #include <extdll.h> // always
39.10
39.11 @@ -287,6 +288,82 @@
39.12 return(buf);
39.13 }
39.14
39.15 +int mutil_LoadMetaPlugin(plid_t plid, const char *fname, PLUG_LOADTIME now, void **plugin_handle)
39.16 +{
39.17 + MPlugin *pl_loaded;
39.18 +
39.19 + if (NULL == fname)
39.20 + {
39.21 + return ME_ARGUMENT;
39.22 + }
39.23 +
39.24 + meta_errno = ME_NOERROR;
39.25 + if (! (pl_loaded=Plugins->plugin_addload(plid, fname, now)) )
39.26 + {
39.27 + if (plugin_handle)
39.28 + *plugin_handle = NULL;
39.29 + return meta_errno;
39.30 + } else {
39.31 + if (plugin_handle)
39.32 + *plugin_handle = (void *)pl_loaded->handle;
39.33 + return 0;
39.34 + }
39.35 +}
39.36 +
39.37 +int mutil_UnloadMetaPlugin(plid_t plid, const char *fname, PLUG_LOADTIME now, PL_UNLOAD_REASON reason)
39.38 +{
39.39 + MPlugin *findp = NULL;
39.40 + int pindex;
39.41 + char* endptr;
39.42 +
39.43 + if (NULL == fname)
39.44 + {
39.45 + return ME_ARGUMENT;
39.46 + }
39.47 +
39.48 + pindex = strtol(fname, &endptr, 10);
39.49 + if (*fname != '\0' && *endptr == '\0')
39.50 + findp = Plugins->find(pindex);
39.51 + else
39.52 + findp = Plugins->find_match(fname);
39.53 +
39.54 + if (!findp)
39.55 + return meta_errno;
39.56 +
39.57 + meta_errno = ME_NOERROR;
39.58 +
39.59 + if (findp->plugin_unload(plid, now, reason))
39.60 + return 0;
39.61 +
39.62 + return meta_errno;
39.63 +}
39.64 +
39.65 +int mutil_UnloadMetaPluginByHandle(plid_t plid, void *plugin_handle, PLUG_LOADTIME now, PL_UNLOAD_REASON reason)
39.66 +{
39.67 + MPlugin *findp;
39.68 +
39.69 + if (NULL == plugin_handle)
39.70 + {
39.71 + return ME_ARGUMENT;
39.72 + }
39.73 +
39.74 + if (!(findp=Plugins->find((DLHANDLE)plugin_handle)))
39.75 + return ME_NOTFOUND;
39.76 +
39.77 + meta_errno = ME_NOERROR;
39.78 +
39.79 + if (findp->plugin_unload(plid, now, reason))
39.80 + return 0;
39.81 +
39.82 + return meta_errno;
39.83 +}
39.84 +
39.85 +const char *mutil_IsQueryingClientCvar(plid_t /*plid*/, const edict_t *pEdict)
39.86 +{
39.87 + return g_Players.is_querying_cvar(pEdict);
39.88 +}
39.89 +
39.90 +
39.91 #ifdef UNFINISHED
39.92 int mutil_HookGameEvent(plid_t plid, game_event_t event,
39.93 event_func_t pfnHandle)
39.94 @@ -338,6 +415,10 @@
39.95 mutil_GetUserMsgName, // pfnGetUserMsgName
39.96 mutil_GetPluginPath, // pfnGetPluginPath
39.97 mutil_GetGameInfo, // pfnGetGameInfo
39.98 + mutil_LoadMetaPlugin, // pfnLoadPlugin
39.99 + mutil_UnloadMetaPlugin, // pfnUnloadPlugin
39.100 + mutil_UnloadMetaPluginByHandle, //pfnUnloadPluginByHandle
39.101 + mutil_IsQueryingClientCvar, //pfnIsQueryingClientCvar
39.102 #ifdef UNFINISHED
39.103 mutil_HookGameEvent, // pfnGameEvent
39.104 mutil_HookLogTrigger, // pfnLogTrigger
40.1 --- a/metamod/mutil.h Fri Feb 18 20:52:34 2005 +0000
40.2 +++ b/metamod/mutil.h Tue Aug 23 20:31:28 2005 +0000
40.3 @@ -71,6 +71,10 @@
40.4 const char *(*pfnGetUserMsgName) (plid_t plid, int msgid, int *size);
40.5 const char *(*pfnGetPluginPath) (plid_t plid);
40.6 const char *(*pfnGetGameInfo) (plid_t plid, ginfo_t tag);
40.7 + int (*pfnLoadPlugin) (plid_t plid, const char *cmdline, PLUG_LOADTIME now, void **plugin_handle);
40.8 + int (*pfnUnloadPlugin) (plid_t plid, const char *cmdline, PLUG_LOADTIME now, PL_UNLOAD_REASON reason);
40.9 + int (*pfnUnloadPluginByHandle) (plid_t plid, void *plugin_handle, PLUG_LOADTIME now, PL_UNLOAD_REASON reason);
40.10 + const char *(*pfnIsQueryingClientCvar) (plid_t plid, const edict_t *pEdict);
40.11 #ifdef UNFINISHED
40.12 int (*pfnHookGameEvent) (plid_t plid, game_event_t event,
40.13 event_func_t pfnHandle);
40.14 @@ -104,6 +108,7 @@
40.15 const char *mutil_GetUserMsgName(plid_t plid, int msgid, int *size);
40.16 const char *mutil_GetPluginPath(plid_t plid);
40.17 const char *mutil_GetGameInfo(plid_t plid, ginfo_t tag);
40.18 +const char *mutil_IsQueryingClientCvar(plid_t plid, const edict_t *pEdict);
40.19
40.20 #ifdef UNFINISHED
40.21 int mutil_HookGameEvent(plid_t plid, game_event_t event,
40.22 @@ -132,6 +137,10 @@
40.23 #define GET_USER_MSG_NAME (*gpMetaUtilFuncs->pfnGetUserMsgName)
40.24 #define GET_PLUGIN_PATH (*gpMetaUtilFuncs->pfnGetPluginPath)
40.25 #define GET_GAME_INFO (*gpMetaUtilFuncs->pfnGetGameInfo)
40.26 +#define LOAD_PLUGIN (*gpMetaUtilFuncs->pfnLoadPlugin)
40.27 +#define UNLOAD_PLUGIN (*gpMetaUtilFuncs->pfnUnloadPlugin)
40.28 +#define UNLOAD_PLUGIN_BY_HANDLE (*gpMetaUtilFuncs->pfnUnloadPluginByHandle)
40.29 +#define IS_QUERYING_CLIENT_CVAR (*gpMetaUtilFuncs->pfnIsQueryingClientCvar)
40.30
40.31 #ifdef UNFINISHED
40.32 #define HOOK_GAME_EVENT (*gpMetaUtilFuncs->pfnHookGameEvent)
41.1 --- a/metamod/osdep.cpp Fri Feb 18 20:52:34 2005 +0000
41.2 +++ b/metamod/osdep.cpp Tue Aug 23 20:31:28 2005 +0000
41.3 @@ -61,6 +61,8 @@
41.4 #include "types_meta.h" // mBOOL
41.5 #include "support_meta.h" // MAX_STRBUF_LEN
41.6
41.7 +mBOOL dlclose_handle_invalid;
41.8 +
41.9 // To keep the rest of the sources clean and keep not only OS but also
41.10 // compiler dependant differences in this file, we define a local function
41.11 // to set the new handler.
41.12 @@ -73,9 +75,6 @@
41.13 #endif
41.14 }
41.15
41.16 -
41.17 -
41.18 -
41.19 #ifdef _WIN32
41.20 // Since windows doesn't provide a verison of strtok_r(), we include one
41.21 // here. This may or may not operate exactly like strtok_r(), but does
42.1 --- a/metamod/osdep.h Fri Feb 18 20:52:34 2005 +0000
42.2 +++ b/metamod/osdep.h Tue Aug 23 20:31:28 2005 +0000
42.3 @@ -47,6 +47,8 @@
42.4 #include "mreg.h" // REG_CMD_FN, etc
42.5 #include "log_meta.h" // LOG_ERROR, etc
42.6
42.7 +extern mBOOL dlclose_handle_invalid;
42.8 +
42.9 // String describing platform/DLL-type, for matching lines in plugins.ini.
42.10 #ifdef linux
42.11 #define PLATFORM "linux"
42.12 @@ -127,9 +129,16 @@
42.13 return(dlsym(handle, string));
42.14 }
42.15 inline int DLCLOSE(DLHANDLE handle) {
42.16 + if (!handle) {
42.17 + dlclose_handle_invalid = mTRUE;
42.18 + return(1);
42.19 + }
42.20 + dlclose_handle_invalid = mFALSE;
42.21 return(dlclose(handle));
42.22 }
42.23 inline char* DLERROR(void) {
42.24 + if (dlclose_handle_invalid)
42.25 + return("Invalid handle.");
42.26 return(dlerror());
42.27 }
42.28 #elif defined(_WIN32)
42.29 @@ -142,6 +151,11 @@
42.30 return(GetProcAddress(handle, string));
42.31 }
42.32 inline int DLCLOSE(DLHANDLE handle) {
42.33 + if (!handle) {
42.34 + dlclose_handle_invalid = mTRUE;
42.35 + return(1);
42.36 + }
42.37 + dlclose_handle_invalid = mFALSE;
42.38 // NOTE: Windows FreeLibrary returns success=nonzero, fail=zero,
42.39 // which is the opposite of the unix convention, thus the '!'.
42.40 return(!FreeLibrary(handle));
42.41 @@ -150,6 +164,8 @@
42.42 // we make our own.
42.43 char *str_GetLastError(void);
42.44 inline char* DLERROR(void) {
42.45 + if (dlclose_handle_invalid)
42.46 + return("Invalid handle.");
42.47 return(str_GetLastError());
42.48 }
42.49 #endif /* _WIN32 */
43.1 --- a/metamod/plinfo.h Fri Feb 18 20:52:34 2005 +0000
43.2 +++ b/metamod/plinfo.h Tue Aug 23 20:31:28 2005 +0000
43.3 @@ -47,6 +47,20 @@
43.4 PT_ANYPAUSE, // can be loaded/unloaded at any time, and can be "paused" during a map
43.5 } PLUG_LOADTIME;
43.6
43.7 +// Flags to indicate why the plugin is being unloaded.
43.8 +typedef enum {
43.9 + PNL_NULL = 0,
43.10 + PNL_INI_DELETED, // was deleted from plugins.ini
43.11 + PNL_FILE_NEWER, // file on disk is newer than last load
43.12 + PNL_COMMAND, // requested by server/console command
43.13 + PNL_CMD_FORCED, // forced by server/console command
43.14 + PNL_DELAYED, // delayed from previous request; can't tell origin
43.15 +//only used for 'real_reason' on MPlugin::unload()
43.16 + PNL_PLUGIN, // requested by plugin function call
43.17 + PNL_PLG_FORCED, // forced by plugin function call
43.18 + PNL_RELOAD, // forced unload by reload()
43.19 +} PL_UNLOAD_REASON;
43.20 +
43.21 // Information plugin provides about itself.
43.22 typedef struct {
43.23 char *ifvers; // meta_interface version
44.1 --- a/metamod/reg_support.cpp Fri Feb 18 20:52:34 2005 +0000
44.2 +++ b/metamod/reg_support.cpp Tue Aug 23 20:31:28 2005 +0000
44.3 @@ -48,7 +48,7 @@
44.4 #include "sdk_util.h" // REG_SVR_COMMAND, etc
44.5
44.6 #include "reg_support.h" // me
44.7 -#include "metamod.h" // RegCmds, etc
44.8 +#include "metamod.h" // RegCmds, g_Players, etc
44.9 #include "log_meta.h" // META_ERROR, etc
44.10
44.11 // "Register" support.
44.12 @@ -237,3 +237,13 @@
44.13 cp=strdup(pszName);
44.14 return(REG_USER_MSG(cp, iSize));
44.15 }
44.16 +
44.17 +// Intercept and record queries
44.18 +void meta_QueryClientCvarValue(const edict_t *player, const char *cvarName)
44.19 +{
44.20 + g_Players.set_player_cvar_query(player, cvarName);
44.21 +
44.22 + (*g_engfuncs.pfnQueryClientCvarValue)(player, cvarName);
44.23 +}
44.24 +
44.25 +
45.1 --- a/metamod/reg_support.h Fri Feb 18 20:52:34 2005 +0000
45.2 +++ b/metamod/reg_support.h Tue Aug 23 20:31:28 2005 +0000
45.3 @@ -43,5 +43,6 @@
45.4 void meta_AddServerCommand(char *cmd_name, REG_CMD_FN function);
45.5 void meta_CVarRegister(cvar_t *pCvar);
45.6 int meta_RegUserMsg(const char *pszName, int iSize);
45.7 +void meta_QueryClientCvarValue(const edict_t *player, const char *cvarName);
45.8
45.9 #endif /* REG_SUPPORT_H */
46.1 --- a/metamod/res_meta.rc Fri Feb 18 20:52:34 2005 +0000
46.2 +++ b/metamod/res_meta.rc Tue Aug 23 20:31:28 2005 +0000
46.3 @@ -61,7 +61,7 @@
46.4 VALUE "FileVersion", VVERSION "\0"
46.5 VALUE "InternalName", RC_INTERNAL "\0"
46.6 VALUE "LegalCopyright", RC_COPYRIGHT "\0"
46.7 - VALUE "LegalTrademarks", "\0"
46.8 + VALUE "License", RC_LICENSE "\0"
46.9 VALUE "OriginalFilename", RC_FILENAME "\0"
46.10 VALUE "PrivateBuild", "\0"
46.11 VALUE "ProductName", VNAME "\0"
47.1 --- a/metamod/sdk_util.h Fri Feb 18 20:52:34 2005 +0000
47.2 +++ b/metamod/sdk_util.h Tue Aug 23 20:31:28 2005 +0000
47.3 @@ -53,12 +53,23 @@
47.4 // Also, create some additional macros for engine callback functions, which
47.5 // weren't in SDK dlls/enginecallbacks.h but probably should have been.
47.6
47.7 -#define GET_INFOKEYBUFFER (*g_engfuncs.pfnGetInfoKeyBuffer)
47.8 -#define INFOKEY_VALUE (*g_engfuncs.pfnInfoKeyValue)
47.9 -#define SET_CLIENT_KEYVALUE (*g_engfuncs.pfnSetClientKeyValue)
47.10 -#define REG_SVR_COMMAND (*g_engfuncs.pfnAddServerCommand)
47.11 -#define SERVER_PRINT (*g_engfuncs.pfnServerPrint)
47.12 -#define SET_SERVER_KEYVALUE (*g_engfuncs.pfnSetKeyValue)
47.13 +#define GET_INFOKEYBUFFER (*g_engfuncs.pfnGetInfoKeyBuffer)
47.14 +#define INFOKEY_VALUE (*g_engfuncs.pfnInfoKeyValue)
47.15 +#define SET_CLIENT_KEYVALUE (*g_engfuncs.pfnSetClientKeyValue)
47.16 +#define REG_SVR_COMMAND (*g_engfuncs.pfnAddServerCommand)
47.17 +#define SERVER_PRINT (*g_engfuncs.pfnServerPrint)
47.18 +#define SET_SERVER_KEYVALUE (*g_engfuncs.pfnSetKeyValue)
47.19 +#define QUERY_CLIENT_CVAR_VALUE (*g_engfuncs.pfnQueryClientCvarValue)
47.20 +
47.21 +
47.22 +// Add overloaded ENTINDEX() version for const edict_t pointer.
47.23 +// The pfnIndexOfEdict() function takes a const edict_t pointer
47.24 +// as parameter anyway, so there is no reason why ENTINDEX()
47.25 +// shouldn't.
47.26 +inline int ENTINDEX(const edict_t *pEdict) {
47.27 + return (*g_engfuncs.pfnIndexOfEdict)(pEdict);
47.28 +}
47.29 +
47.30
47.31 // Also, create some nice inlines for engine callback combos.
47.32
48.1 --- a/metamod/types_meta.h Fri Feb 18 20:52:34 2005 +0000
48.2 +++ b/metamod/types_meta.h Tue Aug 23 20:31:28 2005 +0000
48.3 @@ -68,6 +68,8 @@
48.4 ME_DLMISSING, // symbol missing in lib/dll
48.5 ME_DLERROR, // some other error encountered calling functions from dll
48.6 ME_IFVERSION, // incompatible interface version
48.7 + ME_UNLOAD_UNLOADER, // tried to unload unloader
48.8 + ME_UNLOAD_SELF, // tried to unload self
48.9 } META_ERRNO;
48.10 extern META_ERRNO meta_errno;
48.11
49.1 --- a/metamod/vers_meta.h Fri Feb 18 20:52:34 2005 +0000
49.2 +++ b/metamod/vers_meta.h Tue Aug 23 20:31:28 2005 +0000
49.3 @@ -48,8 +48,8 @@
49.4 # endif /* _MSC_VER */
49.5 #endif /* not OPT_TYPE */
49.6
49.7 -#define VDATE "2005/02/20"
49.8 -#define VVERSION "1.17.4"
49.9 -#define RC_VERS_DWORD 1,17,4,0 // Version Windows DLL Resources in res_meta.rc
49.10 +#define VDATE "2005/08/24"
49.11 +#define VVERSION "1.18"
49.12 +#define RC_VERS_DWORD 1,18,0,0 // Version Windows DLL Resources in res_meta.rc
49.13
49.14 #endif /* VERS_META_H */
50.1 --- a/stub_plugin/engine_api.cpp Fri Feb 18 20:52:34 2005 +0000
50.2 +++ b/stub_plugin/engine_api.cpp Tue Aug 23 20:31:28 2005 +0000
50.3 @@ -239,6 +239,9 @@
50.4 NULL, // pfnProcessTutorMessageDecayBuffer()
50.5 NULL, // pfnConstructTutorMessageDecayBuffer()
50.6 NULL, // pfnResetTutorMessageDecayData()
50.7 +
50.8 + // Added Added 2005/08/11 (no SDK update)
50.9 + NULL, // pfnQueryClientCvarValue()
50.10 };
50.11
50.12 C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine,
51.1 --- a/trace_plugin/api_info.cpp Fri Feb 18 20:52:34 2005 +0000
51.2 +++ b/trace_plugin/api_info.cpp Tue Aug 23 20:31:28 2005 +0000
51.3 @@ -97,6 +97,8 @@
51.4 { mFALSE, 16, "OnFreeEntPrivateData" }, // pfnOnFreeEntPrivateData
51.5 { mFALSE, 3, "GameShutdown" }, // pfnGameShutdown
51.6 { mFALSE, 14, "ShouldCollide" }, // pfnShouldCollide
51.7 + // Added 2005/08/11 (no SDK update)
51.8 + { mFALSE, 3, "CvarValue" }, // pfnCvarValue
51.9 { mFALSE, 0, NULL },
51.10 };
51.11
51.12 @@ -259,6 +261,8 @@
51.13 { mFALSE, 30, "ProcessTutorMessageDecayBuffer" }, // pfnProcessTutorMessageDecayBuffer
51.14 { mFALSE, 30, "ConstructTutorMessageDecayBuffer" }, // pfnConstructTutorMessageDecayBuffer
51.15 { mFALSE, 9, "ResetTutorMessageDecayData" }, // pfnResetTutorMessageDecayData
51.16 + // Added 2005/08/11 (no SDK update)
51.17 + { mFALSE, 3, "QueryClientCvarValue" }, //pfnQueryClientCvarValue
51.18 // end
51.19 { mFALSE, 0, NULL },
51.20 };
52.1 --- a/trace_plugin/dllapi.cpp Fri Feb 18 20:52:34 2005 +0000
52.2 +++ b/trace_plugin/dllapi.cpp Tue Aug 23 20:31:28 2005 +0000
52.3 @@ -284,6 +284,10 @@
52.4 NEWDLL_TRACE(pfnShouldCollide, P_PRE, (""));
52.5 RETURN_META_VALUE(MRES_IGNORED, 1);
52.6 }
52.7 +void CvarValue(const edict_t *pEdict, const char *szValue) {
52.8 + NEWDLL_TRACE(pfnCvarValue, P_PRE, ("player=%s, value=%s", STRING(pEdict->v.netname), szValue?szValue:"nil"));
52.9 + RETURN_META(MRES_IGNORED);
52.10 +}
52.11
52.12
52.13 // from SDK dlls/cbase.cpp:
52.14 @@ -406,6 +410,7 @@
52.15 OnFreeEntPrivateData, //! pfnOnFreeEntPrivateData() Called right before the object's memory is freed. Calls its destructor.
52.16 GameShutdown, //! pfnGameShutdown()
52.17 ShouldCollide, //! pfnShouldCollide()
52.18 + CvarValue, //! pfnCvarValue()
52.19 };
52.20
52.21 C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable,
53.1 --- a/trace_plugin/dllapi_post.cpp Fri Feb 18 20:52:34 2005 +0000
53.2 +++ b/trace_plugin/dllapi_post.cpp Tue Aug 23 20:31:28 2005 +0000
53.3 @@ -277,6 +277,12 @@
53.4 RETURN_META_VALUE(MRES_IGNORED, 1);
53.5 }
53.6
53.7 +void CvarValue_Post(const edict_t *pEdict, const char *szValue)
53.8 +{
53.9 + NEWDLL_TRACE(pfnCvarValue, P_POST, (""));
53.10 + RETURN_META(MRES_IGNORED);
53.11 +}
53.12 +
53.13
53.14 // from SDK dlls/cbase.cpp:
53.15 // (wd) indicates my comments on the functions
53.16 @@ -382,6 +388,7 @@
53.17 OnFreeEntPrivateData_Post, //! pfnOnFreeEntPrivateData() Called right before the object's memory is freed. Calls its destructor.
53.18 GameShutdown_Post, //! pfnGameShutdown()
53.19 ShouldCollide_Post, //! pfnShouldCollide()
53.20 + CvarValue_Post, //! pfnCvarValue()
53.21 };
53.22
53.23 C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion )
54.1 --- a/trace_plugin/engine_api.cpp Fri Feb 18 20:52:34 2005 +0000
54.2 +++ b/trace_plugin/engine_api.cpp Tue Aug 23 20:31:28 2005 +0000
54.3 @@ -844,6 +844,12 @@
54.4 RETURN_META(MRES_IGNORED);
54.5 }
54.6
54.7 +void QueryClientCvarValue(const edict_t *pEdict, const char *cvarName)
54.8 +{
54.9 + ENGINE_TRACE(pfnQueryClientCvarValue, P_PRE, ("queried=%s",cvarName?cvarName:"nil"));
54.10 + RETURN_META(MRES_IGNORED);
54.11 +}
54.12 +
54.13 enginefuncs_t meta_engfuncs = {
54.14 PrecacheModel, // pfnPrecacheModel()
54.15 PrecacheSound, // pfnPrecacheSound()
54.16 @@ -1047,6 +1053,7 @@
54.17 ProcessTutorMessageDecayBuffer, // pfnProcessTutorMessageDecayBuffer()
54.18 ConstructTutorMessageDecayBuffer, // pfnConstructTutorMessageDecayBuffer()
54.19 ResetTutorMessageDecayData, // pfnResetTutorMessageDecayData()
54.20 + QueryClientCvarValue, // pfnQueryClientCvarValue()
54.21 };
54.22
54.23 C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine,
55.1 --- a/trace_plugin/engine_api_post.cpp Fri Feb 18 20:52:34 2005 +0000
55.2 +++ b/trace_plugin/engine_api_post.cpp Tue Aug 23 20:31:28 2005 +0000
55.3 @@ -403,7 +403,6 @@
55.4 }
55.5
55.6 int RegUserMsg_Post(const char *pszName, int iSize) {
55.7 - int ret;
55.8 ENGINE_TRACE(pfnRegUserMsg, P_POST, ("msg=%s, id=%d, size=%d",
55.9 pszName, META_RESULT_ORIG_RET(int), iSize));
55.10 RETURN_META_VALUE(MRES_IGNORED, 0);
55.11 @@ -838,6 +837,14 @@
55.12 RETURN_META(MRES_IGNORED);
55.13 }
55.14
55.15 +// Added 2005/08/11 (no SDK update):
55.16 +
55.17 +void QueryClientCvarValue_Post(const edict_t *pEdict, const char *cvar) {
55.18 + // trace output in Post
55.19 + ENGINE_TRACE(pfnQueryClientCvarValue, P_POST, ("queried=%s",cvar?cvar:"nil"));
55.20 + RETURN_META(MRES_IGNORED);
55.21 +}
55.22 +
55.23 enginefuncs_t meta_engfuncs_post = {
55.24 PrecacheModel_Post, // pfnPrecacheModel()
55.25 PrecacheSound_Post, // pfnPrecacheSound()
55.26 @@ -1041,6 +1048,7 @@
55.27 ProcessTutorMessageDecayBuffer_Post, // pfnProcessTutorMessageDecayBuffer()
55.28 ConstructTutorMessageDecayBuffer_Post, // pfnConstructTutorMessageDecayBuffer()
55.29 ResetTutorMessageDecayData_Post, // pfnResetTutorMessageDecayData()
55.30 + QueryClientCvarValue_Post, // pfnQueryClientCvarValue()
55.31 };
55.32
55.33 C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion )
56.1 --- a/trace_plugin/info_name.h Fri Feb 18 20:52:34 2005 +0000
56.2 +++ b/trace_plugin/info_name.h Tue Aug 23 20:31:28 2005 +0000
56.3 @@ -39,6 +39,8 @@
56.4
56.5 #include "vers_meta.h" // VDATE, VVERSION, etc
56.6
56.7 +#define COPYRIGHT_YEAR "2005"
56.8 +
56.9 #define VNAME "Trace HLSDK API"
56.10 #define VAUTHOR "Will Day <[email protected]>"
56.11 #define VURL "http://www.metamod.org/"
56.12 @@ -49,6 +51,7 @@
56.13 #define RC_DESC "HLSDK API Trace Metamod Plugin DLL"
56.14 #define RC_FILENAME "TRACE_MM.DLL"
56.15 #define RC_INTERNAL "TRACE_MM"
56.16 -#define RC_COPYRIGHT "Copyright� 2001-2003 Will Day; licensed under the GPL"
56.17 +#define RC_COPYRIGHT "Copyright� 2001-" COPYRIGHT_YEAR " Will Day; GPL licensed"
56.18 +#define RC_LICENSE "Licensed under the GNU General Public License"
56.19
56.20 #endif /* INFO_NAME_H */
57.1 --- a/trace_plugin/res_meta.rc Fri Feb 18 20:52:34 2005 +0000
57.2 +++ b/trace_plugin/res_meta.rc Tue Aug 23 20:31:28 2005 +0000
57.3 @@ -61,7 +61,7 @@
57.4 VALUE "FileVersion", VVERSION "\0"
57.5 VALUE "InternalName", RC_INTERNAL "\0"
57.6 VALUE "LegalCopyright", RC_COPYRIGHT "\0"
57.7 - VALUE "LegalTrademarks", "\0"
57.8 + VALUE "License", RC_LICENSE "\0"
57.9 VALUE "OriginalFilename", RC_FILENAME "\0"
57.10 VALUE "PrivateBuild", "\0"
57.11 VALUE "ProductName", VNAME "\0"
58.1 --- a/wdmisc_plugin/info_name.h Fri Feb 18 20:52:34 2005 +0000
58.2 +++ b/wdmisc_plugin/info_name.h Tue Aug 23 20:31:28 2005 +0000
58.3 @@ -39,6 +39,8 @@
58.4
58.5 #include "vers_meta.h" // VDATE, VVERSION, etc
58.6
58.7 +#define COPYRIGHT_YEAR "2003"
58.8 +
58.9 #define VNAME "WD Misc Functions"
58.10 #define VAUTHOR "Will Day <[email protected]>"
58.11 #define VURL "http://www.metamod.org/"
58.12 @@ -49,6 +51,7 @@
58.13 #define RC_DESC "WDMisc Metamod Plugin DLL"
58.14 #define RC_FILENAME "WDMISC_MM.DLL"
58.15 #define RC_INTERNAL "WDMISC_MM"
58.16 -#define RC_COPYRIGHT "Copyright� 2001-2003 Will Day; licensed under the GPL"
58.17 +#define RC_COPYRIGHT "Copyright� 2001-" COPYRIGHT_YEAR " Will Day; GPL licensed"
58.18 +#define RC_LICENSE "Licensed under the GNU General Public License"
58.19
58.20 #endif /* INFO_NAME_H */
59.1 --- a/wdmisc_plugin/res_meta.rc Fri Feb 18 20:52:34 2005 +0000
59.2 +++ b/wdmisc_plugin/res_meta.rc Tue Aug 23 20:31:28 2005 +0000
59.3 @@ -61,7 +61,7 @@
59.4 VALUE "FileVersion", VVERSION "\0"
59.5 VALUE "InternalName", RC_INTERNAL "\0"
59.6 VALUE "LegalCopyright", RC_COPYRIGHT "\0"
59.7 - VALUE "LegalTrademarks", "\0"
59.8 + VALUE "License", RC_LICENSE "\0"
59.9 VALUE "OriginalFilename", RC_FILENAME "\0"
59.10 VALUE "PrivateBuild", "\0"
59.11 VALUE "ProductName", VNAME "\0"