From 72cd86b431d4c6ed708ffc7425cd39fedddb9e96 Mon Sep 17 00:00:00 2001 From: Adidasman Date: Mon, 4 Jul 2016 12:07:29 +0600 Subject: [PATCH] add project --- .gitignore | 2 + ABOUT.txt | 35 + Config.mak | 4 + GPL.txt | 340 ++++ Makefile | 31 + README.txt | 7 + doc/Changelog | 992 +++++++++++ doc/README.txt | 6 + doc/TODO | 37 + doc/config.ini | 90 + doc/html/Index.html | 65 + doc/html/a.html | 35 + doc/html/about.html | 52 + doc/html/coding.html | 396 +++++ doc/html/dllapi_notes.html | 569 +++++++ doc/html/engine_notes.html | 1705 +++++++++++++++++++ doc/html/faq.html | 158 ++ doc/html/gamesupport.html | 17 + doc/html/links.html | 114 ++ doc/html/maillist.html | 62 + doc/html/metamod.html | 696 ++++++++ doc/html/newapi_notes.html | 62 + doc/html/release_notes.html | 127 ++ doc/html/supportedmods.html | 35 + doc/html/trace.html | 88 + doc/html/wdmisc.html | 48 + doc/plugins.ini | 35 + doc/txt/Index.txt | 27 + doc/txt/a.txt | 19 + doc/txt/about.txt | 35 + doc/txt/coding.txt | 340 ++++ doc/txt/dllapi_notes.txt | 702 ++++++++ doc/txt/engine_notes.txt | 2166 ++++++++++++++++++++++++ doc/txt/faq.txt | 120 ++ doc/txt/gamesupport.txt | 6 + doc/txt/links.txt | 129 ++ doc/txt/maillist.txt | 25 + doc/txt/metamod.txt | 568 +++++++ doc/txt/newapi_notes.txt | 55 + doc/txt/release_notes.txt | 79 + doc/txt/supportedmods.txt | 18 + doc/txt/trace.txt | 70 + doc/txt/wdmisc.txt | 32 + doc/txt/windows_notes.txt | 110 ++ hlsdk/common/beamdef.h | 64 + hlsdk/common/cl_entity.h | 117 ++ hlsdk/common/com_model.h | 353 ++++ hlsdk/common/con_nprint.h | 33 + hlsdk/common/const.h | 771 +++++++++ hlsdk/common/crc.h | 54 + hlsdk/common/cvardef.h | 36 + hlsdk/common/demo_api.h | 33 + hlsdk/common/director_cmds.h | 38 + hlsdk/common/dlight.h | 35 + hlsdk/common/dll_state.h | 23 + hlsdk/common/engine_launcher_api.h | 112 ++ hlsdk/common/entity_state.h | 195 +++ hlsdk/common/entity_types.h | 26 + hlsdk/common/event_api.h | 53 + hlsdk/common/event_args.h | 52 + hlsdk/common/event_flags.h | 49 + hlsdk/common/exefuncs.h | 50 + hlsdk/common/hltv.h | 57 + hlsdk/common/in_buttons.h | 40 + hlsdk/common/interface.h | 129 ++ hlsdk/common/ivoicetweak.h | 37 + hlsdk/common/mathlib.h | 156 ++ hlsdk/common/net_api.h | 101 ++ hlsdk/common/netadr.h | 42 + hlsdk/common/nowin.h | 15 + hlsdk/common/particledef.h | 59 + hlsdk/common/pmtrace.h | 45 + hlsdk/common/qfont.h | 42 + hlsdk/common/r_efx.h | 199 +++ hlsdk/common/r_studioint.h | 149 ++ hlsdk/common/ref_params.h | 75 + hlsdk/common/screenfade.h | 26 + hlsdk/common/studio_event.h | 31 + hlsdk/common/triangleapi.h | 61 + hlsdk/common/usercmd.h | 43 + hlsdk/common/weaponinfo.h | 54 + hlsdk/dlls/cdll_dll.h | 46 + hlsdk/dlls/enginecallback.h | 163 ++ hlsdk/dlls/extdll.h | 83 + hlsdk/dlls/util.h | 515 ++++++ hlsdk/dlls/vector.h | 120 ++ hlsdk/engine/Sequence.h | 201 +++ hlsdk/engine/anorms.h | 177 ++ hlsdk/engine/archtypes.h | 41 + hlsdk/engine/cdll_int.h | 311 ++++ hlsdk/engine/custom.h | 104 ++ hlsdk/engine/customentity.h | 38 + hlsdk/engine/edict.h | 31 + hlsdk/engine/eiface.h | 575 +++++++ hlsdk/engine/keydefs.h | 131 ++ hlsdk/engine/progdefs.h | 226 +++ hlsdk/engine/progs.h | 82 + hlsdk/engine/shake.h | 55 + hlsdk/engine/studio.h | 362 ++++ hlsdk/hlsdk_readme.txt | 2 + hlsdk/pm_shared/pm_debug.h | 28 + hlsdk/pm_shared/pm_defs.h | 226 +++ hlsdk/pm_shared/pm_info.h | 26 + hlsdk/pm_shared/pm_materials.h | 37 + hlsdk/pm_shared/pm_movevars.h | 47 + hlsdk/pm_shared/pm_shared.h | 40 + metamod/.gitignore | 3 + metamod/Config.mak | 34 + metamod/Makefile | 454 +++++ metamod/api_hook.cpp | 690 ++++++++ metamod/api_hook.h | 397 +++++ metamod/api_info.cpp | 275 +++ metamod/api_info.h | 312 ++++ metamod/build_all.sh | 5 + metamod/commands_meta.cpp | 513 ++++++ metamod/commands_meta.h | 83 + metamod/comp_dep.h | 97 ++ metamod/conf_meta.cpp | 240 +++ metamod/conf_meta.h | 100 ++ metamod/dllapi.cpp | 513 ++++++ metamod/dllapi.h | 121 ++ metamod/engine_api.cpp | 1130 ++++++++++++ metamod/engine_api.h | 240 +++ metamod/engine_t.h | 82 + metamod/enginecallbacks.h | 78 + metamod/engineinfo.cpp | 390 +++++ metamod/engineinfo.h | 263 +++ metamod/game_autodetect.cpp | 130 ++ metamod/game_autodetect.h | 43 + metamod/game_support.cpp | 331 ++++ metamod/game_support.h | 56 + metamod/games.h | 131 ++ metamod/h_export.cpp | 108 ++ metamod/h_export.h | 49 + metamod/i386pe.merge | 205 +++ metamod/info_name.h | 56 + metamod/linkent.h | 109 ++ metamod/linkgame.cpp | 37 + metamod/linkplug.cpp | 42 + metamod/log_meta.cpp | 240 +++ metamod/log_meta.h | 116 ++ metamod/meta_api.h | 232 +++ metamod/meta_eiface.cpp | 724 ++++++++ metamod/meta_eiface.h | 480 ++++++ metamod/metamod.cpp | 459 +++++ metamod/metamod.def | 5 + metamod/metamod.h | 256 +++ metamod/metamod.sln | 20 + metamod/metamod.vcproj | 489 ++++++ metamod/mhook.cpp | 0 metamod/mhook.h | 0 metamod/mlist.cpp | 901 ++++++++++ metamod/mlist.h | 94 + metamod/mm_pextensions.h | 116 ++ metamod/mplayer.cpp | 190 +++ metamod/mplayer.h | 91 + metamod/mplugin.cpp | 1561 +++++++++++++++++ metamod/mplugin.h | 234 +++ metamod/mqueue.cpp | 0 metamod/mqueue.h | 0 metamod/mreg.cpp | 532 ++++++ metamod/mreg.h | 191 +++ metamod/mutil.cpp | 395 +++++ metamod/mutil.h | 108 ++ metamod/new_baseclass.h | 69 + metamod/osdep.cpp | 399 +++++ metamod/osdep.h | 307 ++++ metamod/osdep_detect_gamedll_linux.cpp | 335 ++++ metamod/osdep_detect_gamedll_win32.cpp | 225 +++ metamod/osdep_linkent_linux.cpp | 234 +++ metamod/osdep_linkent_win32.cpp | 245 +++ metamod/osdep_p.cpp | 124 ++ metamod/osdep_p.h | 76 + metamod/plinfo.h | 85 + metamod/reg_support.cpp | 228 +++ metamod/reg_support.h | 49 + metamod/res_meta.rc | 76 + metamod/ret_type.h | 69 + metamod/sdk_util.cpp | 125 ++ metamod/sdk_util.h | 121 ++ metamod/studioapi.cpp | 38 + metamod/studioapi.h | 38 + metamod/support_meta.cpp | 121 ++ metamod/support_meta.h | 177 ++ metamod/thread_logparse.cpp | 0 metamod/thread_logparse.h | 0 metamod/tqueue.h | 114 ++ metamod/types_meta.h | 85 + metamod/vdate.cpp | 58 + metamod/vdate.h | 45 + metamod/vers_meta.h | 61 + stub_plugin/.gitignore | 3 + stub_plugin/Config.mak | 5 + stub_plugin/Makefile | 6 + stub_plugin/dllapi.cpp | 119 ++ stub_plugin/dummy.h | 0 stub_plugin/dummy.rc | 0 stub_plugin/engine_api.cpp | 266 +++ stub_plugin/h_export.cpp | 45 + stub_plugin/info_name.h | 0 stub_plugin/meta_api.cpp | 121 ++ stub_plugin/sdk_util.cpp | 50 + tools/getents.sh | 4 + tools/stlfilter | 27 + trace_plugin/.gitignore | 3 + trace_plugin/Config.mak | 13 + trace_plugin/Makefile | 6 + trace_plugin/api_info.cpp | 273 +++ trace_plugin/dllapi.cpp | 445 +++++ trace_plugin/dllapi_post.cpp | 417 +++++ trace_plugin/dllapi_post.h | 113 ++ trace_plugin/engine_api.cpp | 1094 ++++++++++++ trace_plugin/engine_api_post.cpp | 1091 ++++++++++++ trace_plugin/engine_api_post.h | 276 +++ trace_plugin/h_export.cpp | 49 + trace_plugin/info_name.h | 54 + trace_plugin/log_plugin.cpp | 64 + trace_plugin/log_plugin.h | 59 + trace_plugin/meta_api.cpp | 169 ++ trace_plugin/plugin.cpp | 75 + trace_plugin/plugin.h | 44 + trace_plugin/res_meta.rc | 76 + trace_plugin/sdk_util.cpp | 143 ++ trace_plugin/trace_api.cpp | 300 ++++ trace_plugin/trace_api.h | 102 ++ trace_plugin/vdate.cpp | 51 + wdmisc_plugin/.gitignore | 3 + wdmisc_plugin/Config.mak | 13 + wdmisc_plugin/Makefile | 6 + wdmisc_plugin/dll_plugin.cpp | 134 ++ wdmisc_plugin/dll_plugin.h | 45 + wdmisc_plugin/engine_api.cpp | 69 + wdmisc_plugin/h_export.cpp | 49 + wdmisc_plugin/info_name.h | 54 + wdmisc_plugin/log_plugin.cpp | 64 + wdmisc_plugin/log_plugin.h | 59 + wdmisc_plugin/meta_api.cpp | 169 ++ wdmisc_plugin/plugin.h | 44 + wdmisc_plugin/res_meta.rc | 76 + wdmisc_plugin/sdk_util.cpp | 143 ++ wdmisc_plugin/vdate.cpp | 51 + wdmisc_plugin/wdmisc.cpp | 209 +++ wdmisc_plugin/wdmisc.h | 51 + 243 files changed, 42488 insertions(+) create mode 100644 .gitignore create mode 100644 ABOUT.txt create mode 100644 Config.mak create mode 100644 GPL.txt create mode 100644 Makefile create mode 100644 README.txt create mode 100644 doc/Changelog create mode 100644 doc/README.txt create mode 100644 doc/TODO create mode 100644 doc/config.ini create mode 100644 doc/html/Index.html create mode 100644 doc/html/a.html create mode 100644 doc/html/about.html create mode 100644 doc/html/coding.html create mode 100644 doc/html/dllapi_notes.html create mode 100644 doc/html/engine_notes.html create mode 100644 doc/html/faq.html create mode 100644 doc/html/gamesupport.html create mode 100644 doc/html/links.html create mode 100644 doc/html/maillist.html create mode 100644 doc/html/metamod.html create mode 100644 doc/html/newapi_notes.html create mode 100644 doc/html/release_notes.html create mode 100644 doc/html/supportedmods.html create mode 100644 doc/html/trace.html create mode 100644 doc/html/wdmisc.html create mode 100644 doc/plugins.ini create mode 100644 doc/txt/Index.txt create mode 100644 doc/txt/a.txt create mode 100644 doc/txt/about.txt create mode 100644 doc/txt/coding.txt create mode 100644 doc/txt/dllapi_notes.txt create mode 100644 doc/txt/engine_notes.txt create mode 100644 doc/txt/faq.txt create mode 100644 doc/txt/gamesupport.txt create mode 100644 doc/txt/links.txt create mode 100644 doc/txt/maillist.txt create mode 100644 doc/txt/metamod.txt create mode 100644 doc/txt/newapi_notes.txt create mode 100644 doc/txt/release_notes.txt create mode 100644 doc/txt/supportedmods.txt create mode 100644 doc/txt/trace.txt create mode 100644 doc/txt/wdmisc.txt create mode 100644 doc/txt/windows_notes.txt create mode 100644 hlsdk/common/beamdef.h create mode 100644 hlsdk/common/cl_entity.h create mode 100644 hlsdk/common/com_model.h create mode 100644 hlsdk/common/con_nprint.h create mode 100644 hlsdk/common/const.h create mode 100644 hlsdk/common/crc.h create mode 100644 hlsdk/common/cvardef.h create mode 100644 hlsdk/common/demo_api.h create mode 100644 hlsdk/common/director_cmds.h create mode 100644 hlsdk/common/dlight.h create mode 100644 hlsdk/common/dll_state.h create mode 100644 hlsdk/common/engine_launcher_api.h create mode 100644 hlsdk/common/entity_state.h create mode 100644 hlsdk/common/entity_types.h create mode 100644 hlsdk/common/event_api.h create mode 100644 hlsdk/common/event_args.h create mode 100644 hlsdk/common/event_flags.h create mode 100644 hlsdk/common/exefuncs.h create mode 100644 hlsdk/common/hltv.h create mode 100644 hlsdk/common/in_buttons.h create mode 100644 hlsdk/common/interface.h create mode 100644 hlsdk/common/ivoicetweak.h create mode 100644 hlsdk/common/mathlib.h create mode 100644 hlsdk/common/net_api.h create mode 100644 hlsdk/common/netadr.h create mode 100644 hlsdk/common/nowin.h create mode 100644 hlsdk/common/particledef.h create mode 100644 hlsdk/common/pmtrace.h create mode 100644 hlsdk/common/qfont.h create mode 100644 hlsdk/common/r_efx.h create mode 100644 hlsdk/common/r_studioint.h create mode 100644 hlsdk/common/ref_params.h create mode 100644 hlsdk/common/screenfade.h create mode 100644 hlsdk/common/studio_event.h create mode 100644 hlsdk/common/triangleapi.h create mode 100644 hlsdk/common/usercmd.h create mode 100644 hlsdk/common/weaponinfo.h create mode 100644 hlsdk/dlls/cdll_dll.h create mode 100644 hlsdk/dlls/enginecallback.h create mode 100644 hlsdk/dlls/extdll.h create mode 100644 hlsdk/dlls/util.h create mode 100644 hlsdk/dlls/vector.h create mode 100644 hlsdk/engine/Sequence.h create mode 100644 hlsdk/engine/anorms.h create mode 100644 hlsdk/engine/archtypes.h create mode 100644 hlsdk/engine/cdll_int.h create mode 100644 hlsdk/engine/custom.h create mode 100644 hlsdk/engine/customentity.h create mode 100644 hlsdk/engine/edict.h create mode 100644 hlsdk/engine/eiface.h create mode 100644 hlsdk/engine/keydefs.h create mode 100644 hlsdk/engine/progdefs.h create mode 100644 hlsdk/engine/progs.h create mode 100644 hlsdk/engine/shake.h create mode 100644 hlsdk/engine/studio.h create mode 100644 hlsdk/hlsdk_readme.txt create mode 100644 hlsdk/pm_shared/pm_debug.h create mode 100644 hlsdk/pm_shared/pm_defs.h create mode 100644 hlsdk/pm_shared/pm_info.h create mode 100644 hlsdk/pm_shared/pm_materials.h create mode 100644 hlsdk/pm_shared/pm_movevars.h create mode 100644 hlsdk/pm_shared/pm_shared.h create mode 100644 metamod/.gitignore create mode 100644 metamod/Config.mak create mode 100644 metamod/Makefile create mode 100644 metamod/api_hook.cpp create mode 100644 metamod/api_hook.h create mode 100644 metamod/api_info.cpp create mode 100644 metamod/api_info.h create mode 100644 metamod/build_all.sh create mode 100644 metamod/commands_meta.cpp create mode 100644 metamod/commands_meta.h create mode 100644 metamod/comp_dep.h create mode 100644 metamod/conf_meta.cpp create mode 100644 metamod/conf_meta.h create mode 100644 metamod/dllapi.cpp create mode 100644 metamod/dllapi.h create mode 100644 metamod/engine_api.cpp create mode 100644 metamod/engine_api.h create mode 100644 metamod/engine_t.h create mode 100644 metamod/enginecallbacks.h create mode 100644 metamod/engineinfo.cpp create mode 100644 metamod/engineinfo.h create mode 100644 metamod/game_autodetect.cpp create mode 100644 metamod/game_autodetect.h create mode 100644 metamod/game_support.cpp create mode 100644 metamod/game_support.h create mode 100644 metamod/games.h create mode 100644 metamod/h_export.cpp create mode 100644 metamod/h_export.h create mode 100644 metamod/i386pe.merge create mode 100644 metamod/info_name.h create mode 100644 metamod/linkent.h create mode 100644 metamod/linkgame.cpp create mode 100644 metamod/linkplug.cpp create mode 100644 metamod/log_meta.cpp create mode 100644 metamod/log_meta.h create mode 100644 metamod/meta_api.h create mode 100644 metamod/meta_eiface.cpp create mode 100644 metamod/meta_eiface.h create mode 100644 metamod/metamod.cpp create mode 100644 metamod/metamod.def create mode 100644 metamod/metamod.h create mode 100644 metamod/metamod.sln create mode 100644 metamod/metamod.vcproj create mode 100644 metamod/mhook.cpp create mode 100644 metamod/mhook.h create mode 100644 metamod/mlist.cpp create mode 100644 metamod/mlist.h create mode 100644 metamod/mm_pextensions.h create mode 100644 metamod/mplayer.cpp create mode 100644 metamod/mplayer.h create mode 100644 metamod/mplugin.cpp create mode 100644 metamod/mplugin.h create mode 100644 metamod/mqueue.cpp create mode 100644 metamod/mqueue.h create mode 100644 metamod/mreg.cpp create mode 100644 metamod/mreg.h create mode 100644 metamod/mutil.cpp create mode 100644 metamod/mutil.h create mode 100644 metamod/new_baseclass.h create mode 100644 metamod/osdep.cpp create mode 100644 metamod/osdep.h create mode 100644 metamod/osdep_detect_gamedll_linux.cpp create mode 100644 metamod/osdep_detect_gamedll_win32.cpp create mode 100644 metamod/osdep_linkent_linux.cpp create mode 100644 metamod/osdep_linkent_win32.cpp create mode 100644 metamod/osdep_p.cpp create mode 100644 metamod/osdep_p.h create mode 100644 metamod/plinfo.h create mode 100644 metamod/reg_support.cpp create mode 100644 metamod/reg_support.h create mode 100644 metamod/res_meta.rc create mode 100644 metamod/ret_type.h create mode 100644 metamod/sdk_util.cpp create mode 100644 metamod/sdk_util.h create mode 100644 metamod/studioapi.cpp create mode 100644 metamod/studioapi.h create mode 100644 metamod/support_meta.cpp create mode 100644 metamod/support_meta.h create mode 100644 metamod/thread_logparse.cpp create mode 100644 metamod/thread_logparse.h create mode 100644 metamod/tqueue.h create mode 100644 metamod/types_meta.h create mode 100644 metamod/vdate.cpp create mode 100644 metamod/vdate.h create mode 100644 metamod/vers_meta.h create mode 100644 stub_plugin/.gitignore create mode 100644 stub_plugin/Config.mak create mode 100644 stub_plugin/Makefile create mode 100644 stub_plugin/dllapi.cpp create mode 100644 stub_plugin/dummy.h create mode 100644 stub_plugin/dummy.rc create mode 100644 stub_plugin/engine_api.cpp create mode 100644 stub_plugin/h_export.cpp create mode 100644 stub_plugin/info_name.h create mode 100644 stub_plugin/meta_api.cpp create mode 100644 stub_plugin/sdk_util.cpp create mode 100644 tools/getents.sh create mode 100644 tools/stlfilter create mode 100644 trace_plugin/.gitignore create mode 100644 trace_plugin/Config.mak create mode 100644 trace_plugin/Makefile create mode 100644 trace_plugin/api_info.cpp create mode 100644 trace_plugin/dllapi.cpp create mode 100644 trace_plugin/dllapi_post.cpp create mode 100644 trace_plugin/dllapi_post.h create mode 100644 trace_plugin/engine_api.cpp create mode 100644 trace_plugin/engine_api_post.cpp create mode 100644 trace_plugin/engine_api_post.h create mode 100644 trace_plugin/h_export.cpp create mode 100644 trace_plugin/info_name.h create mode 100644 trace_plugin/log_plugin.cpp create mode 100644 trace_plugin/log_plugin.h create mode 100644 trace_plugin/meta_api.cpp create mode 100644 trace_plugin/plugin.cpp create mode 100644 trace_plugin/plugin.h create mode 100644 trace_plugin/res_meta.rc create mode 100644 trace_plugin/sdk_util.cpp create mode 100644 trace_plugin/trace_api.cpp create mode 100644 trace_plugin/trace_api.h create mode 100644 trace_plugin/vdate.cpp create mode 100644 wdmisc_plugin/.gitignore create mode 100644 wdmisc_plugin/Config.mak create mode 100644 wdmisc_plugin/Makefile create mode 100644 wdmisc_plugin/dll_plugin.cpp create mode 100644 wdmisc_plugin/dll_plugin.h create mode 100644 wdmisc_plugin/engine_api.cpp create mode 100644 wdmisc_plugin/h_export.cpp create mode 100644 wdmisc_plugin/info_name.h create mode 100644 wdmisc_plugin/log_plugin.cpp create mode 100644 wdmisc_plugin/log_plugin.h create mode 100644 wdmisc_plugin/meta_api.cpp create mode 100644 wdmisc_plugin/plugin.h create mode 100644 wdmisc_plugin/res_meta.rc create mode 100644 wdmisc_plugin/sdk_util.cpp create mode 100644 wdmisc_plugin/vdate.cpp create mode 100644 wdmisc_plugin/wdmisc.cpp create mode 100644 wdmisc_plugin/wdmisc.h diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c4d4798 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +#temporary files +*~ diff --git a/ABOUT.txt b/ABOUT.txt new file mode 100644 index 0000000..cfef91c --- /dev/null +++ b/ABOUT.txt @@ -0,0 +1,35 @@ +Metamod +=-=-=-= + +a Half-Life utility mod + + meta /me't*/ or /may't*/ or (Commonwealth) /mee't*/ adj.,pref. + [from analytic philosophy] One level of description up. + +The purpose of MetaMod is to function "one level up" from the normal +Half-Life game mod DLL. Sitting between the mod game DLL and the Half-Life +engine/binary, it intercepts the function calls between the two, with the +option of passing them along untouched, as well as passing them on to as +any number of _additional mod-like DLLs_. + +Thus, you can actually have multiple "mod-like" DLLs in operation at one +time. I say "mod-like" because these additional DLLs (we'll call them +"plugins") are not intended to provide a full "game"; that functionality +is still provided by the "game dll". However, these plugins can _add to_ +or _modify the functionality provided by the game dll, or by the engine +itself - for instance, adding new server commands, or new client commands, +or even disabling commands built into the game dll. Although the plugin +isn't intended to provide full HL-game functionality, since it's receiving +the same information given to the game DLL, it has the opportunity to do +_anything_ the game DLL can do (given enough coding effort of course). + +This is very similar to the way Alfred Reynolds' AdminMod +(www.adminmod.org) works, as it also sits between the engine and game dll, +catching routines, and passing them on. thus modifying functionality. +However, rather than providing just the additional server features builtin +to AdminMod DLL, MetaMod allows you to add features from multiple, +separate DLLs. Under that framework, AdminMod can be a plugin itself, and +be run alongside numerous other plugins. And, as of version 2.50 of +AdminMod, AM has now transitioned to running as a Metamod plugin. + +-------------------------------------------------------------------------- diff --git a/Config.mak b/Config.mak new file mode 100644 index 0000000..83f24a7 --- /dev/null +++ b/Config.mak @@ -0,0 +1,4 @@ +PROJNAME = metamod + +#SUBDIRS := $(shell find */Makefile | sed "s/.Makefile//") +SUBDIRS = metamod stub_plugin trace_plugin wdmisc_plugin diff --git a/GPL.txt b/GPL.txt new file mode 100644 index 0000000..5b6e7c6 --- /dev/null +++ b/GPL.txt @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0b65d02 --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +# vi: set ts=4 sw=4 : +# vim: set tw=75 : + +# MetaMod toplevel makefile +# Copyright (c) 2001-2003 Will Day +# +# some sections as demonstated in GNU's make.info documentation + +include Config.mak + +ifeq "$(USER)" "willday" +include priv/top.mak +endif + +.DEFAULT: + for i in $(SUBDIRS); do \ + $(MAKE) -C $$i $@ || exit; \ + done + +.PHONY: subdirs dlls $(SUBDIRS) + +subdirs: $(SUBDIRS) + +$(SUBDIRS): + $(MAKE) -C $@ + +clean cleanall: + for i in $(SUBDIRS); do \ + $(MAKE) -C $$i cleanall || exit; \ + done + -rm dlls/* dlls/debug/* diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..d876143 --- /dev/null +++ b/README.txt @@ -0,0 +1,7 @@ +Metamod Half-Life utility mod + +See the files under "doc/txt" or "doc/html" for more information. + +Will Day +willday@metamod.org +http://www.metamod.org/ diff --git a/doc/Changelog b/doc/Changelog new file mode 100644 index 0000000..feb0794 --- /dev/null +++ b/doc/Changelog @@ -0,0 +1,992 @@ +# vim: set tw=75 ft=none : + +Current version: 1.20p35 + +For newer changes, see Metamod-P git repository commit log at: + http://metamod-p.git.sourceforge.net/git/gitweb.cgi?p=metamod-p/metamod-p;a=summary + +--- + +2012/08/08 1.19p34 + - Revert changes in 1.19p33 and start over with 1.19p32 code base + - Fix compiling with latest userspace headers and gcc-4.6 + - Disabled building x86-64 binaries as Valve has dropped x86-64 + linux server support. + +2012/07/27 1.19p33 + - Accumulated fixes and changes over time + - Fixes compiling with latest userspace headers and gcc-4.6 + - (introduced bugs, crashes, do not use) + +2007/08/12 1.19p32 +[Patch: Metamod-P v32 by Jussi Kivilinna] + - Changed GCC optimization flags based on performance monitoring results, + replaced '-O3 -funroll-all-loops' with '-O2'. + - Made 'Fix for engine_api varargs log calls with very long log string' + default on in sources so that MSVC compile is 1:1 with GCC compile. + - Made 'optimizations on META_DEBUG' always on in sources so that MSVC + compile is 1:1 with GCC compile. + - Fixed compiling META_PERFMON build with MSVC. + - Fixed compiling with MSVC fixed by Nikolay "The Storm" Baklicharov. + - [linux] Remake of dynamic linkent code. Parse dlsym function trampoline + instead of parsing ELF structures. + - [linux] Dropped AMD64 support since Valve doesn't support their AMD64 build + anymore and I don't have access to AMD64 machine to port new dynamic + linkent code. Sorry! + +2007/04/05 1.19p31 +[Patch: Metamod-P v31 by Jussi Kivilinna] + - Enabled 'regparam' for internal functions. Means that function arguments are + passed through registers instead of stack, which increases performance. + - Merged in changes from Metamod 1.19 that I didn't initially notice: + - Fixed a bug where plugins could not catch NewDLL calls for GameDLLs that + do not provide NewDLL information. + +2007/04/04 1.19p30 +[Patch: Metamod-P v30 by Jussi Kivilinna] + - Fixed safevoid_vsnprintf() on win32. + +2007/04/02 1.19p29 +[Patch: Metamod-P v29 by Jussi Kivilinna] + - crash fix that didn't work + +2006/03/04 1.19p28 +[Patch: Metamod-P v28 by Jussi Kivilinna] + - Removed use of __VA_ARGS__ (should be easy to port to msvc now). + - Reduced size of extra engineapi function slots from 128 to 16. + - Clean up code, removed use of likely()/unlikely() macros in places where + they don't give extra performance. + - Added MakeRequestID() API + - Added api for using hook tables from plugins (thanks to BAILOPAN) + - Re-enabled fix for engine_api varargs log calls with very long log string. + +2005/08/24 1.18p26 +[Patch: Metamod-P v26 by Jussi Kivilinna] + - Fixed newapi functions not active on mods that don't use newapi. + - [win32] New is_gamedll() code. + - [linux] Fix for buggy DT_HASH in library walker function. + - Following features were removed to improve stability. These changes were + not present in metamod.org version: + - Removed fix for engine_api varargs log calls with very long log + string. + - Removed optimized version of GET_USER_MSG_ID() for metamod-bots. + +2005/08/24 1.18p25 +[Patch: Metamod-P v25 by Jussi Kivilinna] + - Added mutil::IsQueryingClientCvar(). + - Added support for new HLSDK-API functions: + - enginefuncs_t::pfnQueryClientCvarValue() + - NEW_DLL_FUNCTIONS::pfnCvarValue() + - Fixed reloading and unloading of plugins that haven't been loaded + correctly. + - Fixed loading of plugins that needed changelevel to activate. + - Linux x86 and Windows binaries are now compiled for i586 since there is not + performance difference compared to i686. + - Fixes to improve stability on win32. (thanks to Blackhawk) + - Changed to use mingw-gcc 3.4.2rc + - Changed optimization flags, replaced '-O3 -ffast-math' with '-O2'. + - Minor performance tweaks. + - Changed to use mingw-gcc 3.4.2rc, mingw-gcc 3.4.4rc emited extra code + to zero stack memory which lowered performance. + - Changed API hooks to give structure offset to main API hook function + instead of pointer, which increases performance on linux-i586. + - Raised META_INTERFACE_VERSION to "5:12". + - Fixed metamod_version cvar to show "1.18p25" instead of "1.18.0p25". + - [linux] Improved dynamic linkent code. + - [linux] Static linked with libgcc. + +2005/07/27 1.18p24 +[Patch: Metamod-P v24 by Jussi Kivilinna] + - Updated to match latest metamod.org version. + - Removed mm-p-extensions-API, since loading/unloading plugins functions + are included in Metamod 1.18 in mutil-API. + +2005/04/22 1.17.4p23 +[Patch: Metamod-P v23 by Jussi Kivilinna] + - Fixed broken RegMsgList caused by optimization for mm-bots. + - Fixed optimization for mm-bots. + - [linux] Removed ESF-Mod fix. + - [linux] Minor performance tweaks and reduced filesize for linux. + +2005/04/08 1.17.4p22 +[Patch: Metamod-P v22 by Jussi Kivilinna] + - Optimized GET_USER_MSG_ID() function for metamod-bots. + - Minor performance tweaks. + - [linux] Looks for gamedll for Earth Special Forces Mod from 'linuxdlls' + directory after checking 'dlls'. + +2005/03/25 1.17.4p21 +[Patch: Metamod-P v21 by Jussi Kivilinna] + - Fixed 'meta reload' not working on plugins that have failed loading. + - Fixed bug with handling of metamod-plugin-bots, which might have caused + problems depending on order of loaded plugins. See 'call_count' in + 'api_hook.cpp' for details. + - Minor performace tweaks. + - Changed all non-fatal error messages to warning messages. + +2005/03/05 1.17.4p20 +[Patch: Metamod-P v20 by Jussi Kivilinna] + - Fixed bug with metamod.dll not having working relocation: + - Makefile doesn't use 'dllwrap' for linking windows dlls anymore. + - Minor performance tweaks. + - Updated mini-hlsdk to 'official 2.3+patches' version. + - Fixes to improve stability: + - Added fix for broken 'vsnprintf' for win32 and some glibc versions. + - Fixed wrong api-hook function for 'ClientConnect' in 'api_info.cpp'. + - Fixed wrong integer type for CRC32_t in 'hlsdk/common/crc.h'. + - Removed 'metamod_compat-i386.so' from linux binary release. + +2005/02/27 1.17.4p19 +[Patch: Metamod-P v19 by Jussi Kivilinna] + - Performance tweaks mainly for AMD64 (minor for i386). + - Linux-i386 (metamod_i386.so) binary linked against glibc-2.1.3 for better + compatibility. Compiled using gcc-3.3.4-glibc-2.1.3 crosscompiler available + at: http://forums.unitedadmins.com/index.php?showtopic=44048 + - Binaries not linked against libstdc++ anymore for better compatibility + (see: new_baseclass.h). + +2005/02/25 1.17.4p18 +[Patch: Metamod-P v18 by Jussi Kivilinna] + - Fixed AMD64 support. + +2005/02/19 1.17.4p17 +[Patch: Metamod-P v17 by Jussi Kivilinna] + - Renamed 'Metamod All-Mod-Support' to 'Metamod-P'. + - Fixes to improve stability. + - Minor performance tweaks. + - Merged updates from Metamod 1.17.4, + http://www.sourceforge.net/projects/metamod/ + - Added Mod recognition for Brain Bread 1.2, Snow-War 2.0 and + Gangsta Wars 2.7. + +2005/02/13 1.17.3p16 +[Patch: All-Mod-Support v16 by Jussi Kivilinna] + - Fixes to improve stability. + - Minor performance tweaks. + +2005/01/10 1.17.3p15 +[Patch: All-Mod-Support v15 by Jussi Kivilinna] + - New optimization which reduces binary size more than 50%. + - Changed '-march=i586' to '-march=i686'. This means this binary + doesn't work on Pentium/K6 processors. You need PPro/Athlon + or newer. + - Removed 'Active API Hooks' optimization. + - Removed 'memory write detection' code. + +2004/11/27 1.17.3p14 +[Patch: All-Mod-Support v14 by Jussi Kivilinna] + - Remake of new callback API. + +2004/11/27 1.17.3p13 +[Patch: All-Mod-Support v13 by Jussi Kivilinna] + - New callback API for plugins to load/unload other plugins. See + 'mm_pextensions.h'. + - Fixed a minor memory leak when reloading plugins. + - Minor fixes on 'memory write detection'. + - Minor performance tweaks. + - Moved p13 code from osdep.cpp/h to osdep_p.cpp/h + +2004/11/17 1.17.3p12 +[Patch: All-Mod-Support v12 by Jussi Kivilinna] + - Fixed crashing with 'memory write detection' (part of 'Active API Hooks'). + - Improved 'memory write detection' code. + +2004/11/16 1.17.3p11 +[Patch: All-Mod-Support v11 by Jussi Kivilinna] + - Added new 'Active API Hooks' optimization, speeding up handling HLSDK-API + functions that are not hooked by any plugins. + - Added new command 'meta active' to list active hooks. + - [linux] 'metamod_i386.so' is compiled with gcc-3.3.4 now. If that version + doesn't work for you, use 'metamod_compat-i386.so'. + - [linux] gcc-2.95 compiled binary is now 'metamod_compat-i386.so'. + - Merged updates from Metamod 1.17.3, + http://www.sourceforge.net/projects/metamod/ + - Added Mod recognition for Zombie Panic Beta 0.91c, Out Break 1.0, + Operations 1942 v2.0, The Trenches 1.0-Beta, The Ship V0052. + - When reloading plugins honour their load time settings. Does no longer + attempt to reload plugins when the loading after the unloading would + fail due to a load time conflict. + - Fixed only loading one plugin when multiple plugins with the same + prefix were used, e.g. mm_pluginA.dll and mm_pluginB.dll. + - Fixed a minor memory leak when unloading plugins. + - Fixed potential bug initializing plugin incorrectly after unloading + and loading plugins. + +2004/08/31 1.17.2p10 +[Patch: All-Mod-Support v10 by Jussi Kivilinna] + - Merged updates from Metamod 1.17.2, + http://www.sourceforge.net/projects/metamod/ + - Fixed a memory leak the size of the gamedll when extracting a missing + gamedll from the cache file on Windows Steam servers. + Found by Wei Mingzhi. + - Made game directory lookup case-insensitive. + - Added MOD recognition for The Terrorist Revenge 0.2.1, Pirates, + Vikings and Knights Beta 2.1, CSV15 (Counter-Strike 1.5 for Steam), + Adrenaline Gamer 6.5 and up. + - Changed MOD recognition for Adrenaline Gamer 3.x. The 3.x version of + the MOD is now being deprecated and support will be removed from a + future version of Metamod. It can currently still be used by renaming + the game directory from "ag" to "ag3" or by explicitly specifying the + gamedll. + - Improved parsing of plugins.ini file to not report errors on empty + lines and commented out lines that start with whitespace. + - Added "lin32" and "lin64" keywords in addition to "linux" keyword for + plugins.ini file to support using the same file for the same game on + both 32bit and 64bit servers. The "lin32" and "lin64" keywords + override the "linux" keyword when used on the same plugin. Do not + use "linux" when using "lin32" and/or "lin64" keywords for the same + plugin. + +2004/07/28 1.17.1p9 +[Patch: All-Mod-Support v9 by Jussi Kivilinna] + - [linux] Amd64-support. + - [linux] New version of osdep.cpp:is_gamedll(). + - Reads ELF directly and doesn't use external libraries. + - Binary isn't linked with BFD library anymore, reduces filesize to + less than 500kb. + - More optimizations on META_DEBUG macro. + - No more 'fast' compiles, META_DEBUG is optimized enough now. + - Added '+localinfo mm_clientmeta ' setting for disabling 'meta' + client-command. + - Added 'clientmeta' config.ini setting. + +2004/07/04 1.17.1p8 +[Patch: All-Mod-Support v8 by Jussi Kivilinna] + - Fixed memory leak in linux version of osdep.cpp:is_gamedll(). + - Fixes to improve stability. + - Optimizations on META_DEBUG macro. + +2004/06/06 1.17.1p7 +[Patch: All-Mod-Support v7 by Jussi Kivilinna] + - Official support for All-Mod-Support versions at http://koti.mbnet.fi/axh/ + - Merged updates from Metamod 1.17.1, + http://www.sourceforge.net/projects/metamod/ + - Added MOD recognition for Hostile Intent 1.1. + - Added MOD recognition for Natural Selection Beta 3.0. + - Added MOD recognition for CS13. + - Added MOD recognition Rocket Crowbar 2. + - Added MOD recognition Counter-Strike:Condition Zero. + - On Windows Steam servers extract the gamedll file from the cache file + if it is missing in the dlls directory. + - Added Patch-messages. + - Added '+localinfo mm_autodetect ' setting for disabling + autodetection of gamedll. + - Added 'autodetect' config.ini setting. + - Small tweaks and optimizations at various different places. + +2004/05/21 1.17p6 +[Patch: All-Mod-Support v6 by Jussi Kivilinna] + - Tweaks and optimizations on osdep.cpp:is_gamedll(). + - [linux] Added architecture check for i386 and x86-64 to is_gamedll(). + +2004/04/27 1.17p5 +[Patch: All-Mod-Support v5 by Jussi Kivilinna] +2004/04/26 1.17p4 +[Patch: All-Mod-Support v4 by Jussi Kivilinna] + - Amd64-test versions + +2004/04/25 1.17p3 +[Patch: All-Mod-Support v3 by Jussi Kivilinna] + - Automatically searchs for gameDll for new mods that are not included in + internal mod-list. + - [linux] Cleaned up osdep_linkent_linux.cpp, might work with x86-64 build + now (not tested). + +2004/04/24 1.17p2 +[Patch: All-Mod-Support v2 by Jussi Kivilinna] + - Extra functions slots are now passed all the way to the gameDll now too. + - [linux] New method for dlsym hooking, no need for metamod_linkent_tool.so anymore. + - Made mm_* functions in dllapi.cpp and engine_api.cpp static. + - Made mutil_* functions in mutil.cpp static. + +2004/04/22 1.17p1 +[Patch: All-Mod-Support v1 by Jussi Kivilinna] + - Removed dependences on game.dll structures (CBasePlayer). + - Replaced UTIL_ShowMessage with META_UTIL_ShowMessage. + - [win32] Replaced entity linking with PE dll-export-table combining. + - [linux] Replaced entity linking with dlsym hooking. + - Removed entities from linkgame.cpp + - Added 128 extra function slots on enginefuncs_t structure for future engine updates. + +2003/11/15 1.17 + - Added support for recently added routines in the HL Engine: + SequenceGet() + SequencePickSentence() + GetFileSize() + GetApproxWavePlayLen() + IsCareerMatch() + GetLocalizedStringLength() + RegisterTutorMessageShown() + GetTimesTutorMessageShown() + ProcessTutorMessageDecayBuffer() + ConstructTutorMessageDecayBuffer() + ResetTutorMessageDecayData() + - Removed mod recognition and entities for Master-Sword v1.3, at the + request of the Mod's authors. + - Added mod recognition and entities for HL-Rally vBeta 1.0, Kanonball + v1.01, Over Ground vBeta 1.0, Project Timeless vBeta 1.0, Underworld + Bloodline v2.0. + - Additional entities for The Battle Grounds v1.2.1, Firearms v2.8. + - Additional entities "env_rain" and "env_snow" used on some CS maps. + - Added "metamod_version" cvar that can be queried from game browser + clients. + - Added "meta" client command similar to the console command, providing at + this time only "list" and "version" subcommands. + - Introduced basic config file to provide more reliable and more + flexible options passing, in addition to the current +localinfo method. + - Default filename: addons/metamod/config.ini + - Options include: + debuglevel + gamedll + plugins_file + exec_cfg + - Added option "+localinfo mm_configfile " to override default + config.ini pathname. + - Added "meta config" console command to display result of config + file and localinfo options. + - Added "meta require " console command, to exit the server if the + specified plugin is not found loaded and running. Intended for use in + server.cfg or metaexec.cfg. Suggested by Florian Zschocke. + - If a specified override gamedll pathname is invalid, Metamod will now + exit with an appropriate error, rather than falling back to the + auto-detected gamedll. This should provide more useful feedback in such + situations. + - Added GINFO_REALDLL_FULLPATH for mutil GetGameInfo, to return the + (supposed) "real" dllpathname, ie in case gamedll is overridden. Needed + specifically for plugin "SinglePlayer". + - Raised META_INTERFACE_VERSION to 5:10, for GINFO_REALDLL_FULLPATH. + - Now recognizes "/dev/null" as valid for path options (pluginsfile, + execcfg, configini, etc), for when an empty file _is_ desired. + - Fixed loading of plugins.ini to detect duplicate plugins (by full + pathname). + - Added doc/config.ini with comments to document the file. + - Renamed doc/metamod.ini to doc/plugins.ini, and added comments. + - Internal changes: + - Added conf_meta.cpp, conf_meta.h for config file handling. + - Created full_gamedir_path() to centralize code for testing absolute + path, prepending gamedir if necessary, calling realpath, and + normalizing pathnames. + - Most paths are now stored and operated on as fullpathnames, rather + than gamedir-relative pathnames. + - Now using fopen() rather than LOAD_FILE_FOR_ME when reading text + files, in particular due to fullpathnames. + - Errorcheck for absolute paths as mm_execcfg filename, since + servercommand("exec") won't accept absolute pathanmes. + - Added debug messages to valid_gamedir_file(), for checking why it + failed to use a specified (config.ini, localinfo) path. + - Simplified logic in cmd_doplug() to not require re-mapping pcmd to cmd + string. + - Fixed Makefile to always recompile meta_api.cpp for changes in + info_name.h. + - Split lookup_game() into setup_gamedll and lookup_game, to better + organize for storing gamedll->real_pathname. + - Source and documentation files based on the list of supported + game/mods are split into their own files (games.h, + supportedmods.html), so they can be generated from a local database + rather than maintained manually. + - Makefile now using gcc-2.95 explicitly, to avoid using gcc3 at this + time. + +2003/08/02 1.16.2 + - Mod recognition and entities for The Point of No Return v.Beta 4.0. + - Even more entities for The Specialists v.Beta 2.0. + +2003/07/30 1.16.1 + - Mod recognition and entities for Master-Sword v1.3, The Wastes RC 1.2, + and Monkeystrike v1.2. + - Additional entities for Natural Selection v2.0, The Specialists v.Beta + 2.0, Earth's Special Forces v.Beta 1.1, The Battlegrounds v1.2, and + International Online Soccer v2.0. + +2003/05/08 1.16 + - Added support for Server_GetBlendingInterface() in order to allow client + and server to properly coordinate custom player model blending. This + should fix the issue with mismatched hitboxes observed with CS and DOD. + - Mod recognition and entities for International Online Soccer v1.0 and + Morbid Inclination v1.0. + - Added studioapi.{cpp,h} to provide Server_GetBlendingInterface. + +2003/05/03 1.15.3 + - More additional entities for Day of Defeat v1.0. + +2003/05/02 1.15.2 + - Mod recognition and entities for Rival Species vBeta 1.0, Public Enemy + vBeta 1.0, and Bumper Cars vAlpha. + - Additional entities for Day of Defeat v1.0, Sven Coop v2.1, WormsHL + vBeta 3.0, and Natural Selection v1.1. + +2003/04/09 1.15.1 + - Additional entities for Firearms v2.7 and Desert Crisis v1.5. + - Fixed mod recognition for Adrenalinegamer v4.x and later. + +2003/02/12 1.15 + - Additional entities for VampireSlayer Chapter V. + - Fixed entity name "TS_PowerUp" for The Specialists 1.5; should fix + precache error for "models/powerup.mdl". + - Added DLFNAME implementation for win32, provided by Jussi Kivilinna. + Thus, "meta info " will now list registered commands and + registered cvars under win32, rather than just under linux. + - Now dynamically allocating lists of registered commands and registered + cvars, rather than a fixed limit of 1024 (and before that, 512). Based + on code provided by Jussi Kivilinna. + - Console listing of regcmds/regfuncs now also shows currently allocated + list sizes. + - Replaced valid_file() using LOAD_FILE_FOR_ME with valid_gamedir_file() + using stat(). Thus, it should no longer find unintended files under the + "valve" subdirectory. + - Normalize filenames under win32 to use slashes (/) and lowercase chars, + to get rid of mixed-slashes (ie "half-life\cstrike/dlls") and to + simplify pathname comparisons. + - Also, canonicalize filenames under both win32/linux to remove ".." and + redundant "/" path components, to provide more reliable pathname + comparisions. + - If meta_CVarRegister fails to find a corresponding plugin for a cvar, it + now logs only a Debug message rather than an Error message, as a cvar_t + that's malloc'd by a plugin can't be traced back. Problem reported by + Olo. + - In plugin trace, added "classname" to DispatchSpawn output. + - Added is_absolute_path() to centralize the logic, and to be more + OS-precise. + - Split meta_init_gamedll() from meta_load_gamedll() so that the correct + and normalized Gamedir is available earlier in the code. + - #define NAME_MAX and PATH_MAX to the correct win32 constants, rather + than using (inaccurate) internal values. + - Renamed internal classes RegFunc to RegCmd, to provide more easily + associated names. + - Lots of internal file organization changes: + - Removed superfluous symlinks in docs dir. + - Renamed toplevel doc files to *.txt. + - Added Config.mak to toplevel dir, to provide project name and subdirs, + so that toplevel Makefile can be used for multiple projects. + - Added copyrights to Makefiles. + - Added blurbs to engine notes for FunctionFromName and NameForFunction, + based on investigation of singleplayer support. + - In source Makefile, added support for compiling linux-only or + win32-only projects. + - In source Makefile, fixed vdate.o to properly compile for each link. + - Removed tmp files in msvc dir (.ncb, .plg). + - Added copyright/GPL blurb to *.rc files. + - In stub/meta_api.cpp, comment out unused variables rather than doing + "if(var)" to satisfy gcc -Wunused. + - Reduced vers_meta.h to just the version and other common info, and + create info_name.h for module-specific name, desc, etc, so that I'll + only have to edit 1 file when increasing version/date for all the DLLs + distributed with Metamod. + - Made res_meta.rc common among Metamod and the plugins, rather than + having a separate res_plugin.rc. + - In source Makefile, added "--include-dir" args to windres, so it can + find the now common vers_meta.h. + - Source Makefile now copies targets into ../dlls, rather than doing + that only for comprehensive "dlls" targets. + - Added "-fno-exceptions -fno-rtti" to possibly reduce code size, + suggested by Jussi Kivilinna. + - For plugins, renamed ie "mm_wdmisc" to "wdmisc_mm" where it was missed + earlier. + - For plugins, better organized common code, to make it more adaptable + to other plugin projects (ie, singlep). Ie, plugin_query, + plugin_attach, plugin_detach; moved plugin welcome banner to + meta_api.cpp; etc. + - Added tools/stlfilter to help hide -Weffc++ warnings from g++ STL + headers (although not using STL at this time..) + +2003/01/24 1.14.1 + - Properly recognize win32 full pathname from GetGameDir. + - Added "#include " for getcwd() under MSVC. + - Trace plugin: Changed AlertMessage formatting, ie from + "atype=at_console/1" to "atype=at_console(1)". + - Stub plugin: fixed to compile under MSVC again. + +2003/01/23 1.14 + - Fixed to handle new behavior of engine routine GET_GAME_DIR under HL + 1.1.1.1 (CS 1.6) beta, where the routine no longer returns the + fullpathname of the game directory, but now returns only the string + passed to hlds as the argument to "-game" (pointed out by Alfred + Reynolds). + - Added meta-util function GET_GAME_INFO to return various string-based + information about the gamedll (name, description, gamedir fullpathname, + dll fullpathname, dll filename). + - Raised META_INTERFACE_VERSION from 5:8 to 5:9. + - Added FAQ. + - Some docs touchups. + +2003/01/18 1.13.4 + - Additional entities for betas of Counter-Strike 1.6 and TFC from HL + 1.1.1.1. + - Added missing #include "osdep.h" to several files, to make sure things + like win32 vsnprintf are defined. + - In stub plugin, added engine_api.cpp, to provide example framework for + hooking engine routines. + - In trace plugin, changed logtag to all caps. + +2003/01/12 1.13.3 + - Additional entities and updated mod recognition for Earth's Special + Forces Beta 1. + - Mod recognition for Retro Firearms 2.5. + - Increased max allowed plugin functions and max allowed plugin cvars from + 512 to 1024. + - Fixed UTIL_VarArgs and UTIL_LogPrintf (copied from SDK) to use proper + bounds-checking (to help prevent buffer overflows). + - Updated Copyright to include "2001-2003". + +2002/11/26 1.13.2 + - Mod recognition and entities for Azure Sheep v1.0, BuzzyBots v2.3, + Outlawsmod v.Beta 1.5, The Specialists v.Beta 1.0, and StargateTC v.Beta + 2.2. + - Additional entities for The Battle Grounds v.Demo 1.0, Firearms v.2.6.5, + Global Warfare v.Beta 2.0, and Tour of Duty v1.1 Beta. + - Updated mod recognition for Rocket Crowbar v1.9. + - Compiled against HLSDK 2.3. + - Corrected missing "const" in vdate.h (noted by Ravenous BugBlatter + Beast). + +2002/10/06 1.13.1 + - Mod recognition and entities for Digital Paintball v1.0, Dragon Mod Z + v1.7, Holy Wars v.beta2, and OeL Half-Life v4.0. + - Additional entities for Adrenalinegamer Mod v6.0 and Natural Selection + v1.0. + - Corrected a cast in os_safe_call (from Olafur Osvaldsson). + +2002/08/24 1.13 + - New config file names and locations, per the Addon Development Standard + rev 1.00. Default config files are now: + - $gamedir/addons/metamod/plugins.ini + - $gamedir/addons/metamod/exec.cfg + - File "metagame.ini" no longer supported. + - Additional entities for WormsHL beta 2.1. + - Mod recognition (no entities) for Retro Counter-Strike 2.5. + - Added release_notes.html. + - Added function "valid_file" in support_meta.h. + +2002/07/11 1.12.4 + - Additional entities for Day of Defeat beta 3.0 and Tour of Duty 0.9.0. + - Mod recognition and entities for Natural Selection 1.0. + - Added "$pg" string for /usr/bin/ident. + +2002/07/01 1.12.3 + - Mod recognition and entities for Valve's Ricochet mod. + - Additional entities for Tour of Duty 0.8.0. + - Moved common code from LINK_ENTITY_TO_GAME to a function, rather than + duplicating the code in ~2000 expanded macros. Based on code from Jussi + Kivilinna . + +2002/06/04 1.12.2 + - Even more entities for Firearms rc2.6. + +2002/05/29 1.12.1 + - Mod recognition and entities for Desert Crisis 1.1, Tour of Duty 0.6.7, + and Train Hunters beta 1.0. + - Additional entities for GoldenEye 1.9C and Firearms rc2.6. + - Fixed meta-util function GET_PLUGIN_PATH to return the full path as + intended, rather than a partial path. + - Updated Copyright to include "2001-2002". + - Fixed Makefile to not update .tags or .htags by default. + +2002/04/22 1.12.0 + - Updated for HL 1109, which adds one Engine routine: + const char *GetPlayerAuthId(edict_t *e); + - Mod recognition and entities for The Battle Grounds 0.6, Gangwars Beta + 1.0, and WormsHL Beta 2.0 + - Additional entities for Day of Defeat beta 2.0 and Oz 2.5. + - Changed error message "user message registered again" to a debug message + (level 3). + - Fixed compile problem under MSVC with strcasecmp. + - Added meta-util function GET_PLUGIN_PATH, so a plugin can know from + whence it was loaded. + - In trace plugin, added more trace info for EngineFprintf, ServerPrint, + IsMapValid, GetPlayerUserId, GetPlayerWONId, GetPlayerAuthId, + CVarGetFloat, CVarGetString, AllocString, Time, IsDedicatedServer, + GetCurrentPlayer, GetPlayerStats. + +2002/02/08 1.11.2 + - Hopefully complete list of entities for Day of Defeat beta 2.0. + - Don't complain for NULL routines in gamedll's NEW_DLL_FUNCTIONS. Should + solve "Couldn't find api call: dod.dll:ShouldCollide" errors with DoD + b2. + - Changed default for newapi ShouldCollide() from 0 to 1, per Mugsy@DoD's + observations. + +2002/02/03 1.11.1 + - Mod recognition and entities for Snow-War 1.0, and Earth`s Special + Forces version Alpha 2.0. + - Additional entities for Oz 2.4.1, Svencoop 2.0, and partial entities for + Day of Defeat beta 2.0. + - Added check for duplicate UserMsg registration (should help resolve + recent "reached max msgs 256" errors). + - Dropped leading zeroes in version number. + - Tweaked "interface version" log message to help reduce confusion. + - Compiled with updated version of mingw; should help reduce dll filesizes + found in the previous release. + - Some additional debugging in gamedll entity linking. + +2001/12/17 1.11.00 + - Mod recognition and entities for Weapon Wars v0.3. + - Additional entities for version 1.2 of Global Warfare. + - Linux binary linked against glibc-2.1.2 for better compatibility. + - 'meta game' now lists user messages registered by gamedll. + - Added meta-util functions GET_USER_MSG_ID and GET_USER_MSG_NAME, so + plugins that need to know RegUserMsg name/id mappings (like bots) don't + need to be loaded at server startup. + - Raised META_INTERFACE_VERSION from 5:6 to 5:7. + - Fixed NUM_FOR_EDICT error in pfnCenterSay (from Fritz Elfert). + - Re-fixed set_new_handler for MSVC (from Fritz Elfert). + - Fixed meta_AddServerCommand; was registering plugin's command string + rather than local string, causing segfault on plugin unload. + - Changed trace plugin to use GET_USER_MSG_NAME instead of local list. + - Added 'const' to 'char *' arguments in DLOPEN and DLSYM macros. + - Commented out names of unused function paramenters, to satisfy "gcc + -Wunused" without generating MSVC errors. + - Added '#pragma warning(disable: 4390)' to disable "empty controlled + statement" warnings in MSVC. + - Updated MSDN url references. + +2001/09/19 1.10.00 + - Updated for HL SDK 2.2, which adds two Engine routines: + qboolean Voice_GetClientListening)(int iReceiver, int iSender); + qboolean Voice_SetClientListening)(int iReceiver, int iSender, qboolean bListen); + - Mod recognition and entities for "Scientist Hunt" v1.2 and Existence + Beta 1.3. + +2001/08/01 1.09.00 + - Mod recognition and entities for 'Wanted!' v1.5. + - Mod recognition for Adrenalinegamer v3.2 and v4.1 (no special entities). + - Additional entities for version 2.3 of Oz Deathmatch. + - Additional entities for version 1.0 of Wizard Wars. + - Additional meta-utility function CALL_GAME_ENTITY. Raised + META_INTERFACE_VERSION from 5:5 to 5:6. + - Added proper GPL notices. + +2001/07/06 1.08.02 + - Added mod recognition and entities for Gunman Chronicles. + - Added list of supported mods to docs. + - Updated MSVC project/workspace files to match recent source changes. + - Fixed problem with set_new_handler compiling under MSVC. + +2001/06/30 1.08.01 + - Updated for Day of Defeat v1.3. The name of its win32 dll changed (was + mp.dll; now dod.dll). No new entities. + - Added mod recognition and entities for Rocket Crowbar. + - Fixed problem with windows internal DLL version (don't use leading + zeros as compiler will assume it's octal notation). + +2001/06/16 1.08.00 + - Allow specifying/overriding various things on the command line, via + "+localinfo". Fields are: + - mm_gamedll + a bot or other dll, instead of the gamedll based on the gamedir. + Note this is now the preferred method; the "metagame.ini" file is + deprecated, but still recognized for backwards compatibility. + - mm_pluginsfile + a file with the list of mm plugins, instead of "metamod.ini". + - mm_execcfg + a cfg file for mm plugin cvar settings, instead of "metaexec.cfg". + - mm_debug + an initial debug level. + - Examples: + ./hlds_run -game cstrike +localinfo mm_gamedll dlls/pod_bot.so + ./hlds_run -game cstrike +localinfo mm_pluginsfile mylist.ini + ./hlds_run -game cstrike +localinfo mm_execcfg mysettings.cfg + ./hlds_run -game cstrike +localinfo mm_debug 7 + - Don't try exec'ing metaexec.cfg unless it exists. + - Added additional entity for Action Half-Life Beta 4, from list forwarded + from the dev team. + - Added a couple additional entities for Global Warfare, from list + provided by the dev team. + - Moved a couple entities from the "common" list back to the "valve" list, + for better organization. + - Changed logmsg "Plugin '%s' interface version didn't match" from + "Warning:" to "Note:" to reduce confusion. + - Added an optional plugin meta-api routine Meta_Init, to be called prior + to GiveFnptrsToDll, to let the dll know that it's going to be + queried/loaded as a metamod plugin, to allow for DLL's that can be used + as both a metamod plugin _and_ a standalone DLL. Raised + META_INTERFACE_VERSION from 5:4 to 5:5. + - Removed segfault handler under linux, when calling plugin console + command functions, as (a) it masked legitimate segfaults in plugin + commands and produced confusing output ("plugin has been unloaded", when + really it segfaultd), and (b) wasn't necessary since the situation + should be covered by other tests. + - Replaced combo SDK macros with inline funcs, and added ones for + accessing serverinfo and localinfo infokey buffers. + - Unfinished code for event triggers is in the source, but is disabled + (since it's not finished yet). + +2001/06/10 1.07.03 + - improper compile was reporting wrong version number + +2001/06/07 1.07.02 + - added mod recognition and best-guess list of entities for Deathmatch + Classic v1 and Global Warfare Beta 1.0. + - updated entity list with best-guess additions and corrected win32 dll + name for Wasteland Beta 2. + - added additional entities for Frontline Force 1.2a, from list forwarded + from the dev team. + +2001/05/25 1.07.01 + - added complete (hopefully) list of additional entities for Front Line + Force 1.2a/1.3. + - added best-guess list of entities for Day of Defeat b1.1. + - added best-guess list of entities for Science & Industry 0.97 (later + confirmed by SI lead programmer). + - added better guess list of entites for Action Half-Life b4. + - shrunk entity lists for Jailbreak and Judgement to include only + mod-specific entities (rather than common Valve entities which are in a + separate list). + - in THREAD_CREATE inline, replaced "(DWORD (*)(void*)) func" with + "(LPTHREAD_START_ROUTINE) func" to properly compile under MSVC. + - added engine_notes.html with a list of all the engine routines, and some + comments. + - added utils/getents.sh script to pull entity lists from .so files. + +2001/05/08 1.07.00 + - fixed "%s" server-crashing bug. "You should never pass strings with + unknown contents as the format string." Metamod was passing a + preformatted non-constant (thus unknown contents) string as the format + string (and only argument) when handling printf-style varargs engine + functions (in particular, AlertMessage). Ie, don't do: + printf(buf); + Instead do: + printf("%s", buf); + - added some entities for Action Half-Life Beta4, which should help + address crashing on startup, especially with Last Man Standing random + weapons. Note that I don't have an official, complete list of entities + for the mod, so there may still be some instances of crashing. + - added debugging messages for printf-style varargs engine routines, since + we can't rely on trace_mm for this (as the messages are re-written by + metamod before being passed to trace). + - better info in trace plugin's log messages for AlertMessage and + CreateNamedEntity. + - altered debug levels AlertMessage API routines in api_info.cpp + +2001/05/04 1.06.10 + - fixed a couple of entities for HL Paintball. + - added links.html to docs, a set of links/URLs and books that I found + helpful for the project. + - added to META_INTERFACE_VERSION comments to include associated metmaod + version for each change. + - additional data checking in various MPluginList routines. + - added 'const' to various function arguments to more properly reflect + function purpose. + - changed various function macros to inlines, to provide more obvious type + checking, and easier debugging. + - adjusted private/public members of various classes, to try and make them + more proper. + - added new_handler code, for upcoming code additions. + - added MPluginList::find(plid_t id), for upcoming code additions. + - added thread primitives to osdep, for upcoming code additions. + +2001/04/29 1.06.02 + - added entities and mod recognition for VampireSlayer and Open-Source + Jailbreak. + - updated mod recognition for current names of Action Half-Life's DLL/SO + files. + - added some entities for FLF 1.2a, listed on Botman's news page. + - added some docs for Installation and Compiling. + - added build type info (optimized, debugging, etc) to the SpecialBuild + tag in the version info for the win32 DLL. + - disabled SDK's "DBG_" functions, for MSVC win32 debug compiles. + +2001/04/22 1.06.01 + - added some entities for FLF 1.2. + - better info in trace plugin's log messages for + DispatchObjectCollsionBox, SetModel, FindEntityByString, SetOrigin, + EntOffsetOfPEntity, PEntityOfEntIndex. + - fixed missing initialization for "len" in wdmisc. + - added links to sections in html docs. + - for non-critical interface version mismatch, changed from a META_ERROR + to just META_LOG, since it's not, strictly speaking, an error. + +2001/04/17 1.06.00 + - added support for "metaexec.cfg", a commands file to be exec'd after + loading the plugins, for plugin commands and cvars, since autoexec.cfg + is parsed too early (before plugins loaded) and server.cfg is parsed too + late (after ServerActivate). + - better info in trace plugin's log messages for MessageBegin, + WriteString, AlertMessage, RegUserMsg + - to provide more manageable trace log output, throttled trace plugin to 1 + logmsg per second, by default (of course, this can cause log messages to + be lost). Added cvar "trace_unlimit" (0/1) to enable unlimited logging, + as it did previously. + - added centersay meta-utility functions (CENTER_SAY, CENTER_SAY_PARMS, + CENTER_SAY_VARARGS). Raised META_INTERFACE_VERSION from 5:3 to 5:4. + - fixed crash when trying to load typical game DLLs (like standalone-bots) + as metamod plugins. + - fixed segfault on failed plugin attach; was dlclosing plugin + prematurely. + - in wdmisc, added a proof-of-concept for catching certain game events by + doing string matching on all the log messages produced by the game. + Ugly, to be sure, but interesting nonetheless. + - added more entities for HL Paintball, and fixed the linux so name. + - added "-Wno-unused" to CFLAGS when compiling sdk_util.o, to alleviate + the complaints from #including all the extra SDK header files and class + definitions. + - removed GetEntityAPI routine from trace plugin, as it's unnecessary as a + metamod plugin if already providing GetEntityAPI2. + - in trace, moved gMetaFunctionTable declaration to plugin.cpp, so that + meta_api.cpp can be a standard (plugin-independent) sourcefile used in + any plugin. + - updated the docs to include recent new features, as well as some better + discussion of coding details. + +2001/04/06 1.05.00 + - created utility callback functions, for use by plugins, to reduce code + duplication and help simplify some things. Currently, these consist of + only some convenient logging functions (LOG_CONSOLE, LOG_MESSAGE, + LOG_ERROR, LOG_DEVELOPER). + - added "mutil_funcs_t" to Meta_Query, to pass the meta utility function + table. Increased META_INTERFACE_VERSION from 5:2 to 5:3. + - made sure all exported DLL routines (ie routines that are accessed via + dlsym) are both declared _and defined_ as 'extern "C"', so that the C++ + compiler enforces parameter type-matching, rather than considering + routines with mis-matched arguments/types to be overloaded functions... + Note that it's not sufficient to just be declared "C"; it has to defined + this way as well, to make sure the C++ compiler matches it with the + declaration. Otherwise, again, it'll consider it an overloaded + function, and allow it happily without complaint, and cause the + subsequent dlsym to fail. + - created and deployed C_DLLEXPORT macro for declaring/defining functions + 'extern "C" DLLEXPORT'. + - added plugin 'wdmisc' as a basic example, and for my miscellaneous + commands/cvars. + - renamed "mm_stub" and "mm_trace" to "stub_mm" and "trace_mm" to make + plugin name more apparent, and to be more consistent with adminmod_MM. + - had to move plugin_info_t to its own header file, to avoid circular + #include's between meta_api.h and mutil.h. + - in dllapi.cpp and engineapi.cpp, pulled RETURN_API out of META_HANDLE + macro, to make it easier to add code to middle of API routines. + - renamed util_meta.h to support_meta.h, to avoid confusion with mutil.h + - some code cleanup (better 80-column linebreaks). + +2001/04/03 1.02.00 + - added support for Half-Life Paintball + - added "*_mm" and "*_MM" to the list of suffixes to look for when loading + plugins at console. + - log errors when plugin tries to use MRES_SUPERCEDE in a _Post function + (supercede is only relevant in a non-Post function; use OVERRIDE in a + Post function). + - mm_trace: added info to trace log for FindEntityInSphere + - added osdep macro for strcasecmp, for compiling under windows + - fixed a debug log message for GetEngineFunctions_Post + - fixed a couple internal references to engine globals (gpGLobals) + - renamed local SDK API routines to "mm_*" for easier debug breakpoints + - altered debug levels for a couple API routines in api_info.cpp + +2001/04/01 1.01.00 + - replaced use of FStrEQ in most places with !strcasecmp, so that case + doesn't matter for things like console commands ("META LOAD" will now + work in addition to "meta load") and paths (like "-game CSTRIKE"; and + win32 filepaths are case-insignificant anyway). Interestingly, the HL + engine ignores case for console commands ("ADMIN_COMMAND" works), but + cvars are only recognized with matching case ("ADMIN_DEBUG" does not + work). Confusing. + - added "by " when printing author info, to make it a bit clearer + - added a bit more operation info to metamod.html + +2001/03/30 1.00.00 + - released as v1.0, for inclusion with release of Adminmod v2.50. + - added $(VERSFILE) to Makefile and Config.mak, to better insure correct + rebuild on version number changes + - added "i486", "i586", and "i686" to "i386" in the list of prefixes to + look for when loading plugins at console. + - added "MDLL*" and "MNEW" macros in meta_api.h, to be more convenient for + plugins to call GameDLL functions. + - added missing "extern gamedll_funcs_t *gpGamedllFuncs" to meta_api.h + - added handling of gpGamedllFuncs in stub, for example purposes. + - fixed problems with running bots under metagame.ini: + - moved instantiation of Plugins object to before meta_load_gamedll, so + that if gamedll calls engine functions during GiveFnptrsToDll (like + hpb_bot does), META_ENGINE_HANDLE won't crash from a null Plugins object + pointer. + - in GET_FUNC_TABLE_FROM_GAME, memset gamedll.funcs.struct_field, and then + free/null it if the gamedll's GetFuncs call fails, to handle the + situation where the gamedll provides GetNewDLLFunctions(), but doesn't + have anything to return (like hpb_bot does, when the real gamedll + doesn't provide GetNewDLLFunctions). + - add handling of gpGamedllFuncs to mm_stub's Meta_Attach(). + +2001/03/27 1.0-rc5 + - fixed problem with crashing when a plugin failed to load (improper + dereference of null 'info' structure; incomplete fix from rc2). + - added a plugin status "badfile", for plugin files that appear to be + invalid metamod plugins; this is to differentiate from "failed", which + is a valid-looking plugin file (queried) but encountered a failure + attaching/unloading/etc. + - changed "-march=i686" optimization to "-march=i586", and moved this to + only the optimized binaries, and not the debugging binaries. As it + turns out, i686 doesn't work on things like AMD K6-III cpus (I know, go + figure :). + - duplicated functionality of adminmod's "admin.ini", except with a file + named "metagame.ini". This will allow (at least partial) use with game + DLLs that metamod doesn't support yet - "partial" because, although the + game DLL will load, it may not work if it uses entities that metamod + doesn't know about yet. It will also allow use of standalone "bot" + DLLs, which sit between metamod and the gamedll (much like metamod sits + between the engine and the gamedll). + - added console command "meta game" to show information about the loaded + game DLL (to help troubleshoot issues with "metagame.ini"). + +2001/03/25 1.0-rc4 + - split linkfunc.cpp into linkent.h, linkgame.cpp, linkplug.cpp + - split entity lists for mods into separate files, one for each mod; these + are used to build linkgame.cpp + - metamod/mm_trace version info should indicate debugging/optimized compile + - added entity support for Judgement DM + - added "-fno-rtti" to mm_trace gcc cflags, to address problem of + unresolved CSaveRestoreBuffer symbols using older versions of gcc + - lowered debug levels in GetEntityAPI, GetNewDLLFunctions, etc to enable + "+developer" messages (6 -> 3). + - removed "-Werror" from Makefile's default cflags; should only be used + on devl system with edited SDK + +2001/03/18 1.0-rc3 + - central Makefile can now build optimzed as well as debugging targets; + default to compile is debugging; default in 'dlls' dir is optimized + - toplevel Makefile builds release tgz/zip files. TGZ file includes only + linux .so objects, and text files in unix-LF format. ZIP file includes + only win32 .dll objects, and text files in dos-CRLF format, and actual + files rather than symlinks. + - added mod recognition for "judgedm" mod; still need entities list + - added 4 entities for Firearms 2.5 + +2001/03/07 1.0-rc2 + - fixed missing WINAPI in mm_trace GiveFnptrsToDll + - added HTML version of docs + - description field in metamod.ini is now optional: + - uses "name" from plugin info for desc by default + - desc field in metamod.ini will override this + - "meta list" shows just desc, rather than desc and name + - altered debug levels for a couple API routines in api_info.cpp + - added missing "load" cmd in "meta" usage help + - added to "meta load" usage help + - added macros RETURN_META(result) and RETURN_META_VALUE(result, value) to + simplify plugin coding + - added parameter "gamedll_funcs" to meta_attach(), to give each plugin a + copy of the gamedll's API function tables + - raised META_INTERFACE_VERSION to "5:2" + - now load gamedll before plugins (rather than the reverse) so that + it'll have the gamedll func tables to hand to the plugins + - changed trace plugin console commands: + trace_version -> trace version + trace -> trace set + untrace -> trace unset + showtrace -> trace show + - added "trace list " to list all available routines for tracing + - fixed broken trace cvars + - for "meta {load,unload,etc}" console cmd, added matching against plugin + logtag, as well as for "mm_" in plugin file + - handle null 'info' after failed plugin load (ie in "meta info" etc) + - fixed "usage: meta list" errors on some meta commands; was calling + cmd_meta_pluginlist() instead of Plugins->show() + - fixed: unload/attach delayed plugins at changelevel + - now doesn't export newapi if gamedll doesn't provide it + - now doesn't call plugins getnewapi if gamedll doesn't provide it + - fixed incorrect apitable references in MPlugin::show() + +2001/02/08 1.0-rc1 + - fixed unistd.h under MSVC + - fixed S_ISREG under MSVC + - fixed strncasecmp under MSVC + - fixed void svr_meta() returning value + - fixed missing WINAPI in mm_stub GiveFnptrsToDll + - remade MSVC project for metamod + - created MSVC project for mm_stub + - added an example "metamod.ini" to ./docs diff --git a/doc/README.txt b/doc/README.txt new file mode 100644 index 0000000..fffe7c6 --- /dev/null +++ b/doc/README.txt @@ -0,0 +1,6 @@ +Please see the files in the "html" or "txt" directory for documentation. + +Example files in the current directory: + + plugins.ini + config.ini diff --git a/doc/TODO b/doc/TODO new file mode 100644 index 0000000..79af2e1 --- /dev/null +++ b/doc/TODO @@ -0,0 +1,37 @@ +# vi: set ts=4 sw=4 : +# vim: set tw=75 : + + - event notification and log-parsing interface for plugins + - interaction between plugins + - rename trace functions to "tr_*" for easier debug breakpoints + - add meta console command to debug indiv functions, like mm_trace can + - catch register cmds/cvars from gameDLL and list then in "meta game" + - in win32, doesn't report parsed plugin line properly; says only: + [META] ini: Read plugin config for: + - use scanf for file parsing ? + - "meta cancel" command + - more documentation info + - don't refresh_ini on "quit" + - test more bot support for metagame.ini + + - track "messages" for plugins and provide READ_* functions (usermsg.cpp) + - provide other "engine" functions to plugins + - is_connected + - is_ingame + + x fix stat()-related code for linux only + x remake MSVC project + x use resources + x doublecheck DLLEXPORT and stuff + x txt files in "dos" format? + x separate zip/tgz files + x compat support for "admin.ini" + x support dir-specific "metamod.ini" files, similar to servercfgfile + x more documentation info: engineapi_info.txt + x html view of source + x handle RegUserMsg and allow lists of registered messages to be queried + by bot plugins or other plugins that want to catch these things, and to + allow these plugins to be loaded during a map (since after mapstart, the + plugin can't catch RegUserMsg calls, since they've all already been made). + x find some way to generally allow plugins to use LINK_ENTITY_TO_CLASS, + without requiring explicit support in metamod \ No newline at end of file diff --git a/doc/config.ini b/doc/config.ini new file mode 100644 index 0000000..cf7ea60 --- /dev/null +++ b/doc/config.ini @@ -0,0 +1,90 @@ +// vim: set ft=c : +// +// Format is as follows: +// +// +// Fields are whitespace delimited (tabs/spaces). +// +// Comments are either c++ style ("//") or unix shell style ("#"), and +// can appear ONLY at the beginning of a line. +// +// The following provide a list of recognized options, their defaults, and +// examples of usage. +// +// debuglevel +// gamedll +// plugins_file +// exec_cfg +// autodetect + + +// debuglevel +// where is an integer, 0 and up. +// Sets the initial debugging level for metamod (same as cvar "meta_debug"). +// Default is normally 0. If hlds is run with "-dev", default is 3. +// Overridden by: +localinfo mm_debug +// Examples: +// +// debuglevel 0 +// debuglevel 42 + + +// gamedll +// where is an absolute path, or a path relative to the gamedir. +// Overrides the auto-detected gamedll, in particular for bots. +// Default is empty, with gamedll being auto-recognized based on the +// gamedir. +// Overridden by: +localinfo mm_gamedll +// Examples: +// +// gamedll dlls/hl.dll +// gamedll ../podbot/podbot.dll +// gamedll /home/bots/dlls/mybot.dll + + +// plugins_file +// where is an absolute path, or a path relative to the gamedir. +// Overrides the default filename containing the MM plugins to load. +// Default is "addons/metamod/plugins.ini". +// Overridden by: +localinfo mm_pluginsfile +// Examples: +// +// plugins_file cfg/clanmode.ini +// plugins_file ../private.ini +// plugins_file /home/half-life/testing.ini + + +// exec_cfg +// where is a path relative to the gamedir. Note! This CANNOT be +// an absolute path, as hlds will not "exec" absolute pathnames. +// Overrides the default filename containing hlds commands to run just +// after loading Metamod. +// Default is "addons/metamod/exec.cfg". +// Overridden by: +localinfo mm_execcfg +// Examples: +// +// exec_cfg configs/debugging.cfg +// exec_cfg ../clan/match.cfg + + +// autodetect +// Setting to disable or enable autodetection of gamedll. +// Extra feature for Metamod+All-Mod-Support Patch. +// Default is "yes". +// Overridden by: +localinfo mm_autodetect +// Examples: +// +// autodetect yes +// autodetect no + + +// clientmeta +// Setting to disable or enable Metamod's client commands ('meta list' and +// 'meta version') +// Extra setting for Metamod+All-Mod-Support Patch. +// Default is "yes". +// Overridden by: +localinfo mm_clientmeta +// Examples: +// +// clientmeta yes +// clientmeta no diff --git a/doc/html/Index.html b/doc/html/Index.html new file mode 100644 index 0000000..83e22b9 --- /dev/null +++ b/doc/html/Index.html @@ -0,0 +1,65 @@ + + + + + +Metamod + + + +

