2
0
mirror of https://github.com/rehlds/metamod-r.git synced 2025-01-26 05:28:19 +03:00

Modification from ReHLDS Team

This commit is contained in:
Adidasman 2016-07-04 13:11:20 +06:00
parent 72cd86b431
commit 6f2ad90696
428 changed files with 106991 additions and 22921 deletions

15
.gitignore vendored
View File

@ -1,2 +1,13 @@
#temporary files
*~
.idea
*.iml
**/msvc/Debug*
**/msvc/Release*
**/msvc/*.sdf
**/msvc/*.opensdf
**/msvc/*.user
**/msvc/*.suo
**/msvc/*.aps
**/msvc/*.pch
**/msvc/*.txt
**/msvc/ipch
**/*.log

View File

@ -1,35 +0,0 @@
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.
--------------------------------------------------------------------------

View File

@ -1,4 +0,0 @@
PROJNAME = metamod
#SUBDIRS := $(shell find */Makefile | sed "s/.Makefile//")
SUBDIRS = metamod stub_plugin trace_plugin wdmisc_plugin

340
GPL.txt
View File

@ -1,340 +0,0 @@
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.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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.
<signature of Ty Coon>, 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.

View File

@ -1,31 +1,53 @@
# vi: set ts=4 sw=4 :
# vim: set tw=75 :
COMPILER = /opt/intel/bin/icpc
SDKSRC = sdk
DIRSRC = src
NAME = metamod
# MetaMod toplevel makefile
# Copyright (c) 2001-2003 Will Day <willday@hpgx.net>
#
# some sections as demonstated in GNU's make.info documentation
SRCFILES = src/api_hook.cpp src/api_info.cpp src/commands_meta.cpp src/conf_meta.cpp \
src/dllapi.cpp src/engine_api.cpp src/engineinfo.cpp src/game_support.cpp \
src/game_autodetect.cpp src/h_export.cpp src/linkplug.cpp \
src/log_meta.cpp src/meta_eiface.cpp src/metamod.cpp src/mlist.cpp src/mplayer.cpp \
src/mplugin.cpp src/mreg.cpp src/mutil.cpp src/osdep.cpp src/osdep_p.cpp src/reg_support.cpp src/sdk_util.cpp \
src/support_meta.cpp src/vdate.cpp src/osdep_linkent_linux.cpp src/osdep_detect_gamedll_linux.cpp
include Config.mak
OBJECTS = $(SRCFILES) lib/libirc.a lib/linux32/libaelf32.a
ifeq "$(USER)" "willday"
include priv/top.mak
endif
LINK = -lm -ldl -static-intel -static-libgcc -no-intel-extensions
.DEFAULT:
for i in $(SUBDIRS); do \
$(MAKE) -C $$i $@ || exit; \
done
OPT_FLAGS = -O3 -msse3 -no-prec-div -fp-model fast=2 -funroll-loops -fomit-frame-pointer -fno-stack-protector \
-D__METAMOD_BUILD__ -D__BUILD_FAST_METAMOD__ -D__INTERNALS_USE_REGPARAMS__
.PHONY: subdirs dlls $(SUBDIRS)
INCLUDE = -I. -I$(DIRSRC) -I$(SDKSRC)/common -I$(SDKSRC)/engine -I$(SDKSRC)/dlls -I$(SDKSRC)/pm_shared
subdirs: $(SUBDIRS)
BIN_DIR = Release
CFLAGS = $(OPT_FLAGS)
$(SUBDIRS):
$(MAKE) -C $@
CFLAGS += -g -fvisibility=hidden -fvisibility-inlines-hidden -DNDEBUG -Dlinux -D__linux__ -std=c++0x -shared -wd147,274 -fasm-blocks
clean cleanall:
for i in $(SUBDIRS); do \
$(MAKE) -C $$i cleanall || exit; \
done
-rm dlls/* dlls/debug/*
OBJ_LINUX := $(OBJECTS:%.c=$(BIN_DIR)/%.o)
$(BIN_DIR)/%.o: %.c
$(COMPILER) $(INCLUDE) $(CFLAGS) -o $@ -c $<
all:
mkdir -p $(BIN_DIR)
mkdir -p $(BIN_DIR)/sdk
$(MAKE) $(NAME) && strip -x $(BIN_DIR)/$(NAME).so
$(NAME): $(OBJ_LINUX)
$(COMPILER) $(INCLUDE) $(CFLAGS) $(OBJ_LINUX) $(LINK) -o$(BIN_DIR)/$(NAME).so
check:
cppcheck $(INCLUDE) --quiet --max-configs=100 -D__linux__ -DNDEBUG -DHAVE_STDINT_H .
debug:
$(MAKE) all DEBUG=false
default: all
clean:
rm -rf Release/*.o
rm -rf Release/$(NAME).so
rm -rf Debug/*.o
rm -rf Debug/$(NAME).so

View File

@ -1,7 +0,0 @@
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/

BIN
bin/metamod.dll Normal file

Binary file not shown.

BIN
bin/metamod.so Normal file

Binary file not shown.

View File

@ -1,992 +0,0 @@
# 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 <yes/no>' 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 <yes/no>' 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 <number>
gamedll <path>
plugins_file <path>
exec_cfg <path>
- Added option "+localinfo mm_configfile <path>" to override default
config.ini pathname.
- Added "meta config" console command to display result of config
file and localinfo options.
- Added "meta require <plugin>" 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 <plugin>" 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 <direct.h>" 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 <kijuhe00@students.oamk.fi>.
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 <a name> 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 <routine> -> trace set <routine>
untrace <routine> -> trace unset <routine>
showtrace -> trace show
- added "trace list <api>" 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_<prefix>" 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

View File

@ -1,6 +0,0 @@
Please see the files in the "html" or "txt" directory for documentation.
Example files in the current directory:
plugins.ini
config.ini

View File

@ -1,37 +0,0 @@
# 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

View File

@ -1,90 +0,0 @@
// vim: set ft=c :
//
// Format is as follows:
// <optionname> <value>
//
// 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 <number>
// gamedll <path>
// plugins_file <path>
// exec_cfg <file>
// autodetect <yes/no>
// 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 <path>
// 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 <path>
// Examples:
//
// plugins_file cfg/clanmode.ini
// plugins_file ../private.ini
// plugins_file /home/half-life/testing.ini
// exec_cfg <file>
// where <file> 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 <path>
// 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>
// Examples:
//
// autodetect yes
// autodetect 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>
// Examples:
//
// clientmeta yes
// clientmeta no

View File

@ -1,65 +0,0 @@
<!-- vi: set ts=4 sw=4 : -->
<!-- vim: set tw=75 : -->
<HTML>
<head>
<title>Metamod</title>
</head>
<body>
<h1>Metamod
</h1>
<p>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.
<p>
<hr>
<p>
See <a href="http://metamod.org/">metamod.org</a> for news, downloads,
and plugin links.
<p>
<hr>
<table cellspacing=20 width="100%">
<tr valign=top>
<td>
<h2>Metamod Docs</h2>
<ul>
<li><a href="about.html">About metamod</a>
<li><a href="faq.html">FAQ</a>
<li><a href="metamod.html">Using metamod</a>
<li><a href="release_notes.html">Release Notes</a>
<li><a href="gamesupport.html">Game/Mod support</a>
<li><a href="trace.html">Trace Plugin</a>
<li><a href="wdmisc.html">WDMisc Plugin</a>
<li><a href="coding.html">Coding for metamod</a>
</ul>
</td>
<td>
<h2>Other HLDS info</h2>
<ul>
<li><a href="dllapi_notes.html">SDK DLLAPI Notes</a>
<li><a href="newapi_notes.html">SDK NEWAPI Notes</a>
<li><a href="engine_notes.html">SDK Engine Notes</a>
<p>
<li><a href="links.html">Related links &amp; books</a>
<li><a href="maillist.html">Mailing lists</a>
</ul>
</td>
</tr>
</table>
<p>
<hr>
<address>&lt;willday@metamod.org&gt;</address>
</body>
</HTML>
</HTML>

View File

@ -1,35 +0,0 @@
<!-- vi: set ts=4 sw=4 : -->
<!-- vim: set tw=75 : -->
<HTML>
<head>
<title>Metamod Supported Games</title>
</head>
<body>
<a name=supported>
<h1>Supported Games
</h1>
</a>
Metamod includes support for the following mods, with version and last
update if known.
<p>
To get support added for a new Mod, or for an updated version of a Mod, see
<a href="gamesupport.html">Adding game support</a>.
<p>
<table border=5 rules=all cellpadding=5>
<tr> <th>Name</th> <th>Version</th> <th>Last update</th> <th>Ent list</th> <th>Comments</th></tr>
<tr><td>ALL MODS SUPPORTED BY <br>
&nbsp;&nbsp;&nbsp;&nbsp;All-Mod-Support PATCH<br>
&nbsp;&nbsp;&nbsp;&nbsp;By Jussi Kivilinna<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://koti.mbnet.fi/axh/">http://koti.mbnet.fi/axh/</a>
</td><td></td><td></td><td>NONE</td></tr>
</table>
</body>
</HTML>

View File

@ -1,52 +0,0 @@
<!-- vi: set ts=4 sw=4 : -->
<!-- vim: set tw=75 : -->
<HTML>
<head>
<title>About Metamod</title>
</head>
<body>
<h1>Metamod
</h1>
<h2>a Half-Life utility mod</h2>
<pre>
<b>meta</b> /me't*/ <i>or</i> /may't*/ <i>or</i> <i>(Commonwealth)</i> /mee't*/ <i>adj.,pref.</i>
<i>[from analytic philosophy]</i> <b>One level of description up.</b>
</pre>
<p> 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 <b><i>additional mod-like DLLs</i></b>.
<p> 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 <b><i>add
to</i></b> or <b><i>modify</i></b> 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 <b><i>anything</i></b> the game DLL can do (given enough
coding effort of course).
<p> This is very similar to the way Alfred Reynolds'
<a href="http://www.adminmod.org">AdminMod</a> 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.
<p>
<hr>
</body>
</html>

View File

@ -1,396 +0,0 @@
<!-- vi: set ts=4 sw=4 : -->
<!-- vim: set tw=75 : -->
<HTML>
<head>
<title>Coding for Metamod</title>
</head>
<body>
<h1>Coding for Metamod
</h1>
<p><br>
<a name=compiling>
<h2>Compiling
</h2></a>
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 <a href="http://www.valve-erc.com/">Valve Editing Resource Center (VERC)</a>,
and a modified version of SDK 2.3 at <a href="http://metamod.org/files/sdk/">metmod.org/files/sdk</a>.
<p><br>
<a name=operation>
<h2>Operation
</h2></a>
The basic operation is, for each api call:
<ul>
<li> iterate through list of plugins
<li> for each plugin, if it provides this api call, then call the function
in the plugin
<li> call the "real" function (in the game dll, or from the engine)
<li> for each plugin, check for a "post" version of the function, and call
if present
</ul>
Also, for any api call, each plugin has the opportunity to replace the
real routine, in two ways:
<ul>
<li> prevent the real routine from being called (<a
href=#MRES_SUPERCEDE><tt><b>SUPERCEDE</b></tt></a>).
<li> allow the real routine to be called, but change the value that's
returned (<a href=#MRES_OVERRIDE><tt><b>OVERRIDE</b></tt></a>)
</ul>
Thus after each plugin is called, its <tt><b>META_RESULT</b></tt> 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 <tt><b>SUPERCEDE</b></tt> and
<tt><b>OVERRIDE</b></tt> flags, there are two additional flags a plugin can
return:
<ul>
<li> <a href=#MRES_HANDLED><tt><b>HANDLED</b></tt></a> ("I did something here")
<li> <a href=#MRES_IGNORED><tt><b>IGNORED</b></tt></a> ("I didn't really do anything")
</ul>
These aren't used by Metamod itself, but could be used by plugins to
get an idea if a previous plugin did anything.
<p> Note that each routine <b><i>needs</i></b> to set its
<tt><b>META_RESULT</b></tt> value before returning. Plugin routines that
do not set a value will be reported as errors in the logs.
<p><br>
<a name=requirements>
<h2>Plugin coding requirements
</h2></a>
Plugins <i><b>must</b></i> provide the following standard HLSDK exported function:
<p><pre>
void GiveFnptrsToDll(enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals);
</pre><p>
<i><b>As well as</b></i> the following new functions:
<p><pre>
void Meta_Init(void); <i>(optional)</i>
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);
</pre><p>
Also, it must provide <i><b>at least</b></i> one function returning a standard HL
function table, from either the following standard HLSDK functions:
<p><pre>
int GetEntityAPI( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion );
int GetEntityAPI2( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion );
int GetNewDLLFunctions( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion );
</pre><p>
or from the following new functions:
<p><pre>
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);
</pre><p>
Thus, it needs to have (at least):
<p><pre>
GiveFnptrsToDll
Meta_Query
Meta_Attach
Meta_Detach
<tt><i>&lt;one or more Get function&gt;</i></tt>
</pre><p>
See the <tt>"<b>stub_plugin</b>"</tt> for an example of <b><i>bare
minimum</i></b> code. See <tt>"<b>trace_plugin</b>"</tt> for an example of
more complete functionality.
<p>Also, if the plugin needs to use <tt><b>LINK_ENTITY_TO_CLASS</b></tt>,
support for the particular entity(ies) has to be added explicitly to
Metamod (<tt>linkfunc.cpp</tt>), just as it does for entities in game DLLs.
<p><br>
<a name=operation>
<h2>Operation Details
</h2></a>
<p>These are the valid <tt>META_RESULT</tt> values a plugin routine can
specify:
<ul>
<a name=MRES_IGNORED><p><li></a>
<tt><b>MRES_IGNORED</b></tt>
<br> 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.
<a name=MRES_HANDLED><p><li></a>
<tt><b>MRES_HANDLED</b></tt>
<br> 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.
<a name=MRES_OVERRIDE><p><li></a>
<tt><b>MRES_OVERRIDE</b></tt>
<br> 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.
<a name=MRES_SUPERCEDE><p><li></a>
<tt><b>MRES_SUPERCEDE</b></tt>
<br> The plugin has performed sufficient actions for the routine, and
the gameDLL's routine should <i><b>not</b></i> 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 <b><i>only</i></b>
the gameDLL.
</ul>
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 <tt><b>META_SUPERCEDE</b></tt>. The gameDLL's
routine is then called, or skipped, as appropriate. Then, all the "post"
routines are called in the same manner (except
<tt><b>META_SUPERCEDE</b></tt> is no longer a valid meta result).
<p>Last, if any plugins specified <tt><b>META_OVERRIDE</b></tt> or
<tt><b>META_SUPERCEDE</b></tt>, the return value given by the
<b><i>last</i></b> 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 <tt>metamod.ini</tt> <b><i>does</i></b> have a possible
effect.
<p><br>
<a name=macros>
<h2>Available Macros
</h2></a>
The <a href="http://metamod.org/dl/metamod/meta_api.h"><tt>meta_api.h</tt></a>
header that describes the Metamod API functions, types, and structures also
includes several macros that can be of help when coding a plugin.
<ul>
<a name=SET_META_RESULT><p><li></a>
<tt><b>SET_META_RESULT(result)</b></tt>
<br> Sets the <tt>META_RESULT</tt> for the plugin.
<a name=RETURN_META><p><li></a>
<tt><b>RETURN_META(result)</b></tt>
<br> Sets the <tt>META_RESULT</tt> for the plugin, and then calls
<tt>return</tt>. This assumes a <tt>void</tt> function.
<a name=RETURN_META_VALUE><p><li></a>
<tt><b>RETURN_META_VALUE(result, value)</b></tt>
<br> Sets the <tt>META_RESULT</tt> for the plugin, and then returns the
given <tt>value</tt>. This assumes a non-<tt>void</tt> function, and
it doesn't matter the particular type of the return value.
<a name=META_RESULT_STATUS><p><li></a>
<tt><b>META_RESULT_STATUS</b></tt>
<br> Gives the current status of <tt>META_RESULT</tt> for this routine
from plugins so far. It will return the "highest" result so far, in
the order of lesser to greater: <tt>IGNORED</tt>, <tt>HANDLED</tt>,
<tt>OVERRIDE</tt>, <tt>SUPERCEDE</tt> (see also above <a
href=#operation><i>Operation Details</i></a>)
<a name=META_RESULT_PREVIOUS><p><li></a>
<tt><b>META_RESULT_PREVIOUS</b></tt>
<br> Gives the <tt>META_RESULT</tt> of the previous plugin.
<a name=META_RESULT_ORIG_RET><p><li></a>
<tt><b>META_RESULT_ORIG_RET(type)</b></tt>
<br> 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.
<a name=META_RESULT_OVERRIDE_RET><p><li></a>
<tt><b>META_RESULT_OVERRIDE_RET(type)</b></tt>
<br> Gives the return value from any previous plugin that specified
<tt><b>META_OVERRIDE</b></tt> or <tt><b>META_SUPERCEDE</b></tt>. 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.
<a name=MDLL_><p><li></a>
<tt><b>MDLL_<i>*</i>(<i>args</i>)</b></tt>
<br> Calls a given DLLAPI routine in the gameDLL. For instance,
<tt><b>MDLL_GameDLLInit(args)</b></tt>, <tt><b>MDLL_Spawn(args)</b></tt>,
etc.
<a name=MNEW_><p><li></a>
<tt><b>MNEW_<i>*</i>(<i>args</i>)</b></tt>
<br> Calls a given NEWAPI routine in the gameDLL. For instance,
<tt><b>MNEW_GameShutdown(args)</b></tt>, etc.
</ul>
<p><br>
<a name=utility>
<h2>Utility Callback Functions
</h2></a>
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).
<p> Note the <tt><b>PLID</b></tt> 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 <tt>Meta_Query</tt>;
in the future this could change to some other identifier.)
<ul>
<a name=LOG_CONSOLE><p><li></a>
<tt> void <b>LOG_CONSOLE(PLID, <i>char *fmt, ...</i>)</b></tt>
<br> Print a message line on the console. Message is specified as a
<tt>printf</tt> 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).
<a name=LOG_MESSAGE><p><li></a>
<tt> void <b>LOG_MESSAGE(PLID, <i>char *fmt, ...</i>)</b></tt>
<br> Print a message line in the server logs. Message is specified as a
<tt>printf</tt> 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 <tt>logtag</tt> string in the plugin's
"info" struct, surrounded by brackets. For instance:
<p><tt>L 04/17/2001 - 18:00:35: [TraceAPI] Tracing Engine routine 'RegUserMsg'</tt>
<a name=LOG_ERROR><p><li></a>
<tt> void <b>LOG_ERROR(PLID, <i>char *fmt, ...</i>)</b></tt>
<br> As in <tt>LOG_MESSAGE</tt> above, only marked as well with the
string "ERROR:". For example:
<p><tt>L 04/17/2001 - 18:03:13: [TraceAPI] ERROR: malloc failed</tt>
<a name=LOG_DEVELOPER><p><li></a>
<tt> void <b>LOG_DEVELOPER(PLID, <i>char *fmt, ...</i>)</b></tt>
<br> As in <tt>LOG_MESSAGE</tt> above, only message will be logged only
if cvar <tt>developer</tt> is set to 1; message is marked as well with
the string "dev:". For example:
<p><tt>L 04/17/2001 - 18:03:13: [TraceAPI] dev: called: GiveFnptrsToDll</tt>
<a name=CENTER_SAY><p><li></a>
<tt> void <b>CENTER_SAY(PLID, <i>char *fmt, ...</i>)</b></tt>
<br> 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: <i>[added in 1.06]</i>
<p><tt>L 04/17/2001 - 15:44:52: [WDMISC] (centersay) random set up us the bomb!</tt>
<a name=CENTER_SAY_PARMS><p><li></a>
<tt> void <b>CENTER_SAY_PARMS(PLID, <i>hudtextparms_t tparms, char *fmt, ...</i>)</b></tt>
<br> As in <tt>CENTER_SAY</tt> above, but allows specifying all the
parameters. (see SDK <tt>dlls/util.h</tt> for the struct
<tt>hudtextparms_t</tt>). <i>[added in 1.06]</i>
<a name=CENTER_SAY_VARARGS><p><li></a>
<tt> void <b>CENTER_SAY_VARARGS(PLID, <i>hudtextparms_t tparms, char *fmt, va_list ap</i>)</b></tt>
<br> As in <tt>CENTER_SAY_PARMS</tt> above, only the message is passed
as a <tt>vsnprintf</tt> 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.
<i>[added in 1.06]</i>
<a name=CALL_GAME_ENTITY><p><li></a>
<tt> qboolean <b>CALL_GAME_ENTITY(PLID, <i>char *entStr, entvars_t *pev</i>)</b></tt>
<br>Calls an entity function in the gameDLL. For instance, a bot usually
needs to call the <tt><b>player</b></tt> entity function.
<i>[added in 1.09]</i>
<a name=GET_USER_MSG_ID><p><li></a>
<tt> int <b>GET_USER_MSG_ID(PLID, <i>const char *name, int *size</i>)</b></tt>
<br>Returns the id number corresponding to the given message name, of
those messages registered by the gamedll with <a
href="engine_notes.html#RegUserMsg">RegUserMsg</a>, 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.
<i>[added in 1.11]</i>
<a name=GET_USER_MSG_NAME><p><li></a>
<tt> const char * <b>GET_USER_MSG_NAME(PLID, <i>int msgid, int *size</i>)</b></tt>
<br>Returns the name corresponding to the given msgid number, of those
messages registered by the gamedll with <a
href="engine_notes.html#RegUserMsg">RegUserMsg</a>, optionally
returning the registered size of the message as well. It will return
guess-names for any builtin Engine messages that it knows about
(<tt>SVC_TEMPENTITY</tt>, etc). The returned string is presumed to be
a compile-time constant string, stored in the text segment of the
gamedll.
<i>[added in 1.11]</i>
<a name=GET_PLUGIN_PATH><p><li></a>
<tt> const char * <b>GET_PLUGIN_PATH(PLID)</b></tt>
<br>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.
<i>[added in 1.12]</i>
<a name=GET_GAME_INFO><p><li></a>
<tt> const char * <b>GET_GAME_INFO(PLID, <i>ginfo_t type</i>)</b></tt>
<br>Returns various string-based information about the running
game/MOD/gamedll. The given <i>type</i> can be one of:
<ul>
<li><tt><b>GINFO_NAME</b></tt> - short name of game, from "-game" argument to hlds (ie "cstrike")
<li><tt><b>GINFO_DESC</b></tt> - long name of game, from autodetection (ie "Counter-Strike")
<li><tt><b>GINFO_GAMEDIR</b></tt> - game directory, full pathname (ie "/usr/local/half-life/cstrike")
<li><tt><b>GINFO_DLL_FULLPATH</b></tt> - full pathname of the game dll (ie "/usr/local/half-life/cstrike/dlls/cs_i386.so")
<li><tt><b>GINFO_DLL_FILENAME</b></tt> - bare filename of the gamedll (ie "cs_i386.so")
</ul>
The returned string is a pointer to a static buffer, and should be
copied by the caller to local storage.
<i>[added in 1.14]</i>
</ul>
<p><br>
<a name=loading>
<h2>Plugin Loading
</h2></a>
<i>(this is some rough notes I intend to fill in in the future)</i><p>
Plugins are loaded when the engine calls <tt><b>GiveFnptrsToDll()</b></tt>.
The config file is parsed, and for each valid plugin (uncommented, platform
relevant), the operation is:
<ul>
<li> dlopen() the file, store the handle
<li> dlsym() and call:
<pre>
Meta_Init (if present)
GiveFnptrsToDll
Meta_Query
Meta_Attach
</pre>
<li> if present, call function pointers, and store resulting function table:
<pre>
GetEntityAPI
GetEntityAPI2
GetNewDLLFunctions
GetEntityAPI_Post
GetEntityAPI2_Post
GetNewDLLFunctions_Post
GetEngineFunctions
GetEngineFunctions_Post
</pre>
</ul>
<p>
<hr>
</body>
</HTML>

View File

@ -1,569 +0,0 @@
<!-- vi: set ts=4 sw=4 : -->
<!-- vim: set tw=75 : -->
<HTML>
<head>
<title>HLSDK DLLAPI Notes</title>
</head>
<body>
<h1>HLSDK DLLAPI Notes
</h1>
<hr>
<ul>
<li><a href=#GameDLLInit>GameDLLInit</a>
<li><a href=#DispatchSpawn>DispatchSpawn</a>
<li><a href=#DispatchThink>DispatchThink</a>
<li><a href=#DispatchUse>DispatchUse</a>
<li><a href=#DispatchTouch>DispatchTouch</a>
<li><a href=#DispatchBlocked>DispatchBlocked</a>
<li><a href=#DispatchKeyValue>DispatchKeyValue</a>
<li><a href=#DispatchSave>DispatchSave</a>
<li><a href=#DispatchRestore>DispatchRestore</a>
<li><a href=#DispatchObjectCollsionBox>DispatchObjectCollsionBox</a>
<li><a href=#SaveWriteFields>SaveWriteFields</a>
<li><a href=#SaveReadFields>SaveReadFields</a>
<li><a href=#SaveGlobalState>SaveGlobalState</a>
<li><a href=#RestoreGlobalState>RestoreGlobalState</a>
<li><a href=#ResetGlobalState>ResetGlobalState</a>
<li><a href=#ClientConnect>ClientConnect</a>
<li><a href=#ClientDisconnect>ClientDisconnect</a>
<li><a href=#ClientKill>ClientKill</a>
<li><a href=#ClientPutInServer>ClientPutInServer</a>
<li><a href=#ClientCommand>ClientCommand</a>
<li><a href=#ClientUserInfoChanged>ClientUserInfoChanged</a>
<li><a href=#ServerActivate>ServerActivate</a>
<li><a href=#ServerDeactivate>ServerDeactivate</a>
<li><a href=#PlayerPreThink>PlayerPreThink</a>
<li><a href=#PlayerPostThink>PlayerPostThink</a>
<li><a href=#StartFrame>StartFrame</a>
<li><a href=#ParmsNewLevel>ParmsNewLevel</a>
<li><a href=#ParmsChangeLevel>ParmsChangeLevel</a>
<li><a href=#GetGameDescription>GetGameDescription</a>
<li><a href=#PlayerCustomization>PlayerCustomization</a>
<li><a href=#SpectatorConnect>SpectatorConnect</a>
<li><a href=#SpectatorDisconnect>SpectatorDisconnect</a>
<li><a href=#SpectatorThink>SpectatorThink</a>
<li><a href=#Sys_Error>Sys_Error</a>
<li><a href=#PM_Move>PM_Move</a>
<li><a href=#PM_Init>PM_Init</a>
<li><a href=#PM_FindTextureType>PM_FindTextureType</a>
<li><a href=#SetupVisibility>SetupVisibility</a>
<li><a href=#UpdateClientData>UpdateClientData</a>
<li><a href=#AddToFullPack>AddToFullPack</a>
<li><a href=#CreateBaseline>CreateBaseline</a>
<li><a href=#RegisterEncoders>RegisterEncoders</a>
<li><a href=#GetWeaponData>GetWeaponData</a>
<li><a href=#CmdStart>CmdStart</a>
<li><a href=#CmdEnd>CmdEnd</a>
<li><a href=#ConnectionlessPacket>ConnectionlessPacket</a>
<li><a href=#GetHullBounds>GetHullBounds</a>
<li><a href=#CreateInstancedBaselines>CreateInstancedBaselines</a>
<li><a href=#InconsistentFile>InconsistentFile</a>
<li><a href=#AllowLagCompensation>AllowLagCompensation</a>
</ul>
<hr><h3><tt><a name="GameDLLInit">GameDLLInit</a></tt></h3>
<i>from dlls/game.cpp:</i><br>
<dd><tt>void GameDLLInit(void);</tt><p>
<blockquote><tt>
Register your console variables here.<br>
This gets called one time when the game is initialied.<br>
Initialize the game (one-time call after loading of game .dll)<br>
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
Called just after hlds reports "Dll loaded for mod Half-Life".
</blockquote>
<hr><h3><tt><a name="DispatchSpawn">DispatchSpawn</a></tt></h3>
<i>from dlls/cbase.cpp</I>
<dd><tt>int DispatchSpawn(edict_t *pent);</tt><p>
<p><i>comments:</i><br>
<blockquote>
0==Success, -1==Failure ?
</blockquote>
<hr><h3><tt><a name="DispatchThink">DispatchThink</a></tt></h3>
<i>from dlls/cbase.cpp</i><br>
<dd><tt>void DispatchThink(edict_t *pent);</tt><p>
<hr><h3><tt><a name="DispatchUse">DispatchUse</a></tt></h3>
<i>from dlls/cbase.cpp</i><br>
<dd><tt>void DispatchUse(edict_t *pentUsed, edict_t *pentOther);</tt><p>
<hr><h3><tt><a name="DispatchTouch">DispatchTouch</a></tt></h3>
<i>from dlls/cbase.cpp</i><br>
<dd><tt>void DispatchTouch(edict_t *pentTouched, edict_t *pentOther);</tt><p>
<hr><h3><tt><a name="DispatchBlocked">DispatchBlocked</a></tt></h3>
<i>from dlls/cbase.cpp</i><br>
<dd><tt>void DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther);</tt><p>
<hr><h3><tt><a name="DispatchKeyValue">DispatchKeyValue</a></tt></h3>
<i>from dlls/cbase.cpp</i><br>
<dd><tt>void DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd);</tt><p>
<hr><h3><tt><a name="DispatchSave">DispatchSave</a></tt></h3>
<i>from dlls/cbase.cpp</i><br>
<dd><tt>void DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData);</tt><p>
<hr><h3><tt><a name="DispatchRestore">DispatchRestore</a></tt></h3>
<i>from dlls/cbase.cpp</i><br>
<dd><tt>int DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity);</tt><p>
<p><i>comments:</i><br>
<blockquote>
0==Success, -1==Failure ?
</blockquote>
<hr><h3><tt><a name="DispatchObjectCollsionBox">DispatchObjectCollsionBox</a></tt></h3>
<i>from dlls/cbase.cpp</i><br>
<dd><tt>void DispatchObjectCollsionBox(edict_t *pent);</tt><p>
<hr><h3><tt><a name="SaveWriteFields">SaveWriteFields</a></tt></h3>
<i>from dlls/cbase.cpp</i><br>
<dd><tt>void SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount);</tt><p>
<hr><h3><tt><a name="SaveReadFields">SaveReadFields</a></tt></h3>
<i>from dlls/cbase.cpp</i><br>
<dd><tt>void SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount);</tt><p>
<hr><h3><tt><a name="SaveGlobalState">SaveGlobalState</a></tt></h3>
<i>from dlls/world.cpp</i><br>
<dd><tt>void SaveGlobalState(SAVERESTOREDATA *pSaveData);</tt><p>
<hr><h3><tt><a name="RestoreGlobalState">RestoreGlobalState</a></tt></h3>
<i>from dlls/world.cpp</i><br>
<dd><tt>void RestoreGlobalState(SAVERESTOREDATA *pSaveData);</tt><p>
<hr><h3><tt><a name="ResetGlobalState">ResetGlobalState</a></tt></h3>
<i>from dlls/world.cpp</i><br>
<dd><tt>void ResetGlobalState(void);</tt><p>
<hr><h3><tt><a name="ClientConnect">ClientConnect</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>BOOL ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[128]);</tt><p>
<blockquote><tt>
Called when a player connects to a server.
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
Called on initial connect, just after hlds reports "connected", ie:
<pre> <tt>"John&lt;1&gt;&lt;WON:9856723&gt;" connected, address "127.0.0.1:27005"</tt></pre>
This is before the user begins downloading, or anything else.
</blockquote>
<hr><h3><tt><a name="ClientDisconnect">ClientDisconnect</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>void ClientDisconnect(edict_t *pEntity);</tt><p>
<blockquote><tt>
Called when a player disconnects from a server.<br>
GLOBALS ASSUMED SET: g_fGameOver
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
This is not the opposite of <tt><b>ClientConnect</b></tt>, despite the similar name.
It appears to only be called if the client was <tt><b>PutInServer</b></tt> first. If
the client disconnects before being <tt><b>PutInServer</b></tt>, no API routine is
called. This would be more appropriately named <tt><i><b>ClientRemoveFromServer</i></b></tt>.
</blockquote>
<hr><h3><tt><a name="ClientKill">ClientKill</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>void ClientKill(edict_t *pEntity);</tt><p>
<blockquote><tt>
Player entered the suicide command.<br>
GLOBALS ASSUMED SET: g_ulModelIndexPlayer
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
When the client typed "kill" in the console?
</blockquote>
<hr><h3><tt><a name="ClientPutInServer">ClientPutInServer</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>void ClientPutInServer(edict_t *pEntity);</tt><p>
<blockquote><tt>
Called each time a player is spawned.
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
Called after the client has uploaded/download all necessary resources,
just after hlds reports "entered the game", ie:
<pre> "John&lt;1&gt;" has entered the game</pre>
</blockquote>
<hr><h3><tt><a name="ClientCommand">ClientCommand</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>void ClientCommand(edict_t *pEntity);</tt><p>
<blockquote><tt>
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.
</tt></blockquote>
<hr><h3><tt><a name="ClientUserInfoChanged">ClientUserInfoChanged</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>void ClientUserInfoChanged(edict_t *pEntity, char *infobuffer);</tt><p>
<blockquote><tt>
Called after the player changes userinfo - gives dll a chance to modify
it before it gets sent into the rest of the engine.
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
Called when user issues <tt>"<b>setinfo</b>"</tt> from the console. Also appears to be
called whenever the user returns to the game from the ESC menu.
</blockquote>
<hr><h3><tt><a name="ServerActivate">ServerActivate</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax);</tt><p>
<blockquote><tt>
Every call to ServerActivate should be matched by a call to
ServerDeactivate.
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
Added in SDK 2.0.
Apparently called when the server has loaded the map, but before it
precaches from the <tt><b>.res</b></tt> file.
</blockquote>
<hr><h3><tt><a name="ServerDeactivate">ServerDeactivate</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>void ServerDeactivate(void);</tt><p>
<blockquote><tt>
Peform any shutdown operations here.<br>
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.<br>
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
Called upon <tt>"<b>quit</b>"</tt> or <tt>"<b>changelevel</b>"</tt> .
</blockquote>
<hr><h3><tt><a name="PlayerPreThink">PlayerPreThink</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>void PlayerPreThink(edict_t *pEntity);</tt><p>
<blockquote><tt>
Called every frame before physics are run.
</tt></blockquote>
<hr><h3><tt><a name="PlayerPostThink">PlayerPostThink</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>void PlayerPostThink(edict_t *pEntity);</tt><p>
<blockquote><tt>
Called every frame after physics are run.
</tt></blockquote>
<hr><h3><tt><a name="StartFrame">StartFrame</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>void StartFrame(void);</tt><p>
<blockquote><tt>
GLOBALS ASSUMED SET: g_ulFrameCount
</tt></blockquote>
<hr><h3><tt><a name="ParmsNewLevel">ParmsNewLevel</a></tt></h3>
<i>from dlls/client.cpp</i><br>
<dd><tt>void ParmsNewLevel(void);</tt><p>
<hr><h3><tt><a name="ParmsChangeLevel">ParmsChangeLevel</a></tt></h3>
<i>from dlls/client.cpp</i><br>
<dd><tt>void ParmsChangeLevel(void);</tt><p>
<hr><h3><tt><a name="GetGameDescription">GetGameDescription</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>const char *GetGameDescription(void);</tt><p>
<blockquote><tt>
Returns string describing current .dll game.<br>
Returns the descriptive name of this .dll. E.g., Half-Life, or Team
Fortress 2.<br>
This function might be called before the world has spawned, and the game
rules initialized.<br>
</tt></blockquote>
<hr><h3><tt><a name="PlayerCustomization">PlayerCustomization</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>void PlayerCustomization(edict_t *pEntity, customization_t *pCust);</tt><p>
<blockquote><tt>
Notifies .dll of new customization for player.<br>
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.<br>
</tt></blockquote>
<hr><h3><tt><a name="SpectatorConnect">SpectatorConnect</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>void SpectatorConnect(edict_t *pEntity);</tt><p>
<blockquote><tt>
Called when spectator joins server.<br>
A spectator has joined the game.<br>
</tt></blockquote>
<hr><h3><tt><a name="SpectatorDisconnect">SpectatorDisconnect</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>void SpectatorDisconnect(edict_t *pEntity);</tt><p>
<blockquote><tt>
Called when spectator leaves the server.<br>
A spectator has left the game.<br>
</tt></blockquote>
<hr><h3><tt><a name="SpectatorThink">SpectatorThink</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>void SpectatorThink(edict_t *pEntity);</tt><p>
<blockquote><tt>
Called when spectator sends a command packet (usercmd_t).<br>
A spectator has sent a usercmd.<br>
</tt></blockquote>
<hr><h3><tt><a name="Sys_Error">Sys_Error</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>void Sys_Error(const char *error_string);</tt><p>
<blockquote><tt>
Called when engine has encountered an error.<br>
Notify game .dll that engine is going to shut down.<br>
Engine is going to shut down, allows setting a breakpoint in game dll
to catch that occasion.<br>
Add code ( e.g., _asm { int 3 }; here to cause a breakpoint for
debugging your game .dlls.<br>
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
Added in SDK 2.0.
</blockquote>
<hr><h3><tt><a name="PM_Move">PM_Move</a></tt></h3>
<i>from pm_shared/pm_shared.c:</i><br>
<dd><tt>void PM_Move(struct playermove_s *ppmove, int server);</tt><p>
<blockquote><tt>
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.
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
Added in SDK 2.0.
</blockquote>
<hr><h3><tt><a name="PM_Init">PM_Init</a></tt></h3>
<i>from pm_shared/pm_shared.c:</i>
<dd><tt>void PM_Init(struct playermove_s *ppmove);</tt><p>
<blockquote><tt>
Server version of player movement initialization.
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
Added in SDK 2.0.
</blockquote>
<hr><h3><tt><a name="PM_FindTextureType">PM_FindTextureType</a></tt></h3>
<i>from pm_shared/pm_shared.c</i><br>
<dd><tt>char PM_FindTextureType(char *name);</tt><p>
<p><i>comments:</i><br>
<blockquote>
Added in SDK 2.0.
</blockquote>
<hr><h3><tt><a name="SetupVisibility">SetupVisibility</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>void SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas);</tt><p>
<i>from dlls/client.cpp:</i>
<blockquote><tt>
Set up PVS and PAS for networking for this client.
<p>
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.
<p>
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.
<p>
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
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
Added in SDK 2.0.
</blockquote>
<hr><h3><tt><a name="UpdateClientData">UpdateClientData</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>void UpdateClientData (const struct edict_s *ent, int sendweapons, struct clientdata_s *cd);</tt><p>
<blockquote><tt>
Set up data sent only to specific client.<br>
Data sent to current client only.<br>
Engine sets argument 'cd' to 0 before calling.<br>
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
Added in SDK 2.0.
</blockquote>
<hr><h3><tt><a name="AddToFullPack">AddToFullPack</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>int AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet);</tt><p>
<blockquote><tt>
Return 1 if the entity state has been filled in for the ent and the
entity will be propagated to the client, 0 otherwise.
<p>
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.
<p>
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.
<p>
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.
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
Added in SDK 2.0.
</blockquote>
<hr><h3><tt><a name="CreateBaseline">CreateBaseline</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>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);</tt><p>
<blockquote><tt>
Tweak entity baseline for network encoding, allows setup of player
baselines, too.<br>
Creates baselines used for network encoding, especially for player data
since players are not spawned until connect time.<br>
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
Added in SDK 2.0.
</blockquote>
<hr><h3><tt><a name="RegisterEncoders">RegisterEncoders</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>void RegisterEncoders(void);</tt><p>
<blockquote><tt>
Callbacks for network encoding.<br>
Allows game .dll to override network encoding of certain types of
entities and tweak values, etc.<br>
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
Added in SDK 2.0.
</blockquote>
<hr><h3><tt><a name="GetWeaponData">GetWeaponData</a></tt></h3>
<i>from dlls/client.cpp</i><br>
<dd><tt>int GetWeaponData(struct edict_s *player, struct weapon_data_s *info);</tt><p>
<p><i>comments:</i><br>
<blockquote>
Added in SDK 2.0.
</blockquote>
<hr><h3><tt><a name="CmdStart">CmdStart</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>void CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed);</tt><p>
<blockquote><tt>
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.
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
Added in SDK 2.0.
</blockquote>
<hr><h3><tt><a name="CmdEnd">CmdEnd</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>void CmdEnd (const edict_t *player);</tt><p>
<blockquote><tt>
Each cmdstart is exactly matched with a cmd end, clean up any
group trace flags, etc. here.
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
Added in SDK 2.0.
</blockquote>
<hr><h3><tt><a name="ConnectionlessPacket">ConnectionlessPacket</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>int ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size);</tt>
<blockquote><tt>
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.
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
Added in SDK 2.0.
</blockquote>
<hr><h3><tt><a name="GetHullBounds">GetHullBounds</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>int GetHullBounds(int hullnumber, float *mins, float *maxs);</tt><p>
<blockquote><tt>
Engine calls this to enumerate player collision hulls,
for prediction. Return 0 if the hullnumber doesn't exist.
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
Added in SDK 2.0.
</blockquote>
<hr><h3><tt><a name="CreateInstancedBaselines">CreateInstancedBaselines</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>void CreateInstancedBaselines (void);</tt><p>
<blockquote><tt>
Tweak entity baseline for network encoding, allows setup of player baselines, too.<br>
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.).<br>
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
Added in SDK 2.0.
</blockquote>
<hr><h3><tt><a name="InconsistentFile">InconsistentFile</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>int InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message);</tt>
<blockquote><tt>
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).
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
Added in SDK 2.0.
</blockquote>
<hr><h3><tt><a name="AllowLagCompensation">AllowLagCompensation</a></tt></h3>
<i>from dlls/client.cpp:</i><br>
<dd><tt>int AllowLagCompensation(void);</tt><p>
<blockquote><tt>
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.
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
Added in SDK 2.0.
</blockquote>
<p>
<hr>
</body>
</HTML>

File diff suppressed because it is too large Load Diff

View File

@ -1,158 +0,0 @@
<!-- vi: set ts=4 sw=4 : -->
<!-- vim: set tw=75 : -->
<HTML>
<head>
<title>Metamod FAQ</title>
</head>
<body>
<h1>Metamod FAQ
</h1>
<p><a name=modsupport>
<b> Please add support for <i>(some)</i> mod.</b>
</a><p> <blockquote>
Please see <a href="gamesupport.html#requirements">game support
requirements</a> in the documentation.
</blockquote>
<p><a name=bots>
<b> How do I use bots with Metamod?</b>
</a><p> <blockquote>
If the bot is <i>not</i> 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
<a href="metamod.html#localinfo">Metamod docs</a>. See also the
<a href="http://www.adminmod.org/help/online/Configuration/How_to_Use_Bots_with_MetaMod_AM_2.50_and_up.htm">AdminMod docs</a>.
</blockquote>
<p><a name=corrupt>
<b> The download links give corrupt files.</b>
</a><p> <blockquote>
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.
</blockquote>
<p><a name=install>
<b> How do I install Metamod?</b>
</a><p> <blockquote>
This is covered briefly in the <a href="metamod.html#installation">Metamod
docs</a>. Typically, though, Metamod is installed as part of some major
plugin, like <a href="http://www.adminmod.org/">AdminMod</a>. There is
also some discussion of installing Metamod by hand in the <a href="http://www.adminmod.org/help/online/Installing/Manual_Installation_-_Walk-Through.htm">AdminMod docs</a>. 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 <a href="http://metamod.org/">webpage</a>.
</blockquote>
<p><a name=adminmod>
<b> I'm having trouble with AdminMod.</b>
</a><p> <blockquote>
You'll need to ask your AdminMod questions on the <a href="http://www.ozforums.com/forumdisplay.php?forumid=143">AdminMod forums</a>.
</blockquote>
<p><a name=hlcoding>
<b> How do I do <i>(something)</i> in a Metamod plugin?</b>
</a><p> <blockquote>
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 <a href="links.html">related links</a>
and especially <a href="http://planethalflife.com/botman/MOD_FAQ.shtml">Botman's MOD FAQ</a>).
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.
<p>
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
<a href="http://groups.yahoo.com/group/metamod/">Metamod mailing list</a>.
And of course, if you have questions about things in the code specific to
Metamod (ie things mentioned in the <a href="coding.html">Metamod Coding
docs</a>) feel free to ask me or on the mailing list.
</blockquote>
<p><a name=examples>
<b> Is there a tutorial or example of how to write a Metamod plugin?</b>
</a><p> <blockquote>
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.
<p>
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 <a href="links.html">related links</a>
and <a href="http://planethalflife.com/botman/MOD_FAQ.shtml">Botman's MOD FAQ</a>).
</blockquote>
<p><a name=pluginlink>
<b> I have (or know of) a Metamod plugin not listed on the webpage.</b>
</a><p> <blockquote>
Send me the information about the plugin (name, author, description, URL),
and I'd be happy to provide a link from the webpage.
</blockquote>
<p><a name=msvc>
<b> I'm having trouble compiling under MSVC.</b>
</a><p> <blockquote>
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 <a href="http://www.mingw.org/">mingw32</a> 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
<i>should</i> work, and indeed did work the last time I dug up MSVC to test
them. That said, there are a few folks on the <a href="http://groups.yahoo.com/group/metamod/">Metamod mailing list</a> that
do use MSVC, so you might find some assistance there.
</blockquote>
<p><a name=gpl>
<b> If I create a Metamod plugin, does it have to be open source?</b>
</a><p> <blockquote>
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
<a href="http://www.gnu.org/licenses/gpl-faq.html#GPLAndPlugins">plugins of a GPL program</a>.
</blockquote>
<p><a name=otherengines>
<b> How about a port of Metamod to other engines like Q3, Unreal, etc?</b>
</a><p> <blockquote>
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.
<p>
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
<b>own</b> plugin framework themselves. :)
</blockquote>
<p>
<hr>
</body>
</HTML>

View File

@ -1,17 +0,0 @@
<!-- vi: set ts=4 sw=4 : -->
<!-- vim: set tw=75 : -->
<HTML>
<head>
<title>Metamod Adding Game/Mod Support</title>
</head>
<body>
<h1>Adding Game/Mod Support
</h1>
<b>Metamod-P already supports your Mod.</b>
<hr>
</body>
</HTML>

View File

@ -1,114 +0,0 @@
<!-- vi: set ts=4 sw=4 : -->
<!-- vim: set tw=75 : -->
<HTML>
<head>
<title>Metamod Related Links</title>
</head>
<body>
<h2>Related links
</h2></a>
Here's a list of links, other sites, and information I found useful when
working on Metamod:
<ul>
<li><a href="http://www.ozforums.com/forumdisplay.php?forumid=114">AdminMod's DLL Forum</a>
<li><a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/halflifeadmin/">AdminMod CVS at Sourceforge</a>
<p>
<!-- <li><a href="http://hlsdk.valve-erc.com/">Half-Life SDK Resource Site</a>, Valve's official site -->
<li><a href="http://collective.valve-erc.com/">Valve Editing Resource Center</a>, Valve's official site
<li><a href="http://planethalflife.com/botman/">Botman's Bots</a>
<li><a href="http://hlpp.valveworld.com/">Half-Life Programming Planet</a>
<li><a href="http://planethalflife.com/hlsdk2">Shadowman's Half-Life SDK2 Site</a>
<li><a href="http://www.planethalflife.com/botman/balfourroad/index.shtml">Half-Life Coding Pages</a>
<li><a href="http://planethalflife.com/fixxxer/">Fixxxer's HL Coding page</a>
<li><a href="http://www.karljones.com/halflife/coding.asp">The Handy Vandal's HL Coding Links</a>
<p>
<li><a href="http://www.chatbear.com/cgi-bin/board.pl?boardid=942">Half-Life SDK Forums</a>, at the VERC
<li><a href="http://www.chatbear.com/cgi-bin/board.pl?action=boardlisting&boardid=590">Half-Life SDK Forums</a>, at Valve's former SDK site
<li><a href="http://www.topica.com/lists/hlcoders">HL Coders mailing list</a>, at topica.com
<li><a href="http://dynamic.gamespy.com/~botman/yabb/YaBB.pl">Botman's forums</a>
<!-- <li><a href="http://dynamic.gamespy.com/~wavelength/ubb/forumdisplay.cgi?action=topics&forum=Coding&number=3">Wavelength Half-Life Coding Forum</a> -->
<li><a href="http://www.thewavelength.net/forums/index.php?act=SF&f=13">Wavelength Half-Life Coding Forum</a>
<li><a href="http://pub21.ezboard.com/fshadowmanshalflifeforumsdk2">SDK2 Forum</a>, at ezboard.com
<li><a href="http://dynamic.gamespy.com/~hlprogramming/ultimatebb/forumdisplay.cgi?action=topics&forum=Coding&number=1">HL Programming Forum</a>, at gamespy.com
<li><a href="http://network54.com/Hide/Forum/goto?forumid=21807">Fixxxer's HL Coding forum</a>
<li><a href="http://forums.gamedesign.net/forums/wwwthreads.pl?action=list&Board=halflife_coding">HL Programming Forum</a>, at gamedesign.net
<p>
<li><a href="http://www.eskimo.com/~scs/C-faq/top.html">C FAQ</a>
<li><a href="http://www.parashift.com/cpp-faq-lite/">C++ FAQ Lite</a>
<li><a href="http://www.calpoly.edu/~jfischer/c++faq/index.html">C++ FAQ Index</a>
<li><a href="http://snurse-l.org/acllc-c++/faq">alt.comp.lang.learn.c-c++ FAQ</a>
<li><a href="http://dragon.klte.hu/~kollarl/C++/cplusplu.html">C++ Annotations</a>, guide for C programmers to using C++
<li><a href="http://www.mozilla.org/hacking/portable-cpp.html">C++ Portability Guide</a>
<li><a href="http://www.sgi.com/tech/stl/">Standard Template Library Programmer's Guide</a>, at SGI
<li><a href="http://reality.sgi.com/austern_mti/std-c++/faq.html">comp.std.c++ FAQ</a>
<li><a href="http://www.landfield.com/faqs/g++-FAQ/plain/">GNU g++ FAQ</a>
<li><a href="http://gcc.gnu.org/onlinedocs/libstdc++/faq/">GNU libstdc++ FAQ</a>
<li><a href="http://www.apl.jhu.edu/~paulmac/c++-references.html">C++ References</a>, books and other links
<li><a href="http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html">Thinking in C++</a>, free electronic book
<p>
<li><a href="http://www.serpentine.com/~bos/threads-faq/">comp.programming.threads FAQ</a>
<li><a href="http://www.lambdacs.com/cpt/FAQ.html">comp.programming.threads FAQ #2</a>
<li><a href="http://www.cs.wustl.edu/~schmidt/win32-cv-1.html">Implementing POSIX Condition Variables in Win32</a>
<p>
<li><a href="http://msdn.microsoft.com/">Microsoft Developer Network</a>, online win32 API docs
<li><a href="http://www.iseran.com/Win32/FAQ/">Win32 Programming FAQ</a>
<li><a href="http://www.mingw.org/">Minimal Gnu for Windows (mingw)</a>, gcc for win32
<li><a href="http://www.geocities.com/Tokyo/Towers/6162/win32/dll/make.html">Creating DLLs w/mingw</a>
<li><a href="http://www.devolution.com/~slouken/SDL/Xmingw32/">Mingw binaries</a>
<li><a href="http://members.telering.at/jessich/mingw/index.html">Mingw binaries (newer)</a>
</ul>
<h2>Books</h2>
And here are books I picked up that I found useful as well:
<ul>
<li><a href="http://vig.prenhall.com/catalog/academic/product/1,4096,0133262243,00.html">C: A Reference Manual</a>, by Samuel Harbison &amp; <a href="http://www.sls.lcs.mit.edu/~hurley/guysteele.html">Guy Steele</a> (at <a href="http://www.bookpool.com/.x//sm/0133262243">Bookpool</a>, at <a href="http://www.amazon.com/exec/obidos/ASIN/0133262243">Amazon</a>)
<li><a href="http://cseng.aw.com/book/0,3828,0201845199,00.html">C Programming FAQs</a>, by <a href="http://www.eskimo.com/~scs/">Steve Summit</a> (at <a href="http://www.bookpool.com/.x//sm/0201845199">Bookpool</a>, at <a href="http://www.amazon.com/exec/obidos/ASIN/0201845199">Amazon</a>)
<p>
<li><a href="http://www.oreilly.com/catalog/core/">C++: The Core Language</a>, by Gregory Satir &amp; Doug Brown (at <a href="http://www.bookpool.com/.x//sm/156592116X">Bookpool</a>, at <a href="http://www.amazon.com/exec/obidos/ASIN/156592116X">Amazon</a>)
<li><a href="http://cseng.aw.com/book/0,3828,0201700735,00.html">C++ Programming Language Special Edition</a>, by <a href="http://www.research.att.com/~bs/">Bjarne Stroustrup</a> (at <a href="http://www.bookpool.com/.x//sm/0201700735">Bookpool</a>, at <a href="http://www.amazon.com/exec/obidos/ASIN/0201700735">Amazon</a>)
<li><a href="http://cseng.aw.com/book/0,3828,0201379260,00.html">The C++ Standard Library: A Tutorial and Reference</a>, by <a href="http://www.josuttis.de/indexe.html">Nicolai Josuttis</a> (at <a href="http://www.bookpool.com/.x//sm/0201379260">Bookpool</a>, at <a href="http://www.amazon.com/exec/obidos/ASIN/0201379260">Amazon</a>)
<li><a href="http://cseng.aw.com/book/0,3828,0201309831,00.html">C++ FAQs</a>, by <a href="http://www.parashift.com/">Marshall Cline</a>, Greg Lomow, &amp; Mike Girou (at <a href="http://www.bookpool.com/.x//sm/0201309831">Bookpool</a>, at <a href="http://www.amazon.com/exec/obidos/ASIN/0201309831">Amazon</a>)
<li><a href="http://cseng.aw.com/book/0,,0201924889,00.html">Effective C++</a>, by <a href="http://www.aristeia.com/">Scott Meyers</a> (at <a href="http://www.bookpool.com/.x//sm/0201924889">Bookpool</a>, at <a href="http://www.amazon.com/exec/obidos/ASIN/0201924889">Amazon</a>)
<li><a href="http://cseng.aw.com/book/0,,0201350882,00.html">Algorithms in C++, Parts 1-4</a>, by <a href="http://www.cs.princeton.edu/~rs/">Robert Sedgewick</a> (at <a href="http://www.bookpool.com/.x//sm/0201350882">Bookpool</a>, at <a href="http://www.amazon.com/exec/obidos/ASIN/0201350882">Amazon</a>)
<p>
<li><a href="http://cseng.aw.com/book/0,3828,0201563177,00.html">Advanced Programming in the UNIX Environment</a>, by <a href="http://www.kohala.com/">W. Richard Stevens</a> (at <a href="http://www.bookpool.com/.x//sm/0201563177">Bookpool</a>, at <a href="http://www.amazon.com/exec/obidos/ASIN/0201563177">Amazon</a>)
<li><a href="http://cseng.aw.com/book/0,3828,0201703106,00.html">Win32 System Programming</a>, by <a href="http://world.std.com/~jmhart/">Johnson Hart</a> (at <a href="http://www.bookpool.com/.x//sm/0201703106">Bookpool</a>, at <a href="http://www.amazon.com/exec/obidos/ASIN/0201703106">Amazon</a>)
<li><a href="http://www.oreilly.com/catalog/make2/">Managing Projects with Make</a>, by Andrew Oram &amp; <a href="http://www.oreilly.com/~stevet/">Steve Talbott</a> (at <a href="http://www.bookpool.com/.x//sm/0937175900">Bookpool</a>, at <a href="http://www.amazon.com/exec/obidos/ASIN/0937175900">Amazon</a>)
<p>
<li><a href="http://vig.prenhall.com/catalog/academic/product/1,4096,0131900676,00.html">Thread Time</a>, by Scott Norton &amp; Mark DiPasquale (at <a href="http://www.bookpool.com/.x//sm/0131900676">Bookpool</a>, at <a href="http://www.amazon.com/exec/obidos/ASIN/0131900676">Amazon</a>)
<li><a href="http://cseng.awl.com/book/0,3828,0201633922,00.html">Programming with POSIX Thrads</a>, by David Butenhof (at <a href="http://www.bookpool.com/.x//sm/0201633922">Bookpool</a>, at <a href="http://www.amazon.com/exec/obidos/ASIN/0201633922">Amazon</a>)
</ul>
<p>
<hr>
</body>
</HTML>

View File

@ -1,62 +0,0 @@
<!-- vi: set ts=4 sw=4 : -->
<!-- vim: set tw=75 : -->
<HTML>
<head>
<title>Metamod Mailing lists</title>
</head>
<body>
<h1>Mailing lists
</h1>
I've created a couple of lists on YahooGroups (formerly egroups (formerly
onelist)):
<ul>
<li> <a href="http://groups.yahoo.com/group/metamod-announce/">metamod-announce</a> for announcements of new versions and plugins
<li> <a href="http://groups.yahoo.com/group/metamod/">metamod</a> for
questions, support, discussion, etc
</ul>
There are simple subscribe forms below.
<table cellspacing=0 cellpadding=2 border=0 bgcolor=#DDCCFF>
<tr>
<form method=GET action="http://groups.yahoo.com/subscribe/metamod-announce">
<td align=center>
<b>Subscribe to metamod-announce</b><br>
<input type=text name="user" value="enter email address" size=20><br>
<a href="http://groups.yahoo.com/group/metamod-announce/">groups.yahoo.com/metamod-announce</a>
</td>
<td>
<input type=image border=0 alt="Click here to join metamod-announce"
name="Click here to join metamod" src="http://groups.yahoo.com/img/ui/join.gif">
</td>
</form>
</tr>
</table>
<p>
<table cellspacing=0 cellpadding=2 border=0 bgcolor=#DDCCFF>
<tr>
<form method=GET action="http://groups.yahoo.com/subscribe/metamod">
<td align=center>
<b>Subscribe to metamod</b><br>
<input type=text name="user" value="enter email address" size=20><br>
<a href="http://groups.yahoo.com/group/metamod/">groups.yahoo.com/metamod</a>
</td>
<td>
<input type=image border=0 alt="Click here to join metamod"
name="Click here to join metamod" src="http://groups.yahoo.com/img/ui/join.gif">
</td>
</form>
</tr>
</table>
<p>
<hr>
</body>
</HTML>