Metamod +

+ +

Metamod is a plugin/DLL manager that sits between the Half-Life Engine and +an HL Game mod, allowing the dynamic loading/unloading of mod-like DLL +plugins to add functionality to the HL server or game mod. + +

+


+ +

+See metamod.org for news, downloads, +and plugin links. + +

+


+ + + + + + + + +
+

Metamod Docs

+ +
+

Other HLDS info

+ +
+ +

+


+
<willday@metamod.org>
+ + + + + diff --git a/doc/html/a.html b/doc/html/a.html new file mode 100644 index 0000000..8f78ca8 --- /dev/null +++ b/doc/html/a.html @@ -0,0 +1,35 @@ + + + + + +Metamod Supported Games + + + + +

Supported Games +

+
+ +Metamod includes support for the following mods, with version and last +update if known. + +

+To get support added for a new Mod, or for an updated version of a Mod, see +Adding game support. + +

+ + + + + +
Name Version Last update Ent list Comments
ALL MODS SUPPORTED BY
+    All-Mod-Support PATCH
+    By Jussi Kivilinna
+    http://koti.mbnet.fi/axh/ +
NONE
+ + + diff --git a/doc/html/about.html b/doc/html/about.html new file mode 100644 index 0000000..7266364 --- /dev/null +++ b/doc/html/about.html @@ -0,0 +1,52 @@ + + + + + +About Metamod + + + +