View File

@ -1,696 +0,0 @@
<!-- vi: set ts=4 sw=4 : -->
<!-- vim: set tw=75 : -->
<HTML>
<head>
<title>Using Metamod</title>
</head>
<body>
<h1>Using Metamod
</h1>
<a name=clientcommands>
<h2>Client Commands
</h2></a>
Similar to the <a href="#commands">server console interface</a>, clients
can also issue commands to Metamod, of the following form:
<ul>
<li> <b><tt>meta version</tt></b> - displays version information about the
Metamod instance currently running on the server, ie:
<p>
<tt>Metamod v1.21p37 2013/05/30 (5:13)
<br>by Will Day <willday@metamod.org>
<br>&nbsp;&nbsp;http://www.metamod.org/
<br>&nbsp;Patch: Metamod-P (mm-p) v37
<br>&nbsp;by Jussi Kivilinna
<br>&nbsp;&nbsp;&nbsp;http://koti.mbnet.fi/axh/
<br>compiled: Feb 18 2013, 11:53:27 EET (optimized)
</tt>
<p><li> <b><tt>meta list</tt></b> - displays information about the list of
currently running plugins, ie:
<p>
<tt>Currently running plugins:
<br>[ 1] Trace HLSDK API, v1.XX.93, 2003/02/17, by Will Day &lt;willday@metamod.org&gt;, see http://www.metamod.org/
<br>[ 2] Adminmod, v2.50.56 (MM), Jul 13 2003, by Alfred Reynolds &lt;alfred@valvesoftware.com&gt;, see http://www.adminmod.org/
<br>2 plugins
</tt>
</ul>
<a name=clientcvars>
<h2>Client Cvars
</h2></a>
Also available to client browser applications is a cvar
<b><tt>metamod_version</tt></b> that should report the version of Metamod
running on the server, ie:
<p>
<dd><tt>"metamod_version" is "1.21p37"</tt>
<a name=installation>
<h2>Installation
</h2></a>
<!--
If you have installed <a href="http://www.adminmod.org/">AdminMod</a> 2.50
or later, then the AM installer has already installed Metamod for you. If
you only want to upgrade your Metamod with a more recent version, simply
grab the <a href="http://metamod.org/dl/dlls/metamod.dll">metamod.dll</a> (win32) or <a
href="http://metamod.org/dl/dlls/metamod_i386.so">metamod_i386.so</a> (linux) file and
replace the file currently on your system.
<p>
-->
If you want to install Metamod by hand, here's what you have to do:
<ul>
<p><li> Install the Metamod library (.dll for win32, or .so for linux) to a
directory under your <b>game</b> directory. For instance, if you were
running Counter-Strike, under win32 you might want have:
<p><pre>
half-life/cstrike/addons/metamod/dlls/metamod.dll
</pre>
<p>If a directory you want doesn't exist, create it.
<p><li> Edit the "<tt>liblist.gam</tt>" file in your <b>game</b> directory,
replacing the game dll filename with the Metamod dll filename. For
instance with Counter-Strike, you would change:
<p><dl><tt>
<dd>gamedll "dlls/mp.dll"
<dd>gamedll_linux "dlls/cs.so"
</tt></dl>
to:
<dl><tt>
<dd>gamedll "addons/metamod/dlls/metamod.dll"
<dd>gamedll_linux "addons/metamod/dlls/metamod.so"
</tt></dl>
<p>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.
<p><li> To load plugins at game startup, you'll need to create a "<a
href="#plugins.ini">plugins.ini</a>" file containing a list of the plugins
you want to load.
</ul>
<p><br><a name=configuration>
<h2>Configuration
</h2></a>
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.
<p>
Generally speaking, the two methods of providing configuration
information to Metamod are:
<ul>
<li> on the command line, via <a href="localinfo">+localinfo</a>
arguments to hlds.
<li> as the contents of some <b>file</b> that Metamod reads and parses.
</ul>
<p>
The confusing part can come when the <i>pathnames</i> to some of the config
files can be specified via command line options - or indeed, when the
pathnames to <i>some</i> config files can be specified in <i>other</i>
config files.
<p>
In any case, here are the various config options and config files Metamod
uses, (listed in order of priority), where "<tt><i>$gamedir</i></tt>"
indicates the game directory, ie "cstrike":
<ul>
<li> <tt>+<a href="#localinfo">localinfo</a> mm_configfile</tt>
<i>&lt;file&gt;</i>
<p>
<li> <tt>+<a href="#localinfo">localinfo</a> mm_pluginsfile</tt>
<i>&lt;file&gt;</i>
<li> <tt><a href="#config.ini">config.ini</a> option: plugins_file</tt>
<i>&lt;file&gt;</i>
<li> <tt><i>$gamedir</i>/addons/metamod/<a href="#plugins.ini">plugins.ini</a></tt>
<li> <tt><i>$gamedir</i>/metamod.ini</tt>
<p>
<li> <tt>$<a href="#localinfo">localinfo</a> mm_execcfg</tt>
<i>&lt;file&gt;</i>
<li> <tt><a href="#config.ini">config.ini</a> option: exec_cfg</tt>
<i>&lt;file&gt;</i>
<li> <tt><i>$gamedir</i>/addons/metamod/<a href="#exec.cfg">exec.cfg</a></tt>
<li> <tt><i>$gamedir</i>/metaexec.cfg</tt>
<p>
<li> <tt>$<a href="#localinfo">localinfo</a> mm_gamedll</tt>
<i>&lt;file&gt;</i>
<li> <tt><a href="#config.ini">config.ini</a> option: gamedll</tt>
<i>&lt;file&gt;</i>
<li> <tt><strike><i>$gamedir</i>/metagame.ini</strike></tt>
<i><b>-- No longer supported.</b></i>
</ul>
<p><br><a name=metamod.ini></a><a name=plugins.ini>
<h2>File: <tt>plugins.ini</tt>
</h2></a>
Default location: <b><i>$gamedir</i>/addons/metamod/plugins.ini</b>, ie
"cstrike/addons/metamod/plugins.ini".
<p>Plugins are described in a file "plugins.ini" and each line describes a
plugin to load:
<dl>
<dd> <i>&lt;platform&gt; &lt;filepath&gt; [&lt;description&gt;]</i>
</dl>
<p> Fields are whitespace delimited (tabs/spaces).
<ul>
<li><i>Platform</i> is a keyword, either <tt>"<b>linux</b>"</tt> or
<tt>"<b>win32</b>"</tt>.
<p><li><i>Filepath</i> 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 <b>forward</b> slashes (<b>/</b>) and not <b>backward</b>
slashes (<b>\</b>), even on windows platforms.
<p>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.
<p><li><i>Description</i> 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 <b><i>is</i></b> allowed;
quoting is unnecessary.
</ul>
Comments are recognized at <b><i>only</i></b> the beginning of a line, and
can be in either shell style ("<tt>#</tt>") or c++ style ("<tt>//</tt>").
<p> For instance, in <tt>"<b>cstrike/addons/metamod/plugins.ini</b>"</tt>
these are all valid lines:
<p><pre>
// 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
</pre>
<p> Note that order in the plugins.ini file <b><i>is</i></b> significant.
Plugins are loaded and accessed in the order specified, so ordering
<i>can</i> be important, depending on the plugin(s).
<p> The file is re-read at changelevel, as well as on demand (via
<tt>"<b>meta refresh</b>"</tt> console command; see below). When the file
is re-read, it will:
<ul>
<li> load any new plugins added to the file
<li> unload any plugins that have been deleted from the file. This is
only applicable to plugins loaded <b><i>from the inifile</i></b>. If the
plugin was loaded from the console, it will not be unloaded during a
refresh, whether it's in the inifile or not.
<li> 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.
</ul>
<p>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.
<p> You can override the name of this file by specifying it via the <a
href="#localinfo">+localinfo</a> field "<a
href="#mm_pluginsfile"><b>mm_pluginsfile</b></a>".
<p> For compatibility with previous versions, Metamod will also look for a
file "metamod.ini" under the gamedir, ie "<b>cstrike/metamod.ini</b>".
<p><br><a name=config.ini>
<h2>File: <tt>config.ini</tt>
</h2></a>
Default location: <b><i>$gamedir</i>/addons/metamod/config.ini</b>, ie
"cstrike/addons/metamod/config.ini".
<p>
This contains basic config information, at the moment duplicating most of
the <a href="#localinfo">+localinfo</a> 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").
<p>
Basic format is:
<dl>
<dd> <i>&lt;option&gt; &lt;value&gt;</i>
</dl>
<p> Fields are whitespace delimited (tabs/spaces). Comments are recognized
at <b><i>only</i></b> the beginning of a line, and can be in either shell
style ("<tt>#</tt>") or c++ style ("<tt>//</tt>").
The following is a list of currently recognized options, their defaults,
and examples of usage:
<ul>
<p><li> <tt><b>debuglevel</b> <i>&lt;number&gt;</i></tt>
<p> where &lt;number&gt; is an integer, 0 and up.
<br> Sets the initial debugging level for metamod (same as cvar
"meta_debug").
<br> Default is normally 0. If hlds is run with "-dev", default is 3.
<br> Overridden by: <a href="#localinfo">+localinfo</a> <a
href="#mm_debug">mm_debug</a> &lt;number&gt;
<br> Examples:
<br> <tt>debuglevel 0</tt>
<br> <tt>debuglevel 42</tt>
<p><li> <tt><b>gamedll</b> <i>&lt;path&gt;</i></tt>
<p> where &lt;path&gt; is an absolute path, or a path relative to
the gamedir.
<br> Overrides the auto-detected gamedll, in particular for bots.
<br> Default is empty, with gamedll being auto-recognized based on the
gamedir.
<br> Overridden by: <a href="#localinfo">+localinfo</a> <a
href="#mm_gamedll">mm_gamedll</a> &lt;number&gt;
<br> Examples:
<br> <tt>gamedll dlls/hl.dll</tt>
<br> <tt>gamedll ../podbot/podbot.dll</tt>
<br> <tt>gamedll /home/bots/dlls/mybot.dll</tt>
<p><li> <tt><b>plugins_file</b> <i>&lt;path&gt;</i></tt>
<p> where &lt;path&gt; is an absolute path, or a path relative to
the gamedir.
<br> Overrides the default filename containing the MM plugins to load.
<br> Default is "addons/metamod/<a href="#plugins.ini">plugins.ini</a>".
<br> Overridden by: <a href="#localinfo">+localinfo</a> <a
href="#mm_pluginsfile">mm_pluginsfile</a> &lt;number&gt;
<br> Examples:
<br> <tt>plugins_file cfg/clanmode.ini</tt>
<br> <tt>plugins_file ../private.ini</tt>
<br> <tt>plugins_file /home/half-life/testing.ini</tt>
<p><li> <tt><b>exec_cfg</b> <i>&lt;path&gt;</i></tt>
<p> where &lt;path&gt; is a path relative to the gamedir.
<b>NOTE!</b> This <i>cannot</i> be an absolute path, as hlds will
not "exec" absolute pathnames.
<br> Overrides the default filename containing hlds commands to run
just after loading Metamod.
<br> Default is "addons/metamod/<a href="#exec.cfg">exec.cfg</a>".
<br> Overridden by: <a href="#localinfo">+localinfo</a> <a
href="#mm_execcfg">mm_execcfg</a> &lt;number&gt;
<br> Examples:
<br> <tt>exec_cfg configs/debugging.cfg</tt>
<br> <tt>exec_cfg ../clan/match.cfg</tt>
<p><li> <tt><b>autodetect</b> <i>&lt;yes/no&gt;</i></tt>
<p> Setting to disable or enable autodetection of gamedll. Extra feature for Metamod+All-Mod-Support Patch.
<br> Default is "yes".
<br> Overridden by: <a href="#localinfo">+localinfo</a> <a
href="#mm_autodetect">mm_autodetect</a> &lt;yes/no&gt;
<p><li> <tt><b>clientmeta</b> <i>&lt;yes/no&gt;</i></tt>
<p> Setting to disable or enable Metamod's client commands, 'meta list' and 'meta version'. Extra setting for Metamod+All-Mod-Support Patch.
<br> Default is "yes".
<br> Overridden by: <a href="#localinfo">+localinfo</a> <a
href="#mm_clientmeta">mm_clientmeta</a> &lt;yes/no&gt;
</ul>
<p> You can override the name of this file by specifying it via the <a
href="#localinfo">+localinfo</a> field "<a
href="#mm_configfile"><b>mm_configfile</b></a>".
<p><br>
<a name=metaexec.cfg></a><a name=exec.cfg>
<h2>File: <tt>exec.cfg</tt>
</h2></a>
Default location: <b><i>$gamedir</i>/addons/metamod/exec.cfg</b>, ie
"cstrike/addons/metamod/exec.cfg".
<p.This is an optional file containing server commands or cvar settings, and
which is read by the server just after loading the initial plugins (from
plugins.ini).
<p>This is necessary for plugins that need to have settings specified prior
to early API routines like ServerActivate, since <tt>autoexec.cfg</tt> is
read too early and <tt>server.cfg</tt> is read to late. In particular, I
found this necessary for the Trace plugin, in order to trace routines like
<tt>RegUserMsg</tt> which are called during ServerActivate.
<p> You can override the name of this file by specifying it via the <a
href="#localinfo">+localinfo</a> field "<a
href="#mm_execcfg"><b>mm_execcfg</b></a>".
<p> For compatibility with previous versions, Metamod will also look for a
file "metaexec.cfg" under the gamedir, ie "<b>cstrike/metaexec.cfg</b>".
<p><br>
<a name=metagame.ini>
<h2><strike>file: <tt>metagame.ini</tt></strike>
</h2></a>
<b>NOTE! This file is no longer supported!</b> -- use instead the
<a href="#localinfo">+localinfo</a> field
"<a href="#mm_gamedll"><b>mm_gamedll</b></a>" or the <a
href="#config.ini">config.ini</a> option <b>gamedll</b>.
<p><br>
<a name=localinfo>
<h2>Commandline option: <tt>+localinfo</tt>
</h2></a>
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:
<dl>
<dd><tt>+localinfo &lt;<i>field</i>&gt; &lt;<i>value</i>&gt;</tt>
</dl>
Current localinfo fields recognized by Metamod:
<ul>
<p><a name=mm_configfile><li><b>mm_configfile</b></a> Specifies the
file that lists config options, instead of using the file <a
href="#config.ini">config.ini</a>. The <tt>&lt;<i>value</i>&gt;</tt>
should be the pathname of the config file, either absolute path or
path relative to the gamedir.
<p><a name=mm_pluginsfile><li><b>mm_pluginsfile</b></a> Specifies a
file that lists the Metamod plugins to load, instead of using the file <a
href="#plugins.ini">plugins.ini</a>. The <tt>&lt;<i>value</i>&gt;</tt>
should be the pathname of the plugins file, either absolute path or
path relative to the gamedir.
<p><a name=mm_execcfg><li><b>mm_execcfg</b></a> Specifies a file
that contains cvar or other configs to be exec'd after loading the
plugins, instead of using the file <a href="#exec.cfg">exec.cfg</a>.
The <tt>&lt;<i>value</i>&gt;</tt> should be the pathname of the exec
file, either absolute path or path relative to the gamedir.
<p><a name=mm_autodetect><li><b>mm_autodetect</b></a> 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.
<p><a name=mm_clientmeta><li><b>mm_clientmeta</b></a> 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.
<p><a name=mm_gamedll><li><b>mm_gamedll</b></a> Specifies a game or Bot
DLL to be used instead of the normal gameDLL. The
<tt>&lt;<i>value</i>&gt;</tt> should be the pathname of the DLL,
either absolute path or path relative to the gamedir.
<p>This replaces using the <a href="#metagame.ini">metagame.ini</a>
file. With previous versions of AdminMod (2.10 and earlier), this same
functionality was provided by the file "admin.ini".
<p><a name=mm_debug><li><b>mm_debug</b></a> Specifies an initial
meta_debug value.
</ul>
<p>Note that each localinfo field can have only <b>one value</b>. If
specified more than once on the command line, only the <b>last</b> one will
be recognized. (In particular, trying to use mm_gamedll to load multiple
dll-style bots will <b>not</b> work. In a case like that, the multiple
dll's must be chained together).
<p>Some examples are:
<p><pre>
./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
</pre>
<p>Note, paths should use unix-style <b>forward</b> slashes (<b>/</b>) and
not <b>backward</b> slashes (<b>\</b>), even on windows platforms.
<p><br>
<a name=commands>
<h2>Commands
</h2></a>
<p>All console command functionality is provide by a single command "meta",
with multiple sub-commands:
<p><pre>
usage: meta &lt;command&gt; [&lt;arguments&gt;]
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 &lt;name&gt; - find and load a plugin with the given name
unload &lt;plugin&gt; - unload a loaded plugin
reload &lt;plugin&gt; - unload a plugin and load it again
info &lt;plugin&gt; - show all information about a plugin
pause &lt;plugin&gt; - pause a loaded, running plugin
unpause &lt;plugin&gt; - unpause a previously paused plugin
retry &lt;plugin&gt; - retry a plugin that previously failed its action
clear &lt;plugin&gt; - clear a failed plugin from the list
force_unload &lt;plugin&gt; - forcibly unload a loaded plugin
require &lt;plugin&gt; - exit server if plugin not loaded/running
</pre><p>
where <tt>&lt;plugin&gt;</tt> can be either the plugin index number, or a non-ambiguous prefix
string matching description or file.
<p>Also, a single cvar is available:
<pre>
meta_debug - set debugging level
</pre>
<p>For instance with:
<p><pre>
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
</pre><p>
<p>You could then do any of the following to unload the API Trace plugin:
<pre>
meta unload 1
meta unload trace
meta unload mm_trace
</pre>
<br>
<a name=plugin-loading>
<h2>Plugin Loading/Unloading Process
</h2></a>
Through the process of loading and unloading, a plugin can be in one of
several different states ('stat' column in the 'meta list' output):
<ul>
<li><b><tt>BADFILE</tt></b> - The plugin file couldn't be found, or it
doesn't appear to be a valid Metamod plugin.
<li><b><tt>OPENED</tt></b> - The plugin file was found, and is a valid
Metamod plugin, and is ready to be loaded.
<li><b><tt>FAILED</tt></b> - The plugin file attempted to load or unload,
but couldn't complete for some reason.
<li><b><tt>RUNNING</tt></b> - The plugin file was loaded and is active
and running.
<li><b><tt>PAUSED</tt></b> - The plugin file was loaded, but has been
temporarily disabled.
</ul>
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:
<ul>
<li><b><tt>LOAD</tt></b> - Open and look at the plugin file.
<li><b><tt>ATTACH</tt></b> - Attach the plugin to the running game; ie
activate it
<li><b><tt>UNLOAD</tt></b> - Remove the plugin from the running game and
close the file
<li><b><tt>RELOAD</tt></b> - Unload/close and re-open/load the plugin,
for instance when the plugin file has changed.
</ul>
<br>
<a name=example-output>
<h2>Example Output
</h2></a>
<p>Here's some other example output:
<p><pre>
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 &lt;alfred@mazuma.net.au&gt;
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
</pre>
<p>
<hr>
</body>
</HTML>

View File

@ -1,62 +0,0 @@
<!-- vi: set ts=4 sw=4 : -->
<!-- vim: set tw=75 : -->
<HTML>
<head>
<title>HLSDK NEWAPI Notes</title>
</head>
<body>
<h1>HLSDK NEWAPI Notes
</h1>
<hr>
<ul>
<li><a href=#OnFreeEntPrivateData>OnFreeEntPrivateData</a>
<li><a href=#GameShutdown>GameShutdown</a>
<li><a href=#ShouldCollide>ShouldCollide</a>
</ul>
<b>NOTE</b>: No examples of these found in SDK...
<p>
<hr><h3><tt><a name="OnFreeEntPrivateData">OnFreeEntPrivateData</a></tt></h3>
<dd><tt>void OnFreeEntPrivateData(edict_t pEnt);</tt><p>
<i>from engine/eiface.h:</i><br>
<blockquote><tt>
Called right before the object's memory is freed. Calls its destructor.
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
See also <a
href="http://list.valvesoftware.com/pipermail/hlcoders/2002-January/001397.html"
>Ken Birdwell on constructors</a>, from the HLCoders list.
<br>Added in SDK 2.0.
</blockquote>
<hr><h3><tt><a name="GameShutdown">GameShutdown</a></tt></h3>
<dd><tt>void GameShutdown(void);</tt><p>
<p><i>comments:</i><br>
<blockquote>
Added in SDK 2.0.
</blockquote>
<hr><h3><tt><a name="ShouldCollide">ShouldCollide</a></tt></h3>
<dd><tt>int ShouldCollide(edict_t *pentTouched, edict_t *pentOther);</tt><p>
<i>from kenb@valvesoftware.com, via HLCoders:</i><br>
<blockquote><tt>
..a hook that can override if any two entities should collide
when they try to pass through each other.
</tt></blockquote>
<p><i>comments:</i><br>
<blockquote>
Mugsy from DoD indicates that the return value for normal operation is 1.
<br>Added in SDK 2.0.
</blockquote>
<p>
<hr>
</body>
</HTML>

View File

@ -1,127 +0,0 @@
<!-- vi: set ts=4 sw=4 : -->
<!-- vim: set tw=75 : -->
<HTML>
<head>
<title>Metamod Release Notes</title>
</head>
<body>
<h1>Release Notes
</h1>
<a name=major.1.17>
<h2>Major changes with Metamod 1.17
</h2></a>
<ul>
<p><li> New cvar "<b><tt>metamod_version</tt></b>" that can be queried from
client game browsers.
<p><li> New console commands available to clients (much like the existing
server console commands):
<p><ul>
<li> <b><tt>"meta version"</tt></b> prints out version information
(date, compile type, etc).
<li> <b><tt>"meta list"</tt></b> shows a list of the plugins running on
the server (name, author, version, etc).
</ul>
<p><li> New file <a
href="metamod.html#config.ini"><tt><b>config.ini</b></tt></a> to provide a
more reliable and flexible method of specifying configuration options.
At the moment, the recognized options mirror those from <a
href="metamod.html#localinfo">+localinfo</a>, ie:
<p>
<ul>
<li> <tt><b>debuglevel</b> <i>&lt;number&gt;</i></tt>
<li> <tt><b>gamedll</b> <i>&lt;path&gt;</i></tt>
<li> <tt><b>plugins_file</b> <i>&lt;path&gt;</i></tt>
<li> <tt><b>exec_cfg</b> <i>&lt;path&gt;</i></tt>
<li> <tt><b>autodetect</b> <i>&lt;yes/no&gt;</i></tt>
<li> <tt><b>clientmeta</b> <i>&lt;yes/no&gt;</i></tt>
</ul>
<p>Default path is "<tt>addons/metamod/config.ini</tt>" but can be
overridden with "<tt>+localinfo mm_configfile</tt>".
<p>Also, new console command <tt><b>"meta config"</b></tt> to display this
information.
<p><li> New console command <tt><b>"meta require"</b></tt> 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:
<p>
<ul>
<li> <tt>meta require adminmod</tt>
<li> <tt>meta require 1</tt>
</ul>
<p>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.
<p><li> 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.
</ul>
<p>
<hr>
<a name=compat.1.13>
<h2>Incompatible changes with Metamod 1.13
</h2></a>
<ul>
<li> Config file <tt><b>metagame.ini</b></tt> is no longer supported. This
file was deprecated in Metamod 1.08 (2001/06/16). Use instead the "<a
href="metamod.html#localinfo">+localinfo mm_gamedll</a>" option.
</ul>
<a name=major.1.13>
<h2>Major changes with Metamod 1.13
</h2></a>
<ul>
<li> New config file names and locations, per the <a
href="http://www.unitedadmins.com/info_addon_dev_standards.aspx">Addon
Development Standard</a> rev 1.00, developed on the <a
href="http://list.valvesoftware.com/mailman/listinfo/hlds_apps">hlds_apps</a>
list.
<p> Default config file locations are now:
<ul>
<li> $gamedir/addons/metamod/plugins.ini
<li> $gamedir/addons/metamod/exec.cfg
</ul>
<p> Previous config file locations are also supported for backwards
compability:
<ul>
<li> $gamedir/metamod.ini
<li> $gamedir/metaexec.cfg
</ul>
<p> Note that the pathnames in plugins.ini are unchanged, and are still
relative to the gamedir.
</ul>
<p>
<hr>
</body>
</HTML>

View File

@ -1,35 +0,0 @@
<!-- vi: set ts=4 sw=4 : -->
<!-- vim: set tw=75 : -->
<HTML>
<head>
<title>Metamod Supported Mods/Games</title>
</head>
<body>
<a name=supported>
<h1>Supported Mods/Games
</h1>
</a>
Metamod includes support for the following mods, with version and last
update if known.
<p>
To get support added for a new Mod, or for an updated version of a Mod, see
<a href="gamesupport.html">Adding game support</a>.
<p>
<table border=5 rules=all cellpadding=5>
<tr> <th>Name</th> <th>Version</th> <th>Last update</th> <th>Ent list</th> <th>Comments</th></tr>
<tr><td>ALL MODS SUPPORTED BY <br>
&nbsp;&nbsp;&nbsp;&nbsp;All-Mod-Support PATCH<br>
&nbsp;&nbsp;&nbsp;&nbsp;By Jussi Kivilinna<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://koti.mbnet.fi/axh/">http://koti.mbnet.fi/axh/</a>
</td><td></td><td></td><td>NONE</td></tr>
</table>
</body>
</HTML>

View File

@ -1,88 +0,0 @@
<!-- vi: set ts=4 sw=4 : -->
<!-- vim: set tw=75 : -->
<HTML>
<head>
<title>Metamod TraceAPI Plugin</title>
</head>
<body>
<h1>TraceAPI plugin
</h1>
<p> This was originally intended as a (more or less) complete example of a
Metamod plugin. It catches <b><i>every</i></b> call available to it (dll
routines both before and after the game, as well as engine functions both
before and after the engine).
<p> 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.
:)
<p> This can actually be useful for tracking the operation of the HL
engine, as well as that of a particular HL game mod.
<p> It recognizes the following server cvars:
<p><pre>
// 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
</pre>
<p> and the following server commands:
<p><pre>
// 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 &lt;APIroutine&gt;
// Disable tracing of a given routine, iff previously enabled with "trace".
// Doesn't affect routines being logged via "trace_*" level.
trace unset &lt;APIroutine&gt;
// 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
</pre>
<p> Note the information it logs on each routine invocation is, at the
moment, relatively minimal. I included information that seemed obvious
(args for a <tt>ClientCommand</tt>, 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 (<tt>CreateBaseline</tt>, 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.
<p>
<hr>
</body>
</HTML>

View File

@ -1,48 +0,0 @@
<!-- vi: set ts=4 sw=4 : -->
<!-- vim: set tw=75 : -->
<HTML>
<head>
<title>Metamod WDMisc Plugin</title>
</head>
<body>
<h1>WDMisc plugin
</h1>
<p> This is a simple plugin that I use as a testbed for various features
and other things I need to try from a plugin.
<p> It currently provides two features:
<ul>
<p><li> 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.
<p><li> 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").
<p>Although this works, it is really a rather <i><b>poor</b></i>
solution to the problem, as it assumes a <i><b>lot</b></i> of
string-compares, which <i>can</i> 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.
</ul>
Other features to be added/removed in the future...
<p>
<hr>
</body>
</HTML>

View File

@ -1,35 +0,0 @@
// vim: set ft=c :
//
// Format is as follows:
// <platform> <path> <description>
//
// 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

View File

@ -1,27 +0,0 @@
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
--------------------------------------------------------------------------
<willday@metamod.org>

View File

@ -1,19 +0,0 @@
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/ | | | | |
+---------------------------------+----------+--------+--------+----------+

View File

@ -1,35 +0,0 @@
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.
--------------------------------------------------------------------------

View File

@ -1,340 +0,0 @@
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
<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
--------------------------------------------------------------------------

View File

@ -1,702 +0,0 @@
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><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.
--------------------------------------------------------------------------

File diff suppressed because it is too large Load Diff

View File

@ -1,120 +0,0 @@
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. :)
--------------------------------------------------------------------------

View File

@ -1,6 +0,0 @@
Adding Game/Mod Support
=-=-=-=-=-=-=-=-=-=-=-=
Metamod-P already supports your Mod.
--------------------------------------------------------------------------

View File

@ -1,129 +0,0 @@
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))
--------------------------------------------------------------------------

View File

@ -1,25 +0,0 @@
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/)
--------------------------------------------------------------------------

View File

@ -1,568 +0,0 @@
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>
- [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:
<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".
[DEL]file: metagame.ini[DEL]
=========
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
No child plugins.
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
--------------------------------------------------------------------------

View File

@ -1,55 +0,0 @@
HLSDK NEWAPI Notes
=-=-=-=-=-=-=-=-=-=
--------------------------------------------------------------------------
- OnFreeEntPrivateData
- GameShutdown
- ShouldCollide
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.
--------------------------------------------------------------------------

View File

@ -1,79 +0,0 @@
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.
--------------------------------------------------------------------------

View File

@ -1,18 +0,0 @@
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 | Ent | Comments |
| | | update | list | |
|--------------------------------+----------+--------+--------+----------|
| ALL MODS SUPPORTED BY | ALL | | NONE | |
| All-Mod-Support PATCH | | | | |
| By Jussi Kivilinna | | | | |
| http://koti.mbnet.fi/axh/ | | | | |
+------------------------------------------------------------------------+

View File

@ -1,70 +0,0 @@
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.
--------------------------------------------------------------------------

View File

@ -1,32 +0,0 @@
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...
--------------------------------------------------------------------------

View File

@ -1,110 +0,0 @@
# vi: set ts=4 sw=4 :
# vim: set tw=75 :
After writing and testing under linux, I then tried to move the code to
windows, and being unfamiliar with windows coding, I ran into several
issues I wasn't aware of, which I describe here for posterity:
- Apparently the GiveFnptrsToDll() routine has to be declared "WINAPI",
which is a macro for "__stdcall". Without this, the behavior I observed
was that the routine would be called, and would return seemingly okay,
but during the following call to GetNewDLLFunctions, the application
would crash.
This was especially confusing because, using SDK2.1 source for
reference, the use of EXPORT and DLLEXPORT macros seemed inconsistent.
Doing a simple grep for "define.*EXPORT" turns up these definitions:
cl_dll/cl_dll.h: #define EXPORT _declspec( dllexport )
cl_dll/hud_iface.h: #define EXPORT _declspec( dllexport )
dlls/cbase.h: #define EXPORT _declspec( dllexport )
cl_dll/in_defs.h: #define DLLEXPORT __declspec( dllexport )
engine/eiface.h: #define DLLEXPORT __stdcall
Between "EXPORT", "DLLEXPORT", and "dllexport", and then "_declspec" and
"__declspec", they all seemed the same to me. Of course, they aren't.
It seems "__declspec(dllexport)" (I'm still unsure about the single vs
double underscore) simply says that the routine should be visible
externally, outside the DLL. The "__stdcall" specifier, however,
changes the way the stack is cleaned up when the routine returns, and no
doubt having the routine itself using a different convention than the
caller (the engine) caused memory corruption and thus application
crashes. The specifier doesn't seem, to me, to be particularly relative
to DLL exporting per se, so I'd say the macro name was unfortunate and
confusing.
The other confusion was that GiveFnptrsToDll is apparently the _only_
function that needs to be declared __stdcall; declaring the other
external functions (GetEntityAPI, etc) produced MSVC errors and other
problems (as might be expected).
Also, it seems "__declspec" has to be placed _before_ the return type,
whereas "__stdcall" is placed _after_ the return type. Well, at least
in MSVC; mingw appears to be looser.
Further complicating this, the __stdcall generally causes the function
to be given an internal symbol with a trailing "@" and digits specifying
the number of bytes in the function arguments (in this case, "8"). At
least, this is true under the mingw GNU compiler; I couldn't tell if
MSVC was the same. In any case, by default then, the function is
exported as "GiveFnptrsToDll@8()", and the engine can't resolve the name
properly.
In mingw you can apparently alias this to the non-@ name via ".def"
files, but it looked like that if I have a .def file, I'd also have to
list all the entities in linkfunc.cpp (which would be a pain to
maintain). Under MSVC, this didn't appear to be a problem, as both the
SDK source and adminmod source use a ".def" file, but still export all
the other functions okay. I'm not sure why the difference; I may be
missing a mingw link parameter/option.
There are, however, mingw link options (--add-stdcall-alias, --kill-at)
to handle the problem (the first appears to do the job; I'm unsure about
the second), while still exporting all the other necessary functions.
Now, reading MSDN:
http://msdn.microsoft.com/library/devprods/vs6/visualc/vccore/_core_determine_which_exporting_method_to_use.htm
there's apparently an issue of an "export ordinal" and the order of the
list of exported functions, which is solved by using a .def file.
Perhaps this is why the SDK uses a .def file, in which case I may have
problems if I don't specify that GiveFnptrsToDll is the first function
(as the SDK .def file does). Although, perhaps this isn't even an issue
given that the DLL functions are called by name explicitly
(dlsym/GetFuncPointer), rather than being resolved to an library offset
at link time.
In any case, apparently using the conventions in the SDK, and including
the same headers in the same order produces the correct result, but it
wasn't at all clear to me, when looking at the source.
This one was hard for me to track down, and I also found this page to
be helpful:
http://www.geocities.com/Tokyo/Towers/6162/win32/dll/make.html
- Linux appears to be either (a) much more forgiving about improper
pointer references in memcpy, or (b) laying out its memory in a manner
that hides problems with that. In my case, I had:
DLL_FUNCTIONS *dllapi_table;
dllapi_table=malloc(...)
memcpy(pFunctionTable, &dllapi_table, sizeof(DLL_FUNCTIONS));
Since the argument is already a pointer, the extra "&" is improper, and
should instead be:
memcpy(pFunctionTable, dllapi_table, sizeof(DLL_FUNCTIONS));
Under linux, it didn't seem to be a problem, and program operation was
(as far as I could tell) correct. Under windows, though, I got program
crashes after calling the 4th or 5th entity in linkfunc.cpp. It
wasn't at all obvious what the problem was, and took quite a while to
track down.
- missing functions (strtok_r, snprintf)
- missing macros (PATH_MAX, NAME_MAX)
- dlerror, getlasterror
- LoadLibrary returning 0 on failure (vs dlclose returning 0 on success)
- limits.h under mingw

View File

@ -1,112 +0,0 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
// engine/launcher interface
#if !defined( ENGINE_LAUNCHER_APIH )
#define ENGINE_LAUNCHER_APIH
#ifdef _WIN32
#ifndef __MINGW32__
#pragma once
#endif /* not __MINGW32__ */
#endif
//typedef void ( *xcommand_t ) ( void );
#define RENDERTYPE_UNDEFINED 0
#define RENDERTYPE_SOFTWARE 1
#define RENDERTYPE_HARDWARE 2
#define ENGINE_LAUNCHER_API_VERSION 1
typedef struct engine_api_s
{
int version;
int rendertype;
int size;
// Functions
int ( *GetEngineState ) ( void );
void ( *Cbuf_AddText ) ( char *text ); // append cmd at end of buf
void ( *Cbuf_InsertText ) ( char *text ); // insert cmd at start of buf
void ( *Cmd_AddCommand ) ( char *cmd_name, void ( *funcname )( void ) );
int ( *Cmd_Argc ) ( void );
char *( *Cmd_Args ) ( void );
char *( *Cmd_Argv ) ( int arg );
void ( *Con_Printf ) ( char *, ... );
void ( *Con_SafePrintf ) ( char *, ... );
void ( *Cvar_Set ) ( char *var_name, char *value );
void ( *Cvar_SetValue ) ( char *var_name, float value );
int ( *Cvar_VariableInt ) ( char *var_name );
char *( *Cvar_VariableString ) ( char *var_name );
float ( *Cvar_VariableValue ) ( char *var_name );
void ( *ForceReloadProfile ) ( void );
int ( *GetGameInfo ) ( struct GameInfo_s *pGI, char *pszChannel );
void ( *GameSetBackground ) ( int bBack );
void ( *GameSetState ) ( int iState );
void ( *GameSetSubState ) ( int iState );
int ( *GetPauseState ) ( void );
int ( *Host_Frame ) ( float time, int iState, int *stateInfo );
void ( *Host_GetHostInfo ) ( float *fps, int *nActive, int *nSpectators, int *nMaxPlayers, char *pszMap );
void ( *Host_Shutdown ) ( void );
int ( *Game_Init ) ( char *lpCmdLine, unsigned char *pMem, int iSize, struct exefuncs_s *pef, void *, int );
void ( *IN_ActivateMouse ) ( void );
void ( *IN_ClearStates ) ( void );
void ( *IN_DeactivateMouse ) ( void );
void ( *IN_MouseEvent ) ( int mstate );
void ( *Keyboard_ReturnToGame ) ( void );
void ( *Key_ClearStates ) ( void );
void ( *Key_Event ) ( int key, int down );
int ( *LoadGame ) ( const char *pszSlot );
void ( *S_BlockSound ) ( void );
void ( *S_ClearBuffer ) ( void );
void ( *S_GetDSPointer ) ( struct IDirectSound **lpDS, struct IDirectSoundBuffer **lpDSBuf );
void *( *S_GetWAVPointer ) ( void );
void ( *S_UnblockSound ) ( void );
int ( *SaveGame ) ( const char *pszSlot, const char *pszComment );
void ( *SetAuth ) ( void *pobj );
void ( *SetMessagePumpDisableMode ) ( int bMode );
void ( *SetPauseState ) ( int bPause );
void ( *SetStartupMode ) ( int bMode );
void ( *SNDDMA_Shutdown ) ( void );
void ( *Snd_AcquireBuffer ) ( void );
void ( *Snd_ReleaseBuffer ) ( void );
void ( *StoreProfile ) ( void );
double ( *Sys_FloatTime ) ( void );
void ( *VID_UpdateWindowVars ) ( void *prc, int x, int y );
void ( *VID_UpdateVID ) ( struct viddef_s *pvid );
// VGUI interfaces
void ( *VGui_CallEngineSurfaceProc ) ( void* hwnd, unsigned int msg, unsigned int wparam, long lparam );
// notifications that the launcher is taking/giving focus to the engine
void ( *EngineTakingFocus ) ( void );
void ( *LauncherTakingFocus ) ( void );
#ifdef _WIN32
// Only filled in by rendertype RENDERTYPE_HARDWARE
void ( *GL_Init ) ( void );
int ( *GL_SetMode ) ( HWND hwndGame, HDC *pmaindc, HGLRC *pbaseRC, int fD3D, const char *p, const char *pszCmdLine );
void ( *GL_Shutdown ) ( HWND hwnd, HDC hdc, HGLRC hglrc );
void ( *QGL_D3DShared ) ( struct tagD3DGlobals *d3dGShared );
int ( WINAPI *glSwapBuffers ) ( HDC dc );
void ( *DirectorProc ) ( unsigned int cmd, void * params );
#else
// NOT USED IN LINUX!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
void ( *GL_Init ) ( void );
void ( *GL_SetMode ) ( void );
void ( *GL_Shutdown ) ( void );
void ( *QGL_D3DShared ) ( void );
void ( *glSwapBuffers ) ( void );
void ( *DirectorProc ) ( void );
// LINUX
#endif
} engine_api_t;
#endif // ENGINE_LAUNCHER_APIH

View File

@ -1,50 +0,0 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
// exefuncs.h
#ifndef EXEFUNCS_H
#define EXEFUNCS_H
// Engine hands this to DLLs for functionality callbacks
typedef struct exefuncs_s
{
int fMMX;
int iCPUMhz;
void (*unused1)(void);
void (*unused2)(void);
void (*unused3)(void);
void (*unused4)(void);
void (*VID_ForceLockState)(int lk);
int (*VID_ForceUnlockedAndReturnState)(void);
void (*unused5)(void);
void (*unused6)(void);
void (*unused7)(void);
void (*unused8)(void);
void (*unused9)(void);
void (*unused10)(void);
void (*unused11)(void);
void (*unused12)(void);
void (*unused13)(void);
void (*unused14)(void);
void (*unused15)(void);
void (*ErrorMessage)(int nLevel, const char *pszErrorMessage);
void (*unused16)(void);
void (*Sys_Printf)(char *fmt, ...);
void (*unused17)(void);
void (*unused18)(void);
void (*unused19)(void);
void (*unused20)(void);
void (*unused21)(void);
void (*unused22)(void);
void (*unused23)(void);
void (*unused24)(void);
void (*unused25)(void);
void (*unused26)(void);
void (*unused27)(void);
} exefuncs_t;
#endif

View File

@ -1,515 +0,0 @@
/***
*
* Copyright (c) 1999, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* object code is restricted to non-commercial enhancements to products from
* Valve LLC. All other use, distribution, or modification is prohibited
* without written permission from Valve LLC.
*
****/
//
// Misc utility code
//
#define SVC_DIRECTOR 51
inline void MESSAGE_BEGIN( int msg_dest, int msg_type, const float *pOrigin, entvars_t *ent ); // implementation later in this file
extern globalvars_t *gpGlobals;
// Use this instead of ALLOC_STRING on constant strings
//#define STRING(offset) ((const char *)(gpGlobals->pStringBase + (int)offset))
//#define MAKE_STRING(str) ((int)str - (int)STRING(0))
inline const char *STRING(long offset) {return (const char *)(gpGlobals->pStringBase + (long)offset);}
inline long MAKE_STRING(const char *str) {return (long)str - (long)STRING(0);}
inline edict_t *FIND_ENTITY_BY_CLASSNAME(edict_t *entStart, const char *pszName)
{
return FIND_ENTITY_BY_STRING(entStart, "classname", pszName);
}
inline edict_t *FIND_ENTITY_BY_TARGETNAME(edict_t *entStart, const char *pszName)
{
return FIND_ENTITY_BY_STRING(entStart, "targetname", pszName);
}
// for doing a reverse lookup. Say you have a door, and want to find its button.
inline edict_t *FIND_ENTITY_BY_TARGET(edict_t *entStart, const char *pszName)
{
return FIND_ENTITY_BY_STRING(entStart, "target", pszName);
}
// Keeps clutter down a bit, when writing key-value pairs
#define WRITEKEY_INT(pf, szKeyName, iKeyValue) ENGINE_FPRINTF(pf, "\"%s\" \"%d\"\n", szKeyName, iKeyValue)
#define WRITEKEY_FLOAT(pf, szKeyName, flKeyValue) \
ENGINE_FPRINTF(pf, "\"%s\" \"%f\"\n", szKeyName, flKeyValue)
#define WRITEKEY_STRING(pf, szKeyName, szKeyValue) \
ENGINE_FPRINTF(pf, "\"%s\" \"%s\"\n", szKeyName, szKeyValue)
#define WRITEKEY_VECTOR(pf, szKeyName, flX, flY, flZ) \
ENGINE_FPRINTF(pf, "\"%s\" \"%f %f %f\"\n", szKeyName, flX, flY, flZ)
// Keeps clutter down a bit, when using a float as a bit-vector
#define SetBits(flBitVector, bits) ((flBitVector) = (int)(flBitVector) | (bits))
#define ClearBits(flBitVector, bits) ((flBitVector) = (int)(flBitVector) & ~(bits))
#define FBitSet(flBitVector, bit) ((int)(flBitVector) & (bit))
// Makes these more explicit, and easier to find
#define FILE_GLOBAL static
#define DLL_GLOBAL
// Until we figure out why "const" gives the compiler problems, we'll just have to use
// this bogus "empty" define to mark things as constant.
#define CONSTANT
// More explicit than "int"
typedef int EOFFSET;
// In case it's not alread defined
typedef int BOOL;
// In case this ever changes
#define M_PI 3.14159265358979323846
// Keeps clutter down a bit, when declaring external entity/global method prototypes
#define DECLARE_GLOBAL_METHOD(MethodName) extern void DLLEXPORT MethodName( void )
#define GLOBAL_METHOD(funcname) void DLLEXPORT funcname(void)
// This is the glue that hooks .MAP entity class names to our CPP classes
// The _declspec forces them to be exported by name so we can do a lookup with GetProcAddress()
// The function is used to intialize / allocate the object for the entity
#ifdef _WIN32
#define LINK_ENTITY_TO_CLASS(mapClassName,DLLClassName) \
extern "C" __declspec( dllexport ) void mapClassName( entvars_t *pev ); \
void mapClassName( entvars_t *pev ) { GetClassPtr( (DLLClassName *)pev ); }
#else
#define LINK_ENTITY_TO_CLASS(mapClassName,DLLClassName) extern "C" void mapClassName( entvars_t *pev ); void mapClassName( entvars_t *pev ) { GetClassPtr( (DLLClassName *)pev ); }
#endif
//
// Conversion among the three types of "entity", including identity-conversions.
//
#ifdef DEBUG
extern edict_t *DBG_EntOfVars(const entvars_t *pev);
inline edict_t *ENT(const entvars_t *pev) { return DBG_EntOfVars(pev); }
#else
inline edict_t *ENT(const entvars_t *pev) { return pev->pContainingEntity; }
#endif
inline edict_t *ENT(edict_t *pent) { return pent; }
inline edict_t *ENT(EOFFSET eoffset) { return (*g_engfuncs.pfnPEntityOfEntOffset)(eoffset); }
inline EOFFSET OFFSET(EOFFSET eoffset) { return eoffset; }
inline EOFFSET OFFSET(const edict_t *pent)
{
#ifdef _DEBUG
if ( !pent )
ALERT( at_error, "Bad ent in OFFSET()\n" );
#endif
return (*g_engfuncs.pfnEntOffsetOfPEntity)(pent);
}
inline EOFFSET OFFSET(entvars_t *pev)
{
#ifdef _DEBUG
if ( !pev )
ALERT( at_error, "Bad pev in OFFSET()\n" );
#endif
return OFFSET(ENT(pev));
}
inline entvars_t *VARS(entvars_t *pev) { return pev; }
inline entvars_t *VARS(edict_t *pent)
{
if ( !pent )
return NULL;
return &pent->v;
}
inline entvars_t* VARS(EOFFSET eoffset) { return VARS(ENT(eoffset)); }
inline int ENTINDEX(edict_t *pEdict) { return (*g_engfuncs.pfnIndexOfEdict)(pEdict); }
inline edict_t* INDEXENT( int iEdictNum ) { return (*g_engfuncs.pfnPEntityOfEntIndex)(iEdictNum); }
inline void MESSAGE_BEGIN( int msg_dest, int msg_type, const float *pOrigin, entvars_t *ent ) {
(*g_engfuncs.pfnMessageBegin)(msg_dest, msg_type, pOrigin, ENT(ent));
}
// Testing the three types of "entity" for nullity
#define eoNullEntity 0
inline BOOL FNullEnt(EOFFSET eoffset) { return eoffset == 0; }
inline BOOL FNullEnt(const edict_t* pent) { return pent == NULL || FNullEnt(OFFSET(pent)); }
inline BOOL FNullEnt(entvars_t* pev) { return pev == NULL || FNullEnt(OFFSET(pev)); }
// Testing strings for nullity
#define iStringNull 0
inline BOOL FStringNull(int iString) { return iString == iStringNull; }
#define cchMapNameMost 32
// Dot products for view cone checking
#define VIEW_FIELD_FULL (float)-1.0 // +-180 degrees
#define VIEW_FIELD_WIDE (float)-0.7 // +-135 degrees 0.1 // +-85 degrees, used for full FOV checks
#define VIEW_FIELD_NARROW (float)0.7 // +-45 degrees, more narrow check used to set up ranged attacks
#define VIEW_FIELD_ULTRA_NARROW (float)0.9 // +-25 degrees, more narrow check used to set up ranged attacks
// All monsters need this data
#define DONT_BLEED -1
#define BLOOD_COLOR_RED (BYTE)247
#define BLOOD_COLOR_YELLOW (BYTE)195
#define BLOOD_COLOR_GREEN BLOOD_COLOR_YELLOW
typedef enum
{
MONSTERSTATE_NONE = 0,
MONSTERSTATE_IDLE,
MONSTERSTATE_COMBAT,
MONSTERSTATE_ALERT,
MONSTERSTATE_HUNT,
MONSTERSTATE_PRONE,
MONSTERSTATE_SCRIPT,
MONSTERSTATE_PLAYDEAD,
MONSTERSTATE_DEAD
} MONSTERSTATE;
// Things that toggle (buttons/triggers/doors) need this
typedef enum
{
TS_AT_TOP,
TS_AT_BOTTOM,
TS_GOING_UP,
TS_GOING_DOWN
} TOGGLE_STATE;
// Misc useful
#include "string.h"
inline BOOL FStrEq(const char*sz1, const char*sz2)
{ return (strcmp(sz1, sz2) == 0); }
inline BOOL FClassnameIs(edict_t* pent, const char* szClassname)
{ return FStrEq(STRING(VARS(pent)->classname), szClassname); }
inline BOOL FClassnameIs(entvars_t* pev, const char* szClassname)
{ return FStrEq(STRING(pev->classname), szClassname); }
// Misc. Prototypes
extern void UTIL_SetSize (entvars_t* pev, const Vector &vecMin, const Vector &vecMax);
extern float UTIL_VecToYaw (const Vector &vec);
extern Vector UTIL_VecToAngles (const Vector &vec);
extern float UTIL_AngleMod (float a);
extern float UTIL_AngleDiff ( float destAngle, float srcAngle );
#define UTIL_EntitiesInPVS(pent) (*g_engfuncs.pfnEntitiesInPVS)(pent)
extern void UTIL_MakeVectors (const Vector &vecAngles);
inline void UTIL_MakeVectorsPrivate( Vector &vecAngles, float *p_vForward, float *p_vRight, float *p_vUp )
{
g_engfuncs.pfnAngleVectors( vecAngles, p_vForward, p_vRight, p_vUp );
}
extern void UTIL_MakeAimVectors ( const Vector &vecAngles ); // like MakeVectors, but assumes pitch isn't inverted
extern void UTIL_MakeInvVectors ( const Vector &vec, globalvars_t *pgv );
extern void UTIL_SetOrigin ( entvars_t* pev, const Vector &vecOrigin );
extern void UTIL_EmitAmbientSound ( edict_t *entity, const Vector &vecOrigin, const char *samp, float vol, float attenuation, int fFlags, int pitch );
extern void UTIL_ParticleEffect ( const Vector &vecOrigin, const Vector &vecDirection, ULONG ulColor, ULONG ulCount );
extern void UTIL_ScreenShake ( const Vector &center, float amplitude, float frequency, float duration, float radius );
extern void UTIL_ScreenShakeAll ( const Vector &center, float amplitude, float frequency, float duration );
extern void UTIL_ShowMessageAll ( const char *pString );
extern void UTIL_ScreenFadeAll ( const Vector &color, float fadeTime, float holdTime, int alpha, int flags );
typedef enum { ignore_monsters=1, dont_ignore_monsters=0, missile=2 } IGNORE_MONSTERS;
typedef enum { ignore_glass=1, dont_ignore_glass=0 } IGNORE_GLASS;
extern void UTIL_TraceLine (const Vector &vecStart, const Vector &vecEnd, IGNORE_MONSTERS igmon, edict_t *pentIgnore, TraceResult *ptr);
extern void UTIL_TraceLine (const Vector &vecStart, const Vector &vecEnd, IGNORE_MONSTERS igmon, IGNORE_GLASS ignoreGlass, edict_t *pentIgnore, TraceResult *ptr);
typedef enum { point_hull=0, human_hull=1, large_hull=2, head_hull=3 } hull_enum;
extern void UTIL_TraceHull (const Vector &vecStart, const Vector &vecEnd, IGNORE_MONSTERS igmon, int hullNumber, edict_t *pentIgnore, TraceResult *ptr);
extern TraceResult UTIL_GetGlobalTrace (void);
extern void UTIL_TraceModel (const Vector &vecStart, const Vector &vecEnd, int hullNumber, edict_t *pentModel, TraceResult *ptr);
extern Vector UTIL_GetAimVector (edict_t* pent, float flSpeed);
extern int UTIL_PointContents (const Vector &vec);
extern void UTIL_BloodStream( const Vector &origin, const Vector &direction, int color, int amount );
extern void UTIL_BloodDrips( const Vector &origin, const Vector &direction, int color, int amount );
extern Vector UTIL_RandomBloodVector( void );
extern BOOL UTIL_ShouldShowBlood( int bloodColor );
extern void UTIL_BloodDecalTrace( TraceResult *pTrace, int bloodColor );
extern void UTIL_DecalTrace( TraceResult *pTrace, int decalNumber );
extern void UTIL_PlayerDecalTrace( TraceResult *pTrace, int playernum, int decalNumber, BOOL bIsCustom );
extern void UTIL_GunshotDecalTrace( TraceResult *pTrace, int decalNumber );
extern void UTIL_Sparks( const Vector &position );
extern void UTIL_Ricochet( const Vector &position, float scale );
extern void UTIL_StringToVector( float *pVector, const char *pString );
extern void UTIL_StringToIntArray( int *pVector, int count, const char *pString );
extern Vector UTIL_ClampVectorToBox( const Vector &input, const Vector &clampSize );
extern float UTIL_Approach( float target, float value, float speed );
extern float UTIL_ApproachAngle( float target, float value, float speed );
extern float UTIL_AngleDistance( float next, float cur );
extern char *UTIL_VarArgs( char *format, ... );
extern BOOL UTIL_IsValidEntity( edict_t *pent );
extern BOOL UTIL_TeamsMatch( const char *pTeamName1, const char *pTeamName2 );
// Use for ease-in, ease-out style interpolation (accel/decel)
extern float UTIL_SplineFraction( float value, float scale );
// Search for water transition along a vertical line
extern float UTIL_WaterLevel( const Vector &position, float minz, float maxz );
extern void UTIL_Bubbles( Vector mins, Vector maxs, int count );
extern void UTIL_BubbleTrail( Vector from, Vector to, int count );
// allows precacheing of other entities
extern void UTIL_PrecacheOther( const char *szClassname );
// prints a message to each client
extern void UTIL_ClientPrintAll( int msg_dest, const char *msg_name, const char *param1 = NULL, const char *param2 = NULL, const char *param3 = NULL, const char *param4 = NULL );
inline void UTIL_CenterPrintAll( const char *msg_name, const char *param1 = NULL, const char *param2 = NULL, const char *param3 = NULL, const char *param4 = NULL )
{
UTIL_ClientPrintAll( HUD_PRINTCENTER, msg_name, param1, param2, param3, param4 );
}
class CBasePlayerItem;
class CBasePlayer;
extern BOOL UTIL_GetNextBestWeapon( CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon );
// prints messages through the HUD
extern void ClientPrint( entvars_t *client, int msg_dest, const char *msg_name, const char *param1 = NULL, const char *param2 = NULL, const char *param3 = NULL, const char *param4 = NULL );
typedef struct hudtextparms_s
{
float x;
float y;
int effect;
byte r1, g1, b1, a1;
byte r2, g2, b2, a2;
float fadeinTime;
float fadeoutTime;
float holdTime;
float fxTime;
int channel;
} hudtextparms_t;
// prints as transparent 'title' to the HUD
extern void UTIL_HudMessageAll( const hudtextparms_t &textparms, const char *pMessage );
// for handy use with ClientPrint params
extern char *UTIL_dtos1( int d );
extern char *UTIL_dtos2( int d );
extern char *UTIL_dtos3( int d );
extern char *UTIL_dtos4( int d );
// Writes message to console with timestamp and FragLog header.
extern void UTIL_LogPrintf( char *fmt, ... );
// Sorta like FInViewCone, but for nonmonsters.
extern float UTIL_DotPoints ( const Vector &vecSrc, const Vector &vecCheck, const Vector &vecDir );
extern void UTIL_StripToken( const char *pKey, char *pDest );// for redundant keynames
// Misc functions
extern void SetMovedir(entvars_t* pev);
extern Vector VecBModelOrigin( entvars_t* pevBModel );
extern int BuildChangeList( LEVELLIST *pLevelList, int maxList );
//
// How did I ever live without ASSERT?
//
#ifdef DEBUG
void DBG_AssertFunction(BOOL fExpr, const char* szExpr, const char* szFile, int szLine, const char* szMessage);
#define ASSERT(f) DBG_AssertFunction(f, #f, __FILE__, __LINE__, NULL)
#define ASSERTSZ(f, sz) DBG_AssertFunction(f, #f, __FILE__, __LINE__, sz)
#else // !DEBUG
#define ASSERT(f)
#define ASSERTSZ(f, sz)
#endif // !DEBUG
extern DLL_GLOBAL const Vector g_vecZero;
//
// Constants that were used only by QC (maybe not used at all now)
//
// Un-comment only as needed
//
#define LANGUAGE_ENGLISH 0
#define LANGUAGE_GERMAN 1
#define LANGUAGE_FRENCH 2
#define LANGUAGE_BRITISH 3
extern DLL_GLOBAL int g_Language;
#define AMBIENT_SOUND_STATIC 0 // medium radius attenuation
#define AMBIENT_SOUND_EVERYWHERE 1
#define AMBIENT_SOUND_SMALLRADIUS 2
#define AMBIENT_SOUND_MEDIUMRADIUS 4
#define AMBIENT_SOUND_LARGERADIUS 8
#define AMBIENT_SOUND_START_SILENT 16
#define AMBIENT_SOUND_NOT_LOOPING 32
#define SPEAKER_START_SILENT 1 // wait for trigger 'on' to start announcements
#define SND_SPAWNING (1<<8) // duplicated in protocol.h we're spawing, used in some cases for ambients
#define SND_STOP (1<<5) // duplicated in protocol.h stop sound
#define SND_CHANGE_VOL (1<<6) // duplicated in protocol.h change sound vol
#define SND_CHANGE_PITCH (1<<7) // duplicated in protocol.h change sound pitch
#define LFO_SQUARE 1
#define LFO_TRIANGLE 2
#define LFO_RANDOM 3
// func_rotating
#define SF_BRUSH_ROTATE_Y_AXIS 0
#define SF_BRUSH_ROTATE_INSTANT 1
#define SF_BRUSH_ROTATE_BACKWARDS 2
#define SF_BRUSH_ROTATE_Z_AXIS 4
#define SF_BRUSH_ROTATE_X_AXIS 8
#define SF_PENDULUM_AUTO_RETURN 16
#define SF_PENDULUM_PASSABLE 32
#define SF_BRUSH_ROTATE_SMALLRADIUS 128
#define SF_BRUSH_ROTATE_MEDIUMRADIUS 256
#define SF_BRUSH_ROTATE_LARGERADIUS 512
#define PUSH_BLOCK_ONLY_X 1
#define PUSH_BLOCK_ONLY_Y 2
#define VEC_HULL_MIN Vector(-16, -16, -36)
#define VEC_HULL_MAX Vector( 16, 16, 36)
#define VEC_HUMAN_HULL_MIN Vector( -16, -16, 0 )
#define VEC_HUMAN_HULL_MAX Vector( 16, 16, 72 )
#define VEC_HUMAN_HULL_DUCK Vector( 16, 16, 36 )
#define VEC_VIEW Vector( 0, 0, 28 )
#define VEC_DUCK_HULL_MIN Vector(-16, -16, -18 )
#define VEC_DUCK_HULL_MAX Vector( 16, 16, 18)
#define VEC_DUCK_VIEW Vector( 0, 0, 12 )
#define SVC_TEMPENTITY 23
#define SVC_INTERMISSION 30
#define SVC_CDTRACK 32
#define SVC_WEAPONANIM 35
#define SVC_ROOMTYPE 37
#define SVC_HLTV 50
// prxoy director stuff
#define DRC_EVENT 3 // informs the dircetor about ann important game event
#define DRC_FLAG_PRIO_MASK 0x0F // priorities between 0 and 15 (15 most important)
#define DRC_FLAG_DRAMATIC (1<<5)
// triggers
#define SF_TRIGGER_ALLOWMONSTERS 1// monsters allowed to fire this trigger
#define SF_TRIGGER_NOCLIENTS 2// players not allowed to fire this trigger
#define SF_TRIGGER_PUSHABLES 4// only pushables can fire this trigger
// func breakable
#define SF_BREAK_TRIGGER_ONLY 1// may only be broken by trigger
#define SF_BREAK_TOUCH 2// can be 'crashed through' by running player (plate glass)
#define SF_BREAK_PRESSURE 4// can be broken by a player standing on it
#define SF_BREAK_CROWBAR 256// instant break if hit with crowbar
// func_pushable (it's also func_breakable, so don't collide with those flags)
#define SF_PUSH_BREAKABLE 128
#define SF_LIGHT_START_OFF 1
#define SPAWNFLAG_NOMESSAGE 1
#define SPAWNFLAG_NOTOUCH 1
#define SPAWNFLAG_DROIDONLY 4
#define SPAWNFLAG_USEONLY 1 // can't be touched, must be used (buttons)
#define TELE_PLAYER_ONLY 1
#define TELE_SILENT 2
#define SF_TRIG_PUSH_ONCE 1
// Sound Utilities
// sentence groups
#define CBSENTENCENAME_MAX 16
#define CVOXFILESENTENCEMAX 1536 // max number of sentences in game. NOTE: this must match
// CVOXFILESENTENCEMAX in engine\sound.h!!!
extern char gszallsentencenames[CVOXFILESENTENCEMAX][CBSENTENCENAME_MAX];
extern int gcallsentences;
int USENTENCEG_Pick(int isentenceg, char *szfound);
int USENTENCEG_PickSequential(int isentenceg, char *szfound, int ipick, int freset);
void USENTENCEG_InitLRU(unsigned char *plru, int count);
void SENTENCEG_Init();
void SENTENCEG_Stop(edict_t *entity, int isentenceg, int ipick);
int SENTENCEG_PlayRndI(edict_t *entity, int isentenceg, float volume, float attenuation, int flags, int pitch);
int SENTENCEG_PlayRndSz(edict_t *entity, const char *szrootname, float volume, float attenuation, int flags, int pitch);
int SENTENCEG_PlaySequentialSz(edict_t *entity, const char *szrootname, float volume, float attenuation, int flags, int pitch, int ipick, int freset);
int SENTENCEG_GetIndex(const char *szrootname);
int SENTENCEG_Lookup(const char *sample, char *sentencenum);
void TEXTURETYPE_Init();
char TEXTURETYPE_Find(char *name);
float TEXTURETYPE_PlaySound(TraceResult *ptr, Vector vecSrc, Vector vecEnd, int iBulletType);
// NOTE: use EMIT_SOUND_DYN to set the pitch of a sound. Pitch of 100
// is no pitch shift. Pitch > 100 up to 255 is a higher pitch, pitch < 100
// down to 1 is a lower pitch. 150 to 70 is the realistic range.
// EMIT_SOUND_DYN with pitch != 100 should be used sparingly, as it's not quite as
// fast as EMIT_SOUND (the pitchshift mixer is not native coded).
void EMIT_SOUND_DYN(edict_t *entity, int channel, const char *sample, float volume, float attenuation,
int flags, int pitch);
inline void EMIT_SOUND(edict_t *entity, int channel, const char *sample, float volume, float attenuation)
{
EMIT_SOUND_DYN(entity, channel, sample, volume, attenuation, 0, PITCH_NORM);
}
inline void STOP_SOUND(edict_t *entity, int channel, const char *sample)
{
EMIT_SOUND_DYN(entity, channel, sample, 0, 0, SND_STOP, PITCH_NORM);
}
void EMIT_SOUND_SUIT(edict_t *entity, const char *sample);
void EMIT_GROUPID_SUIT(edict_t *entity, int isentenceg);
void EMIT_GROUPNAME_SUIT(edict_t *entity, const char *groupname);
#define PRECACHE_SOUND_ARRAY( a ) \
{ for (int i = 0; i < ARRAYSIZE( a ); i++ ) PRECACHE_SOUND((char *) a [i]); }
#define EMIT_SOUND_ARRAY_DYN( chan, array ) \
EMIT_SOUND_DYN ( ENT(pev), chan , array [ RANDOM_LONG(0,ARRAYSIZE( array )-1) ], 1.0, ATTN_NORM, 0, RANDOM_LONG(95,105) );
#define RANDOM_SOUND_ARRAY( array ) (array) [ RANDOM_LONG(0,ARRAYSIZE( (array) )-1) ]
#define PLAYBACK_EVENT( flags, who, index ) PLAYBACK_EVENT_FULL( flags, who, index, 0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, 0, 0, 0, 0 );
#define PLAYBACK_EVENT_DELAY( flags, who, index, delay ) PLAYBACK_EVENT_FULL( flags, who, index, delay, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, 0, 0, 0, 0 );
#define GROUP_OP_AND 0
#define GROUP_OP_NAND 1
extern int g_groupmask;
extern int g_groupop;
class UTIL_GroupTrace
{
public:
UTIL_GroupTrace( int groupmask, int op );
~UTIL_GroupTrace( void );
private:
int m_oldgroupmask, m_oldgroupop;
};
void UTIL_SetGroupTrace( int groupmask, int op );
void UTIL_UnsetGroupTrace( void );
int UTIL_SharedRandomLong( unsigned int seed, int low, int high );
float UTIL_SharedRandomFloat( unsigned int seed, float low, float high );
float UTIL_WeaponTimeBase( void );

View File

@ -1,120 +0,0 @@
/***
*
* Copyright (c) 1999, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* object code is restricted to non-commercial enhancements to products from
* Valve LLC. All other use, distribution, or modification is prohibited
* without written permission from Valve LLC.
*
****/
#ifndef VECTOR_H
#define VECTOR_H
class Vector;
//=========================================================
// 2DVector - used for many pathfinding and many other
// operations that are treated as planar rather than 3d.
//=========================================================
class Vector2D
{
public:
inline Vector2D(void): x(0.0), y(0.0) { }
inline Vector2D(float X, float Y): x(0.0), y(0.0) { x = X; y = Y; }
inline Vector2D operator+(const Vector2D& v) const { return Vector2D(x+v.x, y+v.y); }
inline Vector2D operator-(const Vector2D& v) const { return Vector2D(x-v.x, y-v.y); }
inline Vector2D operator*(float fl) const { return Vector2D(x*fl, y*fl); }
inline Vector2D operator/(float fl) const { fl=1/fl; return Vector2D(x*fl, y*fl); }
inline float Length(void) const { return (float)sqrt(x*x + y*y ); }
inline Vector2D Normalize ( void ) const
{
// Vector2D vec2;
float flLen = Length();
if ( flLen == 0 )
{
return Vector2D( 0, 0 );
}
else
{
flLen = 1 / flLen;
return Vector2D( x * flLen, y * flLen );
}
}
vec_t x, y;
};
inline float DotProduct(const Vector2D& a, const Vector2D& b) { return( a.x*b.x + a.y*b.y ); }
inline Vector2D operator*(float fl, const Vector2D& v) { return v * fl; }
//=========================================================
// 3D Vector
//=========================================================
class Vector // same data-layout as engine's vec3_t,
{ // which is a vec_t[3]
public:
// Construction/destruction
inline Vector(void): x(0.0), y(0.0), z(0.0) { }
inline Vector(float X, float Y, float Z): x(0.0), y(0.0), z(0.0) { x = X; y = Y; z = Z; }
//inline Vector(double X, double Y, double Z) { x = (float)X; y = (float)Y; z = (float)Z; }
//inline Vector(int X, int Y, int Z) { x = (float)X; y = (float)Y; z = (float)Z; }
inline Vector(const Vector& v): x(0.0), y(0.0), z(0.0) { x = v.x; y = v.y; z = v.z; }
inline Vector(float rgfl[3]): x(0.0), y(0.0), z(0.0) { x = rgfl[0]; y = rgfl[1]; z = rgfl[2]; }
inline Vector(const Vector2D& v): x(0.0), y(0.0), z(0.0){ x = v.x; y = v.y; }
// Operators
inline Vector operator-(void) const { return Vector(-x,-y,-z); }
inline int operator==(const Vector& v) const { return x==v.x && y==v.y && z==v.z; }
inline int operator!=(const Vector& v) const { return !(*this==v); }
inline Vector operator+(const Vector& v) const { return Vector(x+v.x, y+v.y, z+v.z); }
inline Vector operator-(const Vector& v) const { return Vector(x-v.x, y-v.y, z-v.z); }
inline Vector operator*(float fl) const { return Vector(x*fl, y*fl, z*fl); }
inline Vector operator/(float fl) const { fl=1/fl; return Vector(x*fl, y*fl, z*fl); }
// Methods
inline void CopyToArray(float* rgfl) const { rgfl[0] = x, rgfl[1] = y, rgfl[2] = z; }
inline float Length(void) const { return (float)sqrt(x*x + y*y + z*z); }
inline operator float *() { return &x; } // Vectors will now automatically convert to float * when needed
inline operator Vector2D () const { return (*this).Make2D(); }
#if !defined(__GNUC__) || (__GNUC__ >= 3)
inline operator const float *() const { return &x; } // Vectors will now automatically convert to float * when needed
#endif
inline Vector Normalize(void) const
{
float flLen = Length();
if (flLen == 0) return Vector(0,0,1); // ????
flLen = 1 / flLen;
return Vector(x * flLen, y * flLen, z * flLen);
}
inline Vector2D Make2D ( void ) const
{
Vector2D Vec2;
Vec2.x = x;
Vec2.y = y;
return Vec2;
}
inline float Length2D(void) const { return (float)sqrt(x*x + y*y); }
// Members
vec_t x, y, z;
};
inline Vector operator*(float fl, const Vector& v) { return v * fl; }
inline float DotProduct(const Vector& a, const Vector& b) { return(a.x*b.x+a.y*b.y+a.z*b.z); }
inline Vector CrossProduct(const Vector& a, const Vector& b) { return Vector( a.y*b.z - a.z*b.y, a.z*b.x - a.x*b.z, a.x*b.y - a.y*b.x ); }
#endif

View File

@ -1,311 +0,0 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* object code is restricted to non-commercial enhancements to products from
* Valve LLC. All other use, distribution, or modification is prohibited
* without written permission from Valve LLC.
*
****/
//
// cdll_int.h
//
// 4-23-98
// JOHN: client dll interface declarations
//
#ifndef CDLL_INT_H
#define CDLL_INT_H
#ifdef __cplusplus
extern "C" {
#endif
#include "const.h"
// this file is included by both the engine and the client-dll,
// so make sure engine declarations aren't done twice
typedef int HSPRITE; // handle to a graphic
#define SCRINFO_SCREENFLASH 1
#define SCRINFO_STRETCHED 2
typedef struct SCREENINFO_s
{
int iSize;
int iWidth;
int iHeight;
int iFlags;
int iCharHeight;
short charWidths[256];
} SCREENINFO;
typedef struct client_data_s
{
// fields that cannot be modified (ie. have no effect if changed)
vec3_t origin;
// fields that can be changed by the cldll
vec3_t viewangles;
int iWeaponBits;
float fov; // field of view
} client_data_t;
typedef struct client_sprite_s
{
char szName[64];
char szSprite[64];
int hspr;
int iRes;
wrect_t rc;
} client_sprite_t;
typedef struct client_textmessage_s
{
int effect;
byte r1, g1, b1, a1; // 2 colors for effects
byte r2, g2, b2, a2;
float x;
float y;
float fadein;
float fadeout;
float holdtime;
float fxtime;
const char *pName;
const char *pMessage;
} client_textmessage_t;
typedef struct hud_player_info_s
{
char *name;
short ping;
byte thisplayer; // TRUE if this is the calling player
// stuff that's unused at the moment, but should be done
byte spectator;
byte packetloss;
char *model;
short topcolor;
short bottomcolor;
} hud_player_info_t;
typedef struct cl_enginefuncs_s
{
// sprite handlers
HSPRITE ( *pfnSPR_Load ) ( const char *szPicName );
int ( *pfnSPR_Frames ) ( HSPRITE hPic );
int ( *pfnSPR_Height ) ( HSPRITE hPic, int frame );
int ( *pfnSPR_Width ) ( HSPRITE hPic, int frame );
void ( *pfnSPR_Set ) ( HSPRITE hPic, int r, int g, int b );
void ( *pfnSPR_Draw ) ( int frame, int x, int y, const wrect_t *prc );
void ( *pfnSPR_DrawHoles ) ( int frame, int x, int y, const wrect_t *prc );
void ( *pfnSPR_DrawAdditive ) ( int frame, int x, int y, const wrect_t *prc );
void ( *pfnSPR_EnableScissor ) ( int x, int y, int width, int height );
void ( *pfnSPR_DisableScissor ) ( void );
client_sprite_t *( *pfnSPR_GetList ) ( char *psz, int *piCount );
// screen handlers
void ( *pfnFillRGBA ) ( int x, int y, int width, int height, int r, int g, int b, int a );
int ( *pfnGetScreenInfo ) ( SCREENINFO *pscrinfo );
void ( *pfnSetCrosshair ) ( HSPRITE hspr, wrect_t rc, int r, int g, int b );
// cvar handlers
struct cvar_s *( *pfnRegisterVariable ) ( char *szName, char *szValue, int flags );
float ( *pfnGetCvarFloat ) ( char *szName );
char* ( *pfnGetCvarString ) ( char *szName );
// command handlers
int ( *pfnAddCommand ) ( char *cmd_name, void (*function)(void) );
int ( *pfnHookUserMsg ) ( char *szMsgName, pfnUserMsgHook pfn );
int ( *pfnServerCmd ) ( char *szCmdString );
int ( *pfnClientCmd ) ( char *szCmdString );
void ( *pfnGetPlayerInfo ) ( int ent_num, hud_player_info_t *pinfo );
// sound handlers
void ( *pfnPlaySoundByName ) ( char *szSound, float volume );
void ( *pfnPlaySoundByIndex ) ( int iSound, float volume );
// vector helpers
void ( *pfnAngleVectors ) ( const float * vecAngles, float * forward, float * right, float * up );
// text message system
client_textmessage_t *( *pfnTextMessageGet ) ( const char *pName );
int ( *pfnDrawCharacter ) ( int x, int y, int number, int r, int g, int b );
int ( *pfnDrawConsoleString ) ( int x, int y, char *string );
void ( *pfnDrawSetTextColor ) ( float r, float g, float b );
void ( *pfnDrawConsoleStringLen )( const char *string, int *length, int *height );
void ( *pfnConsolePrint ) ( const char *string );
void ( *pfnCenterPrint ) ( const char *string );
// Added for user input processing
int ( *GetWindowCenterX ) ( void );
int ( *GetWindowCenterY ) ( void );
void ( *GetViewAngles ) ( float * );
void ( *SetViewAngles ) ( float * );
int ( *GetMaxClients ) ( void );
void ( *Cvar_SetValue ) ( char *cvar, float value );
int (*Cmd_Argc) (void);
char *( *Cmd_Argv ) ( int arg );
void ( *Con_Printf ) ( char *fmt, ... );
void ( *Con_DPrintf ) ( char *fmt, ... );
void ( *Con_NPrintf ) ( int pos, char *fmt, ... );
void ( *Con_NXPrintf ) ( struct con_nprint_s *info, char *fmt, ... );
const char *( *PhysInfo_ValueForKey ) ( const char *key );
const char *( *ServerInfo_ValueForKey )( const char *key );
float ( *GetClientMaxspeed ) ( void );
int ( *CheckParm ) ( char *parm, char **ppnext );
void ( *Key_Event ) ( int key, int down );
void ( *GetMousePosition ) ( int *mx, int *my );
int ( *IsNoClipping ) ( void );
struct cl_entity_s *( *GetLocalPlayer ) ( void );
struct cl_entity_s *( *GetViewModel ) ( void );
struct cl_entity_s *( *GetEntityByIndex ) ( int idx );
float ( *GetClientTime ) ( void );
void ( *V_CalcShake ) ( void );
void ( *V_ApplyShake ) ( float *origin, float *angles, float factor );
int ( *PM_PointContents ) ( float *point, int *truecontents );
int ( *PM_WaterEntity ) ( float *p );
struct pmtrace_s *( *PM_TraceLine ) ( float *start, float *end, int flags, int usehull, int ignore_pe );
struct model_s *( *CL_LoadModel ) ( const char *modelname, int *index );
int ( *CL_CreateVisibleEntity ) ( int type, struct cl_entity_s *ent );
const struct model_s * ( *GetSpritePointer ) ( HSPRITE hSprite );
void ( *pfnPlaySoundByNameAtLocation ) ( char *szSound, float volume, float *origin );
unsigned short ( *pfnPrecacheEvent ) ( int type, const char* psz );
void ( *pfnPlaybackEvent ) ( int flags, const struct edict_s *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 );
void ( *pfnWeaponAnim ) ( int iAnim, int body );
float ( *pfnRandomFloat ) ( float flLow, float flHigh );
long ( *pfnRandomLong ) ( long lLow, long lHigh );
void ( *pfnHookEvent ) ( char *name, void ( *pfnEvent )( struct event_args_s *args ) );
int (*Con_IsVisible) ();
const char *( *pfnGetGameDirectory ) ( void );
struct cvar_s *( *pfnGetCvarPointer ) ( const char *szName );
const char *( *Key_LookupBinding ) ( const char *pBinding );
const char *( *pfnGetLevelName ) ( void );
void ( *pfnGetScreenFade ) ( struct screenfade_s *fade );
void ( *pfnSetScreenFade ) ( struct screenfade_s *fade );
void *( *VGui_GetPanel ) ( );
void ( *VGui_ViewportPaintBackground ) (int extents[4]);
byte* (*COM_LoadFile) ( char *path, int usehunk, int *pLength );
char* (*COM_ParseFile) ( char *data, char *token );
void (*COM_FreeFile) ( void *buffer );
struct triangleapi_s *pTriAPI;
struct efx_api_s *pEfxAPI;
struct event_api_s *pEventAPI;
struct demo_api_s *pDemoAPI;
struct net_api_s *pNetAPI;
struct IVoiceTweak_s *pVoiceTweak;
// returns 1 if the client is a spectator only (connected to a proxy), 0 otherwise or 2 if in dev_overview mode
int ( *IsSpectateOnly ) ( void );
struct model_s *( *LoadMapSprite ) ( const char *filename );
// file search functions
void ( *COM_AddAppDirectoryToSearchPath ) ( const char *pszBaseDir, const char *appName );
int ( *COM_ExpandFilename) ( const char *fileName, char *nameOutBuffer, int nameOutBufferSize );
// User info
// playerNum is in the range (1, MaxClients)
// returns NULL if player doesn't exit
// returns "" if no value is set
const char *( *PlayerInfo_ValueForKey )( int playerNum, const char *key );
void ( *PlayerInfo_SetValueForKey )( const char *key, const char *value );
// Gets a unique ID for the specified player. This is the same even if you see the player on a different server.
// iPlayer is an entity index, so client 0 would use iPlayer=1.
// Returns false if there is no player on the server in the specified slot.
qboolean (*GetPlayerUniqueID)(int iPlayer, char playerID[16]);
// TrackerID access
int (*GetTrackerIDForPlayer)(int playerSlot);
int (*GetPlayerForTrackerID)(int trackerID);
// Same as pfnServerCmd, but the message goes in the unreliable stream so it can't clog the net stream
// (but it might not get there).
int ( *pfnServerCmdUnreliable )( char *szCmdString );
void ( *pfnGetMousePos )( struct tagPOINT *ppt );
void ( *pfnSetMousePos )( int x, int y );
void ( *pfnSetMouseEnable )( qboolean fEnable );
} cl_enginefunc_t;
#ifndef IN_BUTTONS_H
#include "in_buttons.h"
#endif
#define CLDLL_INTERFACE_VERSION 7
extern void ClientDLL_Init( void ); // from cdll_int.c
extern void ClientDLL_Shutdown( void );
extern void ClientDLL_HudInit( void );
extern void ClientDLL_HudVidInit( void );
extern void ClientDLL_UpdateClientData( void );
extern void ClientDLL_Frame( double time );
extern void ClientDLL_HudRedraw( int intermission );
extern void ClientDLL_MoveClient( struct playermove_s *ppmove );
extern void ClientDLL_ClientMoveInit( struct playermove_s *ppmove );
extern char ClientDLL_ClientTextureType( char *name );
extern void ClientDLL_CreateMove( float frametime, struct usercmd_s *cmd, int active );
extern void ClientDLL_ActivateMouse( void );
extern void ClientDLL_DeactivateMouse( void );
extern void ClientDLL_MouseEvent( int mstate );
extern void ClientDLL_ClearStates( void );
extern int ClientDLL_IsThirdPerson( void );
extern void ClientDLL_GetCameraOffsets( float *ofs );
extern int ClientDLL_GraphKeyDown( void );
extern struct kbutton_s *ClientDLL_FindKey( const char *name );
extern void ClientDLL_CAM_Think( void );
extern void ClientDLL_IN_Accumulate( void );
extern void ClientDLL_CalcRefdef( struct ref_params_s *pparams );
extern int ClientDLL_AddEntity( int type, struct cl_entity_s *ent );
extern void ClientDLL_CreateEntities( void );
extern void ClientDLL_DrawNormalTriangles( void );
extern void ClientDLL_DrawTransparentTriangles( void );
extern void ClientDLL_StudioEvent( const struct mstudioevent_s *event, const struct cl_entity_s *entity );
extern void ClientDLL_PostRunCmd( struct local_state_s *from, struct local_state_s *to, struct usercmd_s *cmd, int runfuncs, double time, unsigned int random_seed );
extern void ClientDLL_TxferLocalOverrides( struct entity_state_s *state, const struct clientdata_s *client );
extern void ClientDLL_ProcessPlayerState( struct entity_state_s *dst, const struct entity_state_s *src );
extern void ClientDLL_TxferPredictionData ( struct entity_state_s *ps, const struct entity_state_s *pps, struct clientdata_s *pcd, const struct clientdata_s *ppcd, struct weapon_data_s *wd, const struct weapon_data_s *pwd );
extern void ClientDLL_ReadDemoBuffer( int size, unsigned char *buffer );
extern int ClientDLL_ConnectionlessPacket( const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size );
extern int ClientDLL_GetHullBounds( int hullnumber, float *mins, float *maxs );
extern void ClientDLL_VGui_ConsolePrint(const char* text);
extern int ClientDLL_Key_Event( int down, int keynum, const char *pszCurrentBinding );
extern void ClientDLL_TempEntUpdate( double ft, double ct, double grav, struct tempent_s **ppFreeTE, struct tempent_s **ppActiveTE, int ( *addTEntity )( struct cl_entity_s *pEntity ), void ( *playTESound )( struct tempent_s *pTemp, float damp ) );
extern struct cl_entity_s *ClientDLL_GetUserEntity( int index );
extern void ClientDLL_VoiceStatus(int entindex, qboolean bTalking);
extern void ClientDLL_DirectorMessage( int iSize, void *pbuf );
#ifdef __cplusplus
}
#endif
#endif // CDLL_INT_H

View File

@ -1,131 +0,0 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
// keydefs.h
#ifndef KEYDEFS_H
#define KEYDEFS_H
#ifdef _WIN32
#ifndef __MINGW32__
#pragma once
#endif /* not __MINGW32__ */
#endif
//
// these are the key numbers that should be passed to Key_Event
//
#define K_TAB 9
#define K_ENTER 13
#define K_ESCAPE 27
#define K_SPACE 32
// normal keys should be passed as lowercased ascii
#define K_BACKSPACE 127
#define K_UPARROW 128
#define K_DOWNARROW 129
#define K_LEFTARROW 130
#define K_RIGHTARROW 131
#define K_ALT 132
#define K_CTRL 133
#define K_SHIFT 134
#define K_F1 135
#define K_F2 136
#define K_F3 137
#define K_F4 138
#define K_F5 139
#define K_F6 140
#define K_F7 141
#define K_F8 142
#define K_F9 143
#define K_F10 144
#define K_F11 145
#define K_F12 146
#define K_INS 147
#define K_DEL 148
#define K_PGDN 149
#define K_PGUP 150
#define K_HOME 151
#define K_END 152
#define K_KP_HOME 160
#define K_KP_UPARROW 161
#define K_KP_PGUP 162
#define K_KP_LEFTARROW 163
#define K_KP_5 164
#define K_KP_RIGHTARROW 165
#define K_KP_END 166
#define K_KP_DOWNARROW 167
#define K_KP_PGDN 168
#define K_KP_ENTER 169
#define K_KP_INS 170
#define K_KP_DEL 171
#define K_KP_SLASH 172
#define K_KP_MINUS 173
#define K_KP_PLUS 174
#define K_CAPSLOCK 175
//
// joystick buttons
//
#define K_JOY1 203
#define K_JOY2 204
#define K_JOY3 205
#define K_JOY4 206
//
// aux keys are for multi-buttoned joysticks to generate so they can use
// the normal binding process
//
#define K_AUX1 207
#define K_AUX2 208
#define K_AUX3 209
#define K_AUX4 210
#define K_AUX5 211
#define K_AUX6 212
#define K_AUX7 213
#define K_AUX8 214
#define K_AUX9 215
#define K_AUX10 216
#define K_AUX11 217
#define K_AUX12 218
#define K_AUX13 219
#define K_AUX14 220
#define K_AUX15 221
#define K_AUX16 222
#define K_AUX17 223
#define K_AUX18 224
#define K_AUX19 225
#define K_AUX20 226
#define K_AUX21 227
#define K_AUX22 228
#define K_AUX23 229
#define K_AUX24 230
#define K_AUX25 231
#define K_AUX26 232
#define K_AUX27 233
#define K_AUX28 234
#define K_AUX29 235
#define K_AUX30 236
#define K_AUX31 237
#define K_AUX32 238
#define K_MWHEELDOWN 239
#define K_MWHEELUP 240
#define K_PAUSE 255
//
// mouse buttons generate virtual keys
//
#define K_MOUSE1 241
#define K_MOUSE2 242
#define K_MOUSE3 243
#define K_MOUSE4 244
#define K_MOUSE5 245
#endif // KEYDEFS_H

View File

@ -1,2 +0,0 @@
This HLSDK is without CBaseEntity and other gamedll internal headers.
Mainly for metamod-p and plugin compiles.

BIN
lib/libacof32.lib Normal file

Binary file not shown.

BIN
lib/libirc.a Normal file

Binary file not shown.

BIN
lib/libirc.lib Normal file

Binary file not shown.

BIN
lib/linux32/libaelf32.a Normal file

Binary file not shown.

3
metamod/.gitignore vendored
View File

@ -1,3 +0,0 @@
msgs/
opt.*/
debug.*/

View File

@ -1,34 +0,0 @@
MODNAME = metamod
#__METAMOD_BUILD__ for our special eiface.h
EXTRA_CFLAGS += -D__METAMOD_BUILD__
#-DMETA_PERFMON
SRCFILES = api_hook.cpp api_info.cpp commands_meta.cpp conf_meta.cpp \
dllapi.cpp engine_api.cpp engineinfo.cpp game_support.cpp \
game_autodetect.cpp h_export.cpp linkgame.cpp linkplug.cpp \
log_meta.cpp meta_eiface.cpp metamod.cpp mlist.cpp mplayer.cpp \
mplugin.cpp mqueue.cpp mreg.cpp mutil.cpp osdep.cpp \
osdep_p.cpp reg_support.cpp sdk_util.cpp studioapi.cpp \
support_meta.cpp thread_logparse.cpp vdate.cpp
INFOFILES = info_name.h vers_meta.h
RESFILE = res_meta.rc
ifeq "$(OS)" "linux"
SRCFILES+=osdep_linkent_linux.cpp osdep_detect_gamedll_linux.cpp
EXTRA_LINK+=
else
SRCFILES+=osdep_linkent_win32.cpp osdep_detect_gamedll_win32.cpp
EXTRA_LINK+=-Xlinker --script -Xlinker i386pe.merge
endif
ifeq "$(OPT)" "opt"
EXTRA_CFLAGS += -D__INTERNALS_USE_REGPARAMS__
endif
ifeq "$(OPT)" "opt-fast"
EXTRA_CFLAGS += -D__INTERNALS_USE_REGPARAMS__
endif
#STLFILES = mreg.cpp

View File

@ -1,454 +0,0 @@
# vi: set ts=4 sw=4 :
# vim: set tw=75 :
# MetaMod makefile
# Copyright (c) 2001-2003 Will Day <willday@hpgx.net>
#
# based on the Valve SDK 2.1 Makefile as well as the Makefile
# in adminmod by Alfred Reynolds.
#
# From SDK 2.1 dlls/Makefile:
#! Half-Life StandardSDK 2.0 mp_i386.so Makefile for i386 Linux
#! April 2000 by Leon Hartwig (jehannum@planethalflife.com)
# NOTE: This is a generic Makefile for metamod and the bundled plugins, and
# is symlinked into each subdir. Per-module config statements are in
# Config.mak in each subdir.
ifeq "$(shell uname | cut -d _ -f1)" "CYGWIN"
HOST=cygwin
endif
ifdef COMSPEC
ifeq "$(HOST)" "cygwin"
ifeq "$(TARGET)" "win32"
OS=windows
else
OS=linux
endif
else
OS=windows
endif
else
OS=linux
endif
#############################################################################
# CONFIGURATION
#############################################################################
# TARGET amd64 disabled since Valve has dropped support for x86-64 server
#ifeq "$(TARGET)" "amd64"
# TARGETTYPE = amd64
#else
TARGETTYPE = i386
#endif
# set paths for your environment
ifeq "$(OS)" "linux"
INST_DIR=$(HOME)/half-life/cstrike/dlls
TEST_DIR=$(HOME)/test/tfc/dlls
TST_DIR=$(HOME)/tmp
else ## windows
INST_DIR=/hlserver/tfc/dlls
TEST_DIR=/hlserver/tfc/dlls
endif
DLLS_DIR=../dlls
SDKSRC=../hlsdk
METADIR=../metamod
COMPILE_TZ=EET
## Developer overrides
ifeq "$(USER)" "jussi"
COMPILE_TZ=EET
endif
#############################################################################
# OS DEPENDENCIES
#############################################################################
ifeq "$(OS)" "linux"
INSTALL=install -m 644
LD_WINDLL= i686-w64-mingw32-dllwrap
OSTARGET=linux
LIBFILE=$(LIBFILE_LINUX)
TARGET_FILE=$(TARGET_LINUX)
else ## windows
INSTALL=cp
LD_WINDLL= i686-w64-mingw32-dllwrap
OSTARGET=win32
LIBFILE=$(LIBFILE_WIN)
TARGET_FILE=$(TARGET_WIN)
endif
CC_WIN=i686-w64-mingw32-gcc
RES_WIN=i686-w64-mingw32-windres
ifeq "$(HOST)" "cygwin"
CC_WIN += -mno-cygwin
EXTRA_LINK += -L/lib/w32api
endif
OBJDIR_LINUX_OPT=opt.linux_$(TARGETTYPE)
OBJDIR_LINUX_DBG=debug.linux_$(TARGETTYPE)
OBJDIR_WIN_OPT=opt.win32
OBJDIR_WIN_DBG=debug.win32
#############################################################################
# COMPILE OPTIONS - ARCHITECTURE AND OPTIMIZATIONS
#############################################################################
ifeq "$(OS)" "linux"
GCCMAJ = $(shell $(CC) -dumpversion | sed -e 's/\.[0-9][0-9]*//')
GCCMIN = $(shell $(CC) -dumpversion | sed -e 's/[0-9]\.//;s/\.[0-9]//')
else
GCCMAJ = $(shell $(CC_WIN) -dumpversion | sed -e 's/\.[0-9][0-9]*//')
GCCMIN = $(shell $(CC_WIN) -dumpversion | sed -e 's/[0-9]\.//;s/\.[0-9]//')
endif
ifeq "$(HOST)" "cygwin"
ifeq "$(TARGETTYPE)" "amd64"
CC=gcc-linux-x86_64
else
CC=gcc-linux
endif
else
ifeq "$(TARGETTYPE)" "amd64"
CC=gcc -m64
else
CC=gcc -m32
endif
endif
MCPU=-mcpu
ifeq "$(GCCMAJ)" "3"
ifeq "$(GCCMIN)" "4"
MCPU=-mtune
endif
endif
ifeq "$(GCCMAJ)" "4"
MCPU=-mtune
endif
ifeq "$(OS)" "linux"
CC_DEP=$(CC)
else
CC_DEP=$(CC_WIN)
endif
# Note! About gcc optimization levels.
# There is four optimization levels:
# -O0 No optimizations.
# -O1 Optimize for smaller size.
# -O2 Optimize for speed without increasing size (alot).
# -O3 Optimize for speed, can result much greater filesize.
# Levels higher -O3 (-O6 for example) is threaded as -O3.
# See differences at "http://gcc.gnu.org/" (look for link to 'gcc manual').
# original safe optimization, from valve Makefile
#CCOPT = -O2 -ffast-math -funroll-loops \
# -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
# -malign-jumps=2 -malign-functions=2
# safe optimization, adapted from adminmod Makefile
#CCOPT = -m486 -O6 -ffast-math -funroll-loops \
# -fexpensive-optimizations -malign-loops=2 -malign-jumps=2 \
# -malign-functions=2 -Wall
# full optimization, adapted from adminmod Makefile
# "WONT WORK WITH omit-frame-pointer"?
# - disable (unneeded) C++ exceptions and rtti code to save some space ?
CCOPT = $(CCO) $(CCOPT_ARCH) -fno-exceptions -fno-rtti
# optimization level; overridden for certain problematic files
CCO = -O2 -fomit-frame-pointer -ffast-math
# architecture tuning by target type
ifeq "$(TARGETTYPE)" "amd64"
CCOPT_ARCH =
else
CCOPT_ARCH = -march=i686 $(MCPU)=generic
endif
# debugging; halt on warnings
CCDEBUG+= -ggdb3
#############################################################################
# COMPILE SETUP
#############################################################################
SRCDIR=.
INCLUDEDIRS+=-I$(SRCDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/pm_shared -I$(SDKSRC)/dlls -I$(SDKSRC)
FILES_ALL = *.cpp *.h [A-Z]* *.rc
CFLAGS=-Wall -Wno-unknown-pragmas -Wno-attributes
CFLAGS+=
#CFLAGS += -DTEST
ifeq "$(OPT)" "opt-fast"
ODEF = -DOPT_TYPE="\"optimized+meta_debug-disabled\""
CFLAGS := $(CCOPT) $(CFLAGS) $(ODEF) -D__BUILD_FAST_METAMOD__
OBJDIR_LINUX = $(OBJDIR_LINUX_OPT)
OBJDIR_WIN = $(OBJDIR_WIN_OPT)
else #other
ifeq "$(OPT)" "opt"
ODEF = -DOPT_TYPE="\"optimized\""
CFLAGS := $(CCOPT) $(CFLAGS) $(ODEF)
OBJDIR_LINUX = $(OBJDIR_LINUX_OPT)
OBJDIR_WIN = $(OBJDIR_WIN_OPT)
else # debug
ODEF = -DOPT_TYPE="\"debugging\""
CFLAGS := $(CCDEBUG) $(CFLAGS) $(ODEF)
OBJDIR_LINUX = $(OBJDIR_LINUX_DBG)
OBJDIR_WIN = $(OBJDIR_WIN_DBG)
DLLS_DIR := $(DLLS_DIR)/debug
endif
endif
ifeq "$(OS)" "linux"
OBJDIR = $(OBJDIR_LINUX)
else
OBJDIR = $(OBJDIR_WIN)
endif
include Config.mak
# any local CFLAGS from Config.mak
CFLAGS += $(EXTRA_CFLAGS)
# provide timezone info
$(OBJDIR_LINUX)/vdate.o $(OBJDIR_WIN)/vdate.o: CFLAGS += -DCOMPILE_TZ=\"$(COMPILE_TZ)\"
# ignore complaints from SDK files like cbase.h
#$(OBJDIR_LINUX)/sdk_util.o $(OBJDIR_WIN)/sdk_util.o: CFLAGS += -Wno-unused
# ignore complaints from STL headers
STLOBJ = $(STLFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
STLOBJ += $(STLFILES:%.cpp=$(OBJDIR_WIN)/%.o)
#$(OBJDIR_LINUX)/mreg.o $(OBJDIR_WIN)/mreg.o: CFLAGS += -Wno-effc++
$(STLOBJ): FILTER= 2>&1 | ../tools/stlfilter
$(STLOBJ): CFLAGS += -Wno-error
# these files seem to create "Internal compiler error" errors under mingw
# when using -O6
#$(OBJDIR_WIN)/engine_api.o: CCO = -O5
#$(OBJDIR_WIN)/dllapi_api.o: CCO = -O5
#############################################################################
# BUILDING LINUX SO
#############################################################################
# linux .so compile commands
DO_CC_LINUX=$(CC) $(CFLAGS) -fPIC $(INCLUDEDIRS) -o $@ -c $< $(FILTER)
LINK_LINUX=$(CC) $(CFLAGS) -shared -ldl -lm -static-libgcc $(EXTRA_LINK) $(OBJ_LINUX) -o $@
# sort by date
#SRCFILES := $(shell ls -t $(SRCFILES))
# linux object files
OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
# compiling linux object files
$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.cpp
$(DO_CC_LINUX)
# linux .so target file
LIBFILE_LINUX = $(MODNAME).so
TARGET_LINUX = $(OBJDIR_LINUX)/$(LIBFILE_LINUX)
#############################################################################
# BUILDING WINDOWS DLL
#############################################################################
# windows .dll compile commands
DO_CC_WIN=$(CC_WIN) $(CFLAGS) $(INCLUDEDIRS) -o $@ -c $<
DO_RES_WIN=$(RES_WIN) '$(ODEF)' --include-dir . --include-dir ../metamod -i $< -O coff -o $@
#LINK_WIN=$(LD_WINDLL) -k -mwindows --add-stdcall-alias --def metamod.def -o $@ $(OBJ_WIN)
#LINK_WIN=$(LD_WINDLL) -A -k -mwindows --export-all-symbols -o $@ $(OBJ_WIN)
#LINK_WIN=$(LD_WINDLL) -mwindows --add-stdcall-alias $(OBJ_WIN) $(RES_OBJ_WIN) -lstdc++ -s -o $@
LINK_WIN=$(CC_WIN) $(CFLAGS) -mdll -Xlinker --add-stdcall-alias $(EXTRA_LINK) $(OBJ_WIN) $(RES_OBJ_WIN) -s -o $@
# windows object files
OBJ_WIN := $(SRCFILES:%.cpp=$(OBJDIR_WIN)/%.o)
RES_OBJ_WIN := $(RESFILE:%.rc=$(OBJDIR_WIN)/%.o)
# compiling windows object files
$(OBJDIR_WIN)/%.o: $(SRCDIR)/%.cpp
$(DO_CC_WIN)
# compiling windows resource file
$(OBJDIR_WIN)/%.o: $(SRCDIR)/%.rc $(INFOFILES)
$(DO_RES_WIN)
# windows .dll target file
LIBFILE_WIN = $(MODNAME).dll
TARGET_WIN = $(OBJDIR_WIN)/$(LIBFILE_WIN)
#############################################################################
# OVERRIDES
#############################################################################
ifeq "$(PLATFORM)" "linux-only"
LIBFILE_WIN =
TARGET_WIN =
endif
ifeq "$(PLATFORM)" "win32-only"
LIBFILE_LINUX =
TARGET_LINUX =
OSTARGET=win32
LIBFILE=$(LIBFILE_WIN)
TARGET_FILE=$(TARGET_WIN)
endif
#############################################################################
# BUILD RULES
#############################################################################
default: $(TARGET_FILE)
all: do_dll_linux do_dll_win32
opt:
$(MAKE) default OPT=opt
linux: do_dll_linux
win32: do_dll_win32
linux_opt:
$(MAKE) linux OPT=opt
win32_opt:
$(MAKE) win32 OPT=opt
$(TARGET_LINUX): msgs/debug msgs/warning msgs/log msgs/error $(OBJDIR_LINUX) $(OBJ_LINUX)
$(LINK_LINUX)
# for plugins, recompile meta_api.cpp if info_name.h changed
$(OBJDIR_LINUX)/meta_api.o $(OBJDIR_WIN)/meta_api.o: info_name.h
$(TARGET_WIN): msgs/debug msgs/warning msgs/log msgs/error $(OBJDIR_WIN) $(OBJ_WIN) $(RES_OBJ_WIN)
$(LINK_WIN)
$(OBJDIR_LINUX) $(OBJDIR_WIN) msgs:
mkdir $@
# make sure to recompile vdate.c for each link
$(OBJDIR_LINUX)/vdate.o $(OBJDIR_WIN)/vdate.o : $(SRCFILES) *.h
domsgs: msgs/debug msgs/log msgs/error msgs/warning
msgs/debug: $(SRCFILES) *.h msgs
egrep "DEBUG\([0-9]" $(SRCFILES) *.h | sed "s/:[ ]*/ /" | sort -k2,2 > $@
msgs/log: $(SRCFILES) *.h msgs
egrep "META_LOG\(" $(SRCFILES) *.h | sed "s/:[ ]*/ /" | sort > $@
msgs/error: $(SRCFILES) *.h msgs
egrep "META_ERROR\(" $(SRCFILES) *.h | sed "s/:[ ]*/ /" | sort > $@
msgs/warning: $(SRCFILES) *.h msgs
egrep "META_WARNING\(" $(SRCFILES) *.h | sed "s/:[ ]*/ /" | sort > $@
tags: .tags .htags
ctags: .tags
htags: .htags
.tags: $(SRCFILES) *.h
-ctags -a $?
.htags: *.h
-htags $?
retags:
-rm -f .tags .htags
ctags -f .tags `find $(SDKSRC) -name '*.h'`
ctags -f .tags -a `find $(METADIR) -name old -prune -o -name '*.h' -print`
ctags -f .tags -a $(SRCFILES)
htags -R $(SDKSRC)
htags `find $(METADIR) -name old -prune -o -name '*.h' -print`
htags *.h
clean: clean_$(OSTARGET)
clean_linux:
test -n "$(OBJDIR_LINUX)"
-rm -f $(OBJDIR_LINUX)/*
clean_win32:
test -n "$(OBJDIR_WIN)"
-rm -f $(OBJDIR_WIN)/*
cleanall_linux:
$(MAKE) clean_linux
$(MAKE) clean_linux OPT=opt
$(MAKE) clean_linux TARGET=amd64
$(MAKE) clean_linux TARGET=amd64 OPT=opt
cleanall_win32:
$(MAKE) clean_win32
$(MAKE) clean_win32 OPT=opt
cleanall: cleanall_linux cleanall_win32
dll_linux dll_win32:
$(MAKE) do_$@
$(MAKE) do_$@ OPT=opt
do_dll_linux: $(DLLS_DIR) $(DLLS_DIR)/$(LIBFILE_LINUX)
do_dll_win32: $(DLLS_DIR) $(DLLS_DIR)/$(LIBFILE_WIN)
$(DLLS_DIR):
mkdir $(DLLS_DIR)
$(DLLS_DIR)/$(LIBFILE_LINUX): $(TARGET_LINUX)
$(INSTALL) $+ $@
$(DLLS_DIR)/$(LIBFILE_WIN): $(TARGET_WIN)
$(INSTALL) $+ $@
dlls: dll_linux dll_win32
rmdlls:
-rm -f ../dlls/*.* ../dlls/debug/*.*
spotless: cleanall
-rmdir $(OBJDIR_LINUX) $(OBJDIR_WIN)
# -rm -f .snap $(GENERATED)
distclean: spotless
install: $(INST_DIR)/$(LIBFILE)
test: $(TEST_DIR)/$(LIBFILE)
test_opt:
$(MAKE) test OPT=opt
$(INST_DIR)/$(LIBFILE) $(TEST_DIR)/$(LIBFILE): $(TARGET_FILE)
$(INSTALL) $< $@
tst: $(TST_DIR)/$(LIBFILE_WIN)
$(TST_DIR)/$(LIBFILE_WIN): $(TARGET_WIN)
cp $< $@
snap: .snap
.snap: $(FILES_ALL)
mkdir -p snapshots
tar zcvf snapshots/`date '+%m%d-%H%M'`.tgz $(FILES_ALL)
touch .snap
depend: $(OBJDIR)/Rules.depend
$(OBJDIR)/Rules.depend: Makefile $(SRCFILES) $(OBJDIR)
$(CC_DEP) -MM $(INCLUDEDIRS) $(SRCFILES) | sed "s;\(^[^ ]*\):\(.*\);$(OBJDIR)/\1: Makefile Config.mak \2;" > $@
include $(OBJDIR)/Rules.depend

View File

@ -1,275 +0,0 @@
// vi: set ts=4 sw=4 :
// vim: set tw=75 :
// api_info.cpp - info for api routines
/*
* Copyright (c) 2001-2006 Will Day <willday@hpgx.net>
*
* This file is part of Metamod.
*
* Metamod 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.
*
* Metamod 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 Metamod; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#include <extdll.h> // always
#include "api_info.h" // me
#include "api_hook.h"
// trace flag, loglevel, name
const dllapi_info_t dllapi_info = {
{ mFALSE, 3, api_caller_void_args_void, "GameDLLInit" }, // pfnGameInit
{ mFALSE, 10, api_caller_int_args_p, "DispatchSpawn" }, // pfnSpawn
{ mFALSE, 16, api_caller_void_args_p, "DispatchThink" }, // pfnThink
{ mFALSE, 9, api_caller_void_args_2p, "DispatchUse" }, // pfnUse
{ mFALSE, 11, api_caller_void_args_2p, "DispatchTouch" }, // pfnTouch
{ mFALSE, 9, api_caller_void_args_2p, "DispatchBlocked" }, // pfnBlocked
{ mFALSE, 10, api_caller_void_args_2p, "DispatchKeyValue" }, // pfnKeyValue
{ mFALSE, 9, api_caller_void_args_2p, "DispatchSave" }, // pfnSave
{ mFALSE, 9, api_caller_int_args_2pi, "DispatchRestore" }, // pfnRestore
{ mFALSE, 20, api_caller_void_args_p, "DispatchObjectCollsionBox" }, // pfnSetAbsBox
{ mFALSE, 9, api_caller_void_args_4pi, "SaveWriteFields" }, // pfnSaveWriteFields
{ mFALSE, 9, api_caller_void_args_4pi, "SaveReadFields" }, // pfnSaveReadFields
{ mFALSE, 9, api_caller_void_args_p, "SaveGlobalState" }, // pfnSaveGlobalState
{ mFALSE, 9, api_caller_void_args_p, "RestoreGlobalState" }, // pfnRestoreGlobalState
{ mFALSE, 9, api_caller_void_args_void, "ResetGlobalState" }, // pfnResetGlobalState
{ mFALSE, 3, api_caller_int_args_4p, "ClientConnect" }, // pfnClientConnect
{ mFALSE, 3, api_caller_void_args_p, "ClientDisconnect" }, // pfnClientDisconnect
{ mFALSE, 3, api_caller_void_args_p, "ClientKill" }, // pfnClientKill
{ mFALSE, 3, api_caller_void_args_p, "ClientPutInServer" }, // pfnClientPutInServer
{ mFALSE, 9, api_caller_void_args_p, "ClientCommand" }, // pfnClientCommand
{ mFALSE, 11, api_caller_void_args_2p, "ClientUserInfoChanged" }, // pfnClientUserInfoChanged
{ mFALSE, 3, api_caller_void_args_p2i, "ServerActivate" }, // pfnServerActivate
{ mFALSE, 3, api_caller_void_args_void, "ServerDeactivate" }, // pfnServerDeactivate
{ mFALSE, 14, api_caller_void_args_p, "PlayerPreThink" }, // pfnPlayerPreThink
{ mFALSE, 14, api_caller_void_args_p, "PlayerPostThink" }, // pfnPlayerPostThink
{ mFALSE, 18, api_caller_void_args_void, "StartFrame" }, // pfnStartFrame
{ mFALSE, 9, api_caller_void_args_void, "ParmsNewLevel" }, // pfnParmsNewLevel
{ mFALSE, 9, api_caller_void_args_void, "ParmsChangeLevel" }, // pfnParmsChangeLevel
{ mFALSE, 9, api_caller_ptr_args_void, "GetGameDescription" }, // pfnGetGameDescription
{ mFALSE, 9, api_caller_void_args_2p, "PlayerCustomization" }, // pfnPlayerCustomization
{ mFALSE, 9, api_caller_void_args_p, "SpectatorConnect" }, // pfnSpectatorConnect
{ mFALSE, 9, api_caller_void_args_p, "SpectatorDisconnect" }, // pfnSpectatorDisconnect
{ mFALSE, 9, api_caller_void_args_p, "SpectatorThink" }, // pfnSpectatorThink
{ mFALSE, 3, api_caller_void_args_p, "Sys_Error" }, // pfnSys_Error
{ mFALSE, 13, api_caller_void_args_pi, "PM_Move" }, // pfnPM_Move
{ mFALSE, 9, api_caller_void_args_p, "PM_Init" }, // pfnPM_Init
{ mFALSE, 9, api_caller_char_args_p, "PM_FindTextureType" }, // pfnPM_FindTextureType
{ mFALSE, 12, api_caller_void_args_4p, "SetupVisibility" }, // pfnSetupVisibility
{ mFALSE, 12, api_caller_void_args_pip, "UpdateClientData" }, // pfnUpdateClientData
{ mFALSE, 16, api_caller_int_args_pi2p2ip, "AddToFullPack" }, // pfnAddToFullPack
{ mFALSE, 9, api_caller_void_args_2i2pi2p, "CreateBaseline" }, // pfnCreateBaseline
{ mFALSE, 9, api_caller_void_args_void, "RegisterEncoders" }, // pfnRegisterEncoders
{ mFALSE, 9, api_caller_int_args_2p, "GetWeaponData" }, // pfnGetWeaponData
{ mFALSE, 15, api_caller_void_args_2pui, "CmdStart" }, // pfnCmdStart
{ mFALSE, 15, api_caller_void_args_p, "CmdEnd" }, // pfnCmdEnd
{ mFALSE, 9, api_caller_int_args_4p, "ConnectionlessPacket" }, // pfnConnectionlessPacket
{ mFALSE, 9, api_caller_int_args_i2p, "GetHullBounds" }, // pfnGetHullBounds
{ mFALSE, 9, api_caller_void_args_void, "CreateInstancedBaselines" }, // pfnCreateInstancedBaselines
{ mFALSE, 3, api_caller_int_args_3p, "InconsistentFile" }, // pfnInconsistentFile
{ mFALSE, 20, api_caller_int_args_void, "AllowLagCompensation" }, // pfnAllowLagCompensation
{ mFALSE, 0, NULL, NULL },
};
const newapi_info_t newapi_info = {
{ mFALSE, 16, api_caller_void_args_p, "OnFreeEntPrivateData" }, // pfnOnFreeEntPrivateData
{ mFALSE, 3, api_caller_void_args_void, "GameShutdown" }, // pfnGameShutdown
{ mFALSE, 14, api_caller_int_args_2p, "ShouldCollide" }, // pfnShouldCollide
// Added 2005/08/11 (no SDK update):
{ mFALSE, 3, api_caller_void_args_2p, "CvarValue" }, // pfnCvarValue
// Added 2005/11/21 (no SDK update):
{ mFALSE, 3, api_caller_void_args_pi2p, "CvarValue2" }, // pfnCvarValue2
{ mFALSE, 0, NULL, NULL },
};
const engine_info_t engine_info = {
{ mFALSE, 13, api_caller_int_args_p, "PrecacheModel" }, // pfnPrecacheModel
{ mFALSE, 13, api_caller_int_args_p, "PrecacheSound" }, // pfnPrecacheSound
{ mFALSE, 18, api_caller_void_args_2p, "SetModel" }, // pfnSetModel
{ mFALSE, 34, api_caller_int_args_p, "ModelIndex" }, // pfnModelIndex
{ mFALSE, 10, api_caller_int_args_i, "ModelFrames" }, // pfnModelFrames
{ mFALSE, 14, api_caller_void_args_3p, "SetSize" }, // pfnSetSize
{ mFALSE, 9, api_caller_void_args_2p, "ChangeLevel" }, // pfnChangeLevel
{ mFALSE, 9, api_caller_void_args_p, "GetSpawnParms" }, // pfnGetSpawnParms
{ mFALSE, 9, api_caller_void_args_p, "SaveSpawnParms" }, // pfnSaveSpawnParms
{ mFALSE, 9, api_caller_float_args_p, "VecToYaw" }, // pfnVecToYaw
{ mFALSE, 14, api_caller_void_args_2p, "VecToAngles" }, // pfnVecToAngles
{ mFALSE, 9, api_caller_void_args_2pfi, "MoveToOrigin" }, // pfnMoveToOrigin
{ mFALSE, 9, api_caller_void_args_p, "ChangeYaw" }, // pfnChangeYaw
{ mFALSE, 9, api_caller_void_args_p, "ChangePitch" }, // pfnChangePitch
{ mFALSE, 32, api_caller_ptr_args_3p, "FindEntityByString" }, // pfnFindEntityByString
{ mFALSE, 9, api_caller_int_args_p, "GetEntityIllum" }, // pfnGetEntityIllum
{ mFALSE, 9, api_caller_ptr_args_2pf, "FindEntityInSphere" }, // pfnFindEntityInSphere
{ mFALSE, 19, api_caller_ptr_args_p, "FindClientInPVS" }, // pfnFindClientInPVS
{ mFALSE, 9, api_caller_ptr_args_p, "EntitiesInPVS" }, // pfnEntitiesInPVS
{ mFALSE, 40, api_caller_void_args_p, "MakeVectors" }, // pfnMakeVectors
{ mFALSE, 9, api_caller_void_args_4p, "AngleVectors" }, // pfnAngleVectors
{ mFALSE, 13, api_caller_ptr_args_void, "CreateEntity" }, // pfnCreateEntity
{ mFALSE, 13, api_caller_void_args_p, "RemoveEntity" }, // pfnRemoveEntity
{ mFALSE, 13, api_caller_ptr_args_i, "CreateNamedEntity" }, // pfnCreateNamedEntity
{ mFALSE, 9, api_caller_void_args_p, "MakeStatic" }, // pfnMakeStatic
{ mFALSE, 9, api_caller_int_args_p, "EntIsOnFloor" }, // pfnEntIsOnFloor
{ mFALSE, 9, api_caller_int_args_p, "DropToFloor" }, // pfnDropToFloor
{ mFALSE, 9, api_caller_int_args_p2fi, "WalkMove" }, // pfnWalkMove
{ mFALSE, 14, api_caller_void_args_2p, "SetOrigin" }, // pfnSetOrigin
{ mFALSE, 12, api_caller_void_args_pip2f2i, "EmitSound" }, // pfnEmitSound
{ mFALSE, 12, api_caller_void_args_3p2f2i, "EmitAmbientSound" }, // pfnEmitAmbientSound
{ mFALSE, 20, api_caller_void_args_2pi2p, "TraceLine" }, // pfnTraceLine
{ mFALSE, 9, api_caller_void_args_3p, "TraceToss" }, // pfnTraceToss
{ mFALSE, 9, api_caller_int_args_3pi2p, "TraceMonsterHull" }, // pfnTraceMonsterHull
{ mFALSE, 9, api_caller_void_args_2p2i2p, "TraceHull" }, // pfnTraceHull
{ mFALSE, 9, api_caller_void_args_2pi2p, "TraceModel" }, // pfnTraceModel
{ mFALSE, 15, api_caller_ptr_args_3p, "TraceTexture" }, // pfnTraceTexture // CS: when moving
{ mFALSE, 9, api_caller_void_args_2pif2p, "TraceSphere" }, // pfnTraceSphere
{ mFALSE, 9, api_caller_void_args_pfp, "GetAimVector" }, // pfnGetAimVector
{ mFALSE, 9, api_caller_void_args_p, "ServerCommand" }, // pfnServerCommand
{ mFALSE, 9, api_caller_void_args_void, "ServerExecute" }, // pfnServerExecute
{ mFALSE, 11, api_caller_void_args_2pV, "engClientCommand" }, // pfnClientCommand // d'oh, ClientCommand in dllapi too
{ mFALSE, 9, api_caller_void_args_2p2f, "ParticleEffect" }, // pfnParticleEffect
{ mFALSE, 9, api_caller_void_args_ip, "LightStyle" }, // pfnLightStyle
{ mFALSE, 9, api_caller_int_args_p, "DecalIndex" }, // pfnDecalIndex
{ mFALSE, 15, api_caller_int_args_p, "PointContents" }, // pfnPointContents // CS: when moving
{ mFALSE, 22, api_caller_void_args_2i2p, "MessageBegin" }, // pfnMessageBegin
{ mFALSE, 22, api_caller_void_args_void, "MessageEnd" }, // pfnMessageEnd
{ mFALSE, 30, api_caller_void_args_i, "WriteByte" }, // pfnWriteByte
{ mFALSE, 23, api_caller_void_args_i, "WriteChar" }, // pfnWriteChar
{ mFALSE, 24, api_caller_void_args_i, "WriteShort" }, // pfnWriteShort
{ mFALSE, 23, api_caller_void_args_i, "WriteLong" }, // pfnWriteLong
{ mFALSE, 23, api_caller_void_args_f, "WriteAngle" }, // pfnWriteAngle
{ mFALSE, 23, api_caller_void_args_f, "WriteCoord" }, // pfnWriteCoord
{ mFALSE, 25, api_caller_void_args_p, "WriteString" }, // pfnWriteString
{ mFALSE, 23, api_caller_void_args_i, "WriteEntity" }, // pfnWriteEntity
{ mFALSE, 9, api_caller_void_args_p, "CVarRegister" }, // pfnCVarRegister
{ mFALSE, 21, api_caller_float_args_p, "CVarGetFloat" }, // pfnCVarGetFloat
{ mFALSE, 9, api_caller_ptr_args_p, "CVarGetString" }, // pfnCVarGetString
{ mFALSE, 10, api_caller_void_args_pf, "CVarSetFloat" }, // pfnCVarSetFloat
{ mFALSE, 9, api_caller_void_args_2p, "CVarSetString" }, // pfnCVarSetString
{ mFALSE, 15, api_caller_void_args_ipV, "AlertMessage" }, // pfnAlertMessage
{ mFALSE, 17, api_caller_void_args_2pV, "EngineFprintf" }, // pfnEngineFprintf
{ mFALSE, 14, api_caller_ptr_args_pi, "PvAllocEntPrivateData" }, // pfnPvAllocEntPrivateData
{ mFALSE, 9, api_caller_ptr_args_p, "PvEntPrivateData" }, // pfnPvEntPrivateData
{ mFALSE, 9, api_caller_void_args_p, "FreeEntPrivateData" }, // pfnFreeEntPrivateData
{ mFALSE, 9, api_caller_ptr_args_i, "SzFromIndex" }, // pfnSzFromIndex
{ mFALSE, 10, api_caller_int_args_p, "AllocString" }, // pfnAllocString
{ mFALSE, 9, api_caller_ptr_args_p, "GetVarsOfEnt" }, // pfnGetVarsOfEnt
{ mFALSE, 14, api_caller_ptr_args_i, "PEntityOfEntOffset" }, // pfnPEntityOfEntOffset
{ mFALSE, 19, api_caller_int_args_p, "EntOffsetOfPEntity" }, // pfnEntOffsetOfPEntity
{ mFALSE, 14, api_caller_int_args_p, "IndexOfEdict" }, // pfnIndexOfEdict
{ mFALSE, 17, api_caller_ptr_args_i, "PEntityOfEntIndex" }, // pfnPEntityOfEntIndex
{ mFALSE, 9, api_caller_ptr_args_p, "FindEntityByVars" }, // pfnFindEntityByVars
{ mFALSE, 14, api_caller_ptr_args_p, "GetModelPtr" }, // pfnGetModelPtr
{ mFALSE, 9, api_caller_int_args_pi, "RegUserMsg" }, // pfnRegUserMsg
{ mFALSE, 9, api_caller_void_args_pf, "AnimationAutomove" }, // pfnAnimationAutomove
{ mFALSE, 9, api_caller_void_args_pi2p, "GetBonePosition" }, // pfnGetBonePosition
{ mFALSE, 9, api_caller_uint_args_p, "FunctionFromName" }, // pfnFunctionFromName
{ mFALSE, 9, api_caller_ptr_args_ui, "NameForFunction" }, // pfnNameForFunction
{ mFALSE, 9, api_caller_void_args_pip, "ClientPrintf" }, // pfnClientPrintf
{ mFALSE, 9, api_caller_void_args_p, "ServerPrint" }, // pfnServerPrint
{ mFALSE, 13, api_caller_ptr_args_void, "Cmd_Args" }, // pfnCmd_Args
{ mFALSE, 13, api_caller_ptr_args_i, "Cmd_Argv" }, // pfnCmd_Argv
{ mFALSE, 13, api_caller_int_args_void, "Cmd_Argc" }, // pfnCmd_Argc
{ mFALSE, 9, api_caller_void_args_pi2p, "GetAttachment" }, // pfnGetAttachment
{ mFALSE, 9, api_caller_void_args_p, "CRC32_Init" }, // pfnCRC32_Init
{ mFALSE, 9, api_caller_void_args_2pi, "CRC32_ProcessBuffer" }, // pfnCRC32_ProcessBuffer
{ mFALSE, 9, api_caller_void_args_puc, "CRC32_ProcessByte" }, // pfnCRC32_ProcessByte
{ mFALSE, 9, api_caller_ulong_args_ul, "CRC32_Final" }, // pfnCRC32_Final
{ mFALSE, 16, api_caller_int_args_2i, "RandomLong" }, // pfnRandomLong
{ mFALSE, 14, api_caller_float_args_2f, "RandomFloat" }, // pfnRandomFloat // CS: when firing
{ mFALSE, 14, api_caller_void_args_2p, "SetView" }, // pfnSetView
{ mFALSE, 9, api_caller_float_args_void, "Time" }, // pfnTime
{ mFALSE, 9, api_caller_void_args_p2f, "CrosshairAngle" }, // pfnCrosshairAngle
{ mFALSE, 10, api_caller_ptr_args_2p, "LoadFileForMe" }, // pfnLoadFileForMe
{ mFALSE, 10, api_caller_void_args_p, "FreeFile" }, // pfnFreeFile
{ mFALSE, 9, api_caller_void_args_p, "EndSection" }, // pfnEndSection
{ mFALSE, 9, api_caller_int_args_3p, "CompareFileTime" }, // pfnCompareFileTime
{ mFALSE, 9, api_caller_void_args_p, "GetGameDir" }, // pfnGetGameDir
{ mFALSE, 9, api_caller_void_args_p, "Cvar_RegisterVariable" }, // pfnCvar_RegisterVariable
{ mFALSE, 9, api_caller_void_args_p4i, "FadeClientVolume" }, // pfnFadeClientVolume
{ mFALSE, 14, api_caller_void_args_pf, "SetClientMaxspeed" }, // pfnSetClientMaxspeed
{ mFALSE, 9, api_caller_ptr_args_p, "CreateFakeClient" }, // pfnCreateFakeClient
{ mFALSE, 9, api_caller_void_args_2p3fus2uc, "RunPlayerMove" }, // pfnRunPlayerMove
{ mFALSE, 9, api_caller_int_args_void, "NumberOfEntities" }, // pfnNumberOfEntities
{ mFALSE, 17, api_caller_ptr_args_p, "GetInfoKeyBuffer" }, // pfnGetInfoKeyBuffer
{ mFALSE, 13, api_caller_ptr_args_2p, "InfoKeyValue" }, // pfnInfoKeyValue
{ mFALSE, 9, api_caller_void_args_3p, "SetKeyValue" }, // pfnSetKeyValue
{ mFALSE, 12, api_caller_void_args_i3p, "SetClientKeyValue" }, // pfnSetClientKeyValue
{ mFALSE, 9, api_caller_int_args_p, "IsMapValid" }, // pfnIsMapValid
{ mFALSE, 9, api_caller_void_args_p3i, "StaticDecal" }, // pfnStaticDecal
{ mFALSE, 9, api_caller_int_args_p, "PrecacheGeneric" }, // pfnPrecacheGeneric
{ mFALSE, 10, api_caller_int_args_p, "GetPlayerUserId" }, // pfnGetPlayerUserId
{ mFALSE, 9, api_caller_void_args_pip2f4i2p, "BuildSoundMsg" }, // pfnBuildSoundMsg
{ mFALSE, 9, api_caller_int_args_void, "IsDedicatedServer" }, // pfnIsDedicatedServer
{ mFALSE, 9, api_caller_ptr_args_p, "CVarGetPointer" }, // pfnCVarGetPointer
{ mFALSE, 9, api_caller_uint_args_p, "GetPlayerWONId" }, // pfnGetPlayerWONId
{ mFALSE, 9, api_caller_void_args_2p, "Info_RemoveKey" }, // pfnInfo_RemoveKey
{ mFALSE, 15, api_caller_ptr_args_2p, "GetPhysicsKeyValue" }, // pfnGetPhysicsKeyValue
{ mFALSE, 14, api_caller_void_args_3p, "SetPhysicsKeyValue" }, // pfnSetPhysicsKeyValue
{ mFALSE, 15, api_caller_ptr_args_p, "GetPhysicsInfoString" }, // pfnGetPhysicsInfoString
{ mFALSE, 13, api_caller_ushort_args_ip, "PrecacheEvent" }, // pfnPrecacheEvent
{ mFALSE, 9, api_caller_void_args_ipusf2p2f4i,"PlaybackEvent" }, // pfnPlaybackEvent
{ mFALSE, 31, api_caller_ptr_args_p, "SetFatPVS" }, // pfnSetFatPVS
{ mFALSE, 31, api_caller_ptr_args_p, "SetFatPAS" }, // pfnSetFatPAS
{ mFALSE, 50, api_caller_int_args_2p, "CheckVisibility" }, // pfnCheckVisibility
{ mFALSE, 37, api_caller_void_args_2p, "DeltaSetField" }, // pfnDeltaSetField
{ mFALSE, 38, api_caller_void_args_2p, "DeltaUnsetField" }, // pfnDeltaUnsetField
{ mFALSE, 9, api_caller_void_args_2p, "DeltaAddEncoder" }, // pfnDeltaAddEncoder
{ mFALSE, 45, api_caller_int_args_void, "GetCurrentPlayer" }, // pfnGetCurrentPlayer
{ mFALSE, 14, api_caller_int_args_p, "CanSkipPlayer" }, // pfnCanSkipPlayer
{ mFALSE, 9, api_caller_int_args_2p, "DeltaFindField" }, // pfnDeltaFindField
{ mFALSE, 37, api_caller_void_args_pi, "DeltaSetFieldByIndex" }, // pfnDeltaSetFieldByIndex
{ mFALSE, 38, api_caller_void_args_pi, "DeltaUnsetFieldByIndex" }, // pfnDeltaUnsetFieldByIndex
{ mFALSE, 9, api_caller_void_args_2i, "SetGroupMask" }, // pfnSetGroupMask
{ mFALSE, 9, api_caller_int_args_ip, "engCreateInstancedBaseline" }, // pfnCreateInstancedBaseline // d'oh, CreateInstancedBaseline in dllapi too
{ mFALSE, 9, api_caller_void_args_2p, "Cvar_DirectSet" }, // pfnCvar_DirectSet
{ mFALSE, 9, api_caller_void_args_i3p, "ForceUnmodified" }, // pfnForceUnmodified
{ mFALSE, 9, api_caller_void_args_3p, "GetPlayerStats" }, // pfnGetPlayerStats
{ mFALSE, 3, api_caller_void_args_2p, "AddServerCommand" }, // pfnAddServerCommand
// Added in SDK 2.2:
{ mFALSE, 9, api_caller_int_args_2i, "Voice_GetClientListening" }, // Voice_GetClientListening
{ mFALSE, 9, api_caller_int_args_3i, "Voice_SetClientListening" }, // Voice_SetClientListening
// Added for HL 1109 (no SDK update):
{ mFALSE, 9, api_caller_ptr_args_p, "GetPlayerAuthId" }, // pfnGetPlayerAuthId
// Added 2003/11/10 (no SDK update):
{ mFALSE, 30, api_caller_ptr_args_2p, "SequenceGet" }, // pfnSequenceGet
{ mFALSE, 30, api_caller_ptr_args_pip, "SequencePickSentence" }, // pfnSequencePickSentence
{ mFALSE, 30, api_caller_int_args_p, "GetFileSize" }, // pfnGetFileSize
{ mFALSE, 30, api_caller_uint_args_p, "GetApproxWavePlayLen" }, // pfnGetApproxWavePlayLen
{ mFALSE, 30, api_caller_int_args_void, "IsCareerMatch" }, // pfnIsCareerMatch
{ mFALSE, 30, api_caller_int_args_p, "GetLocalizedStringLength" }, // pfnGetLocalizedStringLength
{ mFALSE, 30, api_caller_void_args_i, "RegisterTutorMessageShown" }, // pfnRegisterTutorMessageShown
{ mFALSE, 30, api_caller_int_args_i, "GetTimesTutorMessageShown" }, // pfnGetTimesTutorMessageShown
{ mFALSE, 30, api_caller_void_args_pi, "ProcessTutorMessageDecayBuffer" }, // pfnProcessTutorMessageDecayBuffer
{ mFALSE, 30, api_caller_void_args_pi, "ConstructTutorMessageDecayBuffer" }, // pfnConstructTutorMessageDecayBuffer
{ mFALSE, 9, api_caller_void_args_void, "ResetTutorMessageDecayData" }, // pfnResetTutorMessageDecayData
// Added 2005/08/11 (no SDK update):
{ mFALSE, 3, api_caller_void_args_2p, "QueryClientCvarValue" }, // pfnQueryClientCvarValue
// Added 2005/11/21 (no SDK update):
{ mFALSE, 3, api_caller_void_args_2pi, "QueryClientCvarValue2" }, // pfnQueryClientCvarValue2
// Added 2009-06-17 (no SDK update):
{ mFALSE, 8, api_caller_int_args_2p, "EngCheckParm" }, // pfnEngCheckParm
// end
{ mFALSE, 0, NULL, NULL },
};

View File

@ -1,5 +0,0 @@
#!/bin/sh
make HOST=cygwin TARGET=win32 OPT=opt
make HOST=cygwin OPT=opt
make HOST=cygwin TARGET=amd64 OPT=opt

View File

@ -1,130 +0,0 @@
// vi: set ts=4 sw=4 :
// vim: set tw=75 :
// autodetect.cpp - GameDLL search and autodetection.
/*
* Copyright (c) 2004-2006 Jussi Kivilinna
*
* This file is part of "Metamod All-Mod-Support"-patch for Metamod.
*
* Metamod 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.
*
* Metamod 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 Metamod; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#include <extdll.h> // always
#include "osdep_p.h" // is_gamedll, ...
#include "game_autodetect.h" // me
#include "support_meta.h" // full_gamedir_path,
// Search gamedir/dlls/*.dll for gamedlls
//TODO: add META_DEBUG
const char * DLLINTERNAL autodetect_gamedll(const gamedll_t *gamedll, const char *knownfn)
{
static char buf[256];
char dllpath[256];
char fnpath[256];
DIR *dir;
struct dirent *ent;
unsigned int fn_len;
// Generate dllpath
safevoid_snprintf(buf, sizeof(buf), "%s/dlls", gamedll->gamedir);
if(!full_gamedir_path(buf, dllpath)) {
//whine & return
META_WARNING("GameDLL-Autodetection: Directory '%s' doesn't exist.", buf);
return(0);
}
// Generate knownfn path
safevoid_snprintf(fnpath, sizeof(fnpath), "%s/%s", dllpath, knownfn);
// Check if knownfn exists and is valid gamedll
if(is_gamedll(fnpath)) {
// knownfn exists and is loadable gamedll, return 0.
return(0);
}
// Open directory
if(!(dir = opendir(dllpath))) {
//whine & return
META_WARNING("GameDLL-Autodetection: Couldn't open directory '%s'.", dllpath);
return(0);
}
while((ent = readdir(dir)) != 0) {
fn_len = strlen(ent->d_name);
if(fn_len <= strlen(PLATFORM_DLEXT)) {
// Filename is too short
continue;
}
// Compare end of filename with PLATFORM_DLEXT
if(!strcasematch(&ent->d_name[fn_len - strlen(PLATFORM_DLEXT)], PLATFORM_DLEXT)) {
// File isn't dll
continue;
}
// Exclude all metamods
if(strncasematch(ent->d_name, "metamod", strlen("metamod"))) {
continue;
}
// Exclude all bots
STRNCPY(buf, ent->d_name, sizeof(buf));
strlwr(buf);
if(strstr(buf, "bot.")) {
continue;
}
#ifdef linux
//bot_iX86.so, bot_amd64.so, bot_x86_64.so
if(strstr(buf, "bot_i") || strstr(buf, "bot_amd64.so") || strstr(buf, "bot_x86")) {
continue;
}
#endif
// Generate full path
safevoid_snprintf(fnpath, sizeof(fnpath), "%s/%s", dllpath, ent->d_name);
// Check if dll is gamedll
if(is_gamedll(fnpath)) {
META_DEBUG(8, ("is_gamedll(%s): ok.", fnpath));
//gamedll detected
STRNCPY(buf, ent->d_name, sizeof(buf));
closedir(dir);
return(buf);
}
META_DEBUG(8, ("is_gamedll(%s): failed.", fnpath));
}
//not found
META_WARNING("GameDLL-Autodetection: Couldn't find gamedll in '%s'.", dllpath);
closedir(dir);
return(0);
}

View File

@ -1,43 +0,0 @@
// vi: set ts=4 sw=4 :
// vim: set tw=75 :
// autodetect.h - GameDLL search and autodetection.
/*
* Copyright (c) 2004-2006 Jussi Kivilinna
*
* This file is part of "Metamod All-Mod-Support"-patch for Metamod.
*
* Metamod 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.
*
* Metamod 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 Metamod; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#ifndef GAME_AUTODETECT_H
#define GAME_AUTODETECT_H
#include "metamod.h"
const char * DLLINTERNAL autodetect_gamedll(const gamedll_t *gamedll, const char *knownfn);
#endif /*GAME_AUTODETECT_H*/

View File

@ -1,56 +0,0 @@
// vi: set ts=4 sw=4 :
// vim: set tw=75 :
// game_support.h - structures for supporting different HL mod "games"
/*
* Copyright (c) 2001-2006 Will Day <willday@hpgx.net>
*
* This file is part of Metamod.
*
* Metamod 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.
*
* Metamod 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 Metamod; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#ifndef GAME_SUPPORT_H
#define GAME_SUPPORT_H
#include "types_meta.h" // mBOOL
#include "metamod.h" // gamedll_t
// Information we have about each game/mod DLL.
typedef struct game_modinfo_s {
const char *name; // name (the game dir)
const char *linux_so; // filename of linux shared lib
const char *win_dll; // filename of win32 dll
const char *desc; // our long-name description
} game_modinfo_t;
typedef game_modinfo_t game_modlist_t[];
const DLLINTERNAL game_modinfo_t *lookup_game(const char *name);
mBOOL DLLINTERNAL setup_gamedll(gamedll_t *gamedll);
#endif /* GAME_SUPPORT_H */

View File

@ -1,49 +0,0 @@
// vi: set ts=4 sw=4 :
// vim: set tw=75 :
// h_export.h - prototypes for h_export.cpp
/*
* Copyright (c) 2001-2006 Will Day <willday@hpgx.net>
*
* This file is part of Metamod.
*
* Metamod 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.
*
* Metamod 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 Metamod; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#ifndef H_EXPORT_H
#define H_EXPORT_H
#include "osdep.h" // DLLEXPORT, WINAPI, etc
// Our GiveFnptrsToDll, called by engine.
typedef void (WINAPI *GIVE_ENGINE_FUNCTIONS_FN) (enginefuncs_t
*pengfuncsFromEngine, globalvars_t *pGlobals);
C_DLLEXPORT void WINAPI GiveFnptrsToDll(enginefuncs_t *pengfuncsFromEngine,
globalvars_t *pGlobals);
#endif /* H_EXPORT_H */

View File

@ -1,205 +0,0 @@
/* Special ld script needed, because HL engine does some PE section checking on loaded gamedlls. */
/* These checks fail and segfault HL process if default ld script is used! */
OUTPUT_FORMAT(pei-i386)
SEARCH_DIR("/mingw/mingw32/lib"); SEARCH_DIR("/mingw/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
ENTRY(_mainCRTStartup)
SECTIONS
{
.text __image_base__ + __section_alignment__ :
{
*(.init)
*(.text)
*(SORT(.text$*))
*(.glue_7t)
*(.glue_7)
___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
LONG (-1);
*(EXCLUDE_FILE (*crtend.o) .ctors);
*(.ctor);
*(SORT(.ctors.*));
*crtend.o (.ctors);
LONG (0);
___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
LONG (-1);
*(EXCLUDE_FILE (*crtend.o) .dtors);
*(.dtor);
*(SORT(.dtors.*));
*crtend.o (.dtors);
LONG (0);
*(.fini)
/* ??? Why is .gcc_exc here? */
*(.gcc_exc)
PROVIDE (etext = .);
*(.gcc_except_table)
/*}
.rdata BLOCK(__section_alignment__) :
{*/
*(.rdata)
*(SORT(.rdata$*))
}
/* The Cygwin32 library uses a section to avoid copying certain data
on fork. This used to be named ".data". The linker used
to include this between __data_start__ and __data_end__, but that
breaks building the cygwin32 dll. Instead, we name the section
".data_cygwin_nocopy" and explictly include it after __data_end__. */
.data BLOCK(__section_alignment__) :
{
__data_start__ = . ;
*(.data)
*(.data2)
*(SORT(.data$*))
__data_end__ = . ;
*(.data_cygwin_nocopy)
*(.eh_frame)
___RUNTIME_PSEUDO_RELOC_LIST__ = .;
__RUNTIME_PSEUDO_RELOC_LIST__ = .;
*(.rdata_runtime_pseudo_reloc)
___RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
__RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
/*}
.bss BLOCK(__section_alignment__) :
{*/
__bss_start__ = . ;
*(.bss)
*(COMMON)
__bss_end__ = . ;
}
.edata BLOCK(__section_alignment__) :
{
*(.edata)
}
.idata BLOCK(__section_alignment__) :
{
/* This cannot currently be handled with grouped sections.
See pe.em:sort_sections. */
SORT(*)(.idata$2)
SORT(*)(.idata$3)
/* These zeroes mark the end of the import list. */
LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
SORT(*)(.idata$4)
SORT(*)(.idata$5)
SORT(*)(.idata$6)
SORT(*)(.idata$7)
}
/DISCARD/ :
{
*(.debug$S)
*(.debug$T)
*(.debug$F)
*(.drectve)
}
.CRT BLOCK(__section_alignment__) :
{
___crt_xc_start__ = . ;
*(SORT(.CRT$XC*)) /* C initialization */
___crt_xc_end__ = . ;
___crt_xi_start__ = . ;
*(SORT(.CRT$XI*)) /* C++ initialization */
___crt_xi_end__ = . ;
___crt_xl_start__ = . ;
*(SORT(.CRT$XL*)) /* TLS callbacks */
/* ___crt_xl_end__ is defined in the TLS Directory support code */
___crt_xp_start__ = . ;
*(SORT(.CRT$XP*)) /* Pre-termination */
___crt_xp_end__ = . ;
___crt_xt_start__ = . ;
*(SORT(.CRT$XT*)) /* Termination */
___crt_xt_end__ = . ;
}
.tls BLOCK(__section_alignment__) :
{
___tls_start__ = . ;
*(.tls)
*(.tls$)
*(SORT(.tls$*))
___tls_end__ = . ;
}
.endjunk BLOCK(__section_alignment__) :
{
/* end is deprecated, don't use it */
PROVIDE (end = .);
PROVIDE ( _end = .);
__end__ = .;
}
.rsrc BLOCK(__section_alignment__) :
{
*(.rsrc)
*(SORT(.rsrc$*))
}
.reloc BLOCK(__section_alignment__) :
{
*(.reloc)
}
.stab BLOCK(__section_alignment__) (NOLOAD) :
{
*(.stab)
}
.stabstr BLOCK(__section_alignment__) (NOLOAD) :
{
*(.stabstr)
}
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section. Unlike other targets that fake this by putting the
section VMA at 0, the PE format will not allow it. */
/* DWARF 1.1 and DWARF 2. */
.debug_aranges BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_aranges)
}
.debug_pubnames BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_pubnames)
}
/* DWARF 2. */
.debug_info BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_info) *(.gnu.linkonce.wi.*)
}
.debug_abbrev BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_abbrev)
}
.debug_line BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_line)
}
.debug_frame BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_frame)
}
.debug_str BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_str)
}
.debug_loc BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_loc)
}
.debug_macinfo BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_macinfo)
}
/* SGI/MIPS DWARF 2 extensions. */
.debug_weaknames BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_weaknames)
}
.debug_funcnames BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_funcnames)
}
.debug_typenames BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_typenames)
}
.debug_varnames BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_varnames)
}
/* DWARF 3. */
.debug_ranges BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_ranges)
}
}