Metamod +

+ +

a Half-Life utility mod

+ +
+    meta /me't*/ or /may't*/ or (Commonwealth) /mee't*/ adj.,pref.
+        [from analytic philosophy] One level of description up.
+
+ +

The purpose of MetaMod is to function "one level up" from the normal +Half-Life game mod DLL. Sitting between the mod game DLL and the Half-Life +engine/binary, it intercepts the function calls between the two, with the +option of passing them along untouched, as well as passing them on to as +any number of additional mod-like DLLs. + +

Thus, you can actually have multiple "mod-like" DLLs in operation at +one time. I say "mod-like" because these additional DLLs (we'll call them +"plugins") are not intended to provide a full "game"; that functionality is +still provided by the "game dll". However, these plugins can add +to or modify the functionality provided by the game +dll, or by the engine itself - for instance, adding new server commands, or +new client commands, or even disabling commands built into the game dll. +Although the plugin isn't intended to provide full HL-game functionality, +since it's receiving the same information given to the game DLL, it has the +opportunity to do anything the game DLL can do (given enough +coding effort of course). + +

This is very similar to the way Alfred Reynolds' +AdminMod works, as it also sits +between the engine and game dll, catching routines, and passing them on. +thus modifying functionality. However, rather than providing just the +additional server features builtin to AdminMod DLL, MetaMod allows you to +add features from multiple, separate DLLs. Under that framework, AdminMod +can be a plugin itself, and be run alongside numerous other plugins. And, +as of version 2.50 of AdminMod, AM has now transitioned to running as a +Metamod plugin. + +

+


+ + + diff --git a/doc/html/coding.html b/doc/html/coding.html new file mode 100644 index 0000000..e13114f --- /dev/null +++ b/doc/html/coding.html @@ -0,0 +1,396 @@ + + + + + +Coding for Metamod + + + +

Coding for Metamod +

+ +


+ +

Compiling +

+ +You'll need the Half-Life SDK, of course. In particular you'll need HL SDK +version 2.3. You can find the original SDK 2.3 at the Valve Editing Resource Center (VERC), +and a modified version of SDK 2.3 at metmod.org/files/sdk. + +


+ +

Operation +

+ +The basic operation is, for each api call: + +
    +
  • iterate through list of plugins +
  • for each plugin, if it provides this api call, then call the function + in the plugin +
  • call the "real" function (in the game dll, or from the engine) +
  • for each plugin, check for a "post" version of the function, and call + if present +
+ +Also, for any api call, each plugin has the opportunity to replace the +real routine, in two ways: + +
    +
  • prevent the real routine from being called (SUPERCEDE). +
  • allow the real routine to be called, but change the value that's + returned (OVERRIDE) +
+ +Thus after each plugin is called, its META_RESULT flag is +checked, and action taken appropriately. Note that supercede/override only +affects the _real_ routine; other plugins will still be called. + +In addition to the SUPERCEDE and +OVERRIDE flags, there are two additional flags a plugin can +return: + +
    +
  • HANDLED ("I did something here") +
  • IGNORED ("I didn't really do anything") +
+ +These aren't used by Metamod itself, but could be used by plugins to +get an idea if a previous plugin did anything. + +

Note that each routine needs to set its +META_RESULT value before returning. Plugin routines that +do not set a value will be reported as errors in the logs. + +


+ +

Plugin coding requirements +

+ +Plugins must provide the following standard HLSDK exported function: + +

+   void GiveFnptrsToDll(enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals);
+

+ +As well as the following new functions: + +

+   void Meta_Init(void); (optional)
+   int Meta_Query(char *interfaceVersion, plugin_info_t **pinfo, mutil_funcs_t *pMetaUtilFuncs);
+   int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs);
+   int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason);
+

+ +Also, it must provide at least one function returning a standard HL +function table, from either the following standard HLSDK functions: + +

+   int GetEntityAPI( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion );
+   int GetEntityAPI2( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion );
+   int GetNewDLLFunctions( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion );
+

+ +or from the following new functions: + +

+   int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion);
+   int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion ;
+   int GetNewDLLFunctions_Post(NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion);
+
+   int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion);
+   int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion);
+

+ +Thus, it needs to have (at least): +

+   GiveFnptrsToDll
+   Meta_Query
+   Meta_Attach
+   Meta_Detach
+   <one or more Get function>
+

+ +See the "stub_plugin" for an example of bare +minimum code. See "trace_plugin" for an example of +more complete functionality. + +

Also, if the plugin needs to use LINK_ENTITY_TO_CLASS, +support for the particular entity(ies) has to be added explicitly to +Metamod (linkfunc.cpp), just as it does for entities in game DLLs. + +


+ +

Operation Details +

+ +

These are the valid META_RESULT values a plugin routine can +specify: + +

    +

  • +MRES_IGNORED +
    The plugin did nothing. This could be used to tell a subsequent + plugin that the some situation hasn't been handled yet. This would be + recognized only by other plugins; Metamod itself doesn't do anything + special for this situation. Unless otherwise specified by a later + plugin, execution of routine in the gameDLL will take place. This is + valid in both normal and post routines. +

  • +MRES_HANDLED +
    The plugin handled the situation, or did something with the + information. Again, this could be used to tell a subsequent plugin + that some situation has already been taken care of, and is not + recognized specially by Metamod. Unless otherwise specified by a later + plugin, execution of routine in the gameDLL will take place. This is + valid in both normal and post routines. +

  • +MRES_OVERRIDE +
    The plugin is providing a return value for the routine, which + should be used in place of the return value from the gameDLL's routine + (the plugin "overrides" the gameDLL's return value). + Unless otherwise specified by a later plugin, the gameDLL routine will + still be called. Note this only makes sense for non-void routines. + This is valid in both normal and post routines. +

  • +MRES_SUPERCEDE +
    The plugin has performed sufficient actions for the routine, and + the gameDLL's routine should not be called (the plugin + "supercedes" the gameDLL's routine, more or less replacing it + entirely). Any return value for the routine should be specified as + well by the plugin. Note this is only valid for normal routines, as + post routines cannot prevent calling the gameDLL's routine (as it has + already happened!). Also note, this doesn't prevent subsequent plugins + from being called for this routine; it supercedes only + the gameDLL. +
+ +As the plugins are called, a running status is kept of the "highest" meta +status so far, in the order (lowest to highets) shown above. After calling +all the "normal" routines, the status is checked to see if the gameDLL's +routine should be called - ie, it will not be called if one (or more) of +the plugin's has specified META_SUPERCEDE. The gameDLL's +routine is then called, or skipped, as appropriate. Then, all the "post" +routines are called in the same manner (except +META_SUPERCEDE is no longer a valid meta result). + +

Last, if any plugins specified META_OVERRIDE or +META_SUPERCEDE, the return value given by the +last such plugin is returned as the routine's return code to +the engine (assuming a non-void routine). Thus, the order of the plugins +as specified in the metamod.ini does have a possible +effect. + + +


+ +

Available Macros +

+ +The meta_api.h +header that describes the Metamod API functions, types, and structures also +includes several macros that can be of help when coding a plugin. + +
    +

  • +SET_META_RESULT(result) +
    Sets the META_RESULT for the plugin. +

  • +RETURN_META(result) +
    Sets the META_RESULT for the plugin, and then calls + return. This assumes a void function. +

  • +RETURN_META_VALUE(result, value) +
    Sets the META_RESULT for the plugin, and then returns the + given value. This assumes a non-void function, and + it doesn't matter the particular type of the return value. +

  • +META_RESULT_STATUS +
    Gives the current status of META_RESULT for this routine + from plugins so far. It will return the "highest" result so far, in + the order of lesser to greater: IGNORED, HANDLED, + OVERRIDE, SUPERCEDE (see also above Operation Details) +

  • +META_RESULT_PREVIOUS +
    Gives the META_RESULT of the previous plugin. +

  • +META_RESULT_ORIG_RET(type) +
    Gives the "original" return value for the routine, ie the return + value of the routine from gameDLL. The type for the routine's return + value must be specified in the macro; this is used as a cast for + assignment. Note this is only valid in a "post" routine. +

  • +META_RESULT_OVERRIDE_RET(type) +
    Gives the return value from any previous plugin that specified + META_OVERRIDE or META_SUPERCEDE. The + type for the routine's return value must be specified in the macro; + this is used as a cast for assignment. This should only be used after + checking the META_RESULT to see if there's actually an override value + available. +

  • +MDLL_*(args) +
    Calls a given DLLAPI routine in the gameDLL. For instance, + MDLL_GameDLLInit(args), MDLL_Spawn(args), + etc. +

  • +MNEW_*(args) +
    Calls a given NEWAPI routine in the gameDLL. For instance, + MNEW_GameShutdown(args), etc. +
+ + +


+ +

Utility Callback Functions +

+ +In version 1.05, Metamod began providing a set of utility functions to +plugins to centralize functionality, reduce code reuse, and to provide some +convenience in plugin coding. Presently, only a few functions are +provided. More are added as I find the time, and identify some advantage +to having them (either for my own plugins, or by others' request for their +plugins). + +

Note the PLID keyword passed to each function. This is +basically a "plugin id" to indicate to Metamod which plugin is calling the +function (else it's difficult to tell), and is a macro that should be +specified verbatim with each call. (Currently, the macro is merely the +plugin_info struct pointer returned by the plugin via Meta_Query; +in the future this could change to some other identifier.) + +

    +

  • + void LOG_CONSOLE(PLID, char *fmt, ...) +
    Print a message line on the console. Message is specified as a + printf style format string and arguments. A trailing newline + is provided by the routine and should not be specified in the string + (unless you want two newlines). +

  • + void LOG_MESSAGE(PLID, char *fmt, ...) +
    Print a message line in the server logs. Message is specified as a + printf style format string and arguments. A trailing newline + is provided by the routine and should not be specified in the string. + Log message is prefixed by the logtag string in the plugin's + "info" struct, surrounded by brackets. For instance: +

    L 04/17/2001 - 18:00:35: [TraceAPI] Tracing Engine routine 'RegUserMsg' +

  • + void LOG_ERROR(PLID, char *fmt, ...) +
    As in LOG_MESSAGE above, only marked as well with the + string "ERROR:". For example: +

    L 04/17/2001 - 18:03:13: [TraceAPI] ERROR: malloc failed +

  • + void LOG_DEVELOPER(PLID, char *fmt, ...) +
    As in LOG_MESSAGE above, only message will be logged only + if cvar developer is set to 1; message is marked as well with + the string "dev:". For example: +

    L 04/17/2001 - 18:03:13: [TraceAPI] dev: called: GiveFnptrsToDll +

  • + void CENTER_SAY(PLID, char *fmt, ...) +
    Prints a message on the center of all players' screens. This is + like the "centersay" of AdminMod, with pretty_say enabled, with the + same defaults (green, and a 10 second fade-in). A message is logged as + well, ie: [added in 1.06] +

    L 04/17/2001 - 15:44:52: [WDMISC] (centersay) random set up us the bomb! +

  • + void CENTER_SAY_PARMS(PLID, hudtextparms_t tparms, char *fmt, ...) +
    As in CENTER_SAY above, but allows specifying all the + parameters. (see SDK dlls/util.h for the struct + hudtextparms_t). [added in 1.06] +

  • + void CENTER_SAY_VARARGS(PLID, hudtextparms_t tparms, char *fmt, va_list ap) +
    As in CENTER_SAY_PARMS above, only the message is passed + as a vsnprintf style varargs format string and args list. + This is included merely because both the previous CENTER_SAY functions + actually call this, and it was convenient to include it as well. + [added in 1.06] +

  • + qboolean CALL_GAME_ENTITY(PLID, char *entStr, entvars_t *pev) +
    Calls an entity function in the gameDLL. For instance, a bot usually + needs to call the player entity function. + [added in 1.09] +

  • + int GET_USER_MSG_ID(PLID, const char *name, int *size) +
    Returns the id number corresponding to the given message name, of + those messages registered by the gamedll with RegUserMsg, optionally + returning the registered size of the message as well. This is to + allow things like bots to access the name/id mapping without having to + catch RegUserMsg themselves, and thus have to be loaded at startup. + [added in 1.11] +

  • + const char * GET_USER_MSG_NAME(PLID, int msgid, int *size) +
    Returns the name corresponding to the given msgid number, of those + messages registered by the gamedll with RegUserMsg, optionally + returning the registered size of the message as well. It will return + guess-names for any builtin Engine messages that it knows about + (SVC_TEMPENTITY, etc). The returned string is presumed to be + a compile-time constant string, stored in the text segment of the + gamedll. + [added in 1.11] +

  • + const char * GET_PLUGIN_PATH(PLID) +
    Returns the full pathname of the loaded dll/so file for the calling + plugin. The returned string is a pointer to a static buffer, and should be + copied by the caller to local storage. + [added in 1.12] +

  • + const char * GET_GAME_INFO(PLID, ginfo_t type) +
    Returns various string-based information about the running + game/MOD/gamedll. The given type can be one of: +
      +
    • GINFO_NAME - short name of game, from "-game" argument to hlds (ie "cstrike") +
    • GINFO_DESC - long name of game, from autodetection (ie "Counter-Strike") +
    • GINFO_GAMEDIR - game directory, full pathname (ie "/usr/local/half-life/cstrike") +
    • GINFO_DLL_FULLPATH - full pathname of the game dll (ie "/usr/local/half-life/cstrike/dlls/cs_i386.so") +
    • GINFO_DLL_FILENAME - bare filename of the gamedll (ie "cs_i386.so") +
    + The returned string is a pointer to a static buffer, and should be + copied by the caller to local storage. + [added in 1.14] +
+ +


+ +

Plugin Loading +

+ +(this is some rough notes I intend to fill in in the future)

+ +Plugins are loaded when the engine calls GiveFnptrsToDll(). +The config file is parsed, and for each valid plugin (uncommented, platform +relevant), the operation is: + +

    +
  • dlopen() the file, store the handle +
  • dlsym() and call: +
    +   Meta_Init (if present)
    +   GiveFnptrsToDll
    +   Meta_Query
    +   Meta_Attach
    +
    +
  • if present, call function pointers, and store resulting function table: +
    +   GetEntityAPI
    +   GetEntityAPI2
    +   GetNewDLLFunctions
    +
    +   GetEntityAPI_Post
    +   GetEntityAPI2_Post
    +   GetNewDLLFunctions_Post
    +
    +   GetEngineFunctions
    +   GetEngineFunctions_Post
    +
    +
+ +

+


+ + + diff --git a/doc/html/dllapi_notes.html b/doc/html/dllapi_notes.html new file mode 100644 index 0000000..05f1e31 --- /dev/null +++ b/doc/html/dllapi_notes.html @@ -0,0 +1,569 @@ + + + + + +HLSDK DLLAPI Notes + + + +

HLSDK DLLAPI Notes +

+ +
+ + +

GameDLLInit

+from dlls/game.cpp:
+
void GameDLLInit(void);

+

+ Register your console variables here.
+ This gets called one time when the game is initialied.
+ Initialize the game (one-time call after loading of game .dll)
+
+

comments:
+

+ Called just after hlds reports "Dll loaded for mod Half-Life". +
+ +

DispatchSpawn

+from dlls/cbase.cpp +
int DispatchSpawn(edict_t *pent);

+

comments:
+

+ 0==Success, -1==Failure ? +
+ +

DispatchThink

+from dlls/cbase.cpp
+
void DispatchThink(edict_t *pent);

+ +


DispatchUse

+from dlls/cbase.cpp
+
void DispatchUse(edict_t *pentUsed, edict_t *pentOther);

+ +


DispatchTouch

+from dlls/cbase.cpp
+
void DispatchTouch(edict_t *pentTouched, edict_t *pentOther);

+ +


DispatchBlocked

+from dlls/cbase.cpp
+
void DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther);

+ +


DispatchKeyValue

+from dlls/cbase.cpp
+
void DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd);

+ +


DispatchSave

+from dlls/cbase.cpp
+
void DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData);

+ +


DispatchRestore

+from dlls/cbase.cpp
+
int DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity);

+

comments:
+

+ 0==Success, -1==Failure ? +
+ +

DispatchObjectCollsionBox

+from dlls/cbase.cpp
+
void DispatchObjectCollsionBox(edict_t *pent);

+ +


SaveWriteFields

+from dlls/cbase.cpp
+
void SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount);

+ +


SaveReadFields

+from dlls/cbase.cpp
+
void SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount);

+ +


SaveGlobalState

+from dlls/world.cpp
+
void SaveGlobalState(SAVERESTOREDATA *pSaveData);

+ +


RestoreGlobalState

+from dlls/world.cpp
+
void RestoreGlobalState(SAVERESTOREDATA *pSaveData);

+ +


ResetGlobalState

+from dlls/world.cpp
+
void ResetGlobalState(void);

+ +


ClientConnect

+from dlls/client.cpp:
+
BOOL ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[128]);

+

+ Called when a player connects to a server. +
+

comments:
+

+ Called on initial connect, just after hlds reports "connected", ie: +
    "John<1><WON:9856723>" connected, address "127.0.0.1:27005"
+ This is before the user begins downloading, or anything else. +
+ +

ClientDisconnect

+from dlls/client.cpp:
+
void ClientDisconnect(edict_t *pEntity);

+

+ Called when a player disconnects from a server.
+ GLOBALS ASSUMED SET: g_fGameOver +
+

comments:
+

+ This is not the opposite of ClientConnect, despite the similar name. + It appears to only be called if the client was PutInServer first. If + the client disconnects before being PutInServer, no API routine is + called. This would be more appropriately named ClientRemoveFromServer. +
+ +

ClientKill

+from dlls/client.cpp:
+
void ClientKill(edict_t *pEntity);

+

+ Player entered the suicide command.
+ GLOBALS ASSUMED SET: g_ulModelIndexPlayer +
+

comments:
+

+ When the client typed "kill" in the console? +
+ +

ClientPutInServer

+from dlls/client.cpp:
+
void ClientPutInServer(edict_t *pEntity);

+

+ Called each time a player is spawned. +
+

comments:
+

+ Called after the client has uploaded/download all necessary resources, + just after hlds reports "entered the game", ie: +
   "John<1>" has entered the game
+
+ +

ClientCommand

+from dlls/client.cpp:
+
void ClientCommand(edict_t *pEntity);

+

+ Called each time a player uses a "cmd" command. + Use CMD_ARGS, CMD_ARGV, and CMD_ARGC to get pointers to the character + string command. +
+ +

ClientUserInfoChanged

+from dlls/client.cpp:
+
void ClientUserInfoChanged(edict_t *pEntity, char *infobuffer);

+

+ Called after the player changes userinfo - gives dll a chance to modify + it before it gets sent into the rest of the engine. +
+

comments:
+

+ Called when user issues "setinfo" from the console. Also appears to be + called whenever the user returns to the game from the ESC menu. +
+ +

ServerActivate

+from dlls/client.cpp:
+
void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax);

+

+ Every call to ServerActivate should be matched by a call to + ServerDeactivate. +
+

comments:
+

+ Added in SDK 2.0. + Apparently called when the server has loaded the map, but before it + precaches from the .res file. +
+ +

ServerDeactivate

+from dlls/client.cpp:
+
void ServerDeactivate(void);

+

+ Peform any shutdown operations here.
+ It's possible that the engine will call this function more times than + is necessary. Therefore, only run it one time for each call to + ServerActivate.
+
+

comments:
+

+ Called upon "quit" or "changelevel" . +
+ +

PlayerPreThink

+from dlls/client.cpp:
+
void PlayerPreThink(edict_t *pEntity);

+

+ Called every frame before physics are run. +
+ +

PlayerPostThink

+from dlls/client.cpp:
+
void PlayerPostThink(edict_t *pEntity);

+

+ Called every frame after physics are run. +
+ +

StartFrame

+from dlls/client.cpp:
+
void StartFrame(void);

+

+ GLOBALS ASSUMED SET: g_ulFrameCount +
+ +

ParmsNewLevel

+from dlls/client.cpp
+
void ParmsNewLevel(void);

+ +


ParmsChangeLevel

+from dlls/client.cpp
+
void ParmsChangeLevel(void);

+ +


GetGameDescription

+from dlls/client.cpp:
+
const char *GetGameDescription(void);

+

+ Returns string describing current .dll game.
+ Returns the descriptive name of this .dll. E.g., Half-Life, or Team + Fortress 2.
+ This function might be called before the world has spawned, and the game + rules initialized.
+
+ +

PlayerCustomization

+from dlls/client.cpp:
+
void PlayerCustomization(edict_t *pEntity, customization_t *pCust);

+

+ Notifies .dll of new customization for player.
+ A new player customization has been registered on the server. + UNDONE: This only sets the # of frames of the spray can logo animation + right now.
+
+ +

SpectatorConnect

+from dlls/client.cpp:
+
void SpectatorConnect(edict_t *pEntity);

+

+ Called when spectator joins server.
+ A spectator has joined the game.
+
+ +

SpectatorDisconnect

+from dlls/client.cpp:
+
void SpectatorDisconnect(edict_t *pEntity);

+

+ Called when spectator leaves the server.
+ A spectator has left the game.
+
+ +

SpectatorThink

+from dlls/client.cpp:
+
void SpectatorThink(edict_t *pEntity);

+

+ Called when spectator sends a command packet (usercmd_t).
+ A spectator has sent a usercmd.
+
+ +

Sys_Error

+from dlls/client.cpp:
+
void Sys_Error(const char *error_string);

+

+ Called when engine has encountered an error.
+ Notify game .dll that engine is going to shut down.
+ Engine is going to shut down, allows setting a breakpoint in game dll + to catch that occasion.
+ Add code ( e.g., _asm { int 3 }; here to cause a breakpoint for + debugging your game .dlls.
+
+

comments:
+

+ Added in SDK 2.0. +
+ +

PM_Move

+from pm_shared/pm_shared.c:
+
void PM_Move(struct playermove_s *ppmove, int server);

+

+ This modume implements the shared player physics code between + any particular game and the engine. The same PM_Move routine is built + into the game .dll and the client .dll and is invoked by each side as + appropriate. There should be no distinction, internally, between server + and client. This will ensure that prediction behaves appropriately. +
+

comments:
+

+ Added in SDK 2.0. +
+ +

PM_Init

+from pm_shared/pm_shared.c: +
void PM_Init(struct playermove_s *ppmove);

+

+ Server version of player movement initialization. +
+

comments:
+

+ Added in SDK 2.0. +
+ +

PM_FindTextureType

+from pm_shared/pm_shared.c
+
char PM_FindTextureType(char *name);

+

comments:
+

+ Added in SDK 2.0. +
+ +

SetupVisibility

+from dlls/client.cpp:
+
void SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas);

+from dlls/client.cpp: +

+ Set up PVS and PAS for networking for this client. +

+ A client can have a separate "view entity" indicating + that his/her view should depend on the origin of that view entity. If + that's the case, then pViewEntity will be non-NULL and will be used. + Otherwise, the current entity's origin is used. Either is offset by the + view_ofs to get the eye position. +