View File

@ -1,56 +0,0 @@
// vi: set ts=4 sw=4 :
// vim: set tw=75 :
// info_name.h - name, desc, author, etc
/*
* Copyright (c) 2001-2013 Will Day <willday@hpgx.net>
*
* This file is part of Metamod.
*
* Metamod 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.
*
* Metamod 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 Metamod; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#ifndef INFO_NAME_H
#define INFO_NAME_H
#include "vers_meta.h" // VDATE, VVERSION, etc
#define VNAME "Metamod"
#define VAUTHOR "Will Day"
#define VURL "http://www.metamod.org/"
#define COPYRIGHT_YEAR "2013"
// Various strings for the Windows DLL Resources in res_meta.rc
#define RC_COMMENTS "Metamod-P is enhanced version of Metamod. Metamod allows running multiple mod-like plugin DLLs, to add functionality or change the behavior of the running HLDS game mod. See " VURL
#define RC_DESC "Metamod-P Half-Life MOD DLL"
#define RC_FILENAME "METAMOD.DLL"
#define RC_INTERNAL "METAMOD-P"
#define RC_COPYRIGHT "Copyright© 2001-" COPYRIGHT_YEAR " Will Day; 2004-" VPATCH_COPYRIGHT_YEAR " Jussi Kivilinna; GPL licensed"
#define RC_LICENSE "Licensed under the GNU General Public License"
#endif /* INFO_NAME_H */

View File

@ -1,37 +0,0 @@
// vi: set ts=4 sw=4 :
// vim: set tw=75 :
// linkgame.cpp - export entities from mod "games" back to the HL engine
/*
* Copyright (c) 2001-2006 Will Day <willday@hpgx.net>
*
* This file is part of Metamod.
*
* Metamod 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.
*
* Metamod 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 Metamod; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
//linkents not needed on this version of metamod

View File

@ -1,42 +0,0 @@
// vi: set ts=4 sw=4 :
// vim: set tw=75 :
// linkplug.cpp - export entities from plugins back to the HL engine
/*
* Copyright (c) 2001-2006 Will Day <willday@hpgx.net>
*
* This file is part of Metamod.
*
* Metamod 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.
*
* Metamod 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 Metamod; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#include <extdll.h> // always
#include "linkent.h" // LINK_ENTITY_TO_PLUGIN
// Entity lists for plugins
LINK_ENTITY_TO_PLUGIN(adminmod_timer, "adminmod");

View File

@ -1,489 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="metamod"
ProjectGUID="{02832A39-E902-46B7-8D47-911C37CF41B0}"
RootNamespace="metamod"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../hlsdk/common ../../hlsdk/dlls ../../hlsdk/engine ../../hlsdk/pm_shared"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;METAMOD_EXPORTS;_CRT_SECURE_NO_DEPRECATE;__METAMOD_BUILD__"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
ModuleDefinitionFile="metamod.def"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="0"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\hlsdk\common;..\hlsdk\dlls;..\hlsdk\engine;..\hlsdk\pm_shared;."
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;METAMOD_EXPORTS;_CRT_SECURE_NO_DEPRECATE;__METAMOD_BUILD__"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="0"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="false"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\api_hook.cpp"
>
</File>
<File
RelativePath=".\api_info.cpp"
>
</File>
<File
RelativePath=".\commands_meta.cpp"
>
</File>
<File
RelativePath=".\conf_meta.cpp"
>
</File>
<File
RelativePath=".\dllapi.cpp"
>
</File>
<File
RelativePath=".\engine_api.cpp"
>
</File>
<File
RelativePath=".\engineinfo.cpp"
>
</File>
<File
RelativePath=".\game_autodetect.cpp"
>
</File>
<File
RelativePath=".\game_support.cpp"
>
</File>
<File
RelativePath=".\h_export.cpp"
>
</File>
<File
RelativePath=".\linkgame.cpp"
>
</File>
<File
RelativePath=".\linkplug.cpp"
>
</File>
<File
RelativePath=".\log_meta.cpp"
>
</File>
<File
RelativePath=".\meta_eiface.cpp"
>
</File>
<File
RelativePath=".\metamod.cpp"
>
</File>
<File
RelativePath=".\mhook.cpp"
>
</File>
<File
RelativePath=".\mlist.cpp"
>
</File>
<File
RelativePath=".\mplayer.cpp"
>
</File>
<File
RelativePath=".\mplugin.cpp"
>
</File>
<File
RelativePath=".\mqueue.cpp"
>
</File>
<File
RelativePath=".\mreg.cpp"
>
</File>
<File
RelativePath=".\mutil.cpp"
>
</File>
<File
RelativePath=".\osdep.cpp"
>
</File>
<File
RelativePath=".\osdep_detect_gamedll_win32.cpp"
>
</File>
<File
RelativePath=".\osdep_linkent_win32.cpp"
>
</File>
<File
RelativePath=".\osdep_p.cpp"
>
</File>
<File
RelativePath=".\reg_support.cpp"
>
</File>
<File
RelativePath=".\sdk_util.cpp"
>
</File>
<File
RelativePath=".\studioapi.cpp"
>
</File>
<File
RelativePath=".\support_meta.cpp"
>
</File>
<File
RelativePath=".\thread_logparse.cpp"
>
</File>
<File
RelativePath=".\vdate.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\api_hook.h"
>
</File>
<File
RelativePath=".\api_info.h"
>
</File>
<File
RelativePath=".\commands_meta.h"
>
</File>
<File
RelativePath=".\comp_dep.h"
>
</File>
<File
RelativePath=".\conf_meta.h"
>
</File>
<File
RelativePath=".\dllapi.h"
>
</File>
<File
RelativePath=".\engine_api.h"
>
</File>
<File
RelativePath=".\engineinfo.h"
>
</File>
<File
RelativePath=".\game_autodetect.h"
>
</File>
<File
RelativePath=".\game_support.h"
>
</File>
<File
RelativePath=".\games.h"
>
</File>
<File
RelativePath=".\h_export.h"
>
</File>
<File
RelativePath=".\info_name.h"
>
</File>
<File
RelativePath=".\linkent.h"
>
</File>
<File
RelativePath=".\log_meta.h"
>
</File>
<File
RelativePath=".\meta_api.h"
>
</File>
<File
RelativePath=".\meta_eiface.h"
>
</File>
<File
RelativePath=".\metamod.h"
>
</File>
<File
RelativePath=".\mhook.h"
>
</File>
<File
RelativePath=".\mlist.h"
>
</File>
<File
RelativePath=".\mm_pextensions.h"
>
</File>
<File
RelativePath=".\mplayer.h"
>
</File>
<File
RelativePath=".\mplugin.h"
>
</File>
<File
RelativePath=".\mqueue.h"
>
</File>
<File
RelativePath=".\mreg.h"
>
</File>
<File
RelativePath=".\mutil.h"
>
</File>
<File
RelativePath=".\new_baseclass.h"
>
</File>
<File
RelativePath=".\osdep.h"
>
</File>
<File
RelativePath=".\osdep_p.h"
>
</File>
<File
RelativePath=".\plinfo.h"
>
</File>
<File
RelativePath=".\reg_support.h"
>
</File>
<File
RelativePath=".\ret_type.h"
>
</File>
<File
RelativePath=".\sdk_util.h"
>
</File>
<File
RelativePath=".\studioapi.h"
>
</File>
<File
RelativePath=".\support_meta.h"
>
</File>
<File
RelativePath=".\thread_logparse.h"
>
</File>
<File
RelativePath=".\tqueue.h"
>
</File>
<File
RelativePath=".\types_meta.h"
>
</File>
<File
RelativePath=".\vdate.h"
>
</File>
<File
RelativePath=".\vers_meta.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath=".\res_meta.rc"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

View File

View File

View File

@ -1,69 +0,0 @@
/*
* Copyright (c) 2004-2006 Jussi Kivilinna
*
* This file is part of "Metamod All-Mod-Support"-patch for Metamod.
*
* Metamod 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.
*
* Metamod 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 Metamod; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#ifndef METAMOD_NEW_BASECLASS_H
#define METAMOD_NEW_BASECLASS_H
#include <malloc.h>
#include "comp_dep.h"
//new/delete operators with malloc/free to remove need for libstdc++
class class_metamod_new {
public:
// Construction
class_metamod_new(void) { };
// Operators
inline void * operator new(size_t size) {
if(size==0)
return(calloc(1, 1));
return(calloc(1, size));
}
inline void * operator new[](size_t size) {
if(size==0)
return(calloc(1, 1));
return(calloc(1, size));
}
inline void operator delete(void *ptr) {
if(ptr)
free(ptr);
}
inline void operator delete[](void *ptr) {
if(ptr)
free(ptr);
}
};
#endif /*METAMOD_NEW_BASECLASS_H*/