+ From the eye position, we set up the PAS and PVS to use for filtering + network messages to the client. At this point, we could override the + actual PAS or PVS values, or use a different origin. +

+ NOTE: Do not cache the values of pas and pvs, as they depend on + reusable memory in the engine, they are only good for this one frame +

+

comments:
+

+ Added in SDK 2.0. +
+ +

UpdateClientData

+from dlls/client.cpp:
+
void UpdateClientData (const struct edict_s *ent, int sendweapons, struct clientdata_s *cd);

+

+ Set up data sent only to specific client.
+ Data sent to current client only.
+ Engine sets argument 'cd' to 0 before calling.
+
+

comments:
+

+ Added in SDK 2.0. +
+ +

AddToFullPack

+from dlls/client.cpp:
+
int AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet);

+

+ Return 1 if the entity state has been filled in for the ent and the + entity will be propagated to the client, 0 otherwise. +

+ State is the server maintained copy of the state info that is + transmitted to the client. A MOD could alter values copied into state + to send the "host" a different look for a particular entity update, + etc. +

+ Arguments 'e' and 'ent' are the entity that is being added to the + update, if 1 is returneds. Host is the player's edict of the player + whom we are sending the update to. Player is 1 if the ent/e is a + player and 0 otherwise. Argument 'pSet' is either the PAS or PVS that + we previous set up. We can use it to ask the engine to filter the + entity against the PAS or PVS. +

+ We could also use the pas/ pvs that we set in SetupVisibility, if we + wanted to. Caching the value is valid in that case, but still only for + the current frame. +

+

comments:
+

+ Added in SDK 2.0. +
+ +

CreateBaseline

+from dlls/client.cpp:
+
void CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs);

+

+ Tweak entity baseline for network encoding, allows setup of player + baselines, too.
+ Creates baselines used for network encoding, especially for player data + since players are not spawned until connect time.
+
+

comments:
+

+ Added in SDK 2.0. +
+ +

RegisterEncoders

+from dlls/client.cpp:
+
void RegisterEncoders(void);

+

+ Callbacks for network encoding.
+ Allows game .dll to override network encoding of certain types of + entities and tweak values, etc.
+
+

comments:
+

+ Added in SDK 2.0. +
+ +

GetWeaponData

+from dlls/client.cpp
+
int GetWeaponData(struct edict_s *player, struct weapon_data_s *info);

+

comments:
+

+ Added in SDK 2.0. +
+ +

CmdStart

+from dlls/client.cpp:
+
void CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed);

+

+ We're about to run this usercmd for the specified player. We can set + up groupinfo and masking here, etc. This is the time to examine the + usercmd for anything extra. This call happens even if think does not. +
+

comments:
+

+ Added in SDK 2.0. +
+ +

CmdEnd

+from dlls/client.cpp:
+
void CmdEnd (const edict_t *player);

+

+ Each cmdstart is exactly matched with a cmd end, clean up any + group trace flags, etc. here. +
+

comments:
+

+ Added in SDK 2.0. +
+ +

ConnectionlessPacket

+from dlls/client.cpp:
+
int ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size); +
+ Return 1 if the packet is valid. Set response_buffer_size if you want + to send a response packet. Incoming, it holds the max size of the + response_buffer, so you must zero it out if you choose not to respond. +
+

comments:
+

+ Added in SDK 2.0. +
+ +

GetHullBounds

+from dlls/client.cpp:
+
int GetHullBounds(int hullnumber, float *mins, float *maxs);

+

+ Engine calls this to enumerate player collision hulls, + for prediction. Return 0 if the hullnumber doesn't exist. +
+

comments:
+

+ Added in SDK 2.0. +
+ +

CreateInstancedBaselines

+from dlls/client.cpp:
+
void CreateInstancedBaselines (void);

+

+ Tweak entity baseline for network encoding, allows setup of player baselines, too.
+ Create pseudo-baselines for items that aren't placed in the map at + spawn time, but which are likely to be created during play (e.g., + grenades, ammo packs, projectiles, corpses, etc.).
+
+

comments:
+

+ Added in SDK 2.0. +
+ +

InconsistentFile

+from dlls/client.cpp:
+
int InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message); +
+ One of the ENGINE_FORCE_UNMODIFIED files failed the consistency check + for the specified player Return 0 to allow the client to continue, 1 to + force immediate disconnection (with an optional disconnect message of + up to 256 characters). +
+

comments:
+

+ Added in SDK 2.0. +
+ +

AllowLagCompensation

+from dlls/client.cpp:
+
int AllowLagCompensation(void);

+

+ The game .dll should return 1 if lag compensation should be allowed + (could also just set the sv_unlag cvar. Most games right now should + return 0, until client-side weapon prediction code is written and + tested for them (note you can predict weapons, but not do lag + compensation, too, if you want. +
+

comments:
+

+ Added in SDK 2.0. +
+ +

+


+ + + diff --git a/doc/html/engine_notes.html b/doc/html/engine_notes.html new file mode 100644 index 0000000..d8ff278 --- /dev/null +++ b/doc/html/engine_notes.html @@ -0,0 +1,1705 @@ + + + + + +HLSDK Engine Notes + + + +

HLSDK Engine Notes +

+ +
+ + +

PrecacheModel

+from engine/eiface.h:
+
int PrecacheModel(char *s);
+
PRECACHE_MODEL() +

comments:
+

+ . +
+ +

PrecacheSound

+from engine/eiface.h:
+
int PrecacheSound(char *s);
+
PRECACHE_SOUND() +

comments:
+

+ . +
+ +

SetModel

+from engine/eiface.h:
+
void SetModel(edict_t *e, const char *m);
+
SET_MODEL() +

comments:
+

+ . +
+ +

ModelIndex

+from engine/eiface.h:
+
int ModelIndex(const char *m);
+
MODEL_INDEX() +

comments:
+

+ . +
+ +

ModelFrames

+from engine/eiface.h:
+
int ModelFrames(int modelIndex);
+
MODEL_FRAMES() +

comments:
+

+ . +
+ +

SetSize

+from engine/eiface.h:
+
void SetSize(edict_t *e, const float *rgflMin, const float *rgflMax);
+
SET_SIZE() +

comments:
+

+ . +
+ +

ChangeLevel

+from engine/eiface.h:
+
void ChangeLevel(char *s1, char *s2);
+
CHANGE_LEVEL() +

comments:
+

+ . +
+ +

GetSpawnParms

+from engine/eiface.h:
+
void GetSpawnParms(edict_t *ent);
+
GET_SPAWN_PARMS() +

comments:
+

+ . +
+ +

SaveSpawnParms

+from engine/eiface.h:
+
void SaveSpawnParms(edict_t *ent);
+
SAVE_SPAWN_PARMS() +

comments:
+

+ . +
+ +

VecToYaw

+from engine/eiface.h:
+
float VecToYaw(const float *rgflVector);
+
VEC_TO_YAW() +

comments:
+

+ . +
+ +

VecToAngles

+from engine/eiface.h:
+
void VecToAngles(const float *rgflVectorIn, float *rgflVectorOut);
+
VEC_TO_ANGLES() +

comments:
+

+ . +
+ +

MoveToOrigin

+from engine/eiface.h:
+
void MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType);
+
MOVE_TO_ORIGIN() +

comments:
+

+ . +
+ +

ChangeYaw

+from engine/eiface.h:
+
void ChangeYaw(edict_t *ent);
+
oldCHANGE_YAW() +

comments:
+

+ . +
+ +

ChangePitch

+from engine/eiface.h:
+
void ChangePitch(edict_t *ent);
+
CHANGE_PITCH() +

comments:
+

+ . +
+ +

FindEntityByString

+from engine/eiface.h:
+
edict_t *FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue);
+
FIND_ENTITY_BY_STRING() +

comments:
+

+ . +
+ +

GetEntityIllum

+from engine/eiface.h:
+
int GetEntityIllum(edict_t *pEnt);
+
GETENTITYILLUM() +

comments:
+

+ . +
+ +

FindEntityInSphere

+from engine/eiface.h:
+
edict_t *FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad);
+
FIND_ENTITY_IN_SPHERE() +

comments:
+

+ . +
+ +

FindClientInPVS

+from engine/eiface.h:
+
edict_t *FindClientInPVS(edict_t *pEdict);
+
FIND_ENTITY_IN_PVS() +

comments:
+

+ . +
+ +

EntitiesInPVS

+from engine/eiface.h:
+
edict_t *EntitiesInPVS(edict_t *pplayer); +

comments:
+

+ . +
+ +

MakeVectors

+from engine/eiface.h:
+
void MakeVectors(const float *rgflVector);
+
MAKE_VECTORS() +

comments:
+

+ . +
+ +

AngleVectors

+from engine/eiface.h:
+
void AngleVectors(const float *rgflVector, float *forward, float *right, float *up); +

comments:
+

+ . +
+ +

CreateEntity

+from engine/eiface.h:
+
edict_t *CreateEntity(void);
+
CREATE_ENTITY() +

comments:
+

+ . +
+ +

RemoveEntity

+from engine/eiface.h:
+
void RemoveEntity(edict_t *e);
+
REMOVE_ENTITY() +

comments:
+

+ . +
+ +

CreateNamedEntity

+from engine/eiface.h:
+
edict_t *CreateNamedEntity(int className);
+
CREATE_NAMED_ENTITY() +

comments:
+

+ . +
+ +

MakeStatic

+from engine/eiface.h:
+
void MakeStatic(edict_t *ent);
+
MAKE_STATIC() +

comments:
+

+ . +
+ +

EntIsOnFloor

+from engine/eiface.h:
+
int EntIsOnFloor(edict_t *e);
+
ENT_IS_ON_FLOOR() +

comments:
+

+ . +
+ +

DropToFloor

+from engine/eiface.h:
+
int DropToFloor(edict_t *e);
+
DROP_TO_FLOOR() +

comments:
+

+ . +
+ +

WalkMove

+from engine/eiface.h:
+
int WalkMove(edict_t *ent, float yaw, float dist, int iMode);
+
WALK_MOVE() +

comments:
+

+ . +
+ +

SetOrigin

+from engine/eiface.h:
+
void SetOrigin(edict_t *e, const float *rgflOrigin);
+
SET_ORIGIN() +

comments:
+

+ . +
+ +

EmitSound

+from engine/eiface.h:
+
void EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch);
+
EMIT_SOUND_DYN2() +

comments:
+

+ . +
+ +

EmitAmbientSound

+from engine/eiface.h:
+
void EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch);
+
EMIT_AMBIENT_SOUND() +

comments:
+

+ . +
+ +

TraceLine

+from engine/eiface.h:
+
void TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr);
+
TRACE_LINE() +

comments:
+

+ . +
+ +

TraceToss

+from engine/eiface.h:
+
void TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr);
+
TRACE_TOSS() +

comments:
+

+ . +
+ +

TraceMonsterHull

+from engine/eiface.h:
+
int TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr);
+
TRACE_MONSTER_HULL() +

comments:
+

+ . +
+ +

TraceHull

+from engine/eiface.h:
+
void TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr);
+
TRACE_HULL() +

comments:
+

+ . +
+ +

TraceModel

+from engine/eiface.h:
+
void TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); +

comments:
+

+ . +
+ +

TraceTexture

+from engine/eiface.h:
+
const char *TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2);
+
TRACE_TEXTURE() +

comments:
+

+ . +
+ +

TraceSphere

+from engine/eiface.h:
+
void TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); +

comments:
+

+ . +
+ +

GetAimVector

+from engine/eiface.h:
+
void GetAimVector(edict_t *ent, float speed, float *rgflReturn);
+
GET_AIM_VECTOR() +

comments:
+

+ . +
+ +

ServerCommand

+from engine/eiface.h:
+
void ServerCommand(char *str);
+
SERVER_COMMAND() +

comments:
+

+ Executes a server command, as if typed at the console (ie "exec + myconfig.cfg", or "quit"). Note that it appears no commands are + executed until after GameDLLInit is called. If + ServerCommand is called earlier than that, the command is delayed until + then. +
+ +

ServerExecute

+from engine/eiface.h:
+
void ServerExecute(void);
+
SERVER_EXECUTE() +

comments:
+

+ . +
+ +

ClientCommand

+from engine/eiface.h:
+
void ClientCommand(edict_t *pEdict, char *szFmt, ...);
+
CLIENT_COMMAND() +

comments:
+

+ . +
+ +

ParticleEffect

+from engine/eiface.h:
+
void ParticleEffect(const float *org, const float *dir, float color, float count);
+
PARTICLE_EFFECT() +

comments:
+

+ . +
+ +

LightStyle

+from engine/eiface.h:
+
void LightStyle(int style, char *val);
+
LIGHT_STYLE() +

comments:
+

+ . +
+ +

DecalIndex

+from engine/eiface.h:
+
int DecalIndex(const char *name);
+
DECAL_INDEX() +

comments:
+

+ . +
+ +

PointContents

+from engine/eiface.h:
+
int PointContents(const float *rgflVector);
+
POINT_CONTENTS() +

comments:
+

+ . +
+ +

MessageBegin

+from engine/eiface.h:
+
void MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed);
+
MESSAGE_BEGIN() +

comments:
+

+ Begin a network message to send to the client. +
msg_type should be a number returned by RegUserMsg. +
msg_dest is one of: +
    +
  • MSG_BROADCAST - "unreliable to all" +
  • MSG_ONE - "reliable to one (msg_entity)" +
  • MSG_ALL - "reliable to all" +
  • MSG_INIT - "write to the init string" +
  • MSG_PVS - "Ents in PVS of org" (PVS=potentially visible set) +
  • MSG_PAS - "Ents in PAS of org" (PAS=potentially audible set) +
  • MSG_PVS_R - "Reliable to PVS" +
  • MSG_PAS_R - "Reliable to PAS" +
  • MSG_ONE_UNRELIABLE - "Send to one client, but don't put in reliable stream, put in unreliable datagram (could be dropped)" +
+
+ +

MessageEnd

+from engine/eiface.h:
+
void MessageEnd(void);
+
MESSAGE_END() +

comments:
+

+ . +
+ +

WriteByte

+from engine/eiface.h:
+
void WriteByte(int iValue);
+
WRITE_BYTE() +

comments:
+

+ . +
+ +

WriteChar

+from engine/eiface.h:
+
void WriteChar(int iValue);
+
WRITE_CHAR() +

comments:
+

+ . +
+ +

WriteShort

+from engine/eiface.h:
+
void WriteShort(int iValue);
+
WRITE_SHORT() +

comments:
+

+ . +
+ +

WriteLong

+from engine/eiface.h:
+
void WriteLong(int iValue);
+
WRITE_LONG() +

comments:
+

+ . +
+ +

WriteAngle

+from engine/eiface.h:
+
void WriteAngle(float flValue);
+
WRITE_ANGLE() +

comments:
+

+ . +
+ +

WriteCoord

+from engine/eiface.h:
+
void WriteCoord(float flValue);
+
WRITE_COORD() +

comments:
+

+ . +
+ +

WriteString

+from engine/eiface.h:
+
void WriteString(const char *sz);
+
WRITE_STRING() +

comments:
+

+ . +
+ +

WriteEntity

+from engine/eiface.h:
+
void WriteEntity(int iValue);
+
WRITE_ENTITY() +

comments:
+

+ . +
+ +

CVarRegister

+from engine/eiface.h:
+
void CVarRegister(cvar_t *pCvar);
+
CVAR_REGISTER() +

comments:
+

+ Register a new cvar (server variable). +
+ +

CVarGetFloat

+from engine/eiface.h:
+
float CVarGetFloat(const char *szVarName);
+
CVAR_GET_FLOAT() +

comments:
+

+ Return the float value of a cvar. +
+ +

CVarGetString

+from engine/eiface.h:
+
const char *CVarGetString(const char *szVarName);
+
CVAR_GET_STRING() +

comments:
+

+ Return the string value of a cvar. +
+ +

CVarSetFloat

+from engine/eiface.h:
+
void CVarSetFloat(const char *szVarName, float flValue);
+
CVAR_SET_FLOAT() +

comments:
+

+ Set the float value of a cvar. +
+ +

CVarSetString

+from engine/eiface.h:
+
void CVarSetString(const char *szVarName, const char *szValue);
+
CVAR_SET_STRING() +

comments:
+

+ Set the string value of a cvar. +
+ +

AlertMessage

+from engine/eiface.h:
+
void AlertMessage(ALERT_TYPE atype, char *szFmt, ...);
+
ALERT() +

comments:
+

+ Print an alert message. +
atype is one of: +
    +
  • at_notice +
  • at_console - "same as at_notice, but forces a ConPrintf, not a message box". Prints output to server console, but only shown if 'developer' is set. +
  • at_aiconsole - "same as at_console, but only shown if developer level is 2!" +
  • at_warning +
  • at_error +
  • at_logged - "Server print to console (only in multiplayer games)." Prints output to server logs and console. +
+
+ +

EngineFprintf

+from engine/eiface.h:
+
void EngineFprintf(FILE *pfile, char *szFmt, ...);
+
ENGINE_FPRINTF() +

comments:
+

+ . +
+ +

PvAllocEntPrivateData

+from engine/eiface.h:
+
void *PvAllocEntPrivateData(edict_t *pEdict, long cb);
+
ALLOC_PRIVATE() +

comments:
+

+ . +
+ +

PvEntPrivateData

+from engine/eiface.h:
+
void *PvEntPrivateData(edict_t *pEdict);
+
GET_PRIVATE() +

comments:
+

+ Returns a pointer to the base class type of the given edict. For + instance: +
+    CBaseEntity *pPlayer=(CBaseEntity *)GET_PRIVATE(pEntity);
+	
+
+ +

FreeEntPrivateData

+from engine/eiface.h:
+
void FreeEntPrivateData(edict_t *pEdict);
+
FREE_PRIVATE() +

comments:
+

+ . +
+ +

SzFromIndex

+from engine/eiface.h:
+
const char *SzFromIndex(int iString); +

comments:
+

+ . +
+ +

AllocString

+from engine/eiface.h:
+
int AllocString(const char *szValue);
+
ALLOC_STRING() +

comments:
+

+ . +
+ +

GetVarsOfEnt

+from engine/eiface.h:
+
struct entvars_s *GetVarsOfEnt(edict_t *pEdict); +

comments:
+

+ . +
+ +

PEntityOfEntOffset

+from engine/eiface.h:
+
edict_t *PEntityOfEntOffset(int iEntOffset);
+
ENT() +

comments:
+

+ . +
+ +

EntOffsetOfPEntity

+from engine/eiface.h:
+
int EntOffsetOfPEntity(const edict_t *pEdict); +

comments:
+

+ . +
+ +

IndexOfEdict

+from engine/eiface.h:
+
int IndexOfEdict(const edict_t *pEdict);
+
ENTINDEX() +

comments:
+

+ Returns the server slot (ie 1 to maxplayers) of the given player edict. +
+ +

PEntityOfEntIndex

+from engine/eiface.h:
+
edict_t *PEntityOfEntIndex(int iEntIndex);
+
INDEXENT() +

comments:
+

+ Returns the edict for the player in the given server slot (ie 1 to + maxplayers). +
+ +

FindEntityByVars

+from engine/eiface.h:
+
edict_t *FindEntityByVars(struct entvars_s *pvars); +

comments:
+

+ . +
+ +

GetModelPtr

+from engine/eiface.h:
+
void *GetModelPtr(edict_t *pEdict);
+
GET_MODEL_PTR() +

comments:
+

+ . +
+ +

RegUserMsg

+from engine/eiface.h:
+
int RegUserMsg(const char *pszName, int iSize);
+
REG_USER_MSG() +

comments:
+

+ Register a network message type with the given name, and size if known. + Returns the number assigned for the network message, to be used with MessageBegin. It appears that message + ID's 1-63 are reserved for the Engine, and that GameDLL messages are + allocated IDs starting at 64. The SDK dlls/util.h appears to + define six Engine messages: +
    +
  • SVC_TEMPENTITY = 23 +
  • SVC_INTERMISSION = 30 +
  • SVC_CDTRACK = 32 +
  • SVC_WEAPONANIM = 35 +
  • SVC_ROOMTYPE = 37 +
  • SVC_HLTV = 50 +
+
+ +

AnimationAutomove

+from engine/eiface.h:
+
void AnimationAutomove(const edict_t *pEdict, float flTime); +

comments:
+

+ . +
+ +

GetBonePosition

+from engine/eiface.h:
+
void GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles);
+
GET_BONE_POSITION() +

comments:
+

+ . +
+ +

FunctionFromName

+from engine/eiface.h:
+
unsigned long FunctionFromName(const char *pName);
+
FUNCTION_FROM_NAME() +

comments:
+

+ Apparently, this finds the given exported function name string in the + GameDLL, and returns a pointer to said function (much like unix dlsym + or win32 GetProcAddress?). This appears to be used in GameDLL code for + loading savegames, as the savegames contain names of exported functions + in the GameDLL. Basically, this is the opposite of NameForFunction. +
+ +

NameForFunction

+from engine/eiface.h:
+
const char *NameForFunction(unsigned long function);
+
NAME_FOR_FUNCTION() +

comments:
+

+ Basically, the opposite of FunctionFromName. Finds the given + function pointer address in the GameDLL, and returns the string name + for the corresponding function. This appears to be used in GameDLL + code for saving games, taking known function pointers and converting + them to function name strings to be stored in the savegames, so that + they can be converted back to function pointers upon game load. +
+ +

ClientPrintf

+from engine/eiface.h:
+
void ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg);
+
CLIENT_PRINTF() +
+ JOHN: engine callbacks so game DLL can print messages to individual + clients +
+

comments:
+

+ . +
+ +

ServerPrint

+from engine/eiface.h:
+
void ServerPrint(const char *szMsg); +

comments:
+

+ Prints output to the server console. +
+ +

Cmd_Args

+from engine/eiface.h:
+
const char *Cmd_Args(void);
+
CMD_ARGS() +
+ these 3 added so game DLL can easily access client 'cmd' strings +
+

comments:
+

+ Returns the arguments for a command, as a single string. The command + string itself is not included, and must be queried with + CMD_ARGV(0). For use in DLLAPI ClientCommand, or in + the function provided to AddServerCommand. +
+ +

Cmd_Argv

+from engine/eiface.h:
+
const char *Cmd_Argv(int argc);
+
CMD_ARGV() +

comments:
+

+ Returns the nth argument to the command. CMD_ARGV(0) + returns the command name itself. +
+ +

Cmd_Argc

+from engine/eiface.h:
+
int Cmd_Argc(void);
+
CMD_ARGC() +

comments:
+

+ Returns the number of arguments given to the command. +
+ +

GetAttachment

+from engine/eiface.h:
+
void GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles);
+
GET_ATTACHMENT() +

comments:
+

+ . +
+ +

CRC32_Init

+from engine/eiface.h:
+
void CRC32_Init(CRC32_t *pulCRC);
+
CRC32_INIT() +

comments:
+

+ . +
+ +

CRC32_ProcessBuffer

+from engine/eiface.h:
+
void CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len);
+
CRC32_PROCESS_BUFFER() +

comments:
+

+ . +
+ +

CRC32_ProcessByte

+from engine/eiface.h:
+
void CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch);
+
CRC32_PROCESS_BYTE() +

comments:
+

+ . +
+ +

CRC32_Final

+from engine/eiface.h:
+
CRC32_t CRC32_Final(CRC32_t pulCRC);
+
CRC32_FINAL() +

comments:
+

+ . +
+ +

RandomLong

+from engine/eiface.h:
+
long RandomLong(long lLow, long lHigh);
+
RANDOM_LONG() +

comments:
+

+ . +
+ +

RandomFloat

+from engine/eiface.h:
+
float RandomFloat(float flLow, float flHigh);
+
RANDOM_FLOAT() +

comments:
+

+ . +
+ +

SetView

+from engine/eiface.h:
+
void SetView(const edict_t *pClient, const edict_t *pViewent);
+
SET_VIEW() +

comments:
+

+ . +
+ +

Time

+from engine/eiface.h:
+
float Time(void); +

comments:
+

+ . +
+ +

CrosshairAngle

+from engine/eiface.h:
+
void CrosshairAngle(const edict_t *pClient, float pitch, float yaw);
+
SET_CROSSHAIRANGLE() +

comments:
+

+ . +
+ +

LoadFileForMe

+from engine/eiface.h:
+
byte * LoadFileForMe(char *filename, int *pLength);
+
LOAD_FILE_FOR_ME() +

comments:
+

+ Opens the given filename (relative to the gamedir, or relative to the + hlds directory, in that order), and returns a pointer to a byte array + (character string) with the contents of the file. NULL-termination of + the array indicates end of file. Length of the file in bytes is + returned in the given int pointer. +
+ +

FreeFile

+from engine/eiface.h:
+
void FreeFile(void *buffer);
+
FREE_FILE() +

comments:
+

+ Free the byte array of the given buffer which was returned by LoadFileForMe. +
+ +

EndSection

+from engine/eiface.h:
+
void EndSection(const char *pszSectionName); +
+ trigger_endsection +
+

comments:
+

+ . +
+ +

CompareFileTime

+from engine/eiface.h:
+
int CompareFileTime(char *filename1, char *filename2, int *iCompare);
+
COMPARE_FILE_TIME() +

comments:
+

+ . +
+ +

GetGameDir

+from engine/eiface.h:
+
void GetGameDir(char *szGetGameDir);
+
GET_GAME_DIR() +

comments:
+

+ Copies the pathname of the game directory into the given buffer. Note + that there's no way to inform the engine how big the buffer is, so be + forewarned. +

+ Prior to HL 1.1.1.1 (CS 1.6), this gave the full pathname of the game + directory, ie "/usr/local/half-life/cstrike" or + "C:\Games\Half-Life\cstrike". Now, it is only the string passed to + hlds as the argument to "-game", ie "cstrike". +

+ +

Cvar_RegisterVariable

+from engine/eiface.h:
+
void Cvar_RegisterVariable(cvar_t *variable);
+
CVAR_CREATE() +

comments:
+

+ . +
+ +

FadeClientVolume

+from engine/eiface.h:
+
void FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); +

comments:
+

+ . +
+ +

SetClientMaxspeed

+from engine/eiface.h:
+
void SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed); +

comments:
+

+ . +
+ +

CreateFakeClient

+from engine/eiface.h:
+
edict_t * CreateFakeClient(const char *netname); +
+ returns NULL if fake client can't be created +
+

comments:
+

+ Creates "bots" (?). +
+ +

RunPlayerMove

+from engine/eiface.h:
+
void RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec); +

comments:
+

+ . +
+ +

NumberOfEntities

+from engine/eiface.h:
+
int NumberOfEntities(void);
+
NUMBER_OF_ENTITIES() +

comments:
+

+ . +
+ +

GetInfoKeyBuffer

+from engine/eiface.h:
+
char *GetInfoKeyBuffer(edict_t *e); +
+ passing in NULL gets the serverinfo +
+

comments:
+

+ Returns the InfoKeyBuffer for the given edict. This is basically the + fields from "setinfo" at the client console, and includes things like + the player name. +

+ The sourcecode comment ("passing in NULL gets the serverinfo") + isn't entirely accurate. There appear to be two server-side info + buffers available, "serverinfo" and "localinfo", both + accessible from the console by those two commands, respectively. +

+ Calling GetInfoKeyBuffer(NULL) will return the + localinfo buffer. Calling + GetInfoKeyBuffer(PEntityOfEntIndex(0)), ie passing the entity + of slot 0, will return the serverinfo buffer. +

+ +

InfoKeyValue

+from engine/eiface.h:
+
char *InfoKeyValue(char *infobuffer, char *key); +

comments:
+

+ Returns the value for the given key in the given InfoKeyBuffer. +
+ +

SetKeyValue

+from engine/eiface.h:
+
void SetKeyValue(char *infobuffer, char *key, char *value); +

comments:
+

+ Adds or sets a key/value pair in the given InfoKeyBuffer. Appears to + work for only server info, and not client info. For clients, use SetClientKeyValue. +
+ +

SetClientKeyValue

+from engine/eiface.h:
+
void SetClientKeyValue(int clientIndex, char *infobuffer, char *key, char *value); +

comments:
+

+ Adds or sets a key/value pair in a client's InfoKeyBuffer, by server + slot (ie 1 to maxplayers). +
+ +

IsMapValid

+from engine/eiface.h:
+
int IsMapValid(char *filename);
+
IS_MAP_VALID() +

comments:
+

+ . +
+ +

StaticDecal

+from engine/eiface.h:
+
void StaticDecal(const float *origin, int decalIndex, int entityIndex, int modelIndex); +

comments:
+

+ . +
+ +

PrecacheGeneric

+from engine/eiface.h:
+
int PrecacheGeneric(char *s);
+
PRECACHE_GENERIC() +

comments:
+

+ . +
+ +

GetPlayerUserId

+from engine/eiface.h:
+
int GetPlayerUserId(edict_t *e);
+
GETPLAYERUSERID() +
+ returns the server assigned userid for this player. useful for logging + frags, etc. returns -1 if the edict couldn't be found in the list of + clients +
+

comments:
+

+ Returns the session userid for the given player edict. As of server + x106, this is constant for the life of the player connection, and + unique for the life of the server process. Each time a client + connects, they are given a userid of 1 plus the userid of the previous + connecting client. When the server starts/restarts, the server starts + again at userid 1. +
+ +

BuildSoundMsg

+from engine/eiface.h:
+
void BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed);
+
BUILD_SOUND_MSG() +

comments:
+

+ . +
+ +

IsDedicatedServer

+from engine/eiface.h:
+
int IsDedicatedServer(void);
+
IS_DEDICATED_SERVER() +
+ is this a dedicated server? +
+

comments:
+

+ . +
+ +

CVarGetPointer

+from engine/eiface.h:
+
cvar_t *CVarGetPointer(const char *szVarName);
+
CVAR_GET_POINTER() +

comments:
+

+ Returns a pointer to a cvar_t struct for the given cvar + (server variable) name. +
+ +

GetPlayerWONId

+from engine/eiface.h:
+
unsigned int GetPlayerWONId(edict_t *e); +
GETPLAYERWONID() +
+ returns the server assigned WONid for this player. useful for logging + frags, etc. returns -1 if the edict couldn't be found in the list of + clients +
+

comments:
+

+ Returns the WON id for the given player edict. As of server x106, this + should be unique per client CD KEY, and should be consistent across all + WON auth servers. +
+ +

Info_RemoveKey

+from engine/eiface.h:
+
void Info_RemoveKey(char *s, const char *key); +
+ YWB 8/1/99 TFF Physics additions +
+

comments:
+

+ . +
+ +

GetPhysicsKeyValue

+from engine/eiface.h:
+
const char *GetPhysicsKeyValue(const edict_t *pClient, const char *key); +

comments:
+

+ . +
+ +

SetPhysicsKeyValue

+from engine/eiface.h:
+
void SetPhysicsKeyValue(const edict_t *pClient, const char *key, const char *value); +

comments:
+

+ . +
+ +

GetPhysicsInfoString

+from engine/eiface.h:
+
const char *GetPhysicsInfoString(const edict_t *pClient);
+
ENGINE_GETPHYSINFO() +

comments:
+

+ . +
+ +

PrecacheEvent

+from engine/eiface.h:
+
unsigned short PrecacheEvent(int type, const char *psz);
+
PRECACHE_EVENT() +

comments:
+

+ . +
+ +

PlaybackEvent

+from engine/eiface.h:
+
void PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2);
+
PLAYBACK_EVENT_FULL() +

comments:
+

+ . +
+ +

SetFatPVS

+from engine/eiface.h:
+
unsigned char *SetFatPVS(float *org);
+
ENGINE_SET_PVS() +

comments:
+

+ . +
+ +

SetFatPAS

+from engine/eiface.h:
+
unsigned char *SetFatPAS(float *org);
+
ENGINE_SET_PAS() +

comments:
+

+ . +
+ +

CheckVisibility

+from engine/eiface.h:
+
int CheckVisibility(const edict_t *entity, unsigned char *pset);
+
ENGINE_CHECK_VISIBILITY() +

comments:
+

+ . +
+ +

DeltaSetField

+from engine/eiface.h:
+
void DeltaSetField(struct delta_s *pFields, const char *fieldname);
+
DELTA_SET() +

comments:
+

+ . +
+ +

DeltaUnsetField

+from engine/eiface.h:
+
void DeltaUnsetField(struct delta_s *pFields, const char *fieldname);
+
DELTA_UNSET() +

comments:
+

+ . +
+ +

DeltaAddEncoder

+from engine/eiface.h:
+
void DeltaAddEncoder(char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to) );
+
DELTA_ADDENCODER() +

comments:
+

+ . +
+ +

GetCurrentPlayer

+from engine/eiface.h:
+
int GetCurrentPlayer(void);
+
ENGINE_CURRENT_PLAYER() +

comments:
+

+ . +
+ +

CanSkipPlayer

+from engine/eiface.h:
+
int CanSkipPlayer(const edict_t *player);
+
ENGINE_CANSKIP() +

comments:
+

+ . +
+ +

DeltaFindField

+from engine/eiface.h:
+
int DeltaFindField(struct delta_s *pFields, const char *fieldname);
+
DELTA_FINDFIELD() +

comments:
+

+ . +
+ +

DeltaSetFieldByIndex

+from engine/eiface.h:
+
void DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber);
+
DELTA_SETBYINDEX() +

comments:
+

+ . +
+ +

DeltaUnsetFieldByIndex

+from engine/eiface.h:
+
void DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber);
+
DELTA_UNSETBYINDEX() +

comments:
+

+ . +
+ +

SetGroupMask

+from engine/eiface.h:
+
void SetGroupMask(int mask, int op);
+
ENGINE_SETGROUPMASK() +

comments:
+

+ . +
+ +

CreateInstancedBaseline

+from engine/eiface.h:
+
int CreateInstancedBaseline(int classname, struct entity_state_s *baseline);
+
ENGINE_INSTANCE_BASELINE() +

comments:
+

+ . +
+ +

Cvar_DirectSet

+from engine/eiface.h:
+
void Cvar_DirectSet(struct cvar_s *var, char *value); +

comments:
+

+ . +
+ +

ForceUnmodified

+from engine/eiface.h:
+
void ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char *filename);
+
ENGINE_FORCE_UNMODIFIED() +
+ Forces the client and server to be running with the same version of the + specified file ( e.g., a player model ). Calling this has no effect in + single player. +
+

comments:
+

+ . +
+ +

GetPlayerStats

+from engine/eiface.h:
+
void GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss);
+
PLAYER_CNX_STATS() +

comments:
+

+ . +
+ +

AddServerCommand

+from engine/eiface.h:
+
void AddServerCommand(char *cmd_name, void (*function) (void)); +

comments:
+

+ Registers a new server console command. When the given command string + is typed at the console, the given function will be called. Arguments + for the command can be retrieved in the function with + Cmd_Args, Cmd_Argv, and + Cmd_Argc. +
+ +

Voice_GetClientListening

+from engine/eiface.h:
+
qboolean Voice_GetClientListening)(int iReceiver, int iSender); +
+ For voice communications, set which clients hear each other. NOTE: these + functions take player entity indices (starting at 1). +
+

comments:
+

+ Added in SDK 2.2. +
+ +

Voice_SetClientListening

+from engine/eiface.h:
+
qboolean Voice_SetClientListening)(int iReceiver, int iSender, qboolean bListen); +
+ For voice communications, set which clients hear each other. NOTE: these + functions take player entity indices (starting at 1). +
+

comments:
+

+ Added in SDK 2.2. +
+ +

GetPlayerAuthId

+from engine/eiface.h:
+
const char *GetPlayerAuthId(edict_t *e); +

From Eric Smith <EricS@valvesoftware.com> on hlcoders: +

+ The AuthID is a way for applications/mods to get the Authentication ID + (uniqueID) for a player. The AuthID can be a WonID or a SteamID. The + function I've written returns the AuthID as a string. Calling GetPlayerWONId will still work for Non-Steam + players just like it always has. If applications/mods want to get a + jump start on getting ready to support Steam players, then they can + start using GetPlayerAuthId, which will still work for Non-Steam + players, but it will give the WonID as a string instead of an unsigned + int. +
+

From Eric Smith <EricS@valvesoftware.com> on servertest: +

+ Only clients playing via Steam will have SteamIDs. Clients who are not + using Steam will still have WonIDs (just like they always have). The + server now supports WonIDs\SteamIDs and banning using either of them. + WonIDs have not changed. SteamIDs use the format: STEAM_<#>:<#> where + <#> is replaced by numbers. An example SteamID would be + "STEAM_0:94534". +
+

From Eric Smith <EricS@valvesoftware.com> on hlcoders: +

+ This function will now return the string "BOT" as the AuthID for fake + clients. +
+

comments:
+

+ Added for HL 1109; no SDK update. +
+ +

SequenceGet

+from engine/eiface.h:
+
void *SequenceGet(const char *fileName, const char *entryName); +

comments:
+

+ Added for HL 1xxx; no SDK update. +
+ +

SequencePickSentence

+from engine/eiface.h:
+
void *SequencePickSentence(const char *groupName, int pickMethod, +int *picked); +

comments:
+

+ Added for HL 1xxx; no SDK update. +
+ +

GetFileSize

+from engine/eiface.h:
+
int GetFileSize(char *filename); +

comments:
+

+ Added for HL 1xxx; no SDK update. +
+ +

GetApproxWavePlayLen

+from engine/eiface.h:
+
unsigned int GetApproxWavePlayLen(const char *filepath); +

comments:
+

+ Added for HL 1xxx; no SDK update. +
+ +

IsCareerMatch

+from engine/eiface.h:
+
int IsCareerMatch(void); +

comments:
+

+ Added for HL 1xxx; no SDK update. +
+ +

GetLocalizedStringLength

+from engine/eiface.h:
+
int GetLocalizedStringLength(const char *label); +

comments:
+

+ Added for HL 1xxx; no SDK update. +
+ +

RegisterTutorMessageShown

+from engine/eiface.h:
+
void RegisterTutorMessageShown(int mid); +

comments:
+

+ Added for HL 1xxx; no SDK update. +
+ +

GetTimesTutorMessageShown

+from engine/eiface.h:
+
int GetTimesTutorMessageShown(int mid); +

comments:
+

+ Added for HL 1xxx; no SDK update. +
+ +

ProcessTutorMessageDecayBuffer

+from engine/eiface.h:
+
void ProcessTutorMessageDecayBuffer(int *buffer, int bufferLength); +

comments:
+

+ Added for HL 1xxx; no SDK update. +
+ +

ConstructTutorMessageDecayBuffer

+from engine/eiface.h:
+
void ConstructTutorMessageDecayBuffer(int *buffer, int bufferLength); +

comments:
+

+ Added for HL 1xxx; no SDK update. +
+ +

ResetTutorMessageDecayData

+from engine/eiface.h:
+
void ResetTutorMessageDecayData(void); +

comments:
+

+ Added for HL 1xxx; no SDK update. +
+ + +

+


+ + + diff --git a/doc/html/faq.html b/doc/html/faq.html new file mode 100644 index 0000000..f4f49c9 --- /dev/null +++ b/doc/html/faq.html @@ -0,0 +1,158 @@ + + + + + +Metamod FAQ + + + +

Metamod FAQ +

+ +

+ Please add support for (some) mod. +

+Please see game support +requirements in the documentation. +
+ + +

+ How do I use bots with Metamod? +

+If the bot is not a Metamod plugin, then you will need to tell +Metamod to use your bot as the gamedll, by specifying it on the hlds +command line with the "+localinfo mm_gamedll" option. See the +Metamod docs. See also the +AdminMod docs. +
+ + +

+ The download links give corrupt files. +

+I think what you're observing is that your web client is quietly +uncompressing the file, but not updating the name of the downloaded file to +reflect this. In particular, some web clients will silently decompress +(gunzip) files _without_ removing the ".gz" from the filename, so you'll +end up with a file "metamod_i386.so.gz" which is _really_ +"metamod_i386.so", and so trying to gunzip it will produce an error ("not +in gzip format"). Try running "file" on the resulting file to see what the +OS thinks it is. Or, where you don't have "file" (ie windows), just look +at the file size - it should be pretty indicative of whether the file is +still compressed or not. +
+ + +

+ How do I install Metamod? +

+This is covered briefly in the Metamod +docs. Typically, though, Metamod is installed as part of some major +plugin, like AdminMod. There is +also some discussion of installing Metamod by hand in the AdminMod docs. If you already have Metamod installed and merely want +to update it, this requires only replacing the .so/.dll with the latest +version from the webpage. +
+ + +

+ I'm having trouble with AdminMod. +

+You'll need to ask your AdminMod questions on the AdminMod forums. +
+ + +

+ How do I do (something) in a Metamod plugin? +

+Generally speaking, a Metamod plugin works very much like an Half-Life Game +Mod, since all it's doing is making the same calls to the same SDK that the +Game Mod does. So, the question typically isn't "how do I do this in +Metamod?" but instead "how do I do this in an Half-Life Mod?", and is best +asked in a HL SDK Programming forum/mailinglist (see related links +and especially Botman's MOD FAQ). +Once you figure out how it would normally be done in a Game Mod, figuring +out how to do it in Metamod is relatively straightforward. +

+However, if you have questions on how to convert a piece of code from HLmod +to Metamod plugin, then I can provide some pointers, or you can ask on the +Metamod mailing list. +And of course, if you have questions about things in the code specific to +Metamod (ie things mentioned in the Metamod Coding +docs) feel free to ask me or on the mailing list. +

+ + +

+ Is there a tutorial or example of how to write a Metamod plugin? +

+The sourcecode includes a couple of plugins that can be used as examples. +The "stub" plugin is the bare basics of what a plugin needs. The "trace" +plugin provides an example of hooking _every_ SDK function. The "wdmisc" +plugin provides a couple of basic useful features. You can also look at +several of the other plugins out there for more examples. +

+Note that the example plugins in the Metamod sourcecode show how to use +Metamod to interface with Half-Life code, but they mostly assume you +already know how to write Half-Life code. If you need examples or info on +how to write Half-Life code itself, you'll need to go look through the HL +SDK programming websites (see related links +and Botman's MOD FAQ). +

+ + +

+ I have (or know of) a Metamod plugin not listed on the webpage. +

+Send me the information about the plugin (name, author, description, URL), +and I'd be happy to provide a link from the webpage. +
+ + +

+ I'm having trouble compiling under MSVC. +

+Please note that I do not use MSVC, so I can't help a lot with using that +compiler. I do all my development under linux, using gcc for linux +binaries and mingw32 for windows +binaries. The sourcecode does include an MSVC project file for Metamod, as +well as a project file for the stub plugin, both mostly as examples. They +should work, and indeed did work the last time I dug up MSVC to test +them. That said, there are a few folks on the Metamod mailing list that +do use MSVC, so you might find some assistance there. +
+ + +

+ If I create a Metamod plugin, does it have to be open source? +

+Generally speaking, yes. The way the GPL is interpreted, plugins of a GPL +program need to be also GPL. See also the FAQ entry on the GNU site about +plugins of a GPL program. +
+ + +

+ How about a port of Metamod to other engines like Q3, Unreal, etc? +

+I haven't looked into it myself, but several folks on the AdminMod team +(from which Metamod was derived) had looked at porting to other games like +Q3 and UT, and determined that those engines either didn't provide the +necessary API hooks, or that they already provided a suitable method for +extending functionality. So, I wouldn't expect to see a version of Metamod +for those. Perhaps for some other future engines, although I believe most +modern engines are now providing their own method for extensions or +plugins, so that a third-party solution like Metamod wouldn't be necessary. +

+If Half-Life 2 ever sees the light of day, I expect I'd look seriously at +porting to that - unless, of course, Valve ends up providing their +own plugin framework themselves. :) +

+ +

+


+ + + diff --git a/doc/html/gamesupport.html b/doc/html/gamesupport.html new file mode 100644 index 0000000..60aa7f2 --- /dev/null +++ b/doc/html/gamesupport.html @@ -0,0 +1,17 @@ + + + + + +Metamod Adding Game/Mod Support + + + +

Adding Game/Mod Support +

+ +Metamod-P already supports your Mod. + +
+ + diff --git a/doc/html/links.html b/doc/html/links.html new file mode 100644 index 0000000..9e57593 --- /dev/null +++ b/doc/html/links.html @@ -0,0 +1,114 @@ + + + + + +Metamod Related Links + + + +

Related links +

+ +Here's a list of links, other sites, and information I found useful when +working on Metamod: + + + +

Books

+ +And here are books I picked up that I found useful as well: + + +

+


+ + + diff --git a/doc/html/maillist.html b/doc/html/maillist.html new file mode 100644 index 0000000..6b24383 --- /dev/null +++ b/doc/html/maillist.html @@ -0,0 +1,62 @@ + + + + + +Metamod Mailing lists + + + +

Mailing lists +

+ +I've created a couple of lists on YahooGroups (formerly egroups (formerly +onelist)): + +
    +
  • metamod-announce for announcements of new versions and plugins +
  • metamod for + questions, support, discussion, etc +
+ +There are simple subscribe forms below. + + + + + + + + +
+ Subscribe to metamod-announce
+
+ groups.yahoo.com/metamod-announce +
+ +
+ +

+ + + + + + + + +
+ Subscribe to metamod
+
+ groups.yahoo.com/metamod +
+ +
+ +

+


+ + + diff --git a/doc/html/metamod.html b/doc/html/metamod.html new file mode 100644 index 0000000..a791639 --- /dev/null +++ b/doc/html/metamod.html @@ -0,0 +1,696 @@ + + + + + +Using Metamod + + + +

Using Metamod +

+ + +

Client Commands +

+ +Similar to the server console interface, clients +can also issue commands to Metamod, of the following form: +
    + +
  • meta version - displays version information about the + Metamod instance currently running on the server, ie: +

    + Metamod v1.21p37 2013/05/30 (5:13) +
    by Will Day +
      http://www.metamod.org/ +
     Patch: Metamod-P (mm-p) v37 +
     by Jussi Kivilinna +
       http://koti.mbnet.fi/axh/ +
    compiled: Feb 18 2013, 11:53:27 EET (optimized) +
    + +

  • meta list - displays information about the list of + currently running plugins, ie: +

    + Currently running plugins: +
    [ 1] Trace HLSDK API, v1.XX.93, 2003/02/17, by Will Day <willday@metamod.org>, see http://www.metamod.org/ +
    [ 2] Adminmod, v2.50.56 (MM), Jul 13 2003, by Alfred Reynolds <alfred@valvesoftware.com>, see http://www.adminmod.org/ +
    2 plugins +
    + +

+ + +

Client Cvars +

+ +Also available to client browser applications is a cvar +metamod_version that should report the version of Metamod +running on the server, ie: +

+

"metamod_version" is "1.21p37" + + +

Installation +

+ + +If you want to install Metamod by hand, here's what you have to do: +
    + +

  • Install the Metamod library (.dll for win32, or .so for linux) to a +directory under your game directory. For instance, if you were +running Counter-Strike, under win32 you might want have: + +

    +	half-life/cstrike/addons/metamod/dlls/metamod.dll
    +
    + +

    If a directory you want doesn't exist, create it. + +

  • Edit the "liblist.gam" file in your game directory, +replacing the game dll filename with the Metamod dll filename. For +instance with Counter-Strike, you would change: +

    +
    gamedll "dlls/mp.dll" +
    gamedll_linux "dlls/cs.so" +
    +to: +
    +
    gamedll "addons/metamod/dlls/metamod.dll" +
    gamedll_linux "addons/metamod/dlls/metamod.so" +
    + +

    Note that it's only really necessary to change the line corresponding +to your OS (win32 or linux); you can leave the other line unchanged, or you +can change it - it doesn't matter. + +

  • To load plugins at game startup, you'll need to create a "plugins.ini" file containing a list of the plugins +you want to load. + +
+ +


+

Configuration +

+ +Metamod has several ways to provide config options, partially because it +started with one method and then added other methods, but also because one +method can be more convenient than the other, varying with the situation. + +

+Generally speaking, the two methods of providing configuration +information to Metamod are: +

    +
  • on the command line, via +localinfo + arguments to hlds. +
  • as the contents of some file that Metamod reads and parses. +
+ +

+The confusing part can come when the pathnames to some of the config +files can be specified via command line options - or indeed, when the +pathnames to some config files can be specified in other +config files. + +

+In any case, here are the various config options and config files Metamod +uses, (listed in order of priority), where "$gamedir" +indicates the game directory, ie "cstrike": + +

    +
  • +localinfo mm_configfile + <file> + +

    +

  • +localinfo mm_pluginsfile + <file> +
  • config.ini option: plugins_file + <file> +
  • $gamedir/addons/metamod/plugins.ini +
  • $gamedir/metamod.ini + +

    +

  • $localinfo mm_execcfg + <file> +
  • config.ini option: exec_cfg + <file> +
  • $gamedir/addons/metamod/exec.cfg +
  • $gamedir/metaexec.cfg + +

    +

  • $localinfo mm_gamedll + <file> +
  • config.ini option: gamedll + <file> +
  • $gamedir/metagame.ini + -- No longer supported. +
+ + +


+

File: plugins.ini +

+ +Default location: $gamedir/addons/metamod/plugins.ini, ie +"cstrike/addons/metamod/plugins.ini". + +

Plugins are described in a file "plugins.ini" and each line describes a +plugin to load: + +

+
<platform> <filepath> [<description>] +
+ +

Fields are whitespace delimited (tabs/spaces). + +

    +
  • Platform is a keyword, either "linux" or + "win32". + +

  • Filepath is a path to the DLL/so file. Relative paths + are from the game dir; absolute paths are also valid. Paths should use + unix-style forward slashes (/) and not backward + slashes (\), even on windows platforms. + +

    Also, the filepath (once expanded to full path name) is expected to + be unique within the list of plugins. Thus, a plugin with a + fullpathname matching that of a previous plugin is considered a + duplicate, and is not loaded. + +

  • Description is an optional description of the plugin, used + in place of the plugin's internal name in log messages and console + output. Whitespace in the description is allowed; + quoting is unnecessary. +
+ +Comments are recognized at only the beginning of a line, and +can be in either shell style ("#") or c++ style ("//"). + +

For instance, in "cstrike/addons/metamod/plugins.ini" +these are all valid lines: + +

+    // linux    dlls/mybot.so
+    # win32     dlls/mybot-old.dll         Mybot old
+    win32       dlls/mybot.dll             Mybot current
+    linux       /tmp/stub_mm_i386.so
+    win32       /tmp/stub_mm_i386.dll
+    linux       ../dlls/trace_mm_i386.so
+    win32       ../dlls/trace_mm_i386.dll
+    linux       dlls/admin_MM_i386.so
+    win32       dlls/admin_MM_i386.dll
+
+ +

Note that order in the plugins.ini file is significant. +Plugins are loaded and accessed in the order specified, so ordering +can be important, depending on the plugin(s). + +

The file is re-read at changelevel, as well as on demand (via +"meta refresh" console command; see below). When the file +is re-read, it will: + +

    +
  • load any new plugins added to the file + +
  • unload any plugins that have been deleted from the file. This is + only applicable to plugins loaded from the inifile. If the + plugin was loaded from the console, it will not be unloaded during a + refresh, whether it's in the inifile or not. + +
  • reload any plugin whose file on disk has been updated since it was + loaded. Note this appears to be only useful under linux, as under Windows + you cannot rename or overwrite an open DLL, so it doesn't look a loaded + plugin could ever have a newer file on disk. Oh well. +
+ +

The game dll is auto-detected, along the same lines AdminMod operated +(looking at the "gamedir"); see "mm_gamedll" below if you want to use a +"bot" DLL. + +

You can override the name of this file by specifying it via the +localinfo field "mm_pluginsfile". + +

For compatibility with previous versions, Metamod will also look for a +file "metamod.ini" under the gamedir, ie "cstrike/metamod.ini". + + +


+

File: config.ini +

+ +Default location: $gamedir/addons/metamod/config.ini, ie +"cstrike/addons/metamod/config.ini". + +

+This contains basic config information, at the moment duplicating most of +the +localinfo variables, but allowing for more +flexible expansion of config options in the future. Also, it provides +somewhat more reliable options setting, since +localinfo munges some +argument values (in particular, pathnames with leading dots, ie +"../dlls/blah.dll"). + +

+Basic format is: + +

+
<option> <value> +
+ +

Fields are whitespace delimited (tabs/spaces). Comments are recognized +at only the beginning of a line, and can be in either shell +style ("#") or c++ style ("//"). + +The following is a list of currently recognized options, their defaults, +and examples of usage: + +

    + +

  • debuglevel <number> +

    where <number> is an integer, 0 and up. +
    Sets the initial debugging level for metamod (same as cvar + "meta_debug"). +
    Default is normally 0. If hlds is run with "-dev", default is 3. +
    Overridden by: +localinfo mm_debug <number> +
    Examples: +
    debuglevel 0 +
    debuglevel 42 + +

  • gamedll <path> +

    where <path> is an absolute path, or a path relative to + the gamedir. +
    Overrides the auto-detected gamedll, in particular for bots. +
    Default is empty, with gamedll being auto-recognized based on the + gamedir. +
    Overridden by: +localinfo mm_gamedll <number> +
    Examples: +
    gamedll dlls/hl.dll +
    gamedll ../podbot/podbot.dll +
    gamedll /home/bots/dlls/mybot.dll + +

  • plugins_file <path> +

    where <path> is an absolute path, or a path relative to + the gamedir. +
    Overrides the default filename containing the MM plugins to load. +
    Default is "addons/metamod/plugins.ini". +
    Overridden by: +localinfo mm_pluginsfile <number> +
    Examples: +
    plugins_file cfg/clanmode.ini +
    plugins_file ../private.ini +
    plugins_file /home/half-life/testing.ini + +

  • exec_cfg <path> +

    where <path> is a path relative to the gamedir. + NOTE! This cannot be an absolute path, as hlds will + not "exec" absolute pathnames. +
    Overrides the default filename containing hlds commands to run + just after loading Metamod. +
    Default is "addons/metamod/exec.cfg". +
    Overridden by: +localinfo mm_execcfg <number> +
    Examples: +
    exec_cfg configs/debugging.cfg +
    exec_cfg ../clan/match.cfg + +

  • autodetect <yes/no> +

    Setting to disable or enable autodetection of gamedll. Extra feature for Metamod+All-Mod-Support Patch. +
    Default is "yes". +
    Overridden by: +localinfo mm_autodetect <yes/no> + +

  • clientmeta <yes/no> +

    Setting to disable or enable Metamod's client commands, 'meta list' and 'meta version'. Extra setting for Metamod+All-Mod-Support Patch. +
    Default is "yes". +
    Overridden by: +localinfo mm_clientmeta <yes/no> + +

+ +

You can override the name of this file by specifying it via the +localinfo field "mm_configfile". + + +


+ +

File: exec.cfg +

+ +Default location: $gamedir/addons/metamod/exec.cfg, ie +"cstrike/addons/metamod/exec.cfg". + +This is necessary for plugins that need to have settings specified prior +to early API routines like ServerActivate, since autoexec.cfg is +read too early and server.cfg is read to late. In particular, I +found this necessary for the Trace plugin, in order to trace routines like +RegUserMsg which are called during ServerActivate. + +

You can override the name of this file by specifying it via the +localinfo field "mm_execcfg". + +

For compatibility with previous versions, Metamod will also look for a +file "metaexec.cfg" under the gamedir, ie "cstrike/metaexec.cfg". + + +


+ +

file: metagame.ini +

+ +NOTE! This file is no longer supported! -- use instead the ++localinfo field +"mm_gamedll" or the config.ini option gamedll. + + +


+ +

Commandline option: +localinfo +

+ +Several of Metamod's configuration options can be specified by the +"+localinfo" facility on the hlds command line. This is similar to the +"setinfo" console command, where the syntax is: + +
+
+localinfo <field> <value> +
+ +Current localinfo fields recognized by Metamod: +
    + +

  • mm_configfile Specifies the + file that lists config options, instead of using the file config.ini. The <value> + should be the pathname of the config file, either absolute path or + path relative to the gamedir. + +

  • mm_pluginsfile Specifies a + file that lists the Metamod plugins to load, instead of using the file plugins.ini. The <value> + should be the pathname of the plugins file, either absolute path or + path relative to the gamedir. + +

  • mm_execcfg Specifies a file + that contains cvar or other configs to be exec'd after loading the + plugins, instead of using the file exec.cfg. + The <value> should be the pathname of the exec + file, either absolute path or path relative to the gamedir. + +

  • mm_autodetect Specifies if 'autodetect of gamedll' should be enabled + or disabled. It's enabled by default. This is extra feature of + Metamod+All-Mod-Support Patch. + +

  • mm_clientmeta Specifies if Metamod's client commands should be enabled + or disabled. It's enabled by default. This is extra setting of + Metamod+All-Mod-Support Patch. + +

  • mm_gamedll Specifies a game or Bot + DLL to be used instead of the normal gameDLL. The + <value> should be the pathname of the DLL, + either absolute path or path relative to the gamedir. + +

    This replaces using the metagame.ini + file. With previous versions of AdminMod (2.10 and earlier), this same + functionality was provided by the file "admin.ini". + +

  • mm_debug Specifies an initial + meta_debug value. + +
+ +