View File

@ -1,76 +0,0 @@
/*
* Copyright (c) 2004-2006 Jussi Kivilinna
*
* This file is part of "Metamod All-Mod-Support"-patch for Metamod.
*
* Metamod 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.
*
* Metamod 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 Metamod; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#ifndef OSDEP_P_H
#define OSDEP_P_H
#include "types_meta.h" // mBOOL
#include "osdep.h" // PATH_MAX
// Checks if file is hlsdk api game dll
// (osdep_detect_gamedll_linux.cpp and osdep_detect_gamedll_win32.cpp)
// --Jussi Kivilinna
mBOOL DLLINTERNAL is_gamedll(const char *filename);
// MSVC doesn't provide opendir/readdir/closedir, so we write our own.
// --Jussi Kivilinna
#ifdef _WIN32
struct my_dirent {
char d_name[PATH_MAX];
};
typedef struct {
HANDLE handle;
WIN32_FIND_DATAA find_data;
struct my_dirent ent;
int not_found;
} my_DIR;
#define dirent my_dirent
#define DIR my_DIR
DIR * DLLINTERNAL my_opendir(const char *);
struct dirent * DLLINTERNAL my_readdir(DIR *);
void DLLINTERNAL my_closedir(DIR *);
#define opendir(x) my_opendir(x)
#define readdir(x) my_readdir(x)
#define closedir(x) my_closedir(x)
#else
#include <dirent.h>
#endif /* _WIN32 */
DLHANDLE DLLINTERNAL get_module_handle_of_memptr(void * memptr);
#ifdef linux
void * DLLINTERNAL get_dlsym_pointer(void);
#endif
#endif /* OSDEP_P_H */