Note that each localinfo field can have only one value. If +specified more than once on the command line, only the last one will +be recognized. (In particular, trying to use mm_gamedll to load multiple +dll-style bots will not work. In a case like that, the multiple +dll's must be chained together). + +

Some examples are: +

+	./hlds_run -game cstrike +localinfo mm_pluginsfile mylist.ini
+	./hlds_run -game cstrike +localinfo mm_execcfg mysettings.cfg
+	./hlds_run -game cstrike +localinfo mm_gamedll dlls/pod_bot.so
+	./hlds_run -game cstrike +localinfo mm_debug 7
+
+ +

Note, paths should use unix-style forward slashes (/) and +not backward slashes (\), even on windows platforms. + + +


+ +

Commands +

+ +

All console command functionality is provide by a single command "meta", +with multiple sub-commands: + +

+   usage: meta <command> [<arguments>]
+   valid commands are:
+      version                - display Metamod version info
+      list                   - list plugins currently loaded
+      cmds                   - list console cmds registered by plugins
+      cvars                  - list cvars registered by plugins
+      refresh                - load/unload any new/deleted/updated plugins
+      config                 - show config info loaded from config.ini
+      load <name>            - find and load a plugin with the given name
+      unload <plugin>        - unload a loaded plugin
+      reload <plugin>        - unload a plugin and load it again
+      info <plugin>          - show all information about a plugin
+      pause <plugin>         - pause a loaded, running plugin
+      unpause <plugin>       - unpause a previously paused plugin
+      retry <plugin>         - retry a plugin that previously failed its action
+      clear <plugin>         - clear a failed plugin from the list
+      force_unload <plugin>  - forcibly unload a loaded plugin
+      require <plugin>       - exit server if plugin not loaded/running
+

+ +where <plugin> can be either the plugin index number, or a non-ambiguous prefix +string matching description or file. + +

Also, a single cvar is available: +

+   meta_debug       - set debugging level
+
+ +

For instance with: + +

+  Currently loaded plugins:
+        description       stat pend  file               vers    src  load  unlod
+   [ 1] Trace HLSDK API   RUN   -    mm_trace_i386.so   v0.90   ini  ANY   Pause
+   [ 2] adminmod          RUN   -    admin_MM.so        v2.11   ini  Start Start
+   [ 3] stub              RUN   -    mm_stub_i386.so    v0.90   ini  ANY   Pause
+  2 plugins, 2 running
+

+ +

You could then do any of the following to unload the API Trace plugin: +

+   meta unload 1
+   meta unload trace
+   meta unload mm_trace
+
+ + +
+ +

Plugin Loading/Unloading Process +

+ +Through the process of loading and unloading, a plugin can be in one of +several different states ('stat' column in the 'meta list' output): + +
    +
  • BADFILE - The plugin file couldn't be found, or it + doesn't appear to be a valid Metamod plugin. +
  • OPENED - The plugin file was found, and is a valid + Metamod plugin, and is ready to be loaded. +
  • FAILED - The plugin file attempted to load or unload, + but couldn't complete for some reason. +
  • RUNNING - The plugin file was loaded and is active + and running. +
  • PAUSED - The plugin file was loaded, but has been + temporarily disabled. +
+ +Also through the operation process, a plugin can have a pending "action" to +next take (indicated by the 'pend' column in the 'meta list' output), and +can be one of: + +
    +
  • LOAD - Open and look at the plugin file. +
  • ATTACH - Attach the plugin to the running game; ie + activate it +
  • UNLOAD - Remove the plugin from the running game and + close the file +
  • RELOAD - Unload/close and re-open/load the plugin, + for instance when the plugin file has changed. +
+ + +
+ +

Example Output +

+

Here's some other example output: + +

+   meta info admin
+            name: adminmod
+            desc: Adminmod
+          status: running
+          action: none
+        filename: dlls/admin_MM.so
+            file: admin_MM.so
+        pathname: /home/willday/test/cstrike/dlls/admin_MM.so
+           index: 3
+          source: ini file
+        loadable: at server startup
+      unloadable: at server startup
+         version: 2.11
+            date: 2001/02/04
+          author: Alfred Reynolds <alfred@mazuma.net.au>
+             url: http://www.adminmod.org/
+          logtag: ADMIN
+     last loaded: Mon Feb  5 02:06:34 2001
+   DLLAPI functions:
+      GameDLLInit
+      DispatchThink
+      ClientConnect
+      ClientCommand
+      ClientUserInfoChanged
+      ServerActivate
+   6 functions (dllapi)
+   No DLLAPI-Post functions.
+   No NEWAPI functions.
+   No NEWAPI-Post functions.
+   No Engine functions.
+   No Engine-Post functions.
+   Registered commands:
+      admin_command
+   1 commands
+   Registered cvars:                      float value  string value
+      users_file                             0.000000  users.ini
+      maps_file                              0.000000  mapvote.txt
+      default_access                         1.000000  1
+      ips_file                               0.000000  0
+      reserve_slots                          1.000000  1
+      reserve_slots_msg                      0.000000  0
+      admin_debug                            1.000000  1
+      password_field                         0.000000  admin_password
+      alarm_message                          0.000000  0
+      alarm_time                             0.000000  0
+      use_regex                              1.000000  1
+      models_password_field                  0.000000  0
+      models_file                            0.000000  models.ini
+      models_kick_msg                        0.000000  Invalid model
+      script_file                            0.000000  cstrike/dlls/admin.amx
+      help_file                              0.000000  admin_help.txt
+      vote_freq                            360.000000  360
+      encrypt_password                       1.000000  1
+      pretty_say                             1.000000  1
+      admin_mod_version                      2.110000  2.11
+      reserve_type                           1.000000  1
+      map_ratio                             60.000000  60
+      kick_ratio                            75.000000  75
+      words_file                             0.000000  0
+      password_timeout                    1800.000000  1800
+      file_access_read                       0.000000  0
+      file_access_write                      0.000000  0
+      public_slots_free                     20.000000  20.000000
+      allow_client_exec                      0.000000  0
+      admin_balance_teams                    0.000000  0
+   30 cvars
+
+   meta cmds
+   Registered plugin commands:
+          plugin              command
+    [  1] API trace           trace_version
+    [  2] API trace           trace
+    [  3] API trace           untrace
+    [  4] API trace           showtrace
+    [  5] Adminmod            admin_command
+   5 commands, 5 available
+
+   meta cvars
+   Registered plugin cvars:
+          plugin      cvar                   float value  string value
+    [  1] API trace   trace_debug               3.000000  3.000000
+    [  2] API trace   trace_dllapi              8.000000  8
+    [  3] API trace   trace_newapi              0.000000  0
+    [  4] API trace   trace_engine              8.000000  8
+    [  5] Adminmod    users_file                0.000000  users.ini
+    [  6] Adminmod    maps_file                 0.000000  mapvote.txt
+    [  7] Adminmod    default_access            1.000000  1
+    [  8] Adminmod    ips_file                  0.000000  0
+    [  9] Adminmod    reserve_slots             1.000000  1
+    [ 10] Adminmod    reserve_slots_msg         0.000000  0
+    [ 11] Adminmod    admin_debug               1.000000  1
+    [ 12] Adminmod    password_field            0.000000  admin_password
+    [ 13] Adminmod    alarm_message             0.000000  0
+    [ 14] Adminmod    alarm_time                0.000000  0
+    [ 15] Adminmod    use_regex                 1.000000  1
+    [ 16] Adminmod    models_password_fiel      0.000000  0
+    [ 17] Adminmod    models_file               0.000000  models.ini
+    [ 18] Adminmod    models_kick_msg           0.000000  Invalid model
+    [ 19] Adminmod    script_file               0.000000  cstrike/dlls/admin.amx
+    [ 20] Adminmod    help_file                 0.000000  admin_help.txt
+    [ 21] Adminmod    vote_freq               360.000000  360
+    [ 22] Adminmod    encrypt_password          1.000000  1
+    [ 23] Adminmod    pretty_say                1.000000  1
+    [ 24] Adminmod    admin_mod_version         2.110000  2.11
+    [ 25] Adminmod    reserve_type              1.000000  1
+    [ 26] Adminmod    map_ratio                60.000000  60
+    [ 27] Adminmod    kick_ratio               75.000000  75
+    [ 28] Adminmod    words_file                0.000000  0
+    [ 29] Adminmod    password_timeout       1800.000000  1800
+    [ 30] Adminmod    file_access_read          0.000000  0
+    [ 31] Adminmod    file_access_write         0.000000  0
+    [ 32] Adminmod    public_slots_free        20.000000  20.000000
+    [ 33] Adminmod    allow_client_exec         0.000000  0
+    [ 34] Adminmod    admin_balance_teams       0.000000  0
+   34 cvars, 34 available
+
+   meta unload stub
+   Unloaded plugin 'Stub plugin'
+   Currently loaded plugins:
+         description       stat pend  file               vers   src  load  unlod
+    [ 1] Trace HLSDK API   RUN   -    mm_trace_i386.so   v0.90  ini  ANY   Pause
+    [ 2] adminmod          RUN   -    admin_MM.so        v2.11  ini  Start Start
+   2 plugins, 2 running
+
+   meta load stub
+   Loaded plugin 'stub' successfully
+   Currently loaded plugins:
+         description       stat pend  file               vers   src  load  unlod
+    [ 1] Trace HLSDK API   RUN   -    mm_trace_i386.so   v0.90  ini  ANY   Pause
+    [ 2] adminmod          RUN   -    admin_MM.so        v2.11  ini  Start Start
+    [ 3] stub              RUN   -    mm_stub_i386.so    v0.90  cmd  ANY   Pause
+   3 plugins, 3 running
+
+ +

+


+ + + diff --git a/doc/html/newapi_notes.html b/doc/html/newapi_notes.html new file mode 100644 index 0000000..375c240 --- /dev/null +++ b/doc/html/newapi_notes.html @@ -0,0 +1,62 @@ + + + + + +HLSDK NEWAPI Notes + + + +

HLSDK NEWAPI Notes +

+ +
+ + +NOTE: No examples of these found in SDK... + +

+ +


OnFreeEntPrivateData

+
void OnFreeEntPrivateData(edict_t pEnt);

+from engine/eiface.h:
+

+ Called right before the object's memory is freed. Calls its destructor. +
+

comments:
+

+ See also Ken Birdwell on constructors, from the HLCoders list. +
Added in SDK 2.0. +
+ +

GameShutdown

+
void GameShutdown(void);

+

comments:
+

+ Added in SDK 2.0. +
+ +

ShouldCollide

+
int ShouldCollide(edict_t *pentTouched, edict_t *pentOther);

+from kenb@valvesoftware.com, via HLCoders:
+

+ ..a hook that can override if any two entities should collide + when they try to pass through each other. +
+

comments:
+

+ Mugsy from DoD indicates that the return value for normal operation is 1. +
Added in SDK 2.0. +
+ +

+


+ + + diff --git a/doc/html/release_notes.html b/doc/html/release_notes.html new file mode 100644 index 0000000..6fc26d4 --- /dev/null +++ b/doc/html/release_notes.html @@ -0,0 +1,127 @@ + + + + + +Metamod Release Notes + + + +

Release Notes +

+ + +

Major changes with Metamod 1.17 +

+ +
    + +

  • New cvar "metamod_version" that can be queried from +client game browsers. + +

  • New console commands available to clients (much like the existing +server console commands): + +

      +
    • "meta version" prints out version information + (date, compile type, etc). +
    • "meta list" shows a list of the plugins running on + the server (name, author, version, etc). +
    + +

  • New file config.ini to provide a +more reliable and flexible method of specifying configuration options. +At the moment, the recognized options mirror those from +localinfo, ie: + +

    +

      +
    • debuglevel <number> +
    • gamedll <path> +
    • plugins_file <path> +
    • exec_cfg <path> +
    • autodetect <yes/no> +
    • clientmeta <yes/no> +
    + +

    Default path is "addons/metamod/config.ini" but can be +overridden with "+localinfo mm_configfile". + +

    Also, new console command "meta config" to display this +information. + +

  • New console command "meta require" to force the +server to exit if the specified plugin isn't loaded/running. Intended for +use in server.cfg or metaexec.cfg, to keep the server from starting up if +desired plugins don't load. For example: + +

    +

      +
    • meta require adminmod +
    • meta require 1 +
    + +

    The former requires that a plugin with the substring "adminmod" is found +loaded and running. The latter requires that the plugin in slot 1 is +loaded and running. + +

  • If an override gamedll is specified and found to be invalid or +missing, Metamod will now exit with an appropriate error message, rather +than just falling back to the auto-detected gamedll. This should provide +more immediate and useful feedback, and help prevent some confusion. + +
+ +

+


+ + +

Incompatible changes with Metamod 1.13 +

+ +
    + +
  • Config file metagame.ini is no longer supported. This +file was deprecated in Metamod 1.08 (2001/06/16). Use instead the "+localinfo mm_gamedll" option. + +
+ + + +

Major changes with Metamod 1.13 +

+ +
    + +
  • New config file names and locations, per the Addon +Development Standard rev 1.00, developed on the hlds_apps +list. + +

    Default config file locations are now: +

      +
    • $gamedir/addons/metamod/plugins.ini +
    • $gamedir/addons/metamod/exec.cfg +
    + +

    Previous config file locations are also supported for backwards + compability: + +

      +
    • $gamedir/metamod.ini +
    • $gamedir/metaexec.cfg +
    + +

    Note that the pathnames in plugins.ini are unchanged, and are still + relative to the gamedir. + +

+ +

+


+ + + diff --git a/doc/html/supportedmods.html b/doc/html/supportedmods.html new file mode 100644 index 0000000..fe8322e --- /dev/null +++ b/doc/html/supportedmods.html @@ -0,0 +1,35 @@ + + + + + +Metamod Supported Mods/Games + + + + +

Supported Mods/Games +

+
+ +Metamod includes support for the following mods, with version and last +update if known. + +

+To get support added for a new Mod, or for an updated version of a Mod, see +Adding game support. + +

+ + + + + +
Name Version Last update Ent list Comments
ALL MODS SUPPORTED BY
+    All-Mod-Support PATCH
+    By Jussi Kivilinna
+    http://koti.mbnet.fi/axh/ +
NONE
+ + + diff --git a/doc/html/trace.html b/doc/html/trace.html new file mode 100644 index 0000000..eb24ba6 --- /dev/null +++ b/doc/html/trace.html @@ -0,0 +1,88 @@ + + + + + +Metamod TraceAPI Plugin + + + +

TraceAPI plugin +

+ +

This was originally intended as a (more or less) complete example of a +Metamod plugin. It catches every call available to it (dll +routines both before and after the game, as well as engine functions both +before and after the engine). + +

Because it catches every routine, I figured I'd give it the ability to +log when given routines are called, so it became an "api tracing" plugin. +:) + +

This can actually be useful for tracking the operation of the HL +engine, as well as that of a particular HL game mod. + +

It recognizes the following server cvars: + +

+   // Tracing debug levels; higher values log increasingly frequent routines.
+   // Currently 0-50.  See "api_info.cpp" for the debug levels of various
+   // functions.
+
+   // Trace level for dllapi routines.
+   trace_dllapi
+
+   // Trace level for "new" dllapi routines.
+   trace_newapi
+
+   // Trace level for engine functions.
+   trace_engine
+
+   // Enable unlimited trace logging.  By default (as of v1.06), it only
+   // logs _one_ trace message per second, to keep from overwhelming the
+   // server.  Set to "1" to enable unlimited logging.  (Default "0")
+   trace_unlimit
+
+   // General debug level, independent of trace levels.  Not currently used.
+   trace_debug
+
+
+ +

and the following server commands: + +

+   // Enable tracing of a given routine, independent of "trace_*" level.
+   // See the list of routine names in "api_info.cpp".  Case is insignificant.
+   trace set <APIroutine>
+
+   // Disable tracing of a given routine, iff previously enabled with "trace".
+   // Doesn't affect routines being logged via "trace_*" level.
+   trace unset <APIroutine>
+
+   // Show the routines being traced.
+   trace show
+
+   // List the various routines that can be traced.
+   trace list dllapi
+   trace list newapi
+   trace list engine
+   trace list all
+
+   // Prints out version/date/etc.
+   trace version
+
+ +

Note the information it logs on each routine invocation is, at the +moment, relatively minimal. I included information that seemed obvious +(args for a ClientCommand, etc), and I've added info for other +routines as I've come across a need. Most routines I still know too little +about to log any particular information (CreateBaseline, etc). +Feel free to add information that you're interested in to the log messages +in the routines; the examples should be pretty self-explanatory. I'd be +interested in knowing as well, for adding it to the distribution code. + +

+


+ + + diff --git a/doc/html/wdmisc.html b/doc/html/wdmisc.html new file mode 100644 index 0000000..4c919fe --- /dev/null +++ b/doc/html/wdmisc.html @@ -0,0 +1,48 @@ + + + + + +Metamod WDMisc Plugin + + + +

WDMisc plugin +

+ +

This is a simple plugin that I use as a testbed for various features +and other things I need to try from a plugin. + +

It currently provides two features: + +

    + +

  • a cvar "bounce" that, if set to 1, will exit the server at map + change. I use this when I need to shutdown or the server, and don't + want to kill it in the middle of a map, nor watch the server constantly + until the timelimit expires. + +

  • it prints a centersay to all the players whenever someone in + Counter-Strike plants the bomb. This was done basically as a + proof-of-concept for catching certain game-events that aren't otherwise + triggered by the HL API. It works only by examining every log message + that the server generates, and checking to see if it includes the string + indicating the particular event in question (in this case + "Planted_The_Bomb"). + +

    Although this works, it is really a rather poor + solution to the problem, as it assumes a lot of + string-compares, which can seriously degrade the performance of + the server. I did try to take as many short-cuts as reasonable in the + code, to decrease the amount of string-comparing going on, which makes + the code a bit less readable than doing just a "strstr" on the log line. + +

+ +Other features to be added/removed in the future... + +

+


+ + + diff --git a/doc/plugins.ini b/doc/plugins.ini new file mode 100644 index 0000000..c7d7458 --- /dev/null +++ b/doc/plugins.ini @@ -0,0 +1,35 @@ +// vim: set ft=c : +// +// Format is as follows: +// +// +// Fields are whitespace delimited (tabs/spaces). +// +// - Platform must be either "linux" or "win32". +// - Path can be either an absolute pathname, or a pathname relative to the +// gamedir. Paths should use unix-style forward slashes (/) rather than +// windows-style backslashes (\), even on windows platforms. Also, the +// path (once expanded to full path name) is expected to be unique within +// the list of plugins. Thus, a plugin with a fullpathname matching that +// of a previous plugin is considered a duplicate, and is not loaded. +// - Description is optional, and replaces the plugin's internal name in +// console output and log messages. +// +// Comments are either c++ style ("//") or unix shell style ("#"), and +// can appear ONLY at the beginning of a line. +// +// Note that the plugins are loaded and accessed in the order specified, so +// ordering CAN be important, depending on the plugin(s). +// +// The following are examples of valid lines. +// + +// linux dlls/mybot.so +# win32 dlls/mybot-old.dll Mybot old +win32 dlls/mybot.dll Mybot current +linux /tmp/stub_mm_i386.so +win32 /tmp/stub_mm_i386.dll +linux ../dlls/trace_mm_i386.so +win32 ../dlls/trace_mm_i386.dll +linux dlls/admin_MM_i386.so +win32 dlls/admin_MM_i386.dll diff --git a/doc/txt/Index.txt b/doc/txt/Index.txt new file mode 100644 index 0000000..40f558d --- /dev/null +++ b/doc/txt/Index.txt @@ -0,0 +1,27 @@ +Metamod +=-=-=-= + +Metamod is a plugin/DLL manager that sits between the Half-Life Engine and +an HL Game mod, allowing the dynamic loading/unloading of mod-like DLL +plugins to add functionality to the HL server or game mod. + +-------------------------------------------------------------------------- + +See metamod.org (metamod.org/) for news, downloads, and plugin links. + +-------------------------------------------------------------------------- + +Metamod Docs Other HLDS info + + - About metamod * SDK DLLAPI Notes + - FAQ * SDK NEWAPI Notes + - Using metamod * SDK Engine Notes + - Release Notes + - Game/Mod support * Related links & books + - Trace Plugin * Mailing lists + - WDMisc Plugin + - Coding for metamod + +-------------------------------------------------------------------------- + + diff --git a/doc/txt/a.txt b/doc/txt/a.txt new file mode 100644 index 0000000..cb6dccb --- /dev/null +++ b/doc/txt/a.txt @@ -0,0 +1,19 @@ +Supported Games +=-=-=-=-=-=-=-= + +Metamod includes support for the following mods, with version and last +update if known. + +To get support added for a new Mod, or for an updated version of a Mod, +see Adding game support. + ++-------------------------------------------------------------------------+ +| Name | Version | Last | Ent | Comments | +| | | update | list | | +|---------------------------------+----------+--------+--------+----------| +| ALL MODS SUPPORTED BY | ALL | | NONE | | +| All-Mod-Support PATCH | | | | | +| By Jussi Kivilinna | | | | | +| http://koti.mbnet.fi/axh/ | | | | | ++---------------------------------+----------+--------+--------+----------+ + diff --git a/doc/txt/about.txt b/doc/txt/about.txt new file mode 100644 index 0000000..cfef91c --- /dev/null +++ b/doc/txt/about.txt @@ -0,0 +1,35 @@ +Metamod +=-=-=-= + +a Half-Life utility mod + + meta /me't*/ or /may't*/ or (Commonwealth) /mee't*/ adj.,pref. + [from analytic philosophy] One level of description up. + +The purpose of MetaMod is to function "one level up" from the normal +Half-Life game mod DLL. Sitting between the mod game DLL and the Half-Life +engine/binary, it intercepts the function calls between the two, with the +option of passing them along untouched, as well as passing them on to as +any number of _additional mod-like DLLs_. + +Thus, you can actually have multiple "mod-like" DLLs in operation at one +time. I say "mod-like" because these additional DLLs (we'll call them +"plugins") are not intended to provide a full "game"; that functionality +is still provided by the "game dll". However, these plugins can _add to_ +or _modify the functionality provided by the game dll, or by the engine +itself - for instance, adding new server commands, or new client commands, +or even disabling commands built into the game dll. Although the plugin +isn't intended to provide full HL-game functionality, since it's receiving +the same information given to the game DLL, it has the opportunity to do +_anything_ the game DLL can do (given enough coding effort of course). + +This is very similar to the way Alfred Reynolds' AdminMod +(www.adminmod.org) works, as it also sits between the engine and game dll, +catching routines, and passing them on. thus modifying functionality. +However, rather than providing just the additional server features builtin +to AdminMod DLL, MetaMod allows you to add features from multiple, +separate DLLs. Under that framework, AdminMod can be a plugin itself, and +be run alongside numerous other plugins. And, as of version 2.50 of +AdminMod, AM has now transitioned to running as a Metamod plugin. + +-------------------------------------------------------------------------- diff --git a/doc/txt/coding.txt b/doc/txt/coding.txt new file mode 100644 index 0000000..f9dcb3c --- /dev/null +++ b/doc/txt/coding.txt @@ -0,0 +1,340 @@ +Coding for Metamod +=-=-=-=-=-=-=-=-=-= + + +Compiling +========= + +You'll need the Half-Life SDK, of course. In particular you'll need HL SDK +version 2.3. You can find the original SDK 2.3 at the Valve Editing +Resource Center (VERC) (www.valve-erc.com/), and a modified version of SDK +2.3 at metmod.org/files/sdk (metamod.org/files/sdk/). + + +Operation +========= + +The basic operation is, for each api call: + + - iterate through list of plugins + - for each plugin, if it provides this api call, then call the function + in the plugin + - call the "real" function (in the game dll, or from the engine) + - for each plugin, check for a "post" version of the function, and call + if present + +Also, for any api call, each plugin has the opportunity to replace the +real routine, in two ways: + + - prevent the real routine from being called (SUPERCEDE). + - allow the real routine to be called, but change the value that's + returned (OVERRIDE) + +Thus after each plugin is called, its META_RESULT flag is checked, and +action taken appropriately. Note that supercede/override only affects the +_real_ routine; other plugins will still be called. In addition to the +SUPERCEDE and OVERRIDE flags, there are two additional flags a plugin can +return: + + - HANDLED ("I did something here") + - IGNORED ("I didn't really do anything") + +These aren't used by Metamod itself, but could be used by plugins to get +an idea if a previous plugin did anything. + +Note that each routine _needs_ to set its META_RESULT value before +returning. Plugin routines that do not set a value will be reported as +errors in the logs. + + +Plugin coding requirements +========================== + +Plugins MUST provide the following standard HLSDK exported function: + + void GiveFnptrsToDll(enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals); + +AS WELL AS the following new functions: + + void Meta_Init(void); (optional) + int Meta_Query(char *interfaceVersion, plugin_info_t **pinfo, mutil_funcs_t *pMetaUtilFuncs); + int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs); + int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason); + +Also, it must provide AT LEAST one function returning a standard HL +function table, from either the following standard HLSDK functions: + + int GetEntityAPI( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion ); + int GetEntityAPI2( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion ); + int GetNewDLLFunctions( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion ); + +or from the following new functions: + + int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion); + int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion ; + int GetNewDLLFunctions_Post(NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion); + + int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion); + int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion); + +Thus, it needs to have (at least): + + GiveFnptrsToDll + Meta_Query + Meta_Attach + Meta_Detach + + +See the "stub_plugin" for an example of _bare minimum_ code. See " +trace_plugin" for an example of more complete functionality. + +Also, if the plugin needs to use LINK_ENTITY_TO_CLASS, support for the +particular entity(ies) has to be added explicitly to Metamod +(linkfunc.cpp), just as it does for entities in game DLLs. + + +Operation Details +================= + +These are the valid META_RESULT values a plugin routine can specify: + + + - MRES_IGNORED + The plugin did nothing. This could be used to tell a subsequent plugin + that the some situation hasn't been handled yet. This would be + recognized only by other plugins; Metamod itself doesn't do anything + special for this situation. Unless otherwise specified by a later + plugin, execution of routine in the gameDLL will take place. This is + valid in both normal and post routines. + + - MRES_HANDLED + The plugin handled the situation, or did something with the + information. Again, this could be used to tell a subsequent plugin + that some situation has already been taken care of, and is not + recognized specially by Metamod. Unless otherwise specified by a later + plugin, execution of routine in the gameDLL will take place. This is + valid in both normal and post routines. + + - MRES_OVERRIDE + The plugin is providing a return value for the routine, which should + be used in place of the return value from the gameDLL's routine (the + plugin "overrides" the gameDLL's return value). Unless otherwise + specified by a later plugin, the gameDLL routine will still be called. + Note this only makes sense for non-void routines. This is valid in + both normal and post routines. + + - MRES_SUPERCEDE + The plugin has performed sufficient actions for the routine, and the + gameDLL's routine should NOT be called (the plugin "supercedes" the + gameDLL's routine, more or less replacing it entirely). Any return + value for the routine should be specified as well by the plugin. Note + this is only valid for normal routines, as post routines cannot + prevent calling the gameDLL's routine (as it has already happened!). + Also note, this doesn't prevent subsequent plugins from being called + for this routine; it supercedes _only_ the gameDLL. + +As the plugins are called, a running status is kept of the "highest" meta +status so far, in the order (lowest to highets) shown above. After calling +all the "normal" routines, the status is checked to see if the gameDLL's +routine should be called - ie, it will not be called if one (or more) of +the plugin's has specified META_SUPERCEDE. The gameDLL's routine is then +called, or skipped, as appropriate. Then, all the "post" routines are +called in the same manner (except META_SUPERCEDE is no longer a valid meta +result). + +Last, if any plugins specified META_OVERRIDE or META_SUPERCEDE, the return +value given by the _last_ such plugin is returned as the routine's return +code to the engine (assuming a non-void routine). Thus, the order of the +plugins as specified in the metamod.ini _does_ have a possible effect. + + +Available Macros +================ + +The meta_api.h header that describes the Metamod API functions, types, and +structures also includes several macros that can be of help when coding a +plugin. + + + - SET_META_RESULT(result) + Sets the META_RESULT for the plugin. + + - RETURN_META(result) + Sets the META_RESULT for the plugin, and then calls return. This + assumes a void function. + + - RETURN_META_VALUE(result, value) + Sets the META_RESULT for the plugin, and then returns the given value. + This assumes a non-void function, and it doesn't matter the particular + type of the return value. + + - META_RESULT_STATUS + Gives the current status of META_RESULT for this routine from plugins + so far. It will return the "highest" result so far, in the order of + lesser to greater: IGNORED, HANDLED, OVERRIDE, SUPERCEDE (see also + above Operation Details) + + - META_RESULT_PREVIOUS + Gives the META_RESULT of the previous plugin. + + - META_RESULT_ORIG_RET(type) + Gives the "original" return value for the routine, ie the return value + of the routine from gameDLL. The type for the routine's return value + must be specified in the macro; this is used as a cast for assignment. + Note this is only valid in a "post" routine. + + - META_RESULT_OVERRIDE_RET(type) + Gives the return value from any previous plugin that specified + META_OVERRIDE or META_SUPERCEDE. The type for the routine's return + value must be specified in the macro; this is used as a cast for + assignment. This should only be used after checking the META_RESULT to + see if there's actually an override value available. + + - MDLL_*(args) + Calls a given DLLAPI routine in the gameDLL. For instance, + MDLL_GameDLLInit(args), MDLL_Spawn(args), etc. + + - MNEW_*(args) + Calls a given NEWAPI routine in the gameDLL. For instance, + MNEW_GameShutdown(args), etc. + + +Utility Callback Functions +========================== + +In version 1.05, Metamod began providing a set of utility functions to +plugins to centralize functionality, reduce code reuse, and to provide +some convenience in plugin coding. Presently, only a few functions are +provided. More are added as I find the time, and identify some advantage +to having them (either for my own plugins, or by others' request for their +plugins). + +Note the PLID keyword passed to each function. This is basically a "plugin +id" to indicate to Metamod which plugin is calling the function (else it's +difficult to tell), and is a macro that should be specified verbatim with +each call. (Currently, the macro is merely the plugin_info struct pointer +returned by the plugin via Meta_Query; in the future this could change to +some other identifier.) + + + - void LOG_CONSOLE(PLID, char *fmt, ...) + Print a message line on the console. Message is specified as a printf + style format string and arguments. A trailing newline is provided by + the routine and should not be specified in the string (unless you want + two newlines). + + - void LOG_MESSAGE(PLID, char *fmt, ...) + Print a message line in the server logs. Message is specified as a + printf style format string and arguments. A trailing newline is + provided by the routine and should not be specified in the string. Log + message is prefixed by the logtag string in the plugin's "info" + struct, surrounded by brackets. For instance: + + L 04/17/2001 - 18:00:35: [TraceAPI] Tracing Engine routine + 'RegUserMsg' + + - void LOG_ERROR(PLID, char *fmt, ...) + As in LOG_MESSAGE above, only marked as well with the string "ERROR:". + For example: + + L 04/17/2001 - 18:03:13: [TraceAPI] ERROR: malloc failed + + - void LOG_DEVELOPER(PLID, char *fmt, ...) + As in LOG_MESSAGE above, only message will be logged only if cvar + developer is set to 1; message is marked as well with the string "dev: + ". For example: + + L 04/17/2001 - 18:03:13: [TraceAPI] dev: called: GiveFnptrsToDll + + - void CENTER_SAY(PLID, char *fmt, ...) + Prints a message on the center of all players' screens. This is like + the "centersay" of AdminMod, with pretty_say enabled, with the same + defaults (green, and a 10 second fade-in). A message is logged as + well, ie: [added in 1.06] + + L 04/17/2001 - 15:44:52: [WDMISC] (centersay) random set up us the + bomb! + + - void CENTER_SAY_PARMS(PLID, hudtextparms_t tparms, char *fmt, ...) + As in CENTER_SAY above, but allows specifying all the parameters. (see + SDK dlls/util.h for the struct hudtextparms_t). [added in 1.06] + + - void CENTER_SAY_VARARGS(PLID, hudtextparms_t tparms, char *fmt, + va_list ap) + As in CENTER_SAY_PARMS above, only the message is passed as a + vsnprintf style varargs format string and args list. This is included + merely because both the previous CENTER_SAY functions actually call + this, and it was convenient to include it as well. [added in 1.06] + + - qboolean CALL_GAME_ENTITY(PLID, char *entStr, entvars_t *pev) + Calls an entity function in the gameDLL. For instance, a bot usually + needs to call the player entity function. [added in 1.09] + + - int GET_USER_MSG_ID(PLID, const char *name, int *size) + Returns the id number corresponding to the given message name, of + those messages registered by the gamedll with RegUserMsg, optionally + returning the registered size of the message as well. This is to allow + things like bots to access the name/id mapping without having to catch + RegUserMsg themselves, and thus have to be loaded at startup. [added + in 1.11] + + - const char * GET_USER_MSG_NAME(PLID, int msgid, int *size) + Returns the name corresponding to the given msgid number, of those + messages registered by the gamedll with RegUserMsg, optionally + returning the registered size of the message as well. It will return + guess-names for any builtin Engine messages that it knows about + (SVC_TEMPENTITY, etc). The returned string is presumed to be a + compile-time constant string, stored in the text segment of the + gamedll. [added in 1.11] + + - const char * GET_PLUGIN_PATH(PLID) + Returns the full pathname of the loaded dll/so file for the calling + plugin. The returned string is a pointer to a static buffer, and + should be copied by the caller to local storage. [added in 1.12] + + - const char * GET_GAME_INFO(PLID, ginfo_t type) + Returns various string-based information about the running game/MOD/ + gamedll. The given type can be one of: + - GINFO_NAME - short name of game, from "-game" argument to hlds (ie + "cstrike") + - GINFO_DESC - long name of game, from autodetection (ie + "Counter-Strike") + - GINFO_GAMEDIR - game directory, full pathname (ie "/usr/local/ + half-life/cstrike") + - GINFO_DLL_FULLPATH - full pathname of the game dll (ie "/usr/local + /half-life/cstrike/dlls/cs_i386.so") + - GINFO_DLL_FILENAME - bare filename of the gamedll (ie + "cs_i386.so") + The returned string is a pointer to a static buffer, and should be + copied by the caller to local storage. [added in 1.14] + + +Plugin Loading +============== + +(this is some rough notes I intend to fill in in the future) + +Plugins are loaded when the engine calls GiveFnptrsToDll(). The config +file is parsed, and for each valid plugin (uncommented, platform +relevant), the operation is: + + - dlopen() the file, store the handle + - dlsym() and call: + Meta_Init (if present) + GiveFnptrsToDll + Meta_Query + Meta_Attach + - if present, call function pointers, and store resulting function + table: + GetEntityAPI + GetEntityAPI2 + GetNewDLLFunctions + + GetEntityAPI_Post + GetEntityAPI2_Post + GetNewDLLFunctions_Post + + GetEngineFunctions + GetEngineFunctions_Post + +-------------------------------------------------------------------------- diff --git a/doc/txt/dllapi_notes.txt b/doc/txt/dllapi_notes.txt new file mode 100644 index 0000000..d73e450 --- /dev/null +++ b/doc/txt/dllapi_notes.txt @@ -0,0 +1,702 @@ +HLSDK DLLAPI Notes +=-=-=-=-=-=-=-=-=-= + +-------------------------------------------------------------------------- + + - GameDLLInit + - DispatchSpawn + - DispatchThink + - DispatchUse + - DispatchTouch + - DispatchBlocked + - DispatchKeyValue + - DispatchSave + - DispatchRestore + - DispatchObjectCollsionBox + - SaveWriteFields + - SaveReadFields + - SaveGlobalState + - RestoreGlobalState + - ResetGlobalState + - ClientConnect + - ClientDisconnect + - ClientKill + - ClientPutInServer + - ClientCommand + - ClientUserInfoChanged + - ServerActivate + - ServerDeactivate + - PlayerPreThink + - PlayerPostThink + - StartFrame + - ParmsNewLevel + - ParmsChangeLevel + - GetGameDescription + - PlayerCustomization + - SpectatorConnect + - SpectatorDisconnect + - SpectatorThink + - Sys_Error + - PM_Move + - PM_Init + - PM_FindTextureType + - SetupVisibility + - UpdateClientData + - AddToFullPack + - CreateBaseline + - RegisterEncoders + - GetWeaponData + - CmdStart + - CmdEnd + - ConnectionlessPacket + - GetHullBounds + - CreateInstancedBaselines + - InconsistentFile + - AllowLagCompensation + +-------------------------------------------------------------------------- + +GameDLLInit + +from dlls/game.cpp: +void GameDLLInit(void); + + Register your console variables here. + This gets called one time when the game is initialied. + Initialize the game (one-time call after loading of game .dll) + +comments: + + Called just after hlds reports "Dll loaded for mod Half-Life". + +-------------------------------------------------------------------------- + +DispatchSpawn + +from dlls/cbase.cpp +int DispatchSpawn(edict_t *pent); + +comments: + + Called when entity defined in mapfile is being created. + First entity has classname "worldcraft" and can be used to detect + map start. + + 0==Success, -1==Failure ? + +-------------------------------------------------------------------------- + +DispatchThink + +from dlls/cbase.cpp +void DispatchThink(edict_t *pent); + Called when pent->v.nextthink is first time less or equal as + server time. + +-------------------------------------------------------------------------- + +DispatchUse + +from dlls/cbase.cpp +void DispatchUse(edict_t *pentUsed, edict_t *pentOther); + Unused. Use is dispatched internally inside gamedll. + +-------------------------------------------------------------------------- + +DispatchTouch + +from dlls/cbase.cpp +void DispatchTouch(edict_t *pentTouched, edict_t *pentOther); + Called when other entity collides touched entity. + +-------------------------------------------------------------------------- + +DispatchBlocked + +from dlls/cbase.cpp +void DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther); + Unknown. + +-------------------------------------------------------------------------- + +DispatchKeyValue + +from dlls/cbase.cpp +void DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd); + Client uses 'setinfo' command. + - pentKeyvalue Client edict + - pkvd Client key values + +-------------------------------------------------------------------------- + +DispatchSave + +from dlls/cbase.cpp +void DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData); + Save game? + +-------------------------------------------------------------------------- + +DispatchRestore + +from dlls/cbase.cpp +int DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int +globalEntity); + +comments: + Load game? + + 0==Success, -1==Failure ? + +-------------------------------------------------------------------------- + +DispatchObjectCollsionBox + +from dlls/cbase.cpp +void DispatchObjectCollsionBox(edict_t *pent); + +-------------------------------------------------------------------------- + +SaveWriteFields + +from dlls/cbase.cpp +void SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void * +pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); + +-------------------------------------------------------------------------- + +SaveReadFields + +from dlls/cbase.cpp +void SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void * +pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); + +-------------------------------------------------------------------------- + +SaveGlobalState + +from dlls/world.cpp +void SaveGlobalState(SAVERESTOREDATA *pSaveData); + +-------------------------------------------------------------------------- + +RestoreGlobalState + +from dlls/world.cpp +void RestoreGlobalState(SAVERESTOREDATA *pSaveData); + +-------------------------------------------------------------------------- + +ResetGlobalState + +from dlls/world.cpp +void ResetGlobalState(void); + +-------------------------------------------------------------------------- + +ClientConnect + +from dlls/client.cpp: +BOOL ClientConnect(edict_t *pEntity, const char *pszName, const char * +pszAddress, char szRejectReason[128]); + + Called when a player connects to a server. + +comments: + + Called on initial connect, just after hlds reports "connected", ie: + "John<1>" connected, address "127.0.0.1:27005" + This is before the user begins downloading, or anything else. + +-------------------------------------------------------------------------- + +ClientDisconnect + +from dlls/client.cpp: +void ClientDisconnect(edict_t *pEntity); + + Called when a player disconnects from a server. + GLOBALS ASSUMED SET: g_fGameOver + +comments: + + This is not the opposite of ClientConnect, despite the similar name. + It appears to only be called if the client was PutInServer first. If + the client disconnects before being PutInServer, no API routine is + called. This would be more appropriately named ClientRemoveFromServer_ + . + +-------------------------------------------------------------------------- + +ClientKill + +from dlls/client.cpp: +void ClientKill(edict_t *pEntity); + + Player entered the suicide command. + GLOBALS ASSUMED SET: g_ulModelIndexPlayer + +comments: + + When the client typed "kill" in the console? + +-------------------------------------------------------------------------- + +ClientPutInServer + +from dlls/client.cpp: +void ClientPutInServer(edict_t *pEntity); + + Called each time a player is spawned. + +comments: + + Called after the client has uploaded/download all necessary resources, + just after hlds reports "entered the game", ie: + "John<1>" has entered the game + +-------------------------------------------------------------------------- + +ClientCommand + +from dlls/client.cpp: +void ClientCommand(edict_t *pEntity); + + Called each time a player uses a "cmd" command. Use CMD_ARGS, + CMD_ARGV, and CMD_ARGC to get pointers to the character string + command. + +-------------------------------------------------------------------------- + +ClientUserInfoChanged + +from dlls/client.cpp: +void ClientUserInfoChanged(edict_t *pEntity, char *infobuffer); + + Called after the player changes userinfo - gives dll a chance to + modify it before it gets sent into the rest of the engine. + +comments: + + Called when user issues "setinfo" from the console. Also appears to be + called whenever the user returns to the game from the ESC menu. + +-------------------------------------------------------------------------- + +ServerActivate + +from dlls/client.cpp: +void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); + + Every call to ServerActivate should be matched by a call to + ServerDeactivate. + +comments: + + Added in SDK 2.0. Apparently called when the server has loaded the + map, but before it precaches from the .res file. + +-------------------------------------------------------------------------- + +ServerDeactivate + +from dlls/client.cpp: +void ServerDeactivate(void); + + Peform any shutdown operations here. + It's possible that the engine will call this function more times than + is necessary. Therefore, only run it one time for each call to + ServerActivate. + +comments: + + Called upon "quit" or "changelevel" . + +-------------------------------------------------------------------------- + +PlayerPreThink + +from dlls/client.cpp: +void PlayerPreThink(edict_t *pEntity); + + Called every frame before physics are run. + +-------------------------------------------------------------------------- + +PlayerPostThink + +from dlls/client.cpp: +void PlayerPostThink(edict_t *pEntity); + + Called every frame after physics are run. + +-------------------------------------------------------------------------- + +StartFrame + +from dlls/client.cpp: +void StartFrame(void); + + GLOBALS ASSUMED SET: g_ulFrameCount + +-------------------------------------------------------------------------- + +ParmsNewLevel + +from dlls/client.cpp +void ParmsNewLevel(void); + +-------------------------------------------------------------------------- + +ParmsChangeLevel + +from dlls/client.cpp +void ParmsChangeLevel(void); + +-------------------------------------------------------------------------- + +GetGameDescription + +from dlls/client.cpp: +const char *GetGameDescription(void); + + Returns string describing current .dll game. + Returns the descriptive name of this .dll. E.g., Half-Life, or Team + Fortress 2. + This function might be called before the world has spawned, and the + game rules initialized. + +-------------------------------------------------------------------------- + +PlayerCustomization + +from dlls/client.cpp: +void PlayerCustomization(edict_t *pEntity, customization_t *pCust); + + Notifies .dll of new customization for player. + A new player customization has been registered on the server. UNDONE: + This only sets the # of frames of the spray can logo animation right + now. + +-------------------------------------------------------------------------- + +SpectatorConnect + +from dlls/client.cpp: +void SpectatorConnect(edict_t *pEntity); + + Called when spectator joins server. + A spectator has joined the game. + +-------------------------------------------------------------------------- + +SpectatorDisconnect + +from dlls/client.cpp: +void SpectatorDisconnect(edict_t *pEntity); + + Called when spectator leaves the server. + A spectator has left the game. + +-------------------------------------------------------------------------- + +SpectatorThink + +from dlls/client.cpp: +void SpectatorThink(edict_t *pEntity); + + Called when spectator sends a command packet (usercmd_t). + A spectator has sent a usercmd. + +-------------------------------------------------------------------------- + +Sys_Error + +from dlls/client.cpp: +void Sys_Error(const char *error_string); + + Called when engine has encountered an error. + Notify game .dll that engine is going to shut down. + Engine is going to shut down, allows setting a breakpoint in game dll + to catch that occasion. + Add code ( e.g., _asm { int 3 }; here to cause a breakpoint for + debugging your game .dlls. + +comments: + + Added in SDK 2.0. + +-------------------------------------------------------------------------- + +PM_Move + +from pm_shared/pm_shared.c: +void PM_Move(struct playermove_s *ppmove, int server); + + This modume implements the shared player physics code between any + particular game and the engine. The same PM_Move routine is built into + the game .dll and the client .dll and is invoked by each side as + appropriate. There should be no distinction, internally, between + server and client. This will ensure that prediction behaves + appropriately. + +comments: + + Added in SDK 2.0. + +-------------------------------------------------------------------------- + +PM_Init + +from pm_shared/pm_shared.c: +void PM_Init(struct playermove_s *ppmove); + + Server version of player movement initialization. + +comments: + + Added in SDK 2.0. + +-------------------------------------------------------------------------- + +PM_FindTextureType + +from pm_shared/pm_shared.c +char PM_FindTextureType(char *name); + +comments: + + Added in SDK 2.0. + +-------------------------------------------------------------------------- + +SetupVisibility + +from dlls/client.cpp: +void SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char +**pvs, unsigned char **pas); + +from dlls/client.cpp: + + Set up PVS and PAS for networking for this client. + + A client can have a separate "view entity" indicating that his/her + view should depend on the origin of that view entity. If that's the + case, then pViewEntity will be non-NULL and will be used. Otherwise, + the current entity's origin is used. Either is offset by the view_ofs + to get the eye position. + + From the eye position, we set up the PAS and PVS to use for filtering + network messages to the client. At this point, we could override the + actual PAS or PVS values, or use a different origin. + + NOTE: Do not cache the values of pas and pvs, as they depend on + reusable memory in the engine, they are only good for this one frame + +comments: + + Added in SDK 2.0. + +-------------------------------------------------------------------------- + +UpdateClientData + +from dlls/client.cpp: +void UpdateClientData (const struct edict_s *ent, int sendweapons, struct +clientdata_s *cd); + + Set up data sent only to specific client. + Data sent to current client only. + Engine sets argument 'cd' to 0 before calling. + +comments: + + Added in SDK 2.0. + +-------------------------------------------------------------------------- + +AddToFullPack + +from dlls/client.cpp: +int AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, +edict_t *host, int hostflags, int player, unsigned char *pSet); + + Return 1 if the entity state has been filled in for the ent and the + entity will be propagated to the client, 0 otherwise. + + State is the server maintained copy of the state info that is + transmitted to the client. A MOD could alter values copied into state + to send the "host" a different look for a particular entity update, + etc. + + Arguments 'e' and 'ent' are the entity that is being added to the + update, if 1 is returneds. Host is the player's edict of the player + whom we are sending the update to. Player is 1 if the ent/e is a + player and 0 otherwise. Argument 'pSet' is either the PAS or PVS that + we previous set up. We can use it to ask the engine to filter the + entity against the PAS or PVS. + + We could also use the pas/ pvs that we set in SetupVisibility, if we + wanted to. Caching the value is valid in that case, but still only for + the current frame. + +comments: + + Added in SDK 2.0. + +-------------------------------------------------------------------------- + +CreateBaseline + +from dlls/client.cpp: +void CreateBaseline(int player, int eindex, struct entity_state_s * +baseline, struct edict_s *entity, int playermodelindex, vec3_t +player_mins, vec3_t player_maxs); + + Tweak entity baseline for network encoding, allows setup of player + baselines, too. + Creates baselines used for network encoding, especially for player + data since players are not spawned until connect time. + +comments: + + Added in SDK 2.0. + +-------------------------------------------------------------------------- + +RegisterEncoders + +from dlls/client.cpp: +void RegisterEncoders(void); + + Callbacks for network encoding. + Allows game .dll to override network encoding of certain types of + entities and tweak values, etc. + +comments: + + Added in SDK 2.0. + +-------------------------------------------------------------------------- + +GetWeaponData + +from dlls/client.cpp +int GetWeaponData(struct edict_s *player, struct weapon_data_s *info); + +comments: + + Added in SDK 2.0. + +-------------------------------------------------------------------------- + +CmdStart + +from dlls/client.cpp: +void CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned +int random_seed); + + We're about to run this usercmd for the specified player. We can set + up groupinfo and masking here, etc. This is the time to examine the + usercmd for anything extra. This call happens even if think does not. + +comments: + + Added in SDK 2.0. + +-------------------------------------------------------------------------- + +CmdEnd + +from dlls/client.cpp: +void CmdEnd (const edict_t *player); + + Each cmdstart is exactly matched with a cmd end, clean up any group + trace flags, etc. here. + +comments: + + Added in SDK 2.0. + +-------------------------------------------------------------------------- + +ConnectionlessPacket + +from dlls/client.cpp: +int ConnectionlessPacket(const struct netadr_s *net_from, const char * +args, char *response_buffer, int *response_buffer_size); + + Return 1 if the packet is valid. Set response_buffer_size if you want + to send a response packet. Incoming, it holds the max size of the + response_buffer, so you must zero it out if you choose not to respond. + +comments: + + Added in SDK 2.0. + +-------------------------------------------------------------------------- + +GetHullBounds + +from dlls/client.cpp: +int GetHullBounds(int hullnumber, float *mins, float *maxs); + + Engine calls this to enumerate player collision hulls, for prediction. + Return 0 if the hullnumber doesn't exist. + +comments: + + Added in SDK 2.0. + +-------------------------------------------------------------------------- + +CreateInstancedBaselines + +from dlls/client.cpp: +void CreateInstancedBaselines (void); + + Tweak entity baseline for network encoding, allows setup of player + baselines, too. + Create pseudo-baselines for items that aren't placed in the map at + spawn time, but which are likely to be created during play (e.g., + grenades, ammo packs, projectiles, corpses, etc.). + +comments: + + Added in SDK 2.0. + +-------------------------------------------------------------------------- + +InconsistentFile + +from dlls/client.cpp: +int InconsistentFile(const edict_t *player, const char *filename, char * +disconnect_message); + + One of the ENGINE_FORCE_UNMODIFIED files failed the consistency check + for the specified player Return 0 to allow the client to continue, 1 + to force immediate disconnection (with an optional disconnect message + of up to 256 characters). + +comments: + + Added in SDK 2.0. + +-------------------------------------------------------------------------- + +AllowLagCompensation + +from dlls/client.cpp: +int AllowLagCompensation(void); + + The game .dll should return 1 if lag compensation should be allowed + (could also just set the sv_unlag cvar. Most games right now should + return 0, until client-side weapon prediction code is written and + tested for them (note you can predict weapons, but not do lag + compensation, too, if you want. + +comments: + + Added in SDK 2.0. + +-------------------------------------------------------------------------- diff --git a/doc/txt/engine_notes.txt b/doc/txt/engine_notes.txt new file mode 100644 index 0000000..8b12394 --- /dev/null +++ b/doc/txt/engine_notes.txt @@ -0,0 +1,2166 @@ +HLSDK Engine Notes +=-=-=-=-=-=-=-=-=-= + +-------------------------------------------------------------------------- + + - PrecacheModel + - PrecacheSound + - SetModel + - ModelIndex + - ModelFrames + - SetSize + - ChangeLevel + - GetSpawnParms + - SaveSpawnParms + - VecToYaw + - VecToAngles + - MoveToOrigin + - ChangeYaw + - ChangePitch + - FindEntityByString + - GetEntityIllum + - FindEntityInSphere + - FindClientInPVS + - EntitiesInPVS + - MakeVectors + - AngleVectors + - CreateEntity + - RemoveEntity + - CreateNamedEntity + - MakeStatic + - EntIsOnFloor + - DropToFloor + - WalkMove + - SetOrigin + - EmitSound + - EmitAmbientSound + - TraceLine + - TraceToss + - TraceMonsterHull + - TraceHull + - TraceModel + - TraceTexture + - TraceSphere + - GetAimVector + - ServerCommand + - ServerExecute + - ClientCommand + - ParticleEffect + - LightStyle + - DecalIndex + - PointContents + - MessageBegin + - MessageEnd + - WriteByte + - WriteChar + - WriteShort + - WriteLong + - WriteAngle + - WriteCoord + - WriteString + - WriteEntity + - CVarRegister + - CVarGetFloat + - CVarGetString + - CVarSetFloat + - CVarSetString + - AlertMessage + - EngineFprintf + - PvAllocEntPrivateData + - PvEntPrivateData + - FreeEntPrivateData + - SzFromIndex + - AllocString + - GetVarsOfEnt + - PEntityOfEntOffset + - EntOffsetOfPEntity + - IndexOfEdict + - PEntityOfEntIndex + - FindEntityByVars + - GetModelPtr + - RegUserMsg + - AnimationAutomove + - GetBonePosition + - FunctionFromName + - NameForFunction + - ClientPrintf + - ServerPrint + - Cmd_Args + - Cmd_Argv + - Cmd_Argc + - GetAttachment + - CRC32_Init + - CRC32_ProcessBuffer + - CRC32_ProcessByte + - CRC32_Final + - RandomLong + - RandomFloat + - SetView + - Time + - CrosshairAngle + - LoadFileForMe + - FreeFile + - EndSection + - CompareFileTime + - GetGameDir + - Cvar_RegisterVariable + - FadeClientVolume + - SetClientMaxspeed + - CreateFakeClient + - RunPlayerMove + - NumberOfEntities + - GetInfoKeyBuffer + - InfoKeyValue + - SetKeyValue + - SetClientKeyValue + - IsMapValid + - StaticDecal + - PrecacheGeneric + - GetPlayerUserId + - BuildSoundMsg + - IsDedicatedServer + - CVarGetPointer + - GetPlayerWONId + - Info_RemoveKey + - GetPhysicsKeyValue + - SetPhysicsKeyValue + - GetPhysicsInfoString + - PrecacheEvent + - PlaybackEvent + - SetFatPVS + - SetFatPAS + - CheckVisibility + - DeltaSetField + - DeltaUnsetField + - DeltaAddEncoder + - GetCurrentPlayer + - CanSkipPlayer + - DeltaFindField + - DeltaSetFieldByIndex + - DeltaUnsetFieldByIndex + - SetGroupMask + - CreateInstancedBaseline + - Cvar_DirectSet + - ForceUnmodified + - GetPlayerStats + - AddServerCommand + - Voice_GetClientListening + - Voice_SetClientListening + - GetPlayerAuthId + - SequenceGet + - SequencePickSentence + - GetFileSize + - GetApproxWavePlayLen + - IsCareerMatch + - GetLocalizedStringLength + - RegisterTutorMessageShown + - GetTimesTutorMessageShown + - ProcessTutorMessageDecayBuffer + - ConstructTutorMessageDecayBuffer + - ResetTutorMessageDecayData + +-------------------------------------------------------------------------- + +PrecacheModel + +from engine/eiface.h: +int PrecacheModel(char *s); +PRECACHE_MODEL() + +comments: + + . + +-------------------------------------------------------------------------- + +PrecacheSound + +from engine/eiface.h: +int PrecacheSound(char *s); +PRECACHE_SOUND() + +comments: + + . + +-------------------------------------------------------------------------- + +SetModel + +from engine/eiface.h: +void SetModel(edict_t *e, const char *m); +SET_MODEL() + +comments: + + . + +-------------------------------------------------------------------------- + +ModelIndex + +from engine/eiface.h: +int ModelIndex(const char *m); +MODEL_INDEX() + +comments: + + . + +-------------------------------------------------------------------------- + +ModelFrames + +from engine/eiface.h: +int ModelFrames(int modelIndex); +MODEL_FRAMES() + +comments: + + . + +-------------------------------------------------------------------------- + +SetSize + +from engine/eiface.h: +void SetSize(edict_t *e, const float *rgflMin, const float *rgflMax); +SET_SIZE() + +comments: + + . + +-------------------------------------------------------------------------- + +ChangeLevel + +from engine/eiface.h: +void ChangeLevel(char *s1, char *s2); +CHANGE_LEVEL() + +comments: + + . + +-------------------------------------------------------------------------- + +GetSpawnParms + +from engine/eiface.h: +void GetSpawnParms(edict_t *ent); +GET_SPAWN_PARMS() + +comments: + + . + +-------------------------------------------------------------------------- + +SaveSpawnParms + +from engine/eiface.h: +void SaveSpawnParms(edict_t *ent); +SAVE_SPAWN_PARMS() + +comments: + + . + +-------------------------------------------------------------------------- + +VecToYaw + +from engine/eiface.h: +float VecToYaw(const float *rgflVector); +VEC_TO_YAW() + +comments: + + . + +-------------------------------------------------------------------------- + +VecToAngles + +from engine/eiface.h: +void VecToAngles(const float *rgflVectorIn, float *rgflVectorOut); +VEC_TO_ANGLES() + +comments: + + . + +-------------------------------------------------------------------------- + +MoveToOrigin + +from engine/eiface.h: +void MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int +iMoveType); +MOVE_TO_ORIGIN() + +comments: + + . + +-------------------------------------------------------------------------- + +ChangeYaw + +from engine/eiface.h: +void ChangeYaw(edict_t *ent); +oldCHANGE_YAW() + +comments: + + . + +-------------------------------------------------------------------------- + +ChangePitch + +from engine/eiface.h: +void ChangePitch(edict_t *ent); +CHANGE_PITCH() + +comments: + + . + +-------------------------------------------------------------------------- + +FindEntityByString + +from engine/eiface.h: +edict_t *FindEntityByString(edict_t *pEdictStartSearchAfter, const char * +pszField, const char *pszValue); +FIND_ENTITY_BY_STRING() + +comments: + + . + +-------------------------------------------------------------------------- + +GetEntityIllum + +from engine/eiface.h: +int GetEntityIllum(edict_t *pEnt); +GETENTITYILLUM() + +comments: + + . + +-------------------------------------------------------------------------- + +FindEntityInSphere + +from engine/eiface.h: +edict_t *FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float * +org, float rad); +FIND_ENTITY_IN_SPHERE() + +comments: + + . + +-------------------------------------------------------------------------- + +FindClientInPVS + +from engine/eiface.h: +edict_t *FindClientInPVS(edict_t *pEdict); +FIND_ENTITY_IN_PVS() + +comments: + + . + +-------------------------------------------------------------------------- + +EntitiesInPVS + +from engine/eiface.h: +edict_t *EntitiesInPVS(edict_t *pplayer); + +comments: + + . + +-------------------------------------------------------------------------- + +MakeVectors + +from engine/eiface.h: +void MakeVectors(const float *rgflVector); +MAKE_VECTORS() + +comments: + + . + +-------------------------------------------------------------------------- + +AngleVectors + +from engine/eiface.h: +void AngleVectors(const float *rgflVector, float *forward, float *right, +float *up); + +comments: + + . + +-------------------------------------------------------------------------- + +CreateEntity + +from engine/eiface.h: +edict_t *CreateEntity(void); +CREATE_ENTITY() + +comments: + + . + +-------------------------------------------------------------------------- + +RemoveEntity + +from engine/eiface.h: +void RemoveEntity(edict_t *e); +REMOVE_ENTITY() + +comments: + + . + +-------------------------------------------------------------------------- + +CreateNamedEntity + +from engine/eiface.h: +edict_t *CreateNamedEntity(int className); +CREATE_NAMED_ENTITY() + +comments: + + . + +-------------------------------------------------------------------------- + +MakeStatic + +from engine/eiface.h: +void MakeStatic(edict_t *ent); +MAKE_STATIC() + +comments: + + . + +-------------------------------------------------------------------------- + +EntIsOnFloor + +from engine/eiface.h: +int EntIsOnFloor(edict_t *e); +ENT_IS_ON_FLOOR() + +comments: + + . + +-------------------------------------------------------------------------- + +DropToFloor + +from engine/eiface.h: +int DropToFloor(edict_t *e); +DROP_TO_FLOOR() + +comments: + + . + +-------------------------------------------------------------------------- + +WalkMove + +from engine/eiface.h: +int WalkMove(edict_t *ent, float yaw, float dist, int iMode); +WALK_MOVE() + +comments: + + . + +-------------------------------------------------------------------------- + +SetOrigin + +from engine/eiface.h: +void SetOrigin(edict_t *e, const float *rgflOrigin); +SET_ORIGIN() + +comments: + + . + +-------------------------------------------------------------------------- + +EmitSound + +from engine/eiface.h: +void EmitSound(edict_t *entity, int channel, const char *sample, /*int*/ +float volume, float attenuation, int fFlags, int pitch); +EMIT_SOUND_DYN2() + +comments: + + . + +-------------------------------------------------------------------------- + +EmitAmbientSound + +from engine/eiface.h: +void EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float +vol, float attenuation, int fFlags, int pitch); +EMIT_AMBIENT_SOUND() + +comments: + + . + +-------------------------------------------------------------------------- + +TraceLine + +from engine/eiface.h: +void TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t +*pentToSkip, TraceResult *ptr); +TRACE_LINE() + +comments: + + . + +-------------------------------------------------------------------------- + +TraceToss + +from engine/eiface.h: +void TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); +TRACE_TOSS() + +comments: + + . + +-------------------------------------------------------------------------- + +TraceMonsterHull + +from engine/eiface.h: +int TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, +int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); +TRACE_MONSTER_HULL() + +comments: + + . + +-------------------------------------------------------------------------- + +TraceHull + +from engine/eiface.h: +void TraceHull(const float *v1, const float *v2, int fNoMonsters, int +hullNumber, edict_t *pentToSkip, TraceResult *ptr); +TRACE_HULL() + +comments: + + . + +-------------------------------------------------------------------------- + +TraceModel + +from engine/eiface.h: +void TraceModel(const float *v1, const float *v2, int hullNumber, edict_t +*pent, TraceResult *ptr); + +comments: + + . + +-------------------------------------------------------------------------- + +TraceTexture + +from engine/eiface.h: +const char *TraceTexture(edict_t *pTextureEntity, const float *v1, const +float *v2); +TRACE_TEXTURE() + +comments: + + . + +-------------------------------------------------------------------------- + +TraceSphere + +from engine/eiface.h: +void TraceSphere(const float *v1, const float *v2, int fNoMonsters, float +radius, edict_t *pentToSkip, TraceResult *ptr); + +comments: + + . + +-------------------------------------------------------------------------- + +GetAimVector + +from engine/eiface.h: +void GetAimVector(edict_t *ent, float speed, float *rgflReturn); +GET_AIM_VECTOR() + +comments: + + . + +-------------------------------------------------------------------------- + +ServerCommand + +from engine/eiface.h: +void ServerCommand(char *str); +SERVER_COMMAND() + +comments: + + Executes a server command, as if typed at the console (ie "exec + myconfig.cfg", or "quit"). Note that it appears no commands are + executed until after GameDLLInit is called. If ServerCommand is called + earlier than that, the command is delayed until then. + +-------------------------------------------------------------------------- + +ServerExecute + +from engine/eiface.h: +void ServerExecute(void); +SERVER_EXECUTE() + +comments: + + . + +-------------------------------------------------------------------------- + +ClientCommand + +from engine/eiface.h: +void ClientCommand(edict_t *pEdict, char *szFmt, ...); +CLIENT_COMMAND() + +comments: + + . + +-------------------------------------------------------------------------- + +ParticleEffect + +from engine/eiface.h: +void ParticleEffect(const float *org, const float *dir, float color, float +count); +PARTICLE_EFFECT() + +comments: + + . + +-------------------------------------------------------------------------- + +LightStyle + +from engine/eiface.h: +void LightStyle(int style, char *val); +LIGHT_STYLE() + +comments: + + . + +-------------------------------------------------------------------------- + +DecalIndex + +from engine/eiface.h: +int DecalIndex(const char *name); +DECAL_INDEX() + +comments: + + . + +-------------------------------------------------------------------------- + +PointContents + +from engine/eiface.h: +int PointContents(const float *rgflVector); +POINT_CONTENTS() + +comments: + + . + +-------------------------------------------------------------------------- + +MessageBegin + +from engine/eiface.h: +void MessageBegin(int msg_dest, int msg_type, const float *pOrigin, +edict_t *ed); +MESSAGE_BEGIN() + +comments: + + Begin a network message to send to the client. + msg_type should be a number returned by RegUserMsg. + msg_dest is one of: + - MSG_BROADCAST - "unreliable to all" + - MSG_ONE - "reliable to one (msg_entity)" + - MSG_ALL - "reliable to all" + - MSG_INIT - "write to the init string" + - MSG_PVS - "Ents in PVS of org" (PVS=potentially visible set) + - MSG_PAS - "Ents in PAS of org" (PAS=potentially audible set) + - MSG_PVS_R - "Reliable to PVS" + - MSG_PAS_R - "Reliable to PAS" + - MSG_ONE_UNRELIABLE - "Send to one client, but don't put in + reliable stream, put in unreliable datagram (could be dropped)" + +-------------------------------------------------------------------------- + +MessageEnd + +from engine/eiface.h: +void MessageEnd(void); +MESSAGE_END() + +comments: + + . + +-------------------------------------------------------------------------- + +WriteByte + +from engine/eiface.h: +void WriteByte(int iValue); +WRITE_BYTE() + +comments: + + . + +-------------------------------------------------------------------------- + +WriteChar + +from engine/eiface.h: +void WriteChar(int iValue); +WRITE_CHAR() + +comments: + + . + +-------------------------------------------------------------------------- + +WriteShort + +from engine/eiface.h: +void WriteShort(int iValue); +WRITE_SHORT() + +comments: + + . + +-------------------------------------------------------------------------- + +WriteLong + +from engine/eiface.h: +void WriteLong(int iValue); +WRITE_LONG() + +comments: + + . + +-------------------------------------------------------------------------- + +WriteAngle + +from engine/eiface.h: +void WriteAngle(float flValue); +WRITE_ANGLE() + +comments: + + . + +-------------------------------------------------------------------------- + +WriteCoord + +from engine/eiface.h: +void WriteCoord(float flValue); +WRITE_COORD() + +comments: + + . + +-------------------------------------------------------------------------- + +WriteString + +from engine/eiface.h: +void WriteString(const char *sz); +WRITE_STRING() + +comments: + + . + +-------------------------------------------------------------------------- + +WriteEntity + +from engine/eiface.h: +void WriteEntity(int iValue); +WRITE_ENTITY() + +comments: + + . + +-------------------------------------------------------------------------- + +CVarRegister + +from engine/eiface.h: +void CVarRegister(cvar_t *pCvar); +CVAR_REGISTER() + +comments: + + Register a new cvar (server variable). + +-------------------------------------------------------------------------- + +CVarGetFloat + +from engine/eiface.h: +float CVarGetFloat(const char *szVarName); +CVAR_GET_FLOAT() + +comments: + + Return the float value of a cvar. + +-------------------------------------------------------------------------- + +CVarGetString + +from engine/eiface.h: +const char *CVarGetString(const char *szVarName); +CVAR_GET_STRING() + +comments: + + Return the string value of a cvar. + +-------------------------------------------------------------------------- + +CVarSetFloat + +from engine/eiface.h: +void CVarSetFloat(const char *szVarName, float flValue); +CVAR_SET_FLOAT() + +comments: + + Set the float value of a cvar. + +-------------------------------------------------------------------------- + +CVarSetString + +from engine/eiface.h: +void CVarSetString(const char *szVarName, const char *szValue); +CVAR_SET_STRING() + +comments: + + Set the string value of a cvar. + +-------------------------------------------------------------------------- + +AlertMessage + +from engine/eiface.h: +void AlertMessage(ALERT_TYPE atype, char *szFmt, ...); +ALERT() + +comments: + + Print an alert message. + atype is one of: + - at_notice + - at_console - "same as at_notice, but forces a ConPrintf, not a + message box". Prints output to server console, but only shown if + 'developer' is set. + - at_aiconsole - "same as at_console, but only shown if developer + level is 2!" + - at_warning + - at_error + - at_logged - "Server print to console (only in multiplayer games)." + Prints output to server logs and console. + +-------------------------------------------------------------------------- + +EngineFprintf + +from engine/eiface.h: +void EngineFprintf(FILE *pfile, char *szFmt, ...); +ENGINE_FPRINTF() + +comments: + + . + +-------------------------------------------------------------------------- + +PvAllocEntPrivateData + +from engine/eiface.h: +void *PvAllocEntPrivateData(edict_t *pEdict, long cb); +ALLOC_PRIVATE() + +comments: + + . + +-------------------------------------------------------------------------- + +PvEntPrivateData + +from engine/eiface.h: +void *PvEntPrivateData(edict_t *pEdict); +GET_PRIVATE() + +comments: + + Returns a pointer to the base class type of the given edict. For + instance: + CBaseEntity *pPlayer=(CBaseEntity *)GET_PRIVATE(pEntity); + + +-------------------------------------------------------------------------- + +FreeEntPrivateData + +from engine/eiface.h: +void FreeEntPrivateData(edict_t *pEdict); +FREE_PRIVATE() + +comments: + + . + +-------------------------------------------------------------------------- + +SzFromIndex + +from engine/eiface.h: +const char *SzFromIndex(int iString); + +comments: + + . + +-------------------------------------------------------------------------- + +AllocString + +from engine/eiface.h: +int AllocString(const char *szValue); +ALLOC_STRING() + +comments: + + . + +-------------------------------------------------------------------------- + +GetVarsOfEnt + +from engine/eiface.h: +struct entvars_s *GetVarsOfEnt(edict_t *pEdict); + +comments: + + . + +-------------------------------------------------------------------------- + +PEntityOfEntOffset + +from engine/eiface.h: +edict_t *PEntityOfEntOffset(int iEntOffset); +ENT() + +comments: + + . + +-------------------------------------------------------------------------- + +EntOffsetOfPEntity + +from engine/eiface.h: +int EntOffsetOfPEntity(const edict_t *pEdict); + +comments: + + . + +-------------------------------------------------------------------------- + +IndexOfEdict + +from engine/eiface.h: +int IndexOfEdict(const edict_t *pEdict); +ENTINDEX() + +comments: + + Returns the server slot (ie 1 to maxplayers) of the given player + edict. + +-------------------------------------------------------------------------- + +PEntityOfEntIndex + +from engine/eiface.h: +edict_t *PEntityOfEntIndex(int iEntIndex); +INDEXENT() + +comments: + + Returns the edict for the player in the given server slot (ie 1 to + maxplayers). + +-------------------------------------------------------------------------- + +FindEntityByVars + +from engine/eiface.h: +edict_t *FindEntityByVars(struct entvars_s *pvars); + +comments: + + . + +-------------------------------------------------------------------------- + +GetModelPtr + +from engine/eiface.h: +void *GetModelPtr(edict_t *pEdict); +GET_MODEL_PTR() + +comments: + + . + +-------------------------------------------------------------------------- + +RegUserMsg + +from engine/eiface.h: +int RegUserMsg(const char *pszName, int iSize); +REG_USER_MSG() + +comments: + + Register a network message type with the given name, and size if + known. Returns the number assigned for the network message, to be used + with MessageBegin. It appears that message ID's 1-63 are reserved for + the Engine, and that GameDLL messages are allocated IDs starting at + 64. The SDK dlls/util.h appears to define six Engine messages: + - SVC_TEMPENTITY = 23 + - SVC_INTERMISSION = 30 + - SVC_CDTRACK = 32 + - SVC_WEAPONANIM = 35 + - SVC_ROOMTYPE = 37 + - SVC_HLTV = 50 + +-------------------------------------------------------------------------- + +AnimationAutomove + +from engine/eiface.h: +void AnimationAutomove(const edict_t *pEdict, float flTime); + +comments: + + . + +-------------------------------------------------------------------------- + +GetBonePosition + +from engine/eiface.h: +void GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, +float *rgflAngles); +GET_BONE_POSITION() + +comments: + + . + +-------------------------------------------------------------------------- + +FunctionFromName + +from engine/eiface.h: +unsigned long FunctionFromName(const char *pName); +FUNCTION_FROM_NAME() + +comments: + + Apparently, this finds the given exported function name string in the + GameDLL, and returns a pointer to said function (much like unix dlsym + or win32 GetProcAddress?). This appears to be used in GameDLL code for + loading savegames, as the savegames contain names of exported + functions in the GameDLL. Basically, this is the opposite of + NameForFunction. + +-------------------------------------------------------------------------- + +NameForFunction + +from engine/eiface.h: +const char *NameForFunction(unsigned long function); +NAME_FOR_FUNCTION() + +comments: + + Basically, the opposite of FunctionFromName. Finds the given function + pointer address in the GameDLL, and returns the string name for the + corresponding function. This appears to be used in GameDLL code for + saving games, taking known function pointers and converting them to + function name strings to be stored in the savegames, so that they can + be converted back to function pointers upon game load. + +-------------------------------------------------------------------------- + +ClientPrintf + +from engine/eiface.h: +void ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg); +CLIENT_PRINTF() + + JOHN: engine callbacks so game DLL can print messages to individual + clients + +comments: + + . + +-------------------------------------------------------------------------- + +ServerPrint + +from engine/eiface.h: +void ServerPrint(const char *szMsg); + +comments: + + Prints output to the server console. + +-------------------------------------------------------------------------- + +Cmd_Args + +from engine/eiface.h: +const char *Cmd_Args(void); +CMD_ARGS() + + these 3 added so game DLL can easily access client 'cmd' strings + +comments: + + Returns the arguments for a command, as a single string. The command + string itself is not included, and must be queried with CMD_ARGV(0). + For use in DLLAPI ClientCommand, or in the function provided to + AddServerCommand. + +-------------------------------------------------------------------------- + +Cmd_Argv + +from engine/eiface.h: +const char *Cmd_Argv(int argc); +CMD_ARGV() + +comments: + + Returns the nth argument to the command. CMD_ARGV(0) returns the + command name itself. + +-------------------------------------------------------------------------- + +Cmd_Argc + +from engine/eiface.h: +int Cmd_Argc(void); +CMD_ARGC() + +comments: + + Returns the number of arguments given to the command. + +-------------------------------------------------------------------------- + +GetAttachment + +from engine/eiface.h: +void GetAttachment(const edict_t *pEdict, int iAttachment, float * +rgflOrigin, float *rgflAngles); +GET_ATTACHMENT() + +comments: + + . + +-------------------------------------------------------------------------- + +CRC32_Init + +from engine/eiface.h: +void CRC32_Init(CRC32_t *pulCRC); +CRC32_INIT() + +comments: + + . + +-------------------------------------------------------------------------- + +CRC32_ProcessBuffer + +from engine/eiface.h: +void CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); +CRC32_PROCESS_BUFFER() + +comments: + + . + +-------------------------------------------------------------------------- + +CRC32_ProcessByte + +from engine/eiface.h: +void CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); +CRC32_PROCESS_BYTE() + +comments: + + . + +-------------------------------------------------------------------------- + +CRC32_Final + +from engine/eiface.h: +CRC32_t CRC32_Final(CRC32_t pulCRC); +CRC32_FINAL() + +comments: + + . + +-------------------------------------------------------------------------- + +RandomLong + +from engine/eiface.h: +long RandomLong(long lLow, long lHigh); +RANDOM_LONG() + +comments: + + . + +-------------------------------------------------------------------------- + +RandomFloat + +from engine/eiface.h: +float RandomFloat(float flLow, float flHigh); +RANDOM_FLOAT() + +comments: + + . + +-------------------------------------------------------------------------- + +SetView + +from engine/eiface.h: +void SetView(const edict_t *pClient, const edict_t *pViewent); +SET_VIEW() + +comments: + + . + +-------------------------------------------------------------------------- + +Time + +from engine/eiface.h: +float Time(void); + +comments: + + . + +-------------------------------------------------------------------------- + +CrosshairAngle + +from engine/eiface.h: +void CrosshairAngle(const edict_t *pClient, float pitch, float yaw); +SET_CROSSHAIRANGLE() + +comments: + + . + +-------------------------------------------------------------------------- + +LoadFileForMe + +from engine/eiface.h: +byte * LoadFileForMe(char *filename, int *pLength); +LOAD_FILE_FOR_ME() + +comments: + + Opens the given filename (relative to the gamedir, or relative to the + hlds directory, in that order), and returns a pointer to a byte array + (character string) with the contents of the file. NULL-termination of + the array indicates end of file. Length of the file in bytes is + returned in the given int pointer. + +-------------------------------------------------------------------------- + +FreeFile + +from engine/eiface.h: +void FreeFile(void *buffer); +FREE_FILE() + +comments: + + Free the byte array of the given buffer which was returned by + LoadFileForMe. + +-------------------------------------------------------------------------- + +EndSection + +from engine/eiface.h: +void EndSection(const char *pszSectionName); + + trigger_endsection + +comments: + + . + +-------------------------------------------------------------------------- + +CompareFileTime + +from engine/eiface.h: +int CompareFileTime(char *filename1, char *filename2, int *iCompare); +COMPARE_FILE_TIME() + +comments: + + . + +-------------------------------------------------------------------------- + +GetGameDir + +from engine/eiface.h: +void GetGameDir(char *szGetGameDir); +GET_GAME_DIR() + +comments: + + Copies the pathname of the game directory into the given buffer. Note + that there's no way to inform the engine how big the buffer is, so be + forewarned. + + Prior to HL 1.1.1.1 (CS 1.6), this gave the full pathname of the game + directory, ie "/usr/local/half-life/cstrike" or "C:\Games\Half-Life\ + cstrike". Now, it is only the string passed to hlds as the argument to + "-game", ie "cstrike". + +-------------------------------------------------------------------------- + +Cvar_RegisterVariable + +from engine/eiface.h: +void Cvar_RegisterVariable(cvar_t *variable); +CVAR_CREATE() + +comments: + + . + +-------------------------------------------------------------------------- + +FadeClientVolume + +from engine/eiface.h: +void FadeClientVolume(const edict_t *pEdict, int fadePercent, int +fadeOutSeconds, int holdTime, int fadeInSeconds); + +comments: + + . + +-------------------------------------------------------------------------- + +SetClientMaxspeed + +from engine/eiface.h: +void SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed); + +comments: + + . + +-------------------------------------------------------------------------- + +CreateFakeClient + +from engine/eiface.h: +edict_t * CreateFakeClient(const char *netname); + + returns NULL if fake client can't be created + +comments: + + Creates "bots" (?). + +-------------------------------------------------------------------------- + +RunPlayerMove + +from engine/eiface.h: +void RunPlayerMove(edict_t *fakeclient, const float *viewangles, float +forwardmove, float sidemove, float upmove, unsigned short buttons, byte +impulse, byte msec); + +comments: + + . + +-------------------------------------------------------------------------- + +NumberOfEntities + +from engine/eiface.h: +int NumberOfEntities(void); +NUMBER_OF_ENTITIES() + +comments: + + . + +-------------------------------------------------------------------------- + +GetInfoKeyBuffer + +from engine/eiface.h: +char *GetInfoKeyBuffer(edict_t *e); + + passing in NULL gets the serverinfo + +comments: + + Returns the InfoKeyBuffer for the given edict. This is basically the + fields from "setinfo" at the client console, and includes things like + the player name. + + The sourcecode comment ("passing in NULL gets the serverinfo") isn't + entirely accurate. There appear to be two server-side info buffers + available, "serverinfo" and "localinfo", both accessible from the + console by those two commands, respectively. + + Calling GetInfoKeyBuffer(NULL) will return the localinfo buffer. + Calling GetInfoKeyBuffer(PEntityOfEntIndex(0)), ie passing the entity + of slot 0, will return the serverinfo buffer. + +-------------------------------------------------------------------------- + +InfoKeyValue + +from engine/eiface.h: +char *InfoKeyValue(char *infobuffer, char *key); + +comments: + + Returns the value for the given key in the given InfoKeyBuffer. + +-------------------------------------------------------------------------- + +SetKeyValue + +from engine/eiface.h: +void SetKeyValue(char *infobuffer, char *key, char *value); + +comments: + + Adds or sets a key/value pair in the given InfoKeyBuffer. Appears to + work for only server info, and not client info. For clients, use + SetClientKeyValue. + +-------------------------------------------------------------------------- + +SetClientKeyValue + +from engine/eiface.h: +void SetClientKeyValue(int clientIndex, char *infobuffer, char *key, char +*value); + +comments: + + Adds or sets a key/value pair in a client's InfoKeyBuffer, by server + slot (ie 1 to maxplayers). + +-------------------------------------------------------------------------- + +IsMapValid + +from engine/eiface.h: +int IsMapValid(char *filename); +IS_MAP_VALID() + +comments: + + . + +-------------------------------------------------------------------------- + +StaticDecal + +from engine/eiface.h: +void StaticDecal(const float *origin, int decalIndex, int entityIndex, int +modelIndex); + +comments: + + . + +-------------------------------------------------------------------------- + +PrecacheGeneric + +from engine/eiface.h: +int PrecacheGeneric(char *s); +PRECACHE_GENERIC() + +comments: + + . + +-------------------------------------------------------------------------- + +GetPlayerUserId + +from engine/eiface.h: +int GetPlayerUserId(edict_t *e); +GETPLAYERUSERID() + + returns the server assigned userid for this player. useful for logging + frags, etc. returns -1 if the edict couldn't be found in the list of + clients + +comments: + + Returns the session userid for the given player edict. As of server + x106, this is constant for the life of the player connection, and + unique for the life of the server process. Each time a client + connects, they are given a userid of 1 plus the userid of the previous + connecting client. When the server starts/restarts, the server starts + again at userid 1. + +-------------------------------------------------------------------------- + +BuildSoundMsg + +from engine/eiface.h: +void BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int +*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, +int msg_type, const float *pOrigin, edict_t *ed); +BUILD_SOUND_MSG() + +comments: + + . + +-------------------------------------------------------------------------- + +IsDedicatedServer + +from engine/eiface.h: +int IsDedicatedServer(void); +IS_DEDICATED_SERVER() + + is this a dedicated server? + +comments: + + . + +-------------------------------------------------------------------------- + +CVarGetPointer + +from engine/eiface.h: +cvar_t *CVarGetPointer(const char *szVarName); +CVAR_GET_POINTER() + +comments: + + Returns a pointer to a cvar_t struct for the given cvar (server + variable) name. + +-------------------------------------------------------------------------- + +GetPlayerWONId + +from engine/eiface.h: +unsigned int GetPlayerWONId(edict_t *e); +GETPLAYERWONID() + + returns the server assigned WONid for this player. useful for logging + frags, etc. returns -1 if the edict couldn't be found in the list of + clients + +comments: + + Returns the WON id for the given player edict. As of server x106, this + should be unique per client CD KEY, and should be consistent across + all WON auth servers. + +-------------------------------------------------------------------------- + +Info_RemoveKey + +from engine/eiface.h: +void Info_RemoveKey(char *s, const char *key); + + YWB 8/1/99 TFF Physics additions + +comments: + + . + +-------------------------------------------------------------------------- + +GetPhysicsKeyValue + +from engine/eiface.h: +const char *GetPhysicsKeyValue(const edict_t *pClient, const char *key); + +comments: + + . + +-------------------------------------------------------------------------- + +SetPhysicsKeyValue + +from engine/eiface.h: +void SetPhysicsKeyValue(const edict_t *pClient, const char *key, const +char *value); + +comments: + + . + +-------------------------------------------------------------------------- + +GetPhysicsInfoString + +from engine/eiface.h: +const char *GetPhysicsInfoString(const edict_t *pClient); +ENGINE_GETPHYSINFO() + +comments: + + . + +-------------------------------------------------------------------------- + +PrecacheEvent + +from engine/eiface.h: +unsigned short PrecacheEvent(int type, const char *psz); +PRECACHE_EVENT() + +comments: + + . + +-------------------------------------------------------------------------- + +PlaybackEvent + +from engine/eiface.h: +void PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short +eventindex, float delay, float *origin, float *angles, float fparam1, +float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); +PLAYBACK_EVENT_FULL() + +comments: + + . + +-------------------------------------------------------------------------- + +SetFatPVS + +from engine/eiface.h: +unsigned char *SetFatPVS(float *org); +ENGINE_SET_PVS() + +comments: + + . + +-------------------------------------------------------------------------- + +SetFatPAS + +from engine/eiface.h: +unsigned char *SetFatPAS(float *org); +ENGINE_SET_PAS() + +comments: + + . + +-------------------------------------------------------------------------- + +CheckVisibility + +from engine/eiface.h: +int CheckVisibility(const edict_t *entity, unsigned char *pset); +ENGINE_CHECK_VISIBILITY() + +comments: + + . + +-------------------------------------------------------------------------- + +DeltaSetField + +from engine/eiface.h: +void DeltaSetField(struct delta_s *pFields, const char *fieldname); +DELTA_SET() + +comments: + + . + +-------------------------------------------------------------------------- + +DeltaUnsetField + +from engine/eiface.h: +void DeltaUnsetField(struct delta_s *pFields, const char *fieldname); +DELTA_UNSET() + +comments: + + . + +-------------------------------------------------------------------------- + +DeltaAddEncoder + +from engine/eiface.h: +void DeltaAddEncoder(char *name, void (*conditionalencode)( struct delta_s +*pFields, const unsigned char *from, const unsigned char *to) ); +DELTA_ADDENCODER() + +comments: + + . + +-------------------------------------------------------------------------- + +GetCurrentPlayer + +from engine/eiface.h: +int GetCurrentPlayer(void); +ENGINE_CURRENT_PLAYER() + +comments: + + . + +-------------------------------------------------------------------------- + +CanSkipPlayer + +from engine/eiface.h: +int CanSkipPlayer(const edict_t *player); +ENGINE_CANSKIP() + +comments: + + . + +-------------------------------------------------------------------------- + +DeltaFindField + +from engine/eiface.h: +int DeltaFindField(struct delta_s *pFields, const char *fieldname); +DELTA_FINDFIELD() + +comments: + + . + +-------------------------------------------------------------------------- + +DeltaSetFieldByIndex + +from engine/eiface.h: +void DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber); +DELTA_SETBYINDEX() + +comments: + + . + +-------------------------------------------------------------------------- + +DeltaUnsetFieldByIndex + +from engine/eiface.h: +void DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber); +DELTA_UNSETBYINDEX() + +comments: + + . + +-------------------------------------------------------------------------- + +SetGroupMask + +from engine/eiface.h: +void SetGroupMask(int mask, int op); +ENGINE_SETGROUPMASK() + +comments: + + . + +-------------------------------------------------------------------------- + +CreateInstancedBaseline + +from engine/eiface.h: +int CreateInstancedBaseline(int classname, struct entity_state_s * +baseline); +ENGINE_INSTANCE_BASELINE() + +comments: + + . + +-------------------------------------------------------------------------- + +Cvar_DirectSet + +from engine/eiface.h: +void Cvar_DirectSet(struct cvar_s *var, char *value); + +comments: + + . + +-------------------------------------------------------------------------- + +ForceUnmodified + +from engine/eiface.h: +void ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char +*filename); +ENGINE_FORCE_UNMODIFIED() + + Forces the client and server to be running with the same version of + the specified file ( e.g., a player model ). Calling this has no + effect in single player. + +comments: + + . + +-------------------------------------------------------------------------- + +GetPlayerStats + +from engine/eiface.h: +void GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss); +PLAYER_CNX_STATS() + +comments: + + . + +-------------------------------------------------------------------------- + +AddServerCommand + +from engine/eiface.h: +void AddServerCommand(char *cmd_name, void (*function) (void)); + +comments: + + Registers a new server console command. When the given command string + is typed at the console, the given function will be called. Arguments + for the command can be retrieved in the function with Cmd_Args, + Cmd_Argv, and Cmd_Argc. + +-------------------------------------------------------------------------- + +Voice_GetClientListening + +from engine/eiface.h: +qboolean Voice_GetClientListening)(int iReceiver, int iSender); + + For voice communications, set which clients hear each other. NOTE: + these functions take player entity indices (starting at 1). + +comments: + + Added in SDK 2.2. + +-------------------------------------------------------------------------- + +Voice_SetClientListening + +from engine/eiface.h: +qboolean Voice_SetClientListening)(int iReceiver, int iSender, qboolean +bListen); + + For voice communications, set which clients hear each other. NOTE: + these functions take player entity indices (starting at 1). + +comments: + + Added in SDK 2.2. + +-------------------------------------------------------------------------- + +GetPlayerAuthId + +from engine/eiface.h: +const char *GetPlayerAuthId(edict_t *e); + +From Eric Smith on hlcoders +(list.valvesoftware.com/pipermail/hlcoders/2002-April/002865.html): + + The AuthID is a way for applications/mods to get the Authentication ID + (uniqueID) for a player. The AuthID can be a WonID or a SteamID. The + function I've written returns the AuthID as a string. Calling + GetPlayerWONId will still work for Non-Steam players just like it + always has. If applications/mods want to get a jump start on getting + ready to support Steam players, then they can start using + GetPlayerAuthId, which will still work for Non-Steam players, but it + will give the WonID as a string instead of an unsigned int. + +From Eric Smith on servertest: +(list.valvesoftware.com/pipermail/servertest/2002-April/000567.html) + + Only clients playing via Steam will have SteamIDs. Clients who are not + using Steam will still have WonIDs (just like they always have). The + server now supports WonIDs\SteamIDs and banning using either of them. + WonIDs have not changed. SteamIDs use the format: STEAM_<#>:<#> where + <#> is replaced by numbers. An example SteamID would be "STEAM_0: + 94534". + +From Eric Smith on hlcoders: +(list.valvesoftware.com/pipermail/hlcoders/2002-April/002925.html) + + This function will now return the string "BOT" as the AuthID for fake + clients. + +comments: + + Added for HL 1109; no SDK update. + +-------------------------------------------------------------------------- + +SequenceGet + +from engine/eiface.h: +void *SequenceGet(const char *fileName, const char *entryName); + +comments: + + Added for HL 1xxx; no SDK update. + +-------------------------------------------------------------------------- + +SequencePickSentence + +from engine/eiface.h: +void *SequencePickSentence(const char *groupName, int pickMethod, int * +picked); + +comments: + + Added for HL 1xxx; no SDK update. + +-------------------------------------------------------------------------- + +GetFileSize + +from engine/eiface.h: +int GetFileSize(char *filename); + +comments: + + Added for HL 1xxx; no SDK update. + +-------------------------------------------------------------------------- + +GetApproxWavePlayLen + +from engine/eiface.h: +unsigned int GetApproxWavePlayLen(const char *filepath); + +comments: + + Added for HL 1xxx; no SDK update. + +-------------------------------------------------------------------------- + +IsCareerMatch + +from engine/eiface.h: +int IsCareerMatch(void); + +comments: + + Added for HL 1xxx; no SDK update. + +-------------------------------------------------------------------------- + +GetLocalizedStringLength + +from engine/eiface.h: +int GetLocalizedStringLength(const char *label); + +comments: + + Added for HL 1xxx; no SDK update. + +-------------------------------------------------------------------------- + +RegisterTutorMessageShown + +from engine/eiface.h: +void RegisterTutorMessageShown(int mid); + +comments: + + Added for HL 1xxx; no SDK update. + +-------------------------------------------------------------------------- + +GetTimesTutorMessageShown + +from engine/eiface.h: +int GetTimesTutorMessageShown(int mid); + +comments: + + Added for HL 1xxx; no SDK update. + +-------------------------------------------------------------------------- + +ProcessTutorMessageDecayBuffer + +from engine/eiface.h: +void ProcessTutorMessageDecayBuffer(int *buffer, int bufferLength); + +comments: + + Added for HL 1xxx; no SDK update. + +-------------------------------------------------------------------------- + +ConstructTutorMessageDecayBuffer + +from engine/eiface.h: +void ConstructTutorMessageDecayBuffer(int *buffer, int bufferLength); + +comments: + + Added for HL 1xxx; no SDK update. + +-------------------------------------------------------------------------- + +ResetTutorMessageDecayData + +from engine/eiface.h: +void ResetTutorMessageDecayData(void); + +comments: + + Added for HL 1xxx; no SDK update. + +-------------------------------------------------------------------------- diff --git a/doc/txt/faq.txt b/doc/txt/faq.txt new file mode 100644 index 0000000..89dceaf --- /dev/null +++ b/doc/txt/faq.txt @@ -0,0 +1,120 @@ +Metamod FAQ +=-=-=-=-=-= + +Please add support for (some) mod. + + Please see game support requirements in the documentation. + +How do I use bots with Metamod? + + If the bot is not a Metamod plugin, then you will need to tell Metamod + to use your bot as the gamedll, by specifying it on the hlds command + line with the "+localinfo mm_gamedll" option. See the Metamod docs. + See also the AdminMod docs (www.adminmod.org/help/online/Configuration + /How_to_Use_Bots_with_MetaMod_AM_2.50_and_up.htm). + +The download links give corrupt files. + + I think what you're observing is that your web client is quietly + uncompressing the file, but not updating the name of the downloaded + file to reflect this. In particular, some web clients will silently + decompress (gunzip) files _without_ removing the ".gz" from the + filename, so you'll end up with a file "metamod_i386.so.gz" which is + _really_ "metamod_i386.so", and so trying to gunzip it will produce an + error ("not in gzip format"). Try running "file" on the resulting file + to see what the OS thinks it is. Or, where you don't have "file" (ie + windows), just look at the file size - it should be pretty indicative + of whether the file is still compressed or not. + +How do I install Metamod? + + This is covered briefly in the Metamod docs. Typically, though, + Metamod is installed as part of some major plugin, like AdminMod + (www.adminmod.org/). There is also some discussion of installing + Metamod by hand in the AdminMod docs (www.adminmod.org/help/online/ + Installing/Manual_Installation_-_Walk-Through.htm). If you already + have Metamod installed and merely want to update it, this requires + only replacing the .so/.dll with the latest version from the webpage + (metamod.org/). + +I'm having trouble with AdminMod. + + You'll need to ask your AdminMod questions on the AdminMod forums + (www.ozforums.com/forumdisplay.php?forumid=143). + +How do I do (something) in a Metamod plugin? + + Generally speaking, a Metamod plugin works very much like an Half-Life + Game Mod, since all it's doing is making the same calls to the same + SDK that the Game Mod does. So, the question typically isn't "how do I + do this in Metamod?" but instead "how do I do this in an Half-Life + Mod?", and is best asked in a HL SDK Programming forum/mailinglist + (see related links and especially Botman's MOD FAQ (planethalflife.com + /botman/MOD_FAQ.shtml)). Once you figure out how it would normally be + done in a Game Mod, figuring out how to do it in Metamod is relatively + straightforward. + + However, if you have questions on how to convert a piece of code from + HLmod to Metamod plugin, then I can provide some pointers, or you can + ask on the Metamod mailing list (groups.yahoo.com/group/metamod/). And + of course, if you have questions about things in the code specific to + Metamod (ie things mentioned in the Metamod Coding docs) feel free to + ask me or on the mailing list. + +Is there a tutorial or example of how to write a Metamod plugin? + + The sourcecode includes a couple of plugins that can be used as + examples. The "stub" plugin is the bare basics of what a plugin needs. + The "trace" plugin provides an example of hooking _every_ SDK + function. The "wdmisc" plugin provides a couple of basic useful + features. You can also look at several of the other plugins out there + for more examples. + + Note that the example plugins in the Metamod sourcecode show how to + use Metamod to interface with Half-Life code, but they mostly assume + you already know how to write Half-Life code. If you need examples or + info on how to write Half-Life code itself, you'll need to go look + through the HL SDK programming websites (see related links and + Botman's MOD FAQ (planethalflife.com/botman/MOD_FAQ.shtml)). + +I have (or know of) a Metamod plugin not listed on the webpage. + + Send me the information about the plugin (name, author, description, + URL), and I'd be happy to provide a link from the webpage. + +I'm having trouble compiling under MSVC. + + Please note that I do not use MSVC, so I can't help a lot with using + that compiler. I do all my development under linux, using gcc for + linux binaries and mingw32 (www.mingw.org/) for windows binaries. The + sourcecode does include an MSVC project file for Metamod, as well as a + project file for the stub plugin, both mostly as examples. They should + work, and indeed did work the last time I dug up MSVC to test them. + That said, there are a few folks on the Metamod mailing list + (groups.yahoo.com/group/metamod/) that do use MSVC, so you might find + some assistance there. + +If I create a Metamod plugin, does it have to be open source? + + Generally speaking, yes. The way the GPL is interpreted, plugins of a + GPL program need to be also GPL. See also the FAQ entry on the GNU + site about plugins of a GPL program (www.gnu.org/licenses/gpl-faq.html + #GPLAndPlugins). + +How about a port of Metamod to other engines like Q3, Unreal, etc? + + I haven't looked into it myself, but several folks on the AdminMod + team (from which Metamod was derived) had looked at porting to other + games like Q3 and UT, and determined that those engines either didn't + provide the necessary API hooks, or that they already provided a + suitable method for extending functionality. So, I wouldn't expect to + see a version of Metamod for those. Perhaps for some other future + engines, although I believe most modern engines are now providing + their own method for extensions or plugins, so that a third-party + solution like Metamod wouldn't be necessary. + + If Half-Life 2 ever sees the light of day, I expect I'd look seriously + at porting to that - unless, of course, Valve ends up providing their + own plugin framework themselves. :) + +-------------------------------------------------------------------------- diff --git a/doc/txt/gamesupport.txt b/doc/txt/gamesupport.txt new file mode 100644 index 0000000..dfeef2b --- /dev/null +++ b/doc/txt/gamesupport.txt @@ -0,0 +1,6 @@ +Adding Game/Mod Support +=-=-=-=-=-=-=-=-=-=-=-= + +Metamod-P already supports your Mod. + +-------------------------------------------------------------------------- diff --git a/doc/txt/links.txt b/doc/txt/links.txt new file mode 100644 index 0000000..3db6c8e --- /dev/null +++ b/doc/txt/links.txt @@ -0,0 +1,129 @@ +Related links +============= + +Here's a list of links, other sites, and information I found useful when +working on Metamod: + + - AdminMod's DLL Forum (www.ozforums.com/forumdisplay.php?forumid=114) + - AdminMod CVS at Sourceforge (cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ + halflifeadmin/) + + - Valve Editing Resource Center (collective.valve-erc.com/), Valve's + official site + - Botman's Bots (planethalflife.com/botman/) + - Half-Life Programming Planet (hlpp.valveworld.com/) + - Shadowman's Half-Life SDK2 Site (planethalflife.com/hlsdk2) + - Half-Life Coding Pages (www.planethalflife.com/botman/balfourroad/ + index.shtml) + - Fixxxer's HL Coding page (planethalflife.com/fixxxer/) + - The Handy Vandal's HL Coding Links (www.karljones.com/halflife/ + coding.asp) + + - Half-Life SDK Forums (www.chatbear.com/cgi-bin/board.pl?boardid=942), + at the VERC + - Half-Life SDK Forums (www.chatbear.com/cgi-bin/board.pl?action= + boardlisting&boardid=590), at Valve's former SDK site + - HL Coders mailing list (www.topica.com/lists/hlcoders), at topica.com + - Botman's forums (dynamic.gamespy.com/~botman/yabb/YaBB.pl) + - Wavelength Half-Life Coding Forum (www.thewavelength.net/forums/ + index.php?act=SF&f=13) + - SDK2 Forum (pub21.ezboard.com/fshadowmanshalflifeforumsdk2), at + ezboard.com + - HL Programming Forum (dynamic.gamespy.com/~hlprogramming/ultimatebb/ + forumdisplay.cgi?action=topics&forum=Coding&number=1), at gamespy.com + - Fixxxer's HL Coding forum (network54.com/Hide/Forum/goto?forumid= + 21807) + - HL Programming Forum (forums.gamedesign.net/forums/wwwthreads.pl? + action=list&Board=halflife_coding), at gamedesign.net + + - C FAQ (www.eskimo.com/~scs/C-faq/top.html) + - C++ FAQ Lite (www.parashift.com/cpp-faq-lite/) + - C++ FAQ Index (www.calpoly.edu/~jfischer/c++faq/index.html) + - alt.comp.lang.learn.c-c++ FAQ (snurse-l.org/acllc-c++/faq) + - C++ Annotations (dragon.klte.hu/~kollarl/C++/cplusplu.html), guide for + C programmers to using C++ + - C++ Portability Guide (www.mozilla.org/hacking/portable-cpp.html) + - Standard Template Library Programmer's Guide (www.sgi.com/tech/stl/), + at SGI + - comp.std.c++ FAQ (reality.sgi.com/austern_mti/std-c++/faq.html) + - GNU g++ FAQ (www.landfield.com/faqs/g++-FAQ/plain/) + - GNU libstdc++ FAQ (gcc.gnu.org/onlinedocs/libstdc++/faq/) + - C++ References (www.apl.jhu.edu/~paulmac/c++-references.html), books + and other links + - Thinking in C++ (www.mindview.net/Books/TICPP/ThinkingInCPP2e.html), + free electronic book + + - comp.programming.threads FAQ (www.serpentine.com/~bos/threads-faq/) + - comp.programming.threads FAQ #2 (www.lambdacs.com/cpt/FAQ.html) + - Implementing POSIX Condition Variables in Win32 (www.cs.wustl.edu/ + ~schmidt/win32-cv-1.html) + + - Microsoft Developer Network (msdn.microsoft.com/), online win32 API + docs + - Win32 Programming FAQ (www.iseran.com/Win32/FAQ/) + - Minimal Gnu for Windows (mingw) (www.mingw.org/), gcc for win32 + - Creating DLLs w/mingw (www.geocities.com/Tokyo/Towers/6162/win32/dll/ + make.html) + - Mingw binaries (www.devolution.com/~slouken/SDL/Xmingw32/) + - Mingw binaries (newer) (members.telering.at/jessich/mingw/index.html) + +Books + +And here are books I picked up that I found useful as well: + + - C: A Reference Manual (vig.prenhall.com/catalog/academic/product/ + 1,4096,0133262243,00.html), by Samuel Harbison & Guy Steele + (www.sls.lcs.mit.edu/~hurley/guysteele.html) (at Bookpool + (www.bookpool.com/.x//sm/0133262243), at Amazon (www.amazon.com/exec/ + obidos/ASIN/0133262243)) + - C Programming FAQs (cseng.aw.com/book/0,3828,0201845199,00.html), by + Steve Summit (www.eskimo.com/~scs/) (at Bookpool (www.bookpool.com/.x/ + /sm/0201845199), at Amazon (www.amazon.com/exec/obidos/ASIN/ + 0201845199)) + + - C++: The Core Language (www.oreilly.com/catalog/core/), by Gregory + Satir & Doug Brown (at Bookpool (www.bookpool.com/.x//sm/156592116X), + at Amazon (www.amazon.com/exec/obidos/ASIN/156592116X)) + - C++ Programming Language Special Edition (cseng.aw.com/book/ + 0,3828,0201700735,00.html), by Bjarne Stroustrup (www.research.att.com + /~bs/) (at Bookpool (www.bookpool.com/.x//sm/0201700735), at Amazon + (www.amazon.com/exec/obidos/ASIN/0201700735)) + - The C++ Standard Library: A Tutorial and Reference (cseng.aw.com/book/ + 0,3828,0201379260,00.html), by Nicolai Josuttis (www.josuttis.de/ + indexe.html) (at Bookpool (www.bookpool.com/.x//sm/0201379260), at + Amazon (www.amazon.com/exec/obidos/ASIN/0201379260)) + - C++ FAQs (cseng.aw.com/book/0,3828,0201309831,00.html), by Marshall + Cline (www.parashift.com/), Greg Lomow, & Mike Girou (at Bookpool + (www.bookpool.com/.x//sm/0201309831), at Amazon (www.amazon.com/exec/ + obidos/ASIN/0201309831)) + - Effective C++ (cseng.aw.com/book/0,,0201924889,00.html), by Scott + Meyers (www.aristeia.com/) (at Bookpool (www.bookpool.com/.x//sm/ + 0201924889), at Amazon (www.amazon.com/exec/obidos/ASIN/0201924889)) + - Algorithms in C++, Parts 1-4 (cseng.aw.com/book/ + 0,,0201350882,00.html), by Robert Sedgewick (www.cs.princeton.edu/~rs + /) (at Bookpool (www.bookpool.com/.x//sm/0201350882), at Amazon + (www.amazon.com/exec/obidos/ASIN/0201350882)) + + - Advanced Programming in the UNIX Environment (cseng.aw.com/book/ + 0,3828,0201563177,00.html), by W. Richard Stevens (www.kohala.com/) + (at Bookpool (www.bookpool.com/.x//sm/0201563177), at Amazon + (www.amazon.com/exec/obidos/ASIN/0201563177)) + - Win32 System Programming (cseng.aw.com/book/ + 0,3828,0201703106,00.html), by Johnson Hart (world.std.com/~jmhart/) + (at Bookpool (www.bookpool.com/.x//sm/0201703106), at Amazon + (www.amazon.com/exec/obidos/ASIN/0201703106)) + - Managing Projects with Make (www.oreilly.com/catalog/make2/), by + Andrew Oram & Steve Talbott (www.oreilly.com/~stevet/) (at Bookpool + (www.bookpool.com/.x//sm/0937175900), at Amazon (www.amazon.com/exec/ + obidos/ASIN/0937175900)) + + - Thread Time (vig.prenhall.com/catalog/academic/product/ + 1,4096,0131900676,00.html), by Scott Norton & Mark DiPasquale (at + Bookpool (www.bookpool.com/.x//sm/0131900676), at Amazon + (www.amazon.com/exec/obidos/ASIN/0131900676)) + - Programming with POSIX Thrads (cseng.awl.com/book/ + 0,3828,0201633922,00.html), by David Butenhof (at Bookpool + (www.bookpool.com/.x//sm/0201633922), at Amazon (www.amazon.com/exec/ + obidos/ASIN/0201633922)) + +-------------------------------------------------------------------------- diff --git a/doc/txt/maillist.txt b/doc/txt/maillist.txt new file mode 100644 index 0000000..3f8bb5b --- /dev/null +++ b/doc/txt/maillist.txt @@ -0,0 +1,25 @@ +Mailing lists +=-=-=-=--=-=-= + +I've created a couple of lists on YahooGroups (formerly egroups (formerly +onelist)): + + - metamod-announce (groups.yahoo.com/group/metamod-announce/) for + announcements of new versions and plugins + - metamod (groups.yahoo.com/group/metamod/) for questions, support, + discussion, etc + +There are simple subscribe forms below. + + Subscribe to metamod-announce + [enter email address ] + groups.yahoo.com/metamod-announce Click here to join metamod-announce + (groups.yahoo.com/group/ + metamod-announce/) + + Subscribe to metamod + [enter email address ] Click here to join metamod + groups.yahoo.com/metamod (groups.yahoo.com/ + group/metamod/) + +-------------------------------------------------------------------------- diff --git a/doc/txt/metamod.txt b/doc/txt/metamod.txt new file mode 100644 index 0000000..712b3f7 --- /dev/null +++ b/doc/txt/metamod.txt @@ -0,0 +1,568 @@ +Using Metamod +=-=-=-=-=-=-= + +Client Commands +=============== + +Similar to the server console interface, clients can also issue commands +to Metamod, of the following form: + + - meta version - displays version information about the Metamod instance + currently running on the server, ie: + + Metamod v1.21p37 2013/05/30 (5:13) + by Will Day + http://www.metamod.org/ + Patch: Metamod-P (mm-p) v37 + by Jussi Kivilinna + http://koti.mbnet.fi/axh/ + compiled: Feb 18 2013, 11:53:27 EET (optimized) + + - meta list - displays information about the list of currently running + plugins, ie: + + Currently running plugins: + [ 1] Trace HLSDK API, v1.XX.93, 2003/02/17, by Will Day + , see http://www.metamod.org/ + [ 2] Adminmod, v2.50.56 (MM), Jul 13 2003, by Alfred Reynolds + , see http://www.adminmod.org/ + 2 plugins + +Client Cvars +============ + +Also available to client browser applications is a cvar metamod_version +that should report the version of Metamod running on the server, ie: + +"metamod_version" is "1.21p37" + +Installation +============ + +If you want to install Metamod by hand, here's what you have to do: + + + - Install the Metamod library (.dll for win32, or .so for linux) to a + directory under your game directory. For instance, if you were running + Counter-Strike, under win32 you might want have: + + half-life/cstrike/addons/metamod/dlls/metamod.dll + + If a directory you want doesn't exist, create it. + + - Edit the "liblist.gam" file in your game directory, replacing the game + dll filename with the Metamod dll filename. For instance with + Counter-Strike, you would change: + + gamedll "dlls/mp.dll" + gamedll_linux "dlls/cs.so" + + to: + + gamedll "addons/metamod/dlls/metamod.dll" + gamedll_linux "addons/metamod/dlls/metamod.so" + + Note that it's only really necessary to change the line corresponding + to your OS (win32 or linux); you can leave the other line unchanged, + or you can change it - it doesn't matter. + + - To load plugins at game startup, you'll need to create a "plugins.ini" + file containing a list of the plugins you want to load. + + +Configuration +============= + +Metamod has several ways to provide config options, partially because it +started with one method and then added other methods, but also because one +method can be more convenient than the other, varying with the situation. + +Generally speaking, the two methods of providing configuration information +to Metamod are: + + - on the command line, via +localinfo arguments to hlds. + - as the contents of some file that Metamod reads and parses. + +The confusing part can come when the pathnames to some of the config files +can be specified via command line options - or indeed, when the pathnames +to some config files can be specified in other config files. + +In any case, here are the various config options and config files Metamod +uses, (listed in order of priority), where "$gamedir" indicates the game +directory, ie "cstrike": + + - +localinfo mm_configfile + + - +localinfo mm_pluginsfile + - config.ini option: plugins_file + - $gamedir/addons/metamod/plugins.ini + - $gamedir/metamod.ini + + - $localinfo mm_execcfg + - config.ini option: exec_cfg + - $gamedir/addons/metamod/exec.cfg + - $gamedir/metaexec.cfg + + - $localinfo mm_gamedll + - config.ini option: gamedll + - [DEL]$gamedir/metagame.ini[DEL] -- NO LONGER SUPPORTED. + + +File: plugins.ini +===== + +Default location: _$gamedir/addons/metamod/plugins.ini, ie "cstrike/addons +/metamod/plugins.ini". + +Plugins are described in a file "plugins.ini" and each line describes a +plugin to load: + + [] + +Fields are whitespace delimited (tabs/spaces). + + - Platform is a keyword, either "linux" or "win32". + + - Filepath is a path to the DLL/so file. Relative paths are from the + game dir; absolute paths are also valid. Paths should use unix-style + forward slashes (/) and not backward slashes (\), even on windows + platforms. + + Also, the filepath (once expanded to full path name) is expected to be + unique within the list of plugins. Thus, a plugin with a fullpathname + matching that of a previous plugin is considered a duplicate, and is + not loaded. + + - Description is an optional description of the plugin, used in place of + the plugin's internal name in log messages and console output. + Whitespace in the description _is_ allowed; quoting is unnecessary. + +Comments are recognized at _only_ the beginning of a line, and can be in +either shell style ("#") or c++ style ("//"). + +For instance, in "cstrike/addons/metamod/plugins.ini" these are all valid +lines: + + // linux dlls/mybot.so + # win32 dlls/mybot-old.dll Mybot old + win32 dlls/mybot.dll Mybot current + linux /tmp/stub_mm_i386.so + win32 /tmp/stub_mm_i386.dll + linux ../dlls/trace_mm_i386.so + win32 ../dlls/trace_mm_i386.dll + linux dlls/admin_MM_i386.so + win32 dlls/admin_MM_i386.dll + +Note that order in the plugins.ini file _is_ significant. Plugins are +loaded and accessed in the order specified, so ordering can be important, +depending on the plugin(s). + +The file is re-read at changelevel, as well as on demand (via "meta +refresh" console command; see below). When the file is re-read, it will: + + - load any new plugins added to the file + - unload any plugins that have been deleted from the file. This is only + applicable to plugins loaded _from the inifile_. If the plugin was + loaded from the console, it will not be unloaded during a refresh, + whether it's in the inifile or not. + - reload any plugin whose file on disk has been updated since it was + loaded. Note this appears to be only useful under linux, as under + Windows you cannot rename or overwrite an open DLL, so it doesn't look + a loaded plugin could ever have a newer file on disk. Oh well. + +The game dll is auto-detected, along the same lines AdminMod operated +(looking at the "gamedir"); see "mm_gamedll" below if you want to use a +"bot" DLL. + +You can override the name of this file by specifying it via the +localinfo +field "mm_pluginsfile". + +For compatibility with previous versions, Metamod will also look for a +file "metamod.ini" under the gamedir, ie "cstrike/metamod.ini". + + +File: config.ini +===== + +Default location: _$gamedir/addons/metamod/config.ini, ie "cstrike/addons/ +metamod/config.ini". + +This contains basic config information, at the moment duplicating most of +the +localinfo variables, but allowing for more flexible expansion of +config options in the future. Also, it provides somewhat more reliable +options setting, since +localinfo munges some argument values (in +particular, pathnames with leading dots, ie "../dlls/blah.dll"). + +Basic format is: + +