View File

@ -1,49 +0,0 @@
// vi: set ts=4 sw=4 :
// vim: set tw=75 :
// reg_support.h - functions for "registered" cmd/cvar/msg support
/*
* Copyright (c) 2001-2006 Will Day <willday@hpgx.net>
*
* This file is part of Metamod.
*
* Metamod 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.
*
* Metamod 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 Metamod; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#ifndef REG_SUPPORT_H
#define REG_SUPPORT_H
#include "mreg.h" // REG_CMD_FN, etc
// these are only 'hidden' because called from outside (plugins and engine)
void DLLHIDDEN meta_command_handler(void);
void DLLHIDDEN meta_AddServerCommand(char *cmd_name, REG_CMD_FN function);
void DLLHIDDEN meta_CVarRegister(cvar_t *pCvar);
int DLLHIDDEN meta_RegUserMsg(const char *pszName, int iSize);
void DLLHIDDEN meta_QueryClientCvarValue(const edict_t *player, const char *cvarName);
#endif /* REG_SUPPORT_H */

View File

@ -1,69 +0,0 @@
/*
* Copyright (c) 2004-2006 Jussi Kivilinna
*
* This file is part of "Metamod All-Mod-Support"-patch for Metamod.
*
* Metamod 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.
*
* Metamod 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 Metamod; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#ifndef RET_TYPE_H
#define RET_TYPE_H
#include "new_baseclass.h"
class class_ret_t : public class_metamod_new {
public:
// Construction
inline class_ret_t(void) { };
inline class_ret_t(float f) { data.f = f; };
inline class_ret_t(void * p) { data.p = p; };
inline class_ret_t(const char * pc) { data.pc = pc; };
inline class_ret_t(int i) { data.i = i; };
inline class_ret_t(short s) { data.i = s; };
inline class_ret_t(char c) { data.i = c; };
inline class_ret_t(unsigned int ui) { data.ui = ui; };
inline class_ret_t(unsigned long ui) { data.ui = ui; };
inline class_ret_t(unsigned short us) { data.ui = us; };
inline class_ret_t(unsigned char uc) { data.ui = uc; };
// Reading/Writing
inline void * getptr(void) { return(&data); };
#define SET_RET_CLASS(ret,type,x) \
*(type*)((ret).getptr()) = (type)(x)
#define GET_RET_CLASS(ret,type) \
(*(type*)((ret).getptr()))
private:
//Data (select data size of largest type) (x86: 32bit, x86_64: 64bit)
union {
void * p;
const char * pc;
float f;
long i;
unsigned long ui;
} data;
};
#endif /*RET_TYPE_H*/

View File

@ -1,125 +0,0 @@
// vi: set ts=4 sw=4 :
// vim: set tw=75 :
// sdk_util.cpp - utility routines from HL SDK util.cpp
// Selected portions of dlls/util.cpp from SDK 2.1.
// Functions copied from there as needed...
// And modified to avoid buffer overflows (argh).
// Also modified to remove dependency on CBaseEntity class.
/***
*
* Copyright (c) 1999, 2000 Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* object code is restricted to non-commercial enhancements to products from
* Valve LLC. All other use, distribution, or modification is prohibited
* without written permission from Valve LLC.
*
****/
/*
===== util.cpp ========================================================
Utility code. Really not optional after all.
*/
#include <extdll.h>
#include "sdk_util.h"
#include <string.h> // for strncpy(), etc
#include "osdep.h" // win32 vsnprintf, etc
const char * DLLINTERNAL META_UTIL_VarArgs(const char *format, ...)
{
va_list argptr;
static char string[4096];
va_start(argptr, format);
safevoid_vsnprintf(string, sizeof(string), format, argptr);
va_end(argptr);
return(string);
}
short DLLINTERNAL FixedSigned16(float value, float scale)
{
int output;
output = (int)(value * scale);
if(output > 32767)
output = 32767;
if(output < -32768)
output = -32768;
return((short)output);
}
unsigned short DLLINTERNAL FixedUnsigned16(float value, float scale)
{
int output;
output = (int)(value * scale);
if(output < 0)
output = 0;
if(output > 0xFFFF)
output = 0xFFFF;
return((unsigned short)output);
}
void DLLINTERNAL META_UTIL_HudMessage(edict_t *pEntity, const hudtextparms_t &textparms, const char *pMessage)
{
if(fast_FNullEnt(pEntity) || pEntity->free)
return;
MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, pEntity );
WRITE_BYTE( TE_TEXTMESSAGE );
WRITE_BYTE( textparms.channel & 0xFF );
WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) );
WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) );
WRITE_BYTE( textparms.effect );
WRITE_BYTE( textparms.r1 );
WRITE_BYTE( textparms.g1 );
WRITE_BYTE( textparms.b1 );
WRITE_BYTE( textparms.a1 );
WRITE_BYTE( textparms.r2 );
WRITE_BYTE( textparms.g2 );
WRITE_BYTE( textparms.b2 );
WRITE_BYTE( textparms.a2 );
WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) );
WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) );
WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) );
if(textparms.effect == 2)
WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) );
if(strlen( pMessage ) < 512)
{
WRITE_STRING( pMessage );
}
else
{
char tmp[512];
strncpy( tmp, pMessage, 511 );
tmp[511] = 0;
WRITE_STRING( tmp );
}
MESSAGE_END();
}

View File

@ -1,38 +0,0 @@
// vi: set ts=4 sw=4 :
// vim: set tw=75 :
// studio.cpp - player model blending interfaces
/*
* Copyright (c) 2001-2006 Will Day <willday@hpgx.net>
*
* This file is part of Metamod.
*
* Metamod 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.
*
* Metamod 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 Metamod; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
//Jussi Kivilinna: This forwarder function to gamedll is not needed anymore, dynamic
// linkent code handles this too!

View File

@ -1,38 +0,0 @@
// vi: set ts=4 sw=4 :
// vim: set tw=75 :
// studio.cpp - player model blending interfaces
/*
* Copyright (c) 2001-2006 Will Day <willday@hpgx.net>
*
* This file is part of Metamod.
*
* Metamod 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.
*
* Metamod 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 Metamod; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
//Jussi Kivilinna: This forwarder function to gamedll is not needed anymore, dynamic
// linkent code handles this too!

View File

@ -1,58 +0,0 @@
// vi: set ts=4 sw=4 :
// vim: set tw=75 :
// vdate.cpp - compile-time version date
/*
* Copyright (c) 2001-2006 Will Day <willday@hpgx.net>
*
* This file is part of Metamod.
*
* Metamod 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.
*
* Metamod 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 Metamod; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#include "info_name.h" // for VNAME, VVERSION, etc
#include "vdate.h"
// Grab date/time of compile. The Makefile is set up to recompile this
// module before each link, so that this will always indicate the time the
// library was compiled and linked.
// This is in a separate file from vers_*, so it can be generically used by
// multiple projects.
char const *COMPILE_TIME=__DATE__ ", " __TIME__;
#ifndef COMPILE_TZ
#define COMPILE_TZ "EET"
#endif
char const *COMPILE_TZONE = COMPILE_TZ;
// Include a string for /usr/bin/ident.
char const *vstring="\n$Pg: " VNAME " -- " VVERSION " | " __DATE__ " - " __TIME__ " $\n";

View File

@ -1,45 +0,0 @@
// vi: set ts=4 sw=4 :
// vim: set tw=75 :
// vdate.h - compile-time version date
/*
* Copyright (c) 2001-2006 Will Day <willday@hpgx.net>
*
* This file is part of Metamod.
*
* Metamod 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.
*
* Metamod 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 Metamod; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#ifndef VDATE_H
#define VDATE_H
#include "comp_dep.h"
extern char const *COMPILE_TIME DLLHIDDEN;
extern char const *COMPILE_TZONE DLLHIDDEN;
#endif /* VDATE_H */

View File

@ -1,61 +0,0 @@
// vi: set ts=4 sw=4 :
// vim: set tw=75 :
// vers_meta.h - version info, intended to be common among DLLs distributed
// with metamod.
/*
* Copyright (c) 2001-2013 Will Day <willday@hpgx.net>
*
* This file is part of Metamod.
*
* Metamod 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.
*
* Metamod 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 Metamod; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#ifndef VERS_META_H
#define VERS_META_H
#ifndef OPT_TYPE
#define OPT_TYPE "default"
#endif /* not OPT_TYPE */
#define VDATE "2013/05/30"
#define VPATCH_COPYRIGHT_YEAR "2013"
#define VMETA_VERSION "1.21"
#define VPATCH_NAME "Metamod-P (mm-p)"
#define VPATCH_IVERSION 37
#define VPATCH_VERSION "37"
#define VPATCH_AUTHOR "Jussi Kivilinna"
#define VPATCH_WEBSITE "http://metamod-p.sourceforge.net/"
#define VVERSION VMETA_VERSION "p" VPATCH_VERSION
#define RC_VERS_DWORD 1,21,0,VPATCH_IVERSION // Version Windows DLL Resources in res_meta.rc
#endif /* VERS_META_H */

View File

@ -1,7 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "metamod", "metamod.vcproj", "{02832A39-E902-46B7-8D47-911C37CF41B0}"
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30501.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "metamod", "metamod.vcxproj", "{02832A39-E902-46B7-8D47-911C37CF41B0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

167
msvc/metamod.vcxproj Normal file
View File

@ -0,0 +1,167 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{02832A39-E902-46B7-8D47-911C37CF41B0}</ProjectGuid>
<RootNamespace>metamod</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v120_xp</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>12.0.30501.0</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\src;..\sdk\common;..\sdk\dlls;..\sdk\engine;..\sdk\pm_shared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;METAMOD_EXPORTS;_CRT_SECURE_NO_DEPRECATE;__METAMOD_BUILD__;__BUILD_FAST_METAMOD__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<ModuleDefinitionFile>metamod.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalDependencies>psapi.lib;$(ProjectDir)../lib/libirc.lib;$(ProjectDir)../lib/libacof32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\src;..\sdk\common;..\sdk\dlls;..\sdk\engine;..\sdk\pm_shared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;METAMOD_EXPORTS;_CRT_SECURE_NO_DEPRECATE;__METAMOD_BUILD__;__BUILD_FAST_METAMOD__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalDependencies>psapi.lib;$(ProjectDir)../lib/libirc.lib;$(ProjectDir)../lib/libacof32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\src\api_hook.cpp" />
<ClCompile Include="..\src\api_info.cpp" />
<ClCompile Include="..\src\commands_meta.cpp" />
<ClCompile Include="..\src\conf_meta.cpp" />
<ClCompile Include="..\src\dllapi.cpp" />
<ClCompile Include="..\src\engineinfo.cpp" />
<ClCompile Include="..\src\engine_api.cpp" />
<ClCompile Include="..\src\game_autodetect.cpp" />
<ClCompile Include="..\src\game_support.cpp" />
<ClCompile Include="..\src\h_export.cpp" />
<ClCompile Include="..\src\linkplug.cpp" />
<ClCompile Include="..\src\log_meta.cpp" />
<ClCompile Include="..\src\metamod.cpp" />
<ClCompile Include="..\src\meta_eiface.cpp" />
<ClCompile Include="..\src\mhook.cpp" />
<ClCompile Include="..\src\mlist.cpp" />
<ClCompile Include="..\src\mplayer.cpp" />
<ClCompile Include="..\src\mplugin.cpp" />
<ClCompile Include="..\src\mreg.cpp" />
<ClCompile Include="..\src\mutil.cpp" />
<ClCompile Include="..\src\osdep.cpp" />
<ClCompile Include="..\src\osdep_detect_gamedll_win32.cpp" />
<ClCompile Include="..\src\osdep_linkent_win32.cpp" />
<ClCompile Include="..\src\osdep_p.cpp" />
<ClCompile Include="..\src\reg_support.cpp" />
<ClCompile Include="..\src\sdk_util.cpp" />
<ClCompile Include="..\src\support_meta.cpp" />
<ClCompile Include="..\src\vdate.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\api_hook.h" />
<ClInclude Include="..\src\api_info.h" />
<ClInclude Include="..\src\commands_meta.h" />
<ClInclude Include="..\src\comp_dep.h" />
<ClInclude Include="..\src\conf_meta.h" />
<ClInclude Include="..\src\dllapi.h" />
<ClInclude Include="..\src\engineinfo.h" />
<ClInclude Include="..\src\engine_api.h" />
<ClInclude Include="..\src\games.h" />
<ClInclude Include="..\src\game_autodetect.h" />
<ClInclude Include="..\src\game_support.h" />
<ClInclude Include="..\src\h_export.h" />
<ClInclude Include="..\src\info_name.h" />
<ClInclude Include="..\src\linkent.h" />
<ClInclude Include="..\src\log_meta.h" />
<ClInclude Include="..\src\metamod.h" />
<ClInclude Include="..\src\meta_api.h" />
<ClInclude Include="..\src\meta_eiface.h" />
<ClInclude Include="..\src\mlist.h" />
<ClInclude Include="..\src\mm_pextensions.h" />
<ClInclude Include="..\src\mplayer.h" />
<ClInclude Include="..\src\mplugin.h" />
<ClInclude Include="..\src\mreg.h" />
<ClInclude Include="..\src\mutil.h" />
<ClInclude Include="..\src\new_baseclass.h" />
<ClInclude Include="..\src\osdep.h" />
<ClInclude Include="..\src\osdep_p.h" />
<ClInclude Include="..\src\plinfo.h" />
<ClInclude Include="..\src\reg_support.h" />
<ClInclude Include="..\src\ret_type.h" />
<ClInclude Include="..\src\sdk_util.h" />
<ClInclude Include="..\src\support_meta.h" />
<ClInclude Include="..\src\tqueue.h" />
<ClInclude Include="..\src\types_meta.h" />
<ClInclude Include="..\src\vdate.h" />
<ClInclude Include="..\src\vers_meta.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res_meta.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,218 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\api_hook.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\api_info.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\commands_meta.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\conf_meta.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\dllapi.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\engine_api.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\engineinfo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\game_autodetect.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\game_support.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\h_export.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\linkplug.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\log_meta.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\meta_eiface.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\metamod.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\mhook.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\mlist.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\mplayer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\mplugin.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\mreg.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\mutil.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\osdep.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\osdep_detect_gamedll_win32.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\osdep_linkent_win32.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\osdep_p.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\reg_support.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\sdk_util.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\support_meta.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\vdate.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\api_hook.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\api_info.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\commands_meta.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\comp_dep.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\conf_meta.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\dllapi.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\engine_api.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\engineinfo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\game_autodetect.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\game_support.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\games.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\h_export.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\info_name.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\linkent.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\log_meta.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\meta_api.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\meta_eiface.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\metamod.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\mlist.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\mm_pextensions.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\mplayer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\mplugin.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\mreg.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\mutil.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\new_baseclass.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\osdep.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\osdep_p.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\plinfo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\reg_support.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\ret_type.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\sdk_util.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\support_meta.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\tqueue.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\types_meta.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\vdate.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\vers_meta.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res_meta.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

View File

@ -36,7 +36,7 @@
// http://msdn.microsoft.com/library/psdk/winui/rc_7x2d.htm
#include <winver.h>
#include "info_name.h"
#include "..\src\info_name.h"
VS_VERSION_INFO VERSIONINFO
FILEVERSION RC_VERS_DWORD

View File

@ -198,4 +198,4 @@ void Sequence_ParseFile( const char* fileName, qboolean isGlobal );
void Sequence_OnLevelLoad( const char* mapName );
sentenceEntry_s* SequencePickSentence( const char *groupName, int pickMethod, int *picked );
#endif /* _INCLUDE_SEQUENCE_H_ */
#endif // _INCLUDE_SEQUENCE_H_

View File

@ -72,6 +72,8 @@ typedef struct
} dmodel_t;
// plane_t structure
#ifndef _MPLANE_DEFINED_
#define _MPLANE_DEFINED_
typedef struct mplane_s
{
vec3_t normal; // surface normal
@ -80,6 +82,7 @@ typedef struct mplane_s
byte signbits; // signx + signy<<1 + signz<<1
byte pad[2];
} mplane_t;
#endif
typedef struct
{
@ -200,12 +203,17 @@ struct msurface_s
decal_t *pdecals;
};
#ifndef _DCLIPNODE_DEFINED_
#define _DCLIPNODE_DEFINED_
typedef struct
{
int planenum;
short children[2]; // negative numbers are contents
} dclipnode_t;
#endif
#ifndef _HULL_DEFINED_
#define _HULL_DEFINED_
typedef struct hull_s
{
dclipnode_t *clipnodes;
@ -215,6 +223,7 @@ typedef struct hull_s
vec3_t clip_mins;
vec3_t clip_maxs;
} hull_t;
#endif
#if !defined( CACHE_USER ) && !defined( QUAKEDEF_H )
#define CACHE_USER

View File

@ -20,6 +20,10 @@
#endif /* not __MINGW32__ */
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct con_nprint_s
{
int index; // Row #
@ -29,5 +33,8 @@ typedef struct con_nprint_s
void Con_NPrintf( int idx, char *fmt, ... );
void Con_NXPrintf( struct con_nprint_s *info, char *fmt, ... );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1999, 2000, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
@ -109,6 +109,10 @@
#define EF_NOINTERP 32 // don't interpolate the next frame
#define EF_LIGHT 64 // rocket flare glow sprite
#define EF_NODRAW 128 // don't draw entity
#define EF_NIGHTVISION 256 // player nightvision
#define EF_SNIPERLASER 512 // sniper laser effect
#define EF_FIBERCAMERA 1024// fiber camera
// entity flags
#define EFLAG_SLERP 1 // do studio interpolation of this entity
@ -520,6 +524,7 @@
#define TEFIRE_FLAG_LOOP 4 // if set, sprite plays at 15 fps, otherwise plays at whatever rate stretches the animation over the sprite's duration.
#define TEFIRE_FLAG_ALPHA 8 // if set, sprite is rendered alpha blended at 50% else, opaque
#define TEFIRE_FLAG_PLANAR 16 // if set, all fire sprites have same initial Z instead of randomly filling a cube.
#define TEFIRE_FLAG_ADDITIVE 32 // if set, sprite is rendered non-opaque with additive
#define TE_PLAYERATTACHMENT 124 // attaches a TENT to a player (this is a high-priority tent)
// byte (entity index of player)
@ -592,7 +597,11 @@
#define CONTENTS_TRANSLUCENT -15
*/
#define CONTENTS_LADDER -16
#define CONTENTS_LADDER -16
#define CONTENT_FLYFIELD -17
#define CONTENT_GRAVITY_FLYFIELD -18
#define CONTENT_FOG -19
#define CONTENT_EMPTY -1
#define CONTENT_SOLID -2
@ -611,6 +620,7 @@
#define CHAN_STATIC 6 // allocate channel from the static area
#define CHAN_NETWORKVOICE_BASE 7 // voice data coming across the network
#define CHAN_NETWORKVOICE_END 500 // network voice data reserves slots (CHAN_NETWORKVOICE_BASE through CHAN_NETWORKVOICE_END).
#define CHAN_BOT 501 // channel used for bot chatter.
// attenuation values
#define ATTN_NONE 0
@ -631,6 +641,7 @@
// Trains
#define SF_TRAIN_WAIT_RETRIGGER 1
#define SF_TRAIN_START_ON 4 // Train is initially moving
#define SF_TRAIN_PASSABLE 8 // Train is not solid -- used to make water trains
// buttons
@ -701,11 +712,12 @@ enum
kRenderFxExplode, // Scale up really big!
kRenderFxGlowShell, // Glowing Shell
kRenderFxClampMinScale, // Keep this sprite from getting very small (SPRITES only!)
kRenderFxLightMultiplier, //CTM !!!CZERO added to tell the studiorender that the value in iuser2 is a lightmultiplier
};
typedef int func_t;
typedef int string_t;
typedef unsigned int func_t;
typedef unsigned int string_t;
typedef unsigned char byte;
typedef unsigned short word;

View File

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1999, 2000, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
@ -21,6 +21,8 @@
#endif /* not __MINGW32__ */
#endif
#include "archtypes.h" // DAL
// MD5 Hash
typedef struct
{
@ -30,13 +32,24 @@ typedef struct
} MD5Context_t;
typedef unsigned long CRC32_t;
#ifdef _WIN32
typedef uint32 CRC32_t;
#else
typedef uint32 CRC32_t;
#endif
#ifdef __cplusplus
extern "C"
{
#endif
void CRC32_Init(CRC32_t *pulCRC);
CRC32_t CRC32_Final(CRC32_t pulCRC);
void CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len);
void CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch);
int CRC_File(CRC32_t *crcvalue, char *pszFileName);
#ifdef __cplusplus
}
#endif
unsigned char COM_BlockSequenceCRCByte (unsigned char *base, int length, int sequence);
void MD5Init(MD5Context_t *context);

View File

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1999, 2000, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
@ -24,13 +24,14 @@
#define FCVAR_SPONLY (1<<6) // This cvar cannot be changed by clients connected to a multiplayer server.
#define FCVAR_PRINTABLEONLY (1<<7) // This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ).
#define FCVAR_UNLOGGED (1<<8) // If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log
#define FCVAR_NOEXTRAWHITEPACE (1<<9) // strip trailing/leading white space from this cvar
typedef struct cvar_s
{
char *name;
char *string;
int flags;
float value;
const char *name;
const char *string;
int flags;
float value;
struct cvar_s *next;
} cvar_t;
#endif

Some files were not shown because too many files have changed in this diff Show More