1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/ABOUT.txt Tue Apr 06 07:36:14 2004 +0000
1.3 @@ -0,0 +1,35 @@
1.4 +Metamod
1.5 +=-=-=-=
1.6 +
1.7 +a Half-Life utility mod
1.8 +
1.9 + meta /me't*/ or /may't*/ or (Commonwealth) /mee't*/ adj.,pref.
1.10 + [from analytic philosophy] One level of description up.
1.11 +
1.12 +The purpose of MetaMod is to function "one level up" from the normal
1.13 +Half-Life game mod DLL. Sitting between the mod game DLL and the Half-Life
1.14 +engine/binary, it intercepts the function calls between the two, with the
1.15 +option of passing them along untouched, as well as passing them on to as
1.16 +any number of _additional mod-like DLLs_.
1.17 +
1.18 +Thus, you can actually have multiple "mod-like" DLLs in operation at one
1.19 +time. I say "mod-like" because these additional DLLs (we'll call them
1.20 +"plugins") are not intended to provide a full "game"; that functionality
1.21 +is still provided by the "game dll". However, these plugins can _add to_
1.22 +or _modify the functionality provided by the game dll, or by the engine
1.23 +itself - for instance, adding new server commands, or new client commands,
1.24 +or even disabling commands built into the game dll. Although the plugin
1.25 +isn't intended to provide full HL-game functionality, since it's receiving
1.26 +the same information given to the game DLL, it has the opportunity to do
1.27 +_anything_ the game DLL can do (given enough coding effort of course).
1.28 +
1.29 +This is very similar to the way Alfred Reynolds' AdminMod
1.30 +(www.adminmod.org) works, as it also sits between the engine and game dll,
1.31 +catching routines, and passing them on. thus modifying functionality.
1.32 +However, rather than providing just the additional server features builtin
1.33 +to AdminMod DLL, MetaMod allows you to add features from multiple,
1.34 +separate DLLs. Under that framework, AdminMod can be a plugin itself, and
1.35 +be run alongside numerous other plugins. And, as of version 2.50 of
1.36 +AdminMod, AM has now transitioned to running as a Metamod plugin.
1.37 +
1.38 +--------------------------------------------------------------------------
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/Config.mak Tue Apr 06 07:36:14 2004 +0000
2.3 @@ -0,0 +1,4 @@
2.4 +PROJNAME = metamod
2.5 +
2.6 +#SUBDIRS := $(shell find */Makefile | sed "s/.Makefile//")
2.7 +SUBDIRS = metamod stub_plugin trace_plugin wdmisc_plugin
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/GPL.txt Tue Apr 06 07:36:14 2004 +0000
3.3 @@ -0,0 +1,340 @@
3.4 + GNU GENERAL PUBLIC LICENSE
3.5 + Version 2, June 1991
3.6 +
3.7 + Copyright (C) 1989, 1991 Free Software Foundation, Inc.
3.8 + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
3.9 + Everyone is permitted to copy and distribute verbatim copies
3.10 + of this license document, but changing it is not allowed.
3.11 +
3.12 + Preamble
3.13 +
3.14 + The licenses for most software are designed to take away your
3.15 +freedom to share and change it. By contrast, the GNU General Public
3.16 +License is intended to guarantee your freedom to share and change free
3.17 +software--to make sure the software is free for all its users. This
3.18 +General Public License applies to most of the Free Software
3.19 +Foundation's software and to any other program whose authors commit to
3.20 +using it. (Some other Free Software Foundation software is covered by
3.21 +the GNU Library General Public License instead.) You can apply it to
3.22 +your programs, too.
3.23 +
3.24 + When we speak of free software, we are referring to freedom, not
3.25 +price. Our General Public Licenses are designed to make sure that you
3.26 +have the freedom to distribute copies of free software (and charge for
3.27 +this service if you wish), that you receive source code or can get it
3.28 +if you want it, that you can change the software or use pieces of it
3.29 +in new free programs; and that you know you can do these things.
3.30 +
3.31 + To protect your rights, we need to make restrictions that forbid
3.32 +anyone to deny you these rights or to ask you to surrender the rights.
3.33 +These restrictions translate to certain responsibilities for you if you
3.34 +distribute copies of the software, or if you modify it.
3.35 +
3.36 + For example, if you distribute copies of such a program, whether
3.37 +gratis or for a fee, you must give the recipients all the rights that
3.38 +you have. You must make sure that they, too, receive or can get the
3.39 +source code. And you must show them these terms so they know their
3.40 +rights.
3.41 +
3.42 + We protect your rights with two steps: (1) copyright the software, and
3.43 +(2) offer you this license which gives you legal permission to copy,
3.44 +distribute and/or modify the software.
3.45 +
3.46 + Also, for each author's protection and ours, we want to make certain
3.47 +that everyone understands that there is no warranty for this free
3.48 +software. If the software is modified by someone else and passed on, we
3.49 +want its recipients to know that what they have is not the original, so
3.50 +that any problems introduced by others will not reflect on the original
3.51 +authors' reputations.
3.52 +
3.53 + Finally, any free program is threatened constantly by software
3.54 +patents. We wish to avoid the danger that redistributors of a free
3.55 +program will individually obtain patent licenses, in effect making the
3.56 +program proprietary. To prevent this, we have made it clear that any
3.57 +patent must be licensed for everyone's free use or not licensed at all.
3.58 +
3.59 + The precise terms and conditions for copying, distribution and
3.60 +modification follow.
3.61 +
3.62 + GNU GENERAL PUBLIC LICENSE
3.63 + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
3.64 +
3.65 + 0. This License applies to any program or other work which contains
3.66 +a notice placed by the copyright holder saying it may be distributed
3.67 +under the terms of this General Public License. The "Program", below,
3.68 +refers to any such program or work, and a "work based on the Program"
3.69 +means either the Program or any derivative work under copyright law:
3.70 +that is to say, a work containing the Program or a portion of it,
3.71 +either verbatim or with modifications and/or translated into another
3.72 +language. (Hereinafter, translation is included without limitation in
3.73 +the term "modification".) Each licensee is addressed as "you".
3.74 +
3.75 +Activities other than copying, distribution and modification are not
3.76 +covered by this License; they are outside its scope. The act of
3.77 +running the Program is not restricted, and the output from the Program
3.78 +is covered only if its contents constitute a work based on the
3.79 +Program (independent of having been made by running the Program).
3.80 +Whether that is true depends on what the Program does.
3.81 +
3.82 + 1. You may copy and distribute verbatim copies of the Program's
3.83 +source code as you receive it, in any medium, provided that you
3.84 +conspicuously and appropriately publish on each copy an appropriate
3.85 +copyright notice and disclaimer of warranty; keep intact all the
3.86 +notices that refer to this License and to the absence of any warranty;
3.87 +and give any other recipients of the Program a copy of this License
3.88 +along with the Program.
3.89 +
3.90 +You may charge a fee for the physical act of transferring a copy, and
3.91 +you may at your option offer warranty protection in exchange for a fee.
3.92 +
3.93 + 2. You may modify your copy or copies of the Program or any portion
3.94 +of it, thus forming a work based on the Program, and copy and
3.95 +distribute such modifications or work under the terms of Section 1
3.96 +above, provided that you also meet all of these conditions:
3.97 +
3.98 + a) You must cause the modified files to carry prominent notices
3.99 + stating that you changed the files and the date of any change.
3.100 +
3.101 + b) You must cause any work that you distribute or publish, that in
3.102 + whole or in part contains or is derived from the Program or any
3.103 + part thereof, to be licensed as a whole at no charge to all third
3.104 + parties under the terms of this License.
3.105 +
3.106 + c) If the modified program normally reads commands interactively
3.107 + when run, you must cause it, when started running for such
3.108 + interactive use in the most ordinary way, to print or display an
3.109 + announcement including an appropriate copyright notice and a
3.110 + notice that there is no warranty (or else, saying that you provide
3.111 + a warranty) and that users may redistribute the program under
3.112 + these conditions, and telling the user how to view a copy of this
3.113 + License. (Exception: if the Program itself is interactive but
3.114 + does not normally print such an announcement, your work based on
3.115 + the Program is not required to print an announcement.)
3.116 +
3.117 +These requirements apply to the modified work as a whole. If
3.118 +identifiable sections of that work are not derived from the Program,
3.119 +and can be reasonably considered independent and separate works in
3.120 +themselves, then this License, and its terms, do not apply to those
3.121 +sections when you distribute them as separate works. But when you
3.122 +distribute the same sections as part of a whole which is a work based
3.123 +on the Program, the distribution of the whole must be on the terms of
3.124 +this License, whose permissions for other licensees extend to the
3.125 +entire whole, and thus to each and every part regardless of who wrote it.
3.126 +
3.127 +Thus, it is not the intent of this section to claim rights or contest
3.128 +your rights to work written entirely by you; rather, the intent is to
3.129 +exercise the right to control the distribution of derivative or
3.130 +collective works based on the Program.
3.131 +
3.132 +In addition, mere aggregation of another work not based on the Program
3.133 +with the Program (or with a work based on the Program) on a volume of
3.134 +a storage or distribution medium does not bring the other work under
3.135 +the scope of this License.
3.136 +
3.137 + 3. You may copy and distribute the Program (or a work based on it,
3.138 +under Section 2) in object code or executable form under the terms of
3.139 +Sections 1 and 2 above provided that you also do one of the following:
3.140 +
3.141 + a) Accompany it with the complete corresponding machine-readable
3.142 + source code, which must be distributed under the terms of Sections
3.143 + 1 and 2 above on a medium customarily used for software interchange; or,
3.144 +
3.145 + b) Accompany it with a written offer, valid for at least three
3.146 + years, to give any third party, for a charge no more than your
3.147 + cost of physically performing source distribution, a complete
3.148 + machine-readable copy of the corresponding source code, to be
3.149 + distributed under the terms of Sections 1 and 2 above on a medium
3.150 + customarily used for software interchange; or,
3.151 +
3.152 + c) Accompany it with the information you received as to the offer
3.153 + to distribute corresponding source code. (This alternative is
3.154 + allowed only for noncommercial distribution and only if you
3.155 + received the program in object code or executable form with such
3.156 + an offer, in accord with Subsection b above.)
3.157 +
3.158 +The source code for a work means the preferred form of the work for
3.159 +making modifications to it. For an executable work, complete source
3.160 +code means all the source code for all modules it contains, plus any
3.161 +associated interface definition files, plus the scripts used to
3.162 +control compilation and installation of the executable. However, as a
3.163 +special exception, the source code distributed need not include
3.164 +anything that is normally distributed (in either source or binary
3.165 +form) with the major components (compiler, kernel, and so on) of the
3.166 +operating system on which the executable runs, unless that component
3.167 +itself accompanies the executable.
3.168 +
3.169 +If distribution of executable or object code is made by offering
3.170 +access to copy from a designated place, then offering equivalent
3.171 +access to copy the source code from the same place counts as
3.172 +distribution of the source code, even though third parties are not
3.173 +compelled to copy the source along with the object code.
3.174 +
3.175 + 4. You may not copy, modify, sublicense, or distribute the Program
3.176 +except as expressly provided under this License. Any attempt
3.177 +otherwise to copy, modify, sublicense or distribute the Program is
3.178 +void, and will automatically terminate your rights under this License.
3.179 +However, parties who have received copies, or rights, from you under
3.180 +this License will not have their licenses terminated so long as such
3.181 +parties remain in full compliance.
3.182 +
3.183 + 5. You are not required to accept this License, since you have not
3.184 +signed it. However, nothing else grants you permission to modify or
3.185 +distribute the Program or its derivative works. These actions are
3.186 +prohibited by law if you do not accept this License. Therefore, by
3.187 +modifying or distributing the Program (or any work based on the
3.188 +Program), you indicate your acceptance of this License to do so, and
3.189 +all its terms and conditions for copying, distributing or modifying
3.190 +the Program or works based on it.
3.191 +
3.192 + 6. Each time you redistribute the Program (or any work based on the
3.193 +Program), the recipient automatically receives a license from the
3.194 +original licensor to copy, distribute or modify the Program subject to
3.195 +these terms and conditions. You may not impose any further
3.196 +restrictions on the recipients' exercise of the rights granted herein.
3.197 +You are not responsible for enforcing compliance by third parties to
3.198 +this License.
3.199 +
3.200 + 7. If, as a consequence of a court judgment or allegation of patent
3.201 +infringement or for any other reason (not limited to patent issues),
3.202 +conditions are imposed on you (whether by court order, agreement or
3.203 +otherwise) that contradict the conditions of this License, they do not
3.204 +excuse you from the conditions of this License. If you cannot
3.205 +distribute so as to satisfy simultaneously your obligations under this
3.206 +License and any other pertinent obligations, then as a consequence you
3.207 +may not distribute the Program at all. For example, if a patent
3.208 +license would not permit royalty-free redistribution of the Program by
3.209 +all those who receive copies directly or indirectly through you, then
3.210 +the only way you could satisfy both it and this License would be to
3.211 +refrain entirely from distribution of the Program.
3.212 +
3.213 +If any portion of this section is held invalid or unenforceable under
3.214 +any particular circumstance, the balance of the section is intended to
3.215 +apply and the section as a whole is intended to apply in other
3.216 +circumstances.
3.217 +
3.218 +It is not the purpose of this section to induce you to infringe any
3.219 +patents or other property right claims or to contest validity of any
3.220 +such claims; this section has the sole purpose of protecting the
3.221 +integrity of the free software distribution system, which is
3.222 +implemented by public license practices. Many people have made
3.223 +generous contributions to the wide range of software distributed
3.224 +through that system in reliance on consistent application of that
3.225 +system; it is up to the author/donor to decide if he or she is willing
3.226 +to distribute software through any other system and a licensee cannot
3.227 +impose that choice.
3.228 +
3.229 +This section is intended to make thoroughly clear what is believed to
3.230 +be a consequence of the rest of this License.
3.231 +
3.232 + 8. If the distribution and/or use of the Program is restricted in
3.233 +certain countries either by patents or by copyrighted interfaces, the
3.234 +original copyright holder who places the Program under this License
3.235 +may add an explicit geographical distribution limitation excluding
3.236 +those countries, so that distribution is permitted only in or among
3.237 +countries not thus excluded. In such case, this License incorporates
3.238 +the limitation as if written in the body of this License.
3.239 +
3.240 + 9. The Free Software Foundation may publish revised and/or new versions
3.241 +of the General Public License from time to time. Such new versions will
3.242 +be similar in spirit to the present version, but may differ in detail to
3.243 +address new problems or concerns.
3.244 +
3.245 +Each version is given a distinguishing version number. If the Program
3.246 +specifies a version number of this License which applies to it and "any
3.247 +later version", you have the option of following the terms and conditions
3.248 +either of that version or of any later version published by the Free
3.249 +Software Foundation. If the Program does not specify a version number of
3.250 +this License, you may choose any version ever published by the Free Software
3.251 +Foundation.
3.252 +
3.253 + 10. If you wish to incorporate parts of the Program into other free
3.254 +programs whose distribution conditions are different, write to the author
3.255 +to ask for permission. For software which is copyrighted by the Free
3.256 +Software Foundation, write to the Free Software Foundation; we sometimes
3.257 +make exceptions for this. Our decision will be guided by the two goals
3.258 +of preserving the free status of all derivatives of our free software and
3.259 +of promoting the sharing and reuse of software generally.
3.260 +
3.261 + NO WARRANTY
3.262 +
3.263 + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
3.264 +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
3.265 +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
3.266 +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
3.267 +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3.268 +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
3.269 +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
3.270 +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
3.271 +REPAIR OR CORRECTION.
3.272 +
3.273 + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
3.274 +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
3.275 +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
3.276 +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
3.277 +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
3.278 +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
3.279 +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
3.280 +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
3.281 +POSSIBILITY OF SUCH DAMAGES.
3.282 +
3.283 + END OF TERMS AND CONDITIONS
3.284 +
3.285 + How to Apply These Terms to Your New Programs
3.286 +
3.287 + If you develop a new program, and you want it to be of the greatest
3.288 +possible use to the public, the best way to achieve this is to make it
3.289 +free software which everyone can redistribute and change under these terms.
3.290 +
3.291 + To do so, attach the following notices to the program. It is safest
3.292 +to attach them to the start of each source file to most effectively
3.293 +convey the exclusion of warranty; and each file should have at least
3.294 +the "copyright" line and a pointer to where the full notice is found.
3.295 +
3.296 + <one line to give the program's name and a brief idea of what it does.>
3.297 + Copyright (C) <year> <name of author>
3.298 +
3.299 + This program is free software; you can redistribute it and/or modify
3.300 + it under the terms of the GNU General Public License as published by
3.301 + the Free Software Foundation; either version 2 of the License, or
3.302 + (at your option) any later version.
3.303 +
3.304 + This program is distributed in the hope that it will be useful,
3.305 + but WITHOUT ANY WARRANTY; without even the implied warranty of
3.306 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3.307 + GNU General Public License for more details.
3.308 +
3.309 + You should have received a copy of the GNU General Public License
3.310 + along with this program; if not, write to the Free Software
3.311 + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
3.312 +
3.313 +
3.314 +Also add information on how to contact you by electronic and paper mail.
3.315 +
3.316 +If the program is interactive, make it output a short notice like this
3.317 +when it starts in an interactive mode:
3.318 +
3.319 + Gnomovision version 69, Copyright (C) year name of author
3.320 + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
3.321 + This is free software, and you are welcome to redistribute it
3.322 + under certain conditions; type `show c' for details.
3.323 +
3.324 +The hypothetical commands `show w' and `show c' should show the appropriate
3.325 +parts of the General Public License. Of course, the commands you use may
3.326 +be called something other than `show w' and `show c'; they could even be
3.327 +mouse-clicks or menu items--whatever suits your program.
3.328 +
3.329 +You should also get your employer (if you work as a programmer) or your
3.330 +school, if any, to sign a "copyright disclaimer" for the program, if
3.331 +necessary. Here is a sample; alter the names:
3.332 +
3.333 + Yoyodyne, Inc., hereby disclaims all copyright interest in the program
3.334 + `Gnomovision' (which makes passes at compilers) written by James Hacker.
3.335 +
3.336 + <signature of Ty Coon>, 1 April 1989
3.337 + Ty Coon, President of Vice
3.338 +
3.339 +This General Public License does not permit incorporating your program into
3.340 +proprietary programs. If your program is a subroutine library, you may
3.341 +consider it more useful to permit linking proprietary applications with the
3.342 +library. If this is what you want to do, use the GNU Library General
3.343 +Public License instead of this License.
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/Makefile Tue Apr 06 07:36:14 2004 +0000
4.3 @@ -0,0 +1,31 @@
4.4 +# vi: set ts=4 sw=4 :
4.5 +# vim: set tw=75 :
4.6 +
4.7 +# MetaMod toplevel makefile
4.8 +# Copyright (c) 2001-2003 Will Day <[email protected]>
4.9 +#
4.10 +# some sections as demonstated in GNU's make.info documentation
4.11 +
4.12 +include Config.mak
4.13 +
4.14 +ifeq "$(USER)" "willday"
4.15 +include priv/top.mak
4.16 +endif
4.17 +
4.18 +.DEFAULT:
4.19 + for i in $(SUBDIRS); do \
4.20 + $(MAKE) -C $$i $@ || exit; \
4.21 + done
4.22 +
4.23 +.PHONY: subdirs dlls $(SUBDIRS)
4.24 +
4.25 +subdirs: $(SUBDIRS)
4.26 +
4.27 +$(SUBDIRS):
4.28 + $(MAKE) -C $@
4.29 +
4.30 +clean cleanall:
4.31 + for i in $(SUBDIRS); do \
4.32 + $(MAKE) -C $$i cleanall || exit; \
4.33 + done
4.34 + -rm dlls/* dlls/debug/*
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/README.txt Tue Apr 06 07:36:14 2004 +0000
5.3 @@ -0,0 +1,7 @@
5.4 +Metamod Half-Life utility mod
5.5 +
5.6 +See the files under "doc/txt" or "doc/html" for more information.
5.7 +
5.8 +Will Day
5.9 [email protected]
5.10 +http://www.metamod.org/
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
6.2 +++ b/doc/Changelog Tue Apr 06 07:36:14 2004 +0000
6.3 @@ -0,0 +1,684 @@
6.4 +# vim: set tw=75 ft=none :
6.5 +
6.6 +2003/11/15 1.17
6.7 + - Added support for recently added routines in the HL Engine:
6.8 + SequenceGet()
6.9 + SequencePickSentence()
6.10 + GetFileSize()
6.11 + GetApproxWavePlayLen()
6.12 + IsCareerMatch()
6.13 + GetLocalizedStringLength()
6.14 + RegisterTutorMessageShown()
6.15 + GetTimesTutorMessageShown()
6.16 + ProcessTutorMessageDecayBuffer()
6.17 + ConstructTutorMessageDecayBuffer()
6.18 + ResetTutorMessageDecayData()
6.19 + - Removed mod recognition and entities for Master-Sword v1.3, at the
6.20 + request of the Mod's authors.
6.21 + - Added mod recognition and entities for HL-Rally vBeta 1.0, Kanonball
6.22 + v1.01, Over Ground vBeta 1.0, Project Timeless vBeta 1.0, Underworld
6.23 + Bloodline v2.0.
6.24 + - Additional entities for The Battle Grounds v1.2.1, Firearms v2.8.
6.25 + - Additional entities "env_rain" and "env_snow" used on some CS maps.
6.26 + - Added "metamod_version" cvar that can be queried from game browser
6.27 + clients.
6.28 + - Added "meta" client command similar to the console command, providing at
6.29 + this time only "list" and "version" subcommands.
6.30 + - Introduced basic config file to provide more reliable and more
6.31 + flexible options passing, in addition to the current +localinfo method.
6.32 + - Default filename: addons/metamod/config.ini
6.33 + - Options include:
6.34 + debuglevel <number>
6.35 + gamedll <path>
6.36 + plugins_file <path>
6.37 + exec_cfg <path>
6.38 + - Added option "+localinfo mm_configfile <path>" to override default
6.39 + config.ini pathname.
6.40 + - Added "meta config" console command to display result of config
6.41 + file and localinfo options.
6.42 + - Added "meta require <plugin>" console command, to exit the server if the
6.43 + specified plugin is not found loaded and running. Intended for use in
6.44 + server.cfg or metaexec.cfg. Suggested by Florian Zschocke.
6.45 + - If a specified override gamedll pathname is invalid, Metamod will now
6.46 + exit with an appropriate error, rather than falling back to the
6.47 + auto-detected gamedll. This should provide more useful feedback in such
6.48 + situations.
6.49 + - Added GINFO_REALDLL_FULLPATH for mutil GetGameInfo, to return the
6.50 + (supposed) "real" dllpathname, ie in case gamedll is overridden. Needed
6.51 + specifically for plugin "SinglePlayer".
6.52 + - Raised META_INTERFACE_VERSION to 5:10, for GINFO_REALDLL_FULLPATH.
6.53 + - Now recognizes "/dev/null" as valid for path options (pluginsfile,
6.54 + execcfg, configini, etc), for when an empty file _is_ desired.
6.55 + - Fixed loading of plugins.ini to detect duplicate plugins (by full
6.56 + pathname).
6.57 + - Added doc/config.ini with comments to document the file.
6.58 + - Renamed doc/metamod.ini to doc/plugins.ini, and added comments.
6.59 + - Internal changes:
6.60 + - Added conf_meta.cpp, conf_meta.h for config file handling.
6.61 + - Created full_gamedir_path() to centralize code for testing absolute
6.62 + path, prepending gamedir if necessary, calling realpath, and
6.63 + normalizing pathnames.
6.64 + - Most paths are now stored and operated on as fullpathnames, rather
6.65 + than gamedir-relative pathnames.
6.66 + - Now using fopen() rather than LOAD_FILE_FOR_ME when reading text
6.67 + files, in particular due to fullpathnames.
6.68 + - Errorcheck for absolute paths as mm_execcfg filename, since
6.69 + servercommand("exec") won't accept absolute pathanmes.
6.70 + - Added debug messages to valid_gamedir_file(), for checking why it
6.71 + failed to use a specified (config.ini, localinfo) path.
6.72 + - Simplified logic in cmd_doplug() to not require re-mapping pcmd to cmd
6.73 + string.
6.74 + - Fixed Makefile to always recompile meta_api.cpp for changes in
6.75 + info_name.h.
6.76 + - Split lookup_game() into setup_gamedll and lookup_game, to better
6.77 + organize for storing gamedll->real_pathname.
6.78 + - Source and documentation files based on the list of supported
6.79 + game/mods are split into their own files (games.h,
6.80 + supportedmods.html), so they can be generated from a local database
6.81 + rather than maintained manually.
6.82 + - Makefile now using gcc-2.95 explicitly, to avoid using gcc3 at this
6.83 + time.
6.84 +
6.85 +2003/08/02 1.16.2
6.86 + - Mod recognition and entities for The Point of No Return v.Beta 4.0.
6.87 + - Even more entities for The Specialists v.Beta 2.0.
6.88 +
6.89 +2003/07/30 1.16.1
6.90 + - Mod recognition and entities for Master-Sword v1.3, The Wastes RC 1.2,
6.91 + and Monkeystrike v1.2.
6.92 + - Additional entities for Natural Selection v2.0, The Specialists v.Beta
6.93 + 2.0, Earth's Special Forces v.Beta 1.1, The Battlegrounds v1.2, and
6.94 + International Online Soccer v2.0.
6.95 +
6.96 +2003/05/08 1.16
6.97 + - Added support for Server_GetBlendingInterface() in order to allow client
6.98 + and server to properly coordinate custom player model blending. This
6.99 + should fix the issue with mismatched hitboxes observed with CS and DOD.
6.100 + - Mod recognition and entities for International Online Soccer v1.0 and
6.101 + Morbid Inclination v1.0.
6.102 + - Added studioapi.{cpp,h} to provide Server_GetBlendingInterface.
6.103 +
6.104 +2003/05/03 1.15.3
6.105 + - More additional entities for Day of Defeat v1.0.
6.106 +
6.107 +2003/05/02 1.15.2
6.108 + - Mod recognition and entities for Rival Species vBeta 1.0, Public Enemy
6.109 + vBeta 1.0, and Bumper Cars vAlpha.
6.110 + - Additional entities for Day of Defeat v1.0, Sven Coop v2.1, WormsHL
6.111 + vBeta 3.0, and Natural Selection v1.1.
6.112 +
6.113 +2003/04/09 1.15.1
6.114 + - Additional entities for Firearms v2.7 and Desert Crisis v1.5.
6.115 + - Fixed mod recognition for Adrenalinegamer v4.x and later.
6.116 +
6.117 +2003/02/12 1.15
6.118 + - Additional entities for VampireSlayer Chapter V.
6.119 + - Fixed entity name "TS_PowerUp" for The Specialists 1.5; should fix
6.120 + precache error for "models/powerup.mdl".
6.121 + - Added DLFNAME implementation for win32, provided by Jussi Kivilinna.
6.122 + Thus, "meta info <plugin>" will now list registered commands and
6.123 + registered cvars under win32, rather than just under linux.
6.124 + - Now dynamically allocating lists of registered commands and registered
6.125 + cvars, rather than a fixed limit of 1024 (and before that, 512). Based
6.126 + on code provided by Jussi Kivilinna.
6.127 + - Console listing of regcmds/regfuncs now also shows currently allocated
6.128 + list sizes.
6.129 + - Replaced valid_file() using LOAD_FILE_FOR_ME with valid_gamedir_file()
6.130 + using stat(). Thus, it should no longer find unintended files under the
6.131 + "valve" subdirectory.
6.132 + - Normalize filenames under win32 to use slashes (/) and lowercase chars,
6.133 + to get rid of mixed-slashes (ie "half-life\cstrike/dlls") and to
6.134 + simplify pathname comparisons.
6.135 + - Also, canonicalize filenames under both win32/linux to remove ".." and
6.136 + redundant "/" path components, to provide more reliable pathname
6.137 + comparisions.
6.138 + - If meta_CVarRegister fails to find a corresponding plugin for a cvar, it
6.139 + now logs only a Debug message rather than an Error message, as a cvar_t
6.140 + that's malloc'd by a plugin can't be traced back. Problem reported by
6.141 + Olo.
6.142 + - In plugin trace, added "classname" to DispatchSpawn output.
6.143 + - Added is_absolute_path() to centralize the logic, and to be more
6.144 + OS-precise.
6.145 + - Split meta_init_gamedll() from meta_load_gamedll() so that the correct
6.146 + and normalized Gamedir is available earlier in the code.
6.147 + - #define NAME_MAX and PATH_MAX to the correct win32 constants, rather
6.148 + than using (inaccurate) internal values.
6.149 + - Renamed internal classes RegFunc to RegCmd, to provide more easily
6.150 + associated names.
6.151 + - Lots of internal file organization changes:
6.152 + - Removed superfluous symlinks in docs dir.
6.153 + - Renamed toplevel doc files to *.txt.
6.154 + - Added Config.mak to toplevel dir, to provide project name and subdirs,
6.155 + so that toplevel Makefile can be used for multiple projects.
6.156 + - Added copyrights to Makefiles.
6.157 + - Added blurbs to engine notes for FunctionFromName and NameForFunction,
6.158 + based on investigation of singleplayer support.
6.159 + - In source Makefile, added support for compiling linux-only or
6.160 + win32-only projects.
6.161 + - In source Makefile, fixed vdate.o to properly compile for each link.
6.162 + - Removed tmp files in msvc dir (.ncb, .plg).
6.163 + - Added copyright/GPL blurb to *.rc files.
6.164 + - In stub/meta_api.cpp, comment out unused variables rather than doing
6.165 + "if(var)" to satisfy gcc -Wunused.
6.166 + - Reduced vers_meta.h to just the version and other common info, and
6.167 + create info_name.h for module-specific name, desc, etc, so that I'll
6.168 + only have to edit 1 file when increasing version/date for all the DLLs
6.169 + distributed with Metamod.
6.170 + - Made res_meta.rc common among Metamod and the plugins, rather than
6.171 + having a separate res_plugin.rc.
6.172 + - In source Makefile, added "--include-dir" args to windres, so it can
6.173 + find the now common vers_meta.h.
6.174 + - Source Makefile now copies targets into ../dlls, rather than doing
6.175 + that only for comprehensive "dlls" targets.
6.176 + - Added "-fno-exceptions -fno-rtti" to possibly reduce code size,
6.177 + suggested by Jussi Kivilinna.
6.178 + - For plugins, renamed ie "mm_wdmisc" to "wdmisc_mm" where it was missed
6.179 + earlier.
6.180 + - For plugins, better organized common code, to make it more adaptable
6.181 + to other plugin projects (ie, singlep). Ie, plugin_query,
6.182 + plugin_attach, plugin_detach; moved plugin welcome banner to
6.183 + meta_api.cpp; etc.
6.184 + - Added tools/stlfilter to help hide -Weffc++ warnings from g++ STL
6.185 + headers (although not using STL at this time..)
6.186 +
6.187 +2003/01/24 1.14.1
6.188 + - Properly recognize win32 full pathname from GetGameDir.
6.189 + - Added "#include <direct.h>" for getcwd() under MSVC.
6.190 + - Trace plugin: Changed AlertMessage formatting, ie from
6.191 + "atype=at_console/1" to "atype=at_console(1)".
6.192 + - Stub plugin: fixed to compile under MSVC again.
6.193 +
6.194 +2003/01/23 1.14
6.195 + - Fixed to handle new behavior of engine routine GET_GAME_DIR under HL
6.196 + 1.1.1.1 (CS 1.6) beta, where the routine no longer returns the
6.197 + fullpathname of the game directory, but now returns only the string
6.198 + passed to hlds as the argument to "-game" (pointed out by Alfred
6.199 + Reynolds).
6.200 + - Added meta-util function GET_GAME_INFO to return various string-based
6.201 + information about the gamedll (name, description, gamedir fullpathname,
6.202 + dll fullpathname, dll filename).
6.203 + - Raised META_INTERFACE_VERSION from 5:8 to 5:9.
6.204 + - Added FAQ.
6.205 + - Some docs touchups.
6.206 +
6.207 +2003/01/18 1.13.4
6.208 + - Additional entities for betas of Counter-Strike 1.6 and TFC from HL
6.209 + 1.1.1.1.
6.210 + - Added missing #include "osdep.h" to several files, to make sure things
6.211 + like win32 vsnprintf are defined.
6.212 + - In stub plugin, added engine_api.cpp, to provide example framework for
6.213 + hooking engine routines.
6.214 + - In trace plugin, changed logtag to all caps.
6.215 +
6.216 +2003/01/12 1.13.3
6.217 + - Additional entities and updated mod recognition for Earth's Special
6.218 + Forces Beta 1.
6.219 + - Mod recognition for Retro Firearms 2.5.
6.220 + - Increased max allowed plugin functions and max allowed plugin cvars from
6.221 + 512 to 1024.
6.222 + - Fixed UTIL_VarArgs and UTIL_LogPrintf (copied from SDK) to use proper
6.223 + bounds-checking (to help prevent buffer overflows).
6.224 + - Updated Copyright to include "2001-2003".
6.225 +
6.226 +2002/11/26 1.13.2
6.227 + - Mod recognition and entities for Azure Sheep v1.0, BuzzyBots v2.3,
6.228 + Outlawsmod v.Beta 1.5, The Specialists v.Beta 1.0, and StargateTC v.Beta
6.229 + 2.2.
6.230 + - Additional entities for The Battle Grounds v.Demo 1.0, Firearms v.2.6.5,
6.231 + Global Warfare v.Beta 2.0, and Tour of Duty v1.1 Beta.
6.232 + - Updated mod recognition for Rocket Crowbar v1.9.
6.233 + - Compiled against HLSDK 2.3.
6.234 + - Corrected missing "const" in vdate.h (noted by Ravenous BugBlatter
6.235 + Beast).
6.236 +
6.237 +2002/10/06 1.13.1
6.238 + - Mod recognition and entities for Digital Paintball v1.0, Dragon Mod Z
6.239 + v1.7, Holy Wars v.beta2, and OeL Half-Life v4.0.
6.240 + - Additional entities for Adrenalinegamer Mod v6.0 and Natural Selection
6.241 + v1.0.
6.242 + - Corrected a cast in os_safe_call (from Olafur Osvaldsson).
6.243 +
6.244 +2002/08/24 1.13
6.245 + - New config file names and locations, per the Addon Development Standard
6.246 + rev 1.00. Default config files are now:
6.247 + - $gamedir/addons/metamod/plugins.ini
6.248 + - $gamedir/addons/metamod/exec.cfg
6.249 + - File "metagame.ini" no longer supported.
6.250 + - Additional entities for WormsHL beta 2.1.
6.251 + - Mod recognition (no entities) for Retro Counter-Strike 2.5.
6.252 + - Added release_notes.html.
6.253 + - Added function "valid_file" in support_meta.h.
6.254 +
6.255 +2002/07/11 1.12.4
6.256 + - Additional entities for Day of Defeat beta 3.0 and Tour of Duty 0.9.0.
6.257 + - Mod recognition and entities for Natural Selection 1.0.
6.258 + - Added "$pg" string for /usr/bin/ident.
6.259 +
6.260 +2002/07/01 1.12.3
6.261 + - Mod recognition and entities for Valve's Ricochet mod.
6.262 + - Additional entities for Tour of Duty 0.8.0.
6.263 + - Moved common code from LINK_ENTITY_TO_GAME to a function, rather than
6.264 + duplicating the code in ~2000 expanded macros. Based on code from Jussi
6.265 + Kivilinna <[email protected]>.
6.266 +
6.267 +2002/06/04 1.12.2
6.268 + - Even more entities for Firearms rc2.6.
6.269 +
6.270 +2002/05/29 1.12.1
6.271 + - Mod recognition and entities for Desert Crisis 1.1, Tour of Duty 0.6.7,
6.272 + and Train Hunters beta 1.0.
6.273 + - Additional entities for GoldenEye 1.9C and Firearms rc2.6.
6.274 + - Fixed meta-util function GET_PLUGIN_PATH to return the full path as
6.275 + intended, rather than a partial path.
6.276 + - Updated Copyright to include "2001-2002".
6.277 + - Fixed Makefile to not update .tags or .htags by default.
6.278 +
6.279 +2002/04/22 1.12.0
6.280 + - Updated for HL 1109, which adds one Engine routine:
6.281 + const char *GetPlayerAuthId(edict_t *e);
6.282 + - Mod recognition and entities for The Battle Grounds 0.6, Gangwars Beta
6.283 + 1.0, and WormsHL Beta 2.0
6.284 + - Additional entities for Day of Defeat beta 2.0 and Oz 2.5.
6.285 + - Changed error message "user message registered again" to a debug message
6.286 + (level 3).
6.287 + - Fixed compile problem under MSVC with strcasecmp.
6.288 + - Added meta-util function GET_PLUGIN_PATH, so a plugin can know from
6.289 + whence it was loaded.
6.290 + - In trace plugin, added more trace info for EngineFprintf, ServerPrint,
6.291 + IsMapValid, GetPlayerUserId, GetPlayerWONId, GetPlayerAuthId,
6.292 + CVarGetFloat, CVarGetString, AllocString, Time, IsDedicatedServer,
6.293 + GetCurrentPlayer, GetPlayerStats.
6.294 +
6.295 +2002/02/08 1.11.2
6.296 + - Hopefully complete list of entities for Day of Defeat beta 2.0.
6.297 + - Don't complain for NULL routines in gamedll's NEW_DLL_FUNCTIONS. Should
6.298 + solve "Couldn't find api call: dod.dll:ShouldCollide" errors with DoD
6.299 + b2.
6.300 + - Changed default for newapi ShouldCollide() from 0 to 1, per Mugsy@DoD's
6.301 + observations.
6.302 +
6.303 +2002/02/03 1.11.1
6.304 + - Mod recognition and entities for Snow-War 1.0, and Earth`s Special
6.305 + Forces version Alpha 2.0.
6.306 + - Additional entities for Oz 2.4.1, Svencoop 2.0, and partial entities for
6.307 + Day of Defeat beta 2.0.
6.308 + - Added check for duplicate UserMsg registration (should help resolve
6.309 + recent "reached max msgs 256" errors).
6.310 + - Dropped leading zeroes in version number.
6.311 + - Tweaked "interface version" log message to help reduce confusion.
6.312 + - Compiled with updated version of mingw; should help reduce dll filesizes
6.313 + found in the previous release.
6.314 + - Some additional debugging in gamedll entity linking.
6.315 +
6.316 +2001/12/17 1.11.00
6.317 + - Mod recognition and entities for Weapon Wars v0.3.
6.318 + - Additional entities for version 1.2 of Global Warfare.
6.319 + - Linux binary linked against glibc-2.1.2 for better compatibility.
6.320 + - 'meta game' now lists user messages registered by gamedll.
6.321 + - Added meta-util functions GET_USER_MSG_ID and GET_USER_MSG_NAME, so
6.322 + plugins that need to know RegUserMsg name/id mappings (like bots) don't
6.323 + need to be loaded at server startup.
6.324 + - Raised META_INTERFACE_VERSION from 5:6 to 5:7.
6.325 + - Fixed NUM_FOR_EDICT error in pfnCenterSay (from Fritz Elfert).
6.326 + - Re-fixed set_new_handler for MSVC (from Fritz Elfert).
6.327 + - Fixed meta_AddServerCommand; was registering plugin's command string
6.328 + rather than local string, causing segfault on plugin unload.
6.329 + - Changed trace plugin to use GET_USER_MSG_NAME instead of local list.
6.330 + - Added 'const' to 'char *' arguments in DLOPEN and DLSYM macros.
6.331 + - Commented out names of unused function paramenters, to satisfy "gcc
6.332 + -Wunused" without generating MSVC errors.
6.333 + - Added '#pragma warning(disable: 4390)' to disable "empty controlled
6.334 + statement" warnings in MSVC.
6.335 + - Updated MSDN url references.
6.336 +
6.337 +2001/09/19 1.10.00
6.338 + - Updated for HL SDK 2.2, which adds two Engine routines:
6.339 + qboolean Voice_GetClientListening)(int iReceiver, int iSender);
6.340 + qboolean Voice_SetClientListening)(int iReceiver, int iSender, qboolean bListen);
6.341 + - Mod recognition and entities for "Scientist Hunt" v1.2 and Existence
6.342 + Beta 1.3.
6.343 +
6.344 +2001/08/01 1.09.00
6.345 + - Mod recognition and entities for 'Wanted!' v1.5.
6.346 + - Mod recognition for Adrenalinegamer v3.2 and v4.1 (no special entities).
6.347 + - Additional entities for version 2.3 of Oz Deathmatch.
6.348 + - Additional entities for version 1.0 of Wizard Wars.
6.349 + - Additional meta-utility function CALL_GAME_ENTITY. Raised
6.350 + META_INTERFACE_VERSION from 5:5 to 5:6.
6.351 + - Added proper GPL notices.
6.352 +
6.353 +2001/07/06 1.08.02
6.354 + - Added mod recognition and entities for Gunman Chronicles.
6.355 + - Added list of supported mods to docs.
6.356 + - Updated MSVC project/workspace files to match recent source changes.
6.357 + - Fixed problem with set_new_handler compiling under MSVC.
6.358 +
6.359 +2001/06/30 1.08.01
6.360 + - Updated for Day of Defeat v1.3. The name of its win32 dll changed (was
6.361 + mp.dll; now dod.dll). No new entities.
6.362 + - Added mod recognition and entities for Rocket Crowbar.
6.363 + - Fixed problem with windows internal DLL version (don't use leading
6.364 + zeros as compiler will assume it's octal notation).
6.365 +
6.366 +2001/06/16 1.08.00
6.367 + - Allow specifying/overriding various things on the command line, via
6.368 + "+localinfo". Fields are:
6.369 + - mm_gamedll
6.370 + a bot or other dll, instead of the gamedll based on the gamedir.
6.371 + Note this is now the preferred method; the "metagame.ini" file is
6.372 + deprecated, but still recognized for backwards compatibility.
6.373 + - mm_pluginsfile
6.374 + a file with the list of mm plugins, instead of "metamod.ini".
6.375 + - mm_execcfg
6.376 + a cfg file for mm plugin cvar settings, instead of "metaexec.cfg".
6.377 + - mm_debug
6.378 + an initial debug level.
6.379 + - Examples:
6.380 + ./hlds_run -game cstrike +localinfo mm_gamedll dlls/pod_bot.so
6.381 + ./hlds_run -game cstrike +localinfo mm_pluginsfile mylist.ini
6.382 + ./hlds_run -game cstrike +localinfo mm_execcfg mysettings.cfg
6.383 + ./hlds_run -game cstrike +localinfo mm_debug 7
6.384 + - Don't try exec'ing metaexec.cfg unless it exists.
6.385 + - Added additional entity for Action Half-Life Beta 4, from list forwarded
6.386 + from the dev team.
6.387 + - Added a couple additional entities for Global Warfare, from list
6.388 + provided by the dev team.
6.389 + - Moved a couple entities from the "common" list back to the "valve" list,
6.390 + for better organization.
6.391 + - Changed logmsg "Plugin '%s' interface version didn't match" from
6.392 + "Warning:" to "Note:" to reduce confusion.
6.393 + - Added an optional plugin meta-api routine Meta_Init, to be called prior
6.394 + to GiveFnptrsToDll, to let the dll know that it's going to be
6.395 + queried/loaded as a metamod plugin, to allow for DLL's that can be used
6.396 + as both a metamod plugin _and_ a standalone DLL. Raised
6.397 + META_INTERFACE_VERSION from 5:4 to 5:5.
6.398 + - Removed segfault handler under linux, when calling plugin console
6.399 + command functions, as (a) it masked legitimate segfaults in plugin
6.400 + commands and produced confusing output ("plugin has been unloaded", when
6.401 + really it segfaultd), and (b) wasn't necessary since the situation
6.402 + should be covered by other tests.
6.403 + - Replaced combo SDK macros with inline funcs, and added ones for
6.404 + accessing serverinfo and localinfo infokey buffers.
6.405 + - Unfinished code for event triggers is in the source, but is disabled
6.406 + (since it's not finished yet).
6.407 +
6.408 +2001/06/10 1.07.03
6.409 + - improper compile was reporting wrong version number
6.410 +
6.411 +2001/06/07 1.07.02
6.412 + - added mod recognition and best-guess list of entities for Deathmatch
6.413 + Classic v1 and Global Warfare Beta 1.0.
6.414 + - updated entity list with best-guess additions and corrected win32 dll
6.415 + name for Wasteland Beta 2.
6.416 + - added additional entities for Frontline Force 1.2a, from list forwarded
6.417 + from the dev team.
6.418 +
6.419 +2001/05/25 1.07.01
6.420 + - added complete (hopefully) list of additional entities for Front Line
6.421 + Force 1.2a/1.3.
6.422 + - added best-guess list of entities for Day of Defeat b1.1.
6.423 + - added best-guess list of entities for Science & Industry 0.97 (later
6.424 + confirmed by SI lead programmer).
6.425 + - added better guess list of entites for Action Half-Life b4.
6.426 + - shrunk entity lists for Jailbreak and Judgement to include only
6.427 + mod-specific entities (rather than common Valve entities which are in a
6.428 + separate list).
6.429 + - in THREAD_CREATE inline, replaced "(DWORD (*)(void*)) func" with
6.430 + "(LPTHREAD_START_ROUTINE) func" to properly compile under MSVC.
6.431 + - added engine_notes.html with a list of all the engine routines, and some
6.432 + comments.
6.433 + - added utils/getents.sh script to pull entity lists from .so files.
6.434 +
6.435 +2001/05/08 1.07.00
6.436 + - fixed "%s" server-crashing bug. "You should never pass strings with
6.437 + unknown contents as the format string." Metamod was passing a
6.438 + preformatted non-constant (thus unknown contents) string as the format
6.439 + string (and only argument) when handling printf-style varargs engine
6.440 + functions (in particular, AlertMessage). Ie, don't do:
6.441 + printf(buf);
6.442 + Instead do:
6.443 + printf("%s", buf);
6.444 + - added some entities for Action Half-Life Beta4, which should help
6.445 + address crashing on startup, especially with Last Man Standing random
6.446 + weapons. Note that I don't have an official, complete list of entities
6.447 + for the mod, so there may still be some instances of crashing.
6.448 + - added debugging messages for printf-style varargs engine routines, since
6.449 + we can't rely on trace_mm for this (as the messages are re-written by
6.450 + metamod before being passed to trace).
6.451 + - better info in trace plugin's log messages for AlertMessage and
6.452 + CreateNamedEntity.
6.453 + - altered debug levels AlertMessage API routines in api_info.cpp
6.454 +
6.455 +2001/05/04 1.06.10
6.456 + - fixed a couple of entities for HL Paintball.
6.457 + - added links.html to docs, a set of links/URLs and books that I found
6.458 + helpful for the project.
6.459 + - added to META_INTERFACE_VERSION comments to include associated metmaod
6.460 + version for each change.
6.461 + - additional data checking in various MPluginList routines.
6.462 + - added 'const' to various function arguments to more properly reflect
6.463 + function purpose.
6.464 + - changed various function macros to inlines, to provide more obvious type
6.465 + checking, and easier debugging.
6.466 + - adjusted private/public members of various classes, to try and make them
6.467 + more proper.
6.468 + - added new_handler code, for upcoming code additions.
6.469 + - added MPluginList::find(plid_t id), for upcoming code additions.
6.470 + - added thread primitives to osdep, for upcoming code additions.
6.471 +
6.472 +2001/04/29 1.06.02
6.473 + - added entities and mod recognition for VampireSlayer and Open-Source
6.474 + Jailbreak.
6.475 + - updated mod recognition for current names of Action Half-Life's DLL/SO
6.476 + files.
6.477 + - added some entities for FLF 1.2a, listed on Botman's news page.
6.478 + - added some docs for Installation and Compiling.
6.479 + - added build type info (optimized, debugging, etc) to the SpecialBuild
6.480 + tag in the version info for the win32 DLL.
6.481 + - disabled SDK's "DBG_" functions, for MSVC win32 debug compiles.
6.482 +
6.483 +2001/04/22 1.06.01
6.484 + - added some entities for FLF 1.2.
6.485 + - better info in trace plugin's log messages for
6.486 + DispatchObjectCollsionBox, SetModel, FindEntityByString, SetOrigin,
6.487 + EntOffsetOfPEntity, PEntityOfEntIndex.
6.488 + - fixed missing initialization for "len" in wdmisc.
6.489 + - added <a name> links to sections in html docs.
6.490 + - for non-critical interface version mismatch, changed from a META_ERROR
6.491 + to just META_LOG, since it's not, strictly speaking, an error.
6.492 +
6.493 +2001/04/17 1.06.00
6.494 + - added support for "metaexec.cfg", a commands file to be exec'd after
6.495 + loading the plugins, for plugin commands and cvars, since autoexec.cfg
6.496 + is parsed too early (before plugins loaded) and server.cfg is parsed too
6.497 + late (after ServerActivate).
6.498 + - better info in trace plugin's log messages for MessageBegin,
6.499 + WriteString, AlertMessage, RegUserMsg
6.500 + - to provide more manageable trace log output, throttled trace plugin to 1
6.501 + logmsg per second, by default (of course, this can cause log messages to
6.502 + be lost). Added cvar "trace_unlimit" (0/1) to enable unlimited logging,
6.503 + as it did previously.
6.504 + - added centersay meta-utility functions (CENTER_SAY, CENTER_SAY_PARMS,
6.505 + CENTER_SAY_VARARGS). Raised META_INTERFACE_VERSION from 5:3 to 5:4.
6.506 + - fixed crash when trying to load typical game DLLs (like standalone-bots)
6.507 + as metamod plugins.
6.508 + - fixed segfault on failed plugin attach; was dlclosing plugin
6.509 + prematurely.
6.510 + - in wdmisc, added a proof-of-concept for catching certain game events by
6.511 + doing string matching on all the log messages produced by the game.
6.512 + Ugly, to be sure, but interesting nonetheless.
6.513 + - added more entities for HL Paintball, and fixed the linux so name.
6.514 + - added "-Wno-unused" to CFLAGS when compiling sdk_util.o, to alleviate
6.515 + the complaints from #including all the extra SDK header files and class
6.516 + definitions.
6.517 + - removed GetEntityAPI routine from trace plugin, as it's unnecessary as a
6.518 + metamod plugin if already providing GetEntityAPI2.
6.519 + - in trace, moved gMetaFunctionTable declaration to plugin.cpp, so that
6.520 + meta_api.cpp can be a standard (plugin-independent) sourcefile used in
6.521 + any plugin.
6.522 + - updated the docs to include recent new features, as well as some better
6.523 + discussion of coding details.
6.524 +
6.525 +2001/04/06 1.05.00
6.526 + - created utility callback functions, for use by plugins, to reduce code
6.527 + duplication and help simplify some things. Currently, these consist of
6.528 + only some convenient logging functions (LOG_CONSOLE, LOG_MESSAGE,
6.529 + LOG_ERROR, LOG_DEVELOPER).
6.530 + - added "mutil_funcs_t" to Meta_Query, to pass the meta utility function
6.531 + table. Increased META_INTERFACE_VERSION from 5:2 to 5:3.
6.532 + - made sure all exported DLL routines (ie routines that are accessed via
6.533 + dlsym) are both declared _and defined_ as 'extern "C"', so that the C++
6.534 + compiler enforces parameter type-matching, rather than considering
6.535 + routines with mis-matched arguments/types to be overloaded functions...
6.536 + Note that it's not sufficient to just be declared "C"; it has to defined
6.537 + this way as well, to make sure the C++ compiler matches it with the
6.538 + declaration. Otherwise, again, it'll consider it an overloaded
6.539 + function, and allow it happily without complaint, and cause the
6.540 + subsequent dlsym to fail.
6.541 + - created and deployed C_DLLEXPORT macro for declaring/defining functions
6.542 + 'extern "C" DLLEXPORT'.
6.543 + - added plugin 'wdmisc' as a basic example, and for my miscellaneous
6.544 + commands/cvars.
6.545 + - renamed "mm_stub" and "mm_trace" to "stub_mm" and "trace_mm" to make
6.546 + plugin name more apparent, and to be more consistent with adminmod_MM.
6.547 + - had to move plugin_info_t to its own header file, to avoid circular
6.548 + #include's between meta_api.h and mutil.h.
6.549 + - in dllapi.cpp and engineapi.cpp, pulled RETURN_API out of META_HANDLE
6.550 + macro, to make it easier to add code to middle of API routines.
6.551 + - renamed util_meta.h to support_meta.h, to avoid confusion with mutil.h
6.552 + - some code cleanup (better 80-column linebreaks).
6.553 +
6.554 +2001/04/03 1.02.00
6.555 + - added support for Half-Life Paintball
6.556 + - added "*_mm" and "*_MM" to the list of suffixes to look for when loading
6.557 + plugins at console.
6.558 + - log errors when plugin tries to use MRES_SUPERCEDE in a _Post function
6.559 + (supercede is only relevant in a non-Post function; use OVERRIDE in a
6.560 + Post function).
6.561 + - mm_trace: added info to trace log for FindEntityInSphere
6.562 + - added osdep macro for strcasecmp, for compiling under windows
6.563 + - fixed a debug log message for GetEngineFunctions_Post
6.564 + - fixed a couple internal references to engine globals (gpGLobals)
6.565 + - renamed local SDK API routines to "mm_*" for easier debug breakpoints
6.566 + - altered debug levels for a couple API routines in api_info.cpp
6.567 +
6.568 +2001/04/01 1.01.00
6.569 + - replaced use of FStrEQ in most places with !strcasecmp, so that case
6.570 + doesn't matter for things like console commands ("META LOAD" will now
6.571 + work in addition to "meta load") and paths (like "-game CSTRIKE"; and
6.572 + win32 filepaths are case-insignificant anyway). Interestingly, the HL
6.573 + engine ignores case for console commands ("ADMIN_COMMAND" works), but
6.574 + cvars are only recognized with matching case ("ADMIN_DEBUG" does not
6.575 + work). Confusing.
6.576 + - added "by " when printing author info, to make it a bit clearer
6.577 + - added a bit more operation info to metamod.html
6.578 +
6.579 +2001/03/30 1.00.00
6.580 + - released as v1.0, for inclusion with release of Adminmod v2.50.
6.581 + - added $(VERSFILE) to Makefile and Config.mak, to better insure correct
6.582 + rebuild on version number changes
6.583 + - added "i486", "i586", and "i686" to "i386" in the list of prefixes to
6.584 + look for when loading plugins at console.
6.585 + - added "MDLL*" and "MNEW" macros in meta_api.h, to be more convenient for
6.586 + plugins to call GameDLL functions.
6.587 + - added missing "extern gamedll_funcs_t *gpGamedllFuncs" to meta_api.h
6.588 + - added handling of gpGamedllFuncs in stub, for example purposes.
6.589 + - fixed problems with running bots under metagame.ini:
6.590 + - moved instantiation of Plugins object to before meta_load_gamedll, so
6.591 + that if gamedll calls engine functions during GiveFnptrsToDll (like
6.592 + hpb_bot does), META_ENGINE_HANDLE won't crash from a null Plugins object
6.593 + pointer.
6.594 + - in GET_FUNC_TABLE_FROM_GAME, memset gamedll.funcs.struct_field, and then
6.595 + free/null it if the gamedll's GetFuncs call fails, to handle the
6.596 + situation where the gamedll provides GetNewDLLFunctions(), but doesn't
6.597 + have anything to return (like hpb_bot does, when the real gamedll
6.598 + doesn't provide GetNewDLLFunctions).
6.599 + - add handling of gpGamedllFuncs to mm_stub's Meta_Attach().
6.600 +
6.601 +2001/03/27 1.0-rc5
6.602 + - fixed problem with crashing when a plugin failed to load (improper
6.603 + dereference of null 'info' structure; incomplete fix from rc2).
6.604 + - added a plugin status "badfile", for plugin files that appear to be
6.605 + invalid metamod plugins; this is to differentiate from "failed", which
6.606 + is a valid-looking plugin file (queried) but encountered a failure
6.607 + attaching/unloading/etc.
6.608 + - changed "-march=i686" optimization to "-march=i586", and moved this to
6.609 + only the optimized binaries, and not the debugging binaries. As it
6.610 + turns out, i686 doesn't work on things like AMD K6-III cpus (I know, go
6.611 + figure :).
6.612 + - duplicated functionality of adminmod's "admin.ini", except with a file
6.613 + named "metagame.ini". This will allow (at least partial) use with game
6.614 + DLLs that metamod doesn't support yet - "partial" because, although the
6.615 + game DLL will load, it may not work if it uses entities that metamod
6.616 + doesn't know about yet. It will also allow use of standalone "bot"
6.617 + DLLs, which sit between metamod and the gamedll (much like metamod sits
6.618 + between the engine and the gamedll).
6.619 + - added console command "meta game" to show information about the loaded
6.620 + game DLL (to help troubleshoot issues with "metagame.ini").
6.621 +
6.622 +2001/03/25 1.0-rc4
6.623 + - split linkfunc.cpp into linkent.h, linkgame.cpp, linkplug.cpp
6.624 + - split entity lists for mods into separate files, one for each mod; these
6.625 + are used to build linkgame.cpp
6.626 + - metamod/mm_trace version info should indicate debugging/optimized compile
6.627 + - added entity support for Judgement DM
6.628 + - added "-fno-rtti" to mm_trace gcc cflags, to address problem of
6.629 + unresolved CSaveRestoreBuffer symbols using older versions of gcc
6.630 + - lowered debug levels in GetEntityAPI, GetNewDLLFunctions, etc to enable
6.631 + "+developer" messages (6 -> 3).
6.632 + - removed "-Werror" from Makefile's default cflags; should only be used
6.633 + on devl system with edited SDK
6.634 +
6.635 +2001/03/18 1.0-rc3
6.636 + - central Makefile can now build optimzed as well as debugging targets;
6.637 + default to compile is debugging; default in 'dlls' dir is optimized
6.638 + - toplevel Makefile builds release tgz/zip files. TGZ file includes only
6.639 + linux .so objects, and text files in unix-LF format. ZIP file includes
6.640 + only win32 .dll objects, and text files in dos-CRLF format, and actual
6.641 + files rather than symlinks.
6.642 + - added mod recognition for "judgedm" mod; still need entities list
6.643 + - added 4 entities for Firearms 2.5
6.644 +
6.645 +2001/03/07 1.0-rc2
6.646 + - fixed missing WINAPI in mm_trace GiveFnptrsToDll
6.647 + - added HTML version of docs
6.648 + - description field in metamod.ini is now optional:
6.649 + - uses "name" from plugin info for desc by default
6.650 + - desc field in metamod.ini will override this
6.651 + - "meta list" shows just desc, rather than desc and name
6.652 + - altered debug levels for a couple API routines in api_info.cpp
6.653 + - added missing "load" cmd in "meta" usage help
6.654 + - added to "meta load" usage help
6.655 + - added macros RETURN_META(result) and RETURN_META_VALUE(result, value) to
6.656 + simplify plugin coding
6.657 + - added parameter "gamedll_funcs" to meta_attach(), to give each plugin a
6.658 + copy of the gamedll's API function tables
6.659 + - raised META_INTERFACE_VERSION to "5:2"
6.660 + - now load gamedll before plugins (rather than the reverse) so that
6.661 + it'll have the gamedll func tables to hand to the plugins
6.662 + - changed trace plugin console commands:
6.663 + trace_version -> trace version
6.664 + trace <routine> -> trace set <routine>
6.665 + untrace <routine> -> trace unset <routine>
6.666 + showtrace -> trace show
6.667 + - added "trace list <api>" to list all available routines for tracing
6.668 + - fixed broken trace cvars
6.669 + - for "meta {load,unload,etc}" console cmd, added matching against plugin
6.670 + logtag, as well as for "mm_<prefix>" in plugin file
6.671 + - handle null 'info' after failed plugin load (ie in "meta info" etc)
6.672 + - fixed "usage: meta list" errors on some meta commands; was calling
6.673 + cmd_meta_pluginlist() instead of Plugins->show()
6.674 + - fixed: unload/attach delayed plugins at changelevel
6.675 + - now doesn't export newapi if gamedll doesn't provide it
6.676 + - now doesn't call plugins getnewapi if gamedll doesn't provide it
6.677 + - fixed incorrect apitable references in MPlugin::show()
6.678 +
6.679 +2001/02/08 1.0-rc1
6.680 + - fixed unistd.h under MSVC
6.681 + - fixed S_ISREG under MSVC
6.682 + - fixed strncasecmp under MSVC
6.683 + - fixed void svr_meta() returning value
6.684 + - fixed missing WINAPI in mm_stub GiveFnptrsToDll
6.685 + - remade MSVC project for metamod
6.686 + - created MSVC project for mm_stub
6.687 + - added an example "metamod.ini" to ./docs
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/doc/README.txt Tue Apr 06 07:36:14 2004 +0000
7.3 @@ -0,0 +1,6 @@
7.4 +Please see the files in the "html" or "txt" directory for documentation.
7.5 +
7.6 +Example files in the current directory:
7.7 +
7.8 + plugins.ini
7.9 + config.ini
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/doc/TODO Tue Apr 06 07:36:14 2004 +0000
8.3 @@ -0,0 +1,37 @@
8.4 +# vi: set ts=4 sw=4 :
8.5 +# vim: set tw=75 :
8.6 +
8.7 + - event notification and log-parsing interface for plugins
8.8 + - interaction between plugins
8.9 + - rename trace functions to "tr_*" for easier debug breakpoints
8.10 + - add meta console command to debug indiv functions, like mm_trace can
8.11 + - catch register cmds/cvars from gameDLL and list then in "meta game"
8.12 + - handle RegUserMsg and allow lists of registered messages to be queried
8.13 + by bot plugins or other plugins that want to catch these things, and to
8.14 + allow these plugins to be loaded during a map (since after mapstart, the
8.15 + plugin can't catch RegUserMsg calls, since they've all already been made).
8.16 + - in win32, doesn't report parsed plugin line properly; says only:
8.17 + [META] ini: Read plugin config for:
8.18 + - use scanf for file parsing ?
8.19 + - "meta cancel" command
8.20 + - more documentation info
8.21 + - don't refresh_ini on "quit"
8.22 + - test more bot support for metagame.ini
8.23 +
8.24 + - track "messages" for plugins and provide READ_* functions (usermsg.cpp)
8.25 + - provide other "engine" functions to plugins
8.26 + - is_connected
8.27 + - is_ingame
8.28 + - find some way to generally allow plugins to use LINK_ENTITY_TO_CLASS,
8.29 + without requiring explicit support in metamod
8.30 +
8.31 + x fix stat()-related code for linux only
8.32 + x remake MSVC project
8.33 + x use resources
8.34 + x doublecheck DLLEXPORT and stuff
8.35 + x txt files in "dos" format?
8.36 + x separate zip/tgz files
8.37 + x compat support for "admin.ini"
8.38 + x support dir-specific "metamod.ini" files, similar to servercfgfile
8.39 + x more documentation info: engineapi_info.txt
8.40 + x html view of source
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
9.2 +++ b/doc/config.ini Tue Apr 06 07:36:14 2004 +0000
9.3 @@ -0,0 +1,67 @@
9.4 +// vim: set ft=c :
9.5 +//
9.6 +// Format is as follows:
9.7 +// <optionname> <value>
9.8 +//
9.9 +// Fields are whitespace delimited (tabs/spaces).
9.10 +//
9.11 +// Comments are either c++ style ("//") or unix shell style ("#"), and
9.12 +// can appear ONLY at the beginning of a line.
9.13 +//
9.14 +// The following provide a list of recognized options, their defaults, and
9.15 +// examples of usage.
9.16 +//
9.17 +// debuglevel <number>
9.18 +// gamedll <path>
9.19 +// plugins_file <path>
9.20 +// exec_cfg <file>
9.21 +
9.22 +
9.23 +// debuglevel <number>
9.24 +// where <number> is an integer, 0 and up.
9.25 +// Sets the initial debugging level for metamod (same as cvar "meta_debug").
9.26 +// Default is normally 0. If hlds is run with "-dev", default is 3.
9.27 +// Overridden by: +localinfo mm_debug <number>
9.28 +// Examples:
9.29 +//
9.30 +// debuglevel 0
9.31 +// debuglevel 42
9.32 +
9.33 +
9.34 +// gamedll <path>
9.35 +// where <path> is an absolute path, or a path relative to the gamedir.
9.36 +// Overrides the auto-detected gamedll, in particular for bots.
9.37 +// Default is empty, with gamedll being auto-recognized based on the
9.38 +// gamedir.
9.39 +// Overridden by: +localinfo mm_gamedll <path>
9.40 +// Examples:
9.41 +//
9.42 +// gamedll dlls/hl.dll
9.43 +// gamedll ../podbot/podbot.dll
9.44 +// gamedll /home/bots/dlls/mybot.dll
9.45 +
9.46 +
9.47 +// plugins_file <path>
9.48 +// where <path> is an absolute path, or a path relative to the gamedir.
9.49 +// Overrides the default filename containing the MM plugins to load.
9.50 +// Default is "addons/metamod/plugins.ini".
9.51 +// Overridden by: +localinfo mm_pluginsfile <path>
9.52 +// Examples:
9.53 +//
9.54 +// plugins_file cfg/clanmode.ini
9.55 +// plugins_file ../private.ini
9.56 +// plugins_file /home/half-life/testing.ini
9.57 +
9.58 +
9.59 +// exec_cfg <file>
9.60 +// where <file> is a path relative to the gamedir. Note! This CANNOT be
9.61 +// an absolute path, as hlds will not "exec" absolute pathnames.
9.62 +// Overrides the default filename containing hlds commands to run just
9.63 +// after loading Metamod.
9.64 +// Default is "addons/metamod/exec.cfg".
9.65 +// Overridden by: +localinfo mm_execcfg <path>
9.66 +// Examples:
9.67 +//
9.68 +// exec_cfg configs/debugging.cfg
9.69 +// exec_cfg ../clan/match.cfg
9.70 +
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
10.2 +++ b/doc/html/Index.html Tue Apr 06 07:36:14 2004 +0000
10.3 @@ -0,0 +1,65 @@
10.4 +<!-- vi: set ts=4 sw=4 : -->
10.5 +<!-- vim: set tw=75 : -->
10.6 +
10.7 +<HTML>
10.8 +<head>
10.9 +<title>Metamod</title>
10.10 +</head>
10.11 +<body>
10.12 +
10.13 +<h1>Metamod
10.14 +</h1>
10.15 +
10.16 +<p>Metamod is a plugin/DLL manager that sits between the Half-Life Engine and
10.17 +an HL Game mod, allowing the dynamic loading/unloading of mod-like DLL
10.18 +plugins to add functionality to the HL server or game mod.
10.19 +
10.20 +<p>
10.21 +<hr>
10.22 +
10.23 +<p>
10.24 +See <a href="http://metamod.org/">metamod.org</a> for news, downloads,
10.25 +and plugin links.
10.26 +
10.27 +<p>
10.28 +<hr>
10.29 +<table cellspacing=20 width="100%">
10.30 +<tr valign=top>
10.31 +
10.32 +<td>
10.33 +<h2>Metamod Docs</h2>
10.34 +<ul>
10.35 +<li><a href="about.html">About metamod</a>
10.36 +<li><a href="faq.html">FAQ</a>
10.37 +<li><a href="metamod.html">Using metamod</a>
10.38 +<li><a href="release_notes.html">Release Notes</a>
10.39 +<li><a href="gamesupport.html">Game/Mod support</a>
10.40 +<li><a href="trace.html">Trace Plugin</a>
10.41 +<li><a href="wdmisc.html">WDMisc Plugin</a>
10.42 +<li><a href="coding.html">Coding for metamod</a>
10.43 +</ul>
10.44 +</td>
10.45 +
10.46 +<td>
10.47 +<h2>Other HLDS info</h2>
10.48 +<ul>
10.49 +<li><a href="dllapi_notes.html">SDK DLLAPI Notes</a>
10.50 +<li><a href="newapi_notes.html">SDK NEWAPI Notes</a>
10.51 +<li><a href="engine_notes.html">SDK Engine Notes</a>
10.52 +<p>
10.53 +<li><a href="links.html">Related links & books</a>
10.54 +<li><a href="maillist.html">Mailing lists</a>
10.55 +</ul>
10.56 +</td>
10.57 +
10.58 +</tr>
10.59 +</table>
10.60 +
10.61 +<p>
10.62 +<hr>
10.63 +<address><[email protected]></address>
10.64 +
10.65 +</body>
10.66 +
10.67 +</HTML>
10.68 +</HTML>
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
11.2 +++ b/doc/html/a.html Tue Apr 06 07:36:14 2004 +0000
11.3 @@ -0,0 +1,94 @@
11.4 +<!-- vi: set ts=4 sw=4 : -->
11.5 +<!-- vim: set tw=75 : -->
11.6 +
11.7 +<HTML>
11.8 +<head>
11.9 +<title>Metamod Supported Games</title>
11.10 +</head>
11.11 +<body>
11.12 +
11.13 +<a name=supported>
11.14 +<h1>Supported Games
11.15 +</h1>
11.16 +</a>
11.17 +
11.18 +Metamod includes support for the following mods, with version and last
11.19 +update if known.
11.20 +
11.21 +<p>
11.22 +To get support added for a new Mod, or for an updated version of a Mod, see
11.23 +<a href="gamesupport.html">Adding game support</a>.
11.24 +
11.25 +<p>
11.26 +<table border=5 rules=all cellpadding=5>
11.27 +<tr> <th>Name</th> <th>Version</th> <th>Last update</th> <th>Ent list</th> <th>Comments</th></tr>
11.28 +
11.29 +<tr><td><a href="http://ahl.action-web.net/">Action Half-Life</a></td><td>Beta 4</td><td>2001/06/14</td><td><a href="http://metamod.org/dl/metamod/ents/action">[ents]</a></td></tr>
11.30 +<tr><td><a href="-">Adrenalinegamer 3.x</a></td><td>-</td><td>2001/../..</td><td><a href="http://metamod.org/dl/metamod/ents/adgamer3">[ents]</a></td></tr>
11.31 +<tr><td><a href="-">Adrenalinegamer 4.x</a></td><td>v6.0</td><td>2002/10/06</td><td><a href="http://metamod.org/dl/metamod/ents/adgamer4">[ents]</a></td></tr>
11.32 +<tr><td><a href="-">Arg!</a></td><td>v1.0</td><td>2001/../..</td><td><a href="http://metamod.org/dl/metamod/ents/arg">[ents]</a></td></tr>
11.33 +<tr><td><a href="http://www.halflifeitalia.com/azuresheep/">Azure Sheep</a></td><td>v1.0</td><td>2002/11/26</td><td><a href="http://metamod.org/dl/metamod/ents/azuresheep">[ents]</a></td></tr>
11.34 +<tr><td><a href="http://www.bgmod.com/">The Battle Grounds</a></td><td>v1.2</td><td>2003/07/30</td><td><a href="http://metamod.org/dl/metamod/ents/battlegrounds">[ents]</a></td></tr>
11.35 +<tr><td><a href="-">Bot</a></td><td>-</td><td>2001/../..</td><td><a href="http://metamod.org/dl/metamod/ents/bot">[ents]</a></td></tr>
11.36 +<tr><td><a href="http://www.planethalflife.com/bumpercars/">Bumper Cars</a></td><td>Alpha</td><td>2003/05/02</td><td><a href="http://metamod.org/dl/metamod/ents/bumpercars">[ents]</a></td></tr>
11.37 +<tr><td><a href="http://www.buzzybots.dk/">BuzzyBots</a></td><td>v2.3</td><td>2002/11/26</td><td><a href="http://metamod.org/dl/metamod/ents/buzzybots">[ents]</a></td></tr>
11.38 +<tr><td><a href="http://www.counter-strike.net/">Counter-Strike</a></td><td>v1.6</td><td>2003/01/18</td><td><a href="http://metamod.org/dl/metamod/ents/cstrike">[ents]</a></td></tr>
11.39 +<tr><td><a href="http://www.desertcrisis.com/">Desert Crisis</a></td><td>v1.5</td><td>2003/04/09</td><td><a href="http://metamod.org/dl/metamod/ents/desertcrisis">[ents]</a></td></tr>
11.40 +<tr><td><a href="-">Deathmatch Classic</a></td><td>v1.0</td><td>2001/06/07</td><td><a href="http://metamod.org/dl/metamod/ents/dmc">[ents]</a></td></tr>
11.41 +<tr><td><a href="http://www.dayofdefeatmod.com/">Day of Defeat</a></td><td>v1.0</td><td>2003/05/03</td><td><a href="http://metamod.org/dl/metamod/ents/dod">[ents]</a></td></tr>
11.42 +<tr><td><a href="http://www.digitalpaintball.net/">Digital Paintball</a></td><td>v1.0</td><td>2002/10/06</td><td><a href="http://metamod.org/dl/metamod/ents/dpaintball">[ents]</a></td></tr>
11.43 +<tr><td><a href="http://dmz.flagrun.net/">Dragon Mod Z</a></td><td>v1.7</td><td>2002/10/06</td><td><a href="http://metamod.org/dl/metamod/ents/dragonmodz">[ents]</a></td></tr>
11.44 +<tr><td><a href="http://www.esforces.com/">Earth's Special Forces</a></td><td>Beta 1.1</td><td>2003/07/30</td><td><a href="http://metamod.org/dl/metamod/ents/esforces">[ents]</a></td></tr>
11.45 +<tr><td><a href="http://www.whatisexistence.com/">Existence</a></td><td>Beta 1.3</td><td>2001/09/19</td><td><a href="http://metamod.org/dl/metamod/ents/existence">[ents]</a></td></tr>
11.46 +<tr><td><a href="http://www.firearmsmod.com/">Firearms</a></td><td>v2.7</td><td>2003/03/24</td><td><a href="http://metamod.org/dl/metamod/ents/firearms">[ents]</a></td></tr>
11.47 +<tr><td><a href="http://www.firearms25mod.tk/">Retro Firearms</a></td><td>v2.5</td><td>2002/01/11</td><td><a href="http://metamod.org/dl/metamod/ents/retrofirearms">[ents]</a></td></tr>
11.48 +<tr><td><a href="-">Freeze</a></td><td>-</td><td>2001/../..</td><td><a href="http://metamod.org/dl/metamod/ents/freeze">[ents]</a></td></tr>
11.49 +<tr><td><a href="http://www.frontlineforce.com/">Frontline Force</a></td><td>v1.3</td><td>2001/06/10</td><td><a href="http://metamod.org/dl/metamod/ents/flf">[ents]</a></td></tr>
11.50 +<tr><td><a href="http://gangstawars.thebackburner.com/">GangstaWars</a></td><td>v2.6</td><td>2001/../..</td><td><a href="http://metamod.org/dl/metamod/ents/gangstawars">[ents]</a></td></tr>
11.51 +<tr><td><a href="http://www.gangwars.net/">Gangwars</a></td><td>Beta 1.0</td><td>2002/04/21</td><td><a href="http://metamod.org/dl/metamod/ents/gangwars">[ents]</a></td></tr>
11.52 +<tr><td><a href="http://www.sierrastudios.com/games/opposingforce/">Opposing Force</a></td><td>-</td><td>2001/../..</td><td><a href="http://metamod.org/dl/metamod/ents/opforce">[ents]</a></td></tr>
11.53 +<tr><td><a href="http://www.Globalwarfare.net/">Global Warfare</a></td><td>Beta 2.0</td><td>2002/11/26</td><td><a href="http://metamod.org/dl/metamod/ents/globalwarfare">[ents]</a></td></tr>
11.54 +<tr><td><a href="http://www.goldeneye-mod.net/">Goldeneye</a></td><td>v1.9C</td><td>2002/04/24</td><td><a href="http://metamod.org/dl/metamod/ents/goldeneye">[ents]</a></td></tr>
11.55 +<tr><td><a href="http://www.planethalflife.com/holywars/">Holy Wars</a></td><td>Beta 2</td><td>2002/10/06</td><td><a href="http://metamod.org/dl/metamod/ents/holywars">[ents]</a></td></tr>
11.56 +<tr><td><a href="http://www.planethalflife.com/ios/">International Online Soccer</a></td><td>v2.0</td><td>2003/07/30</td><td><a href="http://metamod.org/dl/metamod/ents/iosoccer">[ents]</a></td></tr>
11.57 +<tr><td><a href="http://justicedepartment.co.uk/">Judgement</a></td><td>v1.0</td><td>2001/05/26</td><td><a href="http://metamod.org/dl/metamod/ents/judgement">[ents]</a></td></tr>
11.58 +<tr><td><a href="http://www.monkeystrike.com/">Monkeystrike</a></td><td>v1.2</td><td>2003/07/30</td><td><a href="http://metamod.org/dl/metamod/ents/monkeystrike">[ents]</a></td></tr>
11.59 +<tr><td><a href="http://www.planethalflife.com/morbid/">Morbid Inclination</a></td><td>v1.0</td><td>2003/05/08</td><td><a href="http://metamod.org/dl/metamod/ents/morbid">[ents]</a></td></tr>
11.60 +<tr><td><a href="http://www.mastersword.flagrun.net">Master-Sword</a></td><td>v1.3</td><td>2003/07/30</td><td><a href="http://metamod.org/dl/metamod/ents/mastersword">[ents]</a></td></tr>
11.61 +<tr><td><a href="http://www.natural-selection.org/">Natural Selection</a></td><td>v2.0</td><td>2003/07/30</td><td><a href="http://metamod.org/dl/metamod/ents/naturalselection">[ents]</a></td></tr>
11.62 +<tr><td><a href="http://www.kixar.com/">OeL Half-Life</a></td><td>v4.0</td><td>2002/10/06</td><td><a href="http://metamod.org/dl/metamod/ents/oel">[ents]</a></td></tr>
11.63 +<tr><td><a href="http://www.planethalflife.com/outlawsmod/">Outlawsmod</a></td><td>Beta 1.5</td><td>2002/11/26</td><td><a href="http://metamod.org/dl/metamod/ents/outlaws">[ents]</a></td></tr>
11.64 +<tr><td><a href="http://www.eatsleepcode.ca/~osjb/">Open-Source Jailbreak</a></td><td>v0.95a</td><td>2001/05/26</td><td><a href="http://metamod.org/dl/metamod/ents/osjailbreak">[ents]</a></td></tr>
11.65 +<tr><td><a href="http://www.planethalflife.com/oz/">Oz Deathmatch</a></td><td>v2.4.1</td><td>2001/12/21</td><td><a href="http://metamod.org/dl/metamod/ents/oz">[ents]</a></td></tr>
11.66 +<tr><td><a href="http://www.paintball-mod.net/">Paintball</a></td><td>v2.0</td><td>2001/04/30</td><td><a href="http://metamod.org/dl/metamod/ents/paintball">[ents]</a></td></tr>
11.67 +<tr><td><a href="http://www.public-enemy.org/">Public Enemy</a></td><td>Beta 1.0</td><td>2003/05/02</td><td><a href="http://metamod.org/dl/metamod/ents/publicenemy">[ents]</a></td></tr>
11.68 +<tr><td><a href="-">Phineas Bot</a></td><td>-</td><td>2001/../..</td><td><a href="http://metamod.org/dl/metamod/ents/phineas">[ents]</a></td></tr>
11.69 +<tr><td><a href="http://ponr.half-life.hu/">Point of No Return</a></td><td>Beta 4.0</td><td>2003/08/01</td><td><a href="http://metamod.org/dl/metamod/ents/pointofnoreturn">[ents]</a></td></tr>
11.70 +<tr><td><a href="http://www.retro-cs.com/">Retro Counter-Strike</a></td><td>v2.5</td><td>2002/08/24</td><td><a href="http://metamod.org/dl/metamod/ents/retrocs">[ents]</a></td></tr>
11.71 +<tr><td><a href="http://www.gunmanchronicles.com/">Gunman Chronicles</a></td><td>-</td><td>2001/07/05</td><td><a href="http://metamod.org/dl/metamod/ents/gunman">[ents]</a></td></tr>
11.72 +<tr><td><a href="-">Ricochet</a></td><td>v1.0</td><td>2002/07/01</td><td><a href="http://metamod.org/dl/metamod/ents/ricochet">[ents]</a></td></tr>
11.73 +<tr><td><a href="http://www.planethalflife.com/rocketcrowbar/">Rocket Crowbar</a></td><td>v1.9</td><td>2002/11/26</td><td><a href="http://metamod.org/dl/metamod/ents/rocketcrowbar">[ents]</a></td></tr>
11.74 +<tr><td><a href="http://www.rivalspecies.com/">Rival Species</a></td><td>v1.0</td><td>2003/05/02</td><td><a href="http://metamod.org/dl/metamod/ents/rivalspecies">[ents]</a></td></tr>
11.75 +<tr><td><a href="http://www.telefragged.com/thefatal/scihunt.shtml">Scientist Hunt</a></td><td>v1.2</td><td>2001/09/19</td><td><a href="http://metamod.org/dl/metamod/ents/scihunt">[ents]</a></td></tr>
11.76 +<tr><td><a href="http://www.planethalflife.com/si/">Science & Industry</a></td><td>v0.97</td><td>2001/05/23</td><td><a href="http://metamod.org/dl/metamod/ents/si">[ents]</a></td></tr>
11.77 +<tr><td><a href="http://www.planethalflife.com/snowwar/">Snow-War</a></td><td>v1.0</td><td>2001/12/29</td><td><a href="http://metamod.org/dl/metamod/ents/snowwar">[ents]</a></td></tr>
11.78 +<tr><td><a href="http://www.stargatetc.com/">StargateTC</a></td><td>Beta 2.2</td><td>2002/11/26</td><td><a href="http://metamod.org/dl/metamod/ents/stargatetc">[ents]</a></td></tr>
11.79 +<tr><td><a href="http://www.svencoop.com/">Sven Coop</a></td><td>v2.1</td><td>2003/05/02</td><td><a href="http://metamod.org/dl/metamod/ents/svencoop">[ents]</a></td></tr>
11.80 +<tr><td><a href="http://swarm.edgegaming.com/">Swarm</a></td><td>-</td><td>2001/../..</td><td><a href="http://metamod.org/dl/metamod/ents/swarm">[ents]</a></td></tr>
11.81 +<tr><td><a href="http://sierrastudios.com/games/tf1.5/">Team Fortress Classic</a></td><td>v1.1.1.1</td><td>2003/01/18</td><td><a href="http://metamod.org/dl/metamod/ents/tfc">[ents]</a></td></tr>
11.82 +<tr><td><a href="http://planethalflife.com/thewastes/">The Wastes</a></td><td>RC 1.2</td><td>2003/07/30</td><td><a href="http://metamod.org/dl/metamod/ents/wastes">[ents]</a></td></tr>
11.83 +<tr><td><a href="http://www.tourofdutymod.com/">Tour of Duty</a></td><td>v1.1 Beta</td><td>2002/11/26</td><td><a href="http://metamod.org/dl/metamod/ents/tod">[ents]</a></td></tr>
11.84 +<tr><td><a href="http://th.fragoff.net/">Train Hunters</a></td><td>Beta 1.0</td><td>2002/04/29</td><td><a href="http://metamod.org/dl/metamod/ents/trainhunters">[ents]</a></td></tr>
11.85 +<tr><td><a href="http://www.specialistsmod.net/">The Specialists</a></td><td>Beta 2.0</td><td>2003/07/31</td><td><a href="http://metamod.org/dl/metamod/ents/specialists">[ents]</a></td></tr>
11.86 +<tr><td><a href="http://www.sierrastudios.com/games/half-life/bot.html">Half-Life Deathmatch</a></td><td>v1.1.0.6</td><td>2001/../..</td><td><a href="http://metamod.org/dl/metamod/ents/hldm">[ents]</a></td></tr>
11.87 +<tr><td><a href="http://www.planethalflife.com/vampire/">VampireSlayer</a></td><td>Chapter V</td><td>2003/02/08</td><td><a href="http://metamod.org/dl/metamod/ents/vampireslayer">[ents]</a></td></tr>
11.88 +<tr><td><a href="http://www.wantedhl.com/">Wanted!</a></td><td>v1.5</td><td>2001/07/11</td><td><a href="http://metamod.org/dl/metamod/ents/wanted">[ents]</a></td></tr>
11.89 +<tr><td><a href="http://wastelandhalflife.com/">Wasteland</a></td><td>Beta 2</td><td>2001/06/07</td><td><a href="http://metamod.org/dl/metamod/ents/wasteland">[ents]</a></td></tr>
11.90 +<tr><td><a href="http://wwars.hlcenter.com/">Weapon Wars</a></td><td>v0.3</td><td>2001/08/13</td><td><a href="http://metamod.org/dl/metamod/ents/weaponwars">[ents]</a></td></tr>
11.91 +<tr><td><a href="http://www.planethalflife.com/wizardwars/">Wizard Wars</a></td><td>v1.0</td><td>2001/07/30</td><td><a href="http://metamod.org/dl/metamod/ents/wizardwars">[ents]</a></td></tr>
11.92 +<tr><td><a href="http://www.wormshl.com/">WormsHL</a></td><td>Beta 3.0</td><td>2003/05/02</td><td><a href="http://metamod.org/dl/metamod/ents/wormshl">[ents]</a></td></tr>
11.93 +
11.94 +</table>
11.95 +</body>
11.96 +</HTML>
11.97 +
12.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
12.2 +++ b/doc/html/about.html Tue Apr 06 07:36:14 2004 +0000
12.3 @@ -0,0 +1,52 @@
12.4 +<!-- vi: set ts=4 sw=4 : -->
12.5 +<!-- vim: set tw=75 : -->
12.6 +
12.7 +<HTML>
12.8 +<head>
12.9 +<title>About Metamod</title>
12.10 +</head>
12.11 +<body>
12.12 +
12.13 +<h1>Metamod
12.14 +</h1>
12.15 +
12.16 +<h2>a Half-Life utility mod</h2>
12.17 +
12.18 +<pre>
12.19 + <b>meta</b> /me't*/ <i>or</i> /may't*/ <i>or</i> <i>(Commonwealth)</i> /mee't*/ <i>adj.,pref.</i>
12.20 + <i>[from analytic philosophy]</i> <b>One level of description up.</b>
12.21 +</pre>
12.22 +
12.23 +<p> The purpose of MetaMod is to function "one level up" from the normal
12.24 +Half-Life game mod DLL. Sitting between the mod game DLL and the Half-Life
12.25 +engine/binary, it intercepts the function calls between the two, with the
12.26 +option of passing them along untouched, as well as passing them on to as
12.27 +any number of <b><i>additional mod-like DLLs</i></b>.
12.28 +
12.29 +<p> Thus, you can actually have multiple "mod-like" DLLs in operation at
12.30 +one time. I say "mod-like" because these additional DLLs (we'll call them
12.31 +"plugins") are not intended to provide a full "game"; that functionality is
12.32 +still provided by the "game dll". However, these plugins can <b><i>add
12.33 +to</i></b> or <b><i>modify</i></b> the functionality provided by the game
12.34 +dll, or by the engine itself - for instance, adding new server commands, or
12.35 +new client commands, or even disabling commands built into the game dll.
12.36 +Although the plugin isn't intended to provide full HL-game functionality,
12.37 +since it's receiving the same information given to the game DLL, it has the
12.38 +opportunity to do <b><i>anything</i></b> the game DLL can do (given enough
12.39 +coding effort of course).
12.40 +
12.41 +<p> This is very similar to the way Alfred Reynolds'
12.42 +<a href="http://www.adminmod.org">AdminMod</a> works, as it also sits
12.43 +between the engine and game dll, catching routines, and passing them on.
12.44 +thus modifying functionality. However, rather than providing just the
12.45 +additional server features builtin to AdminMod DLL, MetaMod allows you to
12.46 +add features from multiple, separate DLLs. Under that framework, AdminMod
12.47 +can be a plugin itself, and be run alongside numerous other plugins. And,
12.48 +as of version 2.50 of AdminMod, AM has now transitioned to running as a
12.49 +Metamod plugin.
12.50 +
12.51 +<p>
12.52 +<hr>
12.53 +
12.54 +</body>
12.55 +</html>
13.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
13.2 +++ b/doc/html/coding.html Tue Apr 06 07:36:14 2004 +0000
13.3 @@ -0,0 +1,396 @@
13.4 +<!-- vi: set ts=4 sw=4 : -->
13.5 +<!-- vim: set tw=75 : -->
13.6 +
13.7 +<HTML>
13.8 +<head>
13.9 +<title>Coding for Metamod</title>
13.10 +</head>
13.11 +<body>
13.12 +
13.13 +<h1>Coding for Metamod
13.14 +</h1>
13.15 +
13.16 +<p><br>
13.17 +<a name=compiling>
13.18 +<h2>Compiling
13.19 +</h2></a>
13.20 +
13.21 +You'll need the Half-Life SDK, of course. In particular you'll need HL SDK
13.22 +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>,
13.23 +and a modified version of SDK 2.3 at <a href="http://metamod.org/files/sdk/">metmod.org/files/sdk</a>.
13.24 +
13.25 +<p><br>
13.26 +<a name=operation>
13.27 +<h2>Operation
13.28 +</h2></a>
13.29 +
13.30 +The basic operation is, for each api call:
13.31 +
13.32 +<ul>
13.33 + <li> iterate through list of plugins
13.34 + <li> for each plugin, if it provides this api call, then call the function
13.35 + in the plugin
13.36 + <li> call the "real" function (in the game dll, or from the engine)
13.37 + <li> for each plugin, check for a "post" version of the function, and call
13.38 + if present
13.39 +</ul>
13.40 +
13.41 +Also, for any api call, each plugin has the opportunity to replace the
13.42 +real routine, in two ways:
13.43 +
13.44 +<ul>
13.45 + <li> prevent the real routine from being called (<a
13.46 + href=#MRES_SUPERCEDE><tt><b>SUPERCEDE</b></tt></a>).
13.47 + <li> allow the real routine to be called, but change the value that's
13.48 + returned (<a href=#MRES_OVERRIDE><tt><b>OVERRIDE</b></tt></a>)
13.49 +</ul>
13.50 +
13.51 +Thus after each plugin is called, its <tt><b>META_RESULT</b></tt> flag is
13.52 +checked, and action taken appropriately. Note that supercede/override only
13.53 +affects the _real_ routine; other plugins will still be called.
13.54 +
13.55 +In addition to the <tt><b>SUPERCEDE</b></tt> and
13.56 +<tt><b>OVERRIDE</b></tt> flags, there are two additional flags a plugin can
13.57 +return:
13.58 +
13.59 +<ul>
13.60 + <li> <a href=#MRES_HANDLED><tt><b>HANDLED</b></tt></a> ("I did something here")
13.61 + <li> <a href=#MRES_IGNORED><tt><b>IGNORED</b></tt></a> ("I didn't really do anything")
13.62 +</ul>
13.63 +
13.64 +These aren't used by Metamod itself, but could be used by plugins to
13.65 +get an idea if a previous plugin did anything.
13.66 +
13.67 +<p> Note that each routine <b><i>needs</i></b> to set its
13.68 +<tt><b>META_RESULT</b></tt> value before returning. Plugin routines that
13.69 +do not set a value will be reported as errors in the logs.
13.70 +
13.71 +<p><br>
13.72 +<a name=requirements>
13.73 +<h2>Plugin coding requirements
13.74 +</h2></a>
13.75 +
13.76 +Plugins <i><b>must</b></i> provide the following standard HLSDK exported function:
13.77 +
13.78 +<p><pre>
13.79 + void GiveFnptrsToDll(enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals);
13.80 +</pre><p>
13.81 +
13.82 +<i><b>As well as</b></i> the following new functions:
13.83 +
13.84 +<p><pre>
13.85 + void Meta_Init(void); <i>(optional)</i>
13.86 + int Meta_Query(char *interfaceVersion, plugin_info_t **pinfo, mutil_funcs_t *pMetaUtilFuncs);
13.87 + int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs);
13.88 + int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason);
13.89 +</pre><p>
13.90 +
13.91 +Also, it must provide <i><b>at least</b></i> one function returning a standard HL
13.92 +function table, from either the following standard HLSDK functions:
13.93 +
13.94 +<p><pre>
13.95 + int GetEntityAPI( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion );
13.96 + int GetEntityAPI2( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion );
13.97 + int GetNewDLLFunctions( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion );
13.98 +</pre><p>
13.99 +
13.100 +or from the following new functions:
13.101 +
13.102 +<p><pre>
13.103 + int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion);
13.104 + int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion ;
13.105 + int GetNewDLLFunctions_Post(NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion);
13.106 +
13.107 + int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion);
13.108 + int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion);
13.109 +</pre><p>
13.110 +
13.111 +Thus, it needs to have (at least):
13.112 +<p><pre>
13.113 + GiveFnptrsToDll
13.114 + Meta_Query
13.115 + Meta_Attach
13.116 + Meta_Detach
13.117 + <tt><i><one or more Get function></i></tt>
13.118 +</pre><p>
13.119 +
13.120 +See the <tt>"<b>stub_plugin</b>"</tt> for an example of <b><i>bare
13.121 +minimum</i></b> code. See <tt>"<b>trace_plugin</b>"</tt> for an example of
13.122 +more complete functionality.
13.123 +
13.124 +<p>Also, if the plugin needs to use <tt><b>LINK_ENTITY_TO_CLASS</b></tt>,
13.125 +support for the particular entity(ies) has to be added explicitly to
13.126 +Metamod (<tt>linkfunc.cpp</tt>), just as it does for entities in game DLLs.
13.127 +
13.128 +<p><br>
13.129 +<a name=operation>
13.130 +<h2>Operation Details
13.131 +</h2></a>
13.132 +
13.133 +<p>These are the valid <tt>META_RESULT</tt> values a plugin routine can
13.134 +specify:
13.135 +
13.136 +<ul>
13.137 +<a name=MRES_IGNORED><p><li></a>
13.138 +<tt><b>MRES_IGNORED</b></tt>
13.139 + <br> The plugin did nothing. This could be used to tell a subsequent
13.140 + plugin that the some situation hasn't been handled yet. This would be
13.141 + recognized only by other plugins; Metamod itself doesn't do anything
13.142 + special for this situation. Unless otherwise specified by a later
13.143 + plugin, execution of routine in the gameDLL will take place. This is
13.144 + valid in both normal and post routines.
13.145 +<a name=MRES_HANDLED><p><li></a>
13.146 +<tt><b>MRES_HANDLED</b></tt>
13.147 + <br> The plugin handled the situation, or did something with the
13.148 + information. Again, this could be used to tell a subsequent plugin
13.149 + that some situation has already been taken care of, and is not
13.150 + recognized specially by Metamod. Unless otherwise specified by a later
13.151 + plugin, execution of routine in the gameDLL will take place. This is
13.152 + valid in both normal and post routines.
13.153 +<a name=MRES_OVERRIDE><p><li></a>
13.154 +<tt><b>MRES_OVERRIDE</b></tt>
13.155 + <br> The plugin is providing a return value for the routine, which
13.156 + should be used in place of the return value from the gameDLL's routine
13.157 + (the plugin "overrides" the gameDLL's return value).
13.158 + Unless otherwise specified by a later plugin, the gameDLL routine will
13.159 + still be called. Note this only makes sense for non-void routines.
13.160 + This is valid in both normal and post routines.
13.161 +<a name=MRES_SUPERCEDE><p><li></a>
13.162 +<tt><b>MRES_SUPERCEDE</b></tt>
13.163 + <br> The plugin has performed sufficient actions for the routine, and
13.164 + the gameDLL's routine should <i><b>not</b></i> be called (the plugin
13.165 + "supercedes" the gameDLL's routine, more or less replacing it
13.166 + entirely). Any return value for the routine should be specified as
13.167 + well by the plugin. Note this is only valid for normal routines, as
13.168 + post routines cannot prevent calling the gameDLL's routine (as it has
13.169 + already happened!). Also note, this doesn't prevent subsequent plugins
13.170 + from being called for this routine; it supercedes <b><i>only</i></b>
13.171 + the gameDLL.
13.172 +</ul>
13.173 +
13.174 +As the plugins are called, a running status is kept of the "highest" meta
13.175 +status so far, in the order (lowest to highets) shown above. After calling
13.176 +all the "normal" routines, the status is checked to see if the gameDLL's
13.177 +routine should be called - ie, it will not be called if one (or more) of
13.178 +the plugin's has specified <tt><b>META_SUPERCEDE</b></tt>. The gameDLL's
13.179 +routine is then called, or skipped, as appropriate. Then, all the "post"
13.180 +routines are called in the same manner (except
13.181 +<tt><b>META_SUPERCEDE</b></tt> is no longer a valid meta result).
13.182 +
13.183 +<p>Last, if any plugins specified <tt><b>META_OVERRIDE</b></tt> or
13.184 +<tt><b>META_SUPERCEDE</b></tt>, the return value given by the
13.185 +<b><i>last</i></b> such plugin is returned as the routine's return code to
13.186 +the engine (assuming a non-void routine). Thus, the order of the plugins
13.187 +as specified in the <tt>metamod.ini</tt> <b><i>does</i></b> have a possible
13.188 +effect.
13.189 +
13.190 +
13.191 +<p><br>
13.192 +<a name=macros>
13.193 +<h2>Available Macros
13.194 +</h2></a>
13.195 +
13.196 +The <a href="http://metamod.org/dl/metamod/meta_api.h"><tt>meta_api.h</tt></a>
13.197 +header that describes the Metamod API functions, types, and structures also
13.198 +includes several macros that can be of help when coding a plugin.
13.199 +
13.200 +<ul>
13.201 +<a name=SET_META_RESULT><p><li></a>
13.202 +<tt><b>SET_META_RESULT(result)</b></tt>
13.203 + <br> Sets the <tt>META_RESULT</tt> for the plugin.
13.204 +<a name=RETURN_META><p><li></a>
13.205 +<tt><b>RETURN_META(result)</b></tt>
13.206 + <br> Sets the <tt>META_RESULT</tt> for the plugin, and then calls
13.207 + <tt>return</tt>. This assumes a <tt>void</tt> function.
13.208 +<a name=RETURN_META_VALUE><p><li></a>
13.209 +<tt><b>RETURN_META_VALUE(result, value)</b></tt>
13.210 + <br> Sets the <tt>META_RESULT</tt> for the plugin, and then returns the
13.211 + given <tt>value</tt>. This assumes a non-<tt>void</tt> function, and
13.212 + it doesn't matter the particular type of the return value.
13.213 +<a name=META_RESULT_STATUS><p><li></a>
13.214 +<tt><b>META_RESULT_STATUS</b></tt>
13.215 + <br> Gives the current status of <tt>META_RESULT</tt> for this routine
13.216 + from plugins so far. It will return the "highest" result so far, in
13.217 + the order of lesser to greater: <tt>IGNORED</tt>, <tt>HANDLED</tt>,
13.218 + <tt>OVERRIDE</tt>, <tt>SUPERCEDE</tt> (see also above <a
13.219 + href=#operation><i>Operation Details</i></a>)
13.220 +<a name=META_RESULT_PREVIOUS><p><li></a>
13.221 +<tt><b>META_RESULT_PREVIOUS</b></tt>
13.222 + <br> Gives the <tt>META_RESULT</tt> of the previous plugin.
13.223 +<a name=META_RESULT_ORIG_RET><p><li></a>
13.224 +<tt><b>META_RESULT_ORIG_RET(type)</b></tt>
13.225 + <br> Gives the "original" return value for the routine, ie the return
13.226 + value of the routine from gameDLL. The type for the routine's return
13.227 + value must be specified in the macro; this is used as a cast for
13.228 + assignment. Note this is only valid in a "post" routine.
13.229 +<a name=META_RESULT_OVERRIDE_RET><p><li></a>
13.230 +<tt><b>META_RESULT_OVERRIDE_RET(type)</b></tt>
13.231 + <br> Gives the return value from any previous plugin that specified
13.232 + <tt><b>META_OVERRIDE</b></tt> or <tt><b>META_SUPERCEDE</b></tt>. The
13.233 + type for the routine's return value must be specified in the macro;
13.234 + this is used as a cast for assignment. This should only be used after
13.235 + checking the META_RESULT to see if there's actually an override value
13.236 + available.
13.237 +<a name=MDLL_><p><li></a>
13.238 +<tt><b>MDLL_<i>*</i>(<i>args</i>)</b></tt>
13.239 + <br> Calls a given DLLAPI routine in the gameDLL. For instance,
13.240 + <tt><b>MDLL_GameDLLInit(args)</b></tt>, <tt><b>MDLL_Spawn(args)</b></tt>,
13.241 + etc.
13.242 +<a name=MNEW_><p><li></a>
13.243 +<tt><b>MNEW_<i>*</i>(<i>args</i>)</b></tt>
13.244 + <br> Calls a given NEWAPI routine in the gameDLL. For instance,
13.245 + <tt><b>MNEW_GameShutdown(args)</b></tt>, etc.
13.246 +</ul>
13.247 +
13.248 +
13.249 +<p><br>
13.250 +<a name=utility>
13.251 +<h2>Utility Callback Functions
13.252 +</h2></a>
13.253 +
13.254 +In version 1.05, Metamod began providing a set of utility functions to
13.255 +plugins to centralize functionality, reduce code reuse, and to provide some
13.256 +convenience in plugin coding. Presently, only a few functions are
13.257 +provided. More are added as I find the time, and identify some advantage
13.258 +to having them (either for my own plugins, or by others' request for their
13.259 +plugins).
13.260 +
13.261 +<p> Note the <tt><b>PLID</b></tt> keyword passed to each function. This is
13.262 +basically a "plugin id" to indicate to Metamod which plugin is calling the
13.263 +function (else it's difficult to tell), and is a macro that should be
13.264 +specified verbatim with each call. (Currently, the macro is merely the
13.265 +plugin_info struct pointer returned by the plugin via <tt>Meta_Query</tt>;
13.266 +in the future this could change to some other identifier.)
13.267 +
13.268 +<ul>
13.269 +<a name=LOG_CONSOLE><p><li></a>
13.270 +<tt> void <b>LOG_CONSOLE(PLID, <i>char *fmt, ...</i>)</b></tt>
13.271 + <br> Print a message line on the console. Message is specified as a
13.272 + <tt>printf</tt> style format string and arguments. A trailing newline
13.273 + is provided by the routine and should not be specified in the string
13.274 + (unless you want two newlines).
13.275 +<a name=LOG_MESSAGE><p><li></a>
13.276 +<tt> void <b>LOG_MESSAGE(PLID, <i>char *fmt, ...</i>)</b></tt>
13.277 + <br> Print a message line in the server logs. Message is specified as a
13.278 + <tt>printf</tt> style format string and arguments. A trailing newline
13.279 + is provided by the routine and should not be specified in the string.
13.280 + Log message is prefixed by the <tt>logtag</tt> string in the plugin's
13.281 + "info" struct, surrounded by brackets. For instance:
13.282 + <p><tt>L 04/17/2001 - 18:00:35: [TraceAPI] Tracing Engine routine 'RegUserMsg'</tt>
13.283 +<a name=LOG_ERROR><p><li></a>
13.284 +<tt> void <b>LOG_ERROR(PLID, <i>char *fmt, ...</i>)</b></tt>
13.285 + <br> As in <tt>LOG_MESSAGE</tt> above, only marked as well with the
13.286 + string "ERROR:". For example:
13.287 + <p><tt>L 04/17/2001 - 18:03:13: [TraceAPI] ERROR: malloc failed</tt>
13.288 +<a name=LOG_DEVELOPER><p><li></a>
13.289 +<tt> void <b>LOG_DEVELOPER(PLID, <i>char *fmt, ...</i>)</b></tt>
13.290 + <br> As in <tt>LOG_MESSAGE</tt> above, only message will be logged only
13.291 + if cvar <tt>developer</tt> is set to 1; message is marked as well with
13.292 + the string "dev:". For example:
13.293 + <p><tt>L 04/17/2001 - 18:03:13: [TraceAPI] dev: called: GiveFnptrsToDll</tt>
13.294 +<a name=CENTER_SAY><p><li></a>
13.295 +<tt> void <b>CENTER_SAY(PLID, <i>char *fmt, ...</i>)</b></tt>
13.296 + <br> Prints a message on the center of all players' screens. This is
13.297 + like the "centersay" of AdminMod, with pretty_say enabled, with the
13.298 + same defaults (green, and a 10 second fade-in). A message is logged as
13.299 + well, ie: <i>[added in 1.06]</i>
13.300 + <p><tt>L 04/17/2001 - 15:44:52: [WDMISC] (centersay) random set up us the bomb!</tt>
13.301 +<a name=CENTER_SAY_PARMS><p><li></a>
13.302 +<tt> void <b>CENTER_SAY_PARMS(PLID, <i>hudtextparms_t tparms, char *fmt, ...</i>)</b></tt>
13.303 + <br> As in <tt>CENTER_SAY</tt> above, but allows specifying all the
13.304 + parameters. (see SDK <tt>dlls/util.h</tt> for the struct
13.305 + <tt>hudtextparms_t</tt>). <i>[added in 1.06]</i>
13.306 +<a name=CENTER_SAY_VARARGS><p><li></a>
13.307 +<tt> void <b>CENTER_SAY_VARARGS(PLID, <i>hudtextparms_t tparms, char *fmt, va_list ap</i>)</b></tt>
13.308 + <br> As in <tt>CENTER_SAY_PARMS</tt> above, only the message is passed
13.309 + as a <tt>vsnprintf</tt> style varargs format string and args list.
13.310 + This is included merely because both the previous CENTER_SAY functions
13.311 + actually call this, and it was convenient to include it as well.
13.312 + <i>[added in 1.06]</i>
13.313 +<a name=CALL_GAME_ENTITY><p><li></a>
13.314 +<tt> qboolean <b>CALL_GAME_ENTITY(PLID, <i>char *entStr, entvars_t *pev</i>)</b></tt>
13.315 + <br>Calls an entity function in the gameDLL. For instance, a bot usually
13.316 + needs to call the <tt><b>player</b></tt> entity function.
13.317 + <i>[added in 1.09]</i>
13.318 +<a name=GET_USER_MSG_ID><p><li></a>
13.319 +<tt> int <b>GET_USER_MSG_ID(PLID, <i>const char *name, int *size</i>)</b></tt>
13.320 + <br>Returns the id number corresponding to the given message name, of
13.321 + those messages registered by the gamedll with <a
13.322 + href="engine_notes.html#RegUserMsg">RegUserMsg</a>, optionally
13.323 + returning the registered size of the message as well. This is to
13.324 + allow things like bots to access the name/id mapping without having to
13.325 + catch RegUserMsg themselves, and thus have to be loaded at startup.
13.326 + <i>[added in 1.11]</i>
13.327 +<a name=GET_USER_MSG_NAME><p><li></a>
13.328 +<tt> const char * <b>GET_USER_MSG_NAME(PLID, <i>int msgid, int *size</i>)</b></tt>
13.329 + <br>Returns the name corresponding to the given msgid number, of those
13.330 + messages registered by the gamedll with <a
13.331 + href="engine_notes.html#RegUserMsg">RegUserMsg</a>, optionally
13.332 + returning the registered size of the message as well. It will return
13.333 + guess-names for any builtin Engine messages that it knows about
13.334 + (<tt>SVC_TEMPENTITY</tt>, etc). The returned string is presumed to be
13.335 + a compile-time constant string, stored in the text segment of the
13.336 + gamedll.
13.337 + <i>[added in 1.11]</i>
13.338 +<a name=GET_PLUGIN_PATH><p><li></a>
13.339 +<tt> const char * <b>GET_PLUGIN_PATH(PLID)</b></tt>
13.340 + <br>Returns the full pathname of the loaded dll/so file for the calling
13.341 + plugin. The returned string is a pointer to a static buffer, and should be
13.342 + copied by the caller to local storage.
13.343 + <i>[added in 1.12]</i>
13.344 +<a name=GET_GAME_INFO><p><li></a>
13.345 +<tt> const char * <b>GET_GAME_INFO(PLID, <i>ginfo_t type</i>)</b></tt>
13.346 + <br>Returns various string-based information about the running
13.347 + game/MOD/gamedll. The given <i>type</i> can be one of:
13.348 + <ul>
13.349 + <li><tt><b>GINFO_NAME</b></tt> - short name of game, from "-game" argument to hlds (ie "cstrike")
13.350 + <li><tt><b>GINFO_DESC</b></tt> - long name of game, from autodetection (ie "Counter-Strike")
13.351 + <li><tt><b>GINFO_GAMEDIR</b></tt> - game directory, full pathname (ie "/usr/local/half-life/cstrike")
13.352 + <li><tt><b>GINFO_DLL_FULLPATH</b></tt> - full pathname of the game dll (ie "/usr/local/half-life/cstrike/dlls/cs_i386.so")
13.353 + <li><tt><b>GINFO_DLL_FILENAME</b></tt> - bare filename of the gamedll (ie "cs_i386.so")
13.354 + </ul>
13.355 + The returned string is a pointer to a static buffer, and should be
13.356 + copied by the caller to local storage.
13.357 + <i>[added in 1.14]</i>
13.358 +</ul>
13.359 +
13.360 +<p><br>
13.361 +<a name=loading>
13.362 +<h2>Plugin Loading
13.363 +</h2></a>
13.364 +
13.365 +<i>(this is some rough notes I intend to fill in in the future)</i><p>
13.366 +
13.367 +Plugins are loaded when the engine calls <tt><b>GiveFnptrsToDll()</b></tt>.
13.368 +The config file is parsed, and for each valid plugin (uncommented, platform
13.369 +relevant), the operation is:
13.370 +
13.371 +<ul>
13.372 + <li> dlopen() the file, store the handle
13.373 + <li> dlsym() and call:
13.374 +<pre>
13.375 + Meta_Init (if present)
13.376 + GiveFnptrsToDll
13.377 + Meta_Query
13.378 + Meta_Attach
13.379 +</pre>
13.380 + <li> if present, call function pointers, and store resulting function table:
13.381 +<pre>
13.382 + GetEntityAPI
13.383 + GetEntityAPI2
13.384 + GetNewDLLFunctions
13.385 +
13.386 + GetEntityAPI_Post
13.387 + GetEntityAPI2_Post
13.388 + GetNewDLLFunctions_Post
13.389 +
13.390 + GetEngineFunctions
13.391 + GetEngineFunctions_Post
13.392 +</pre>
13.393 +</ul>
13.394 +
13.395 +<p>
13.396 +<hr>
13.397 +
13.398 +</body>
13.399 +</HTML>
14.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
14.2 +++ b/doc/html/dllapi_notes.html Tue Apr 06 07:36:14 2004 +0000
14.3 @@ -0,0 +1,569 @@
14.4 +<!-- vi: set ts=4 sw=4 : -->
14.5 +<!-- vim: set tw=75 : -->
14.6 +
14.7 +<HTML>
14.8 +<head>
14.9 +<title>HLSDK DLLAPI Notes</title>
14.10 +</head>
14.11 +<body>
14.12 +
14.13 +<h1>HLSDK DLLAPI Notes
14.14 +</h1>
14.15 +
14.16 +<hr>
14.17 +<ul>
14.18 + <li><a href=#GameDLLInit>GameDLLInit</a>
14.19 + <li><a href=#DispatchSpawn>DispatchSpawn</a>
14.20 + <li><a href=#DispatchThink>DispatchThink</a>
14.21 + <li><a href=#DispatchUse>DispatchUse</a>
14.22 + <li><a href=#DispatchTouch>DispatchTouch</a>
14.23 + <li><a href=#DispatchBlocked>DispatchBlocked</a>
14.24 + <li><a href=#DispatchKeyValue>DispatchKeyValue</a>
14.25 + <li><a href=#DispatchSave>DispatchSave</a>
14.26 + <li><a href=#DispatchRestore>DispatchRestore</a>
14.27 + <li><a href=#DispatchObjectCollsionBox>DispatchObjectCollsionBox</a>
14.28 + <li><a href=#SaveWriteFields>SaveWriteFields</a>
14.29 + <li><a href=#SaveReadFields>SaveReadFields</a>
14.30 + <li><a href=#SaveGlobalState>SaveGlobalState</a>
14.31 + <li><a href=#RestoreGlobalState>RestoreGlobalState</a>
14.32 + <li><a href=#ResetGlobalState>ResetGlobalState</a>
14.33 + <li><a href=#ClientConnect>ClientConnect</a>
14.34 + <li><a href=#ClientDisconnect>ClientDisconnect</a>
14.35 + <li><a href=#ClientKill>ClientKill</a>
14.36 + <li><a href=#ClientPutInServer>ClientPutInServer</a>
14.37 + <li><a href=#ClientCommand>ClientCommand</a>
14.38 + <li><a href=#ClientUserInfoChanged>ClientUserInfoChanged</a>
14.39 + <li><a href=#ServerActivate>ServerActivate</a>
14.40 + <li><a href=#ServerDeactivate>ServerDeactivate</a>
14.41 + <li><a href=#PlayerPreThink>PlayerPreThink</a>
14.42 + <li><a href=#PlayerPostThink>PlayerPostThink</a>
14.43 + <li><a href=#StartFrame>StartFrame</a>
14.44 + <li><a href=#ParmsNewLevel>ParmsNewLevel</a>
14.45 + <li><a href=#ParmsChangeLevel>ParmsChangeLevel</a>
14.46 + <li><a href=#GetGameDescription>GetGameDescription</a>
14.47 + <li><a href=#PlayerCustomization>PlayerCustomization</a>
14.48 + <li><a href=#SpectatorConnect>SpectatorConnect</a>
14.49 + <li><a href=#SpectatorDisconnect>SpectatorDisconnect</a>
14.50 + <li><a href=#SpectatorThink>SpectatorThink</a>
14.51 + <li><a href=#Sys_Error>Sys_Error</a>
14.52 + <li><a href=#PM_Move>PM_Move</a>
14.53 + <li><a href=#PM_Init>PM_Init</a>
14.54 + <li><a href=#PM_FindTextureType>PM_FindTextureType</a>
14.55 + <li><a href=#SetupVisibility>SetupVisibility</a>
14.56 + <li><a href=#UpdateClientData>UpdateClientData</a>
14.57 + <li><a href=#AddToFullPack>AddToFullPack</a>
14.58 + <li><a href=#CreateBaseline>CreateBaseline</a>
14.59 + <li><a href=#RegisterEncoders>RegisterEncoders</a>
14.60 + <li><a href=#GetWeaponData>GetWeaponData</a>
14.61 + <li><a href=#CmdStart>CmdStart</a>
14.62 + <li><a href=#CmdEnd>CmdEnd</a>
14.63 + <li><a href=#ConnectionlessPacket>ConnectionlessPacket</a>
14.64 + <li><a href=#GetHullBounds>GetHullBounds</a>
14.65 + <li><a href=#CreateInstancedBaselines>CreateInstancedBaselines</a>
14.66 + <li><a href=#InconsistentFile>InconsistentFile</a>
14.67 + <li><a href=#AllowLagCompensation>AllowLagCompensation</a>
14.68 +</ul>
14.69 +
14.70 +<hr><h3><tt><a name="GameDLLInit">GameDLLInit</a></tt></h3>
14.71 +<i>from dlls/game.cpp:</i><br>
14.72 +<dd><tt>void GameDLLInit(void);</tt><p>
14.73 +<blockquote><tt>
14.74 + Register your console variables here.<br>
14.75 + This gets called one time when the game is initialied.<br>
14.76 + Initialize the game (one-time call after loading of game .dll)<br>
14.77 +</tt></blockquote>
14.78 +<p><i>comments:</i><br>
14.79 +<blockquote>
14.80 + Called just after hlds reports "Dll loaded for mod Half-Life".
14.81 +</blockquote>
14.82 +
14.83 +<hr><h3><tt><a name="DispatchSpawn">DispatchSpawn</a></tt></h3>
14.84 +<i>from dlls/cbase.cpp</I>
14.85 +<dd><tt>int DispatchSpawn(edict_t *pent);</tt><p>
14.86 +<p><i>comments:</i><br>
14.87 +<blockquote>
14.88 + 0==Success, -1==Failure ?
14.89 +</blockquote>
14.90 +
14.91 +<hr><h3><tt><a name="DispatchThink">DispatchThink</a></tt></h3>
14.92 +<i>from dlls/cbase.cpp</i><br>
14.93 +<dd><tt>void DispatchThink(edict_t *pent);</tt><p>
14.94 +
14.95 +<hr><h3><tt><a name="DispatchUse">DispatchUse</a></tt></h3>
14.96 +<i>from dlls/cbase.cpp</i><br>
14.97 +<dd><tt>void DispatchUse(edict_t *pentUsed, edict_t *pentOther);</tt><p>
14.98 +
14.99 +<hr><h3><tt><a name="DispatchTouch">DispatchTouch</a></tt></h3>
14.100 +<i>from dlls/cbase.cpp</i><br>
14.101 +<dd><tt>void DispatchTouch(edict_t *pentTouched, edict_t *pentOther);</tt><p>
14.102 +
14.103 +<hr><h3><tt><a name="DispatchBlocked">DispatchBlocked</a></tt></h3>
14.104 +<i>from dlls/cbase.cpp</i><br>
14.105 +<dd><tt>void DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther);</tt><p>
14.106 +
14.107 +<hr><h3><tt><a name="DispatchKeyValue">DispatchKeyValue</a></tt></h3>
14.108 +<i>from dlls/cbase.cpp</i><br>
14.109 +<dd><tt>void DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd);</tt><p>
14.110 +
14.111 +<hr><h3><tt><a name="DispatchSave">DispatchSave</a></tt></h3>
14.112 +<i>from dlls/cbase.cpp</i><br>
14.113 +<dd><tt>void DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData);</tt><p>
14.114 +
14.115 +<hr><h3><tt><a name="DispatchRestore">DispatchRestore</a></tt></h3>
14.116 +<i>from dlls/cbase.cpp</i><br>
14.117 +<dd><tt>int DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity);</tt><p>
14.118 +<p><i>comments:</i><br>
14.119 +<blockquote>
14.120 + 0==Success, -1==Failure ?
14.121 +</blockquote>
14.122 +
14.123 +<hr><h3><tt><a name="DispatchObjectCollsionBox">DispatchObjectCollsionBox</a></tt></h3>
14.124 +<i>from dlls/cbase.cpp</i><br>
14.125 +<dd><tt>void DispatchObjectCollsionBox(edict_t *pent);</tt><p>
14.126 +
14.127 +<hr><h3><tt><a name="SaveWriteFields">SaveWriteFields</a></tt></h3>
14.128 +<i>from dlls/cbase.cpp</i><br>
14.129 +<dd><tt>void SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount);</tt><p>
14.130 +
14.131 +<hr><h3><tt><a name="SaveReadFields">SaveReadFields</a></tt></h3>
14.132 +<i>from dlls/cbase.cpp</i><br>
14.133 +<dd><tt>void SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount);</tt><p>
14.134 +
14.135 +<hr><h3><tt><a name="SaveGlobalState">SaveGlobalState</a></tt></h3>
14.136 +<i>from dlls/world.cpp</i><br>
14.137 +<dd><tt>void SaveGlobalState(SAVERESTOREDATA *pSaveData);</tt><p>
14.138 +
14.139 +<hr><h3><tt><a name="RestoreGlobalState">RestoreGlobalState</a></tt></h3>
14.140 +<i>from dlls/world.cpp</i><br>
14.141 +<dd><tt>void RestoreGlobalState(SAVERESTOREDATA *pSaveData);</tt><p>
14.142 +
14.143 +<hr><h3><tt><a name="ResetGlobalState">ResetGlobalState</a></tt></h3>
14.144 +<i>from dlls/world.cpp</i><br>
14.145 +<dd><tt>void ResetGlobalState(void);</tt><p>
14.146 +
14.147 +<hr><h3><tt><a name="ClientConnect">ClientConnect</a></tt></h3>
14.148 +<i>from dlls/client.cpp:</i><br>
14.149 +<dd><tt>BOOL ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[128]);</tt><p>
14.150 +<blockquote><tt>
14.151 + Called when a player connects to a server.
14.152 +</tt></blockquote>
14.153 +<p><i>comments:</i><br>
14.154 +<blockquote>
14.155 + Called on initial connect, just after hlds reports "connected", ie:
14.156 + <pre> <tt>"John<1><WON:9856723>" connected, address "127.0.0.1:27005"</tt></pre>
14.157 + This is before the user begins downloading, or anything else.
14.158 +</blockquote>
14.159 +
14.160 +<hr><h3><tt><a name="ClientDisconnect">ClientDisconnect</a></tt></h3>
14.161 +<i>from dlls/client.cpp:</i><br>
14.162 +<dd><tt>void ClientDisconnect(edict_t *pEntity);</tt><p>
14.163 +<blockquote><tt>
14.164 + Called when a player disconnects from a server.<br>
14.165 + GLOBALS ASSUMED SET: g_fGameOver
14.166 +</tt></blockquote>
14.167 +<p><i>comments:</i><br>
14.168 +<blockquote>
14.169 + This is not the opposite of <tt><b>ClientConnect</b></tt>, despite the similar name.
14.170 + It appears to only be called if the client was <tt><b>PutInServer</b></tt> first. If
14.171 + the client disconnects before being <tt><b>PutInServer</b></tt>, no API routine is
14.172 + called. This would be more appropriately named <tt><i><b>ClientRemoveFromServer</i></b></tt>.
14.173 +</blockquote>
14.174 +
14.175 +<hr><h3><tt><a name="ClientKill">ClientKill</a></tt></h3>
14.176 +<i>from dlls/client.cpp:</i><br>
14.177 +<dd><tt>void ClientKill(edict_t *pEntity);</tt><p>
14.178 +<blockquote><tt>
14.179 + Player entered the suicide command.<br>
14.180 + GLOBALS ASSUMED SET: g_ulModelIndexPlayer
14.181 +</tt></blockquote>
14.182 +<p><i>comments:</i><br>
14.183 +<blockquote>
14.184 + When the client typed "kill" in the console?
14.185 +</blockquote>
14.186 +
14.187 +<hr><h3><tt><a name="ClientPutInServer">ClientPutInServer</a></tt></h3>
14.188 +<i>from dlls/client.cpp:</i><br>
14.189 +<dd><tt>void ClientPutInServer(edict_t *pEntity);</tt><p>
14.190 +<blockquote><tt>
14.191 + Called each time a player is spawned.
14.192 +</tt></blockquote>
14.193 +<p><i>comments:</i><br>
14.194 +<blockquote>
14.195 + Called after the client has uploaded/download all necessary resources,
14.196 + just after hlds reports "entered the game", ie:
14.197 + <pre> "John<1>" has entered the game</pre>
14.198 +</blockquote>
14.199 +
14.200 +<hr><h3><tt><a name="ClientCommand">ClientCommand</a></tt></h3>
14.201 +<i>from dlls/client.cpp:</i><br>
14.202 +<dd><tt>void ClientCommand(edict_t *pEntity);</tt><p>
14.203 +<blockquote><tt>
14.204 + Called each time a player uses a "cmd" command.
14.205 + Use CMD_ARGS, CMD_ARGV, and CMD_ARGC to get pointers to the character
14.206 + string command.
14.207 +</tt></blockquote>
14.208 +
14.209 +<hr><h3><tt><a name="ClientUserInfoChanged">ClientUserInfoChanged</a></tt></h3>
14.210 +<i>from dlls/client.cpp:</i><br>
14.211 +<dd><tt>void ClientUserInfoChanged(edict_t *pEntity, char *infobuffer);</tt><p>
14.212 +<blockquote><tt>
14.213 + Called after the player changes userinfo - gives dll a chance to modify
14.214 + it before it gets sent into the rest of the engine.
14.215 +</tt></blockquote>
14.216 +<p><i>comments:</i><br>
14.217 +<blockquote>
14.218 + Called when user issues <tt>"<b>setinfo</b>"</tt> from the console. Also appears to be
14.219 + called whenever the user returns to the game from the ESC menu.
14.220 +</blockquote>
14.221 +
14.222 +<hr><h3><tt><a name="ServerActivate">ServerActivate</a></tt></h3>
14.223 +<i>from dlls/client.cpp:</i><br>
14.224 +<dd><tt>void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax);</tt><p>
14.225 +<blockquote><tt>
14.226 + Every call to ServerActivate should be matched by a call to
14.227 + ServerDeactivate.
14.228 +</tt></blockquote>
14.229 +<p><i>comments:</i><br>
14.230 +<blockquote>
14.231 + Added in SDK 2.0.
14.232 + Apparently called when the server has loaded the map, but before it
14.233 + precaches from the <tt><b>.res</b></tt> file.
14.234 +</blockquote>
14.235 +
14.236 +<hr><h3><tt><a name="ServerDeactivate">ServerDeactivate</a></tt></h3>
14.237 +<i>from dlls/client.cpp:</i><br>
14.238 +<dd><tt>void ServerDeactivate(void);</tt><p>
14.239 +<blockquote><tt>
14.240 + Peform any shutdown operations here.<br>
14.241 + It's possible that the engine will call this function more times than
14.242 + is necessary. Therefore, only run it one time for each call to
14.243 + ServerActivate.<br>
14.244 +</tt></blockquote>
14.245 +<p><i>comments:</i><br>
14.246 +<blockquote>
14.247 + Called upon <tt>"<b>quit</b>"</tt> or <tt>"<b>changelevel</b>"</tt> .
14.248 +</blockquote>
14.249 +
14.250 +<hr><h3><tt><a name="PlayerPreThink">PlayerPreThink</a></tt></h3>
14.251 +<i>from dlls/client.cpp:</i><br>
14.252 +<dd><tt>void PlayerPreThink(edict_t *pEntity);</tt><p>
14.253 +<blockquote><tt>
14.254 + Called every frame before physics are run.
14.255 +</tt></blockquote>
14.256 +
14.257 +<hr><h3><tt><a name="PlayerPostThink">PlayerPostThink</a></tt></h3>
14.258 +<i>from dlls/client.cpp:</i><br>
14.259 +<dd><tt>void PlayerPostThink(edict_t *pEntity);</tt><p>
14.260 +<blockquote><tt>
14.261 + Called every frame after physics are run.
14.262 +</tt></blockquote>
14.263 +
14.264 +<hr><h3><tt><a name="StartFrame">StartFrame</a></tt></h3>
14.265 +<i>from dlls/client.cpp:</i><br>
14.266 +<dd><tt>void StartFrame(void);</tt><p>
14.267 +<blockquote><tt>
14.268 + GLOBALS ASSUMED SET: g_ulFrameCount
14.269 +</tt></blockquote>
14.270 +
14.271 +<hr><h3><tt><a name="ParmsNewLevel">ParmsNewLevel</a></tt></h3>
14.272 +<i>from dlls/client.cpp</i><br>
14.273 +<dd><tt>void ParmsNewLevel(void);</tt><p>
14.274 +
14.275 +<hr><h3><tt><a name="ParmsChangeLevel">ParmsChangeLevel</a></tt></h3>
14.276 +<i>from dlls/client.cpp</i><br>
14.277 +<dd><tt>void ParmsChangeLevel(void);</tt><p>
14.278 +
14.279 +<hr><h3><tt><a name="GetGameDescription">GetGameDescription</a></tt></h3>
14.280 +<i>from dlls/client.cpp:</i><br>
14.281 +<dd><tt>const char *GetGameDescription(void);</tt><p>
14.282 +<blockquote><tt>
14.283 + Returns string describing current .dll game.<br>
14.284 + Returns the descriptive name of this .dll. E.g., Half-Life, or Team
14.285 + Fortress 2.<br>
14.286 + This function might be called before the world has spawned, and the game
14.287 + rules initialized.<br>
14.288 +</tt></blockquote>
14.289 +
14.290 +<hr><h3><tt><a name="PlayerCustomization">PlayerCustomization</a></tt></h3>
14.291 +<i>from dlls/client.cpp:</i><br>
14.292 +<dd><tt>void PlayerCustomization(edict_t *pEntity, customization_t *pCust);</tt><p>
14.293 +<blockquote><tt>
14.294 + Notifies .dll of new customization for player.<br>
14.295 + A new player customization has been registered on the server.
14.296 + UNDONE: This only sets the # of frames of the spray can logo animation
14.297 + right now.<br>
14.298 +</tt></blockquote>
14.299 +
14.300 +<hr><h3><tt><a name="SpectatorConnect">SpectatorConnect</a></tt></h3>
14.301 +<i>from dlls/client.cpp:</i><br>
14.302 +<dd><tt>void SpectatorConnect(edict_t *pEntity);</tt><p>
14.303 +<blockquote><tt>
14.304 + Called when spectator joins server.<br>
14.305 + A spectator has joined the game.<br>
14.306 +</tt></blockquote>
14.307 +
14.308 +<hr><h3><tt><a name="SpectatorDisconnect">SpectatorDisconnect</a></tt></h3>
14.309 +<i>from dlls/client.cpp:</i><br>
14.310 +<dd><tt>void SpectatorDisconnect(edict_t *pEntity);</tt><p>
14.311 +<blockquote><tt>
14.312 + Called when spectator leaves the server.<br>
14.313 + A spectator has left the game.<br>
14.314 +</tt></blockquote>
14.315 +
14.316 +<hr><h3><tt><a name="SpectatorThink">SpectatorThink</a></tt></h3>
14.317 +<i>from dlls/client.cpp:</i><br>
14.318 +<dd><tt>void SpectatorThink(edict_t *pEntity);</tt><p>
14.319 +<blockquote><tt>
14.320 + Called when spectator sends a command packet (usercmd_t).<br>
14.321 + A spectator has sent a usercmd.<br>
14.322 +</tt></blockquote>
14.323 +
14.324 +<hr><h3><tt><a name="Sys_Error">Sys_Error</a></tt></h3>
14.325 +<i>from dlls/client.cpp:</i><br>
14.326 +<dd><tt>void Sys_Error(const char *error_string);</tt><p>
14.327 +<blockquote><tt>
14.328 + Called when engine has encountered an error.<br>
14.329 + Notify game .dll that engine is going to shut down.<br>
14.330 + Engine is going to shut down, allows setting a breakpoint in game dll
14.331 + to catch that occasion.<br>
14.332 + Add code ( e.g., _asm { int 3 }; here to cause a breakpoint for
14.333 + debugging your game .dlls.<br>
14.334 +</tt></blockquote>
14.335 +<p><i>comments:</i><br>
14.336 +<blockquote>
14.337 + Added in SDK 2.0.
14.338 +</blockquote>
14.339 +
14.340 +<hr><h3><tt><a name="PM_Move">PM_Move</a></tt></h3>
14.341 +<i>from pm_shared/pm_shared.c:</i><br>
14.342 +<dd><tt>void PM_Move(struct playermove_s *ppmove, int server);</tt><p>
14.343 +<blockquote><tt>
14.344 + This modume implements the shared player physics code between
14.345 + any particular game and the engine. The same PM_Move routine is built
14.346 + into the game .dll and the client .dll and is invoked by each side as
14.347 + appropriate. There should be no distinction, internally, between server
14.348 + and client. This will ensure that prediction behaves appropriately.
14.349 +</tt></blockquote>
14.350 +<p><i>comments:</i><br>
14.351 +<blockquote>
14.352 + Added in SDK 2.0.
14.353 +</blockquote>
14.354 +
14.355 +<hr><h3><tt><a name="PM_Init">PM_Init</a></tt></h3>
14.356 +<i>from pm_shared/pm_shared.c:</i>
14.357 +<dd><tt>void PM_Init(struct playermove_s *ppmove);</tt><p>
14.358 +<blockquote><tt>
14.359 + Server version of player movement initialization.
14.360 +</tt></blockquote>
14.361 +<p><i>comments:</i><br>
14.362 +<blockquote>
14.363 + Added in SDK 2.0.
14.364 +</blockquote>
14.365 +
14.366 +<hr><h3><tt><a name="PM_FindTextureType">PM_FindTextureType</a></tt></h3>
14.367 +<i>from pm_shared/pm_shared.c</i><br>
14.368 +<dd><tt>char PM_FindTextureType(char *name);</tt><p>
14.369 +<p><i>comments:</i><br>
14.370 +<blockquote>
14.371 + Added in SDK 2.0.
14.372 +</blockquote>
14.373 +
14.374 +<hr><h3><tt><a name="SetupVisibility">SetupVisibility</a></tt></h3>
14.375 +<i>from dlls/client.cpp:</i><br>
14.376 +<dd><tt>void SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas);</tt><p>
14.377 +<i>from dlls/client.cpp:</i>
14.378 +<blockquote><tt>
14.379 + Set up PVS and PAS for networking for this client.
14.380 + <p>
14.381 + A client can have a separate "view entity" indicating
14.382 + that his/her view should depend on the origin of that view entity. If
14.383 + that's the case, then pViewEntity will be non-NULL and will be used.
14.384 + Otherwise, the current entity's origin is used. Either is offset by the
14.385 + view_ofs to get the eye position.
14.386 + <p>
14.387 + From the eye position, we set up the PAS and PVS to use for filtering
14.388 + network messages to the client. At this point, we could override the
14.389 + actual PAS or PVS values, or use a different origin.
14.390 + <p>
14.391 + NOTE: Do not cache the values of pas and pvs, as they depend on
14.392 + reusable memory in the engine, they are only good for this one frame
14.393 +</tt></blockquote>
14.394 +<p><i>comments:</i><br>
14.395 +<blockquote>
14.396 + Added in SDK 2.0.
14.397 +</blockquote>
14.398 +
14.399 +<hr><h3><tt><a name="UpdateClientData">UpdateClientData</a></tt></h3>
14.400 +<i>from dlls/client.cpp:</i><br>
14.401 +<dd><tt>void UpdateClientData (const struct edict_s *ent, int sendweapons, struct clientdata_s *cd);</tt><p>
14.402 +<blockquote><tt>
14.403 + Set up data sent only to specific client.<br>
14.404 + Data sent to current client only.<br>
14.405 + Engine sets argument 'cd' to 0 before calling.<br>
14.406 +</tt></blockquote>
14.407 +<p><i>comments:</i><br>
14.408 +<blockquote>
14.409 + Added in SDK 2.0.
14.410 +</blockquote>
14.411 +
14.412 +<hr><h3><tt><a name="AddToFullPack">AddToFullPack</a></tt></h3>
14.413 +<i>from dlls/client.cpp:</i><br>
14.414 +<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>
14.415 +<blockquote><tt>
14.416 + Return 1 if the entity state has been filled in for the ent and the
14.417 + entity will be propagated to the client, 0 otherwise.
14.418 + <p>
14.419 + State is the server maintained copy of the state info that is
14.420 + transmitted to the client. A MOD could alter values copied into state
14.421 + to send the "host" a different look for a particular entity update,
14.422 + etc.
14.423 + <p>
14.424 + Arguments 'e' and 'ent' are the entity that is being added to the
14.425 + update, if 1 is returneds. Host is the player's edict of the player
14.426 + whom we are sending the update to. Player is 1 if the ent/e is a
14.427 + player and 0 otherwise. Argument 'pSet' is either the PAS or PVS that
14.428 + we previous set up. We can use it to ask the engine to filter the
14.429 + entity against the PAS or PVS.
14.430 + <p>
14.431 + We could also use the pas/ pvs that we set in SetupVisibility, if we
14.432 + wanted to. Caching the value is valid in that case, but still only for
14.433 + the current frame.
14.434 +</tt></blockquote>
14.435 +<p><i>comments:</i><br>
14.436 +<blockquote>
14.437 + Added in SDK 2.0.
14.438 +</blockquote>
14.439 +
14.440 +<hr><h3><tt><a name="CreateBaseline">CreateBaseline</a></tt></h3>
14.441 +<i>from dlls/client.cpp:</i><br>
14.442 +<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>
14.443 +<blockquote><tt>
14.444 + Tweak entity baseline for network encoding, allows setup of player
14.445 + baselines, too.<br>
14.446 + Creates baselines used for network encoding, especially for player data
14.447 + since players are not spawned until connect time.<br>
14.448 +</tt></blockquote>
14.449 +<p><i>comments:</i><br>
14.450 +<blockquote>
14.451 + Added in SDK 2.0.
14.452 +</blockquote>
14.453 +
14.454 +<hr><h3><tt><a name="RegisterEncoders">RegisterEncoders</a></tt></h3>
14.455 +<i>from dlls/client.cpp:</i><br>
14.456 +<dd><tt>void RegisterEncoders(void);</tt><p>
14.457 +<blockquote><tt>
14.458 + Callbacks for network encoding.<br>
14.459 + Allows game .dll to override network encoding of certain types of
14.460 + entities and tweak values, etc.<br>
14.461 +</tt></blockquote>
14.462 +<p><i>comments:</i><br>
14.463 +<blockquote>
14.464 + Added in SDK 2.0.
14.465 +</blockquote>
14.466 +
14.467 +<hr><h3><tt><a name="GetWeaponData">GetWeaponData</a></tt></h3>
14.468 +<i>from dlls/client.cpp</i><br>
14.469 +<dd><tt>int GetWeaponData(struct edict_s *player, struct weapon_data_s *info);</tt><p>
14.470 +<p><i>comments:</i><br>
14.471 +<blockquote>
14.472 + Added in SDK 2.0.
14.473 +</blockquote>
14.474 +
14.475 +<hr><h3><tt><a name="CmdStart">CmdStart</a></tt></h3>
14.476 +<i>from dlls/client.cpp:</i><br>
14.477 +<dd><tt>void CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed);</tt><p>
14.478 +<blockquote><tt>
14.479 + We're about to run this usercmd for the specified player. We can set
14.480 + up groupinfo and masking here, etc. This is the time to examine the
14.481 + usercmd for anything extra. This call happens even if think does not.
14.482 +</tt></blockquote>
14.483 +<p><i>comments:</i><br>
14.484 +<blockquote>
14.485 + Added in SDK 2.0.
14.486 +</blockquote>
14.487 +
14.488 +<hr><h3><tt><a name="CmdEnd">CmdEnd</a></tt></h3>
14.489 +<i>from dlls/client.cpp:</i><br>
14.490 +<dd><tt>void CmdEnd (const edict_t *player);</tt><p>
14.491 +<blockquote><tt>
14.492 + Each cmdstart is exactly matched with a cmd end, clean up any
14.493 + group trace flags, etc. here.
14.494 +</tt></blockquote>
14.495 +<p><i>comments:</i><br>
14.496 +<blockquote>
14.497 + Added in SDK 2.0.
14.498 +</blockquote>
14.499 +
14.500 +<hr><h3><tt><a name="ConnectionlessPacket">ConnectionlessPacket</a></tt></h3>
14.501 +<i>from dlls/client.cpp:</i><br>
14.502 +<dd><tt>int ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size);</tt>
14.503 +<blockquote><tt>
14.504 + Return 1 if the packet is valid. Set response_buffer_size if you want
14.505 + to send a response packet. Incoming, it holds the max size of the
14.506 + response_buffer, so you must zero it out if you choose not to respond.
14.507 +</tt></blockquote>
14.508 +<p><i>comments:</i><br>
14.509 +<blockquote>
14.510 + Added in SDK 2.0.
14.511 +</blockquote>
14.512 +
14.513 +<hr><h3><tt><a name="GetHullBounds">GetHullBounds</a></tt></h3>
14.514 +<i>from dlls/client.cpp:</i><br>
14.515 +<dd><tt>int GetHullBounds(int hullnumber, float *mins, float *maxs);</tt><p>
14.516 +<blockquote><tt>
14.517 + Engine calls this to enumerate player collision hulls,
14.518 + for prediction. Return 0 if the hullnumber doesn't exist.
14.519 +</tt></blockquote>
14.520 +<p><i>comments:</i><br>
14.521 +<blockquote>
14.522 + Added in SDK 2.0.
14.523 +</blockquote>
14.524 +
14.525 +<hr><h3><tt><a name="CreateInstancedBaselines">CreateInstancedBaselines</a></tt></h3>
14.526 +<i>from dlls/client.cpp:</i><br>
14.527 +<dd><tt>void CreateInstancedBaselines (void);</tt><p>
14.528 +<blockquote><tt>
14.529 + Tweak entity baseline for network encoding, allows setup of player baselines, too.<br>
14.530 + Create pseudo-baselines for items that aren't placed in the map at
14.531 + spawn time, but which are likely to be created during play (e.g.,
14.532 + grenades, ammo packs, projectiles, corpses, etc.).<br>
14.533 +</tt></blockquote>
14.534 +<p><i>comments:</i><br>
14.535 +<blockquote>
14.536 + Added in SDK 2.0.
14.537 +</blockquote>
14.538 +
14.539 +<hr><h3><tt><a name="InconsistentFile">InconsistentFile</a></tt></h3>
14.540 +<i>from dlls/client.cpp:</i><br>
14.541 +<dd><tt>int InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message);</tt>
14.542 +<blockquote><tt>
14.543 + One of the ENGINE_FORCE_UNMODIFIED files failed the consistency check
14.544 + for the specified player Return 0 to allow the client to continue, 1 to
14.545 + force immediate disconnection (with an optional disconnect message of
14.546 + up to 256 characters).
14.547 +</tt></blockquote>
14.548 +<p><i>comments:</i><br>
14.549 +<blockquote>
14.550 + Added in SDK 2.0.
14.551 +</blockquote>
14.552 +
14.553 +<hr><h3><tt><a name="AllowLagCompensation">AllowLagCompensation</a></tt></h3>
14.554 +<i>from dlls/client.cpp:</i><br>
14.555 +<dd><tt>int AllowLagCompensation(void);</tt><p>
14.556 +<blockquote><tt>
14.557 + The game .dll should return 1 if lag compensation should be allowed
14.558 + (could also just set the sv_unlag cvar. Most games right now should
14.559 + return 0, until client-side weapon prediction code is written and
14.560 + tested for them (note you can predict weapons, but not do lag
14.561 + compensation, too, if you want.
14.562 +</tt></blockquote>
14.563 +<p><i>comments:</i><br>
14.564 +<blockquote>
14.565 + Added in SDK 2.0.
14.566 +</blockquote>
14.567 +
14.568 +<p>
14.569 +<hr>
14.570 +
14.571 +</body>
14.572 +</HTML>
15.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
15.2 +++ b/doc/html/engine_notes.html Tue Apr 06 07:36:14 2004 +0000
15.3 @@ -0,0 +1,1705 @@
15.4 +<!-- vi: set ts=4 sw=4 : -->
15.5 +<!-- vim: set tw=75 : -->
15.6 +
15.7 +<HTML>
15.8 +<head>
15.9 +<title>HLSDK Engine Notes</title>
15.10 +</head>
15.11 +<body>
15.12 +
15.13 +<h1>HLSDK Engine Notes
15.14 +</h1>
15.15 +
15.16 +<hr>
15.17 +<ul>
15.18 + <li><a href=#PrecacheModel>PrecacheModel</a>
15.19 + <li><a href=#PrecacheSound>PrecacheSound</a>
15.20 + <li><a href=#SetModel>SetModel</a>
15.21 + <li><a href=#ModelIndex>ModelIndex</a>
15.22 + <li><a href=#ModelFrames>ModelFrames</a>
15.23 + <li><a href=#SetSize>SetSize</a>
15.24 + <li><a href=#ChangeLevel>ChangeLevel</a>
15.25 + <li><a href=#GetSpawnParms>GetSpawnParms</a>
15.26 + <li><a href=#SaveSpawnParms>SaveSpawnParms</a>
15.27 + <li><a href=#VecToYaw>VecToYaw</a>
15.28 + <li><a href=#VecToAngles>VecToAngles</a>
15.29 + <li><a href=#MoveToOrigin>MoveToOrigin</a>
15.30 + <li><a href=#ChangeYaw>ChangeYaw</a>
15.31 + <li><a href=#ChangePitch>ChangePitch</a>
15.32 + <li><a href=#FindEntityByString>FindEntityByString</a>
15.33 + <li><a href=#GetEntityIllum>GetEntityIllum</a>
15.34 + <li><a href=#FindEntityInSphere>FindEntityInSphere</a>
15.35 + <li><a href=#FindClientInPVS>FindClientInPVS</a>
15.36 + <li><a href=#EntitiesInPVS>EntitiesInPVS</a>
15.37 + <li><a href=#MakeVectors>MakeVectors</a>
15.38 + <li><a href=#AngleVectors>AngleVectors</a>
15.39 + <li><a href=#CreateEntity>CreateEntity</a>
15.40 + <li><a href=#RemoveEntity>RemoveEntity</a>
15.41 + <li><a href=#CreateNamedEntity>CreateNamedEntity</a>
15.42 + <li><a href=#MakeStatic>MakeStatic</a>
15.43 + <li><a href=#EntIsOnFloor>EntIsOnFloor</a>
15.44 + <li><a href=#DropToFloor>DropToFloor</a>
15.45 + <li><a href=#WalkMove>WalkMove</a>
15.46 + <li><a href=#SetOrigin>SetOrigin</a>
15.47 + <li><a href=#EmitSound>EmitSound</a>
15.48 + <li><a href=#EmitAmbientSound>EmitAmbientSound</a>
15.49 + <li><a href=#TraceLine>TraceLine</a>
15.50 + <li><a href=#TraceToss>TraceToss</a>
15.51 + <li><a href=#TraceMonsterHull>TraceMonsterHull</a>
15.52 + <li><a href=#TraceHull>TraceHull</a>
15.53 + <li><a href=#TraceModel>TraceModel</a>
15.54 + <li><a href=#TraceTexture>TraceTexture</a>
15.55 + <li><a href=#TraceSphere>TraceSphere</a>
15.56 + <li><a href=#GetAimVector>GetAimVector</a>
15.57 + <li><a href=#ServerCommand>ServerCommand</a>
15.58 + <li><a href=#ServerExecute>ServerExecute</a>
15.59 + <li><a href=#ClientCommand>ClientCommand</a>
15.60 + <li><a href=#ParticleEffect>ParticleEffect</a>
15.61 + <li><a href=#LightStyle>LightStyle</a>
15.62 + <li><a href=#DecalIndex>DecalIndex</a>
15.63 + <li><a href=#PointContents>PointContents</a>
15.64 + <li><a href=#MessageBegin>MessageBegin</a>
15.65 + <li><a href=#MessageEnd>MessageEnd</a>
15.66 + <li><a href=#WriteByte>WriteByte</a>
15.67 + <li><a href=#WriteChar>WriteChar</a>
15.68 + <li><a href=#WriteShort>WriteShort</a>
15.69 + <li><a href=#WriteLong>WriteLong</a>
15.70 + <li><a href=#WriteAngle>WriteAngle</a>
15.71 + <li><a href=#WriteCoord>WriteCoord</a>
15.72 + <li><a href=#WriteString>WriteString</a>
15.73 + <li><a href=#WriteEntity>WriteEntity</a>
15.74 + <li><a href=#CVarRegister>CVarRegister</a>
15.75 + <li><a href=#CVarGetFloat>CVarGetFloat</a>
15.76 + <li><a href=#CVarGetString>CVarGetString</a>
15.77 + <li><a href=#CVarSetFloat>CVarSetFloat</a>
15.78 + <li><a href=#CVarSetString>CVarSetString</a>
15.79 + <li><a href=#AlertMessage>AlertMessage</a>
15.80 + <li><a href=#EngineFprintf>EngineFprintf</a>
15.81 + <li><a href=#PvAllocEntPrivateData>PvAllocEntPrivateData</a>
15.82 + <li><a href=#PvEntPrivateData>PvEntPrivateData</a>
15.83 + <li><a href=#FreeEntPrivateData>FreeEntPrivateData</a>
15.84 + <li><a href=#SzFromIndex>SzFromIndex</a>
15.85 + <li><a href=#AllocString>AllocString</a>
15.86 + <li><a href=#GetVarsOfEnt>GetVarsOfEnt</a>
15.87 + <li><a href=#PEntityOfEntOffset>PEntityOfEntOffset</a>
15.88 + <li><a href=#EntOffsetOfPEntity>EntOffsetOfPEntity</a>
15.89 + <li><a href=#IndexOfEdict>IndexOfEdict</a>
15.90 + <li><a href=#PEntityOfEntIndex>PEntityOfEntIndex</a>
15.91 + <li><a href=#FindEntityByVars>FindEntityByVars</a>
15.92 + <li><a href=#GetModelPtr>GetModelPtr</a>
15.93 + <li><a href=#RegUserMsg>RegUserMsg</a>
15.94 + <li><a href=#AnimationAutomove>AnimationAutomove</a>
15.95 + <li><a href=#GetBonePosition>GetBonePosition</a>
15.96 + <li><a href=#FunctionFromName>FunctionFromName</a>
15.97 + <li><a href=#NameForFunction>NameForFunction</a>
15.98 + <li><a href=#ClientPrintf>ClientPrintf</a>
15.99 + <li><a href=#ServerPrint>ServerPrint</a>
15.100 + <li><a href=#Cmd_Args>Cmd_Args</a>
15.101 + <li><a href=#Cmd_Argv>Cmd_Argv</a>
15.102 + <li><a href=#Cmd_Argc>Cmd_Argc</a>
15.103 + <li><a href=#GetAttachment>GetAttachment</a>
15.104 + <li><a href=#CRC32_Init>CRC32_Init</a>
15.105 + <li><a href=#CRC32_ProcessBuffer>CRC32_ProcessBuffer</a>
15.106 + <li><a href=#CRC32_ProcessByte>CRC32_ProcessByte</a>
15.107 + <li><a href=#CRC32_Final>CRC32_Final</a>
15.108 + <li><a href=#RandomLong>RandomLong</a>
15.109 + <li><a href=#RandomFloat>RandomFloat</a>
15.110 + <li><a href=#SetView>SetView</a>
15.111 + <li><a href=#Time>Time</a>
15.112 + <li><a href=#CrosshairAngle>CrosshairAngle</a>
15.113 + <li><a href=#LoadFileForMe>LoadFileForMe</a>
15.114 + <li><a href=#FreeFile>FreeFile</a>
15.115 + <li><a href=#EndSection>EndSection</a>
15.116 + <li><a href=#CompareFileTime>CompareFileTime</a>
15.117 + <li><a href=#GetGameDir>GetGameDir</a>
15.118 + <li><a href=#Cvar_RegisterVariable>Cvar_RegisterVariable</a>
15.119 + <li><a href=#FadeClientVolume>FadeClientVolume</a>
15.120 + <li><a href=#SetClientMaxspeed>SetClientMaxspeed</a>
15.121 + <li><a href=#CreateFakeClient>CreateFakeClient</a>
15.122 + <li><a href=#RunPlayerMove>RunPlayerMove</a>
15.123 + <li><a href=#NumberOfEntities>NumberOfEntities</a>
15.124 + <li><a href=#GetInfoKeyBuffer>GetInfoKeyBuffer</a>
15.125 + <li><a href=#InfoKeyValue>InfoKeyValue</a>
15.126 + <li><a href=#SetKeyValue>SetKeyValue</a>
15.127 + <li><a href=#SetClientKeyValue>SetClientKeyValue</a>
15.128 + <li><a href=#IsMapValid>IsMapValid</a>
15.129 + <li><a href=#StaticDecal>StaticDecal</a>
15.130 + <li><a href=#PrecacheGeneric>PrecacheGeneric</a>
15.131 + <li><a href=#GetPlayerUserId>GetPlayerUserId</a>
15.132 + <li><a href=#BuildSoundMsg>BuildSoundMsg</a>
15.133 + <li><a href=#IsDedicatedServer>IsDedicatedServer</a>
15.134 + <li><a href=#CVarGetPointer>CVarGetPointer</a>
15.135 + <li><a href=#GetPlayerWONId>GetPlayerWONId</a>
15.136 + <li><a href=#Info_RemoveKey>Info_RemoveKey</a>
15.137 + <li><a href=#GetPhysicsKeyValue>GetPhysicsKeyValue</a>
15.138 + <li><a href=#SetPhysicsKeyValue>SetPhysicsKeyValue</a>
15.139 + <li><a href=#GetPhysicsInfoString>GetPhysicsInfoString</a>
15.140 + <li><a href=#PrecacheEvent>PrecacheEvent</a>
15.141 + <li><a href=#PlaybackEvent>PlaybackEvent</a>
15.142 + <li><a href=#SetFatPVS>SetFatPVS</a>
15.143 + <li><a href=#SetFatPAS>SetFatPAS</a>
15.144 + <li><a href=#CheckVisibility>CheckVisibility</a>
15.145 + <li><a href=#DeltaSetField>DeltaSetField</a>
15.146 + <li><a href=#DeltaUnsetField>DeltaUnsetField</a>
15.147 + <li><a href=#DeltaAddEncoder>DeltaAddEncoder</a>
15.148 + <li><a href=#GetCurrentPlayer>GetCurrentPlayer</a>
15.149 + <li><a href=#CanSkipPlayer>CanSkipPlayer</a>
15.150 + <li><a href=#DeltaFindField>DeltaFindField</a>
15.151 + <li><a href=#DeltaSetFieldByIndex>DeltaSetFieldByIndex</a>
15.152 + <li><a href=#DeltaUnsetFieldByIndex>DeltaUnsetFieldByIndex</a>
15.153 + <li><a href=#SetGroupMask>SetGroupMask</a>
15.154 + <li><a href=#CreateInstancedBaseline>CreateInstancedBaseline</a>
15.155 + <li><a href=#Cvar_DirectSet>Cvar_DirectSet</a>
15.156 + <li><a href=#ForceUnmodified>ForceUnmodified</a>
15.157 + <li><a href=#GetPlayerStats>GetPlayerStats</a>
15.158 + <li><a href=#AddServerCommand>AddServerCommand</a>
15.159 + <li><a href=#Voice_GetClientListening>Voice_GetClientListening</a>
15.160 + <li><a href=#Voice_SetClientListening>Voice_SetClientListening</a>
15.161 + <li><a href=#GetPlayerAuthId>GetPlayerAuthId</a>
15.162 + <li><a href=#SequenceGet>SequenceGet</a>
15.163 + <li><a href=#SequencePickSentence>SequencePickSentence</a>
15.164 + <li><a href=#GetFileSize>GetFileSize</a>
15.165 + <li><a href=#GetApproxWavePlayLen>GetApproxWavePlayLen</a>
15.166 + <li><a href=#IsCareerMatch>IsCareerMatch</a>
15.167 + <li><a href=#GetLocalizedStringLength>GetLocalizedStringLength</a>
15.168 + <li><a href=#RegisterTutorMessageShown>RegisterTutorMessageShown</a>
15.169 + <li><a href=#GetTimesTutorMessageShown>GetTimesTutorMessageShown</a>
15.170 + <li><a href=#ProcessTutorMessageDecayBuffer>ProcessTutorMessageDecayBuffer</a>
15.171 + <li><a href=#ConstructTutorMessageDecayBuffer>ConstructTutorMessageDecayBuffer</a>
15.172 + <li><a href=#ResetTutorMessageDecayData>ResetTutorMessageDecayData</a>
15.173 +</ul>
15.174 +
15.175 +<hr><h3><tt><a name="PrecacheModel">PrecacheModel</a></tt></h3>
15.176 +<i>from engine/eiface.h:</i><br>
15.177 +<dd><tt>int PrecacheModel(char *s);</tt><br>
15.178 +<dd><tt>PRECACHE_MODEL()</tt>
15.179 +<p><i>comments:</i><br>
15.180 +<blockquote>
15.181 + .
15.182 +</blockquote>
15.183 +
15.184 +<hr><h3><tt><a name="PrecacheSound">PrecacheSound</a></tt></h3>
15.185 +<i>from engine/eiface.h:</i><br>
15.186 +<dd><tt>int PrecacheSound(char *s);</tt><br>
15.187 +<dd><tt>PRECACHE_SOUND()</tt>
15.188 +<p><i>comments:</i><br>
15.189 +<blockquote>
15.190 + .
15.191 +</blockquote>
15.192 +
15.193 +<hr><h3><tt><a name="SetModel">SetModel</a></tt></h3>
15.194 +<i>from engine/eiface.h:</i><br>
15.195 +<dd><tt>void SetModel(edict_t *e, const char *m);</tt><br>
15.196 +<dd><tt>SET_MODEL()</tt>
15.197 +<p><i>comments:</i><br>
15.198 +<blockquote>
15.199 + .
15.200 +</blockquote>
15.201 +
15.202 +<hr><h3><tt><a name="ModelIndex">ModelIndex</a></tt></h3>
15.203 +<i>from engine/eiface.h:</i><br>
15.204 +<dd><tt>int ModelIndex(const char *m);</tt><br>
15.205 +<dd><tt>MODEL_INDEX()</tt>
15.206 +<p><i>comments:</i><br>
15.207 +<blockquote>
15.208 + .
15.209 +</blockquote>
15.210 +
15.211 +<hr><h3><tt><a name="ModelFrames">ModelFrames</a></tt></h3>
15.212 +<i>from engine/eiface.h:</i><br>
15.213 +<dd><tt>int ModelFrames(int modelIndex);</tt><br>
15.214 +<dd><tt>MODEL_FRAMES()</tt>
15.215 +<p><i>comments:</i><br>
15.216 +<blockquote>
15.217 + .
15.218 +</blockquote>
15.219 +
15.220 +<hr><h3><tt><a name="SetSize">SetSize</a></tt></h3>
15.221 +<i>from engine/eiface.h:</i><br>
15.222 +<dd><tt>void SetSize(edict_t *e, const float *rgflMin, const float *rgflMax);</tt><br>
15.223 +<dd><tt>SET_SIZE()</tt>
15.224 +<p><i>comments:</i><br>
15.225 +<blockquote>
15.226 + .
15.227 +</blockquote>
15.228 +
15.229 +<hr><h3><tt><a name="ChangeLevel">ChangeLevel</a></tt></h3>
15.230 +<i>from engine/eiface.h:</i><br>
15.231 +<dd><tt>void ChangeLevel(char *s1, char *s2);</tt><br>
15.232 +<dd><tt>CHANGE_LEVEL()</tt>
15.233 +<p><i>comments:</i><br>
15.234 +<blockquote>
15.235 + .
15.236 +</blockquote>
15.237 +
15.238 +<hr><h3><tt><a name="GetSpawnParms">GetSpawnParms</a></tt></h3>
15.239 +<i>from engine/eiface.h:</i><br>
15.240 +<dd><tt>void GetSpawnParms(edict_t *ent);</tt><br>
15.241 +<dd><tt>GET_SPAWN_PARMS()</tt>
15.242 +<p><i>comments:</i><br>
15.243 +<blockquote>
15.244 + .
15.245 +</blockquote>
15.246 +
15.247 +<hr><h3><tt><a name="SaveSpawnParms">SaveSpawnParms</a></tt></h3>
15.248 +<i>from engine/eiface.h:</i><br>
15.249 +<dd><tt>void SaveSpawnParms(edict_t *ent);</tt><br>
15.250 +<dd><tt>SAVE_SPAWN_PARMS()</tt>
15.251 +<p><i>comments:</i><br>
15.252 +<blockquote>
15.253 + .
15.254 +</blockquote>
15.255 +
15.256 +<hr><h3><tt><a name="VecToYaw">VecToYaw</a></tt></h3>
15.257 +<i>from engine/eiface.h:</i><br>
15.258 +<dd><tt>float VecToYaw(const float *rgflVector);</tt><br>
15.259 +<dd><tt>VEC_TO_YAW()</tt>
15.260 +<p><i>comments:</i><br>
15.261 +<blockquote>
15.262 + .
15.263 +</blockquote>
15.264 +
15.265 +<hr><h3><tt><a name="VecToAngles">VecToAngles</a></tt></h3>
15.266 +<i>from engine/eiface.h:</i><br>
15.267 +<dd><tt>void VecToAngles(const float *rgflVectorIn, float *rgflVectorOut);</tt><br>
15.268 +<dd><tt>VEC_TO_ANGLES()</tt>
15.269 +<p><i>comments:</i><br>
15.270 +<blockquote>
15.271 + .
15.272 +</blockquote>
15.273 +
15.274 +<hr><h3><tt><a name="MoveToOrigin">MoveToOrigin</a></tt></h3>
15.275 +<i>from engine/eiface.h:</i><br>
15.276 +<dd><tt>void MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType);</tt><br>
15.277 +<dd><tt>MOVE_TO_ORIGIN()</tt>
15.278 +<p><i>comments:</i><br>
15.279 +<blockquote>
15.280 + .
15.281 +</blockquote>
15.282 +
15.283 +<hr><h3><tt><a name="ChangeYaw">ChangeYaw</a></tt></h3>
15.284 +<i>from engine/eiface.h:</i><br>
15.285 +<dd><tt>void ChangeYaw(edict_t *ent);</tt><br>
15.286 +<dd><tt>oldCHANGE_YAW()</tt>
15.287 +<p><i>comments:</i><br>
15.288 +<blockquote>
15.289 + .
15.290 +</blockquote>
15.291 +
15.292 +<hr><h3><tt><a name="ChangePitch">ChangePitch</a></tt></h3>
15.293 +<i>from engine/eiface.h:</i><br>
15.294 +<dd><tt>void ChangePitch(edict_t *ent);</tt><br>
15.295 +<dd><tt>CHANGE_PITCH()</tt>
15.296 +<p><i>comments:</i><br>
15.297 +<blockquote>
15.298 + .
15.299 +</blockquote>
15.300 +
15.301 +<hr><h3><tt><a name="FindEntityByString">FindEntityByString</a></tt></h3>
15.302 +<i>from engine/eiface.h:</i><br>
15.303 +<dd><tt>edict_t *FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue);</tt><br>
15.304 +<dd><tt>FIND_ENTITY_BY_STRING()</tt>
15.305 +<p><i>comments:</i><br>
15.306 +<blockquote>
15.307 + .
15.308 +</blockquote>
15.309 +
15.310 +<hr><h3><tt><a name="GetEntityIllum">GetEntityIllum</a></tt></h3>
15.311 +<i>from engine/eiface.h:</i><br>
15.312 +<dd><tt>int GetEntityIllum(edict_t *pEnt);</tt><br>
15.313 +<dd><tt>GETENTITYILLUM()</tt>
15.314 +<p><i>comments:</i><br>
15.315 +<blockquote>
15.316 + .
15.317 +</blockquote>
15.318 +
15.319 +<hr><h3><tt><a name="FindEntityInSphere">FindEntityInSphere</a></tt></h3>
15.320 +<i>from engine/eiface.h:</i><br>
15.321 +<dd><tt>edict_t *FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad);</tt><br>
15.322 +<dd><tt>FIND_ENTITY_IN_SPHERE()</tt>
15.323 +<p><i>comments:</i><br>
15.324 +<blockquote>
15.325 + .
15.326 +</blockquote>
15.327 +
15.328 +<hr><h3><tt><a name="FindClientInPVS">FindClientInPVS</a></tt></h3>
15.329 +<i>from engine/eiface.h:</i><br>
15.330 +<dd><tt>edict_t *FindClientInPVS(edict_t *pEdict);</tt><br>
15.331 +<dd><tt>FIND_ENTITY_IN_PVS()</tt>
15.332 +<p><i>comments:</i><br>
15.333 +<blockquote>
15.334 + .
15.335 +</blockquote>
15.336 +
15.337 +<hr><h3><tt><a name="EntitiesInPVS">EntitiesInPVS</a></tt></h3>
15.338 +<i>from engine/eiface.h:</i><br>
15.339 +<dd><tt>edict_t *EntitiesInPVS(edict_t *pplayer);</tt>
15.340 +<p><i>comments:</i><br>
15.341 +<blockquote>
15.342 + .
15.343 +</blockquote>
15.344 +
15.345 +<hr><h3><tt><a name="MakeVectors">MakeVectors</a></tt></h3>
15.346 +<i>from engine/eiface.h:</i><br>
15.347 +<dd><tt>void MakeVectors(const float *rgflVector);</tt><br>
15.348 +<dd><tt>MAKE_VECTORS()</tt>
15.349 +<p><i>comments:</i><br>
15.350 +<blockquote>
15.351 + .
15.352 +</blockquote>
15.353 +
15.354 +<hr><h3><tt><a name="AngleVectors">AngleVectors</a></tt></h3>
15.355 +<i>from engine/eiface.h:</i><br>
15.356 +<dd><tt>void AngleVectors(const float *rgflVector, float *forward, float *right, float *up);</tt>
15.357 +<p><i>comments:</i><br>
15.358 +<blockquote>
15.359 + .
15.360 +</blockquote>
15.361 +
15.362 +<hr><h3><tt><a name="CreateEntity">CreateEntity</a></tt></h3>
15.363 +<i>from engine/eiface.h:</i><br>
15.364 +<dd><tt>edict_t *CreateEntity(void);</tt><br>
15.365 +<dd><tt>CREATE_ENTITY()</tt>
15.366 +<p><i>comments:</i><br>
15.367 +<blockquote>
15.368 + .
15.369 +</blockquote>
15.370 +
15.371 +<hr><h3><tt><a name="RemoveEntity">RemoveEntity</a></tt></h3>
15.372 +<i>from engine/eiface.h:</i><br>
15.373 +<dd><tt>void RemoveEntity(edict_t *e);</tt><br>
15.374 +<dd><tt>REMOVE_ENTITY()</tt>
15.375 +<p><i>comments:</i><br>
15.376 +<blockquote>
15.377 + .
15.378 +</blockquote>
15.379 +
15.380 +<hr><h3><tt><a name="CreateNamedEntity">CreateNamedEntity</a></tt></h3>
15.381 +<i>from engine/eiface.h:</i><br>
15.382 +<dd><tt>edict_t *CreateNamedEntity(int className);</tt><br>
15.383 +<dd><tt>CREATE_NAMED_ENTITY()</tt>
15.384 +<p><i>comments:</i><br>
15.385 +<blockquote>
15.386 + .
15.387 +</blockquote>
15.388 +
15.389 +<hr><h3><tt><a name="MakeStatic">MakeStatic</a></tt></h3>
15.390 +<i>from engine/eiface.h:</i><br>
15.391 +<dd><tt>void MakeStatic(edict_t *ent);</tt><br>
15.392 +<dd><tt>MAKE_STATIC()</tt>
15.393 +<p><i>comments:</i><br>
15.394 +<blockquote>
15.395 + .
15.396 +</blockquote>
15.397 +
15.398 +<hr><h3><tt><a name="EntIsOnFloor">EntIsOnFloor</a></tt></h3>
15.399 +<i>from engine/eiface.h:</i><br>
15.400 +<dd><tt>int EntIsOnFloor(edict_t *e);</tt><br>
15.401 +<dd><tt>ENT_IS_ON_FLOOR()</tt>
15.402 +<p><i>comments:</i><br>
15.403 +<blockquote>
15.404 + .
15.405 +</blockquote>
15.406 +
15.407 +<hr><h3><tt><a name="DropToFloor">DropToFloor</a></tt></h3>
15.408 +<i>from engine/eiface.h:</i><br>
15.409 +<dd><tt>int DropToFloor(edict_t *e);</tt><br>
15.410 +<dd><tt>DROP_TO_FLOOR()</tt>
15.411 +<p><i>comments:</i><br>
15.412 +<blockquote>
15.413 + .
15.414 +</blockquote>
15.415 +
15.416 +<hr><h3><tt><a name="WalkMove">WalkMove</a></tt></h3>
15.417 +<i>from engine/eiface.h:</i><br>
15.418 +<dd><tt>int WalkMove(edict_t *ent, float yaw, float dist, int iMode);</tt><br>
15.419 +<dd><tt>WALK_MOVE()</tt>
15.420 +<p><i>comments:</i><br>
15.421 +<blockquote>
15.422 + .
15.423 +</blockquote>
15.424 +
15.425 +<hr><h3><tt><a name="SetOrigin">SetOrigin</a></tt></h3>
15.426 +<i>from engine/eiface.h:</i><br>
15.427 +<dd><tt>void SetOrigin(edict_t *e, const float *rgflOrigin);</tt><br>
15.428 +<dd><tt>SET_ORIGIN()</tt>
15.429 +<p><i>comments:</i><br>
15.430 +<blockquote>
15.431 + .
15.432 +</blockquote>
15.433 +
15.434 +<hr><h3><tt><a name="EmitSound">EmitSound</a></tt></h3>
15.435 +<i>from engine/eiface.h:</i><br>
15.436 +<dd><tt>void EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch);</tt><br>
15.437 +<dd><tt>EMIT_SOUND_DYN2()</tt>
15.438 +<p><i>comments:</i><br>
15.439 +<blockquote>
15.440 + .
15.441 +</blockquote>
15.442 +
15.443 +<hr><h3><tt><a name="EmitAmbientSound">EmitAmbientSound</a></tt></h3>
15.444 +<i>from engine/eiface.h:</i><br>
15.445 +<dd><tt>void EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch);</tt><br>
15.446 +<dd><tt>EMIT_AMBIENT_SOUND()</tt>
15.447 +<p><i>comments:</i><br>
15.448 +<blockquote>
15.449 + .
15.450 +</blockquote>
15.451 +
15.452 +<hr><h3><tt><a name="TraceLine">TraceLine</a></tt></h3>
15.453 +<i>from engine/eiface.h:</i><br>
15.454 +<dd><tt>void TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr);</tt><br>
15.455 +<dd><tt>TRACE_LINE()</tt>
15.456 +<p><i>comments:</i><br>
15.457 +<blockquote>
15.458 + .
15.459 +</blockquote>
15.460 +
15.461 +<hr><h3><tt><a name="TraceToss">TraceToss</a></tt></h3>
15.462 +<i>from engine/eiface.h:</i><br>
15.463 +<dd><tt>void TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr);</tt><br>
15.464 +<dd><tt>TRACE_TOSS()</tt>
15.465 +<p><i>comments:</i><br>
15.466 +<blockquote>
15.467 + .
15.468 +</blockquote>
15.469 +
15.470 +<hr><h3><tt><a name="TraceMonsterHull">TraceMonsterHull</a></tt></h3>
15.471 +<i>from engine/eiface.h:</i><br>
15.472 +<dd><tt>int TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr);</tt><br>
15.473 +<dd><tt>TRACE_MONSTER_HULL()</tt>
15.474 +<p><i>comments:</i><br>
15.475 +<blockquote>
15.476 + .
15.477 +</blockquote>
15.478 +
15.479 +<hr><h3><tt><a name="TraceHull">TraceHull</a></tt></h3>
15.480 +<i>from engine/eiface.h:</i><br>
15.481 +<dd><tt>void TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr);</tt><br>
15.482 +<dd><tt>TRACE_HULL()</tt>
15.483 +<p><i>comments:</i><br>
15.484 +<blockquote>
15.485 + .
15.486 +</blockquote>
15.487 +
15.488 +<hr><h3><tt><a name="TraceModel">TraceModel</a></tt></h3>
15.489 +<i>from engine/eiface.h:</i><br>
15.490 +<dd><tt>void TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr);</tt>
15.491 +<p><i>comments:</i><br>
15.492 +<blockquote>
15.493 + .
15.494 +</blockquote>
15.495 +
15.496 +<hr><h3><tt><a name="TraceTexture">TraceTexture</a></tt></h3>
15.497 +<i>from engine/eiface.h:</i><br>
15.498 +<dd><tt>const char *TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2);</tt><br>
15.499 +<dd><tt>TRACE_TEXTURE()</tt>
15.500 +<p><i>comments:</i><br>
15.501 +<blockquote>
15.502 + .
15.503 +</blockquote>
15.504 +
15.505 +<hr><h3><tt><a name="TraceSphere">TraceSphere</a></tt></h3>
15.506 +<i>from engine/eiface.h:</i><br>
15.507 +<dd><tt>void TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr);</tt>
15.508 +<p><i>comments:</i><br>
15.509 +<blockquote>
15.510 + .
15.511 +</blockquote>
15.512 +
15.513 +<hr><h3><tt><a name="GetAimVector">GetAimVector</a></tt></h3>
15.514 +<i>from engine/eiface.h:</i><br>
15.515 +<dd><tt>void GetAimVector(edict_t *ent, float speed, float *rgflReturn);</tt><br>
15.516 +<dd><tt>GET_AIM_VECTOR()</tt>
15.517 +<p><i>comments:</i><br>
15.518 +<blockquote>
15.519 + .
15.520 +</blockquote>
15.521 +
15.522 +<hr><h3><tt><a name="ServerCommand">ServerCommand</a></tt></h3>
15.523 +<i>from engine/eiface.h:</i><br>
15.524 +<dd><tt>void ServerCommand(char *str);</tt><br>
15.525 +<dd><tt>SERVER_COMMAND()</tt>
15.526 +<p><i>comments:</i><br>
15.527 +<blockquote>
15.528 + Executes a server command, as if typed at the console (ie "exec
15.529 + myconfig.cfg", or "quit"). Note that it appears no commands are
15.530 + executed until <b>after</b> GameDLLInit is called. If
15.531 + ServerCommand is called earlier than that, the command is delayed until
15.532 + then.
15.533 +</blockquote>
15.534 +
15.535 +<hr><h3><tt><a name="ServerExecute">ServerExecute</a></tt></h3>
15.536 +<i>from engine/eiface.h:</i><br>
15.537 +<dd><tt>void ServerExecute(void);</tt><br>
15.538 +<dd><tt>SERVER_EXECUTE()</tt>
15.539 +<p><i>comments:</i><br>
15.540 +<blockquote>
15.541 + .
15.542 +</blockquote>
15.543 +
15.544 +<hr><h3><tt><a name="ClientCommand">ClientCommand</a></tt></h3>
15.545 +<i>from engine/eiface.h:</i><br>
15.546 +<dd><tt>void ClientCommand(edict_t *pEdict, char *szFmt, ...);</tt><br>
15.547 +<dd><tt>CLIENT_COMMAND()</tt>
15.548 +<p><i>comments:</i><br>
15.549 +<blockquote>
15.550 + .
15.551 +</blockquote>
15.552 +
15.553 +<hr><h3><tt><a name="ParticleEffect">ParticleEffect</a></tt></h3>
15.554 +<i>from engine/eiface.h:</i><br>
15.555 +<dd><tt>void ParticleEffect(const float *org, const float *dir, float color, float count);</tt><br>
15.556 +<dd><tt>PARTICLE_EFFECT()</tt>
15.557 +<p><i>comments:</i><br>
15.558 +<blockquote>
15.559 + .
15.560 +</blockquote>
15.561 +
15.562 +<hr><h3><tt><a name="LightStyle">LightStyle</a></tt></h3>
15.563 +<i>from engine/eiface.h:</i><br>
15.564 +<dd><tt>void LightStyle(int style, char *val);</tt><br>
15.565 +<dd><tt>LIGHT_STYLE()</tt>
15.566 +<p><i>comments:</i><br>
15.567 +<blockquote>
15.568 + .
15.569 +</blockquote>
15.570 +
15.571 +<hr><h3><tt><a name="DecalIndex">DecalIndex</a></tt></h3>
15.572 +<i>from engine/eiface.h:</i><br>
15.573 +<dd><tt>int DecalIndex(const char *name);</tt><br>
15.574 +<dd><tt>DECAL_INDEX()</tt>
15.575 +<p><i>comments:</i><br>
15.576 +<blockquote>
15.577 + .
15.578 +</blockquote>
15.579 +
15.580 +<hr><h3><tt><a name="PointContents">PointContents</a></tt></h3>
15.581 +<i>from engine/eiface.h:</i><br>
15.582 +<dd><tt>int PointContents(const float *rgflVector);</tt><br>
15.583 +<dd><tt>POINT_CONTENTS()</tt>
15.584 +<p><i>comments:</i><br>
15.585 +<blockquote>
15.586 + .
15.587 +</blockquote>
15.588 +
15.589 +<hr><h3><tt><a name="MessageBegin">MessageBegin</a></tt></h3>
15.590 +<i>from engine/eiface.h:</i><br>
15.591 +<dd><tt>void MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed);</tt><br>
15.592 +<dd><tt>MESSAGE_BEGIN()</tt>
15.593 +<p><i>comments:</i><br>
15.594 +<blockquote>
15.595 + Begin a network message to send to the client.
15.596 + <br><b><tt>msg_type</tt></b> should be a number returned by <a
15.597 + href="#RegUserMsg">RegUserMsg</a>.
15.598 + <br><b><tt>msg_dest</tt></b> is one of:
15.599 + <ul>
15.600 + <li> <b><tt>MSG_BROADCAST</tt></b> - "unreliable to all"
15.601 + <li> <b><tt>MSG_ONE</tt></b> - "reliable to one (msg_entity)"
15.602 + <li> <b><tt>MSG_ALL</tt></b> - "reliable to all"
15.603 + <li> <b><tt>MSG_INIT</tt></b> - "write to the init string"
15.604 + <li> <b><tt>MSG_PVS</tt></b> - "Ents in PVS of org" (PVS=potentially visible set)
15.605 + <li> <b><tt>MSG_PAS</tt></b> - "Ents in PAS of org" (PAS=potentially audible set)
15.606 + <li> <b><tt>MSG_PVS_R</tt></b> - "Reliable to PVS"
15.607 + <li> <b><tt>MSG_PAS_R</tt></b> - "Reliable to PAS"
15.608 + <li> <b><tt>MSG_ONE_UNRELIABLE</tt></b> - "Send to one client, but don't put in reliable stream, put in unreliable datagram (could be dropped)"
15.609 + </ul>
15.610 +</blockquote>
15.611 +
15.612 +<hr><h3><tt><a name="MessageEnd">MessageEnd</a></tt></h3>
15.613 +<i>from engine/eiface.h:</i><br>
15.614 +<dd><tt>void MessageEnd(void);</tt><br>
15.615 +<dd><tt>MESSAGE_END()</tt>
15.616 +<p><i>comments:</i><br>
15.617 +<blockquote>
15.618 + .
15.619 +</blockquote>
15.620 +
15.621 +<hr><h3><tt><a name="WriteByte">WriteByte</a></tt></h3>
15.622 +<i>from engine/eiface.h:</i><br>
15.623 +<dd><tt>void WriteByte(int iValue);</tt><br>
15.624 +<dd><tt>WRITE_BYTE()</tt>
15.625 +<p><i>comments:</i><br>
15.626 +<blockquote>
15.627 + .
15.628 +</blockquote>
15.629 +
15.630 +<hr><h3><tt><a name="WriteChar">WriteChar</a></tt></h3>
15.631 +<i>from engine/eiface.h:</i><br>
15.632 +<dd><tt>void WriteChar(int iValue);</tt><br>
15.633 +<dd><tt>WRITE_CHAR()</tt>
15.634 +<p><i>comments:</i><br>
15.635 +<blockquote>
15.636 + .
15.637 +</blockquote>
15.638 +
15.639 +<hr><h3><tt><a name="WriteShort">WriteShort</a></tt></h3>
15.640 +<i>from engine/eiface.h:</i><br>
15.641 +<dd><tt>void WriteShort(int iValue);</tt><br>
15.642 +<dd><tt>WRITE_SHORT()</tt>
15.643 +<p><i>comments:</i><br>
15.644 +<blockquote>
15.645 + .
15.646 +</blockquote>
15.647 +
15.648 +<hr><h3><tt><a name="WriteLong">WriteLong</a></tt></h3>
15.649 +<i>from engine/eiface.h:</i><br>
15.650 +<dd><tt>void WriteLong(int iValue);</tt><br>
15.651 +<dd><tt>WRITE_LONG()</tt>
15.652 +<p><i>comments:</i><br>
15.653 +<blockquote>
15.654 + .
15.655 +</blockquote>
15.656 +
15.657 +<hr><h3><tt><a name="WriteAngle">WriteAngle</a></tt></h3>
15.658 +<i>from engine/eiface.h:</i><br>
15.659 +<dd><tt>void WriteAngle(float flValue);</tt><br>
15.660 +<dd><tt>WRITE_ANGLE()</tt>
15.661 +<p><i>comments:</i><br>
15.662 +<blockquote>
15.663 + .
15.664 +</blockquote>
15.665 +
15.666 +<hr><h3><tt><a name="WriteCoord">WriteCoord</a></tt></h3>
15.667 +<i>from engine/eiface.h:</i><br>
15.668 +<dd><tt>void WriteCoord(float flValue);</tt><br>
15.669 +<dd><tt>WRITE_COORD()</tt>
15.670 +<p><i>comments:</i><br>
15.671 +<blockquote>
15.672 + .
15.673 +</blockquote>
15.674 +
15.675 +<hr><h3><tt><a name="WriteString">WriteString</a></tt></h3>
15.676 +<i>from engine/eiface.h:</i><br>
15.677 +<dd><tt>void WriteString(const char *sz);</tt><br>
15.678 +<dd><tt>WRITE_STRING()</tt>
15.679 +<p><i>comments:</i><br>
15.680 +<blockquote>
15.681 + .
15.682 +</blockquote>
15.683 +
15.684 +<hr><h3><tt><a name="WriteEntity">WriteEntity</a></tt></h3>
15.685 +<i>from engine/eiface.h:</i><br>
15.686 +<dd><tt>void WriteEntity(int iValue);</tt><br>
15.687 +<dd><tt>WRITE_ENTITY()</tt>
15.688 +<p><i>comments:</i><br>
15.689 +<blockquote>
15.690 + .
15.691 +</blockquote>
15.692 +
15.693 +<hr><h3><tt><a name="CVarRegister">CVarRegister</a></tt></h3>
15.694 +<i>from engine/eiface.h:</i><br>
15.695 +<dd><tt>void CVarRegister(cvar_t *pCvar);</tt><br>
15.696 +<dd><tt>CVAR_REGISTER()</tt>
15.697 +<p><i>comments:</i><br>
15.698 +<blockquote>
15.699 + Register a new cvar (server variable).
15.700 +</blockquote>
15.701 +
15.702 +<hr><h3><tt><a name="CVarGetFloat">CVarGetFloat</a></tt></h3>
15.703 +<i>from engine/eiface.h:</i><br>
15.704 +<dd><tt>float CVarGetFloat(const char *szVarName);</tt><br>
15.705 +<dd><tt>CVAR_GET_FLOAT()</tt>
15.706 +<p><i>comments:</i><br>
15.707 +<blockquote>
15.708 + Return the float value of a cvar.
15.709 +</blockquote>
15.710 +
15.711 +<hr><h3><tt><a name="CVarGetString">CVarGetString</a></tt></h3>
15.712 +<i>from engine/eiface.h:</i><br>
15.713 +<dd><tt>const char *CVarGetString(const char *szVarName);</tt><br>
15.714 +<dd><tt>CVAR_GET_STRING()</tt>
15.715 +<p><i>comments:</i><br>
15.716 +<blockquote>
15.717 + Return the string value of a cvar.
15.718 +</blockquote>
15.719 +
15.720 +<hr><h3><tt><a name="CVarSetFloat">CVarSetFloat</a></tt></h3>
15.721 +<i>from engine/eiface.h:</i><br>
15.722 +<dd><tt>void CVarSetFloat(const char *szVarName, float flValue);</tt><br>
15.723 +<dd><tt>CVAR_SET_FLOAT()</tt>
15.724 +<p><i>comments:</i><br>
15.725 +<blockquote>
15.726 + Set the float value of a cvar.
15.727 +</blockquote>
15.728 +
15.729 +<hr><h3><tt><a name="CVarSetString">CVarSetString</a></tt></h3>
15.730 +<i>from engine/eiface.h:</i><br>
15.731 +<dd><tt>void CVarSetString(const char *szVarName, const char *szValue);</tt><br>
15.732 +<dd><tt>CVAR_SET_STRING()</tt>
15.733 +<p><i>comments:</i><br>
15.734 +<blockquote>
15.735 + Set the string value of a cvar.
15.736 +</blockquote>
15.737 +
15.738 +<hr><h3><tt><a name="AlertMessage">AlertMessage</a></tt></h3>
15.739 +<i>from engine/eiface.h:</i><br>
15.740 +<dd><tt>void AlertMessage(ALERT_TYPE atype, char *szFmt, ...);</tt><br>
15.741 +<dd><tt>ALERT()</tt>
15.742 +<p><i>comments:</i><br>
15.743 +<blockquote>
15.744 + Print an alert message.
15.745 + <br><b><tt>atype</tt></b> is one of:
15.746 + <ul>
15.747 + <li> <b><tt>at_notice</tt></b>
15.748 + <li> <b><tt>at_console</tt></b> - "same as at_notice, but forces a ConPrintf, not a message box". Prints output to server console, but only shown if 'developer' is set.
15.749 + <li> <b><tt>at_aiconsole</tt></b> - "same as at_console, but only shown if developer level is 2!"
15.750 + <li> <b><tt>at_warning</tt></b>
15.751 + <li> <b><tt>at_error</tt></b>
15.752 + <li> <b><tt>at_logged</tt></b> - "Server print to console (only in multiplayer games)." Prints output to server logs and console.
15.753 + </ul>
15.754 +</blockquote>
15.755 +
15.756 +<hr><h3><tt><a name="EngineFprintf">EngineFprintf</a></tt></h3>
15.757 +<i>from engine/eiface.h:</i><br>
15.758 +<dd><tt>void EngineFprintf(FILE *pfile, char *szFmt, ...);</tt><br>
15.759 +<dd><tt>ENGINE_FPRINTF()</tt>
15.760 +<p><i>comments:</i><br>
15.761 +<blockquote>
15.762 + .
15.763 +</blockquote>
15.764 +
15.765 +<hr><h3><tt><a name="PvAllocEntPrivateData">PvAllocEntPrivateData</a></tt></h3>
15.766 +<i>from engine/eiface.h:</i><br>
15.767 +<dd><tt>void *PvAllocEntPrivateData(edict_t *pEdict, long cb);</tt><br>
15.768 +<dd><tt>ALLOC_PRIVATE()</tt>
15.769 +<p><i>comments:</i><br>
15.770 +<blockquote>
15.771 + .
15.772 +</blockquote>
15.773 +
15.774 +<hr><h3><tt><a name="PvEntPrivateData">PvEntPrivateData</a></tt></h3>
15.775 +<i>from engine/eiface.h:</i><br>
15.776 +<dd><tt>void *PvEntPrivateData(edict_t *pEdict);</tt><br>
15.777 +<dd><tt>GET_PRIVATE()</tt>
15.778 +<p><i>comments:</i><br>
15.779 +<blockquote>
15.780 + Returns a pointer to the base class type of the given edict. For
15.781 + instance:
15.782 + <pre>
15.783 + CBaseEntity *pPlayer=(CBaseEntity *)GET_PRIVATE(pEntity);
15.784 + </pre>
15.785 +</blockquote>
15.786 +
15.787 +<hr><h3><tt><a name="FreeEntPrivateData">FreeEntPrivateData</a></tt></h3>
15.788 +<i>from engine/eiface.h:</i><br>
15.789 +<dd><tt>void FreeEntPrivateData(edict_t *pEdict);</tt><br>
15.790 +<dd><tt>FREE_PRIVATE()</tt>
15.791 +<p><i>comments:</i><br>
15.792 +<blockquote>
15.793 + .
15.794 +</blockquote>
15.795 +
15.796 +<hr><h3><tt><a name="SzFromIndex">SzFromIndex</a></tt></h3>
15.797 +<i>from engine/eiface.h:</i><br>
15.798 +<dd><tt>const char *SzFromIndex(int iString);</tt>
15.799 +<p><i>comments:</i><br>
15.800 +<blockquote>
15.801 + .
15.802 +</blockquote>
15.803 +
15.804 +<hr><h3><tt><a name="AllocString">AllocString</a></tt></h3>
15.805 +<i>from engine/eiface.h:</i><br>
15.806 +<dd><tt>int AllocString(const char *szValue);</tt><br>
15.807 +<dd><tt>ALLOC_STRING()</tt>
15.808 +<p><i>comments:</i><br>
15.809 +<blockquote>
15.810 + .
15.811 +</blockquote>
15.812 +
15.813 +<hr><h3><tt><a name="GetVarsOfEnt">GetVarsOfEnt</a></tt></h3>
15.814 +<i>from engine/eiface.h:</i><br>
15.815 +<dd><tt>struct entvars_s *GetVarsOfEnt(edict_t *pEdict);</tt>
15.816 +<p><i>comments:</i><br>
15.817 +<blockquote>
15.818 + .
15.819 +</blockquote>
15.820 +
15.821 +<hr><h3><tt><a name="PEntityOfEntOffset">PEntityOfEntOffset</a></tt></h3>
15.822 +<i>from engine/eiface.h:</i><br>
15.823 +<dd><tt>edict_t *PEntityOfEntOffset(int iEntOffset);</tt><br>
15.824 +<dd><tt>ENT()</tt>
15.825 +<p><i>comments:</i><br>
15.826 +<blockquote>
15.827 + .
15.828 +</blockquote>
15.829 +
15.830 +<hr><h3><tt><a name="EntOffsetOfPEntity">EntOffsetOfPEntity</a></tt></h3>
15.831 +<i>from engine/eiface.h:</i><br>
15.832 +<dd><tt>int EntOffsetOfPEntity(const edict_t *pEdict);</tt>
15.833 +<p><i>comments:</i><br>
15.834 +<blockquote>
15.835 + .
15.836 +</blockquote>
15.837 +
15.838 +<hr><h3><tt><a name="IndexOfEdict">IndexOfEdict</a></tt></h3>
15.839 +<i>from engine/eiface.h:</i><br>
15.840 +<dd><tt>int IndexOfEdict(const edict_t *pEdict);</tt><br>
15.841 +<dd><tt>ENTINDEX()</tt>
15.842 +<p><i>comments:</i><br>
15.843 +<blockquote>
15.844 + Returns the server slot (ie 1 to maxplayers) of the given player edict.
15.845 +</blockquote>
15.846 +
15.847 +<hr><h3><tt><a name="PEntityOfEntIndex">PEntityOfEntIndex</a></tt></h3>
15.848 +<i>from engine/eiface.h:</i><br>
15.849 +<dd><tt>edict_t *PEntityOfEntIndex(int iEntIndex);</tt><br>
15.850 +<dd><tt>INDEXENT()</tt>
15.851 +<p><i>comments:</i><br>
15.852 +<blockquote>
15.853 + Returns the edict for the player in the given server slot (ie 1 to
15.854 + maxplayers).
15.855 +</blockquote>
15.856 +
15.857 +<hr><h3><tt><a name="FindEntityByVars">FindEntityByVars</a></tt></h3>
15.858 +<i>from engine/eiface.h:</i><br>
15.859 +<dd><tt>edict_t *FindEntityByVars(struct entvars_s *pvars);</tt>
15.860 +<p><i>comments:</i><br>
15.861 +<blockquote>
15.862 + .
15.863 +</blockquote>
15.864 +
15.865 +<hr><h3><tt><a name="GetModelPtr">GetModelPtr</a></tt></h3>
15.866 +<i>from engine/eiface.h:</i><br>
15.867 +<dd><tt>void *GetModelPtr(edict_t *pEdict);</tt><br>
15.868 +<dd><tt>GET_MODEL_PTR()</tt>
15.869 +<p><i>comments:</i><br>
15.870 +<blockquote>
15.871 + .
15.872 +</blockquote>
15.873 +
15.874 +<hr><h3><tt><a name="RegUserMsg">RegUserMsg</a></tt></h3>
15.875 +<i>from engine/eiface.h:</i><br>
15.876 +<dd><tt>int RegUserMsg(const char *pszName, int iSize);</tt><br>
15.877 +<dd><tt>REG_USER_MSG()</tt>
15.878 +<p><i>comments:</i><br>
15.879 +<blockquote>
15.880 + Register a network message type with the given name, and size if known.
15.881 + Returns the number assigned for the network message, to be used with <a
15.882 + href="#MessageBegin">MessageBegin</a>. It appears that message
15.883 + ID's 1-63 are reserved for the Engine, and that GameDLL messages are
15.884 + allocated IDs starting at 64. The SDK <tt>dlls/util.h</tt> appears to
15.885 + define six Engine messages:
15.886 + <ul>
15.887 + <li> <tt>SVC_TEMPENTITY = 23</tt>
15.888 + <li> <tt>SVC_INTERMISSION = 30</tt>
15.889 + <li> <tt>SVC_CDTRACK = 32</tt>
15.890 + <li> <tt>SVC_WEAPONANIM = 35</tt>
15.891 + <li> <tt>SVC_ROOMTYPE = 37</tt>
15.892 + <li> <tt>SVC_HLTV = 50</tt>
15.893 + </ul>
15.894 +</blockquote>
15.895 +
15.896 +<hr><h3><tt><a name="AnimationAutomove">AnimationAutomove</a></tt></h3>
15.897 +<i>from engine/eiface.h:</i><br>
15.898 +<dd><tt>void AnimationAutomove(const edict_t *pEdict, float flTime);</tt>
15.899 +<p><i>comments:</i><br>
15.900 +<blockquote>
15.901 + .
15.902 +</blockquote>
15.903 +
15.904 +<hr><h3><tt><a name="GetBonePosition">GetBonePosition</a></tt></h3>
15.905 +<i>from engine/eiface.h:</i><br>
15.906 +<dd><tt>void GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles);</tt><br>
15.907 +<dd><tt>GET_BONE_POSITION()</tt>
15.908 +<p><i>comments:</i><br>
15.909 +<blockquote>
15.910 + .
15.911 +</blockquote>
15.912 +
15.913 +<hr><h3><tt><a name="FunctionFromName">FunctionFromName</a></tt></h3>
15.914 +<i>from engine/eiface.h:</i><br>
15.915 +<dd><tt>unsigned long FunctionFromName(const char *pName);</tt><br>
15.916 +<dd><tt>FUNCTION_FROM_NAME()</tt>
15.917 +<p><i>comments:</i><br>
15.918 +<blockquote>
15.919 + Apparently, this finds the given exported function name string in the
15.920 + GameDLL, and returns a pointer to said function (much like unix dlsym
15.921 + or win32 GetProcAddress?). This appears to be used in GameDLL code for
15.922 + loading savegames, as the savegames contain names of exported functions
15.923 + in the GameDLL. Basically, this is the opposite of <a
15.924 + href="#NameForFunction">NameForFunction</a>.
15.925 +</blockquote>
15.926 +
15.927 +<hr><h3><tt><a name="NameForFunction">NameForFunction</a></tt></h3>
15.928 +<i>from engine/eiface.h:</i><br>
15.929 +<dd><tt>const char *NameForFunction(unsigned long function);</tt><br>
15.930 +<dd><tt>NAME_FOR_FUNCTION()</tt>
15.931 +<p><i>comments:</i><br>
15.932 +<blockquote>
15.933 + Basically, the opposite of <a
15.934 + href="#FunctionFromName">FunctionFromName</a>. Finds the given
15.935 + function pointer address in the GameDLL, and returns the string name
15.936 + for the corresponding function. This appears to be used in GameDLL
15.937 + code for saving games, taking known function pointers and converting
15.938 + them to function name strings to be stored in the savegames, so that
15.939 + they can be converted back to function pointers upon game load.
15.940 +</blockquote>
15.941 +
15.942 +<hr><h3><tt><a name="ClientPrintf">ClientPrintf</a></tt></h3>
15.943 +<i>from engine/eiface.h:</i><br>
15.944 +<dd><tt>void ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg);</tt><br>
15.945 +<dd><tt>CLIENT_PRINTF()</tt>
15.946 +<blockquote><tt>
15.947 + JOHN: engine callbacks so game DLL can print messages to individual
15.948 + clients
15.949 +</tt></blockquote>
15.950 +<p><i>comments:</i><br>
15.951 +<blockquote>
15.952 + .
15.953 +</blockquote>
15.954 +
15.955 +<hr><h3><tt><a name="ServerPrint">ServerPrint</a></tt></h3>
15.956 +<i>from engine/eiface.h:</i><br>
15.957 +<dd><tt>void ServerPrint(const char *szMsg);</tt>
15.958 +<p><i>comments:</i><br>
15.959 +<blockquote>
15.960 + Prints output to the server console.
15.961 +</blockquote>
15.962 +
15.963 +<hr><h3><tt><a name="Cmd_Args">Cmd_Args</a></tt></h3>
15.964 +<i>from engine/eiface.h:</i><br>
15.965 +<dd><tt>const char *Cmd_Args(void);</tt><br>
15.966 +<dd><tt>CMD_ARGS()</tt>
15.967 +<blockquote><tt>
15.968 + these 3 added so game DLL can easily access client 'cmd' strings
15.969 +</tt></blockquote>
15.970 +<p><i>comments:</i><br>
15.971 +<blockquote>
15.972 + Returns the arguments for a command, as a single string. The command
15.973 + string itself is not included, and must be queried with
15.974 + <a href="#Cmd_Argv"><tt>CMD_ARGV(0)</tt></a>. For use in <a
15.975 + href="dllapi_notes.html#ClientCommand">DLLAPI ClientCommand</a>, or in
15.976 + the function provided to <a
15.977 + href="#AddServerCommand">AddServerCommand</a>.
15.978 +</blockquote>
15.979 +
15.980 +<hr><h3><tt><a name="Cmd_Argv">Cmd_Argv</a></tt></h3>
15.981 +<i>from engine/eiface.h:</i><br>
15.982 +<dd><tt>const char *Cmd_Argv(int argc);</tt><br>
15.983 +<dd><tt>CMD_ARGV()</tt>
15.984 +<p><i>comments:</i><br>
15.985 +<blockquote>
15.986 + Returns the <i>nth</i> argument to the command. <tt>CMD_ARGV(0)</tt>
15.987 + returns the command name itself.
15.988 +</blockquote>
15.989 +
15.990 +<hr><h3><tt><a name="Cmd_Argc">Cmd_Argc</a></tt></h3>
15.991 +<i>from engine/eiface.h:</i><br>
15.992 +<dd><tt>int Cmd_Argc(void);</tt><br>
15.993 +<dd><tt>CMD_ARGC()</tt>
15.994 +<p><i>comments:</i><br>
15.995 +<blockquote>
15.996 + Returns the number of arguments given to the command.
15.997 +</blockquote>
15.998 +
15.999 +<hr><h3><tt><a name="GetAttachment">GetAttachment</a></tt></h3>
15.1000 +<i>from engine/eiface.h:</i><br>
15.1001 +<dd><tt>void GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles);</tt><br>
15.1002 +<dd><tt>GET_ATTACHMENT()</tt>
15.1003 +<p><i>comments:</i><br>
15.1004 +<blockquote>
15.1005 + .
15.1006 +</blockquote>
15.1007 +
15.1008 +<hr><h3><tt><a name="CRC32_Init">CRC32_Init</a></tt></h3>
15.1009 +<i>from engine/eiface.h:</i><br>
15.1010 +<dd><tt>void CRC32_Init(CRC32_t *pulCRC);</tt><br>
15.1011 +<dd><tt>CRC32_INIT()</tt>
15.1012 +<p><i>comments:</i><br>
15.1013 +<blockquote>
15.1014 + .
15.1015 +</blockquote>
15.1016 +
15.1017 +<hr><h3><tt><a name="CRC32_ProcessBuffer">CRC32_ProcessBuffer</a></tt></h3>
15.1018 +<i>from engine/eiface.h:</i><br>
15.1019 +<dd><tt>void CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len);</tt><br>
15.1020 +<dd><tt>CRC32_PROCESS_BUFFER()</tt>
15.1021 +<p><i>comments:</i><br>
15.1022 +<blockquote>
15.1023 + .
15.1024 +</blockquote>
15.1025 +
15.1026 +<hr><h3><tt><a name="CRC32_ProcessByte">CRC32_ProcessByte</a></tt></h3>
15.1027 +<i>from engine/eiface.h:</i><br>
15.1028 +<dd><tt>void CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch);</tt><br>
15.1029 +<dd><tt>CRC32_PROCESS_BYTE()</tt>
15.1030 +<p><i>comments:</i><br>
15.1031 +<blockquote>
15.1032 + .
15.1033 +</blockquote>
15.1034 +
15.1035 +<hr><h3><tt><a name="CRC32_Final">CRC32_Final</a></tt></h3>
15.1036 +<i>from engine/eiface.h:</i><br>
15.1037 +<dd><tt>CRC32_t CRC32_Final(CRC32_t pulCRC);</tt><br>
15.1038 +<dd><tt>CRC32_FINAL()</tt>
15.1039 +<p><i>comments:</i><br>
15.1040 +<blockquote>
15.1041 + .
15.1042 +</blockquote>
15.1043 +
15.1044 +<hr><h3><tt><a name="RandomLong">RandomLong</a></tt></h3>
15.1045 +<i>from engine/eiface.h:</i><br>
15.1046 +<dd><tt>long RandomLong(long lLow, long lHigh);</tt><br>
15.1047 +<dd><tt>RANDOM_LONG()</tt>
15.1048 +<p><i>comments:</i><br>
15.1049 +<blockquote>
15.1050 + .
15.1051 +</blockquote>
15.1052 +
15.1053 +<hr><h3><tt><a name="RandomFloat">RandomFloat</a></tt></h3>
15.1054 +<i>from engine/eiface.h:</i><br>
15.1055 +<dd><tt>float RandomFloat(float flLow, float flHigh);</tt><br>
15.1056 +<dd><tt>RANDOM_FLOAT()</tt>
15.1057 +<p><i>comments:</i><br>
15.1058 +<blockquote>
15.1059 + .
15.1060 +</blockquote>
15.1061 +
15.1062 +<hr><h3><tt><a name="SetView">SetView</a></tt></h3>
15.1063 +<i>from engine/eiface.h:</i><br>
15.1064 +<dd><tt>void SetView(const edict_t *pClient, const edict_t *pViewent);</tt><br>
15.1065 +<dd><tt>SET_VIEW() </tt>
15.1066 +<p><i>comments:</i><br>
15.1067 +<blockquote>
15.1068 + .
15.1069 +</blockquote>
15.1070 +
15.1071 +<hr><h3><tt><a name="Time">Time</a></tt></h3>
15.1072 +<i>from engine/eiface.h:</i><br>
15.1073 +<dd><tt>float Time(void);</tt>
15.1074 +<p><i>comments:</i><br>
15.1075 +<blockquote>
15.1076 + .
15.1077 +</blockquote>
15.1078 +
15.1079 +<hr><h3><tt><a name="CrosshairAngle">CrosshairAngle</a></tt></h3>
15.1080 +<i>from engine/eiface.h:</i><br>
15.1081 +<dd><tt>void CrosshairAngle(const edict_t *pClient, float pitch, float yaw);</tt><br>
15.1082 +<dd><tt>SET_CROSSHAIRANGLE()</tt>
15.1083 +<p><i>comments:</i><br>
15.1084 +<blockquote>
15.1085 + .
15.1086 +</blockquote>
15.1087 +
15.1088 +<hr><h3><tt><a name="LoadFileForMe">LoadFileForMe</a></tt></h3>
15.1089 +<i>from engine/eiface.h:</i><br>
15.1090 +<dd><tt>byte * LoadFileForMe(char *filename, int *pLength);</tt><br>
15.1091 +<dd><tt>LOAD_FILE_FOR_ME()</tt>
15.1092 +<p><i>comments:</i><br>
15.1093 +<blockquote>
15.1094 + Opens the given filename (relative to the gamedir, or relative to the
15.1095 + hlds directory, in that order), and returns a pointer to a byte array
15.1096 + (character string) with the contents of the file. NULL-termination of
15.1097 + the array indicates end of file. Length of the file in bytes is
15.1098 + returned in the given int pointer.
15.1099 +</blockquote>
15.1100 +
15.1101 +<hr><h3><tt><a name="FreeFile">FreeFile</a></tt></h3>
15.1102 +<i>from engine/eiface.h:</i><br>
15.1103 +<dd><tt>void FreeFile(void *buffer);</tt><br>
15.1104 +<dd><tt>FREE_FILE()</tt>
15.1105 +<p><i>comments:</i><br>
15.1106 +<blockquote>
15.1107 + Free the byte array of the given buffer which was returned by <a
15.1108 + href="#LoadFileForMe">LoadFileForMe</a>.
15.1109 +</blockquote>
15.1110 +
15.1111 +<hr><h3><tt><a name="EndSection">EndSection</a></tt></h3>
15.1112 +<i>from engine/eiface.h:</i><br>
15.1113 +<dd><tt>void EndSection(const char *pszSectionName);</tt>
15.1114 +<blockquote><tt>
15.1115 + trigger_endsection
15.1116 +</tt></blockquote>
15.1117 +<p><i>comments:</i><br>
15.1118 +<blockquote>
15.1119 + .
15.1120 +</blockquote>
15.1121 +
15.1122 +<hr><h3><tt><a name="CompareFileTime">CompareFileTime</a></tt></h3>
15.1123 +<i>from engine/eiface.h:</i><br>
15.1124 +<dd><tt>int CompareFileTime(char *filename1, char *filename2, int *iCompare);</tt><br>
15.1125 +<dd><tt>COMPARE_FILE_TIME()</tt>
15.1126 +<p><i>comments:</i><br>
15.1127 +<blockquote>
15.1128 + .
15.1129 +</blockquote>
15.1130 +
15.1131 +<hr><h3><tt><a name="GetGameDir">GetGameDir</a></tt></h3>
15.1132 +<i>from engine/eiface.h:</i><br>
15.1133 +<dd><tt>void GetGameDir(char *szGetGameDir);</tt><br>
15.1134 +<dd><tt>GET_GAME_DIR() </tt>
15.1135 +<p><i>comments:</i><br>
15.1136 +<blockquote>
15.1137 + Copies the pathname of the game directory into the given buffer. Note
15.1138 + that there's no way to inform the engine how big the buffer is, so be
15.1139 + forewarned.
15.1140 + <p>
15.1141 + Prior to HL 1.1.1.1 (CS 1.6), this gave the full pathname of the game
15.1142 + directory, ie "/usr/local/half-life/cstrike" or
15.1143 + "C:\Games\Half-Life\cstrike". Now, it is only the string passed to
15.1144 + hlds as the argument to "-game", ie "cstrike".
15.1145 +</blockquote>
15.1146 +
15.1147 +<hr><h3><tt><a name="Cvar_RegisterVariable">Cvar_RegisterVariable</a></tt></h3>
15.1148 +<i>from engine/eiface.h:</i><br>
15.1149 +<dd><tt>void Cvar_RegisterVariable(cvar_t *variable);</tt><br>
15.1150 +<dd><tt>CVAR_CREATE()</tt>
15.1151 +<p><i>comments:</i><br>
15.1152 +<blockquote>
15.1153 + .
15.1154 +</blockquote>
15.1155 +
15.1156 +<hr><h3><tt><a name="FadeClientVolume">FadeClientVolume</a></tt></h3>
15.1157 +<i>from engine/eiface.h:</i><br>
15.1158 +<dd><tt>void FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds);</tt>
15.1159 +<p><i>comments:</i><br>
15.1160 +<blockquote>
15.1161 + .
15.1162 +</blockquote>
15.1163 +
15.1164 +<hr><h3><tt><a name="SetClientMaxspeed">SetClientMaxspeed</a></tt></h3>
15.1165 +<i>from engine/eiface.h:</i><br>
15.1166 +<dd><tt>void SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed);</tt>
15.1167 +<p><i>comments:</i><br>
15.1168 +<blockquote>
15.1169 + .
15.1170 +</blockquote>
15.1171 +
15.1172 +<hr><h3><tt><a name="CreateFakeClient">CreateFakeClient</a></tt></h3>
15.1173 +<i>from engine/eiface.h:</i><br>
15.1174 +<dd><tt>edict_t * CreateFakeClient(const char *netname);</tt>
15.1175 +<blockquote><tt>
15.1176 + returns NULL if fake client can't be created
15.1177 +</tt></blockquote>
15.1178 +<p><i>comments:</i><br>
15.1179 +<blockquote>
15.1180 + Creates "bots" (?).
15.1181 +</blockquote>
15.1182 +
15.1183 +<hr><h3><tt><a name="RunPlayerMove">RunPlayerMove</a></tt></h3>
15.1184 +<i>from engine/eiface.h:</i><br>
15.1185 +<dd><tt>void RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec);</tt>
15.1186 +<p><i>comments:</i><br>
15.1187 +<blockquote>
15.1188 + .
15.1189 +</blockquote>
15.1190 +
15.1191 +<hr><h3><tt><a name="NumberOfEntities">NumberOfEntities</a></tt></h3>
15.1192 +<i>from engine/eiface.h:</i><br>
15.1193 +<dd><tt>int NumberOfEntities(void);</tt><br>
15.1194 +<dd><tt>NUMBER_OF_ENTITIES()</tt>
15.1195 +<p><i>comments:</i><br>
15.1196 +<blockquote>
15.1197 + .
15.1198 +</blockquote>
15.1199 +
15.1200 +<hr><h3><tt><a name="GetInfoKeyBuffer">GetInfoKeyBuffer</a></tt></h3>
15.1201 +<i>from engine/eiface.h:</i><br>
15.1202 +<dd><tt>char *GetInfoKeyBuffer(edict_t *e);</tt>
15.1203 +<blockquote><tt>
15.1204 + passing in NULL gets the serverinfo
15.1205 +</tt></blockquote>
15.1206 +<p><i>comments:</i><br>
15.1207 +<blockquote>
15.1208 + Returns the InfoKeyBuffer for the given edict. This is basically the
15.1209 + fields from "setinfo" at the client console, and includes things like
15.1210 + the player name.
15.1211 + <p>
15.1212 + The sourcecode comment ("<i>passing in NULL gets the serverinfo</i>")
15.1213 + isn't entirely accurate. There appear to be two server-side info
15.1214 + buffers available, "<b>serverinfo</b>" and "<b>localinfo</b>", both
15.1215 + accessible from the console by those two commands, respectively.
15.1216 + <p>
15.1217 + Calling <tt>GetInfoKeyBuffer(NULL)</tt> will return the
15.1218 + <b>localinfo</b> buffer. Calling
15.1219 + <tt>GetInfoKeyBuffer(PEntityOfEntIndex(0))</tt>, ie passing the entity
15.1220 + of slot 0, will return the <b>serverinfo</b> buffer.
15.1221 +</blockquote>
15.1222 +
15.1223 +<hr><h3><tt><a name="InfoKeyValue">InfoKeyValue</a></tt></h3>
15.1224 +<i>from engine/eiface.h:</i><br>
15.1225 +<dd><tt>char *InfoKeyValue(char *infobuffer, char *key);</tt>
15.1226 +<p><i>comments:</i><br>
15.1227 +<blockquote>
15.1228 + Returns the value for the given key in the given InfoKeyBuffer.
15.1229 +</blockquote>
15.1230 +
15.1231 +<hr><h3><tt><a name="SetKeyValue">SetKeyValue</a></tt></h3>
15.1232 +<i>from engine/eiface.h:</i><br>
15.1233 +<dd><tt>void SetKeyValue(char *infobuffer, char *key, char *value);</tt>
15.1234 +<p><i>comments:</i><br>
15.1235 +<blockquote>
15.1236 + Adds or sets a key/value pair in the given InfoKeyBuffer. Appears to
15.1237 + work for only server info, and not client info. For clients, use <a
15.1238 + href="#SetClientKeyValue">SetClientKeyValue</a>.
15.1239 +</blockquote>
15.1240 +
15.1241 +<hr><h3><tt><a name="SetClientKeyValue">SetClientKeyValue</a></tt></h3>
15.1242 +<i>from engine/eiface.h:</i><br>
15.1243 +<dd><tt>void SetClientKeyValue(int clientIndex, char *infobuffer, char *key, char *value);</tt>
15.1244 +<p><i>comments:</i><br>
15.1245 +<blockquote>
15.1246 + Adds or sets a key/value pair in a client's InfoKeyBuffer, by server
15.1247 + slot (ie 1 to maxplayers).
15.1248 +</blockquote>
15.1249 +
15.1250 +<hr><h3><tt><a name="IsMapValid">IsMapValid</a></tt></h3>
15.1251 +<i>from engine/eiface.h:</i><br>
15.1252 +<dd><tt>int IsMapValid(char *filename);</tt><br>
15.1253 +<dd><tt>IS_MAP_VALID()</tt>
15.1254 +<p><i>comments:</i><br>
15.1255 +<blockquote>
15.1256 + .
15.1257 +</blockquote>
15.1258 +
15.1259 +<hr><h3><tt><a name="StaticDecal">StaticDecal</a></tt></h3>
15.1260 +<i>from engine/eiface.h:</i><br>
15.1261 +<dd><tt>void StaticDecal(const float *origin, int decalIndex, int entityIndex, int modelIndex);</tt>
15.1262 +<p><i>comments:</i><br>
15.1263 +<blockquote>
15.1264 + .
15.1265 +</blockquote>
15.1266 +
15.1267 +<hr><h3><tt><a name="PrecacheGeneric">PrecacheGeneric</a></tt></h3>
15.1268 +<i>from engine/eiface.h:</i><br>
15.1269 +<dd><tt>int PrecacheGeneric(char *s);</tt><br>
15.1270 +<dd><tt>PRECACHE_GENERIC()</tt>
15.1271 +<p><i>comments:</i><br>
15.1272 +<blockquote>
15.1273 + .
15.1274 +</blockquote>
15.1275 +
15.1276 +<hr><h3><tt><a name="GetPlayerUserId">GetPlayerUserId</a></tt></h3>
15.1277 +<i>from engine/eiface.h:</i><br>
15.1278 +<dd><tt>int GetPlayerUserId(edict_t *e);</tt><br>
15.1279 +<dd><tt>GETPLAYERUSERID()
15.1280 +<blockquote><tt>
15.1281 + returns the server assigned userid for this player. useful for logging
15.1282 + frags, etc. returns -1 if the edict couldn't be found in the list of
15.1283 + clients
15.1284 +</tt></blockquote>
15.1285 +<p><i>comments:</i><br>
15.1286 +<blockquote>
15.1287 + Returns the session userid for the given player edict. As of server
15.1288 + x106, this is constant for the life of the player connection, and
15.1289 + unique for the life of the server process. Each time a client
15.1290 + connects, they are given a userid of 1 plus the userid of the previous
15.1291 + connecting client. When the server starts/restarts, the server starts
15.1292 + again at userid 1.
15.1293 +</blockquote>
15.1294 +
15.1295 +<hr><h3><tt><a name="BuildSoundMsg">BuildSoundMsg</a></tt></h3>
15.1296 +<i>from engine/eiface.h:</i><br>
15.1297 +<dd><tt>void BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed);</tt><br>
15.1298 +<dd><tt>BUILD_SOUND_MSG()</tt>
15.1299 +<p><i>comments:</i><br>
15.1300 +<blockquote>
15.1301 + .
15.1302 +</blockquote>
15.1303 +
15.1304 +<hr><h3><tt><a name="IsDedicatedServer">IsDedicatedServer</a></tt></h3>
15.1305 +<i>from engine/eiface.h:</i><br>
15.1306 +<dd><tt>int IsDedicatedServer(void);</tt><br>
15.1307 +<dd><tt>IS_DEDICATED_SERVER()
15.1308 +<blockquote><tt>
15.1309 + is this a dedicated server?
15.1310 +</tt></blockquote>
15.1311 +<p><i>comments:</i><br>
15.1312 +<blockquote>
15.1313 + .
15.1314 +</blockquote>
15.1315 +
15.1316 +<hr><h3><tt><a name="CVarGetPointer">CVarGetPointer</a></tt></h3>
15.1317 +<i>from engine/eiface.h:</i><br>
15.1318 +<dd><tt>cvar_t *CVarGetPointer(const char *szVarName);</tt><br>
15.1319 +<dd><tt>CVAR_GET_POINTER()</tt>
15.1320 +<p><i>comments:</i><br>
15.1321 +<blockquote>
15.1322 + Returns a pointer to a <tt>cvar_t</tt> struct for the given cvar
15.1323 + (server variable) name.
15.1324 +</blockquote>
15.1325 +
15.1326 +<hr><h3><tt><a name="GetPlayerWONId">GetPlayerWONId</a></tt></h3>
15.1327 +<i>from engine/eiface.h:</i><br>
15.1328 +<dd><tt>unsigned int GetPlayerWONId(edict_t *e);</tt>
15.1329 +<dd><tt>GETPLAYERWONID()</tt>
15.1330 +<blockquote><tt>
15.1331 + returns the server assigned WONid for this player. useful for logging
15.1332 + frags, etc. returns -1 if the edict couldn't be found in the list of
15.1333 + clients
15.1334 +</tt></blockquote>
15.1335 +<p><i>comments:</i><br>
15.1336 +<blockquote>
15.1337 + Returns the WON id for the given player edict. As of server x106, this
15.1338 + should be unique per client CD KEY, and should be consistent across all
15.1339 + WON auth servers.
15.1340 +</blockquote>
15.1341 +
15.1342 +<hr><h3><tt><a name="Info_RemoveKey">Info_RemoveKey</a></tt></h3>
15.1343 +<i>from engine/eiface.h:</i><br>
15.1344 +<dd><tt>void Info_RemoveKey(char *s, const char *key);</tt>
15.1345 +<blockquote><tt>
15.1346 + YWB 8/1/99 TFF Physics additions
15.1347 +</tt></blockquote>
15.1348 +<p><i>comments:</i><br>
15.1349 +<blockquote>
15.1350 + .
15.1351 +</blockquote>
15.1352 +
15.1353 +<hr><h3><tt><a name="GetPhysicsKeyValue">GetPhysicsKeyValue</a></tt></h3>
15.1354 +<i>from engine/eiface.h:</i><br>
15.1355 +<dd><tt>const char *GetPhysicsKeyValue(const edict_t *pClient, const char *key);</tt>
15.1356 +<p><i>comments:</i><br>
15.1357 +<blockquote>
15.1358 + .
15.1359 +</blockquote>
15.1360 +
15.1361 +<hr><h3><tt><a name="SetPhysicsKeyValue">SetPhysicsKeyValue</a></tt></h3>
15.1362 +<i>from engine/eiface.h:</i><br>
15.1363 +<dd><tt>void SetPhysicsKeyValue(const edict_t *pClient, const char *key, const char *value);</tt>
15.1364 +<p><i>comments:</i><br>
15.1365 +<blockquote>
15.1366 + .
15.1367 +</blockquote>
15.1368 +
15.1369 +<hr><h3><tt><a name="GetPhysicsInfoString">GetPhysicsInfoString</a></tt></h3>
15.1370 +<i>from engine/eiface.h:</i><br>
15.1371 +<dd><tt>const char *GetPhysicsInfoString(const edict_t *pClient);</tt><br>
15.1372 +<dd><tt>ENGINE_GETPHYSINFO()</tt>
15.1373 +<p><i>comments:</i><br>
15.1374 +<blockquote>
15.1375 + .
15.1376 +</blockquote>
15.1377 +
15.1378 +<hr><h3><tt><a name="PrecacheEvent">PrecacheEvent</a></tt></h3>
15.1379 +<i>from engine/eiface.h:</i><br>
15.1380 +<dd><tt>unsigned short PrecacheEvent(int type, const char *psz);</tt><br>
15.1381 +<dd><tt>PRECACHE_EVENT()</tt>
15.1382 +<p><i>comments:</i><br>
15.1383 +<blockquote>
15.1384 + .
15.1385 +</blockquote>
15.1386 +
15.1387 +<hr><h3><tt><a name="PlaybackEvent">PlaybackEvent</a></tt></h3>
15.1388 +<i>from engine/eiface.h:</i><br>
15.1389 +<dd><tt>void PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2);</tt><br>
15.1390 +<dd><tt>PLAYBACK_EVENT_FULL()</tt>
15.1391 +<p><i>comments:</i><br>
15.1392 +<blockquote>
15.1393 + .
15.1394 +</blockquote>
15.1395 +
15.1396 +<hr><h3><tt><a name="SetFatPVS">SetFatPVS</a></tt></h3>
15.1397 +<i>from engine/eiface.h:</i><br>
15.1398 +<dd><tt>unsigned char *SetFatPVS(float *org);</tt><br>
15.1399 +<dd><tt>ENGINE_SET_PVS()</tt>
15.1400 +<p><i>comments:</i><br>
15.1401 +<blockquote>
15.1402 + .
15.1403 +</blockquote>
15.1404 +
15.1405 +<hr><h3><tt><a name="SetFatPAS">SetFatPAS</a></tt></h3>
15.1406 +<i>from engine/eiface.h:</i><br>
15.1407 +<dd><tt>unsigned char *SetFatPAS(float *org);</tt><br>
15.1408 +<dd><tt>ENGINE_SET_PAS()</tt>
15.1409 +<p><i>comments:</i><br>
15.1410 +<blockquote>
15.1411 + .
15.1412 +</blockquote>
15.1413 +
15.1414 +<hr><h3><tt><a name="CheckVisibility">CheckVisibility</a></tt></h3>
15.1415 +<i>from engine/eiface.h:</i><br>
15.1416 +<dd><tt>int CheckVisibility(const edict_t *entity, unsigned char *pset);</tt><br>
15.1417 +<dd><tt>ENGINE_CHECK_VISIBILITY()</tt>
15.1418 +<p><i>comments:</i><br>
15.1419 +<blockquote>
15.1420 + .
15.1421 +</blockquote>
15.1422 +
15.1423 +<hr><h3><tt><a name="DeltaSetField">DeltaSetField</a></tt></h3>
15.1424 +<i>from engine/eiface.h:</i><br>
15.1425 +<dd><tt>void DeltaSetField(struct delta_s *pFields, const char *fieldname);</tt><br>
15.1426 +<dd><tt>DELTA_SET()</tt>
15.1427 +<p><i>comments:</i><br>
15.1428 +<blockquote>
15.1429 + .
15.1430 +</blockquote>
15.1431 +
15.1432 +<hr><h3><tt><a name="DeltaUnsetField">DeltaUnsetField</a></tt></h3>
15.1433 +<i>from engine/eiface.h:</i><br>
15.1434 +<dd><tt>void DeltaUnsetField(struct delta_s *pFields, const char *fieldname);</tt><br>
15.1435 +<dd><tt>DELTA_UNSET()</tt>
15.1436 +<p><i>comments:</i><br>
15.1437 +<blockquote>
15.1438 + .
15.1439 +</blockquote>
15.1440 +
15.1441 +<hr><h3><tt><a name="DeltaAddEncoder">DeltaAddEncoder</a></tt></h3>
15.1442 +<i>from engine/eiface.h:</i><br>
15.1443 +<dd><tt>void DeltaAddEncoder(char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to) );</tt><br>
15.1444 +<dd><tt>DELTA_ADDENCODER()</tt>
15.1445 +<p><i>comments:</i><br>
15.1446 +<blockquote>
15.1447 + .
15.1448 +</blockquote>
15.1449 +
15.1450 +<hr><h3><tt><a name="GetCurrentPlayer">GetCurrentPlayer</a></tt></h3>
15.1451 +<i>from engine/eiface.h:</i><br>
15.1452 +<dd><tt>int GetCurrentPlayer(void);</tt><br>
15.1453 +<dd><tt>ENGINE_CURRENT_PLAYER()</tt>
15.1454 +<p><i>comments:</i><br>
15.1455 +<blockquote>
15.1456 + .
15.1457 +</blockquote>
15.1458 +
15.1459 +<hr><h3><tt><a name="CanSkipPlayer">CanSkipPlayer</a></tt></h3>
15.1460 +<i>from engine/eiface.h:</i><br>
15.1461 +<dd><tt>int CanSkipPlayer(const edict_t *player);</tt><br>
15.1462 +<dd><tt>ENGINE_CANSKIP()</tt>
15.1463 +<p><i>comments:</i><br>
15.1464 +<blockquote>
15.1465 + .
15.1466 +</blockquote>
15.1467 +
15.1468 +<hr><h3><tt><a name="DeltaFindField">DeltaFindField</a></tt></h3>
15.1469 +<i>from engine/eiface.h:</i><br>
15.1470 +<dd><tt>int DeltaFindField(struct delta_s *pFields, const char *fieldname);</tt><br>
15.1471 +<dd><tt>DELTA_FINDFIELD()</tt>
15.1472 +<p><i>comments:</i><br>
15.1473 +<blockquote>
15.1474 + .
15.1475 +</blockquote>
15.1476 +
15.1477 +<hr><h3><tt><a name="DeltaSetFieldByIndex">DeltaSetFieldByIndex</a></tt></h3>
15.1478 +<i>from engine/eiface.h:</i><br>
15.1479 +<dd><tt>void DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber);</tt><br>
15.1480 +<dd><tt>DELTA_SETBYINDEX()</tt>
15.1481 +<p><i>comments:</i><br>
15.1482 +<blockquote>
15.1483 + .
15.1484 +</blockquote>
15.1485 +
15.1486 +<hr><h3><tt><a name="DeltaUnsetFieldByIndex">DeltaUnsetFieldByIndex</a></tt></h3>
15.1487 +<i>from engine/eiface.h:</i><br>
15.1488 +<dd><tt>void DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber);</tt><br>
15.1489 +<dd><tt>DELTA_UNSETBYINDEX()</tt>
15.1490 +<p><i>comments:</i><br>
15.1491 +<blockquote>
15.1492 + .
15.1493 +</blockquote>
15.1494 +
15.1495 +<hr><h3><tt><a name="SetGroupMask">SetGroupMask</a></tt></h3>
15.1496 +<i>from engine/eiface.h:</i><br>
15.1497 +<dd><tt>void SetGroupMask(int mask, int op);</tt><br>
15.1498 +<dd><tt>ENGINE_SETGROUPMASK()</tt>
15.1499 +<p><i>comments:</i><br>
15.1500 +<blockquote>
15.1501 + .
15.1502 +</blockquote>
15.1503 +
15.1504 +<hr><h3><tt><a name="CreateInstancedBaseline">CreateInstancedBaseline</a></tt></h3>
15.1505 +<i>from engine/eiface.h:</i><br>
15.1506 +<dd><tt>int CreateInstancedBaseline(int classname, struct entity_state_s *baseline);</tt><br>
15.1507 +<dd><tt>ENGINE_INSTANCE_BASELINE()</tt>
15.1508 +<p><i>comments:</i><br>
15.1509 +<blockquote>
15.1510 + .
15.1511 +</blockquote>
15.1512 +
15.1513 +<hr><h3><tt><a name="Cvar_DirectSet">Cvar_DirectSet</a></tt></h3>
15.1514 +<i>from engine/eiface.h:</i><br>
15.1515 +<dd><tt>void Cvar_DirectSet(struct cvar_s *var, char *value);</tt>
15.1516 +<p><i>comments:</i><br>
15.1517 +<blockquote>
15.1518 + .
15.1519 +</blockquote>
15.1520 +
15.1521 +<hr><h3><tt><a name="ForceUnmodified">ForceUnmodified</a></tt></h3>
15.1522 +<i>from engine/eiface.h:</i><br>
15.1523 +<dd><tt>void ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char *filename);</tt><br>
15.1524 +<dd><tt>ENGINE_FORCE_UNMODIFIED()</tt>
15.1525 +<blockquote><tt>
15.1526 + Forces the client and server to be running with the same version of the
15.1527 + specified file ( e.g., a player model ). Calling this has no effect in
15.1528 + single player.
15.1529 +</tt></blockquote>
15.1530 +<p><i>comments:</i><br>
15.1531 +<blockquote>
15.1532 + .
15.1533 +</blockquote>
15.1534 +
15.1535 +<hr><h3><tt><a name="GetPlayerStats">GetPlayerStats</a></tt></h3>
15.1536 +<i>from engine/eiface.h:</i><br>
15.1537 +<dd><tt>void GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss);</tt><br>
15.1538 +<dd><tt>PLAYER_CNX_STATS()</tt>
15.1539 +<p><i>comments:</i><br>
15.1540 +<blockquote>
15.1541 + .
15.1542 +</blockquote>
15.1543 +
15.1544 +<hr><h3><tt><a name="AddServerCommand">AddServerCommand</a></tt></h3>
15.1545 +<i>from engine/eiface.h:</i><br>
15.1546 +<dd><tt>void AddServerCommand(char *cmd_name, void (*function) (void));</tt>
15.1547 +<p><i>comments:</i><br>
15.1548 +<blockquote>
15.1549 + Registers a new server console command. When the given command string
15.1550 + is typed at the console, the given function will be called. Arguments
15.1551 + for the command can be retrieved in the function with
15.1552 + <a href="#Cmd_Args">Cmd_Args</a>, <a href="#Cmd_Argv">Cmd_Argv</a>, and
15.1553 + <a href="#Cmd_Argc">Cmd_Argc</a>.
15.1554 +</blockquote>
15.1555 +
15.1556 +<hr><h3><tt><a name="Voice_GetClientListening">Voice_GetClientListening</a></tt></h3>
15.1557 +<i>from engine/eiface.h:</i><br>
15.1558 +<dd><tt>qboolean Voice_GetClientListening)(int iReceiver, int iSender);</tt>
15.1559 +<blockquote><tt>
15.1560 + For voice communications, set which clients hear each other. NOTE: these
15.1561 + functions take player entity indices (starting at 1).
15.1562 +</tt></blockquote>
15.1563 +<p><i>comments:</i><br>
15.1564 +<blockquote>
15.1565 + Added in SDK 2.2.
15.1566 +</blockquote>
15.1567 +
15.1568 +<hr><h3><tt><a name="Voice_SetClientListening">Voice_SetClientListening</a></tt></h3>
15.1569 +<i>from engine/eiface.h:</i><br>
15.1570 +<dd><tt>qboolean Voice_SetClientListening)(int iReceiver, int iSender, qboolean bListen);</tt>
15.1571 +<blockquote><tt>
15.1572 + For voice communications, set which clients hear each other. NOTE: these
15.1573 + functions take player entity indices (starting at 1).
15.1574 +</tt></blockquote>
15.1575 +<p><i>comments:</i><br>
15.1576 +<blockquote>
15.1577 + Added in SDK 2.2.
15.1578 +</blockquote>
15.1579 +
15.1580 +<hr><h3><tt><a name="GetPlayerAuthId">GetPlayerAuthId</a></tt></h3>
15.1581 +<i>from engine/eiface.h:</i><br>
15.1582 +<dd><tt>const char *GetPlayerAuthId(edict_t *e);</tt>
15.1583 +<p><i>From Eric Smith <[email protected]> on <a href="http://list.valvesoftware.com/pipermail/hlcoders/2002-April/002865.html">hlcoders</a>:</i>
15.1584 +<blockquote><tt>
15.1585 + The AuthID is a way for applications/mods to get the Authentication ID
15.1586 + (uniqueID) for a player. The AuthID can be a WonID or a SteamID. The
15.1587 + function I've written returns the AuthID as a string. Calling <a
15.1588 + href="#GetPlayerWONId">GetPlayerWONId</a> will still work for Non-Steam
15.1589 + players just like it always has. If applications/mods want to get a
15.1590 + jump start on getting ready to support Steam players, then they can
15.1591 + start using GetPlayerAuthId, which will still work for Non-Steam
15.1592 + players, but it will give the WonID as a string instead of an unsigned
15.1593 + int.
15.1594 +</tt></blockquote>
15.1595 +<p><i>From Eric Smith <[email protected]> on <a href="http://list.valvesoftware.com/pipermail/servertest/2002-April/000567.html">servertest:</a></i>
15.1596 +<blockquote><tt>
15.1597 + Only clients playing via Steam will have SteamIDs. Clients who are not
15.1598 + using Steam will still have WonIDs (just like they always have). The
15.1599 + server now supports WonIDs\SteamIDs and banning using either of them.
15.1600 + WonIDs have not changed. SteamIDs use the format: STEAM_<#>:<#> where
15.1601 + <#> is replaced by numbers. An example SteamID would be
15.1602 + "STEAM_0:94534".
15.1603 +</tt></blockquote>
15.1604 +<p><i>From Eric Smith <[email protected]> on <a href="http://list.valvesoftware.com/pipermail/hlcoders/2002-April/002925.html">hlcoders:</a></i>
15.1605 +<blockquote><tt>
15.1606 + This function will now return the string "BOT" as the AuthID for fake
15.1607 + clients.
15.1608 +</tt></blockquote>
15.1609 +<p><i>comments:</i><br>
15.1610 +<blockquote>
15.1611 + Added for HL 1109; no SDK update.
15.1612 +</blockquote>
15.1613 +
15.1614 +<hr><h3><tt><a name="SequenceGet">SequenceGet</a></tt></h3>
15.1615 +<i>from engine/eiface.h:</i><br>
15.1616 +<dd><tt>void *SequenceGet(const char *fileName, const char *entryName);</tt>
15.1617 +<p><i>comments:</i><br>
15.1618 +<blockquote>
15.1619 + Added for HL 1xxx; no SDK update.
15.1620 +</blockquote>
15.1621 +
15.1622 +<hr><h3><tt><a name="SequencePickSentence">SequencePickSentence</a></tt></h3>
15.1623 +<i>from engine/eiface.h:</i><br>
15.1624 +<dd><tt>void *SequencePickSentence(const char *groupName, int pickMethod,
15.1625 +int *picked);</tt>
15.1626 +<p><i>comments:</i><br>
15.1627 +<blockquote>
15.1628 + Added for HL 1xxx; no SDK update.
15.1629 +</blockquote>
15.1630 +
15.1631 +<hr><h3><tt><a name="GetFileSize">GetFileSize</a></tt></h3>
15.1632 +<i>from engine/eiface.h:</i><br>
15.1633 +<dd><tt>int GetFileSize(char *filename);</tt>
15.1634 +<p><i>comments:</i><br>
15.1635 +<blockquote>
15.1636 + Added for HL 1xxx; no SDK update.
15.1637 +</blockquote>
15.1638 +
15.1639 +<hr><h3><tt><a name="GetApproxWavePlayLen">GetApproxWavePlayLen</a></tt></h3>
15.1640 +<i>from engine/eiface.h:</i><br>
15.1641 +<dd><tt>unsigned int GetApproxWavePlayLen(const char *filepath);</tt>
15.1642 +<p><i>comments:</i><br>
15.1643 +<blockquote>
15.1644 + Added for HL 1xxx; no SDK update.
15.1645 +</blockquote>
15.1646 +
15.1647 +<hr><h3><tt><a name="IsCareerMatch">IsCareerMatch</a></tt></h3>
15.1648 +<i>from engine/eiface.h:</i><br>
15.1649 +<dd><tt>int IsCareerMatch(void);</tt>
15.1650 +<p><i>comments:</i><br>
15.1651 +<blockquote>
15.1652 + Added for HL 1xxx; no SDK update.
15.1653 +</blockquote>
15.1654 +
15.1655 +<hr><h3><tt><a name="GetLocalizedStringLength">GetLocalizedStringLength</a></tt></h3>
15.1656 +<i>from engine/eiface.h:</i><br>
15.1657 +<dd><tt>int GetLocalizedStringLength(const char *label);</tt>
15.1658 +<p><i>comments:</i><br>
15.1659 +<blockquote>
15.1660 + Added for HL 1xxx; no SDK update.
15.1661 +</blockquote>
15.1662 +
15.1663 +<hr><h3><tt><a name="RegisterTutorMessageShown">RegisterTutorMessageShown</a></tt></h3>
15.1664 +<i>from engine/eiface.h:</i><br>
15.1665 +<dd><tt>void RegisterTutorMessageShown(int mid);</tt>
15.1666 +<p><i>comments:</i><br>
15.1667 +<blockquote>
15.1668 + Added for HL 1xxx; no SDK update.
15.1669 +</blockquote>
15.1670 +
15.1671 +<hr><h3><tt><a name="GetTimesTutorMessageShown">GetTimesTutorMessageShown</a></tt></h3>
15.1672 +<i>from engine/eiface.h:</i><br>
15.1673 +<dd><tt>int GetTimesTutorMessageShown(int mid);</tt>
15.1674 +<p><i>comments:</i><br>
15.1675 +<blockquote>
15.1676 + Added for HL 1xxx; no SDK update.
15.1677 +</blockquote>
15.1678 +
15.1679 +<hr><h3><tt><a name="ProcessTutorMessageDecayBuffer">ProcessTutorMessageDecayBuffer</a></tt></h3>
15.1680 +<i>from engine/eiface.h:</i><br>
15.1681 +<dd><tt>void ProcessTutorMessageDecayBuffer(int *buffer, int bufferLength);</tt>
15.1682 +<p><i>comments:</i><br>
15.1683 +<blockquote>
15.1684 + Added for HL 1xxx; no SDK update.
15.1685 +</blockquote>
15.1686 +
15.1687 +<hr><h3><tt><a name="ConstructTutorMessageDecayBuffer">ConstructTutorMessageDecayBuffer</a></tt></h3>
15.1688 +<i>from engine/eiface.h:</i><br>
15.1689 +<dd><tt>void ConstructTutorMessageDecayBuffer(int *buffer, int bufferLength);</tt>
15.1690 +<p><i>comments:</i><br>
15.1691 +<blockquote>
15.1692 + Added for HL 1xxx; no SDK update.
15.1693 +</blockquote>
15.1694 +
15.1695 +<hr><h3><tt><a name="ResetTutorMessageDecayData">ResetTutorMessageDecayData</a></tt></h3>
15.1696 +<i>from engine/eiface.h:</i><br>
15.1697 +<dd><tt>void ResetTutorMessageDecayData(void);</tt>
15.1698 +<p><i>comments:</i><br>
15.1699 +<blockquote>
15.1700 + Added for HL 1xxx; no SDK update.
15.1701 +</blockquote>
15.1702 +
15.1703 +
15.1704 +<p>
15.1705 +<hr>
15.1706 +
15.1707 +</body>
15.1708 +</HTML>
16.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
16.2 +++ b/doc/html/faq.html Tue Apr 06 07:36:14 2004 +0000
16.3 @@ -0,0 +1,158 @@
16.4 +<!-- vi: set ts=4 sw=4 : -->
16.5 +<!-- vim: set tw=75 : -->
16.6 +
16.7 +<HTML>
16.8 +<head>
16.9 +<title>Metamod FAQ</title>
16.10 +</head>
16.11 +<body>
16.12 +
16.13 +<h1>Metamod FAQ
16.14 +</h1>
16.15 +
16.16 +<p><a name=modsupport>
16.17 +<b> Please add support for <i>(some)</i> mod.</b>
16.18 +</a><p> <blockquote>
16.19 +Please see <a href="gamesupport.html#requirements">game support
16.20 +requirements</a> in the documentation.
16.21 +</blockquote>
16.22 +
16.23 +
16.24 +<p><a name=bots>
16.25 +<b> How do I use bots with Metamod?</b>
16.26 +</a><p> <blockquote>
16.27 +If the bot is <i>not</i> a Metamod plugin, then you will need to tell
16.28 +Metamod to use your bot as the gamedll, by specifying it on the hlds
16.29 +command line with the "+localinfo mm_gamedll" option. See the
16.30 +<a href="metamod.html#localinfo">Metamod docs</a>. See also the
16.31 +<a href="http://www.adminmod.org/help/online/Configuration/How_to_Use_Bots_with_MetaMod_AM_2.50_and_up.htm">AdminMod docs</a>.
16.32 +</blockquote>
16.33 +
16.34 +
16.35 +<p><a name=corrupt>
16.36 +<b> The download links give corrupt files.</b>
16.37 +</a><p> <blockquote>
16.38 +I think what you're observing is that your web client is quietly
16.39 +uncompressing the file, but not updating the name of the downloaded file to
16.40 +reflect this. In particular, some web clients will silently decompress
16.41 +(gunzip) files _without_ removing the ".gz" from the filename, so you'll
16.42 +end up with a file "metamod_i386.so.gz" which is _really_
16.43 +"metamod_i386.so", and so trying to gunzip it will produce an error ("not
16.44 +in gzip format"). Try running "file" on the resulting file to see what the
16.45 +OS thinks it is. Or, where you don't have "file" (ie windows), just look
16.46 +at the file size - it should be pretty indicative of whether the file is
16.47 +still compressed or not.
16.48 +</blockquote>
16.49 +
16.50 +
16.51 +<p><a name=install>
16.52 +<b> How do I install Metamod?</b>
16.53 +</a><p> <blockquote>
16.54 +This is covered briefly in the <a href="metamod.html#installation">Metamod
16.55 +docs</a>. Typically, though, Metamod is installed as part of some major
16.56 +plugin, like <a href="http://www.adminmod.org/">AdminMod</a>. There is
16.57 +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
16.58 +to update it, this requires only replacing the .so/.dll with the latest
16.59 +version from the <a href="http://metamod.org/">webpage</a>.
16.60 +</blockquote>
16.61 +
16.62 +
16.63 +<p><a name=adminmod>
16.64 +<b> I'm having trouble with AdminMod.</b>
16.65 +</a><p> <blockquote>
16.66 +You'll need to ask your AdminMod questions on the <a href="http://www.ozforums.com/forumdisplay.php?forumid=143">AdminMod forums</a>.
16.67 +</blockquote>
16.68 +
16.69 +
16.70 +<p><a name=hlcoding>
16.71 +<b> How do I do <i>(something)</i> in a Metamod plugin?</b>
16.72 +</a><p> <blockquote>
16.73 +Generally speaking, a Metamod plugin works very much like an Half-Life Game
16.74 +Mod, since all it's doing is making the same calls to the same SDK that the
16.75 +Game Mod does. So, the question typically isn't "how do I do this in
16.76 +Metamod?" but instead "how do I do this in an Half-Life Mod?", and is best
16.77 +asked in a HL SDK Programming forum/mailinglist (see <a href="links.html">related links</a>
16.78 +and especially <a href="http://planethalflife.com/botman/MOD_FAQ.shtml">Botman's MOD FAQ</a>).
16.79 +Once you figure out how it would normally be done in a Game Mod, figuring
16.80 +out how to do it in Metamod is relatively straightforward.
16.81 +<p>
16.82 +However, if you have questions on how to convert a piece of code from HLmod
16.83 +to Metamod plugin, then I can provide some pointers, or you can ask on the
16.84 +<a href="http://groups.yahoo.com/group/metamod/">Metamod mailing list</a>.
16.85 +And of course, if you have questions about things in the code specific to
16.86 +Metamod (ie things mentioned in the <a href="coding.html">Metamod Coding
16.87 +docs</a>) feel free to ask me or on the mailing list.
16.88 +</blockquote>
16.89 +
16.90 +
16.91 +<p><a name=examples>
16.92 +<b> Is there a tutorial or example of how to write a Metamod plugin?</b>
16.93 +</a><p> <blockquote>
16.94 +The sourcecode includes a couple of plugins that can be used as examples.
16.95 +The "stub" plugin is the bare basics of what a plugin needs. The "trace"
16.96 +plugin provides an example of hooking _every_ SDK function. The "wdmisc"
16.97 +plugin provides a couple of basic useful features. You can also look at
16.98 +several of the other plugins out there for more examples.
16.99 +<p>
16.100 +Note that the example plugins in the Metamod sourcecode show how to use
16.101 +Metamod to interface with Half-Life code, but they mostly assume you
16.102 +already know how to write Half-Life code. If you need examples or info on
16.103 +how to write Half-Life code itself, you'll need to go look through the HL
16.104 +SDK programming websites (see <a href="links.html">related links</a>
16.105 +and <a href="http://planethalflife.com/botman/MOD_FAQ.shtml">Botman's MOD FAQ</a>).
16.106 +</blockquote>
16.107 +
16.108 +
16.109 +<p><a name=pluginlink>
16.110 +<b> I have (or know of) a Metamod plugin not listed on the webpage.</b>
16.111 +</a><p> <blockquote>
16.112 +Send me the information about the plugin (name, author, description, URL),
16.113 +and I'd be happy to provide a link from the webpage.
16.114 +</blockquote>
16.115 +
16.116 +
16.117 +<p><a name=msvc>
16.118 +<b> I'm having trouble compiling under MSVC.</b>
16.119 +</a><p> <blockquote>
16.120 +Please note that I do not use MSVC, so I can't help a lot with using that
16.121 +compiler. I do all my development under linux, using gcc for linux
16.122 +binaries and <a href="http://www.mingw.org/">mingw32</a> for windows
16.123 +binaries. The sourcecode does include an MSVC project file for Metamod, as
16.124 +well as a project file for the stub plugin, both mostly as examples. They
16.125 +<i>should</i> work, and indeed did work the last time I dug up MSVC to test
16.126 +them. That said, there are a few folks on the <a href="http://groups.yahoo.com/group/metamod/">Metamod mailing list</a> that
16.127 +do use MSVC, so you might find some assistance there.
16.128 +</blockquote>
16.129 +
16.130 +
16.131 +<p><a name=gpl>
16.132 +<b> If I create a Metamod plugin, does it have to be open source?</b>
16.133 +</a><p> <blockquote>
16.134 +Generally speaking, yes. The way the GPL is interpreted, plugins of a GPL
16.135 +program need to be also GPL. See also the FAQ entry on the GNU site about
16.136 +<a href="http://www.gnu.org/licenses/gpl-faq.html#GPLAndPlugins">plugins of a GPL program</a>.
16.137 +</blockquote>
16.138 +
16.139 +
16.140 +<p><a name=otherengines>
16.141 +<b> How about a port of Metamod to other engines like Q3, Unreal, etc?</b>
16.142 +</a><p> <blockquote>
16.143 +I haven't looked into it myself, but several folks on the AdminMod team
16.144 +(from which Metamod was derived) had looked at porting to other games like
16.145 +Q3 and UT, and determined that those engines either didn't provide the
16.146 +necessary API hooks, or that they already provided a suitable method for
16.147 +extending functionality. So, I wouldn't expect to see a version of Metamod
16.148 +for those. Perhaps for some other future engines, although I believe most
16.149 +modern engines are now providing their own method for extensions or
16.150 +plugins, so that a third-party solution like Metamod wouldn't be necessary.
16.151 +<p>
16.152 +If Half-Life 2 ever sees the light of day, I expect I'd look seriously at
16.153 +porting to that - unless, of course, Valve ends up providing their
16.154 +<b>own</b> plugin framework themselves. :)
16.155 +</blockquote>
16.156 +
16.157 +<p>
16.158 +<hr>
16.159 +
16.160 +</body>
16.161 +</HTML>
17.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
17.2 +++ b/doc/html/gamesupport.html Tue Apr 06 07:36:14 2004 +0000
17.3 @@ -0,0 +1,98 @@
17.4 +<!-- vi: set ts=4 sw=4 : -->
17.5 +<!-- vim: set tw=75 : -->
17.6 +
17.7 +<HTML>
17.8 +<head>
17.9 +<title>Metamod Adding Game/Mod Support</title>
17.10 +</head>
17.11 +<body>
17.12 +
17.13 +<h1>Adding Game/Mod Support
17.14 +</h1>
17.15 +
17.16 +<b>Note that the list of supported mods is now provided separately; see <a
17.17 +href="supportedmods.html">Supported Mods</a>.</b>
17.18 +
17.19 +<p>
17.20 +If you want to have support for your game/mod added, you'll need to send me
17.21 +([email protected]) the following information:
17.22 +
17.23 +<h3> Basic Info </h3>
17.24 +<ul>
17.25 +<li> <b>Game name:</b>
17.26 +<li> <b>Homepage URL:</b>
17.27 +<li> <b>Game version:</b>
17.28 +<li> <b>Game directory:</b>
17.29 +<li> <b>Win32 DLL name:</b>
17.30 +<li> <b>Linux SO name:</b>
17.31 +<p>
17.32 +<li> also, <b>List of game entities</b> <a href="#entlist">(see below)</a>
17.33 +</ul>
17.34 +
17.35 +For instance, Counter-Strike would be:
17.36 +
17.37 +<ul>
17.38 +<li> <b>Game name:</b> Counter-Strike
17.39 +<li> <b>Homepage URL:</b> http://www.counter-strike.net/
17.40 +<li> <b>Game version:</b> 1.1
17.41 +<li> <b>Game directory:</b> cstrike
17.42 +<li> <b>Win32 DLL name:</b> mp.dll
17.43 +<li> <b>Linux SO name:</b> cs_i386.so
17.44 +</ul>
17.45 +
17.46 +Many of these can be found in the <b>liblist.gam</b> file in the mod.
17.47 +
17.48 +<a name=entlist><h3>List of game entities</h3></a>
17.49 +<p>The <b>major</b> information that I'll need is the names of any non-standard
17.50 +entities the game uses, for instance TFC uses things like:
17.51 +<p><pre>
17.52 + building_sentrygun
17.53 + detpack
17.54 + func_nobuild
17.55 + ghost
17.56 + info_player_teamspawn
17.57 + info_tfgoal
17.58 + item_artifact_envirosuit
17.59 + i_p_t
17.60 + item_tfgoal
17.61 + i_t_t
17.62 + teledeath
17.63 + tf_ammo_rpgclip
17.64 + tf_gl_grenade
17.65 +</pre>
17.66 +
17.67 +<p>You can see the complete lists of entities for supported mods in the <a
17.68 +href="http://metamod.org/dl/metamod/ents/">files in the "ents" directory</a>.
17.69 +
17.70 +<p>The reason these are needed is that the macro
17.71 +<b><tt>LINK_ENTITY_TO_CLASS</tt></b> in the HL SDK actually
17.72 +declares/defines a function with the name of the entity, which the engine
17.73 +will <tt>dlsym</tt> and call in the gameDLL. Since Metamod is sitting
17.74 +between the engine and the gameDLL, it needs to pass on the call to the
17.75 +function - but can't do this unless it knows ahead of time (at compile) to
17.76 +declare/define a function for that entity name. Thus, metamod needs a list
17.77 +of any entities that have functions declared/defined for them in the
17.78 +gameDLL via LINK_ENTITY_TO_CLASS.
17.79 +
17.80 +<p>Now, the simplest way to generate the list is to grep the source files
17.81 +for <tt><b>LINK_ENTITY_TO_CLASS</b></tt>. If you're not familiar with
17.82 +grep, it's a tool under linux for searching contents of files. For
17.83 +instance:
17.84 +
17.85 +<p><pre>
17.86 + grep LINK_ENTITY_TO_CLASS *.cpp *.c *.h
17.87 +</pre>
17.88 +
17.89 +<p>If you don't have linux available, then you may have to use some other
17.90 +tool under win32 to find a similar list. Or find a copy of grep for win32.
17.91 +:)
17.92 +
17.93 +<p>Note this all assumes you have access to the sourcecode for the mod. If
17.94 +you don't have access to the code, you'll need to find someone who does and
17.95 +ask them to grep the source for the entities.
17.96 +
17.97 +<p>
17.98 +<hr>
17.99 +
17.100 +</body>
17.101 +</HTML>
18.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
18.2 +++ b/doc/html/index.html Tue Apr 06 07:36:14 2004 +0000
18.3 @@ -0,0 +1,65 @@
18.4 +<!-- vi: set ts=4 sw=4 : -->
18.5 +<!-- vim: set tw=75 : -->
18.6 +
18.7 +<HTML>
18.8 +<head>
18.9 +<title>Metamod</title>
18.10 +</head>
18.11 +<body>
18.12 +
18.13 +<h1>Metamod
18.14 +</h1>
18.15 +
18.16 +<p>Metamod is a plugin/DLL manager that sits between the Half-Life Engine and
18.17 +an HL Game mod, allowing the dynamic loading/unloading of mod-like DLL
18.18 +plugins to add functionality to the HL server or game mod.
18.19 +
18.20 +<p>
18.21 +<hr>
18.22 +
18.23 +<p>
18.24 +See <a href="http://metamod.org/">metamod.org</a> for news, downloads,
18.25 +and plugin links.
18.26 +
18.27 +<p>
18.28 +<hr>
18.29 +<table cellspacing=20 width="100%">
18.30 +<tr valign=top>
18.31 +
18.32 +<td>
18.33 +<h2>Metamod Docs</h2>
18.34 +<ul>
18.35 +<li><a href="about.html">About metamod</a>
18.36 +<li><a href="faq.html">FAQ</a>
18.37 +<li><a href="metamod.html">Using metamod</a>
18.38 +<li><a href="release_notes.html">Release Notes</a>
18.39 +<li><a href="gamesupport.html">Game/Mod support</a>
18.40 +<li><a href="trace.html">Trace Plugin</a>
18.41 +<li><a href="wdmisc.html">WDMisc Plugin</a>
18.42 +<li><a href="coding.html">Coding for metamod</a>
18.43 +</ul>
18.44 +</td>
18.45 +
18.46 +<td>
18.47 +<h2>Other HLDS info</h2>
18.48 +<ul>
18.49 +<li><a href="dllapi_notes.html">SDK DLLAPI Notes</a>
18.50 +<li><a href="newapi_notes.html">SDK NEWAPI Notes</a>
18.51 +<li><a href="engine_notes.html">SDK Engine Notes</a>
18.52 +<p>
18.53 +<li><a href="links.html">Related links & books</a>
18.54 +<li><a href="maillist.html">Mailing lists</a>
18.55 +</ul>
18.56 +</td>
18.57 +
18.58 +</tr>
18.59 +</table>
18.60 +
18.61 +<p>
18.62 +<hr>
18.63 +<address><[email protected]></address>
18.64 +
18.65 +</body>
18.66 +
18.67 +</HTML>
18.68 +</HTML>
19.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
19.2 +++ b/doc/html/links.html Tue Apr 06 07:36:14 2004 +0000
19.3 @@ -0,0 +1,114 @@
19.4 +<!-- vi: set ts=4 sw=4 : -->
19.5 +<!-- vim: set tw=75 : -->
19.6 +
19.7 +<HTML>
19.8 +<head>
19.9 +<title>Metamod Related Links</title>
19.10 +</head>
19.11 +<body>
19.12 +
19.13 +<h2>Related links
19.14 +</h2></a>
19.15 +
19.16 +Here's a list of links, other sites, and information I found useful when
19.17 +working on Metamod:
19.18 +
19.19 +<ul>
19.20 +<li><a href="http://www.ozforums.com/forumdisplay.php?forumid=114">AdminMod's DLL Forum</a>
19.21 +<li><a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/halflifeadmin/">AdminMod CVS at Sourceforge</a>
19.22 +
19.23 +<p>
19.24 +<!-- <li><a href="http://hlsdk.valve-erc.com/">Half-Life SDK Resource Site</a>, Valve's official site -->
19.25 +<li><a href="http://collective.valve-erc.com/">Valve Editing Resource Center</a>, Valve's official site
19.26 +<li><a href="http://planethalflife.com/botman/">Botman's Bots</a>
19.27 +<li><a href="http://hlpp.valveworld.com/">Half-Life Programming Planet</a>
19.28 +<li><a href="http://planethalflife.com/hlsdk2">Shadowman's Half-Life SDK2 Site</a>
19.29 +<li><a href="http://www.planethalflife.com/botman/balfourroad/index.shtml">Half-Life Coding Pages</a>
19.30 +<li><a href="http://planethalflife.com/fixxxer/">Fixxxer's HL Coding page</a>
19.31 +<li><a href="http://www.karljones.com/halflife/coding.asp">The Handy Vandal's HL Coding Links</a>
19.32 +
19.33 +<p>
19.34 +<li><a href="http://www.chatbear.com/cgi-bin/board.pl?boardid=942">Half-Life SDK Forums</a>, at the VERC
19.35 +<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
19.36 +<li><a href="http://www.topica.com/lists/hlcoders">HL Coders mailing list</a>, at topica.com
19.37 +<li><a href="http://dynamic.gamespy.com/~botman/yabb/YaBB.pl">Botman's forums</a>
19.38 +<!-- <li><a href="http://dynamic.gamespy.com/~wavelength/ubb/forumdisplay.cgi?action=topics&forum=Coding&number=3">Wavelength Half-Life Coding Forum</a> -->
19.39 +<li><a href="http://www.thewavelength.net/forums/index.php?act=SF&f=13">Wavelength Half-Life Coding Forum</a>
19.40 +<li><a href="http://pub21.ezboard.com/fshadowmanshalflifeforumsdk2">SDK2 Forum</a>, at ezboard.com
19.41 +<li><a href="http://dynamic.gamespy.com/~hlprogramming/ultimatebb/forumdisplay.cgi?action=topics&forum=Coding&number=1">HL Programming Forum</a>, at gamespy.com
19.42 +<li><a href="http://network54.com/Hide/Forum/goto?forumid=21807">Fixxxer's HL Coding forum</a>
19.43 +<li><a href="http://forums.gamedesign.net/forums/wwwthreads.pl?action=list&Board=halflife_coding">HL Programming Forum</a>, at gamedesign.net
19.44 +
19.45 +<p>
19.46 +<li><a href="http://www.eskimo.com/~scs/C-faq/top.html">C FAQ</a>
19.47 +<li><a href="http://www.parashift.com/cpp-faq-lite/">C++ FAQ Lite</a>
19.48 +<li><a href="http://www.calpoly.edu/~jfischer/c++faq/index.html">C++ FAQ Index</a>
19.49 +<li><a href="http://snurse-l.org/acllc-c++/faq">alt.comp.lang.learn.c-c++ FAQ</a>
19.50 +<li><a href="http://dragon.klte.hu/~kollarl/C++/cplusplu.html">C++ Annotations</a>, guide for C programmers to using C++
19.51 +<li><a href="http://www.mozilla.org/hacking/portable-cpp.html">C++ Portability Guide</a>
19.52 +<li><a href="http://www.sgi.com/tech/stl/">Standard Template Library Programmer's Guide</a>, at SGI
19.53 +<li><a href="http://reality.sgi.com/austern_mti/std-c++/faq.html">comp.std.c++ FAQ</a>
19.54 +<li><a href="http://www.landfield.com/faqs/g++-FAQ/plain/">GNU g++ FAQ</a>
19.55 +<li><a href="http://gcc.gnu.org/onlinedocs/libstdc++/faq/">GNU libstdc++ FAQ</a>
19.56 +<li><a href="http://www.apl.jhu.edu/~paulmac/c++-references.html">C++ References</a>, books and other links
19.57 +<li><a href="http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html">Thinking in C++</a>, free electronic book
19.58 +
19.59 +<p>
19.60 +<li><a href="http://www.serpentine.com/~bos/threads-faq/">comp.programming.threads FAQ</a>
19.61 +<li><a href="http://www.lambdacs.com/cpt/FAQ.html">comp.programming.threads FAQ #2</a>
19.62 +<li><a href="http://www.cs.wustl.edu/~schmidt/win32-cv-1.html">Implementing POSIX Condition Variables in Win32</a>
19.63 +
19.64 +<p>
19.65 +<li><a href="http://msdn.microsoft.com/">Microsoft Developer Network</a>, online win32 API docs
19.66 +<li><a href="http://www.iseran.com/Win32/FAQ/">Win32 Programming FAQ</a>
19.67 +<li><a href="http://www.mingw.org/">Minimal Gnu for Windows (mingw)</a>, gcc for win32
19.68 +<li><a href="http://www.geocities.com/Tokyo/Towers/6162/win32/dll/make.html">Creating DLLs w/mingw</a>
19.69 +<li><a href="http://www.devolution.com/~slouken/SDL/Xmingw32/">Mingw binaries</a>
19.70 +<li><a href="http://members.telering.at/jessich/mingw/index.html">Mingw binaries (newer)</a>
19.71 +
19.72 +</ul>
19.73 +
19.74 +<h2>Books</h2>
19.75 +
19.76 +And here are books I picked up that I found useful as well:
19.77 +<ul>
19.78 +
19.79 +<li><a href="http://vig.prenhall.com/catalog/academic/product/1,4096,0133262243,00.html">C: A Reference Manual</a>, by Samuel Harbison & <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>)
19.80 +
19.81 +<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>)
19.82 +
19.83 +
19.84 +<p>
19.85 +<li><a href="http://www.oreilly.com/catalog/core/">C++: The Core Language</a>, by Gregory Satir & 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>)
19.86 +
19.87 +<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>)
19.88 +
19.89 +<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>)
19.90 +
19.91 +<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, & 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>)
19.92 +
19.93 +<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>)
19.94 +
19.95 +<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>)
19.96 +
19.97 +
19.98 +<p>
19.99 +<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>)
19.100 +
19.101 +<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>)
19.102 +
19.103 +<li><a href="http://www.oreilly.com/catalog/make2/">Managing Projects with Make</a>, by Andrew Oram & <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>)
19.104 +
19.105 +
19.106 +<p>
19.107 +<li><a href="http://vig.prenhall.com/catalog/academic/product/1,4096,0131900676,00.html">Thread Time</a>, by Scott Norton & 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>)
19.108 +
19.109 +<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>)
19.110 +
19.111 +</ul>
19.112 +
19.113 +<p>
19.114 +<hr>
19.115 +
19.116 +</body>
19.117 +</HTML>
20.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
20.2 +++ b/doc/html/maillist.html Tue Apr 06 07:36:14 2004 +0000
20.3 @@ -0,0 +1,62 @@
20.4 +<!-- vi: set ts=4 sw=4 : -->
20.5 +<!-- vim: set tw=75 : -->
20.6 +
20.7 +<HTML>
20.8 +<head>
20.9 +<title>Metamod Mailing lists</title>
20.10 +</head>
20.11 +<body>
20.12 +
20.13 +<h1>Mailing lists
20.14 +</h1>
20.15 +
20.16 +I've created a couple of lists on YahooGroups (formerly egroups (formerly
20.17 +onelist)):
20.18 +
20.19 +<ul>
20.20 +<li> <a href="http://groups.yahoo.com/group/metamod-announce/">metamod-announce</a> for announcements of new versions and plugins
20.21 +<li> <a href="http://groups.yahoo.com/group/metamod/">metamod</a> for
20.22 + questions, support, discussion, etc
20.23 +</ul>
20.24 +
20.25 +There are simple subscribe forms below.
20.26 +
20.27 +<table cellspacing=0 cellpadding=2 border=0 bgcolor=#DDCCFF>
20.28 + <tr>
20.29 + <form method=GET action="http://groups.yahoo.com/subscribe/metamod-announce">
20.30 + <td align=center>
20.31 + <b>Subscribe to metamod-announce</b><br>
20.32 + <input type=text name="user" value="enter email address" size=20><br>
20.33 + <a href="http://groups.yahoo.com/group/metamod-announce/">groups.yahoo.com/metamod-announce</a>
20.34 + </td>
20.35 + <td>
20.36 + <input type=image border=0 alt="Click here to join metamod-announce"
20.37 + name="Click here to join metamod" src="http://groups.yahoo.com/img/ui/join.gif">
20.38 + </td>
20.39 + </form>
20.40 + </tr>
20.41 +</table>
20.42 +
20.43 +<p>
20.44 +
20.45 +<table cellspacing=0 cellpadding=2 border=0 bgcolor=#DDCCFF>
20.46 + <tr>
20.47 + <form method=GET action="http://groups.yahoo.com/subscribe/metamod">
20.48 + <td align=center>
20.49 + <b>Subscribe to metamod</b><br>
20.50 + <input type=text name="user" value="enter email address" size=20><br>
20.51 + <a href="http://groups.yahoo.com/group/metamod/">groups.yahoo.com/metamod</a>
20.52 + </td>
20.53 + <td>
20.54 + <input type=image border=0 alt="Click here to join metamod"
20.55 + name="Click here to join metamod" src="http://groups.yahoo.com/img/ui/join.gif">
20.56 + </td>
20.57 + </form>
20.58 + </tr>
20.59 +</table>
20.60 +
20.61 +<p>
20.62 +<hr>
20.63 +
20.64 +</body>
20.65 +</HTML>
21.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
21.2 +++ b/doc/html/metamod.html Tue Apr 06 07:36:14 2004 +0000
21.3 @@ -0,0 +1,671 @@
21.4 +<!-- vi: set ts=4 sw=4 : -->
21.5 +<!-- vim: set tw=75 : -->
21.6 +
21.7 +<HTML>
21.8 +<head>
21.9 +<title>Using Metamod</title>
21.10 +</head>
21.11 +<body>
21.12 +
21.13 +<h1>Using Metamod
21.14 +</h1>
21.15 +
21.16 +<a name=clientcommands>
21.17 +<h2>Client Commands
21.18 +</h2></a>
21.19 +
21.20 +Similar to the <a href="#commands">server console interface</a>, clients
21.21 +can also issue commands to Metamod, of the following form:
21.22 +<ul>
21.23 +
21.24 +<li> <b><tt>meta version</tt></b> - displays version information about the
21.25 + Metamod instance currently running on the server, ie:
21.26 + <p>
21.27 + <tt>Metamod v1.17 2003/08/01
21.28 + <br>by Will Day <[email protected]>
21.29 + <br>http://www.metamod.org/
21.30 + <br>compiled: Aug 4 2003, 22:43:33 Eastern (debugging)
21.31 + </tt>
21.32 +
21.33 +<p><li> <b><tt>meta list</tt></b> - displays information about the list of
21.34 + currently running plugins, ie:
21.35 + <p>
21.36 + <tt>Currently running plugins:
21.37 + <br>[ 1] Trace HLSDK API, v1.XX.93, 2003/02/17, by Will Day <[email protected]>, see http://www.metamod.org/
21.38 + <br>[ 2] Adminmod, v2.50.56 (MM), Jul 13 2003, by Alfred Reynolds <[email protected]>, see http://www.adminmod.org/
21.39 + <br>2 plugins
21.40 + </tt>
21.41 +
21.42 +</ul>
21.43 +
21.44 +<a name=clientcvars>
21.45 +<h2>Client Cvars
21.46 +</h2></a>
21.47 +
21.48 +Also available to client browser applications is a cvar
21.49 +<b><tt>metamod_version</tt></b> that should report the version of Metamod
21.50 +running on the server, ie:
21.51 + <p>
21.52 + <dd><tt>"metamod_version" is "1.17"</tt>
21.53 +
21.54 +<a name=installation>
21.55 +<h2>Installation
21.56 +</h2></a>
21.57 +
21.58 +If you have installed <a href="http://www.adminmod.org/">AdminMod</a> 2.50
21.59 +or later, then the AM installer has already installed Metamod for you. If
21.60 +you only want to upgrade your Metamod with a more recent version, simply
21.61 +grab the <a href="http://metamod.org/dl/dlls/metamod.dll">metamod.dll</a> (win32) or <a
21.62 +href="http://metamod.org/dl/dlls/metamod_i386.so">metamod_i386.so</a> (linux) file and
21.63 +replace the file currently on your system.
21.64 +<p>
21.65 +If you want to install Metamod by hand, here's what you have to do:
21.66 +<ul>
21.67 +
21.68 +<p><li> Install the Metamod library (.dll for win32, or .so for linux) to a
21.69 +directory under your <b>game</b> directory. For instance, if you were
21.70 +running Counter-Strike, under win32 you might want have:
21.71 +
21.72 +<p><pre>
21.73 + half-life/cstrike/addons/metamod/dlls/metamod.dll
21.74 +</pre>
21.75 +
21.76 +<p>If a directory you want doesn't exist, create it.
21.77 +
21.78 +<p><li> Edit the "<tt>liblist.gam</tt>" file in your <b>game</b> directory,
21.79 +replacing the game dll filename with the Metamod dll filename. For
21.80 +instance with Counter-Strike, you would change:
21.81 + <p><dl><tt>
21.82 + <dd>gamedll "dlls/mp.dll"
21.83 + <dd>gamedll_linux "dlls/cs_i386.so"
21.84 + </tt></dl>
21.85 +to:
21.86 + <dl><tt>
21.87 + <dd>gamedll "addons/metamod/dlls/metamod.dll"
21.88 + <dd>gamedll_linux "addons/metamod/dlls/metamod_i386.so"
21.89 + </tt></dl>
21.90 +
21.91 +<p>Note that it's only really necessary to change the line corresponding
21.92 +to your OS (win32 or linux); you can leave the other line unchanged, or you
21.93 +can change it - it doesn't matter.
21.94 +
21.95 +<p><li> To load plugins at game startup, you'll need to create a "<a
21.96 +href="#plugins.ini">plugins.ini</a>" file containing a list of the plugins
21.97 +you want to load.
21.98 +
21.99 +</ul>
21.100 +
21.101 +<p><br><a name=configuration>
21.102 +<h2>Configuration
21.103 +</h2></a>
21.104 +
21.105 +Metamod has several ways to provide config options, partially because it
21.106 +started with one method and then added other methods, but also because one
21.107 +method can be more convenient than the other, varying with the situation.
21.108 +
21.109 +<p>
21.110 +Generally speaking, the two methods of providing configuration
21.111 +information to Metamod are:
21.112 +<ul>
21.113 + <li> on the command line, via <a href="localinfo">+localinfo</a>
21.114 + arguments to hlds.
21.115 + <li> as the contents of some <b>file</b> that Metamod reads and parses.
21.116 +</ul>
21.117 +
21.118 +<p>
21.119 +The confusing part can come when the <i>pathnames</i> to some of the config
21.120 +files can be specified via command line options - or indeed, when the
21.121 +pathnames to <i>some</i> config files can be specified in <i>other</i>
21.122 +config files.
21.123 +
21.124 +<p>
21.125 +In any case, here are the various config options and config files Metamod
21.126 +uses, (listed in order of priority), where "<tt><i>$gamedir</i></tt>"
21.127 +indicates the game directory, ie "cstrike":
21.128 +
21.129 +<ul>
21.130 +<li> <tt>+<a href="#localinfo">localinfo</a> mm_configfile</tt>
21.131 + <i><file></i>
21.132 +
21.133 +<p>
21.134 +<li> <tt>+<a href="#localinfo">localinfo</a> mm_pluginsfile</tt>
21.135 + <i><file></i>
21.136 +<li> <tt><a href="#config.ini">config.ini</a> option: plugins_file</tt>
21.137 + <i><file></i>
21.138 +<li> <tt><i>$gamedir</i>/addons/metamod/<a href="#plugins.ini">plugins.ini</a></tt>
21.139 +<li> <tt><i>$gamedir</i>/metamod.ini</tt>
21.140 +
21.141 +<p>
21.142 +<li> <tt>$<a href="#localinfo">localinfo</a> mm_execcfg</tt>
21.143 + <i><file></i>
21.144 +<li> <tt><a href="#config.ini">config.ini</a> option: exec_cfg</tt>
21.145 + <i><file></i>
21.146 +<li> <tt><i>$gamedir</i>/addons/metamod/<a href="#exec.cfg">exec.cfg</a></tt>
21.147 +<li> <tt><i>$gamedir</i>/metaexec.cfg</tt>
21.148 +
21.149 +<p>
21.150 +<li> <tt>$<a href="#localinfo">localinfo</a> mm_gamedll</tt>
21.151 + <i><file></i>
21.152 +<li> <tt><a href="#config.ini">config.ini</a> option: gamedll</tt>
21.153 + <i><file></i>
21.154 +<li> <tt><strike><i>$gamedir</i>/metagame.ini</strike></tt>
21.155 + <i><b>-- No longer supported.</b></i>
21.156 +</ul>
21.157 +
21.158 +
21.159 +<p><br><a name=metamod.ini></a><a name=plugins.ini>
21.160 +<h2>File: <tt>plugins.ini</tt>
21.161 +</h2></a>
21.162 +
21.163 +Default location: <b><i>$gamedir</i>/addons/metamod/plugins.ini</b>, ie
21.164 +"cstrike/addons/metamod/plugins.ini".
21.165 +
21.166 +<p>Plugins are described in a file "plugins.ini" and each line describes a
21.167 +plugin to load:
21.168 +
21.169 +<dl>
21.170 + <dd> <i><platform> <filepath> [<description>]</i>
21.171 +</dl>
21.172 +
21.173 +<p> Fields are whitespace delimited (tabs/spaces).
21.174 +
21.175 +<ul>
21.176 + <li><i>Platform</i> is a keyword, either <tt>"<b>linux</b>"</tt> or
21.177 + <tt>"<b>win32</b>"</tt>.
21.178 +
21.179 + <p><li><i>Filepath</i> is a path to the DLL/so file. Relative paths
21.180 + are from the game dir; absolute paths are also valid. Paths should use
21.181 + unix-style <b>forward</b> slashes (<b>/</b>) and not <b>backward</b>
21.182 + slashes (<b>\</b>), even on windows platforms.
21.183 +
21.184 + <p>Also, the filepath (once expanded to full path name) is expected to
21.185 + be unique within the list of plugins. Thus, a plugin with a
21.186 + fullpathname matching that of a previous plugin is considered a
21.187 + duplicate, and is not loaded.
21.188 +
21.189 + <p><li><i>Description</i> is an optional description of the plugin, used
21.190 + in place of the plugin's internal name in log messages and console
21.191 + output. Whitespace in the description <b><i>is</i></b> allowed;
21.192 + quoting is unnecessary.
21.193 +</ul>
21.194 +
21.195 +Comments are recognized at <b><i>only</i></b> the beginning of a line, and
21.196 +can be in either shell style ("<tt>#</tt>") or c++ style ("<tt>//</tt>").
21.197 +
21.198 +<p> For instance, in <tt>"<b>cstrike/addons/metamod/plugins.ini</b>"</tt>
21.199 +these are all valid lines:
21.200 +
21.201 +<p><pre>
21.202 + // linux dlls/mybot.so
21.203 + # win32 dlls/mybot-old.dll Mybot old
21.204 + win32 dlls/mybot.dll Mybot current
21.205 + linux /tmp/stub_mm_i386.so
21.206 + win32 /tmp/stub_mm_i386.dll
21.207 + linux ../dlls/trace_mm_i386.so
21.208 + win32 ../dlls/trace_mm_i386.dll
21.209 + linux dlls/admin_MM_i386.so
21.210 + win32 dlls/admin_MM_i386.dll
21.211 +</pre>
21.212 +
21.213 +<p> Note that order in the plugins.ini file <b><i>is</i></b> significant.
21.214 +Plugins are loaded and accessed in the order specified, so ordering
21.215 +<i>can</i> be important, depending on the plugin(s).
21.216 +
21.217 +<p> The file is re-read at changelevel, as well as on demand (via
21.218 +<tt>"<b>meta refresh</b>"</tt> console command; see below). When the file
21.219 +is re-read, it will:
21.220 +
21.221 +<ul>
21.222 + <li> load any new plugins added to the file
21.223 +
21.224 + <li> unload any plugins that have been deleted from the file. This is
21.225 + only applicable to plugins loaded <b><i>from the inifile</i></b>. If the
21.226 + plugin was loaded from the console, it will not be unloaded during a
21.227 + refresh, whether it's in the inifile or not.
21.228 +
21.229 + <li> reload any plugin whose file on disk has been updated since it was
21.230 + loaded. Note this appears to be only useful under linux, as under Windows
21.231 + you cannot rename or overwrite an open DLL, so it doesn't look a loaded
21.232 + plugin could ever have a newer file on disk. Oh well.
21.233 +</ul>
21.234 +
21.235 +<p>The game dll is auto-detected, along the same lines AdminMod operated
21.236 +(looking at the "gamedir"); see "mm_gamedll" below if you want to use a
21.237 +"bot" DLL.
21.238 +
21.239 +<p> You can override the name of this file by specifying it via the <a
21.240 +href="#localinfo">+localinfo</a> field "<a
21.241 +href="#mm_pluginsfile"><b>mm_pluginsfile</b></a>".
21.242 +
21.243 +<p> For compatibility with previous versions, Metamod will also look for a
21.244 +file "metamod.ini" under the gamedir, ie "<b>cstrike/metamod.ini</b>".
21.245 +
21.246 +
21.247 +<p><br><a name=config.ini>
21.248 +<h2>File: <tt>config.ini</tt>
21.249 +</h2></a>
21.250 +
21.251 +Default location: <b><i>$gamedir</i>/addons/metamod/config.ini</b>, ie
21.252 +"cstrike/addons/metamod/config.ini".
21.253 +
21.254 +<p>
21.255 +This contains basic config information, at the moment duplicating most of
21.256 +the <a href="#localinfo">+localinfo</a> variables, but allowing for more
21.257 +flexible expansion of config options in the future. Also, it provides
21.258 +somewhat more reliable options setting, since +localinfo munges some
21.259 +argument values (in particular, pathnames with leading dots, ie
21.260 +"../dlls/blah.dll").
21.261 +
21.262 +<p>
21.263 +Basic format is:
21.264 +
21.265 +<dl>
21.266 + <dd> <i><option> <value></i>
21.267 +</dl>
21.268 +
21.269 +<p> Fields are whitespace delimited (tabs/spaces). Comments are recognized
21.270 +at <b><i>only</i></b> the beginning of a line, and can be in either shell
21.271 +style ("<tt>#</tt>") or c++ style ("<tt>//</tt>").
21.272 +
21.273 +The following is a list of currently recognized options, their defaults,
21.274 +and examples of usage:
21.275 +
21.276 +<ul>
21.277 +
21.278 + <p><li> <tt><b>debuglevel</b> <i><number></i></tt>
21.279 + <p> where <number> is an integer, 0 and up.
21.280 + <br> Sets the initial debugging level for metamod (same as cvar
21.281 + "meta_debug").
21.282 + <br> Default is normally 0. If hlds is run with "-dev", default is 3.
21.283 + <br> Overridden by: <a href="#localinfo">+localinfo</a> <a
21.284 + href="#mm_debug">mm_debug</a> <number>
21.285 + <br> Examples:
21.286 + <br> <tt>debuglevel 0</tt>
21.287 + <br> <tt>debuglevel 42</tt>
21.288 +
21.289 + <p><li> <tt><b>gamedll</b> <i><path></i></tt>
21.290 + <p> where <path> is an absolute path, or a path relative to
21.291 + the gamedir.
21.292 + <br> Overrides the auto-detected gamedll, in particular for bots.
21.293 + <br> Default is empty, with gamedll being auto-recognized based on the
21.294 + gamedir.
21.295 + <br> Overridden by: <a href="#localinfo">+localinfo</a> <a
21.296 + href="#mm_gamedll">mm_gamedll</a> <number>
21.297 + <br> Examples:
21.298 + <br> <tt>gamedll dlls/hl.dll</tt>
21.299 + <br> <tt>gamedll ../podbot/podbot.dll</tt>
21.300 + <br> <tt>gamedll /home/bots/dlls/mybot.dll</tt>
21.301 +
21.302 + <p><li> <tt><b>plugins_file</b> <i><path></i></tt>
21.303 + <p> where <path> is an absolute path, or a path relative to
21.304 + the gamedir.
21.305 + <br> Overrides the default filename containing the MM plugins to load.
21.306 + <br> Default is "addons/metamod/<a href="#plugins.ini">plugins.ini</a>".
21.307 + <br> Overridden by: <a href="#localinfo">+localinfo</a> <a
21.308 + href="#mm_pluginsfile">mm_pluginsfile</a> <number>
21.309 + <br> Examples:
21.310 + <br> <tt>plugins_file cfg/clanmode.ini</tt>
21.311 + <br> <tt>plugins_file ../private.ini</tt>
21.312 + <br> <tt>plugins_file /home/half-life/testing.ini</tt>
21.313 +
21.314 + <p><li> <tt><b>exec_cfg</b> <i><path></i></tt>
21.315 + <p> where <path> is a path relative to the gamedir.
21.316 + <b>NOTE!</b> This <i>cannot</i> be an absolute path, as hlds will
21.317 + not "exec" absolute pathnames.
21.318 + <br> Overrides the default filename containing hlds commands to run
21.319 + just after loading Metamod.
21.320 + <br> Default is "addons/metamod/<a href="#exec.cfg">exec.cfg</a>".
21.321 + <br> Overridden by: <a href="#localinfo">+localinfo</a> <a
21.322 + href="#mm_execcfg">mm_execcfg</a> <number>
21.323 + <br> Examples:
21.324 + <br> <tt>exec_cfg configs/debugging.cfg</tt>
21.325 + <br> <tt>exec_cfg ../clan/match.cfg</tt>
21.326 +
21.327 +</ul>
21.328 +
21.329 +<p> You can override the name of this file by specifying it via the <a
21.330 +href="#localinfo">+localinfo</a> field "<a
21.331 +href="#mm_configfile"><b>mm_configfile</b></a>".
21.332 +
21.333 +
21.334 +<p><br>
21.335 +<a name=metaexec.cfg></a><a name=exec.cfg>
21.336 +<h2>File: <tt>exec.cfg</tt>
21.337 +</h2></a>
21.338 +
21.339 +Default location: <b><i>$gamedir</i>/addons/metamod/exec.cfg</b>, ie
21.340 +"cstrike/addons/metamod/exec.cfg".
21.341 +
21.342 +<p.This is an optional file containing server commands or cvar settings, and
21.343 +which is read by the server just after loading the initial plugins (from
21.344 +plugins.ini).
21.345 +
21.346 +<p>This is necessary for plugins that need to have settings specified prior
21.347 +to early API routines like ServerActivate, since <tt>autoexec.cfg</tt> is
21.348 +read too early and <tt>server.cfg</tt> is read to late. In particular, I
21.349 +found this necessary for the Trace plugin, in order to trace routines like
21.350 +<tt>RegUserMsg</tt> which are called during ServerActivate.
21.351 +
21.352 +<p> You can override the name of this file by specifying it via the <a
21.353 +href="#localinfo">+localinfo</a> field "<a
21.354 +href="#mm_execcfg"><b>mm_execcfg</b></a>".
21.355 +
21.356 +<p> For compatibility with previous versions, Metamod will also look for a
21.357 +file "metaexec.cfg" under the gamedir, ie "<b>cstrike/metaexec.cfg</b>".
21.358 +
21.359 +
21.360 +<p><br>
21.361 +<a name=metagame.ini>
21.362 +<h2><strike>file: <tt>metagame.ini</tt></strike>
21.363 +</h2></a>
21.364 +
21.365 +<b>NOTE! This file is no longer supported!</b> -- use instead the
21.366 +<a href="#localinfo">+localinfo</a> field
21.367 +"<a href="#mm_gamedll"><b>mm_gamedll</b></a>" or the <a
21.368 +href="#config.ini">config.ini</a> option <b>gamedll</b>.
21.369 +
21.370 +
21.371 +<p><br>
21.372 +<a name=localinfo>
21.373 +<h2>Commandline option: <tt>+localinfo</tt>
21.374 +</h2></a>
21.375 +
21.376 +Several of Metamod's configuration options can be specified by the
21.377 +"+localinfo" facility on the hlds command line. This is similar to the
21.378 +"setinfo" console command, where the syntax is:
21.379 +
21.380 +<dl>
21.381 + <dd><tt>+localinfo <<i>field</i>> <<i>value</i>></tt>
21.382 +</dl>
21.383 +
21.384 +Current localinfo fields recognized by Metamod:
21.385 +<ul>
21.386 +
21.387 + <p><a name=mm_configfile><li><b>mm_configfile</b></a> Specifies the
21.388 + file that lists config options, instead of using the file <a
21.389 + href="#config.ini">config.ini</a>. The <tt><<i>value</i>></tt>
21.390 + should be the pathname of the config file, either absolute path or
21.391 + path relative to the gamedir.
21.392 +
21.393 + <p><a name=mm_pluginsfile><li><b>mm_pluginsfile</b></a> Specifies a
21.394 + file that lists the Metamod plugins to load, instead of using the file <a
21.395 + href="#plugins.ini">plugins.ini</a>. The <tt><<i>value</i>></tt>
21.396 + should be the pathname of the plugins file, either absolute path or
21.397 + path relative to the gamedir.
21.398 +
21.399 + <p><a name=mm_execcfg><li><b>mm_execcfg</b></a> Specifies a file
21.400 + that contains cvar or other configs to be exec'd after loading the
21.401 + plugins, instead of using the file <a href="#exec.cfg">exec.cfg</a>.
21.402 + The <tt><<i>value</i>></tt> should be the pathname of the exec
21.403 + file, either absolute path or path relative to the gamedir.
21.404 +
21.405 + <p><a name=mm_gamedll><li><b>mm_gamedll</b></a> Specifies a game or Bot
21.406 + DLL to be used instead of the normal gameDLL. The
21.407 + <tt><<i>value</i>></tt> should be the pathname of the DLL,
21.408 + either absolute path or path relative to the gamedir.
21.409 +
21.410 + <p>This replaces using the <a href="#metagame.ini">metagame.ini</a>
21.411 + file. With previous versions of AdminMod (2.10 and earlier), this same
21.412 + functionality was provided by the file "admin.ini".
21.413 +
21.414 + <p><a name=mm_debug><li><b>mm_debug</b></a> Specifies an initial
21.415 + meta_debug value.
21.416 +
21.417 +</ul>
21.418 +
21.419 +<p>Note that each localinfo field can have only <b>one value</b>. If
21.420 +specified more than once on the command line, only the <b>last</b> one will
21.421 +be recognized. (In particular, trying to use mm_gamedll to load multiple
21.422 +dll-style bots will <b>not</b> work. In a case like that, the multiple
21.423 +dll's must be chained together).
21.424 +
21.425 +<p>Some examples are:
21.426 +<p><pre>
21.427 + ./hlds_run -game cstrike +localinfo mm_pluginsfile mylist.ini
21.428 + ./hlds_run -game cstrike +localinfo mm_execcfg mysettings.cfg
21.429 + ./hlds_run -game cstrike +localinfo mm_gamedll dlls/pod_bot.so
21.430 + ./hlds_run -game cstrike +localinfo mm_debug 7
21.431 +</pre>
21.432 +
21.433 +<p>Note, paths should use unix-style <b>forward</b> slashes (<b>/</b>) and
21.434 +not <b>backward</b> slashes (<b>\</b>), even on windows platforms.
21.435 +
21.436 +
21.437 +<p><br>
21.438 +<a name=commands>
21.439 +<h2>Commands
21.440 +</h2></a>
21.441 +
21.442 +<p>All console command functionality is provide by a single command "meta",
21.443 +with multiple sub-commands:
21.444 +
21.445 +<p><pre>
21.446 + usage: meta <command> [<arguments>]
21.447 + valid commands are:
21.448 + version - display Metamod version info
21.449 + list - list plugins currently loaded
21.450 + cmds - list console cmds registered by plugins
21.451 + cvars - list cvars registered by plugins
21.452 + refresh - load/unload any new/deleted/updated plugins
21.453 + config - show config info loaded from config.ini
21.454 + load <name> - find and load a plugin with the given name
21.455 + unload <plugin> - unload a loaded plugin
21.456 + reload <plugin> - unload a plugin and load it again
21.457 + info <plugin> - show all information about a plugin
21.458 + pause <plugin> - pause a loaded, running plugin
21.459 + unpause <plugin> - unpause a previously paused plugin
21.460 + retry <plugin> - retry a plugin that previously failed its action
21.461 + clear <plugin> - clear a failed plugin from the list
21.462 + force_unload <plugin> - forcibly unload a loaded plugin
21.463 + require <plugin> - exit server if plugin not loaded/running
21.464 +</pre><p>
21.465 +
21.466 +where <tt><plugin></tt> can be either the plugin index number, or a non-ambiguous prefix
21.467 +string matching description or file.
21.468 +
21.469 +<p>Also, a single cvar is available:
21.470 +<pre>
21.471 + meta_debug - set debugging level
21.472 +</pre>
21.473 +
21.474 +<p>For instance with:
21.475 +
21.476 +<p><pre>
21.477 + Currently loaded plugins:
21.478 + description stat pend file vers src load unlod
21.479 + [ 1] Trace HLSDK API RUN - mm_trace_i386.so v0.90 ini ANY Pause
21.480 + [ 2] adminmod RUN - admin_MM.so v2.11 ini Start Start
21.481 + [ 3] stub RUN - mm_stub_i386.so v0.90 ini ANY Pause
21.482 + 2 plugins, 2 running
21.483 +</pre><p>
21.484 +
21.485 +<p>You could then do any of the following to unload the API Trace plugin:
21.486 +<pre>
21.487 + meta unload 1
21.488 + meta unload trace
21.489 + meta unload mm_trace
21.490 +</pre>
21.491 +
21.492 +
21.493 +<br>
21.494 +<a name=plugin-loading>
21.495 +<h2>Plugin Loading/Unloading Process
21.496 +</h2></a>
21.497 +
21.498 +Through the process of loading and unloading, a plugin can be in one of
21.499 +several different states ('stat' column in the 'meta list' output):
21.500 +
21.501 +<ul>
21.502 + <li><b><tt>BADFILE</tt></b> - The plugin file couldn't be found, or it
21.503 + doesn't appear to be a valid Metamod plugin.
21.504 + <li><b><tt>OPENED</tt></b> - The plugin file was found, and is a valid
21.505 + Metamod plugin, and is ready to be loaded.
21.506 + <li><b><tt>FAILED</tt></b> - The plugin file attempted to load or unload,
21.507 + but couldn't complete for some reason.
21.508 + <li><b><tt>RUNNING</tt></b> - The plugin file was loaded and is active
21.509 + and running.
21.510 + <li><b><tt>PAUSED</tt></b> - The plugin file was loaded, but has been
21.511 + temporarily disabled.
21.512 +</ul>
21.513 +
21.514 +Also through the operation process, a plugin can have a pending "action" to
21.515 +next take (indicated by the 'pend' column in the 'meta list' output), and
21.516 +can be one of:
21.517 +
21.518 +<ul>
21.519 + <li><b><tt>LOAD</tt></b> - Open and look at the plugin file.
21.520 + <li><b><tt>ATTACH</tt></b> - Attach the plugin to the running game; ie
21.521 + activate it
21.522 + <li><b><tt>UNLOAD</tt></b> - Remove the plugin from the running game and
21.523 + close the file
21.524 + <li><b><tt>RELOAD</tt></b> - Unload/close and re-open/load the plugin,
21.525 + for instance when the plugin file has changed.
21.526 +</ul>
21.527 +
21.528 +
21.529 +<br>
21.530 +<a name=example-output>
21.531 +<h2>Example Output
21.532 +</h2></a>
21.533 +<p>Here's some other example output:
21.534 +
21.535 +<p><pre>
21.536 + meta info admin
21.537 + name: adminmod
21.538 + desc: Adminmod
21.539 + status: running
21.540 + action: none
21.541 + filename: dlls/admin_MM.so
21.542 + file: admin_MM.so
21.543 + pathname: /home/willday/test/cstrike/dlls/admin_MM.so
21.544 + index: 3
21.545 + source: ini file
21.546 + loadable: at server startup
21.547 + unloadable: at server startup
21.548 + version: 2.11
21.549 + date: 2001/02/04
21.550 + author: Alfred Reynolds <[email protected]>
21.551 + url: http://www.adminmod.org/
21.552 + logtag: ADMIN
21.553 + last loaded: Mon Feb 5 02:06:34 2001
21.554 + DLLAPI functions:
21.555 + GameDLLInit
21.556 + DispatchThink
21.557 + ClientConnect
21.558 + ClientCommand
21.559 + ClientUserInfoChanged
21.560 + ServerActivate
21.561 + 6 functions (dllapi)
21.562 + No DLLAPI-Post functions.
21.563 + No NEWAPI functions.
21.564 + No NEWAPI-Post functions.
21.565 + No Engine functions.
21.566 + No Engine-Post functions.
21.567 + Registered commands:
21.568 + admin_command
21.569 + 1 commands
21.570 + Registered cvars: float value string value
21.571 + users_file 0.000000 users.ini
21.572 + maps_file 0.000000 mapvote.txt
21.573 + default_access 1.000000 1
21.574 + ips_file 0.000000 0
21.575 + reserve_slots 1.000000 1
21.576 + reserve_slots_msg 0.000000 0
21.577 + admin_debug 1.000000 1
21.578 + password_field 0.000000 admin_password
21.579 + alarm_message 0.000000 0
21.580 + alarm_time 0.000000 0
21.581 + use_regex 1.000000 1
21.582 + models_password_field 0.000000 0
21.583 + models_file 0.000000 models.ini
21.584 + models_kick_msg 0.000000 Invalid model
21.585 + script_file 0.000000 cstrike/dlls/admin.amx
21.586 + help_file 0.000000 admin_help.txt
21.587 + vote_freq 360.000000 360
21.588 + encrypt_password 1.000000 1
21.589 + pretty_say 1.000000 1
21.590 + admin_mod_version 2.110000 2.11
21.591 + reserve_type 1.000000 1
21.592 + map_ratio 60.000000 60
21.593 + kick_ratio 75.000000 75
21.594 + words_file 0.000000 0
21.595 + password_timeout 1800.000000 1800
21.596 + file_access_read 0.000000 0
21.597 + file_access_write 0.000000 0
21.598 + public_slots_free 20.000000 20.000000
21.599 + allow_client_exec 0.000000 0
21.600 + admin_balance_teams 0.000000 0
21.601 + 30 cvars
21.602 +
21.603 + meta cmds
21.604 + Registered plugin commands:
21.605 + plugin command
21.606 + [ 1] API trace trace_version
21.607 + [ 2] API trace trace
21.608 + [ 3] API trace untrace
21.609 + [ 4] API trace showtrace
21.610 + [ 5] Adminmod admin_command
21.611 + 5 commands, 5 available
21.612 +
21.613 + meta cvars
21.614 + Registered plugin cvars:
21.615 + plugin cvar float value string value
21.616 + [ 1] API trace trace_debug 3.000000 3.000000
21.617 + [ 2] API trace trace_dllapi 8.000000 8
21.618 + [ 3] API trace trace_newapi 0.000000 0
21.619 + [ 4] API trace trace_engine 8.000000 8
21.620 + [ 5] Adminmod users_file 0.000000 users.ini
21.621 + [ 6] Adminmod maps_file 0.000000 mapvote.txt
21.622 + [ 7] Adminmod default_access 1.000000 1
21.623 + [ 8] Adminmod ips_file 0.000000 0
21.624 + [ 9] Adminmod reserve_slots 1.000000 1
21.625 + [ 10] Adminmod reserve_slots_msg 0.000000 0
21.626 + [ 11] Adminmod admin_debug 1.000000 1
21.627 + [ 12] Adminmod password_field 0.000000 admin_password
21.628 + [ 13] Adminmod alarm_message 0.000000 0
21.629 + [ 14] Adminmod alarm_time 0.000000 0
21.630 + [ 15] Adminmod use_regex 1.000000 1
21.631 + [ 16] Adminmod models_password_fiel 0.000000 0
21.632 + [ 17] Adminmod models_file 0.000000 models.ini
21.633 + [ 18] Adminmod models_kick_msg 0.000000 Invalid model
21.634 + [ 19] Adminmod script_file 0.000000 cstrike/dlls/admin.amx
21.635 + [ 20] Adminmod help_file 0.000000 admin_help.txt
21.636 + [ 21] Adminmod vote_freq 360.000000 360
21.637 + [ 22] Adminmod encrypt_password 1.000000 1
21.638 + [ 23] Adminmod pretty_say 1.000000 1
21.639 + [ 24] Adminmod admin_mod_version 2.110000 2.11
21.640 + [ 25] Adminmod reserve_type 1.000000 1
21.641 + [ 26] Adminmod map_ratio 60.000000 60
21.642 + [ 27] Adminmod kick_ratio 75.000000 75
21.643 + [ 28] Adminmod words_file 0.000000 0
21.644 + [ 29] Adminmod password_timeout 1800.000000 1800
21.645 + [ 30] Adminmod file_access_read 0.000000 0
21.646 + [ 31] Adminmod file_access_write 0.000000 0
21.647 + [ 32] Adminmod public_slots_free 20.000000 20.000000
21.648 + [ 33] Adminmod allow_client_exec 0.000000 0
21.649 + [ 34] Adminmod admin_balance_teams 0.000000 0
21.650 + 34 cvars, 34 available
21.651 +
21.652 + meta unload stub
21.653 + Unloaded plugin 'Stub plugin'
21.654 + Currently loaded plugins:
21.655 + description stat pend file vers src load unlod
21.656 + [ 1] Trace HLSDK API RUN - mm_trace_i386.so v0.90 ini ANY Pause
21.657 + [ 2] adminmod RUN - admin_MM.so v2.11 ini Start Start
21.658 + 2 plugins, 2 running
21.659 +
21.660 + meta load stub
21.661 + Loaded plugin 'stub' successfully
21.662 + Currently loaded plugins:
21.663 + description stat pend file vers src load unlod
21.664 + [ 1] Trace HLSDK API RUN - mm_trace_i386.so v0.90 ini ANY Pause
21.665 + [ 2] adminmod RUN - admin_MM.so v2.11 ini Start Start
21.666 + [ 3] stub RUN - mm_stub_i386.so v0.90 cmd ANY Pause
21.667 + 3 plugins, 3 running
21.668 +</pre>
21.669 +
21.670 +<p>
21.671 +<hr>
21.672 +
21.673 +</body>
21.674 +</HTML>
22.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
22.2 +++ b/doc/html/newapi_notes.html Tue Apr 06 07:36:14 2004 +0000
22.3 @@ -0,0 +1,62 @@
22.4 +<!-- vi: set ts=4 sw=4 : -->
22.5 +<!-- vim: set tw=75 : -->
22.6 +
22.7 +<HTML>
22.8 +<head>
22.9 +<title>HLSDK NEWAPI Notes</title>
22.10 +</head>
22.11 +<body>
22.12 +
22.13 +<h1>HLSDK NEWAPI Notes
22.14 +</h1>
22.15 +
22.16 +<hr>
22.17 +<ul>
22.18 + <li><a href=#OnFreeEntPrivateData>OnFreeEntPrivateData</a>
22.19 + <li><a href=#GameShutdown>GameShutdown</a>
22.20 + <li><a href=#ShouldCollide>ShouldCollide</a>
22.21 +</ul>
22.22 +
22.23 +<b>NOTE</b>: No examples of these found in SDK...
22.24 +
22.25 +<p>
22.26 +
22.27 +<hr><h3><tt><a name="OnFreeEntPrivateData">OnFreeEntPrivateData</a></tt></h3>
22.28 +<dd><tt>void OnFreeEntPrivateData(edict_t pEnt);</tt><p>
22.29 +<i>from engine/eiface.h:</i><br>
22.30 +<blockquote><tt>
22.31 + Called right before the object's memory is freed. Calls its destructor.
22.32 +</tt></blockquote>
22.33 +<p><i>comments:</i><br>
22.34 +<blockquote>
22.35 + See also <a
22.36 + href="http://list.valvesoftware.com/pipermail/hlcoders/2002-January/001397.html"
22.37 + >Ken Birdwell on constructors</a>, from the HLCoders list.
22.38 + <br>Added in SDK 2.0.
22.39 +</blockquote>
22.40 +
22.41 +<hr><h3><tt><a name="GameShutdown">GameShutdown</a></tt></h3>
22.42 +<dd><tt>void GameShutdown(void);</tt><p>
22.43 +<p><i>comments:</i><br>
22.44 +<blockquote>
22.45 + Added in SDK 2.0.
22.46 +</blockquote>
22.47 +
22.48 +<hr><h3><tt><a name="ShouldCollide">ShouldCollide</a></tt></h3>
22.49 +<dd><tt>int ShouldCollide(edict_t *pentTouched, edict_t *pentOther);</tt><p>
22.50 +<i>from [email protected], via HLCoders:</i><br>
22.51 +<blockquote><tt>
22.52 + ..a hook that can override if any two entities should collide
22.53 + when they try to pass through each other.
22.54 +</tt></blockquote>
22.55 +<p><i>comments:</i><br>
22.56 +<blockquote>
22.57 + Mugsy from DoD indicates that the return value for normal operation is 1.
22.58 + <br>Added in SDK 2.0.
22.59 +</blockquote>
22.60 +
22.61 +<p>
22.62 +<hr>
22.63 +
22.64 +</body>
22.65 +</HTML>
23.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
23.2 +++ b/doc/html/release_notes.html Tue Apr 06 07:36:14 2004 +0000
23.3 @@ -0,0 +1,125 @@
23.4 +<!-- vi: set ts=4 sw=4 : -->
23.5 +<!-- vim: set tw=75 : -->
23.6 +
23.7 +<HTML>
23.8 +<head>
23.9 +<title>Metamod Release Notes</title>
23.10 +</head>
23.11 +<body>
23.12 +
23.13 +<h1>Release Notes
23.14 +</h1>
23.15 +
23.16 +<a name=major.1.17>
23.17 +<h2>Major changes with Metamod 1.17
23.18 +</h2></a>
23.19 +
23.20 +<ul>
23.21 +
23.22 +<p><li> New cvar "<b><tt>metamod_version</tt></b>" that can be queried from
23.23 +client game browsers.
23.24 +
23.25 +<p><li> New console commands available to clients (much like the existing
23.26 +server console commands):
23.27 +
23.28 + <p><ul>
23.29 + <li> <b><tt>"meta version"</tt></b> prints out version information
23.30 + (date, compile type, etc).
23.31 + <li> <b><tt>"meta list"</tt></b> shows a list of the plugins running on
23.32 + the server (name, author, version, etc).
23.33 + </ul>
23.34 +
23.35 +<p><li> New file <a
23.36 +href="metamod.html#config.ini"><tt><b>config.ini</b></tt></a> to provide a
23.37 +more reliable and flexible method of specifying configuration options.
23.38 +At the moment, the recognized options mirror those from <a
23.39 +href="metamod.html#localinfo">+localinfo</a>, ie:
23.40 +
23.41 + <p>
23.42 + <ul>
23.43 + <li> <tt><b>debuglevel</b> <i><number></i></tt>
23.44 + <li> <tt><b>gamedll</b> <i><path></i></tt>
23.45 + <li> <tt><b>plugins_file</b> <i><path></i></tt>
23.46 + <li> <tt><b>exec_cfg</b> <i><path></i></tt>
23.47 + </ul>
23.48 +
23.49 +<p>Default path is "<tt>addons/metamod/config.ini</tt>" but can be
23.50 +overridden with "<tt>+localinfo mm_configfile</tt>".
23.51 +
23.52 +<p>Also, new console command <tt><b>"meta config"</b></tt> to display this
23.53 +information.
23.54 +
23.55 +<p><li> New console command <tt><b>"meta require"</b></tt> to force the
23.56 +server to exit if the specified plugin isn't loaded/running. Intended for
23.57 +use in server.cfg or metaexec.cfg, to keep the server from starting up if
23.58 +desired plugins don't load. For example:
23.59 +
23.60 + <p>
23.61 + <ul>
23.62 + <li> <tt>meta require adminmod</tt>
23.63 + <li> <tt>meta require 1</tt>
23.64 + </ul>
23.65 +
23.66 +<p>The former requires that a plugin with the substring "adminmod" is found
23.67 +loaded and running. The latter requires that the plugin in slot 1 is
23.68 +loaded and running.
23.69 +
23.70 +<p><li> If an override gamedll is specified and found to be invalid or
23.71 +missing, Metamod will now exit with an appropriate error message, rather
23.72 +than just falling back to the auto-detected gamedll. This should provide
23.73 +more immediate and useful feedback, and help prevent some confusion.
23.74 +
23.75 +</ul>
23.76 +
23.77 +<p>
23.78 +<hr>
23.79 +
23.80 +<a name=compat.1.13>
23.81 +<h2>Incompatible changes with Metamod 1.13
23.82 +</h2></a>
23.83 +
23.84 +<ul>
23.85 +
23.86 +<li> Config file <tt><b>metagame.ini</b></tt> is no longer supported. This
23.87 +file was deprecated in Metamod 1.08 (2001/06/16). Use instead the "<a
23.88 +href="metamod.html#localinfo">+localinfo mm_gamedll</a>" option.
23.89 +
23.90 +</ul>
23.91 +
23.92 +
23.93 +<a name=major.1.13>
23.94 +<h2>Major changes with Metamod 1.13
23.95 +</h2></a>
23.96 +
23.97 +<ul>
23.98 +
23.99 +<li> New config file names and locations, per the <a
23.100 +href="http://www.unitedadmins.com/info_addon_dev_standards.aspx">Addon
23.101 +Development Standard</a> rev 1.00, developed on the <a
23.102 +href="http://list.valvesoftware.com/mailman/listinfo/hlds_apps">hlds_apps</a>
23.103 +list.
23.104 +
23.105 + <p> Default config file locations are now:
23.106 + <ul>
23.107 + <li> $gamedir/addons/metamod/plugins.ini
23.108 + <li> $gamedir/addons/metamod/exec.cfg
23.109 + </ul>
23.110 +
23.111 + <p> Previous config file locations are also supported for backwards
23.112 + compability:
23.113 +
23.114 + <ul>
23.115 + <li> $gamedir/metamod.ini
23.116 + <li> $gamedir/metaexec.cfg
23.117 + </ul>
23.118 +
23.119 + <p> Note that the pathnames in plugins.ini are unchanged, and are still
23.120 + relative to the gamedir.
23.121 +
23.122 +</ul>
23.123 +
23.124 +<p>
23.125 +<hr>
23.126 +
23.127 +</body>
23.128 +</HTML>
24.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
24.2 +++ b/doc/html/supportedmods.html Tue Apr 06 07:36:14 2004 +0000
24.3 @@ -0,0 +1,98 @@
24.4 +<!-- vi: set ts=4 sw=4 : -->
24.5 +<!-- vim: set tw=75 : -->
24.6 +
24.7 +<HTML>
24.8 +<head>
24.9 +<title>Metamod Supported Mods/Games</title>
24.10 +</head>
24.11 +<body>
24.12 +
24.13 +<a name=supported>
24.14 +<h1>Supported Mods/Games
24.15 +</h1>
24.16 +</a>
24.17 +
24.18 +Metamod includes support for the following mods, with version and last
24.19 +update if known.
24.20 +
24.21 +<p>
24.22 +To get support added for a new Mod, or for an updated version of a Mod, see
24.23 +<a href="gamesupport.html">Adding game support</a>.
24.24 +
24.25 +<p>
24.26 +<table border=5 rules=all cellpadding=5>
24.27 +<tr> <th>Name</th> <th>Version</th> <th>Last update</th> <th>Ent list</th> <th>Comments</th></tr>
24.28 +
24.29 +<tr><td><a href="http://ahl.action-web.net/">Action Half-Life</a></td><td>Beta 4</td><td>2001/06/14</td><td><a href="http://metamod.org/dl/metamod/ents/action">[ents]</a></td></tr>
24.30 +<tr><td><a href="-">Adrenalinegamer 3.x</a></td><td>-</td><td>2001/../..</td><td><a href="http://metamod.org/dl/metamod/ents/adgamer3">[ents]</a></td></tr>
24.31 +<tr><td><a href="-">Adrenalinegamer 4.x</a></td><td>v6.0</td><td>2002/10/06</td><td><a href="http://metamod.org/dl/metamod/ents/adgamer4">[ents]</a></td></tr>
24.32 +<tr><td><a href="-">Arg!</a></td><td>v1.0</td><td>2001/../..</td><td><a href="http://metamod.org/dl/metamod/ents/arg">[ents]</a></td></tr>
24.33 +<tr><td><a href="http://www.halflifeitalia.com/azuresheep/">Azure Sheep</a></td><td>v1.0</td><td>2002/11/26</td><td><a href="http://metamod.org/dl/metamod/ents/azuresheep">[ents]</a></td></tr>
24.34 +<tr><td><a href="http://www.bgmod.com/">The Battle Grounds</a></td><td>v1.2.1</td><td>2003/11/15</td><td><a href="http://metamod.org/dl/metamod/ents/battlegrounds">[ents]</a></td></tr>
24.35 +<tr><td><a href="-">Bot</a></td><td>-</td><td>2001/../..</td><td><a href="http://metamod.org/dl/metamod/ents/bot">[ents]</a></td></tr>
24.36 +<tr><td><a href="http://www.planethalflife.com/bumpercars/">Bumper Cars</a></td><td>Alpha</td><td>2003/05/02</td><td><a href="http://metamod.org/dl/metamod/ents/bumpercars">[ents]</a></td></tr>
24.37 +<tr><td><a href="http://www.buzzybots.dk/">BuzzyBots</a></td><td>v2.3</td><td>2002/11/26</td><td><a href="http://metamod.org/dl/metamod/ents/buzzybots">[ents]</a></td></tr>
24.38 +<tr><td><a href="http://www.counter-strike.net/">Counter-Strike</a></td><td>v1.6</td><td>2003/11/15</td><td><a href="http://metamod.org/dl/metamod/ents/cstrike">[ents]</a></td></tr>
24.39 +<tr><td><a href="http://www.desertcrisis.com/">Desert Crisis</a></td><td>v1.5</td><td>2003/04/09</td><td><a href="http://metamod.org/dl/metamod/ents/desertcrisis">[ents]</a></td></tr>
24.40 +<tr><td><a href="-">Deathmatch Classic</a></td><td>v1.0</td><td>2001/06/07</td><td><a href="http://metamod.org/dl/metamod/ents/dmc">[ents]</a></td></tr>
24.41 +<tr><td><a href="http://www.dayofdefeatmod.com/">Day of Defeat</a></td><td>v1.0</td><td>2003/05/03</td><td><a href="http://metamod.org/dl/metamod/ents/dod">[ents]</a></td></tr>
24.42 +<tr><td><a href="http://www.digitalpaintball.net/">Digital Paintball</a></td><td>v1.0</td><td>2002/10/06</td><td><a href="http://metamod.org/dl/metamod/ents/dpaintball">[ents]</a></td></tr>
24.43 +<tr><td><a href="http://dmz.flagrun.net/">Dragon Mod Z</a></td><td>v1.7</td><td>2002/10/06</td><td><a href="http://metamod.org/dl/metamod/ents/dragonmodz">[ents]</a></td></tr>
24.44 +<tr><td><a href="http://www.esforces.com/">Earth's Special Forces</a></td><td>Beta 1.1</td><td>2003/07/30</td><td><a href="http://metamod.org/dl/metamod/ents/esforces">[ents]</a></td></tr>
24.45 +<tr><td><a href="http://www.whatisexistence.com/">Existence</a></td><td>Beta 1.3</td><td>2001/09/19</td><td><a href="http://metamod.org/dl/metamod/ents/existence">[ents]</a></td></tr>
24.46 +<tr><td><a href="http://www.firearmsmod.com/">Firearms</a></td><td>v2.8</td><td>2003/11/15</td><td><a href="http://metamod.org/dl/metamod/ents/firearms">[ents]</a></td></tr>
24.47 +<tr><td><a href="http://www.firearms25mod.tk/">Retro Firearms</a></td><td>v2.5</td><td>2002/01/11</td><td><a href="http://metamod.org/dl/metamod/ents/retrofirearms">[ents]</a></td></tr>
24.48 +<tr><td><a href="-">Freeze</a></td><td>-</td><td>2001/../..</td><td><a href="http://metamod.org/dl/metamod/ents/freeze">[ents]</a></td></tr>
24.49 +<tr><td><a href="http://www.frontlineforce.com/">Frontline Force</a></td><td>v1.3</td><td>2001/06/10</td><td><a href="http://metamod.org/dl/metamod/ents/flf">[ents]</a></td></tr>
24.50 +<tr><td><a href="http://gangstawars.thebackburner.com/">GangstaWars</a></td><td>v2.6</td><td>2001/../..</td><td><a href="http://metamod.org/dl/metamod/ents/gangstawars">[ents]</a></td></tr>
24.51 +<tr><td><a href="http://www.gangwars.net/">Gangwars</a></td><td>Beta 1.0</td><td>2002/04/21</td><td><a href="http://metamod.org/dl/metamod/ents/gangwars">[ents]</a></td></tr>
24.52 +<tr><td><a href="http://www.sierrastudios.com/games/opposingforce/">Opposing Force</a></td><td>-</td><td>2001/../..</td><td><a href="http://metamod.org/dl/metamod/ents/opforce">[ents]</a></td></tr>
24.53 +<tr><td><a href="http://www.Globalwarfare.net/">Global Warfare</a></td><td>Beta 2.0</td><td>2002/11/26</td><td><a href="http://metamod.org/dl/metamod/ents/globalwarfare">[ents]</a></td></tr>
24.54 +<tr><td><a href="http://www.goldeneye-mod.net/">Goldeneye</a></td><td>v1.9C</td><td>2002/04/24</td><td><a href="http://metamod.org/dl/metamod/ents/goldeneye">[ents]</a></td></tr>
24.55 +<tr><td><a href="http://www.hlrally.net/">HL-Rally</a></td><td>Beta 1.0</td><td>2003/11/15</td><td><a href="http://metamod.org/dl/metamod/ents/hlrally">[ents]</a></td></tr>
24.56 +<tr><td><a href="http://www.planethalflife.com/holywars/">Holy Wars</a></td><td>Beta 2</td><td>2002/10/06</td><td><a href="http://metamod.org/dl/metamod/ents/holywars">[ents]</a></td></tr>
24.57 +<tr><td><a href="http://www.planethalflife.com/ios/">International Online Soccer</a></td><td>v2.0</td><td>2003/07/30</td><td><a href="http://metamod.org/dl/metamod/ents/iosoccer">[ents]</a></td></tr>
24.58 +<tr><td><a href="http://justicedepartment.co.uk/">Judgement</a></td><td>v1.0</td><td>2001/05/26</td><td><a href="http://metamod.org/dl/metamod/ents/judgement">[ents]</a></td></tr>
24.59 +<tr><td><a href="http://www.planethalflife.com/kanonball/">Kanonball</a></td><td>v1.01</td><td>2003/11/15</td><td><a href="http://metamod.org/dl/metamod/ents/kanonball">[ents]</a></td></tr>
24.60 +<tr><td><a href="http://www.monkeystrike.com/">Monkeystrike</a></td><td>v1.2</td><td>2003/07/30</td><td><a href="http://metamod.org/dl/metamod/ents/monkeystrike">[ents]</a></td></tr>
24.61 +<tr><td><a href="http://www.planethalflife.com/morbid/">Morbid Inclination</a></td><td>v1.0</td><td>2003/05/08</td><td><a href="http://metamod.org/dl/metamod/ents/morbid">[ents]</a></td></tr>
24.62 +<tr><td><a href="http://www.natural-selection.org/">Natural Selection</a></td><td>v2.0</td><td>2003/07/30</td><td><a href="http://metamod.org/dl/metamod/ents/naturalselection">[ents]</a></td></tr>
24.63 +<tr><td><a href="http://www.kixar.com/">OeL Half-Life</a></td><td>v4.0</td><td>2002/10/06</td><td><a href="http://metamod.org/dl/metamod/ents/oel">[ents]</a></td></tr>
24.64 +<tr><td><a href="http://og.portailmods.com/">Over Ground</a></td><td>Beta 1.0</td><td>2003/11/15</td><td><a href="http://metamod.org/dl/metamod/ents/overground">[ents]</a></td></tr>
24.65 +<tr><td><a href="http://www.planethalflife.com/outlawsmod/">Outlawsmod</a></td><td>Beta 1.5</td><td>2002/11/26</td><td><a href="http://metamod.org/dl/metamod/ents/outlaws">[ents]</a></td></tr>
24.66 +<tr><td><a href="http://www.eatsleepcode.ca/~osjb/">Open-Source Jailbreak</a></td><td>v0.95a</td><td>2001/05/26</td><td><a href="http://metamod.org/dl/metamod/ents/osjailbreak">[ents]</a></td></tr>
24.67 +<tr><td><a href="http://www.planethalflife.com/oz/">Oz Deathmatch</a></td><td>v2.4.1</td><td>2001/12/21</td><td><a href="http://metamod.org/dl/metamod/ents/oz">[ents]</a></td></tr>
24.68 +<tr><td><a href="http://www.paintball-mod.net/">Paintball</a></td><td>v2.0</td><td>2001/04/30</td><td><a href="http://metamod.org/dl/metamod/ents/paintball">[ents]</a></td></tr>
24.69 +<tr><td><a href="http://www.public-enemy.org/">Public Enemy</a></td><td>Beta 1.0</td><td>2003/05/02</td><td><a href="http://metamod.org/dl/metamod/ents/publicenemy">[ents]</a></td></tr>
24.70 +<tr><td><a href="-">Phineas Bot</a></td><td>-</td><td>2001/../..</td><td><a href="http://metamod.org/dl/metamod/ents/phineas">[ents]</a></td></tr>
24.71 +<tr><td><a href="http://ponr.half-life.hu/">Point of No Return</a></td><td>Beta 4.0</td><td>2003/08/01</td><td><a href="http://metamod.org/dl/metamod/ents/pointofnoreturn">[ents]</a></td></tr>
24.72 +<tr><td><a href="http://www.retro-cs.com/">Retro Counter-Strike</a></td><td>v2.5</td><td>2002/08/24</td><td><a href="http://metamod.org/dl/metamod/ents/retrocs">[ents]</a></td></tr>
24.73 +<tr><td><a href="http://www.gunmanchronicles.com/">Gunman Chronicles</a></td><td>-</td><td>2001/07/05</td><td><a href="http://metamod.org/dl/metamod/ents/gunman">[ents]</a></td></tr>
24.74 +<tr><td><a href="-">Ricochet</a></td><td>v1.0</td><td>2002/07/01</td><td><a href="http://metamod.org/dl/metamod/ents/ricochet">[ents]</a></td></tr>
24.75 +<tr><td><a href="http://www.planethalflife.com/rocketcrowbar/">Rocket Crowbar</a></td><td>v1.9</td><td>2002/11/26</td><td><a href="http://metamod.org/dl/metamod/ents/rocketcrowbar">[ents]</a></td></tr>
24.76 +<tr><td><a href="http://www.rivalspecies.com/">Rival Species</a></td><td>v1.0</td><td>2003/05/02</td><td><a href="http://metamod.org/dl/metamod/ents/rivalspecies">[ents]</a></td></tr>
24.77 +<tr><td><a href="http://www.telefragged.com/thefatal/scihunt.shtml">Scientist Hunt</a></td><td>v1.2</td><td>2001/09/19</td><td><a href="http://metamod.org/dl/metamod/ents/scihunt">[ents]</a></td></tr>
24.78 +<tr><td><a href="http://www.planethalflife.com/si/">Science & Industry</a></td><td>v0.97</td><td>2001/05/23</td><td><a href="http://metamod.org/dl/metamod/ents/si">[ents]</a></td></tr>
24.79 +<tr><td><a href="http://www.planethalflife.com/snowwar/">Snow-War</a></td><td>v1.0</td><td>2001/12/29</td><td><a href="http://metamod.org/dl/metamod/ents/snowwar">[ents]</a></td></tr>
24.80 +<tr><td><a href="http://www.stargatetc.com/">StargateTC</a></td><td>Beta 2.2</td><td>2002/11/26</td><td><a href="http://metamod.org/dl/metamod/ents/stargatetc">[ents]</a></td></tr>
24.81 +<tr><td><a href="http://www.svencoop.com/">Sven Coop</a></td><td>v2.1</td><td>2003/05/02</td><td><a href="http://metamod.org/dl/metamod/ents/svencoop">[ents]</a></td></tr>
24.82 +<tr><td><a href="http://swarm.edgegaming.com/">Swarm</a></td><td>-</td><td>2001/../..</td><td><a href="http://metamod.org/dl/metamod/ents/swarm">[ents]</a></td></tr>
24.83 +<tr><td><a href="http://sierrastudios.com/games/tf1.5/">Team Fortress Classic</a></td><td>v1.1.1.1</td><td>2003/01/18</td><td><a href="http://metamod.org/dl/metamod/ents/tfc">[ents]</a></td></tr>
24.84 +<tr><td><a href="http://planethalflife.com/thewastes/">The Wastes</a></td><td>RC 1.2</td><td>2003/07/30</td><td><a href="http://metamod.org/dl/metamod/ents/wastes">[ents]</a></td></tr>
24.85 +<tr><td><a href="http://www.project-timeless.de/">Project Timeless</a></td><td>Beta 1.0</td><td>2003/11/15</td><td><a href="http://metamod.org/dl/metamod/ents/timeless">[ents]</a></td></tr>
24.86 +<tr><td><a href="http://www.tourofdutymod.com/">Tour of Duty</a></td><td>v1.1 Beta</td><td>2002/11/26</td><td><a href="http://metamod.org/dl/metamod/ents/tod">[ents]</a></td></tr>
24.87 +<tr><td><a href="http://th.fragoff.net/">Train Hunters</a></td><td>Beta 1.0</td><td>2002/04/29</td><td><a href="http://metamod.org/dl/metamod/ents/trainhunters">[ents]</a></td></tr>
24.88 +<tr><td><a href="http://www.specialistsmod.net/">The Specialists</a></td><td>Beta 2.0</td><td>2003/07/31</td><td><a href="http://metamod.org/dl/metamod/ents/specialists">[ents]</a></td></tr>
24.89 +<tr><td><a href="http://www.entertheunderworld.com/">Underworld Bloodline</a></td><td>v2.0</td><td>2003/11/15</td><td><a href="http://metamod.org/dl/metamod/ents/underworld">[ents]</a></td></tr>
24.90 +<tr><td><a href="http://www.sierrastudios.com/games/half-life/bot.html">Half-Life Deathmatch</a></td><td>v1.1.0.6</td><td>2001/../..</td><td><a href="http://metamod.org/dl/metamod/ents/hldm">[ents]</a></td></tr>
24.91 +<tr><td><a href="http://www.planethalflife.com/vampire/">VampireSlayer</a></td><td>Chapter V</td><td>2003/02/08</td><td><a href="http://metamod.org/dl/metamod/ents/vampireslayer">[ents]</a></td></tr>
24.92 +<tr><td><a href="http://www.wantedhl.com/">Wanted!</a></td><td>v1.5</td><td>2001/07/11</td><td><a href="http://metamod.org/dl/metamod/ents/wanted">[ents]</a></td></tr>
24.93 +<tr><td><a href="http://wastelandhalflife.com/">Wasteland</a></td><td>Beta 2</td><td>2001/06/07</td><td><a href="http://metamod.org/dl/metamod/ents/wasteland">[ents]</a></td></tr>
24.94 +<tr><td><a href="http://wwars.hlcenter.com/">Weapon Wars</a></td><td>v0.3</td><td>2001/08/13</td><td><a href="http://metamod.org/dl/metamod/ents/weaponwars">[ents]</a></td></tr>
24.95 +<tr><td><a href="http://www.planethalflife.com/wizardwars/">Wizard Wars</a></td><td>v1.0</td><td>2001/07/30</td><td><a href="http://metamod.org/dl/metamod/ents/wizardwars">[ents]</a></td></tr>
24.96 +<tr><td><a href="http://www.wormshl.com/">WormsHL</a></td><td>Beta 3.0</td><td>2003/05/02</td><td><a href="http://metamod.org/dl/metamod/ents/wormshl">[ents]</a></td></tr>
24.97 +
24.98 +</table>
24.99 +</body>
24.100 +</HTML>
24.101 +
25.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
25.2 +++ b/doc/html/trace.html Tue Apr 06 07:36:14 2004 +0000
25.3 @@ -0,0 +1,88 @@
25.4 +<!-- vi: set ts=4 sw=4 : -->
25.5 +<!-- vim: set tw=75 : -->
25.6 +
25.7 +<HTML>
25.8 +<head>
25.9 +<title>Metamod TraceAPI Plugin</title>
25.10 +</head>
25.11 +<body>
25.12 +
25.13 +<h1>TraceAPI plugin
25.14 +</h1>
25.15 +
25.16 +<p> This was originally intended as a (more or less) complete example of a
25.17 +Metamod plugin. It catches <b><i>every</i></b> call available to it (dll
25.18 +routines both before and after the game, as well as engine functions both
25.19 +before and after the engine).
25.20 +
25.21 +<p> Because it catches every routine, I figured I'd give it the ability to
25.22 +log when given routines are called, so it became an "api tracing" plugin.
25.23 +:)
25.24 +
25.25 +<p> This can actually be useful for tracking the operation of the HL
25.26 +engine, as well as that of a particular HL game mod.
25.27 +
25.28 +<p> It recognizes the following server cvars:
25.29 +
25.30 +<p><pre>
25.31 + // Tracing debug levels; higher values log increasingly frequent routines.
25.32 + // Currently 0-50. See "api_info.cpp" for the debug levels of various
25.33 + // functions.
25.34 +
25.35 + // Trace level for dllapi routines.
25.36 + trace_dllapi
25.37 +
25.38 + // Trace level for "new" dllapi routines.
25.39 + trace_newapi
25.40 +
25.41 + // Trace level for engine functions.
25.42 + trace_engine
25.43 +
25.44 + // Enable unlimited trace logging. By default (as of v1.06), it only
25.45 + // logs _one_ trace message per second, to keep from overwhelming the
25.46 + // server. Set to "1" to enable unlimited logging. (Default "0")
25.47 + trace_unlimit
25.48 +
25.49 + // General debug level, independent of trace levels. Not currently used.
25.50 + trace_debug
25.51 +
25.52 +</pre>
25.53 +
25.54 +<p> and the following server commands:
25.55 +
25.56 +<p><pre>
25.57 + // Enable tracing of a given routine, independent of "trace_*" level.
25.58 + // See the list of routine names in "api_info.cpp". Case is insignificant.
25.59 + trace set <APIroutine>
25.60 +
25.61 + // Disable tracing of a given routine, iff previously enabled with "trace".
25.62 + // Doesn't affect routines being logged via "trace_*" level.
25.63 + trace unset <APIroutine>
25.64 +
25.65 + // Show the routines being traced.
25.66 + trace show
25.67 +
25.68 + // List the various routines that can be traced.
25.69 + trace list dllapi
25.70 + trace list newapi
25.71 + trace list engine
25.72 + trace list all
25.73 +
25.74 + // Prints out version/date/etc.
25.75 + trace version
25.76 +</pre>
25.77 +
25.78 +<p> Note the information it logs on each routine invocation is, at the
25.79 +moment, relatively minimal. I included information that seemed obvious
25.80 +(args for a <tt>ClientCommand</tt>, etc), and I've added info for other
25.81 +routines as I've come across a need. Most routines I still know too little
25.82 +about to log any particular information (<tt>CreateBaseline</tt>, etc).
25.83 +Feel free to add information that you're interested in to the log messages
25.84 +in the routines; the examples should be pretty self-explanatory. I'd be
25.85 +interested in knowing as well, for adding it to the distribution code.
25.86 +
25.87 +<p>
25.88 +<hr>
25.89 +
25.90 +</body>
25.91 +</HTML>
26.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
26.2 +++ b/doc/html/wdmisc.html Tue Apr 06 07:36:14 2004 +0000
26.3 @@ -0,0 +1,48 @@
26.4 +<!-- vi: set ts=4 sw=4 : -->
26.5 +<!-- vim: set tw=75 : -->
26.6 +
26.7 +<HTML>
26.8 +<head>
26.9 +<title>Metamod WDMisc Plugin</title>
26.10 +</head>
26.11 +<body>
26.12 +
26.13 +<h1>WDMisc plugin
26.14 +</h1>
26.15 +
26.16 +<p> This is a simple plugin that I use as a testbed for various features
26.17 +and other things I need to try from a plugin.
26.18 +
26.19 +<p> It currently provides two features:
26.20 +
26.21 +<ul>
26.22 +
26.23 + <p><li> a cvar "bounce" that, if set to 1, will exit the server at map
26.24 + change. I use this when I need to shutdown or the server, and don't
26.25 + want to kill it in the middle of a map, nor watch the server constantly
26.26 + until the timelimit expires.
26.27 +
26.28 + <p><li> it prints a centersay to all the players whenever someone in
26.29 + Counter-Strike plants the bomb. This was done basically as a
26.30 + proof-of-concept for catching certain game-events that aren't otherwise
26.31 + triggered by the HL API. It works only by examining every log message
26.32 + that the server generates, and checking to see if it includes the string
26.33 + indicating the particular event in question (in this case
26.34 + "Planted_The_Bomb").
26.35 +
26.36 + <p>Although this works, it is really a rather <i><b>poor</b></i>
26.37 + solution to the problem, as it assumes a <i><b>lot</b></i> of
26.38 + string-compares, which <i>can</i> seriously degrade the performance of
26.39 + the server. I did try to take as many short-cuts as reasonable in the
26.40 + code, to decrease the amount of string-comparing going on, which makes
26.41 + the code a bit less readable than doing just a "strstr" on the log line.
26.42 +
26.43 +</ul>
26.44 +
26.45 +Other features to be added/removed in the future...
26.46 +
26.47 +<p>
26.48 +<hr>
26.49 +
26.50 +</body>
26.51 +</HTML>
27.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
27.2 +++ b/doc/plugins.ini Tue Apr 06 07:36:14 2004 +0000
27.3 @@ -0,0 +1,35 @@
27.4 +// vim: set ft=c :
27.5 +//
27.6 +// Format is as follows:
27.7 +// <platform> <path> <description>
27.8 +//
27.9 +// Fields are whitespace delimited (tabs/spaces).
27.10 +//
27.11 +// - Platform must be either "linux" or "win32".
27.12 +// - Path can be either an absolute pathname, or a pathname relative to the
27.13 +// gamedir. Paths should use unix-style forward slashes (/) rather than
27.14 +// windows-style backslashes (\), even on windows platforms. Also, the
27.15 +// path (once expanded to full path name) is expected to be unique within
27.16 +// the list of plugins. Thus, a plugin with a fullpathname matching that
27.17 +// of a previous plugin is considered a duplicate, and is not loaded.
27.18 +// - Description is optional, and replaces the plugin's internal name in
27.19 +// console output and log messages.
27.20 +//
27.21 +// Comments are either c++ style ("//") or unix shell style ("#"), and
27.22 +// can appear ONLY at the beginning of a line.
27.23 +//
27.24 +// Note that the plugins are loaded and accessed in the order specified, so
27.25 +// ordering CAN be important, depending on the plugin(s).
27.26 +//
27.27 +// The following are examples of valid lines.
27.28 +//
27.29 +
27.30 +// linux dlls/mybot.so
27.31 +# win32 dlls/mybot-old.dll Mybot old
27.32 +win32 dlls/mybot.dll Mybot current
27.33 +linux /tmp/stub_mm_i386.so
27.34 +win32 /tmp/stub_mm_i386.dll
27.35 +linux ../dlls/trace_mm_i386.so
27.36 +win32 ../dlls/trace_mm_i386.dll
27.37 +linux dlls/admin_MM_i386.so
27.38 +win32 dlls/admin_MM_i386.dll
28.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
28.2 +++ b/doc/txt/Index.txt Tue Apr 06 07:36:14 2004 +0000
28.3 @@ -0,0 +1,27 @@
28.4 +Metamod
28.5 +=-=-=-=
28.6 +
28.7 +Metamod is a plugin/DLL manager that sits between the Half-Life Engine and
28.8 +an HL Game mod, allowing the dynamic loading/unloading of mod-like DLL
28.9 +plugins to add functionality to the HL server or game mod.
28.10 +
28.11 +--------------------------------------------------------------------------
28.12 +
28.13 +See metamod.org (metamod.org/) for news, downloads, and plugin links.
28.14 +
28.15 +--------------------------------------------------------------------------
28.16 +
28.17 +Metamod Docs Other HLDS info
28.18 +
28.19 + - About metamod * SDK DLLAPI Notes
28.20 + - FAQ * SDK NEWAPI Notes
28.21 + - Using metamod * SDK Engine Notes
28.22 + - Release Notes
28.23 + - Game/Mod support * Related links & books
28.24 + - Trace Plugin * Mailing lists
28.25 + - WDMisc Plugin
28.26 + - Coding for metamod
28.27 +
28.28 +--------------------------------------------------------------------------
28.29 +
28.30 +<[email protected]>
29.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
29.2 +++ b/doc/txt/a.txt Tue Apr 06 07:36:14 2004 +0000
29.3 @@ -0,0 +1,219 @@
29.4 +Supported Games
29.5 +=-=-=-=-=-=-=-=
29.6 +
29.7 +Metamod includes support for the following mods, with version and last
29.8 +update if known.
29.9 +
29.10 +To get support added for a new Mod, or for an updated version of a Mod,
29.11 +see Adding game support.
29.12 +
29.13 ++------------------------------------------------------------------------+
29.14 +| Name | Version | Last | Ent | Comments |
29.15 +| | | update | list | |
29.16 +|--------------------------------+----------+--------+--------+----------|
29.17 +| Action Half-Life | Beta 4 | 2001/ | [ents] | |
29.18 +| (ahl.action-web.net/) | | 06/14 | | |
29.19 +|--------------------------------+----------+--------+--------+----------|
29.20 +| Adrenalinegamer 3.x | - | 2001 | [ents] | |
29.21 +| | | /../.. | | |
29.22 +|--------------------------------+----------+--------+--------+----------|
29.23 +| Adrenalinegamer 4.x | v6.0 | 2002/ | [ents] | |
29.24 +| | | 10/06 | | |
29.25 +|--------------------------------+----------+--------+--------+----------|
29.26 +| Arg! | v1.0 | 2001 | [ents] | |
29.27 +| | | /../.. | | |
29.28 +|--------------------------------+----------+--------+--------+----------|
29.29 +| Azure Sheep | | 2002/ | | |
29.30 +| (www.halflifeitalia.com/ | v1.0 | 11/26 | [ents] | |
29.31 +| azuresheep/) | | | | |
29.32 +|--------------------------------+----------+--------+--------+----------|
29.33 +| The Battle Grounds | v1.2 | 2003/ | [ents] | |
29.34 +| (www.bgmod.com/) | | 07/30 | | |
29.35 +|--------------------------------+----------+--------+--------+----------|
29.36 +| Bot | - | 2001 | [ents] | |
29.37 +| | | /../.. | | |
29.38 +|--------------------------------+----------+--------+--------+----------|
29.39 +| Bumper Cars | | 2003/ | | |
29.40 +| (www.planethalflife.com/ | Alpha | 05/02 | [ents] | |
29.41 +| bumpercars/) | | | | |
29.42 +|--------------------------------+----------+--------+--------+----------|
29.43 +| BuzzyBots (www.buzzybots.dk/) | v2.3 | 2002/ | [ents] | |
29.44 +| | | 11/26 | | |
29.45 +|--------------------------------+----------+--------+--------+----------|
29.46 +| Counter-Strike | v1.6 | 2003/ | [ents] | |
29.47 +| (www.counter-strike.net/) | | 01/18 | | |
29.48 +|--------------------------------+----------+--------+--------+----------|
29.49 +| Desert Crisis | v1.5 | 2003/ | [ents] | |
29.50 +| (www.desertcrisis.com/) | | 04/09 | | |
29.51 +|--------------------------------+----------+--------+--------+----------|
29.52 +| Deathmatch Classic | v1.0 | 2001/ | [ents] | |
29.53 +| | | 06/07 | | |
29.54 +|--------------------------------+----------+--------+--------+----------|
29.55 +| Day of Defeat | v1.0 | 2003/ | [ents] | |
29.56 +| (www.dayofdefeatmod.com/) | | 05/03 | | |
29.57 +|--------------------------------+----------+--------+--------+----------|
29.58 +| Digital Paintball | v1.0 | 2002/ | [ents] | |
29.59 +| (www.digitalpaintball.net/) | | 10/06 | | |
29.60 +|--------------------------------+----------+--------+--------+----------|
29.61 +| Dragon Mod Z (dmz.flagrun.net | v1.7 | 2002/ | [ents] | |
29.62 +| /) | | 10/06 | | |
29.63 +|--------------------------------+----------+--------+--------+----------|
29.64 +| Earth's Special Forces | Beta 1.1 | 2003/ | [ents] | |
29.65 +| (www.esforces.com/) | | 07/30 | | |
29.66 +|--------------------------------+----------+--------+--------+----------|
29.67 +| Existence | Beta 1.3 | 2001/ | [ents] | |
29.68 +| (www.whatisexistence.com/) | | 09/19 | | |
29.69 +|--------------------------------+----------+--------+--------+----------|
29.70 +| Firearms (www.firearmsmod.com | v2.7 | 2003/ | [ents] | |
29.71 +| /) | | 03/24 | | |
29.72 +|--------------------------------+----------+--------+--------+----------|
29.73 +| Retro Firearms | v2.5 | 2002/ | [ents] | |
29.74 +| (www.firearms25mod.tk/) | | 01/11 | | |
29.75 +|--------------------------------+----------+--------+--------+----------|
29.76 +| Freeze | - | 2001 | [ents] | |
29.77 +| | | /../.. | | |
29.78 +|--------------------------------+----------+--------+--------+----------|
29.79 +| Frontline Force | v1.3 | 2001/ | [ents] | |
29.80 +| (www.frontlineforce.com/) | | 06/10 | | |
29.81 +|--------------------------------+----------+--------+--------+----------|
29.82 +| GangstaWars | | 2001 | | |
29.83 +| (gangstawars.thebackburner.com | v2.6 | /../.. | [ents] | |
29.84 +| /) | | | | |
29.85 +|--------------------------------+----------+--------+--------+----------|
29.86 +| Gangwars (www.gangwars.net/) | Beta 1.0 | 2002/ | [ents] | |
29.87 +| | | 04/21 | | |
29.88 +|--------------------------------+----------+--------+--------+----------|
29.89 +| Opposing Force | | 2001 | | |
29.90 +| (www.sierrastudios.com/games/ | - | /../.. | [ents] | |
29.91 +| opposingforce/) | | | | |
29.92 +|--------------------------------+----------+--------+--------+----------|
29.93 +| Global Warfare | Beta 2.0 | 2002/ | [ents] | |
29.94 +| (www.Globalwarfare.net/) | | 11/26 | | |
29.95 +|--------------------------------+----------+--------+--------+----------|
29.96 +| Goldeneye | v1.9C | 2002/ | [ents] | |
29.97 +| (www.goldeneye-mod.net/) | | 04/24 | | |
29.98 +|--------------------------------+----------+--------+--------+----------|
29.99 +| Holy Wars | | 2002/ | | |
29.100 +| (www.planethalflife.com/ | Beta 2 | 10/06 | [ents] | |
29.101 +| holywars/) | | | | |
29.102 +|--------------------------------+----------+--------+--------+----------|
29.103 +| International Online Soccer | v2.0 | 2003/ | [ents] | |
29.104 +| (www.planethalflife.com/ios/) | | 07/30 | | |
29.105 +|--------------------------------+----------+--------+--------+----------|
29.106 +| Judgement | v1.0 | 2001/ | [ents] | |
29.107 +| (justicedepartment.co.uk/) | | 05/26 | | |
29.108 +|--------------------------------+----------+--------+--------+----------|
29.109 +| Monkeystrike | v1.2 | 2003/ | [ents] | |
29.110 +| (www.monkeystrike.com/) | | 07/30 | | |
29.111 +|--------------------------------+----------+--------+--------+----------|
29.112 +| Morbid Inclination | | 2003/ | | |
29.113 +| (www.planethalflife.com/morbid | v1.0 | 05/08 | [ents] | |
29.114 +| /) | | | | |
29.115 +|--------------------------------+----------+--------+--------+----------|
29.116 +| Master-Sword | v1.3 | 2003/ | [ents] | |
29.117 +| (www.mastersword.flagrun.net) | | 07/30 | | |
29.118 +|--------------------------------+----------+--------+--------+----------|
29.119 +| Natural Selection | v2.0 | 2003/ | [ents] | |
29.120 +| (www.natural-selection.org/) | | 07/30 | | |
29.121 +|--------------------------------+----------+--------+--------+----------|
29.122 +| OeL Half-Life (www.kixar.com/) | v4.0 | 2002/ | [ents] | |
29.123 +| | | 10/06 | | |
29.124 +|--------------------------------+----------+--------+--------+----------|
29.125 +| Outlawsmod | | 2002/ | | |
29.126 +| (www.planethalflife.com/ | Beta 1.5 | 11/26 | [ents] | |
29.127 +| outlawsmod/) | | | | |
29.128 +|--------------------------------+----------+--------+--------+----------|
29.129 +| Open-Source Jailbreak | v0.95a | 2001/ | [ents] | |
29.130 +| (www.eatsleepcode.ca/~osjb/) | | 05/26 | | |
29.131 +|--------------------------------+----------+--------+--------+----------|
29.132 +| Oz Deathmatch | v2.4.1 | 2001/ | [ents] | |
29.133 +| (www.planethalflife.com/oz/) | | 12/21 | | |
29.134 +|--------------------------------+----------+--------+--------+----------|
29.135 +| Paintball | v2.0 | 2001/ | [ents] | |
29.136 +| (www.paintball-mod.net/) | | 04/30 | | |
29.137 +|--------------------------------+----------+--------+--------+----------|
29.138 +| Public Enemy | Beta 1.0 | 2003/ | [ents] | |
29.139 +| (www.public-enemy.org/) | | 05/02 | | |
29.140 +|--------------------------------+----------+--------+--------+----------|
29.141 +| Phineas Bot | - | 2001 | [ents] | |
29.142 +| | | /../.. | | |
29.143 +|--------------------------------+----------+--------+--------+----------|
29.144 +| Point of No Return | Beta 4.0 | 2003/ | [ents] | |
29.145 +| (ponr.half-life.hu/) | | 08/01 | | |
29.146 +|--------------------------------+----------+--------+--------+----------|
29.147 +| Retro Counter-Strike | v2.5 | 2002/ | [ents] | |
29.148 +| (www.retro-cs.com/) | | 08/24 | | |
29.149 +|--------------------------------+----------+--------+--------+----------|
29.150 +| Gunman Chronicles | - | 2001/ | [ents] | |
29.151 +| (www.gunmanchronicles.com/) | | 07/05 | | |
29.152 +|--------------------------------+----------+--------+--------+----------|
29.153 +| Ricochet | v1.0 | 2002/ | [ents] | |
29.154 +| | | 07/01 | | |
29.155 +|--------------------------------+----------+--------+--------+----------|
29.156 +| Rocket Crowbar | | 2002/ | | |
29.157 +| (www.planethalflife.com/ | v1.9 | 11/26 | [ents] | |
29.158 +| rocketcrowbar/) | | | | |
29.159 +|--------------------------------+----------+--------+--------+----------|
29.160 +| Rival Species | v1.0 | 2003/ | [ents] | |
29.161 +| (www.rivalspecies.com/) | | 05/02 | | |
29.162 +|--------------------------------+----------+--------+--------+----------|
29.163 +| Scientist Hunt | | 2001/ | | |
29.164 +| (www.telefragged.com/thefatal/ | v1.2 | 09/19 | [ents] | |
29.165 +| scihunt.shtml) | | | | |
29.166 +|--------------------------------+----------+--------+--------+----------|
29.167 +| Science & Industry | v0.97 | 2001/ | [ents] | |
29.168 +| (www.planethalflife.com/si/) | | 05/23 | | |
29.169 +|--------------------------------+----------+--------+--------+----------|
29.170 +| Snow-War | | 2001/ | | |
29.171 +| (www.planethalflife.com/ | v1.0 | 12/29 | [ents] | |
29.172 +| snowwar/) | | | | |
29.173 +|--------------------------------+----------+--------+--------+----------|
29.174 +| StargateTC (www.stargatetc.com | Beta 2.2 | 2002/ | [ents] | |
29.175 +| /) | | 11/26 | | |
29.176 +|--------------------------------+----------+--------+--------+----------|
29.177 +| Sven Coop (www.svencoop.com/) | v2.1 | 2003/ | [ents] | |
29.178 +| | | 05/02 | | |
29.179 +|--------------------------------+----------+--------+--------+----------|
29.180 +| Swarm (swarm.edgegaming.com/) | - | 2001 | [ents] | |
29.181 +| | | /../.. | | |
29.182 +|--------------------------------+----------+--------+--------+----------|
29.183 +| Team Fortress Classic | | 2003/ | | |
29.184 +| (sierrastudios.com/games/tf1.5 | v1.1.1.1 | 01/18 | [ents] | |
29.185 +| /) | | | | |
29.186 +|--------------------------------+----------+--------+--------+----------|
29.187 +| The Wastes (planethalflife.com | RC 1.2 | 2003/ | [ents] | |
29.188 +| /thewastes/) | | 07/30 | | |
29.189 +|--------------------------------+----------+--------+--------+----------|
29.190 +| Tour of Duty | v1.1 | 2002/ | [ents] | |
29.191 +| (www.tourofdutymod.com/) | Beta | 11/26 | | |
29.192 +|--------------------------------+----------+--------+--------+----------|
29.193 +| Train Hunters (th.fragoff.net | Beta 1.0 | 2002/ | [ents] | |
29.194 +| /) | | 04/29 | | |
29.195 +|--------------------------------+----------+--------+--------+----------|
29.196 +| The Specialists | Beta 2.0 | 2003/ | [ents] | |
29.197 +| (www.specialistsmod.net/) | | 07/31 | | |
29.198 +|--------------------------------+----------+--------+--------+----------|
29.199 +| Half-Life Deathmatch | | 2001 | | |
29.200 +| (www.sierrastudios.com/games/ | v1.1.0.6 | /../.. | [ents] | |
29.201 +| half-life/bot.html) | | | | |
29.202 +|--------------------------------+----------+--------+--------+----------|
29.203 +| VampireSlayer | Chapter | 2003/ | | |
29.204 +| (www.planethalflife.com/ | V | 02/08 | [ents] | |
29.205 +| vampire/) | | | | |
29.206 +|--------------------------------+----------+--------+--------+----------|
29.207 +| Wanted! (www.wantedhl.com/) | v1.5 | 2001/ | [ents] | |
29.208 +| | | 07/11 | | |
29.209 +|--------------------------------+----------+--------+--------+----------|
29.210 +| Wasteland | Beta 2 | 2001/ | [ents] | |
29.211 +| (wastelandhalflife.com/) | | 06/07 | | |
29.212 +|--------------------------------+----------+--------+--------+----------|
29.213 +| Weapon Wars | v0.3 | 2001/ | [ents] | |
29.214 +| (wwars.hlcenter.com/) | | 08/13 | | |
29.215 +|--------------------------------+----------+--------+--------+----------|
29.216 +| Wizard Wars | | 2001/ | | |
29.217 +| (www.planethalflife.com/ | v1.0 | 07/30 | [ents] | |
29.218 +| wizardwars/) | | | | |
29.219 +|--------------------------------+----------+--------+--------+----------|
29.220 +| WormsHL (www.wormshl.com/) | Beta 3.0 | 2003/ | [ents] | |
29.221 +| | | 05/02 | | |
29.222 ++------------------------------------------------------------------------+
30.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
30.2 +++ b/doc/txt/about.txt Tue Apr 06 07:36:14 2004 +0000
30.3 @@ -0,0 +1,35 @@
30.4 +Metamod
30.5 +=-=-=-=
30.6 +
30.7 +a Half-Life utility mod
30.8 +
30.9 + meta /me't*/ or /may't*/ or (Commonwealth) /mee't*/ adj.,pref.
30.10 + [from analytic philosophy] One level of description up.
30.11 +
30.12 +The purpose of MetaMod is to function "one level up" from the normal
30.13 +Half-Life game mod DLL. Sitting between the mod game DLL and the Half-Life
30.14 +engine/binary, it intercepts the function calls between the two, with the
30.15 +option of passing them along untouched, as well as passing them on to as
30.16 +any number of _additional mod-like DLLs_.
30.17 +
30.18 +Thus, you can actually have multiple "mod-like" DLLs in operation at one
30.19 +time. I say "mod-like" because these additional DLLs (we'll call them
30.20 +"plugins") are not intended to provide a full "game"; that functionality
30.21 +is still provided by the "game dll". However, these plugins can _add to_
30.22 +or _modify the functionality provided by the game dll, or by the engine
30.23 +itself - for instance, adding new server commands, or new client commands,
30.24 +or even disabling commands built into the game dll. Although the plugin
30.25 +isn't intended to provide full HL-game functionality, since it's receiving
30.26 +the same information given to the game DLL, it has the opportunity to do
30.27 +_anything_ the game DLL can do (given enough coding effort of course).
30.28 +
30.29 +This is very similar to the way Alfred Reynolds' AdminMod
30.30 +(www.adminmod.org) works, as it also sits between the engine and game dll,
30.31 +catching routines, and passing them on. thus modifying functionality.
30.32 +However, rather than providing just the additional server features builtin
30.33 +to AdminMod DLL, MetaMod allows you to add features from multiple,
30.34 +separate DLLs. Under that framework, AdminMod can be a plugin itself, and
30.35 +be run alongside numerous other plugins. And, as of version 2.50 of
30.36 +AdminMod, AM has now transitioned to running as a Metamod plugin.
30.37 +
30.38 +--------------------------------------------------------------------------
31.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
31.2 +++ b/doc/txt/coding.txt Tue Apr 06 07:36:14 2004 +0000
31.3 @@ -0,0 +1,340 @@
31.4 +Coding for Metamod
31.5 +=-=-=-=-=-=-=-=-=-=
31.6 +
31.7 +
31.8 +Compiling
31.9 +=========
31.10 +
31.11 +You'll need the Half-Life SDK, of course. In particular you'll need HL SDK
31.12 +version 2.3. You can find the original SDK 2.3 at the Valve Editing
31.13 +Resource Center (VERC) (www.valve-erc.com/), and a modified version of SDK
31.14 +2.3 at metmod.org/files/sdk (metamod.org/files/sdk/).
31.15 +
31.16 +
31.17 +Operation
31.18 +=========
31.19 +
31.20 +The basic operation is, for each api call:
31.21 +
31.22 + - iterate through list of plugins
31.23 + - for each plugin, if it provides this api call, then call the function
31.24 + in the plugin
31.25 + - call the "real" function (in the game dll, or from the engine)
31.26 + - for each plugin, check for a "post" version of the function, and call
31.27 + if present
31.28 +
31.29 +Also, for any api call, each plugin has the opportunity to replace the
31.30 +real routine, in two ways:
31.31 +
31.32 + - prevent the real routine from being called (SUPERCEDE).
31.33 + - allow the real routine to be called, but change the value that's
31.34 + returned (OVERRIDE)
31.35 +
31.36 +Thus after each plugin is called, its META_RESULT flag is checked, and
31.37 +action taken appropriately. Note that supercede/override only affects the
31.38 +_real_ routine; other plugins will still be called. In addition to the
31.39 +SUPERCEDE and OVERRIDE flags, there are two additional flags a plugin can
31.40 +return:
31.41 +
31.42 + - HANDLED ("I did something here")
31.43 + - IGNORED ("I didn't really do anything")
31.44 +
31.45 +These aren't used by Metamod itself, but could be used by plugins to get
31.46 +an idea if a previous plugin did anything.
31.47 +
31.48 +Note that each routine _needs_ to set its META_RESULT value before
31.49 +returning. Plugin routines that do not set a value will be reported as
31.50 +errors in the logs.
31.51 +
31.52 +
31.53 +Plugin coding requirements
31.54 +==========================
31.55 +
31.56 +Plugins MUST provide the following standard HLSDK exported function:
31.57 +
31.58 + void GiveFnptrsToDll(enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals);
31.59 +
31.60 +AS WELL AS the following new functions:
31.61 +
31.62 + void Meta_Init(void); (optional)
31.63 + int Meta_Query(char *interfaceVersion, plugin_info_t **pinfo, mutil_funcs_t *pMetaUtilFuncs);
31.64 + int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs);
31.65 + int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason);
31.66 +
31.67 +Also, it must provide AT LEAST one function returning a standard HL
31.68 +function table, from either the following standard HLSDK functions:
31.69 +
31.70 + int GetEntityAPI( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion );
31.71 + int GetEntityAPI2( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion );
31.72 + int GetNewDLLFunctions( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion );
31.73 +
31.74 +or from the following new functions:
31.75 +
31.76 + int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion);
31.77 + int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion ;
31.78 + int GetNewDLLFunctions_Post(NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion);
31.79 +
31.80 + int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion);
31.81 + int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion);
31.82 +
31.83 +Thus, it needs to have (at least):
31.84 +
31.85 + GiveFnptrsToDll
31.86 + Meta_Query
31.87 + Meta_Attach
31.88 + Meta_Detach
31.89 + <one or more Get function>
31.90 +
31.91 +See the "stub_plugin" for an example of _bare minimum_ code. See "
31.92 +trace_plugin" for an example of more complete functionality.
31.93 +
31.94 +Also, if the plugin needs to use LINK_ENTITY_TO_CLASS, support for the
31.95 +particular entity(ies) has to be added explicitly to Metamod
31.96 +(linkfunc.cpp), just as it does for entities in game DLLs.
31.97 +
31.98 +
31.99 +Operation Details
31.100 +=================
31.101 +
31.102 +These are the valid META_RESULT values a plugin routine can specify:
31.103 +
31.104 +
31.105 + - MRES_IGNORED
31.106 + The plugin did nothing. This could be used to tell a subsequent plugin
31.107 + that the some situation hasn't been handled yet. This would be
31.108 + recognized only by other plugins; Metamod itself doesn't do anything
31.109 + special for this situation. Unless otherwise specified by a later
31.110 + plugin, execution of routine in the gameDLL will take place. This is
31.111 + valid in both normal and post routines.
31.112 +
31.113 + - MRES_HANDLED
31.114 + The plugin handled the situation, or did something with the
31.115 + information. Again, this could be used to tell a subsequent plugin
31.116 + that some situation has already been taken care of, and is not
31.117 + recognized specially by Metamod. Unless otherwise specified by a later
31.118 + plugin, execution of routine in the gameDLL will take place. This is
31.119 + valid in both normal and post routines.
31.120 +
31.121 + - MRES_OVERRIDE
31.122 + The plugin is providing a return value for the routine, which should
31.123 + be used in place of the return value from the gameDLL's routine (the
31.124 + plugin "overrides" the gameDLL's return value). Unless otherwise
31.125 + specified by a later plugin, the gameDLL routine will still be called.
31.126 + Note this only makes sense for non-void routines. This is valid in
31.127 + both normal and post routines.
31.128 +
31.129 + - MRES_SUPERCEDE
31.130 + The plugin has performed sufficient actions for the routine, and the
31.131 + gameDLL's routine should NOT be called (the plugin "supercedes" the
31.132 + gameDLL's routine, more or less replacing it entirely). Any return
31.133 + value for the routine should be specified as well by the plugin. Note
31.134 + this is only valid for normal routines, as post routines cannot
31.135 + prevent calling the gameDLL's routine (as it has already happened!).
31.136 + Also note, this doesn't prevent subsequent plugins from being called
31.137 + for this routine; it supercedes _only_ the gameDLL.
31.138 +
31.139 +As the plugins are called, a running status is kept of the "highest" meta
31.140 +status so far, in the order (lowest to highets) shown above. After calling
31.141 +all the "normal" routines, the status is checked to see if the gameDLL's
31.142 +routine should be called - ie, it will not be called if one (or more) of
31.143 +the plugin's has specified META_SUPERCEDE. The gameDLL's routine is then
31.144 +called, or skipped, as appropriate. Then, all the "post" routines are
31.145 +called in the same manner (except META_SUPERCEDE is no longer a valid meta
31.146 +result).
31.147 +
31.148 +Last, if any plugins specified META_OVERRIDE or META_SUPERCEDE, the return
31.149 +value given by the _last_ such plugin is returned as the routine's return
31.150 +code to the engine (assuming a non-void routine). Thus, the order of the
31.151 +plugins as specified in the metamod.ini _does_ have a possible effect.
31.152 +
31.153 +
31.154 +Available Macros
31.155 +================
31.156 +
31.157 +The meta_api.h header that describes the Metamod API functions, types, and
31.158 +structures also includes several macros that can be of help when coding a
31.159 +plugin.
31.160 +
31.161 +
31.162 + - SET_META_RESULT(result)
31.163 + Sets the META_RESULT for the plugin.
31.164 +
31.165 + - RETURN_META(result)
31.166 + Sets the META_RESULT for the plugin, and then calls return. This
31.167 + assumes a void function.
31.168 +
31.169 + - RETURN_META_VALUE(result, value)
31.170 + Sets the META_RESULT for the plugin, and then returns the given value.
31.171 + This assumes a non-void function, and it doesn't matter the particular
31.172 + type of the return value.
31.173 +
31.174 + - META_RESULT_STATUS
31.175 + Gives the current status of META_RESULT for this routine from plugins
31.176 + so far. It will return the "highest" result so far, in the order of
31.177 + lesser to greater: IGNORED, HANDLED, OVERRIDE, SUPERCEDE (see also
31.178 + above Operation Details)
31.179 +
31.180 + - META_RESULT_PREVIOUS
31.181 + Gives the META_RESULT of the previous plugin.
31.182 +
31.183 + - META_RESULT_ORIG_RET(type)
31.184 + Gives the "original" return value for the routine, ie the return value
31.185 + of the routine from gameDLL. The type for the routine's return value
31.186 + must be specified in the macro; this is used as a cast for assignment.
31.187 + Note this is only valid in a "post" routine.
31.188 +
31.189 + - META_RESULT_OVERRIDE_RET(type)
31.190 + Gives the return value from any previous plugin that specified
31.191 + META_OVERRIDE or META_SUPERCEDE. The type for the routine's return
31.192 + value must be specified in the macro; this is used as a cast for
31.193 + assignment. This should only be used after checking the META_RESULT to
31.194 + see if there's actually an override value available.
31.195 +
31.196 + - MDLL_*(args)
31.197 + Calls a given DLLAPI routine in the gameDLL. For instance,
31.198 + MDLL_GameDLLInit(args), MDLL_Spawn(args), etc.
31.199 +
31.200 + - MNEW_*(args)
31.201 + Calls a given NEWAPI routine in the gameDLL. For instance,
31.202 + MNEW_GameShutdown(args), etc.
31.203 +
31.204 +
31.205 +Utility Callback Functions
31.206 +==========================
31.207 +
31.208 +In version 1.05, Metamod began providing a set of utility functions to
31.209 +plugins to centralize functionality, reduce code reuse, and to provide
31.210 +some convenience in plugin coding. Presently, only a few functions are
31.211 +provided. More are added as I find the time, and identify some advantage
31.212 +to having them (either for my own plugins, or by others' request for their
31.213 +plugins).
31.214 +
31.215 +Note the PLID keyword passed to each function. This is basically a "plugin
31.216 +id" to indicate to Metamod which plugin is calling the function (else it's
31.217 +difficult to tell), and is a macro that should be specified verbatim with
31.218 +each call. (Currently, the macro is merely the plugin_info struct pointer
31.219 +returned by the plugin via Meta_Query; in the future this could change to
31.220 +some other identifier.)
31.221 +
31.222 +
31.223 + - void LOG_CONSOLE(PLID, char *fmt, ...)
31.224 + Print a message line on the console. Message is specified as a printf
31.225 + style format string and arguments. A trailing newline is provided by
31.226 + the routine and should not be specified in the string (unless you want
31.227 + two newlines).
31.228 +
31.229 + - void LOG_MESSAGE(PLID, char *fmt, ...)
31.230 + Print a message line in the server logs. Message is specified as a
31.231 + printf style format string and arguments. A trailing newline is
31.232 + provided by the routine and should not be specified in the string. Log
31.233 + message is prefixed by the logtag string in the plugin's "info"
31.234 + struct, surrounded by brackets. For instance:
31.235 +
31.236 + L 04/17/2001 - 18:00:35: [TraceAPI] Tracing Engine routine
31.237 + 'RegUserMsg'
31.238 +
31.239 + - void LOG_ERROR(PLID, char *fmt, ...)
31.240 + As in LOG_MESSAGE above, only marked as well with the string "ERROR:".
31.241 + For example:
31.242 +
31.243 + L 04/17/2001 - 18:03:13: [TraceAPI] ERROR: malloc failed
31.244 +
31.245 + - void LOG_DEVELOPER(PLID, char *fmt, ...)
31.246 + As in LOG_MESSAGE above, only message will be logged only if cvar
31.247 + developer is set to 1; message is marked as well with the string "dev:
31.248 + ". For example:
31.249 +
31.250 + L 04/17/2001 - 18:03:13: [TraceAPI] dev: called: GiveFnptrsToDll
31.251 +
31.252 + - void CENTER_SAY(PLID, char *fmt, ...)
31.253 + Prints a message on the center of all players' screens. This is like
31.254 + the "centersay" of AdminMod, with pretty_say enabled, with the same
31.255 + defaults (green, and a 10 second fade-in). A message is logged as
31.256 + well, ie: [added in 1.06]
31.257 +
31.258 + L 04/17/2001 - 15:44:52: [WDMISC] (centersay) random set up us the
31.259 + bomb!
31.260 +
31.261 + - void CENTER_SAY_PARMS(PLID, hudtextparms_t tparms, char *fmt, ...)
31.262 + As in CENTER_SAY above, but allows specifying all the parameters. (see
31.263 + SDK dlls/util.h for the struct hudtextparms_t). [added in 1.06]
31.264 +
31.265 + - void CENTER_SAY_VARARGS(PLID, hudtextparms_t tparms, char *fmt,
31.266 + va_list ap)
31.267 + As in CENTER_SAY_PARMS above, only the message is passed as a
31.268 + vsnprintf style varargs format string and args list. This is included
31.269 + merely because both the previous CENTER_SAY functions actually call
31.270 + this, and it was convenient to include it as well. [added in 1.06]
31.271 +
31.272 + - qboolean CALL_GAME_ENTITY(PLID, char *entStr, entvars_t *pev)
31.273 + Calls an entity function in the gameDLL. For instance, a bot usually
31.274 + needs to call the player entity function. [added in 1.09]
31.275 +
31.276 + - int GET_USER_MSG_ID(PLID, const char *name, int *size)
31.277 + Returns the id number corresponding to the given message name, of
31.278 + those messages registered by the gamedll with RegUserMsg, optionally
31.279 + returning the registered size of the message as well. This is to allow
31.280 + things like bots to access the name/id mapping without having to catch
31.281 + RegUserMsg themselves, and thus have to be loaded at startup. [added
31.282 + in 1.11]
31.283 +
31.284 + - const char * GET_USER_MSG_NAME(PLID, int msgid, int *size)
31.285 + Returns the name corresponding to the given msgid number, of those
31.286 + messages registered by the gamedll with RegUserMsg, optionally
31.287 + returning the registered size of the message as well. It will return
31.288 + guess-names for any builtin Engine messages that it knows about
31.289 + (SVC_TEMPENTITY, etc). The returned string is presumed to be a
31.290 + compile-time constant string, stored in the text segment of the
31.291 + gamedll. [added in 1.11]
31.292 +
31.293 + - const char * GET_PLUGIN_PATH(PLID)
31.294 + Returns the full pathname of the loaded dll/so file for the calling
31.295 + plugin. The returned string is a pointer to a static buffer, and
31.296 + should be copied by the caller to local storage. [added in 1.12]
31.297 +
31.298 + - const char * GET_GAME_INFO(PLID, ginfo_t type)
31.299 + Returns various string-based information about the running game/MOD/
31.300 + gamedll. The given type can be one of:
31.301 + - GINFO_NAME - short name of game, from "-game" argument to hlds (ie
31.302 + "cstrike")
31.303 + - GINFO_DESC - long name of game, from autodetection (ie
31.304 + "Counter-Strike")
31.305 + - GINFO_GAMEDIR - game directory, full pathname (ie "/usr/local/
31.306 + half-life/cstrike")
31.307 + - GINFO_DLL_FULLPATH - full pathname of the game dll (ie "/usr/local
31.308 + /half-life/cstrike/dlls/cs_i386.so")
31.309 + - GINFO_DLL_FILENAME - bare filename of the gamedll (ie
31.310 + "cs_i386.so")
31.311 + The returned string is a pointer to a static buffer, and should be
31.312 + copied by the caller to local storage. [added in 1.14]
31.313 +
31.314 +
31.315 +Plugin Loading
31.316 +==============
31.317 +
31.318 +(this is some rough notes I intend to fill in in the future)
31.319 +
31.320 +Plugins are loaded when the engine calls GiveFnptrsToDll(). The config
31.321 +file is parsed, and for each valid plugin (uncommented, platform
31.322 +relevant), the operation is:
31.323 +
31.324 + - dlopen() the file, store the handle
31.325 + - dlsym() and call:
31.326 + Meta_Init (if present)
31.327 + GiveFnptrsToDll
31.328 + Meta_Query
31.329 + Meta_Attach
31.330 + - if present, call function pointers, and store resulting function
31.331 + table:
31.332 + GetEntityAPI
31.333 + GetEntityAPI2
31.334 + GetNewDLLFunctions
31.335 +
31.336 + GetEntityAPI_Post
31.337 + GetEntityAPI2_Post
31.338 + GetNewDLLFunctions_Post
31.339 +
31.340 + GetEngineFunctions
31.341 + GetEngineFunctions_Post
31.342 +
31.343 +--------------------------------------------------------------------------
32.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
32.2 +++ b/doc/txt/dllapi_notes.txt Tue Apr 06 07:36:14 2004 +0000
32.3 @@ -0,0 +1,688 @@
32.4 +HLSDK DLLAPI Notes
32.5 +=-=-=-=-=-=-=-=-=-=
32.6 +
32.7 +--------------------------------------------------------------------------
32.8 +
32.9 + - GameDLLInit
32.10 + - DispatchSpawn
32.11 + - DispatchThink
32.12 + - DispatchUse
32.13 + - DispatchTouch
32.14 + - DispatchBlocked
32.15 + - DispatchKeyValue
32.16 + - DispatchSave
32.17 + - DispatchRestore
32.18 + - DispatchObjectCollsionBox
32.19 + - SaveWriteFields
32.20 + - SaveReadFields
32.21 + - SaveGlobalState
32.22 + - RestoreGlobalState
32.23 + - ResetGlobalState
32.24 + - ClientConnect
32.25 + - ClientDisconnect
32.26 + - ClientKill
32.27 + - ClientPutInServer
32.28 + - ClientCommand
32.29 + - ClientUserInfoChanged
32.30 + - ServerActivate
32.31 + - ServerDeactivate
32.32 + - PlayerPreThink
32.33 + - PlayerPostThink
32.34 + - StartFrame
32.35 + - ParmsNewLevel
32.36 + - ParmsChangeLevel
32.37 + - GetGameDescription
32.38 + - PlayerCustomization
32.39 + - SpectatorConnect
32.40 + - SpectatorDisconnect
32.41 + - SpectatorThink
32.42 + - Sys_Error
32.43 + - PM_Move
32.44 + - PM_Init
32.45 + - PM_FindTextureType
32.46 + - SetupVisibility
32.47 + - UpdateClientData
32.48 + - AddToFullPack
32.49 + - CreateBaseline
32.50 + - RegisterEncoders
32.51 + - GetWeaponData
32.52 + - CmdStart
32.53 + - CmdEnd
32.54 + - ConnectionlessPacket
32.55 + - GetHullBounds
32.56 + - CreateInstancedBaselines
32.57 + - InconsistentFile
32.58 + - AllowLagCompensation
32.59 +
32.60 +--------------------------------------------------------------------------
32.61 +
32.62 +GameDLLInit
32.63 +
32.64 +from dlls/game.cpp:
32.65 +void GameDLLInit(void);
32.66 +
32.67 + Register your console variables here.
32.68 + This gets called one time when the game is initialied.
32.69 + Initialize the game (one-time call after loading of game .dll)
32.70 +
32.71 +comments:
32.72 +
32.73 + Called just after hlds reports "Dll loaded for mod Half-Life".
32.74 +
32.75 +--------------------------------------------------------------------------
32.76 +
32.77 +DispatchSpawn
32.78 +
32.79 +from dlls/cbase.cpp
32.80 +int DispatchSpawn(edict_t *pent);
32.81 +
32.82 +comments:
32.83 +
32.84 + 0==Success, -1==Failure ?
32.85 +
32.86 +--------------------------------------------------------------------------
32.87 +
32.88 +DispatchThink
32.89 +
32.90 +from dlls/cbase.cpp
32.91 +void DispatchThink(edict_t *pent);
32.92 +
32.93 +--------------------------------------------------------------------------
32.94 +
32.95 +DispatchUse
32.96 +
32.97 +from dlls/cbase.cpp
32.98 +void DispatchUse(edict_t *pentUsed, edict_t *pentOther);
32.99 +
32.100 +--------------------------------------------------------------------------
32.101 +
32.102 +DispatchTouch
32.103 +
32.104 +from dlls/cbase.cpp
32.105 +void DispatchTouch(edict_t *pentTouched, edict_t *pentOther);
32.106 +
32.107 +--------------------------------------------------------------------------
32.108 +
32.109 +DispatchBlocked
32.110 +
32.111 +from dlls/cbase.cpp
32.112 +void DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther);
32.113 +
32.114 +--------------------------------------------------------------------------
32.115 +
32.116 +DispatchKeyValue
32.117 +
32.118 +from dlls/cbase.cpp
32.119 +void DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd);
32.120 +
32.121 +--------------------------------------------------------------------------
32.122 +
32.123 +DispatchSave
32.124 +
32.125 +from dlls/cbase.cpp
32.126 +void DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData);
32.127 +
32.128 +--------------------------------------------------------------------------
32.129 +
32.130 +DispatchRestore
32.131 +
32.132 +from dlls/cbase.cpp
32.133 +int DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int
32.134 +globalEntity);
32.135 +
32.136 +comments:
32.137 +
32.138 + 0==Success, -1==Failure ?
32.139 +
32.140 +--------------------------------------------------------------------------
32.141 +
32.142 +DispatchObjectCollsionBox
32.143 +
32.144 +from dlls/cbase.cpp
32.145 +void DispatchObjectCollsionBox(edict_t *pent);
32.146 +
32.147 +--------------------------------------------------------------------------
32.148 +
32.149 +SaveWriteFields
32.150 +
32.151 +from dlls/cbase.cpp
32.152 +void SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *
32.153 +pBaseData, TYPEDESCRIPTION *pFields, int fieldCount);
32.154 +
32.155 +--------------------------------------------------------------------------
32.156 +
32.157 +SaveReadFields
32.158 +
32.159 +from dlls/cbase.cpp
32.160 +void SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *
32.161 +pBaseData, TYPEDESCRIPTION *pFields, int fieldCount);
32.162 +
32.163 +--------------------------------------------------------------------------
32.164 +
32.165 +SaveGlobalState
32.166 +
32.167 +from dlls/world.cpp
32.168 +void SaveGlobalState(SAVERESTOREDATA *pSaveData);
32.169 +
32.170 +--------------------------------------------------------------------------
32.171 +
32.172 +RestoreGlobalState
32.173 +
32.174 +from dlls/world.cpp
32.175 +void RestoreGlobalState(SAVERESTOREDATA *pSaveData);
32.176 +
32.177 +--------------------------------------------------------------------------
32.178 +
32.179 +ResetGlobalState
32.180 +
32.181 +from dlls/world.cpp
32.182 +void ResetGlobalState(void);
32.183 +
32.184 +--------------------------------------------------------------------------
32.185 +
32.186 +ClientConnect
32.187 +
32.188 +from dlls/client.cpp:
32.189 +BOOL ClientConnect(edict_t *pEntity, const char *pszName, const char *
32.190 +pszAddress, char szRejectReason[128]);
32.191 +
32.192 + Called when a player connects to a server.
32.193 +
32.194 +comments:
32.195 +
32.196 + Called on initial connect, just after hlds reports "connected", ie:
32.197 + "John<1><WON:9856723>" connected, address "127.0.0.1:27005"
32.198 + This is before the user begins downloading, or anything else.
32.199 +
32.200 +--------------------------------------------------------------------------
32.201 +
32.202 +ClientDisconnect
32.203 +
32.204 +from dlls/client.cpp:
32.205 +void ClientDisconnect(edict_t *pEntity);
32.206 +
32.207 + Called when a player disconnects from a server.
32.208 + GLOBALS ASSUMED SET: g_fGameOver
32.209 +
32.210 +comments:
32.211 +
32.212 + This is not the opposite of ClientConnect, despite the similar name.
32.213 + It appears to only be called if the client was PutInServer first. If
32.214 + the client disconnects before being PutInServer, no API routine is
32.215 + called. This would be more appropriately named ClientRemoveFromServer_
32.216 + .
32.217 +
32.218 +--------------------------------------------------------------------------
32.219 +
32.220 +ClientKill
32.221 +
32.222 +from dlls/client.cpp:
32.223 +void ClientKill(edict_t *pEntity);
32.224 +
32.225 + Player entered the suicide command.
32.226 + GLOBALS ASSUMED SET: g_ulModelIndexPlayer
32.227 +
32.228 +comments:
32.229 +
32.230 + When the client typed "kill" in the console?
32.231 +
32.232 +--------------------------------------------------------------------------
32.233 +
32.234 +ClientPutInServer
32.235 +
32.236 +from dlls/client.cpp:
32.237 +void ClientPutInServer(edict_t *pEntity);
32.238 +
32.239 + Called each time a player is spawned.
32.240 +
32.241 +comments:
32.242 +
32.243 + Called after the client has uploaded/download all necessary resources,
32.244 + just after hlds reports "entered the game", ie:
32.245 + "John<1>" has entered the game
32.246 +
32.247 +--------------------------------------------------------------------------
32.248 +
32.249 +ClientCommand
32.250 +
32.251 +from dlls/client.cpp:
32.252 +void ClientCommand(edict_t *pEntity);
32.253 +
32.254 + Called each time a player uses a "cmd" command. Use CMD_ARGS,
32.255 + CMD_ARGV, and CMD_ARGC to get pointers to the character string
32.256 + command.
32.257 +
32.258 +--------------------------------------------------------------------------
32.259 +
32.260 +ClientUserInfoChanged
32.261 +
32.262 +from dlls/client.cpp:
32.263 +void ClientUserInfoChanged(edict_t *pEntity, char *infobuffer);
32.264 +
32.265 + Called after the player changes userinfo - gives dll a chance to
32.266 + modify it before it gets sent into the rest of the engine.
32.267 +
32.268 +comments:
32.269 +
32.270 + Called when user issues "setinfo" from the console. Also appears to be
32.271 + called whenever the user returns to the game from the ESC menu.
32.272 +
32.273 +--------------------------------------------------------------------------
32.274 +
32.275 +ServerActivate
32.276 +
32.277 +from dlls/client.cpp:
32.278 +void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax);
32.279 +
32.280 + Every call to ServerActivate should be matched by a call to
32.281 + ServerDeactivate.
32.282 +
32.283 +comments:
32.284 +
32.285 + Added in SDK 2.0. Apparently called when the server has loaded the
32.286 + map, but before it precaches from the .res file.
32.287 +
32.288 +--------------------------------------------------------------------------
32.289 +
32.290 +ServerDeactivate
32.291 +
32.292 +from dlls/client.cpp:
32.293 +void ServerDeactivate(void);
32.294 +
32.295 + Peform any shutdown operations here.
32.296 + It's possible that the engine will call this function more times than
32.297 + is necessary. Therefore, only run it one time for each call to
32.298 + ServerActivate.
32.299 +
32.300 +comments:
32.301 +
32.302 + Called upon "quit" or "changelevel" .
32.303 +
32.304 +--------------------------------------------------------------------------
32.305 +
32.306 +PlayerPreThink
32.307 +
32.308 +from dlls/client.cpp:
32.309 +void PlayerPreThink(edict_t *pEntity);
32.310 +
32.311 + Called every frame before physics are run.
32.312 +
32.313 +--------------------------------------------------------------------------
32.314 +
32.315 +PlayerPostThink
32.316 +
32.317 +from dlls/client.cpp:
32.318 +void PlayerPostThink(edict_t *pEntity);
32.319 +
32.320 + Called every frame after physics are run.
32.321 +
32.322 +--------------------------------------------------------------------------
32.323 +
32.324 +StartFrame
32.325 +
32.326 +from dlls/client.cpp:
32.327 +void StartFrame(void);
32.328 +
32.329 + GLOBALS ASSUMED SET: g_ulFrameCount
32.330 +
32.331 +--------------------------------------------------------------------------
32.332 +
32.333 +ParmsNewLevel
32.334 +
32.335 +from dlls/client.cpp
32.336 +void ParmsNewLevel(void);
32.337 +
32.338 +--------------------------------------------------------------------------
32.339 +
32.340 +ParmsChangeLevel
32.341 +
32.342 +from dlls/client.cpp
32.343 +void ParmsChangeLevel(void);
32.344 +
32.345 +--------------------------------------------------------------------------
32.346 +
32.347 +GetGameDescription
32.348 +
32.349 +from dlls/client.cpp:
32.350 +const char *GetGameDescription(void);
32.351 +
32.352 + Returns string describing current .dll game.
32.353 + Returns the descriptive name of this .dll. E.g., Half-Life, or Team
32.354 + Fortress 2.
32.355 + This function might be called before the world has spawned, and the
32.356 + game rules initialized.
32.357 +
32.358 +--------------------------------------------------------------------------
32.359 +
32.360 +PlayerCustomization
32.361 +
32.362 +from dlls/client.cpp:
32.363 +void PlayerCustomization(edict_t *pEntity, customization_t *pCust);
32.364 +
32.365 + Notifies .dll of new customization for player.
32.366 + A new player customization has been registered on the server. UNDONE:
32.367 + This only sets the # of frames of the spray can logo animation right
32.368 + now.
32.369 +
32.370 +--------------------------------------------------------------------------
32.371 +
32.372 +SpectatorConnect
32.373 +
32.374 +from dlls/client.cpp:
32.375 +void SpectatorConnect(edict_t *pEntity);
32.376 +
32.377 + Called when spectator joins server.
32.378 + A spectator has joined the game.
32.379 +
32.380 +--------------------------------------------------------------------------
32.381 +
32.382 +SpectatorDisconnect
32.383 +
32.384 +from dlls/client.cpp:
32.385 +void SpectatorDisconnect(edict_t *pEntity);
32.386 +
32.387 + Called when spectator leaves the server.
32.388 + A spectator has left the game.
32.389 +
32.390 +--------------------------------------------------------------------------
32.391 +
32.392 +SpectatorThink
32.393 +
32.394 +from dlls/client.cpp:
32.395 +void SpectatorThink(edict_t *pEntity);
32.396 +
32.397 + Called when spectator sends a command packet (usercmd_t).
32.398 + A spectator has sent a usercmd.
32.399 +
32.400 +--------------------------------------------------------------------------
32.401 +
32.402 +Sys_Error
32.403 +
32.404 +from dlls/client.cpp:
32.405 +void Sys_Error(const char *error_string);
32.406 +
32.407 + Called when engine has encountered an error.
32.408 + Notify game .dll that engine is going to shut down.
32.409 + Engine is going to shut down, allows setting a breakpoint in game dll
32.410 + to catch that occasion.
32.411 + Add code ( e.g., _asm { int 3 }; here to cause a breakpoint for
32.412 + debugging your game .dlls.
32.413 +
32.414 +comments:
32.415 +
32.416 + Added in SDK 2.0.
32.417 +
32.418 +--------------------------------------------------------------------------
32.419 +
32.420 +PM_Move
32.421 +
32.422 +from pm_shared/pm_shared.c:
32.423 +void PM_Move(struct playermove_s *ppmove, int server);
32.424 +
32.425 + This modume implements the shared player physics code between any
32.426 + particular game and the engine. The same PM_Move routine is built into
32.427 + the game .dll and the client .dll and is invoked by each side as
32.428 + appropriate. There should be no distinction, internally, between
32.429 + server and client. This will ensure that prediction behaves
32.430 + appropriately.
32.431 +
32.432 +comments:
32.433 +
32.434 + Added in SDK 2.0.
32.435 +
32.436 +--------------------------------------------------------------------------
32.437 +
32.438 +PM_Init
32.439 +
32.440 +from pm_shared/pm_shared.c:
32.441 +void PM_Init(struct playermove_s *ppmove);
32.442 +
32.443 + Server version of player movement initialization.
32.444 +
32.445 +comments:
32.446 +
32.447 + Added in SDK 2.0.
32.448 +
32.449 +--------------------------------------------------------------------------
32.450 +
32.451 +PM_FindTextureType
32.452 +
32.453 +from pm_shared/pm_shared.c
32.454 +char PM_FindTextureType(char *name);
32.455 +
32.456 +comments:
32.457 +
32.458 + Added in SDK 2.0.
32.459 +
32.460 +--------------------------------------------------------------------------
32.461 +
32.462 +SetupVisibility
32.463 +
32.464 +from dlls/client.cpp:
32.465 +void SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char
32.466 +**pvs, unsigned char **pas);
32.467 +
32.468 +from dlls/client.cpp:
32.469 +
32.470 + Set up PVS and PAS for networking for this client.
32.471 +
32.472 + A client can have a separate "view entity" indicating that his/her
32.473 + view should depend on the origin of that view entity. If that's the
32.474 + case, then pViewEntity will be non-NULL and will be used. Otherwise,
32.475 + the current entity's origin is used. Either is offset by the view_ofs
32.476 + to get the eye position.
32.477 +
32.478 + From the eye position, we set up the PAS and PVS to use for filtering
32.479 + network messages to the client. At this point, we could override the
32.480 + actual PAS or PVS values, or use a different origin.
32.481 +
32.482 + NOTE: Do not cache the values of pas and pvs, as they depend on
32.483 + reusable memory in the engine, they are only good for this one frame
32.484 +
32.485 +comments:
32.486 +
32.487 + Added in SDK 2.0.
32.488 +
32.489 +--------------------------------------------------------------------------
32.490 +
32.491 +UpdateClientData
32.492 +
32.493 +from dlls/client.cpp:
32.494 +void UpdateClientData (const struct edict_s *ent, int sendweapons, struct
32.495 +clientdata_s *cd);
32.496 +
32.497 + Set up data sent only to specific client.
32.498 + Data sent to current client only.
32.499 + Engine sets argument 'cd' to 0 before calling.
32.500 +
32.501 +comments:
32.502 +
32.503 + Added in SDK 2.0.
32.504 +
32.505 +--------------------------------------------------------------------------
32.506 +
32.507 +AddToFullPack
32.508 +
32.509 +from dlls/client.cpp:
32.510 +int AddToFullPack(struct entity_state_s *state, int e, edict_t *ent,
32.511 +edict_t *host, int hostflags, int player, unsigned char *pSet);
32.512 +
32.513 + Return 1 if the entity state has been filled in for the ent and the
32.514 + entity will be propagated to the client, 0 otherwise.
32.515 +
32.516 + State is the server maintained copy of the state info that is
32.517 + transmitted to the client. A MOD could alter values copied into state
32.518 + to send the "host" a different look for a particular entity update,
32.519 + etc.
32.520 +
32.521 + Arguments 'e' and 'ent' are the entity that is being added to the
32.522 + update, if 1 is returneds. Host is the player's edict of the player
32.523 + whom we are sending the update to. Player is 1 if the ent/e is a
32.524 + player and 0 otherwise. Argument 'pSet' is either the PAS or PVS that
32.525 + we previous set up. We can use it to ask the engine to filter the
32.526 + entity against the PAS or PVS.
32.527 +
32.528 + We could also use the pas/ pvs that we set in SetupVisibility, if we
32.529 + wanted to. Caching the value is valid in that case, but still only for
32.530 + the current frame.
32.531 +
32.532 +comments:
32.533 +
32.534 + Added in SDK 2.0.
32.535 +
32.536 +--------------------------------------------------------------------------
32.537 +
32.538 +CreateBaseline
32.539 +
32.540 +from dlls/client.cpp:
32.541 +void CreateBaseline(int player, int eindex, struct entity_state_s *
32.542 +baseline, struct edict_s *entity, int playermodelindex, vec3_t
32.543 +player_mins, vec3_t player_maxs);
32.544 +
32.545 + Tweak entity baseline for network encoding, allows setup of player
32.546 + baselines, too.
32.547 + Creates baselines used for network encoding, especially for player
32.548 + data since players are not spawned until connect time.
32.549 +
32.550 +comments:
32.551 +
32.552 + Added in SDK 2.0.
32.553 +
32.554 +--------------------------------------------------------------------------
32.555 +
32.556 +RegisterEncoders
32.557 +
32.558 +from dlls/client.cpp:
32.559 +void RegisterEncoders(void);
32.560 +
32.561 + Callbacks for network encoding.
32.562 + Allows game .dll to override network encoding of certain types of
32.563 + entities and tweak values, etc.
32.564 +
32.565 +comments:
32.566 +
32.567 + Added in SDK 2.0.
32.568 +
32.569 +--------------------------------------------------------------------------
32.570 +
32.571 +GetWeaponData
32.572 +
32.573 +from dlls/client.cpp
32.574 +int GetWeaponData(struct edict_s *player, struct weapon_data_s *info);
32.575 +
32.576 +comments:
32.577 +
32.578 + Added in SDK 2.0.
32.579 +
32.580 +--------------------------------------------------------------------------
32.581 +
32.582 +CmdStart
32.583 +
32.584 +from dlls/client.cpp:
32.585 +void CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned
32.586 +int random_seed);
32.587 +
32.588 + We're about to run this usercmd for the specified player. We can set
32.589 + up groupinfo and masking here, etc. This is the time to examine the
32.590 + usercmd for anything extra. This call happens even if think does not.
32.591 +
32.592 +comments:
32.593 +
32.594 + Added in SDK 2.0.
32.595 +
32.596 +--------------------------------------------------------------------------
32.597 +
32.598 +CmdEnd
32.599 +
32.600 +from dlls/client.cpp:
32.601 +void CmdEnd (const edict_t *player);
32.602 +
32.603 + Each cmdstart is exactly matched with a cmd end, clean up any group
32.604 + trace flags, etc. here.
32.605 +
32.606 +comments:
32.607 +
32.608 + Added in SDK 2.0.
32.609 +
32.610 +--------------------------------------------------------------------------
32.611 +
32.612 +ConnectionlessPacket
32.613 +
32.614 +from dlls/client.cpp:
32.615 +int ConnectionlessPacket(const struct netadr_s *net_from, const char *
32.616 +args, char *response_buffer, int *response_buffer_size);
32.617 +
32.618 + Return 1 if the packet is valid. Set response_buffer_size if you want
32.619 + to send a response packet. Incoming, it holds the max size of the
32.620 + response_buffer, so you must zero it out if you choose not to respond.
32.621 +
32.622 +comments:
32.623 +
32.624 + Added in SDK 2.0.
32.625 +
32.626 +--------------------------------------------------------------------------
32.627 +
32.628 +GetHullBounds
32.629 +
32.630 +from dlls/client.cpp:
32.631 +int GetHullBounds(int hullnumber, float *mins, float *maxs);
32.632 +
32.633 + Engine calls this to enumerate player collision hulls, for prediction.
32.634 + Return 0 if the hullnumber doesn't exist.
32.635 +
32.636 +comments:
32.637 +
32.638 + Added in SDK 2.0.
32.639 +
32.640 +--------------------------------------------------------------------------
32.641 +
32.642 +CreateInstancedBaselines
32.643 +
32.644 +from dlls/client.cpp:
32.645 +void CreateInstancedBaselines (void);
32.646 +
32.647 + Tweak entity baseline for network encoding, allows setup of player
32.648 + baselines, too.
32.649 + Create pseudo-baselines for items that aren't placed in the map at
32.650 + spawn time, but which are likely to be created during play (e.g.,
32.651 + grenades, ammo packs, projectiles, corpses, etc.).
32.652 +
32.653 +comments:
32.654 +
32.655 + Added in SDK 2.0.
32.656 +
32.657 +--------------------------------------------------------------------------
32.658 +
32.659 +InconsistentFile
32.660 +
32.661 +from dlls/client.cpp:
32.662 +int InconsistentFile(const edict_t *player, const char *filename, char *
32.663 +disconnect_message);
32.664 +
32.665 + One of the ENGINE_FORCE_UNMODIFIED files failed the consistency check
32.666 + for the specified player Return 0 to allow the client to continue, 1
32.667 + to force immediate disconnection (with an optional disconnect message
32.668 + of up to 256 characters).
32.669 +
32.670 +comments:
32.671 +
32.672 + Added in SDK 2.0.
32.673 +
32.674 +--------------------------------------------------------------------------
32.675 +
32.676 +AllowLagCompensation
32.677 +
32.678 +from dlls/client.cpp:
32.679 +int AllowLagCompensation(void);
32.680 +
32.681 + The game .dll should return 1 if lag compensation should be allowed
32.682 + (could also just set the sv_unlag cvar. Most games right now should
32.683 + return 0, until client-side weapon prediction code is written and
32.684 + tested for them (note you can predict weapons, but not do lag
32.685 + compensation, too, if you want.
32.686 +
32.687 +comments:
32.688 +
32.689 + Added in SDK 2.0.
32.690 +
32.691 +--------------------------------------------------------------------------
33.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
33.2 +++ b/doc/txt/engine_notes.txt Tue Apr 06 07:36:14 2004 +0000
33.3 @@ -0,0 +1,2166 @@
33.4 +HLSDK Engine Notes
33.5 +=-=-=-=-=-=-=-=-=-=
33.6 +
33.7 +--------------------------------------------------------------------------
33.8 +
33.9 + - PrecacheModel
33.10 + - PrecacheSound
33.11 + - SetModel
33.12 + - ModelIndex
33.13 + - ModelFrames
33.14 + - SetSize
33.15 + - ChangeLevel
33.16 + - GetSpawnParms
33.17 + - SaveSpawnParms
33.18 + - VecToYaw
33.19 + - VecToAngles
33.20 + - MoveToOrigin
33.21 + - ChangeYaw
33.22 + - ChangePitch
33.23 + - FindEntityByString
33.24 + - GetEntityIllum
33.25 + - FindEntityInSphere
33.26 + - FindClientInPVS
33.27 + - EntitiesInPVS
33.28 + - MakeVectors
33.29 + - AngleVectors
33.30 + - CreateEntity
33.31 + - RemoveEntity
33.32 + - CreateNamedEntity
33.33 + - MakeStatic
33.34 + - EntIsOnFloor
33.35 + - DropToFloor
33.36 + - WalkMove
33.37 + - SetOrigin
33.38 + - EmitSound
33.39 + - EmitAmbientSound
33.40 + - TraceLine
33.41 + - TraceToss
33.42 + - TraceMonsterHull
33.43 + - TraceHull
33.44 + - TraceModel
33.45 + - TraceTexture
33.46 + - TraceSphere
33.47 + - GetAimVector
33.48 + - ServerCommand
33.49 + - ServerExecute
33.50 + - ClientCommand
33.51 + - ParticleEffect
33.52 + - LightStyle
33.53 + - DecalIndex
33.54 + - PointContents
33.55 + - MessageBegin
33.56 + - MessageEnd
33.57 + - WriteByte
33.58 + - WriteChar
33.59 + - WriteShort
33.60 + - WriteLong
33.61 + - WriteAngle
33.62 + - WriteCoord
33.63 + - WriteString
33.64 + - WriteEntity
33.65 + - CVarRegister
33.66 + - CVarGetFloat
33.67 + - CVarGetString
33.68 + - CVarSetFloat
33.69 + - CVarSetString
33.70 + - AlertMessage
33.71 + - EngineFprintf
33.72 + - PvAllocEntPrivateData
33.73 + - PvEntPrivateData
33.74 + - FreeEntPrivateData
33.75 + - SzFromIndex
33.76 + - AllocString
33.77 + - GetVarsOfEnt
33.78 + - PEntityOfEntOffset
33.79 + - EntOffsetOfPEntity
33.80 + - IndexOfEdict
33.81 + - PEntityOfEntIndex
33.82 + - FindEntityByVars
33.83 + - GetModelPtr
33.84 + - RegUserMsg
33.85 + - AnimationAutomove
33.86 + - GetBonePosition
33.87 + - FunctionFromName
33.88 + - NameForFunction
33.89 + - ClientPrintf
33.90 + - ServerPrint
33.91 + - Cmd_Args
33.92 + - Cmd_Argv
33.93 + - Cmd_Argc
33.94 + - GetAttachment
33.95 + - CRC32_Init
33.96 + - CRC32_ProcessBuffer
33.97 + - CRC32_ProcessByte
33.98 + - CRC32_Final
33.99 + - RandomLong
33.100 + - RandomFloat
33.101 + - SetView
33.102 + - Time
33.103 + - CrosshairAngle
33.104 + - LoadFileForMe
33.105 + - FreeFile
33.106 + - EndSection
33.107 + - CompareFileTime
33.108 + - GetGameDir
33.109 + - Cvar_RegisterVariable
33.110 + - FadeClientVolume
33.111 + - SetClientMaxspeed
33.112 + - CreateFakeClient
33.113 + - RunPlayerMove
33.114 + - NumberOfEntities
33.115 + - GetInfoKeyBuffer
33.116 + - InfoKeyValue
33.117 + - SetKeyValue
33.118 + - SetClientKeyValue
33.119 + - IsMapValid
33.120 + - StaticDecal
33.121 + - PrecacheGeneric
33.122 + - GetPlayerUserId
33.123 + - BuildSoundMsg
33.124 + - IsDedicatedServer
33.125 + - CVarGetPointer
33.126 + - GetPlayerWONId
33.127 + - Info_RemoveKey
33.128 + - GetPhysicsKeyValue
33.129 + - SetPhysicsKeyValue
33.130 + - GetPhysicsInfoString
33.131 + - PrecacheEvent
33.132 + - PlaybackEvent
33.133 + - SetFatPVS
33.134 + - SetFatPAS
33.135 + - CheckVisibility
33.136 + - DeltaSetField
33.137 + - DeltaUnsetField
33.138 + - DeltaAddEncoder
33.139 + - GetCurrentPlayer
33.140 + - CanSkipPlayer
33.141 + - DeltaFindField
33.142 + - DeltaSetFieldByIndex
33.143 + - DeltaUnsetFieldByIndex
33.144 + - SetGroupMask
33.145 + - CreateInstancedBaseline
33.146 + - Cvar_DirectSet
33.147 + - ForceUnmodified
33.148 + - GetPlayerStats
33.149 + - AddServerCommand
33.150 + - Voice_GetClientListening
33.151 + - Voice_SetClientListening
33.152 + - GetPlayerAuthId
33.153 + - SequenceGet
33.154 + - SequencePickSentence
33.155 + - GetFileSize
33.156 + - GetApproxWavePlayLen
33.157 + - IsCareerMatch
33.158 + - GetLocalizedStringLength
33.159 + - RegisterTutorMessageShown
33.160 + - GetTimesTutorMessageShown
33.161 + - ProcessTutorMessageDecayBuffer
33.162 + - ConstructTutorMessageDecayBuffer
33.163 + - ResetTutorMessageDecayData
33.164 +
33.165 +--------------------------------------------------------------------------
33.166 +
33.167 +PrecacheModel
33.168 +
33.169 +from engine/eiface.h:
33.170 +int PrecacheModel(char *s);
33.171 +PRECACHE_MODEL()
33.172 +
33.173 +comments:
33.174 +
33.175 + .
33.176 +
33.177 +--------------------------------------------------------------------------
33.178 +
33.179 +PrecacheSound
33.180 +
33.181 +from engine/eiface.h:
33.182 +int PrecacheSound(char *s);
33.183 +PRECACHE_SOUND()
33.184 +
33.185 +comments:
33.186 +
33.187 + .
33.188 +
33.189 +--------------------------------------------------------------------------
33.190 +
33.191 +SetModel
33.192 +
33.193 +from engine/eiface.h:
33.194 +void SetModel(edict_t *e, const char *m);
33.195 +SET_MODEL()
33.196 +
33.197 +comments:
33.198 +
33.199 + .
33.200 +
33.201 +--------------------------------------------------------------------------
33.202 +
33.203 +ModelIndex
33.204 +
33.205 +from engine/eiface.h:
33.206 +int ModelIndex(const char *m);
33.207 +MODEL_INDEX()
33.208 +
33.209 +comments:
33.210 +
33.211 + .
33.212 +
33.213 +--------------------------------------------------------------------------
33.214 +
33.215 +ModelFrames
33.216 +
33.217 +from engine/eiface.h:
33.218 +int ModelFrames(int modelIndex);
33.219 +MODEL_FRAMES()
33.220 +
33.221 +comments:
33.222 +
33.223 + .
33.224 +
33.225 +--------------------------------------------------------------------------
33.226 +
33.227 +SetSize
33.228 +
33.229 +from engine/eiface.h:
33.230 +void SetSize(edict_t *e, const float *rgflMin, const float *rgflMax);
33.231 +SET_SIZE()
33.232 +
33.233 +comments:
33.234 +
33.235 + .
33.236 +
33.237 +--------------------------------------------------------------------------
33.238 +
33.239 +ChangeLevel
33.240 +
33.241 +from engine/eiface.h:
33.242 +void ChangeLevel(char *s1, char *s2);
33.243 +CHANGE_LEVEL()
33.244 +
33.245 +comments:
33.246 +
33.247 + .
33.248 +
33.249 +--------------------------------------------------------------------------
33.250 +
33.251 +GetSpawnParms
33.252 +
33.253 +from engine/eiface.h:
33.254 +void GetSpawnParms(edict_t *ent);
33.255 +GET_SPAWN_PARMS()
33.256 +
33.257 +comments:
33.258 +
33.259 + .
33.260 +
33.261 +--------------------------------------------------------------------------
33.262 +
33.263 +SaveSpawnParms
33.264 +
33.265 +from engine/eiface.h:
33.266 +void SaveSpawnParms(edict_t *ent);
33.267 +SAVE_SPAWN_PARMS()
33.268 +
33.269 +comments:
33.270 +
33.271 + .
33.272 +
33.273 +--------------------------------------------------------------------------
33.274 +
33.275 +VecToYaw
33.276 +
33.277 +from engine/eiface.h:
33.278 +float VecToYaw(const float *rgflVector);
33.279 +VEC_TO_YAW()
33.280 +
33.281 +comments:
33.282 +
33.283 + .
33.284 +
33.285 +--------------------------------------------------------------------------
33.286 +
33.287 +VecToAngles
33.288 +
33.289 +from engine/eiface.h:
33.290 +void VecToAngles(const float *rgflVectorIn, float *rgflVectorOut);
33.291 +VEC_TO_ANGLES()
33.292 +
33.293 +comments:
33.294 +
33.295 + .
33.296 +
33.297 +--------------------------------------------------------------------------
33.298 +
33.299 +MoveToOrigin
33.300 +
33.301 +from engine/eiface.h:
33.302 +void MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int
33.303 +iMoveType);
33.304 +MOVE_TO_ORIGIN()
33.305 +
33.306 +comments:
33.307 +
33.308 + .
33.309 +
33.310 +--------------------------------------------------------------------------
33.311 +
33.312 +ChangeYaw
33.313 +
33.314 +from engine/eiface.h:
33.315 +void ChangeYaw(edict_t *ent);
33.316 +oldCHANGE_YAW()
33.317 +
33.318 +comments:
33.319 +
33.320 + .
33.321 +
33.322 +--------------------------------------------------------------------------
33.323 +
33.324 +ChangePitch
33.325 +
33.326 +from engine/eiface.h:
33.327 +void ChangePitch(edict_t *ent);
33.328 +CHANGE_PITCH()
33.329 +
33.330 +comments:
33.331 +
33.332 + .
33.333 +
33.334 +--------------------------------------------------------------------------
33.335 +
33.336 +FindEntityByString
33.337 +
33.338 +from engine/eiface.h:
33.339 +edict_t *FindEntityByString(edict_t *pEdictStartSearchAfter, const char *
33.340 +pszField, const char *pszValue);
33.341 +FIND_ENTITY_BY_STRING()
33.342 +
33.343 +comments:
33.344 +
33.345 + .
33.346 +
33.347 +--------------------------------------------------------------------------
33.348 +
33.349 +GetEntityIllum
33.350 +
33.351 +from engine/eiface.h:
33.352 +int GetEntityIllum(edict_t *pEnt);
33.353 +GETENTITYILLUM()
33.354 +
33.355 +comments:
33.356 +
33.357 + .
33.358 +
33.359 +--------------------------------------------------------------------------
33.360 +
33.361 +FindEntityInSphere
33.362 +
33.363 +from engine/eiface.h:
33.364 +edict_t *FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *
33.365 +org, float rad);
33.366 +FIND_ENTITY_IN_SPHERE()
33.367 +
33.368 +comments:
33.369 +
33.370 + .
33.371 +
33.372 +--------------------------------------------------------------------------
33.373 +
33.374 +FindClientInPVS
33.375 +
33.376 +from engine/eiface.h:
33.377 +edict_t *FindClientInPVS(edict_t *pEdict);
33.378 +FIND_ENTITY_IN_PVS()
33.379 +
33.380 +comments:
33.381 +
33.382 + .
33.383 +
33.384 +--------------------------------------------------------------------------
33.385 +
33.386 +EntitiesInPVS
33.387 +
33.388 +from engine/eiface.h:
33.389 +edict_t *EntitiesInPVS(edict_t *pplayer);
33.390 +
33.391 +comments:
33.392 +
33.393 + .
33.394 +
33.395 +--------------------------------------------------------------------------
33.396 +
33.397 +MakeVectors
33.398 +
33.399 +from engine/eiface.h:
33.400 +void MakeVectors(const float *rgflVector);
33.401 +MAKE_VECTORS()
33.402 +
33.403 +comments:
33.404 +
33.405 + .
33.406 +
33.407 +--------------------------------------------------------------------------
33.408 +
33.409 +AngleVectors
33.410 +
33.411 +from engine/eiface.h:
33.412 +void AngleVectors(const float *rgflVector, float *forward, float *right,
33.413 +float *up);
33.414 +
33.415 +comments:
33.416 +
33.417 + .
33.418 +
33.419 +--------------------------------------------------------------------------
33.420 +
33.421 +CreateEntity
33.422 +
33.423 +from engine/eiface.h:
33.424 +edict_t *CreateEntity(void);
33.425 +CREATE_ENTITY()
33.426 +
33.427 +comments:
33.428 +
33.429 + .
33.430 +
33.431 +--------------------------------------------------------------------------
33.432 +
33.433 +RemoveEntity
33.434 +
33.435 +from engine/eiface.h:
33.436 +void RemoveEntity(edict_t *e);
33.437 +REMOVE_ENTITY()
33.438 +
33.439 +comments:
33.440 +
33.441 + .
33.442 +
33.443 +--------------------------------------------------------------------------
33.444 +
33.445 +CreateNamedEntity
33.446 +
33.447 +from engine/eiface.h:
33.448 +edict_t *CreateNamedEntity(int className);
33.449 +CREATE_NAMED_ENTITY()
33.450 +
33.451 +comments:
33.452 +
33.453 + .
33.454 +
33.455 +--------------------------------------------------------------------------
33.456 +
33.457 +MakeStatic
33.458 +
33.459 +from engine/eiface.h:
33.460 +void MakeStatic(edict_t *ent);
33.461 +MAKE_STATIC()
33.462 +
33.463 +comments:
33.464 +
33.465 + .
33.466 +
33.467 +--------------------------------------------------------------------------
33.468 +
33.469 +EntIsOnFloor
33.470 +
33.471 +from engine/eiface.h:
33.472 +int EntIsOnFloor(edict_t *e);
33.473 +ENT_IS_ON_FLOOR()
33.474 +
33.475 +comments:
33.476 +
33.477 + .
33.478 +
33.479 +--------------------------------------------------------------------------
33.480 +
33.481 +DropToFloor
33.482 +
33.483 +from engine/eiface.h:
33.484 +int DropToFloor(edict_t *e);
33.485 +DROP_TO_FLOOR()
33.486 +
33.487 +comments:
33.488 +
33.489 + .
33.490 +
33.491 +--------------------------------------------------------------------------
33.492 +
33.493 +WalkMove
33.494 +
33.495 +from engine/eiface.h:
33.496 +int WalkMove(edict_t *ent, float yaw, float dist, int iMode);
33.497 +WALK_MOVE()
33.498 +
33.499 +comments:
33.500 +
33.501 + .
33.502 +
33.503 +--------------------------------------------------------------------------
33.504 +
33.505 +SetOrigin
33.506 +
33.507 +from engine/eiface.h:
33.508 +void SetOrigin(edict_t *e, const float *rgflOrigin);
33.509 +SET_ORIGIN()
33.510 +
33.511 +comments:
33.512 +
33.513 + .
33.514 +
33.515 +--------------------------------------------------------------------------
33.516 +
33.517 +EmitSound
33.518 +
33.519 +from engine/eiface.h:
33.520 +void EmitSound(edict_t *entity, int channel, const char *sample, /*int*/
33.521 +float volume, float attenuation, int fFlags, int pitch);
33.522 +EMIT_SOUND_DYN2()
33.523 +
33.524 +comments:
33.525 +
33.526 + .
33.527 +
33.528 +--------------------------------------------------------------------------
33.529 +
33.530 +EmitAmbientSound
33.531 +
33.532 +from engine/eiface.h:
33.533 +void EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float
33.534 +vol, float attenuation, int fFlags, int pitch);
33.535 +EMIT_AMBIENT_SOUND()
33.536 +
33.537 +comments:
33.538 +
33.539 + .
33.540 +
33.541 +--------------------------------------------------------------------------
33.542 +
33.543 +TraceLine
33.544 +
33.545 +from engine/eiface.h:
33.546 +void TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t
33.547 +*pentToSkip, TraceResult *ptr);
33.548 +TRACE_LINE()
33.549 +
33.550 +comments:
33.551 +
33.552 + .
33.553 +
33.554 +--------------------------------------------------------------------------
33.555 +
33.556 +TraceToss
33.557 +
33.558 +from engine/eiface.h:
33.559 +void TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr);
33.560 +TRACE_TOSS()
33.561 +
33.562 +comments:
33.563 +
33.564 + .
33.565 +
33.566 +--------------------------------------------------------------------------
33.567 +
33.568 +TraceMonsterHull
33.569 +
33.570 +from engine/eiface.h:
33.571 +int TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2,
33.572 +int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr);
33.573 +TRACE_MONSTER_HULL()
33.574 +
33.575 +comments:
33.576 +
33.577 + .
33.578 +
33.579 +--------------------------------------------------------------------------
33.580 +
33.581 +TraceHull
33.582 +
33.583 +from engine/eiface.h:
33.584 +void TraceHull(const float *v1, const float *v2, int fNoMonsters, int
33.585 +hullNumber, edict_t *pentToSkip, TraceResult *ptr);
33.586 +TRACE_HULL()
33.587 +
33.588 +comments:
33.589 +
33.590 + .
33.591 +
33.592 +--------------------------------------------------------------------------
33.593 +
33.594 +TraceModel
33.595 +
33.596 +from engine/eiface.h:
33.597 +void TraceModel(const float *v1, const float *v2, int hullNumber, edict_t
33.598 +*pent, TraceResult *ptr);
33.599 +
33.600 +comments:
33.601 +
33.602 + .
33.603 +
33.604 +--------------------------------------------------------------------------
33.605 +
33.606 +TraceTexture
33.607 +
33.608 +from engine/eiface.h:
33.609 +const char *TraceTexture(edict_t *pTextureEntity, const float *v1, const
33.610 +float *v2);
33.611 +TRACE_TEXTURE()
33.612 +
33.613 +comments:
33.614 +
33.615 + .
33.616 +
33.617 +--------------------------------------------------------------------------
33.618 +
33.619 +TraceSphere
33.620 +
33.621 +from engine/eiface.h:
33.622 +void TraceSphere(const float *v1, const float *v2, int fNoMonsters, float
33.623 +radius, edict_t *pentToSkip, TraceResult *ptr);
33.624 +
33.625 +comments:
33.626 +
33.627 + .
33.628 +
33.629 +--------------------------------------------------------------------------
33.630 +
33.631 +GetAimVector
33.632 +
33.633 +from engine/eiface.h:
33.634 +void GetAimVector(edict_t *ent, float speed, float *rgflReturn);
33.635 +GET_AIM_VECTOR()
33.636 +
33.637 +comments:
33.638 +
33.639 + .
33.640 +
33.641 +--------------------------------------------------------------------------
33.642 +
33.643 +ServerCommand
33.644 +
33.645 +from engine/eiface.h:
33.646 +void ServerCommand(char *str);
33.647 +SERVER_COMMAND()
33.648 +
33.649 +comments:
33.650 +
33.651 + Executes a server command, as if typed at the console (ie "exec
33.652 + myconfig.cfg", or "quit"). Note that it appears no commands are
33.653 + executed until after GameDLLInit is called. If ServerCommand is called
33.654 + earlier than that, the command is delayed until then.
33.655 +
33.656 +--------------------------------------------------------------------------
33.657 +
33.658 +ServerExecute
33.659 +
33.660 +from engine/eiface.h:
33.661 +void ServerExecute(void);
33.662 +SERVER_EXECUTE()
33.663 +
33.664 +comments:
33.665 +
33.666 + .
33.667 +
33.668 +--------------------------------------------------------------------------
33.669 +
33.670 +ClientCommand
33.671 +
33.672 +from engine/eiface.h:
33.673 +void ClientCommand(edict_t *pEdict, char *szFmt, ...);
33.674 +CLIENT_COMMAND()
33.675 +
33.676 +comments:
33.677 +
33.678 + .
33.679 +
33.680 +--------------------------------------------------------------------------
33.681 +
33.682 +ParticleEffect
33.683 +
33.684 +from engine/eiface.h:
33.685 +void ParticleEffect(const float *org, const float *dir, float color, float
33.686 +count);
33.687 +PARTICLE_EFFECT()
33.688 +
33.689 +comments:
33.690 +
33.691 + .
33.692 +
33.693 +--------------------------------------------------------------------------
33.694 +
33.695 +LightStyle
33.696 +
33.697 +from engine/eiface.h:
33.698 +void LightStyle(int style, char *val);
33.699 +LIGHT_STYLE()
33.700 +
33.701 +comments:
33.702 +
33.703 + .
33.704 +
33.705 +--------------------------------------------------------------------------
33.706 +
33.707 +DecalIndex
33.708 +
33.709 +from engine/eiface.h:
33.710 +int DecalIndex(const char *name);
33.711 +DECAL_INDEX()
33.712 +
33.713 +comments:
33.714 +
33.715 + .
33.716 +
33.717 +--------------------------------------------------------------------------
33.718 +
33.719 +PointContents
33.720 +
33.721 +from engine/eiface.h:
33.722 +int PointContents(const float *rgflVector);
33.723 +POINT_CONTENTS()
33.724 +
33.725 +comments:
33.726 +
33.727 + .
33.728 +
33.729 +--------------------------------------------------------------------------
33.730 +
33.731 +MessageBegin
33.732 +
33.733 +from engine/eiface.h:
33.734 +void MessageBegin(int msg_dest, int msg_type, const float *pOrigin,
33.735 +edict_t *ed);
33.736 +MESSAGE_BEGIN()
33.737 +
33.738 +comments:
33.739 +
33.740 + Begin a network message to send to the client.
33.741 + msg_type should be a number returned by RegUserMsg.
33.742 + msg_dest is one of:
33.743 + - MSG_BROADCAST - "unreliable to all"
33.744 + - MSG_ONE - "reliable to one (msg_entity)"
33.745 + - MSG_ALL - "reliable to all"
33.746 + - MSG_INIT - "write to the init string"
33.747 + - MSG_PVS - "Ents in PVS of org" (PVS=potentially visible set)
33.748 + - MSG_PAS - "Ents in PAS of org" (PAS=potentially audible set)
33.749 + - MSG_PVS_R - "Reliable to PVS"
33.750 + - MSG_PAS_R - "Reliable to PAS"
33.751 + - MSG_ONE_UNRELIABLE - "Send to one client, but don't put in
33.752 + reliable stream, put in unreliable datagram (could be dropped)"
33.753 +
33.754 +--------------------------------------------------------------------------
33.755 +
33.756 +MessageEnd
33.757 +
33.758 +from engine/eiface.h:
33.759 +void MessageEnd(void);
33.760 +MESSAGE_END()
33.761 +
33.762 +comments:
33.763 +
33.764 + .
33.765 +
33.766 +--------------------------------------------------------------------------
33.767 +
33.768 +WriteByte
33.769 +
33.770 +from engine/eiface.h:
33.771 +void WriteByte(int iValue);
33.772 +WRITE_BYTE()
33.773 +
33.774 +comments:
33.775 +
33.776 + .
33.777 +
33.778 +--------------------------------------------------------------------------
33.779 +
33.780 +WriteChar
33.781 +
33.782 +from engine/eiface.h:
33.783 +void WriteChar(int iValue);
33.784 +WRITE_CHAR()
33.785 +
33.786 +comments:
33.787 +
33.788 + .
33.789 +
33.790 +--------------------------------------------------------------------------
33.791 +
33.792 +WriteShort
33.793 +
33.794 +from engine/eiface.h:
33.795 +void WriteShort(int iValue);
33.796 +WRITE_SHORT()
33.797 +
33.798 +comments:
33.799 +
33.800 + .
33.801 +
33.802 +--------------------------------------------------------------------------
33.803 +
33.804 +WriteLong
33.805 +
33.806 +from engine/eiface.h:
33.807 +void WriteLong(int iValue);
33.808 +WRITE_LONG()
33.809 +
33.810 +comments:
33.811 +
33.812 + .
33.813 +
33.814 +--------------------------------------------------------------------------
33.815 +
33.816 +WriteAngle
33.817 +
33.818 +from engine/eiface.h:
33.819 +void WriteAngle(float flValue);
33.820 +WRITE_ANGLE()
33.821 +
33.822 +comments:
33.823 +
33.824 + .
33.825 +
33.826 +--------------------------------------------------------------------------
33.827 +
33.828 +WriteCoord
33.829 +
33.830 +from engine/eiface.h:
33.831 +void WriteCoord(float flValue);
33.832 +WRITE_COORD()
33.833 +
33.834 +comments:
33.835 +
33.836 + .
33.837 +
33.838 +--------------------------------------------------------------------------
33.839 +
33.840 +WriteString
33.841 +
33.842 +from engine/eiface.h:
33.843 +void WriteString(const char *sz);
33.844 +WRITE_STRING()
33.845 +
33.846 +comments:
33.847 +
33.848 + .
33.849 +
33.850 +--------------------------------------------------------------------------
33.851 +
33.852 +WriteEntity
33.853 +
33.854 +from engine/eiface.h:
33.855 +void WriteEntity(int iValue);
33.856 +WRITE_ENTITY()
33.857 +
33.858 +comments:
33.859 +
33.860 + .
33.861 +
33.862 +--------------------------------------------------------------------------
33.863 +
33.864 +CVarRegister
33.865 +
33.866 +from engine/eiface.h:
33.867 +void CVarRegister(cvar_t *pCvar);
33.868 +CVAR_REGISTER()
33.869 +
33.870 +comments:
33.871 +
33.872 + Register a new cvar (server variable).
33.873 +
33.874 +--------------------------------------------------------------------------
33.875 +
33.876 +CVarGetFloat
33.877 +
33.878 +from engine/eiface.h:
33.879 +float CVarGetFloat(const char *szVarName);
33.880 +CVAR_GET_FLOAT()
33.881 +
33.882 +comments:
33.883 +
33.884 + Return the float value of a cvar.
33.885 +
33.886 +--------------------------------------------------------------------------
33.887 +
33.888 +CVarGetString
33.889 +
33.890 +from engine/eiface.h:
33.891 +const char *CVarGetString(const char *szVarName);
33.892 +CVAR_GET_STRING()
33.893 +
33.894 +comments:
33.895 +
33.896 + Return the string value of a cvar.
33.897 +
33.898 +--------------------------------------------------------------------------
33.899 +
33.900 +CVarSetFloat
33.901 +
33.902 +from engine/eiface.h:
33.903 +void CVarSetFloat(const char *szVarName, float flValue);
33.904 +CVAR_SET_FLOAT()
33.905 +
33.906 +comments:
33.907 +
33.908 + Set the float value of a cvar.
33.909 +
33.910 +--------------------------------------------------------------------------
33.911 +
33.912 +CVarSetString
33.913 +
33.914 +from engine/eiface.h:
33.915 +void CVarSetString(const char *szVarName, const char *szValue);
33.916 +CVAR_SET_STRING()
33.917 +
33.918 +comments:
33.919 +
33.920 + Set the string value of a cvar.
33.921 +
33.922 +--------------------------------------------------------------------------
33.923 +
33.924 +AlertMessage
33.925 +
33.926 +from engine/eiface.h:
33.927 +void AlertMessage(ALERT_TYPE atype, char *szFmt, ...);
33.928 +ALERT()
33.929 +
33.930 +comments:
33.931 +
33.932 + Print an alert message.
33.933 + atype is one of:
33.934 + - at_notice
33.935 + - at_console - "same as at_notice, but forces a ConPrintf, not a
33.936 + message box". Prints output to server console, but only shown if
33.937 + 'developer' is set.
33.938 + - at_aiconsole - "same as at_console, but only shown if developer
33.939 + level is 2!"
33.940 + - at_warning
33.941 + - at_error
33.942 + - at_logged - "Server print to console (only in multiplayer games)."
33.943 + Prints output to server logs and console.
33.944 +
33.945 +--------------------------------------------------------------------------
33.946 +
33.947 +EngineFprintf
33.948 +
33.949 +from engine/eiface.h:
33.950 +void EngineFprintf(FILE *pfile, char *szFmt, ...);
33.951 +ENGINE_FPRINTF()
33.952 +
33.953 +comments:
33.954 +
33.955 + .
33.956 +
33.957 +--------------------------------------------------------------------------
33.958 +
33.959 +PvAllocEntPrivateData
33.960 +
33.961 +from engine/eiface.h:
33.962 +void *PvAllocEntPrivateData(edict_t *pEdict, long cb);
33.963 +ALLOC_PRIVATE()
33.964 +
33.965 +comments:
33.966 +
33.967 + .
33.968 +
33.969 +--------------------------------------------------------------------------
33.970 +
33.971 +PvEntPrivateData
33.972 +
33.973 +from engine/eiface.h:
33.974 +void *PvEntPrivateData(edict_t *pEdict);
33.975 +GET_PRIVATE()
33.976 +
33.977 +comments:
33.978 +
33.979 + Returns a pointer to the base class type of the given edict. For
33.980 + instance:
33.981 + CBaseEntity *pPlayer=(CBaseEntity *)GET_PRIVATE(pEntity);
33.982 +
33.983 +
33.984 +--------------------------------------------------------------------------
33.985 +
33.986 +FreeEntPrivateData
33.987 +
33.988 +from engine/eiface.h:
33.989 +void FreeEntPrivateData(edict_t *pEdict);
33.990 +FREE_PRIVATE()
33.991 +
33.992 +comments:
33.993 +
33.994 + .
33.995 +
33.996 +--------------------------------------------------------------------------
33.997 +
33.998 +SzFromIndex
33.999 +
33.1000 +from engine/eiface.h:
33.1001 +const char *SzFromIndex(int iString);
33.1002 +
33.1003 +comments:
33.1004 +
33.1005 + .
33.1006 +
33.1007 +--------------------------------------------------------------------------
33.1008 +
33.1009 +AllocString
33.1010 +
33.1011 +from engine/eiface.h:
33.1012 +int AllocString(const char *szValue);
33.1013 +ALLOC_STRING()
33.1014 +
33.1015 +comments:
33.1016 +
33.1017 + .
33.1018 +
33.1019 +--------------------------------------------------------------------------
33.1020 +
33.1021 +GetVarsOfEnt
33.1022 +
33.1023 +from engine/eiface.h:
33.1024 +struct entvars_s *GetVarsOfEnt(edict_t *pEdict);
33.1025 +
33.1026 +comments:
33.1027 +
33.1028 + .
33.1029 +
33.1030 +--------------------------------------------------------------------------
33.1031 +
33.1032 +PEntityOfEntOffset
33.1033 +
33.1034 +from engine/eiface.h:
33.1035 +edict_t *PEntityOfEntOffset(int iEntOffset);
33.1036 +ENT()
33.1037 +
33.1038 +comments:
33.1039 +
33.1040 + .
33.1041 +
33.1042 +--------------------------------------------------------------------------
33.1043 +
33.1044 +EntOffsetOfPEntity
33.1045 +
33.1046 +from engine/eiface.h:
33.1047 +int EntOffsetOfPEntity(const edict_t *pEdict);
33.1048 +
33.1049 +comments:
33.1050 +
33.1051 + .
33.1052 +
33.1053 +--------------------------------------------------------------------------
33.1054 +
33.1055 +IndexOfEdict
33.1056 +
33.1057 +from engine/eiface.h:
33.1058 +int IndexOfEdict(const edict_t *pEdict);
33.1059 +ENTINDEX()
33.1060 +
33.1061 +comments:
33.1062 +
33.1063 + Returns the server slot (ie 1 to maxplayers) of the given player
33.1064 + edict.
33.1065 +
33.1066 +--------------------------------------------------------------------------
33.1067 +
33.1068 +PEntityOfEntIndex
33.1069 +
33.1070 +from engine/eiface.h:
33.1071 +edict_t *PEntityOfEntIndex(int iEntIndex);
33.1072 +INDEXENT()
33.1073 +
33.1074 +comments:
33.1075 +
33.1076 + Returns the edict for the player in the given server slot (ie 1 to
33.1077 + maxplayers).
33.1078 +
33.1079 +--------------------------------------------------------------------------
33.1080 +
33.1081 +FindEntityByVars
33.1082 +
33.1083 +from engine/eiface.h:
33.1084 +edict_t *FindEntityByVars(struct entvars_s *pvars);
33.1085 +
33.1086 +comments:
33.1087 +
33.1088 + .
33.1089 +
33.1090 +--------------------------------------------------------------------------
33.1091 +
33.1092 +GetModelPtr
33.1093 +
33.1094 +from engine/eiface.h:
33.1095 +void *GetModelPtr(edict_t *pEdict);
33.1096 +GET_MODEL_PTR()
33.1097 +
33.1098 +comments:
33.1099 +
33.1100 + .
33.1101 +
33.1102 +--------------------------------------------------------------------------
33.1103 +
33.1104 +RegUserMsg
33.1105 +
33.1106 +from engine/eiface.h:
33.1107 +int RegUserMsg(const char *pszName, int iSize);
33.1108 +REG_USER_MSG()
33.1109 +
33.1110 +comments:
33.1111 +
33.1112 + Register a network message type with the given name, and size if
33.1113 + known. Returns the number assigned for the network message, to be used
33.1114 + with MessageBegin. It appears that message ID's 1-63 are reserved for
33.1115 + the Engine, and that GameDLL messages are allocated IDs starting at
33.1116 + 64. The SDK dlls/util.h appears to define six Engine messages:
33.1117 + - SVC_TEMPENTITY = 23
33.1118 + - SVC_INTERMISSION = 30
33.1119 + - SVC_CDTRACK = 32
33.1120 + - SVC_WEAPONANIM = 35
33.1121 + - SVC_ROOMTYPE = 37
33.1122 + - SVC_HLTV = 50
33.1123 +
33.1124 +--------------------------------------------------------------------------
33.1125 +
33.1126 +AnimationAutomove
33.1127 +
33.1128 +from engine/eiface.h:
33.1129 +void AnimationAutomove(const edict_t *pEdict, float flTime);
33.1130 +
33.1131 +comments:
33.1132 +
33.1133 + .
33.1134 +
33.1135 +--------------------------------------------------------------------------
33.1136 +
33.1137 +GetBonePosition
33.1138 +
33.1139 +from engine/eiface.h:
33.1140 +void GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin,
33.1141 +float *rgflAngles);
33.1142 +GET_BONE_POSITION()
33.1143 +
33.1144 +comments:
33.1145 +
33.1146 + .
33.1147 +
33.1148 +--------------------------------------------------------------------------
33.1149 +
33.1150 +FunctionFromName
33.1151 +
33.1152 +from engine/eiface.h:
33.1153 +unsigned long FunctionFromName(const char *pName);
33.1154 +FUNCTION_FROM_NAME()
33.1155 +
33.1156 +comments:
33.1157 +
33.1158 + Apparently, this finds the given exported function name string in the
33.1159 + GameDLL, and returns a pointer to said function (much like unix dlsym
33.1160 + or win32 GetProcAddress?). This appears to be used in GameDLL code for
33.1161 + loading savegames, as the savegames contain names of exported
33.1162 + functions in the GameDLL. Basically, this is the opposite of
33.1163 + NameForFunction.
33.1164 +
33.1165 +--------------------------------------------------------------------------
33.1166 +
33.1167 +NameForFunction
33.1168 +
33.1169 +from engine/eiface.h:
33.1170 +const char *NameForFunction(unsigned long function);
33.1171 +NAME_FOR_FUNCTION()
33.1172 +
33.1173 +comments:
33.1174 +
33.1175 + Basically, the opposite of FunctionFromName. Finds the given function
33.1176 + pointer address in the GameDLL, and returns the string name for the
33.1177 + corresponding function. This appears to be used in GameDLL code for
33.1178 + saving games, taking known function pointers and converting them to
33.1179 + function name strings to be stored in the savegames, so that they can
33.1180 + be converted back to function pointers upon game load.
33.1181 +
33.1182 +--------------------------------------------------------------------------
33.1183 +
33.1184 +ClientPrintf
33.1185 +
33.1186 +from engine/eiface.h:
33.1187 +void ClientPrintf(edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg);
33.1188 +CLIENT_PRINTF()
33.1189 +
33.1190 + JOHN: engine callbacks so game DLL can print messages to individual
33.1191 + clients
33.1192 +
33.1193 +comments:
33.1194 +
33.1195 + .
33.1196 +
33.1197 +--------------------------------------------------------------------------
33.1198 +
33.1199 +ServerPrint
33.1200 +
33.1201 +from engine/eiface.h:
33.1202 +void ServerPrint(const char *szMsg);
33.1203 +
33.1204 +comments:
33.1205 +
33.1206 + Prints output to the server console.
33.1207 +
33.1208 +--------------------------------------------------------------------------
33.1209 +
33.1210 +Cmd_Args
33.1211 +
33.1212 +from engine/eiface.h:
33.1213 +const char *Cmd_Args(void);
33.1214 +CMD_ARGS()
33.1215 +
33.1216 + these 3 added so game DLL can easily access client 'cmd' strings
33.1217 +
33.1218 +comments:
33.1219 +
33.1220 + Returns the arguments for a command, as a single string. The command
33.1221 + string itself is not included, and must be queried with CMD_ARGV(0).
33.1222 + For use in DLLAPI ClientCommand, or in the function provided to
33.1223 + AddServerCommand.
33.1224 +
33.1225 +--------------------------------------------------------------------------
33.1226 +
33.1227 +Cmd_Argv
33.1228 +
33.1229 +from engine/eiface.h:
33.1230 +const char *Cmd_Argv(int argc);
33.1231 +CMD_ARGV()
33.1232 +
33.1233 +comments:
33.1234 +
33.1235 + Returns the nth argument to the command. CMD_ARGV(0) returns the
33.1236 + command name itself.
33.1237 +
33.1238 +--------------------------------------------------------------------------
33.1239 +
33.1240 +Cmd_Argc
33.1241 +
33.1242 +from engine/eiface.h:
33.1243 +int Cmd_Argc(void);
33.1244 +CMD_ARGC()
33.1245 +
33.1246 +comments:
33.1247 +
33.1248 + Returns the number of arguments given to the command.
33.1249 +
33.1250 +--------------------------------------------------------------------------
33.1251 +
33.1252 +GetAttachment
33.1253 +
33.1254 +from engine/eiface.h:
33.1255 +void GetAttachment(const edict_t *pEdict, int iAttachment, float *
33.1256 +rgflOrigin, float *rgflAngles);
33.1257 +GET_ATTACHMENT()
33.1258 +
33.1259 +comments:
33.1260 +
33.1261 + .
33.1262 +
33.1263 +--------------------------------------------------------------------------
33.1264 +
33.1265 +CRC32_Init
33.1266 +
33.1267 +from engine/eiface.h:
33.1268 +void CRC32_Init(CRC32_t *pulCRC);
33.1269 +CRC32_INIT()
33.1270 +
33.1271 +comments:
33.1272 +
33.1273 + .
33.1274 +
33.1275 +--------------------------------------------------------------------------
33.1276 +
33.1277 +CRC32_ProcessBuffer
33.1278 +
33.1279 +from engine/eiface.h:
33.1280 +void CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len);
33.1281 +CRC32_PROCESS_BUFFER()
33.1282 +
33.1283 +comments:
33.1284 +
33.1285 + .
33.1286 +
33.1287 +--------------------------------------------------------------------------
33.1288 +
33.1289 +CRC32_ProcessByte
33.1290 +
33.1291 +from engine/eiface.h:
33.1292 +void CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch);
33.1293 +CRC32_PROCESS_BYTE()
33.1294 +
33.1295 +comments:
33.1296 +
33.1297 + .
33.1298 +
33.1299 +--------------------------------------------------------------------------
33.1300 +
33.1301 +CRC32_Final
33.1302 +
33.1303 +from engine/eiface.h:
33.1304 +CRC32_t CRC32_Final(CRC32_t pulCRC);
33.1305 +CRC32_FINAL()
33.1306 +
33.1307 +comments:
33.1308 +
33.1309 + .
33.1310 +
33.1311 +--------------------------------------------------------------------------
33.1312 +
33.1313 +RandomLong
33.1314 +
33.1315 +from engine/eiface.h:
33.1316 +long RandomLong(long lLow, long lHigh);
33.1317 +RANDOM_LONG()
33.1318 +
33.1319 +comments:
33.1320 +
33.1321 + .
33.1322 +
33.1323 +--------------------------------------------------------------------------
33.1324 +
33.1325 +RandomFloat
33.1326 +
33.1327 +from engine/eiface.h:
33.1328 +float RandomFloat(float flLow, float flHigh);
33.1329 +RANDOM_FLOAT()
33.1330 +
33.1331 +comments:
33.1332 +
33.1333 + .
33.1334 +
33.1335 +--------------------------------------------------------------------------
33.1336 +
33.1337 +SetView
33.1338 +
33.1339 +from engine/eiface.h:
33.1340 +void SetView(const edict_t *pClient, const edict_t *pViewent);
33.1341 +SET_VIEW()
33.1342 +
33.1343 +comments:
33.1344 +
33.1345 + .
33.1346 +
33.1347 +--------------------------------------------------------------------------
33.1348 +
33.1349 +Time
33.1350 +
33.1351 +from engine/eiface.h:
33.1352 +float Time(void);
33.1353 +
33.1354 +comments:
33.1355 +
33.1356 + .
33.1357 +
33.1358 +--------------------------------------------------------------------------
33.1359 +
33.1360 +CrosshairAngle
33.1361 +
33.1362 +from engine/eiface.h:
33.1363 +void CrosshairAngle(const edict_t *pClient, float pitch, float yaw);
33.1364 +SET_CROSSHAIRANGLE()
33.1365 +
33.1366 +comments:
33.1367 +
33.1368 + .
33.1369 +
33.1370 +--------------------------------------------------------------------------
33.1371 +
33.1372 +LoadFileForMe
33.1373 +
33.1374 +from engine/eiface.h:
33.1375 +byte * LoadFileForMe(char *filename, int *pLength);
33.1376 +LOAD_FILE_FOR_ME()
33.1377 +
33.1378 +comments:
33.1379 +
33.1380 + Opens the given filename (relative to the gamedir, or relative to the
33.1381 + hlds directory, in that order), and returns a pointer to a byte array
33.1382 + (character string) with the contents of the file. NULL-termination of
33.1383 + the array indicates end of file. Length of the file in bytes is
33.1384 + returned in the given int pointer.
33.1385 +
33.1386 +--------------------------------------------------------------------------
33.1387 +
33.1388 +FreeFile
33.1389 +
33.1390 +from engine/eiface.h:
33.1391 +void FreeFile(void *buffer);
33.1392 +FREE_FILE()
33.1393 +
33.1394 +comments:
33.1395 +
33.1396 + Free the byte array of the given buffer which was returned by
33.1397 + LoadFileForMe.
33.1398 +
33.1399 +--------------------------------------------------------------------------
33.1400 +
33.1401 +EndSection
33.1402 +
33.1403 +from engine/eiface.h:
33.1404 +void EndSection(const char *pszSectionName);
33.1405 +
33.1406 + trigger_endsection
33.1407 +
33.1408 +comments:
33.1409 +
33.1410 + .
33.1411 +
33.1412 +--------------------------------------------------------------------------
33.1413 +
33.1414 +CompareFileTime
33.1415 +
33.1416 +from engine/eiface.h:
33.1417 +int CompareFileTime(char *filename1, char *filename2, int *iCompare);
33.1418 +COMPARE_FILE_TIME()
33.1419 +
33.1420 +comments:
33.1421 +
33.1422 + .
33.1423 +
33.1424 +--------------------------------------------------------------------------
33.1425 +
33.1426 +GetGameDir
33.1427 +
33.1428 +from engine/eiface.h:
33.1429 +void GetGameDir(char *szGetGameDir);
33.1430 +GET_GAME_DIR()
33.1431 +
33.1432 +comments:
33.1433 +
33.1434 + Copies the pathname of the game directory into the given buffer. Note
33.1435 + that there's no way to inform the engine how big the buffer is, so be
33.1436 + forewarned.
33.1437 +
33.1438 + Prior to HL 1.1.1.1 (CS 1.6), this gave the full pathname of the game
33.1439 + directory, ie "/usr/local/half-life/cstrike" or "C:\Games\Half-Life\
33.1440 + cstrike". Now, it is only the string passed to hlds as the argument to
33.1441 + "-game", ie "cstrike".
33.1442 +
33.1443 +--------------------------------------------------------------------------
33.1444 +
33.1445 +Cvar_RegisterVariable
33.1446 +
33.1447 +from engine/eiface.h:
33.1448 +void Cvar_RegisterVariable(cvar_t *variable);
33.1449 +CVAR_CREATE()
33.1450 +
33.1451 +comments:
33.1452 +
33.1453 + .
33.1454 +
33.1455 +--------------------------------------------------------------------------
33.1456 +
33.1457 +FadeClientVolume
33.1458 +
33.1459 +from engine/eiface.h:
33.1460 +void FadeClientVolume(const edict_t *pEdict, int fadePercent, int
33.1461 +fadeOutSeconds, int holdTime, int fadeInSeconds);
33.1462 +
33.1463 +comments:
33.1464 +
33.1465 + .
33.1466 +
33.1467 +--------------------------------------------------------------------------
33.1468 +
33.1469 +SetClientMaxspeed
33.1470 +
33.1471 +from engine/eiface.h:
33.1472 +void SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed);
33.1473 +
33.1474 +comments:
33.1475 +
33.1476 + .
33.1477 +
33.1478 +--------------------------------------------------------------------------
33.1479 +
33.1480 +CreateFakeClient
33.1481 +
33.1482 +from engine/eiface.h:
33.1483 +edict_t * CreateFakeClient(const char *netname);
33.1484 +
33.1485 + returns NULL if fake client can't be created
33.1486 +
33.1487 +comments:
33.1488 +
33.1489 + Creates "bots" (?).
33.1490 +
33.1491 +--------------------------------------------------------------------------
33.1492 +
33.1493 +RunPlayerMove
33.1494 +
33.1495 +from engine/eiface.h:
33.1496 +void RunPlayerMove(edict_t *fakeclient, const float *viewangles, float
33.1497 +forwardmove, float sidemove, float upmove, unsigned short buttons, byte
33.1498 +impulse, byte msec);
33.1499 +
33.1500 +comments:
33.1501 +
33.1502 + .
33.1503 +
33.1504 +--------------------------------------------------------------------------
33.1505 +
33.1506 +NumberOfEntities
33.1507 +
33.1508 +from engine/eiface.h:
33.1509 +int NumberOfEntities(void);
33.1510 +NUMBER_OF_ENTITIES()
33.1511 +
33.1512 +comments:
33.1513 +
33.1514 + .
33.1515 +
33.1516 +--------------------------------------------------------------------------
33.1517 +
33.1518 +GetInfoKeyBuffer
33.1519 +
33.1520 +from engine/eiface.h:
33.1521 +char *GetInfoKeyBuffer(edict_t *e);
33.1522 +
33.1523 + passing in NULL gets the serverinfo
33.1524 +
33.1525 +comments:
33.1526 +
33.1527 + Returns the InfoKeyBuffer for the given edict. This is basically the
33.1528 + fields from "setinfo" at the client console, and includes things like
33.1529 + the player name.
33.1530 +
33.1531 + The sourcecode comment ("passing in NULL gets the serverinfo") isn't
33.1532 + entirely accurate. There appear to be two server-side info buffers
33.1533 + available, "serverinfo" and "localinfo", both accessible from the
33.1534 + console by those two commands, respectively.
33.1535 +
33.1536 + Calling GetInfoKeyBuffer(NULL) will return the localinfo buffer.
33.1537 + Calling GetInfoKeyBuffer(PEntityOfEntIndex(0)), ie passing the entity
33.1538 + of slot 0, will return the serverinfo buffer.
33.1539 +
33.1540 +--------------------------------------------------------------------------
33.1541 +
33.1542 +InfoKeyValue
33.1543 +
33.1544 +from engine/eiface.h:
33.1545 +char *InfoKeyValue(char *infobuffer, char *key);
33.1546 +
33.1547 +comments:
33.1548 +
33.1549 + Returns the value for the given key in the given InfoKeyBuffer.
33.1550 +
33.1551 +--------------------------------------------------------------------------
33.1552 +
33.1553 +SetKeyValue
33.1554 +
33.1555 +from engine/eiface.h:
33.1556 +void SetKeyValue(char *infobuffer, char *key, char *value);
33.1557 +
33.1558 +comments:
33.1559 +
33.1560 + Adds or sets a key/value pair in the given InfoKeyBuffer. Appears to
33.1561 + work for only server info, and not client info. For clients, use
33.1562 + SetClientKeyValue.
33.1563 +
33.1564 +--------------------------------------------------------------------------
33.1565 +
33.1566 +SetClientKeyValue
33.1567 +
33.1568 +from engine/eiface.h:
33.1569 +void SetClientKeyValue(int clientIndex, char *infobuffer, char *key, char
33.1570 +*value);
33.1571 +
33.1572 +comments:
33.1573 +
33.1574 + Adds or sets a key/value pair in a client's InfoKeyBuffer, by server
33.1575 + slot (ie 1 to maxplayers).
33.1576 +
33.1577 +--------------------------------------------------------------------------
33.1578 +
33.1579 +IsMapValid
33.1580 +
33.1581 +from engine/eiface.h:
33.1582 +int IsMapValid(char *filename);
33.1583 +IS_MAP_VALID()
33.1584 +
33.1585 +comments:
33.1586 +
33.1587 + .
33.1588 +
33.1589 +--------------------------------------------------------------------------
33.1590 +
33.1591 +StaticDecal
33.1592 +
33.1593 +from engine/eiface.h:
33.1594 +void StaticDecal(const float *origin, int decalIndex, int entityIndex, int
33.1595 +modelIndex);
33.1596 +
33.1597 +comments:
33.1598 +
33.1599 + .
33.1600 +
33.1601 +--------------------------------------------------------------------------
33.1602 +
33.1603 +PrecacheGeneric
33.1604 +
33.1605 +from engine/eiface.h:
33.1606 +int PrecacheGeneric(char *s);
33.1607 +PRECACHE_GENERIC()
33.1608 +
33.1609 +comments:
33.1610 +
33.1611 + .
33.1612 +
33.1613 +--------------------------------------------------------------------------
33.1614 +
33.1615 +GetPlayerUserId
33.1616 +
33.1617 +from engine/eiface.h:
33.1618 +int GetPlayerUserId(edict_t *e);
33.1619 +GETPLAYERUSERID()
33.1620 +
33.1621 + returns the server assigned userid for this player. useful for logging
33.1622 + frags, etc. returns -1 if the edict couldn't be found in the list of
33.1623 + clients
33.1624 +
33.1625 +comments:
33.1626 +
33.1627 + Returns the session userid for the given player edict. As of server
33.1628 + x106, this is constant for the life of the player connection, and
33.1629 + unique for the life of the server process. Each time a client
33.1630 + connects, they are given a userid of 1 plus the userid of the previous
33.1631 + connecting client. When the server starts/restarts, the server starts
33.1632 + again at userid 1.
33.1633 +
33.1634 +--------------------------------------------------------------------------
33.1635 +
33.1636 +BuildSoundMsg
33.1637 +
33.1638 +from engine/eiface.h:
33.1639 +void BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int
33.1640 +*/float volume, float attenuation, int fFlags, int pitch, int msg_dest,
33.1641 +int msg_type, const float *pOrigin, edict_t *ed);
33.1642 +BUILD_SOUND_MSG()
33.1643 +
33.1644 +comments:
33.1645 +
33.1646 + .
33.1647 +
33.1648 +--------------------------------------------------------------------------
33.1649 +
33.1650 +IsDedicatedServer
33.1651 +
33.1652 +from engine/eiface.h:
33.1653 +int IsDedicatedServer(void);
33.1654 +IS_DEDICATED_SERVER()
33.1655 +
33.1656 + is this a dedicated server?
33.1657 +
33.1658 +comments:
33.1659 +
33.1660 + .
33.1661 +
33.1662 +--------------------------------------------------------------------------
33.1663 +
33.1664 +CVarGetPointer
33.1665 +
33.1666 +from engine/eiface.h:
33.1667 +cvar_t *CVarGetPointer(const char *szVarName);
33.1668 +CVAR_GET_POINTER()
33.1669 +
33.1670 +comments:
33.1671 +
33.1672 + Returns a pointer to a cvar_t struct for the given cvar (server
33.1673 + variable) name.
33.1674 +
33.1675 +--------------------------------------------------------------------------
33.1676 +
33.1677 +GetPlayerWONId
33.1678 +
33.1679 +from engine/eiface.h:
33.1680 +unsigned int GetPlayerWONId(edict_t *e);
33.1681 +GETPLAYERWONID()
33.1682 +
33.1683 + returns the server assigned WONid for this player. useful for logging
33.1684 + frags, etc. returns -1 if the edict couldn't be found in the list of
33.1685 + clients
33.1686 +
33.1687 +comments:
33.1688 +
33.1689 + Returns the WON id for the given player edict. As of server x106, this
33.1690 + should be unique per client CD KEY, and should be consistent across
33.1691 + all WON auth servers.
33.1692 +
33.1693 +--------------------------------------------------------------------------
33.1694 +
33.1695 +Info_RemoveKey
33.1696 +
33.1697 +from engine/eiface.h:
33.1698 +void Info_RemoveKey(char *s, const char *key);
33.1699 +
33.1700 + YWB 8/1/99 TFF Physics additions
33.1701 +
33.1702 +comments:
33.1703 +
33.1704 + .
33.1705 +
33.1706 +--------------------------------------------------------------------------
33.1707 +
33.1708 +GetPhysicsKeyValue
33.1709 +
33.1710 +from engine/eiface.h:
33.1711 +const char *GetPhysicsKeyValue(const edict_t *pClient, const char *key);
33.1712 +
33.1713 +comments:
33.1714 +
33.1715 + .
33.1716 +
33.1717 +--------------------------------------------------------------------------
33.1718 +
33.1719 +SetPhysicsKeyValue
33.1720 +
33.1721 +from engine/eiface.h:
33.1722 +void SetPhysicsKeyValue(const edict_t *pClient, const char *key, const
33.1723 +char *value);
33.1724 +
33.1725 +comments:
33.1726 +
33.1727 + .
33.1728 +
33.1729 +--------------------------------------------------------------------------
33.1730 +
33.1731 +GetPhysicsInfoString
33.1732 +
33.1733 +from engine/eiface.h:
33.1734 +const char *GetPhysicsInfoString(const edict_t *pClient);
33.1735 +ENGINE_GETPHYSINFO()
33.1736 +
33.1737 +comments:
33.1738 +
33.1739 + .
33.1740 +
33.1741 +--------------------------------------------------------------------------
33.1742 +
33.1743 +PrecacheEvent
33.1744 +
33.1745 +from engine/eiface.h:
33.1746 +unsigned short PrecacheEvent(int type, const char *psz);
33.1747 +PRECACHE_EVENT()
33.1748 +
33.1749 +comments:
33.1750 +
33.1751 + .
33.1752 +
33.1753 +--------------------------------------------------------------------------
33.1754 +
33.1755 +PlaybackEvent
33.1756 +
33.1757 +from engine/eiface.h:
33.1758 +void PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short
33.1759 +eventindex, float delay, float *origin, float *angles, float fparam1,
33.1760 +float fparam2, int iparam1, int iparam2, int bparam1, int bparam2);
33.1761 +PLAYBACK_EVENT_FULL()
33.1762 +
33.1763 +comments:
33.1764 +
33.1765 + .
33.1766 +
33.1767 +--------------------------------------------------------------------------
33.1768 +
33.1769 +SetFatPVS
33.1770 +
33.1771 +from engine/eiface.h:
33.1772 +unsigned char *SetFatPVS(float *org);
33.1773 +ENGINE_SET_PVS()
33.1774 +
33.1775 +comments:
33.1776 +
33.1777 + .
33.1778 +
33.1779 +--------------------------------------------------------------------------
33.1780 +
33.1781 +SetFatPAS
33.1782 +
33.1783 +from engine/eiface.h:
33.1784 +unsigned char *SetFatPAS(float *org);
33.1785 +ENGINE_SET_PAS()
33.1786 +
33.1787 +comments:
33.1788 +
33.1789 + .
33.1790 +
33.1791 +--------------------------------------------------------------------------
33.1792 +
33.1793 +CheckVisibility
33.1794 +
33.1795 +from engine/eiface.h:
33.1796 +int CheckVisibility(const edict_t *entity, unsigned char *pset);
33.1797 +ENGINE_CHECK_VISIBILITY()
33.1798 +
33.1799 +comments:
33.1800 +
33.1801 + .
33.1802 +
33.1803 +--------------------------------------------------------------------------
33.1804 +
33.1805 +DeltaSetField
33.1806 +
33.1807 +from engine/eiface.h:
33.1808 +void DeltaSetField(struct delta_s *pFields, const char *fieldname);
33.1809 +DELTA_SET()
33.1810 +
33.1811 +comments:
33.1812 +
33.1813 + .
33.1814 +
33.1815 +--------------------------------------------------------------------------
33.1816 +
33.1817 +DeltaUnsetField
33.1818 +
33.1819 +from engine/eiface.h:
33.1820 +void DeltaUnsetField(struct delta_s *pFields, const char *fieldname);
33.1821 +DELTA_UNSET()
33.1822 +
33.1823 +comments:
33.1824 +
33.1825 + .
33.1826 +
33.1827 +--------------------------------------------------------------------------
33.1828 +
33.1829 +DeltaAddEncoder
33.1830 +
33.1831 +from engine/eiface.h:
33.1832 +void DeltaAddEncoder(char *name, void (*conditionalencode)( struct delta_s
33.1833 +*pFields, const unsigned char *from, const unsigned char *to) );
33.1834 +DELTA_ADDENCODER()
33.1835 +
33.1836 +comments:
33.1837 +
33.1838 + .
33.1839 +
33.1840 +--------------------------------------------------------------------------
33.1841 +
33.1842 +GetCurrentPlayer
33.1843 +
33.1844 +from engine/eiface.h:
33.1845 +int GetCurrentPlayer(void);
33.1846 +ENGINE_CURRENT_PLAYER()
33.1847 +
33.1848 +comments:
33.1849 +
33.1850 + .
33.1851 +
33.1852 +--------------------------------------------------------------------------
33.1853 +
33.1854 +CanSkipPlayer
33.1855 +
33.1856 +from engine/eiface.h:
33.1857 +int CanSkipPlayer(const edict_t *player);
33.1858 +ENGINE_CANSKIP()
33.1859 +
33.1860 +comments:
33.1861 +
33.1862 + .
33.1863 +
33.1864 +--------------------------------------------------------------------------
33.1865 +
33.1866 +DeltaFindField
33.1867 +
33.1868 +from engine/eiface.h:
33.1869 +int DeltaFindField(struct delta_s *pFields, const char *fieldname);
33.1870 +DELTA_FINDFIELD()
33.1871 +
33.1872 +comments:
33.1873 +
33.1874 + .
33.1875 +
33.1876 +--------------------------------------------------------------------------
33.1877 +
33.1878 +DeltaSetFieldByIndex
33.1879 +
33.1880 +from engine/eiface.h:
33.1881 +void DeltaSetFieldByIndex(struct delta_s *pFields, int fieldNumber);
33.1882 +DELTA_SETBYINDEX()
33.1883 +
33.1884 +comments:
33.1885 +
33.1886 + .
33.1887 +
33.1888 +--------------------------------------------------------------------------
33.1889 +
33.1890 +DeltaUnsetFieldByIndex
33.1891 +
33.1892 +from engine/eiface.h:
33.1893 +void DeltaUnsetFieldByIndex(struct delta_s *pFields, int fieldNumber);
33.1894 +DELTA_UNSETBYINDEX()
33.1895 +
33.1896 +comments:
33.1897 +
33.1898 + .
33.1899 +
33.1900 +--------------------------------------------------------------------------
33.1901 +
33.1902 +SetGroupMask
33.1903 +
33.1904 +from engine/eiface.h:
33.1905 +void SetGroupMask(int mask, int op);
33.1906 +ENGINE_SETGROUPMASK()
33.1907 +
33.1908 +comments:
33.1909 +
33.1910 + .
33.1911 +
33.1912 +--------------------------------------------------------------------------
33.1913 +
33.1914 +CreateInstancedBaseline
33.1915 +
33.1916 +from engine/eiface.h:
33.1917 +int CreateInstancedBaseline(int classname, struct entity_state_s *
33.1918 +baseline);
33.1919 +ENGINE_INSTANCE_BASELINE()
33.1920 +
33.1921 +comments:
33.1922 +
33.1923 + .
33.1924 +
33.1925 +--------------------------------------------------------------------------
33.1926 +
33.1927 +Cvar_DirectSet
33.1928 +
33.1929 +from engine/eiface.h:
33.1930 +void Cvar_DirectSet(struct cvar_s *var, char *value);
33.1931 +
33.1932 +comments:
33.1933 +
33.1934 + .
33.1935 +
33.1936 +--------------------------------------------------------------------------
33.1937 +
33.1938 +ForceUnmodified
33.1939 +
33.1940 +from engine/eiface.h:
33.1941 +void ForceUnmodified(FORCE_TYPE type, float *mins, float *maxs, const char
33.1942 +*filename);
33.1943 +ENGINE_FORCE_UNMODIFIED()
33.1944 +
33.1945 + Forces the client and server to be running with the same version of
33.1946 + the specified file ( e.g., a player model ). Calling this has no
33.1947 + effect in single player.
33.1948 +
33.1949 +comments:
33.1950 +
33.1951 + .
33.1952 +
33.1953 +--------------------------------------------------------------------------
33.1954 +
33.1955 +GetPlayerStats
33.1956 +
33.1957 +from engine/eiface.h:
33.1958 +void GetPlayerStats(const edict_t *pClient, int *ping, int *packet_loss);
33.1959 +PLAYER_CNX_STATS()
33.1960 +
33.1961 +comments:
33.1962 +
33.1963 + .
33.1964 +
33.1965 +--------------------------------------------------------------------------
33.1966 +
33.1967 +AddServerCommand
33.1968 +
33.1969 +from engine/eiface.h:
33.1970 +void AddServerCommand(char *cmd_name, void (*function) (void));
33.1971 +
33.1972 +comments:
33.1973 +
33.1974 + Registers a new server console command. When the given command string
33.1975 + is typed at the console, the given function will be called. Arguments
33.1976 + for the command can be retrieved in the function with Cmd_Args,
33.1977 + Cmd_Argv, and Cmd_Argc.
33.1978 +
33.1979 +--------------------------------------------------------------------------
33.1980 +
33.1981 +Voice_GetClientListening
33.1982 +
33.1983 +from engine/eiface.h:
33.1984 +qboolean Voice_GetClientListening)(int iReceiver, int iSender);
33.1985 +
33.1986 + For voice communications, set which clients hear each other. NOTE:
33.1987 + these functions take player entity indices (starting at 1).
33.1988 +
33.1989 +comments:
33.1990 +
33.1991 + Added in SDK 2.2.
33.1992 +
33.1993 +--------------------------------------------------------------------------
33.1994 +
33.1995 +Voice_SetClientListening
33.1996 +
33.1997 +from engine/eiface.h:
33.1998 +qboolean Voice_SetClientListening)(int iReceiver, int iSender, qboolean
33.1999 +bListen);
33.2000 +
33.2001 + For voice communications, set which clients hear each other. NOTE:
33.2002 + these functions take player entity indices (starting at 1).
33.2003 +
33.2004 +comments:
33.2005 +
33.2006 + Added in SDK 2.2.
33.2007 +
33.2008 +--------------------------------------------------------------------------
33.2009 +
33.2010 +GetPlayerAuthId
33.2011 +
33.2012 +from engine/eiface.h:
33.2013 +const char *GetPlayerAuthId(edict_t *e);
33.2014 +
33.2015 +From Eric Smith <[email protected]> on hlcoders
33.2016 +(list.valvesoftware.com/pipermail/hlcoders/2002-April/002865.html):
33.2017 +
33.2018 + The AuthID is a way for applications/mods to get the Authentication ID
33.2019 + (uniqueID) for a player. The AuthID can be a WonID or a SteamID. The
33.2020 + function I've written returns the AuthID as a string. Calling
33.2021 + GetPlayerWONId will still work for Non-Steam players just like it
33.2022 + always has. If applications/mods want to get a jump start on getting
33.2023 + ready to support Steam players, then they can start using
33.2024 + GetPlayerAuthId, which will still work for Non-Steam players, but it
33.2025 + will give the WonID as a string instead of an unsigned int.
33.2026 +
33.2027 +From Eric Smith <[email protected]> on servertest:
33.2028 +(list.valvesoftware.com/pipermail/servertest/2002-April/000567.html)
33.2029 +
33.2030 + Only clients playing via Steam will have SteamIDs. Clients who are not
33.2031 + using Steam will still have WonIDs (just like they always have). The
33.2032 + server now supports WonIDs\SteamIDs and banning using either of them.
33.2033 + WonIDs have not changed. SteamIDs use the format: STEAM_<#>:<#> where
33.2034 + <#> is replaced by numbers. An example SteamID would be "STEAM_0:
33.2035 + 94534".
33.2036 +
33.2037 +From Eric Smith <[email protected]> on hlcoders:
33.2038 +(list.valvesoftware.com/pipermail/hlcoders/2002-April/002925.html)
33.2039 +
33.2040 + This function will now return the string "BOT" as the AuthID for fake
33.2041 + clients.
33.2042 +
33.2043 +comments:
33.2044 +
33.2045 + Added for HL 1109; no SDK update.
33.2046 +
33.2047 +--------------------------------------------------------------------------
33.2048 +
33.2049 +SequenceGet
33.2050 +
33.2051 +from engine/eiface.h:
33.2052 +void *SequenceGet(const char *fileName, const char *entryName);
33.2053 +
33.2054 +comments:
33.2055 +
33.2056 + Added for HL 1xxx; no SDK update.
33.2057 +
33.2058 +--------------------------------------------------------------------------
33.2059 +
33.2060 +SequencePickSentence
33.2061 +
33.2062 +from engine/eiface.h:
33.2063 +void *SequencePickSentence(const char *groupName, int pickMethod, int *
33.2064 +picked);
33.2065 +
33.2066 +comments:
33.2067 +
33.2068 + Added for HL 1xxx; no SDK update.
33.2069 +
33.2070 +--------------------------------------------------------------------------
33.2071 +
33.2072 +GetFileSize
33.2073 +
33.2074 +from engine/eiface.h:
33.2075 +int GetFileSize(char *filename);
33.2076 +
33.2077 +comments:
33.2078 +
33.2079 + Added for HL 1xxx; no SDK update.
33.2080 +
33.2081 +--------------------------------------------------------------------------
33.2082 +
33.2083 +GetApproxWavePlayLen
33.2084 +
33.2085 +from engine/eiface.h:
33.2086 +unsigned int GetApproxWavePlayLen(const char *filepath);
33.2087 +
33.2088 +comments:
33.2089 +
33.2090 + Added for HL 1xxx; no SDK update.
33.2091 +
33.2092 +--------------------------------------------------------------------------
33.2093 +
33.2094 +IsCareerMatch
33.2095 +
33.2096 +from engine/eiface.h:
33.2097 +int IsCareerMatch(void);
33.2098 +
33.2099 +comments:
33.2100 +
33.2101 + Added for HL 1xxx; no SDK update.
33.2102 +
33.2103 +--------------------------------------------------------------------------
33.2104 +
33.2105 +GetLocalizedStringLength
33.2106 +
33.2107 +from engine/eiface.h:
33.2108 +int GetLocalizedStringLength(const char *label);
33.2109 +
33.2110 +comments:
33.2111 +
33.2112 + Added for HL 1xxx; no SDK update.
33.2113 +
33.2114 +--------------------------------------------------------------------------
33.2115 +
33.2116 +RegisterTutorMessageShown
33.2117 +
33.2118 +from engine/eiface.h:
33.2119 +void RegisterTutorMessageShown(int mid);
33.2120 +
33.2121 +comments:
33.2122 +
33.2123 + Added for HL 1xxx; no SDK update.
33.2124 +
33.2125 +--------------------------------------------------------------------------
33.2126 +
33.2127 +GetTimesTutorMessageShown
33.2128 +
33.2129 +from engine/eiface.h:
33.2130 +int GetTimesTutorMessageShown(int mid);
33.2131 +
33.2132 +comments:
33.2133 +
33.2134 + Added for HL 1xxx; no SDK update.
33.2135 +
33.2136 +--------------------------------------------------------------------------
33.2137 +
33.2138 +ProcessTutorMessageDecayBuffer
33.2139 +
33.2140 +from engine/eiface.h:
33.2141 +void ProcessTutorMessageDecayBuffer(int *buffer, int bufferLength);
33.2142 +
33.2143 +comments:
33.2144 +
33.2145 + Added for HL 1xxx; no SDK update.
33.2146 +
33.2147 +--------------------------------------------------------------------------
33.2148 +
33.2149 +ConstructTutorMessageDecayBuffer
33.2150 +
33.2151 +from engine/eiface.h:
33.2152 +void ConstructTutorMessageDecayBuffer(int *buffer, int bufferLength);
33.2153 +
33.2154 +comments:
33.2155 +
33.2156 + Added for HL 1xxx; no SDK update.
33.2157 +
33.2158 +--------------------------------------------------------------------------
33.2159 +
33.2160 +ResetTutorMessageDecayData
33.2161 +
33.2162 +from engine/eiface.h:
33.2163 +void ResetTutorMessageDecayData(void);
33.2164 +
33.2165 +comments:
33.2166 +
33.2167 + Added for HL 1xxx; no SDK update.
33.2168 +
33.2169 +--------------------------------------------------------------------------
34.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
34.2 +++ b/doc/txt/faq.txt Tue Apr 06 07:36:14 2004 +0000
34.3 @@ -0,0 +1,120 @@
34.4 +Metamod FAQ
34.5 +=-=-=-=-=-=
34.6 +
34.7 +Please add support for (some) mod.
34.8 +
34.9 + Please see game support requirements in the documentation.
34.10 +
34.11 +How do I use bots with Metamod?
34.12 +
34.13 + If the bot is not a Metamod plugin, then you will need to tell Metamod
34.14 + to use your bot as the gamedll, by specifying it on the hlds command
34.15 + line with the "+localinfo mm_gamedll" option. See the Metamod docs.
34.16 + See also the AdminMod docs (www.adminmod.org/help/online/Configuration
34.17 + /How_to_Use_Bots_with_MetaMod_AM_2.50_and_up.htm).
34.18 +
34.19 +The download links give corrupt files.
34.20 +
34.21 + I think what you're observing is that your web client is quietly
34.22 + uncompressing the file, but not updating the name of the downloaded
34.23 + file to reflect this. In particular, some web clients will silently
34.24 + decompress (gunzip) files _without_ removing the ".gz" from the
34.25 + filename, so you'll end up with a file "metamod_i386.so.gz" which is
34.26 + _really_ "metamod_i386.so", and so trying to gunzip it will produce an
34.27 + error ("not in gzip format"). Try running "file" on the resulting file
34.28 + to see what the OS thinks it is. Or, where you don't have "file" (ie
34.29 + windows), just look at the file size - it should be pretty indicative
34.30 + of whether the file is still compressed or not.
34.31 +
34.32 +How do I install Metamod?
34.33 +
34.34 + This is covered briefly in the Metamod docs. Typically, though,
34.35 + Metamod is installed as part of some major plugin, like AdminMod
34.36 + (www.adminmod.org/). There is also some discussion of installing
34.37 + Metamod by hand in the AdminMod docs (www.adminmod.org/help/online/
34.38 + Installing/Manual_Installation_-_Walk-Through.htm). If you already
34.39 + have Metamod installed and merely want to update it, this requires
34.40 + only replacing the .so/.dll with the latest version from the webpage
34.41 + (metamod.org/).
34.42 +
34.43 +I'm having trouble with AdminMod.
34.44 +
34.45 + You'll need to ask your AdminMod questions on the AdminMod forums
34.46 + (www.ozforums.com/forumdisplay.php?forumid=143).
34.47 +
34.48 +How do I do (something) in a Metamod plugin?
34.49 +
34.50 + Generally speaking, a Metamod plugin works very much like an Half-Life
34.51 + Game Mod, since all it's doing is making the same calls to the same
34.52 + SDK that the Game Mod does. So, the question typically isn't "how do I
34.53 + do this in Metamod?" but instead "how do I do this in an Half-Life
34.54 + Mod?", and is best asked in a HL SDK Programming forum/mailinglist
34.55 + (see related links and especially Botman's MOD FAQ (planethalflife.com
34.56 + /botman/MOD_FAQ.shtml)). Once you figure out how it would normally be
34.57 + done in a Game Mod, figuring out how to do it in Metamod is relatively
34.58 + straightforward.
34.59 +
34.60 + However, if you have questions on how to convert a piece of code from
34.61 + HLmod to Metamod plugin, then I can provide some pointers, or you can
34.62 + ask on the Metamod mailing list (groups.yahoo.com/group/metamod/). And
34.63 + of course, if you have questions about things in the code specific to
34.64 + Metamod (ie things mentioned in the Metamod Coding docs) feel free to
34.65 + ask me or on the mailing list.
34.66 +
34.67 +Is there a tutorial or example of how to write a Metamod plugin?
34.68 +
34.69 + The sourcecode includes a couple of plugins that can be used as
34.70 + examples. The "stub" plugin is the bare basics of what a plugin needs.
34.71 + The "trace" plugin provides an example of hooking _every_ SDK
34.72 + function. The "wdmisc" plugin provides a couple of basic useful
34.73 + features. You can also look at several of the other plugins out there
34.74 + for more examples.
34.75 +
34.76 + Note that the example plugins in the Metamod sourcecode show how to
34.77 + use Metamod to interface with Half-Life code, but they mostly assume
34.78 + you already know how to write Half-Life code. If you need examples or
34.79 + info on how to write Half-Life code itself, you'll need to go look
34.80 + through the HL SDK programming websites (see related links and
34.81 + Botman's MOD FAQ (planethalflife.com/botman/MOD_FAQ.shtml)).
34.82 +
34.83 +I have (or know of) a Metamod plugin not listed on the webpage.
34.84 +
34.85 + Send me the information about the plugin (name, author, description,
34.86 + URL), and I'd be happy to provide a link from the webpage.
34.87 +
34.88 +I'm having trouble compiling under MSVC.
34.89 +
34.90 + Please note that I do not use MSVC, so I can't help a lot with using
34.91 + that compiler. I do all my development under linux, using gcc for
34.92 + linux binaries and mingw32 (www.mingw.org/) for windows binaries. The
34.93 + sourcecode does include an MSVC project file for Metamod, as well as a
34.94 + project file for the stub plugin, both mostly as examples. They should
34.95 + work, and indeed did work the last time I dug up MSVC to test them.
34.96 + That said, there are a few folks on the Metamod mailing list
34.97 + (groups.yahoo.com/group/metamod/) that do use MSVC, so you might find
34.98 + some assistance there.
34.99 +
34.100 +If I create a Metamod plugin, does it have to be open source?
34.101 +
34.102 + Generally speaking, yes. The way the GPL is interpreted, plugins of a
34.103 + GPL program need to be also GPL. See also the FAQ entry on the GNU
34.104 + site about plugins of a GPL program (www.gnu.org/licenses/gpl-faq.html
34.105 + #GPLAndPlugins).
34.106 +
34.107 +How about a port of Metamod to other engines like Q3, Unreal, etc?
34.108 +
34.109 + I haven't looked into it myself, but several folks on the AdminMod
34.110 + team (from which Metamod was derived) had looked at porting to other
34.111 + games like Q3 and UT, and determined that those engines either didn't
34.112 + provide the necessary API hooks, or that they already provided a
34.113 + suitable method for extending functionality. So, I wouldn't expect to
34.114 + see a version of Metamod for those. Perhaps for some other future
34.115 + engines, although I believe most modern engines are now providing
34.116 + their own method for extensions or plugins, so that a third-party
34.117 + solution like Metamod wouldn't be necessary.
34.118 +
34.119 + If Half-Life 2 ever sees the light of day, I expect I'd look seriously
34.120 + at porting to that - unless, of course, Valve ends up providing their
34.121 + own plugin framework themselves. :)
34.122 +
34.123 +--------------------------------------------------------------------------
35.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
35.2 +++ b/doc/txt/gamesupport.txt Tue Apr 06 07:36:14 2004 +0000
35.3 @@ -0,0 +1,77 @@
35.4 +Adding Game/Mod Support
35.5 +=-=-=-=-=-=-=-=-=-=-=-=
35.6 +
35.7 +Note that the list of supported mods is now provided separately; see
35.8 +Supported Mods.
35.9 +
35.10 +If you want to have support for your game/mod added, you'll need to send
35.11 +me ([email protected]) the following information:
35.12 +
35.13 +Basic Info
35.14 +
35.15 + - Game name:
35.16 + - Homepage URL:
35.17 + - Game version:
35.18 + - Game directory:
35.19 + - Win32 DLL name:
35.20 + - Linux SO name:
35.21 +
35.22 + - also, List of game entities (see below)
35.23 +
35.24 +For instance, Counter-Strike would be:
35.25 +
35.26 + - Game name: Counter-Strike
35.27 + - Homepage URL: http://www.counter-strike.net/
35.28 + - Game version: 1.1
35.29 + - Game directory: cstrike
35.30 + - Win32 DLL name: mp.dll
35.31 + - Linux SO name: cs_i386.so
35.32 +
35.33 +Many of these can be found in the liblist.gam file in the mod.
35.34 +
35.35 +List of game entities
35.36 +
35.37 +The major information that I'll need is the names of any non-standard
35.38 +entities the game uses, for instance TFC uses things like:
35.39 +
35.40 + building_sentrygun
35.41 + detpack
35.42 + func_nobuild
35.43 + ghost
35.44 + info_player_teamspawn
35.45 + info_tfgoal
35.46 + item_artifact_envirosuit
35.47 + i_p_t
35.48 + item_tfgoal
35.49 + i_t_t
35.50 + teledeath
35.51 + tf_ammo_rpgclip
35.52 + tf_gl_grenade
35.53 +
35.54 +You can see the complete lists of entities for supported mods in the files
35.55 +in the "ents" directory.
35.56 +
35.57 +The reason these are needed is that the macro LINK_ENTITY_TO_CLASS in the
35.58 +HL SDK actually declares/defines a function with the name of the entity,
35.59 +which the engine will dlsym and call in the gameDLL. Since Metamod is
35.60 +sitting between the engine and the gameDLL, it needs to pass on the call
35.61 +to the function - but can't do this unless it knows ahead of time (at
35.62 +compile) to declare/define a function for that entity name. Thus, metamod
35.63 +needs a list of any entities that have functions declared/defined for them
35.64 +in the gameDLL via LINK_ENTITY_TO_CLASS.
35.65 +
35.66 +Now, the simplest way to generate the list is to grep the source files for
35.67 +LINK_ENTITY_TO_CLASS. If you're not familiar with grep, it's a tool under
35.68 +linux for searching contents of files. For instance:
35.69 +
35.70 + grep LINK_ENTITY_TO_CLASS *.cpp *.c *.h
35.71 +
35.72 +If you don't have linux available, then you may have to use some other
35.73 +tool under win32 to find a similar list. Or find a copy of grep for win32.
35.74 +:)
35.75 +
35.76 +Note this all assumes you have access to the sourcecode for the mod. If
35.77 +you don't have access to the code, you'll need to find someone who does
35.78 +and ask them to grep the source for the entities.
35.79 +
35.80 +--------------------------------------------------------------------------
36.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
36.2 +++ b/doc/txt/index.txt Tue Apr 06 07:36:14 2004 +0000
36.3 @@ -0,0 +1,27 @@
36.4 +Metamod
36.5 +=-=-=-=
36.6 +
36.7 +Metamod is a plugin/DLL manager that sits between the Half-Life Engine and
36.8 +an HL Game mod, allowing the dynamic loading/unloading of mod-like DLL
36.9 +plugins to add functionality to the HL server or game mod.
36.10 +
36.11 +--------------------------------------------------------------------------
36.12 +
36.13 +See metamod.org (metamod.org/) for news, downloads, and plugin links.
36.14 +
36.15 +--------------------------------------------------------------------------
36.16 +
36.17 +Metamod Docs Other HLDS info
36.18 +
36.19 + - About metamod * SDK DLLAPI Notes
36.20 + - FAQ * SDK NEWAPI Notes
36.21 + - Using metamod * SDK Engine Notes
36.22 + - Release Notes
36.23 + - Game/Mod support * Related links & books
36.24 + - Trace Plugin * Mailing lists
36.25 + - WDMisc Plugin
36.26 + - Coding for metamod
36.27 +
36.28 +--------------------------------------------------------------------------
36.29 +
36.30 +<[email protected]>
37.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
37.2 +++ b/doc/txt/links.txt Tue Apr 06 07:36:14 2004 +0000
37.3 @@ -0,0 +1,129 @@
37.4 +Related links
37.5 +=============
37.6 +
37.7 +Here's a list of links, other sites, and information I found useful when
37.8 +working on Metamod:
37.9 +
37.10 + - AdminMod's DLL Forum (www.ozforums.com/forumdisplay.php?forumid=114)
37.11 + - AdminMod CVS at Sourceforge (cvs.sourceforge.net/cgi-bin/viewcvs.cgi/
37.12 + halflifeadmin/)
37.13 +
37.14 + - Valve Editing Resource Center (collective.valve-erc.com/), Valve's
37.15 + official site
37.16 + - Botman's Bots (planethalflife.com/botman/)
37.17 + - Half-Life Programming Planet (hlpp.valveworld.com/)
37.18 + - Shadowman's Half-Life SDK2 Site (planethalflife.com/hlsdk2)
37.19 + - Half-Life Coding Pages (www.planethalflife.com/botman/balfourroad/
37.20 + index.shtml)
37.21 + - Fixxxer's HL Coding page (planethalflife.com/fixxxer/)
37.22 + - The Handy Vandal's HL Coding Links (www.karljones.com/halflife/
37.23 + coding.asp)
37.24 +
37.25 + - Half-Life SDK Forums (www.chatbear.com/cgi-bin/board.pl?boardid=942),
37.26 + at the VERC
37.27 + - Half-Life SDK Forums (www.chatbear.com/cgi-bin/board.pl?action=
37.28 + boardlisting&boardid=590), at Valve's former SDK site
37.29 + - HL Coders mailing list (www.topica.com/lists/hlcoders), at topica.com
37.30 + - Botman's forums (dynamic.gamespy.com/~botman/yabb/YaBB.pl)
37.31 + - Wavelength Half-Life Coding Forum (www.thewavelength.net/forums/
37.32 + index.php?act=SF&f=13)
37.33 + - SDK2 Forum (pub21.ezboard.com/fshadowmanshalflifeforumsdk2), at
37.34 + ezboard.com
37.35 + - HL Programming Forum (dynamic.gamespy.com/~hlprogramming/ultimatebb/
37.36 + forumdisplay.cgi?action=topics&forum=Coding&number=1), at gamespy.com
37.37 + - Fixxxer's HL Coding forum (network54.com/Hide/Forum/goto?forumid=
37.38 + 21807)
37.39 + - HL Programming Forum (forums.gamedesign.net/forums/wwwthreads.pl?
37.40 + action=list&Board=halflife_coding), at gamedesign.net
37.41 +
37.42 + - C FAQ (www.eskimo.com/~scs/C-faq/top.html)
37.43 + - C++ FAQ Lite (www.parashift.com/cpp-faq-lite/)
37.44 + - C++ FAQ Index (www.calpoly.edu/~jfischer/c++faq/index.html)
37.45 + - alt.comp.lang.learn.c-c++ FAQ (snurse-l.org/acllc-c++/faq)
37.46 + - C++ Annotations (dragon.klte.hu/~kollarl/C++/cplusplu.html), guide for
37.47 + C programmers to using C++
37.48 + - C++ Portability Guide (www.mozilla.org/hacking/portable-cpp.html)
37.49 + - Standard Template Library Programmer's Guide (www.sgi.com/tech/stl/),
37.50 + at SGI
37.51 + - comp.std.c++ FAQ (reality.sgi.com/austern_mti/std-c++/faq.html)
37.52 + - GNU g++ FAQ (www.landfield.com/faqs/g++-FAQ/plain/)
37.53 + - GNU libstdc++ FAQ (gcc.gnu.org/onlinedocs/libstdc++/faq/)
37.54 + - C++ References (www.apl.jhu.edu/~paulmac/c++-references.html), books
37.55 + and other links
37.56 + - Thinking in C++ (www.mindview.net/Books/TICPP/ThinkingInCPP2e.html),
37.57 + free electronic book
37.58 +
37.59 + - comp.programming.threads FAQ (www.serpentine.com/~bos/threads-faq/)
37.60 + - comp.programming.threads FAQ #2 (www.lambdacs.com/cpt/FAQ.html)
37.61 + - Implementing POSIX Condition Variables in Win32 (www.cs.wustl.edu/
37.62 + ~schmidt/win32-cv-1.html)
37.63 +
37.64 + - Microsoft Developer Network (msdn.microsoft.com/), online win32 API
37.65 + docs
37.66 + - Win32 Programming FAQ (www.iseran.com/Win32/FAQ/)
37.67 + - Minimal Gnu for Windows (mingw) (www.mingw.org/), gcc for win32
37.68 + - Creating DLLs w/mingw (www.geocities.com/Tokyo/Towers/6162/win32/dll/
37.69 + make.html)
37.70 + - Mingw binaries (www.devolution.com/~slouken/SDL/Xmingw32/)
37.71 + - Mingw binaries (newer) (members.telering.at/jessich/mingw/index.html)
37.72 +
37.73 +Books
37.74 +
37.75 +And here are books I picked up that I found useful as well:
37.76 +
37.77 + - C: A Reference Manual (vig.prenhall.com/catalog/academic/product/
37.78 + 1,4096,0133262243,00.html), by Samuel Harbison & Guy Steele
37.79 + (www.sls.lcs.mit.edu/~hurley/guysteele.html) (at Bookpool
37.80 + (www.bookpool.com/.x//sm/0133262243), at Amazon (www.amazon.com/exec/
37.81 + obidos/ASIN/0133262243))
37.82 + - C Programming FAQs (cseng.aw.com/book/0,3828,0201845199,00.html), by
37.83 + Steve Summit (www.eskimo.com/~scs/) (at Bookpool (www.bookpool.com/.x/
37.84 + /sm/0201845199), at Amazon (www.amazon.com/exec/obidos/ASIN/
37.85 + 0201845199))
37.86 +
37.87 + - C++: The Core Language (www.oreilly.com/catalog/core/), by Gregory
37.88 + Satir & Doug Brown (at Bookpool (www.bookpool.com/.x//sm/156592116X),
37.89 + at Amazon (www.amazon.com/exec/obidos/ASIN/156592116X))
37.90 + - C++ Programming Language Special Edition (cseng.aw.com/book/
37.91 + 0,3828,0201700735,00.html), by Bjarne Stroustrup (www.research.att.com
37.92 + /~bs/) (at Bookpool (www.bookpool.com/.x//sm/0201700735), at Amazon
37.93 + (www.amazon.com/exec/obidos/ASIN/0201700735))
37.94 + - The C++ Standard Library: A Tutorial and Reference (cseng.aw.com/book/
37.95 + 0,3828,0201379260,00.html), by Nicolai Josuttis (www.josuttis.de/
37.96 + indexe.html) (at Bookpool (www.bookpool.com/.x//sm/0201379260), at
37.97 + Amazon (www.amazon.com/exec/obidos/ASIN/0201379260))
37.98 + - C++ FAQs (cseng.aw.com/book/0,3828,0201309831,00.html), by Marshall
37.99 + Cline (www.parashift.com/), Greg Lomow, & Mike Girou (at Bookpool
37.100 + (www.bookpool.com/.x//sm/0201309831), at Amazon (www.amazon.com/exec/
37.101 + obidos/ASIN/0201309831))
37.102 + - Effective C++ (cseng.aw.com/book/0,,0201924889,00.html), by Scott
37.103 + Meyers (www.aristeia.com/) (at Bookpool (www.bookpool.com/.x//sm/
37.104 + 0201924889), at Amazon (www.amazon.com/exec/obidos/ASIN/0201924889))
37.105 + - Algorithms in C++, Parts 1-4 (cseng.aw.com/book/
37.106 + 0,,0201350882,00.html), by Robert Sedgewick (www.cs.princeton.edu/~rs
37.107 + /) (at Bookpool (www.bookpool.com/.x//sm/0201350882), at Amazon
37.108 + (www.amazon.com/exec/obidos/ASIN/0201350882))
37.109 +
37.110 + - Advanced Programming in the UNIX Environment (cseng.aw.com/book/
37.111 + 0,3828,0201563177,00.html), by W. Richard Stevens (www.kohala.com/)
37.112 + (at Bookpool (www.bookpool.com/.x//sm/0201563177), at Amazon
37.113 + (www.amazon.com/exec/obidos/ASIN/0201563177))
37.114 + - Win32 System Programming (cseng.aw.com/book/
37.115 + 0,3828,0201703106,00.html), by Johnson Hart (world.std.com/~jmhart/)
37.116 + (at Bookpool (www.bookpool.com/.x//sm/0201703106), at Amazon
37.117 + (www.amazon.com/exec/obidos/ASIN/0201703106))
37.118 + - Managing Projects with Make (www.oreilly.com/catalog/make2/), by
37.119 + Andrew Oram & Steve Talbott (www.oreilly.com/~stevet/) (at Bookpool
37.120 + (www.bookpool.com/.x//sm/0937175900), at Amazon (www.amazon.com/exec/
37.121 + obidos/ASIN/0937175900))
37.122 +
37.123 + - Thread Time (vig.prenhall.com/catalog/academic/product/
37.124 + 1,4096,0131900676,00.html), by Scott Norton & Mark DiPasquale (at
37.125 + Bookpool (www.bookpool.com/.x//sm/0131900676), at Amazon
37.126 + (www.amazon.com/exec/obidos/ASIN/0131900676))
37.127 + - Programming with POSIX Thrads (cseng.awl.com/book/
37.128 + 0,3828,0201633922,00.html), by David Butenhof (at Bookpool
37.129 + (www.bookpool.com/.x//sm/0201633922), at Amazon (www.amazon.com/exec/
37.130 + obidos/ASIN/0201633922))
37.131 +
37.132 +--------------------------------------------------------------------------
38.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
38.2 +++ b/doc/txt/maillist.txt Tue Apr 06 07:36:14 2004 +0000
38.3 @@ -0,0 +1,25 @@
38.4 +Mailing lists
38.5 +=-=-=-=--=-=-=
38.6 +
38.7 +I've created a couple of lists on YahooGroups (formerly egroups (formerly
38.8 +onelist)):
38.9 +
38.10 + - metamod-announce (groups.yahoo.com/group/metamod-announce/) for
38.11 + announcements of new versions and plugins
38.12 + - metamod (groups.yahoo.com/group/metamod/) for questions, support,
38.13 + discussion, etc
38.14 +
38.15 +There are simple subscribe forms below.
38.16 +
38.17 + Subscribe to metamod-announce
38.18 + [enter email address ]
38.19 + groups.yahoo.com/metamod-announce Click here to join metamod-announce
38.20 + (groups.yahoo.com/group/
38.21 + metamod-announce/)
38.22 +
38.23 + Subscribe to metamod
38.24 + [enter email address ] Click here to join metamod
38.25 + groups.yahoo.com/metamod (groups.yahoo.com/
38.26 + group/metamod/)
38.27 +
38.28 +--------------------------------------------------------------------------
39.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
39.2 +++ b/doc/txt/metamod.txt Tue Apr 06 07:36:14 2004 +0000
39.3 @@ -0,0 +1,547 @@
39.4 +Using Metamod
39.5 +=-=-=-=-=-=-=
39.6 +
39.7 +Client Commands
39.8 +===============
39.9 +
39.10 +Similar to the server console interface, clients can also issue commands
39.11 +to Metamod, of the following form:
39.12 +
39.13 + - meta version - displays version information about the Metamod instance
39.14 + currently running on the server, ie:
39.15 +
39.16 + Metamod v1.17 2003/08/01
39.17 + by Will Day <[email protected]>
39.18 + http://www.metamod.org/
39.19 + compiled: Aug 4 2003, 22:43:33 Eastern (debugging)
39.20 +
39.21 + - meta list - displays information about the list of currently running
39.22 + plugins, ie:
39.23 +
39.24 + Currently running plugins:
39.25 + [ 1] Trace HLSDK API, v1.XX.93, 2003/02/17, by Will Day
39.26 + <[email protected]>, see http://www.metamod.org/
39.27 + [ 2] Adminmod, v2.50.56 (MM), Jul 13 2003, by Alfred Reynolds
39.28 + <[email protected]>, see http://www.adminmod.org/
39.29 + 2 plugins
39.30 +
39.31 +Client Cvars
39.32 +============
39.33 +
39.34 +Also available to client browser applications is a cvar metamod_version
39.35 +that should report the version of Metamod running on the server, ie:
39.36 +
39.37 +"metamod_version" is "1.17"
39.38 +
39.39 +Installation
39.40 +============
39.41 +
39.42 +If you have installed AdminMod (www.adminmod.org/) 2.50 or later, then the
39.43 +AM installer has already installed Metamod for you. If you only want to
39.44 +upgrade your Metamod with a more recent version, simply grab the
39.45 +metamod.dll (win32) or metamod_i386.so (linux) file and replace the file
39.46 +currently on your system.
39.47 +
39.48 +If you want to install Metamod by hand, here's what you have to do:
39.49 +
39.50 +
39.51 + - Install the Metamod library (.dll for win32, or .so for linux) to a
39.52 + directory under your game directory. For instance, if you were running
39.53 + Counter-Strike, under win32 you might want have:
39.54 +
39.55 + half-life/cstrike/addons/metamod/dlls/metamod.dll
39.56 +
39.57 + If a directory you want doesn't exist, create it.
39.58 +
39.59 + - Edit the "liblist.gam" file in your game directory, replacing the game
39.60 + dll filename with the Metamod dll filename. For instance with
39.61 + Counter-Strike, you would change:
39.62 +
39.63 + gamedll "dlls/mp.dll"
39.64 + gamedll_linux "dlls/cs_i386.so"
39.65 +
39.66 + to:
39.67 +
39.68 + gamedll "addons/metamod/dlls/metamod.dll"
39.69 + gamedll_linux "addons/metamod/dlls/metamod_i386.so"
39.70 +
39.71 + Note that it's only really necessary to change the line corresponding
39.72 + to your OS (win32 or linux); you can leave the other line unchanged,
39.73 + or you can change it - it doesn't matter.
39.74 +
39.75 + - To load plugins at game startup, you'll need to create a "plugins.ini"
39.76 + file containing a list of the plugins you want to load.
39.77 +
39.78 +
39.79 +Configuration
39.80 +=============
39.81 +
39.82 +Metamod has several ways to provide config options, partially because it
39.83 +started with one method and then added other methods, but also because one
39.84 +method can be more convenient than the other, varying with the situation.
39.85 +
39.86 +Generally speaking, the two methods of providing configuration information
39.87 +to Metamod are:
39.88 +
39.89 + - on the command line, via +localinfo arguments to hlds.
39.90 + - as the contents of some file that Metamod reads and parses.
39.91 +
39.92 +The confusing part can come when the pathnames to some of the config files
39.93 +can be specified via command line options - or indeed, when the pathnames
39.94 +to some config files can be specified in other config files.
39.95 +
39.96 +In any case, here are the various config options and config files Metamod
39.97 +uses, (listed in order of priority), where "$gamedir" indicates the game
39.98 +directory, ie "cstrike":
39.99 +
39.100 + - +localinfo mm_configfile <file>
39.101 +
39.102 + - +localinfo mm_pluginsfile <file>
39.103 + - config.ini option: plugins_file <file>
39.104 + - $gamedir/addons/metamod/plugins.ini
39.105 + - $gamedir/metamod.ini
39.106 +
39.107 + - $localinfo mm_execcfg <file>
39.108 + - config.ini option: exec_cfg <file>
39.109 + - $gamedir/addons/metamod/exec.cfg
39.110 + - $gamedir/metaexec.cfg
39.111 +
39.112 + - $localinfo mm_gamedll <file>
39.113 + - config.ini option: gamedll <file>
39.114 + - [DEL]$gamedir/metagame.ini[DEL] -- NO LONGER SUPPORTED.
39.115 +
39.116 +
39.117 +File: plugins.ini
39.118 +=====
39.119 +
39.120 +Default location: _$gamedir/addons/metamod/plugins.ini, ie "cstrike/addons
39.121 +/metamod/plugins.ini".
39.122 +
39.123 +Plugins are described in a file "plugins.ini" and each line describes a
39.124 +plugin to load:
39.125 +
39.126 + <platform> <filepath> [<description>]
39.127 +
39.128 +Fields are whitespace delimited (tabs/spaces).
39.129 +
39.130 + - Platform is a keyword, either "linux" or "win32".
39.131 +
39.132 + - Filepath is a path to the DLL/so file. Relative paths are from the
39.133 + game dir; absolute paths are also valid. Paths should use unix-style
39.134 + forward slashes (/) and not backward slashes (\), even on windows
39.135 + platforms.
39.136 +
39.137 + Also, the filepath (once expanded to full path name) is expected to be
39.138 + unique within the list of plugins. Thus, a plugin with a fullpathname
39.139 + matching that of a previous plugin is considered a duplicate, and is
39.140 + not loaded.
39.141 +
39.142 + - Description is an optional description of the plugin, used in place of
39.143 + the plugin's internal name in log messages and console output.
39.144 + Whitespace in the description _is_ allowed; quoting is unnecessary.
39.145 +
39.146 +Comments are recognized at _only_ the beginning of a line, and can be in
39.147 +either shell style ("#") or c++ style ("//").
39.148 +
39.149 +For instance, in "cstrike/addons/metamod/plugins.ini" these are all valid
39.150 +lines:
39.151 +
39.152 + // linux dlls/mybot.so
39.153 + # win32 dlls/mybot-old.dll Mybot old
39.154 + win32 dlls/mybot.dll Mybot current
39.155 + linux /tmp/stub_mm_i386.so
39.156 + win32 /tmp/stub_mm_i386.dll
39.157 + linux ../dlls/trace_mm_i386.so
39.158 + win32 ../dlls/trace_mm_i386.dll
39.159 + linux dlls/admin_MM_i386.so
39.160 + win32 dlls/admin_MM_i386.dll
39.161 +
39.162 +Note that order in the plugins.ini file _is_ significant. Plugins are
39.163 +loaded and accessed in the order specified, so ordering can be important,
39.164 +depending on the plugin(s).
39.165 +
39.166 +The file is re-read at changelevel, as well as on demand (via "meta
39.167 +refresh" console command; see below). When the file is re-read, it will:
39.168 +
39.169 + - load any new plugins added to the file
39.170 + - unload any plugins that have been deleted from the file. This is only
39.171 + applicable to plugins loaded _from the inifile_. If the plugin was
39.172 + loaded from the console, it will not be unloaded during a refresh,
39.173 + whether it's in the inifile or not.
39.174 + - reload any plugin whose file on disk has been updated since it was
39.175 + loaded. Note this appears to be only useful under linux, as under
39.176 + Windows you cannot rename or overwrite an open DLL, so it doesn't look
39.177 + a loaded plugin could ever have a newer file on disk. Oh well.
39.178 +
39.179 +The game dll is auto-detected, along the same lines AdminMod operated
39.180 +(looking at the "gamedir"); see "mm_gamedll" below if you want to use a
39.181 +"bot" DLL.
39.182 +
39.183 +You can override the name of this file by specifying it via the +localinfo
39.184 +field "mm_pluginsfile".
39.185 +
39.186 +For compatibility with previous versions, Metamod will also look for a
39.187 +file "metamod.ini" under the gamedir, ie "cstrike/metamod.ini".
39.188 +
39.189 +
39.190 +File: config.ini
39.191 +=====
39.192 +
39.193 +Default location: _$gamedir/addons/metamod/config.ini, ie "cstrike/addons/
39.194 +metamod/config.ini".
39.195 +
39.196 +This contains basic config information, at the moment duplicating most of
39.197 +the +localinfo variables, but allowing for more flexible expansion of
39.198 +config options in the future. Also, it provides somewhat more reliable
39.199 +options setting, since +localinfo munges some argument values (in
39.200 +particular, pathnames with leading dots, ie "../dlls/blah.dll").
39.201 +
39.202 +Basic format is:
39.203 +
39.204 + <option> <value>
39.205 +
39.206 +Fields are whitespace delimited (tabs/spaces). Comments are recognized at
39.207 +_only_ the beginning of a line, and can be in either shell style ("#") or
39.208 +c++ style ("//"). The following is a list of currently recognized options,
39.209 +their defaults, and examples of usage:
39.210 +
39.211 +
39.212 + - debuglevel <number>
39.213 +
39.214 + where <number> is an integer, 0 and up.
39.215 + Sets the initial debugging level for metamod (same as cvar
39.216 + "meta_debug").
39.217 + Default is normally 0. If hlds is run with "-dev", default is 3.
39.218 + Overridden by: +localinfo mm_debug <number>
39.219 + Examples:
39.220 + debuglevel 0
39.221 + debuglevel 42
39.222 +
39.223 + - gamedll <path>
39.224 +
39.225 + where <path> is an absolute path, or a path relative to the gamedir.
39.226 + Overrides the auto-detected gamedll, in particular for bots.
39.227 + Default is empty, with gamedll being auto-recognized based on the
39.228 + gamedir.
39.229 + Overridden by: +localinfo mm_gamedll <number>
39.230 + Examples:
39.231 + gamedll dlls/hl.dll
39.232 + gamedll ../podbot/podbot.dll
39.233 + gamedll /home/bots/dlls/mybot.dll
39.234 +
39.235 + - plugins_file <path>
39.236 +
39.237 + where <path> is an absolute path, or a path relative to the gamedir.
39.238 + Overrides the default filename containing the MM plugins to load.
39.239 + Default is "addons/metamod/plugins.ini".
39.240 + Overridden by: +localinfo mm_pluginsfile <number>
39.241 + Examples:
39.242 + plugins_file cfg/clanmode.ini
39.243 + plugins_file ../private.ini
39.244 + plugins_file /home/half-life/testing.ini
39.245 +
39.246 + - exec_cfg <path>
39.247 +
39.248 + where <path> is a path relative to the gamedir. NOTE! This cannot be
39.249 + an absolute path, as hlds will not "exec" absolute pathnames.
39.250 + Overrides the default filename containing hlds commands to run just
39.251 + after loading Metamod.
39.252 + Default is "addons/metamod/exec.cfg".
39.253 + Overridden by: +localinfo mm_execcfg <number>
39.254 + Examples:
39.255 + exec_cfg configs/debugging.cfg
39.256 + exec_cfg ../clan/match.cfg
39.257 +
39.258 +You can override the name of this file by specifying it via the +localinfo
39.259 +field "mm_configfile".
39.260 +
39.261 +
39.262 +File: exec.cfg
39.263 +=====
39.264 +
39.265 +Default location: _$gamedir/addons/metamod/exec.cfg, ie "cstrike/addons/
39.266 +metamod/exec.cfg". This is necessary for plugins that need to have
39.267 +settings specified prior to early API routines like ServerActivate, since
39.268 +autoexec.cfg is read too early and server.cfg is read to late. In
39.269 +particular, I found this necessary for the Trace plugin, in order to trace
39.270 +routines like RegUserMsg which are called during ServerActivate.
39.271 +
39.272 +You can override the name of this file by specifying it via the +localinfo
39.273 +field "mm_execcfg".
39.274 +
39.275 +For compatibility with previous versions, Metamod will also look for a
39.276 +file "metaexec.cfg" under the gamedir, ie "cstrike/metaexec.cfg".
39.277 +
39.278 +
39.279 +[DEL]file: metagame.ini[DEL]
39.280 +=========
39.281 +
39.282 +NOTE! This file is no longer supported! -- use instead the +localinfo
39.283 +field "mm_gamedll" or the config.ini option gamedll.
39.284 +
39.285 +
39.286 +Commandline option: +localinfo
39.287 +===================
39.288 +
39.289 +Several of Metamod's configuration options can be specified by the
39.290 +"+localinfo" facility on the hlds command line. This is similar to the
39.291 +"setinfo" console command, where the syntax is:
39.292 +
39.293 + +localinfo <field> <value>
39.294 +
39.295 +Current localinfo fields recognized by Metamod:
39.296 +
39.297 +
39.298 + - mm_configfile Specifies the file that lists config options, instead of
39.299 + using the file config.ini. The <value> should be the pathname of the
39.300 + config file, either absolute path or path relative to the gamedir.
39.301 +
39.302 + - mm_pluginsfile Specifies a file that lists the Metamod plugins to
39.303 + load, instead of using the file plugins.ini. The <value> should be the
39.304 + pathname of the plugins file, either absolute path or path relative to
39.305 + the gamedir.
39.306 +
39.307 + - mm_execcfg Specifies a file that contains cvar or other configs to be
39.308 + exec'd after loading the plugins, instead of using the file exec.cfg.
39.309 + The <value> should be the pathname of the exec file, either absolute
39.310 + path or path relative to the gamedir.
39.311 +
39.312 + - mm_gamedll Specifies a game or Bot DLL to be used instead of the
39.313 + normal gameDLL. The <value> should be the pathname of the DLL, either
39.314 + absolute path or path relative to the gamedir.
39.315 +
39.316 + This replaces using the metagame.ini file. With previous versions of
39.317 + AdminMod (2.10 and earlier), this same functionality was provided by
39.318 + the file "admin.ini".
39.319 +
39.320 + - mm_debug Specifies an initial meta_debug value.
39.321 +
39.322 +Note that each localinfo field can have only one value. If specified more
39.323 +than once on the command line, only the last one will be recognized. (In
39.324 +particular, trying to use mm_gamedll to load multiple dll-style bots will
39.325 +not work. In a case like that, the multiple dll's must be chained
39.326 +together).
39.327 +
39.328 +Some examples are:
39.329 +
39.330 + ./hlds_run -game cstrike +localinfo mm_pluginsfile mylist.ini
39.331 + ./hlds_run -game cstrike +localinfo mm_execcfg mysettings.cfg
39.332 + ./hlds_run -game cstrike +localinfo mm_gamedll dlls/pod_bot.so
39.333 + ./hlds_run -game cstrike +localinfo mm_debug 7
39.334 +
39.335 +Note, paths should use unix-style forward slashes (/) and not backward
39.336 +slashes (\), even on windows platforms.
39.337 +
39.338 +
39.339 +Commands
39.340 +========
39.341 +
39.342 +All console command functionality is provide by a single command "meta",
39.343 +with multiple sub-commands:
39.344 +
39.345 + usage: meta <command> [<arguments>]
39.346 + valid commands are:
39.347 + version - display Metamod version info
39.348 + list - list plugins currently loaded
39.349 + cmds - list console cmds registered by plugins
39.350 + cvars - list cvars registered by plugins
39.351 + refresh - load/unload any new/deleted/updated plugins
39.352 + config - show config info loaded from config.ini
39.353 + load <name> - find and load a plugin with the given name
39.354 + unload <plugin> - unload a loaded plugin
39.355 + reload <plugin> - unload a plugin and load it again
39.356 + info <plugin> - show all information about a plugin
39.357 + pause <plugin> - pause a loaded, running plugin
39.358 + unpause <plugin> - unpause a previously paused plugin
39.359 + retry <plugin> - retry a plugin that previously failed its action
39.360 + clear <plugin> - clear a failed plugin from the list
39.361 + force_unload <plugin> - forcibly unload a loaded plugin
39.362 + require <plugin> - exit server if plugin not loaded/running
39.363 +
39.364 +where <plugin> can be either the plugin index number, or a non-ambiguous
39.365 +prefix string matching description or file.
39.366 +
39.367 +Also, a single cvar is available:
39.368 + meta_debug - set debugging level
39.369 +
39.370 +For instance with:
39.371 +
39.372 + Currently loaded plugins:
39.373 + description stat pend file vers src load unlod
39.374 + [ 1] Trace HLSDK API RUN - mm_trace_i386.so v0.90 ini ANY Pause
39.375 + [ 2] adminmod RUN - admin_MM.so v2.11 ini Start Start
39.376 + [ 3] stub RUN - mm_stub_i386.so v0.90 ini ANY Pause
39.377 + 2 plugins, 2 running
39.378 +
39.379 +You could then do any of the following to unload the API Trace plugin:
39.380 + meta unload 1
39.381 + meta unload trace
39.382 + meta unload mm_trace
39.383 +
39.384 +
39.385 +Plugin Loading/Unloading Process
39.386 +================================
39.387 +
39.388 +Through the process of loading and unloading, a plugin can be in one of
39.389 +several different states ('stat' column in the 'meta list' output):
39.390 +
39.391 + - BADFILE - The plugin file couldn't be found, or it doesn't appear to
39.392 + be a valid Metamod plugin.
39.393 + - OPENED - The plugin file was found, and is a valid Metamod plugin, and
39.394 + is ready to be loaded.
39.395 + - FAILED - The plugin file attempted to load or unload, but couldn't
39.396 + complete for some reason.
39.397 + - RUNNING - The plugin file was loaded and is active and running.
39.398 + - PAUSED - The plugin file was loaded, but has been temporarily
39.399 + disabled.
39.400 +
39.401 +Also through the operation process, a plugin can have a pending "action"
39.402 +to next take (indicated by the 'pend' column in the 'meta list' output),
39.403 +and can be one of:
39.404 +
39.405 + - LOAD - Open and look at the plugin file.
39.406 + - ATTACH - Attach the plugin to the running game; ie activate it
39.407 + - UNLOAD - Remove the plugin from the running game and close the file
39.408 + - RELOAD - Unload/close and re-open/load the plugin, for instance when
39.409 + the plugin file has changed.
39.410 +
39.411 +
39.412 +Example Output
39.413 +==============
39.414 +
39.415 +Here's some other example output:
39.416 +
39.417 + meta info admin
39.418 + name: adminmod
39.419 + desc: Adminmod
39.420 + status: running
39.421 + action: none
39.422 + filename: dlls/admin_MM.so
39.423 + file: admin_MM.so
39.424 + pathname: /home/willday/test/cstrike/dlls/admin_MM.so
39.425 + index: 3
39.426 + source: ini file
39.427 + loadable: at server startup
39.428 + unloadable: at server startup
39.429 + version: 2.11
39.430 + date: 2001/02/04
39.431 + author: Alfred Reynolds <[email protected]>
39.432 + url: http://www.adminmod.org/
39.433 + logtag: ADMIN
39.434 + last loaded: Mon Feb 5 02:06:34 2001
39.435 + DLLAPI functions:
39.436 + GameDLLInit
39.437 + DispatchThink
39.438 + ClientConnect
39.439 + ClientCommand
39.440 + ClientUserInfoChanged
39.441 + ServerActivate
39.442 + 6 functions (dllapi)
39.443 + No DLLAPI-Post functions.
39.444 + No NEWAPI functions.
39.445 + No NEWAPI-Post functions.
39.446 + No Engine functions.
39.447 + No Engine-Post functions.
39.448 + Registered commands:
39.449 + admin_command
39.450 + 1 commands
39.451 + Registered cvars: float value string value
39.452 + users_file 0.000000 users.ini
39.453 + maps_file 0.000000 mapvote.txt
39.454 + default_access 1.000000 1
39.455 + ips_file 0.000000 0
39.456 + reserve_slots 1.000000 1
39.457 + reserve_slots_msg 0.000000 0
39.458 + admin_debug 1.000000 1
39.459 + password_field 0.000000 admin_password
39.460 + alarm_message 0.000000 0
39.461 + alarm_time 0.000000 0
39.462 + use_regex 1.000000 1
39.463 + models_password_field 0.000000 0
39.464 + models_file 0.000000 models.ini
39.465 + models_kick_msg 0.000000 Invalid model
39.466 + script_file 0.000000 cstrike/dlls/admin.amx
39.467 + help_file 0.000000 admin_help.txt
39.468 + vote_freq 360.000000 360
39.469 + encrypt_password 1.000000 1
39.470 + pretty_say 1.000000 1
39.471 + admin_mod_version 2.110000 2.11
39.472 + reserve_type 1.000000 1
39.473 + map_ratio 60.000000 60
39.474 + kick_ratio 75.000000 75
39.475 + words_file 0.000000 0
39.476 + password_timeout 1800.000000 1800
39.477 + file_access_read 0.000000 0
39.478 + file_access_write 0.000000 0
39.479 + public_slots_free 20.000000 20.000000
39.480 + allow_client_exec 0.000000 0
39.481 + admin_balance_teams 0.000000 0
39.482 + 30 cvars
39.483 +
39.484 + meta cmds
39.485 + Registered plugin commands:
39.486 + plugin command
39.487 + [ 1] API trace trace_version
39.488 + [ 2] API trace trace
39.489 + [ 3] API trace untrace
39.490 + [ 4] API trace showtrace
39.491 + [ 5] Adminmod admin_command
39.492 + 5 commands, 5 available
39.493 +
39.494 + meta cvars
39.495 + Registered plugin cvars:
39.496 + plugin cvar float value string value
39.497 + [ 1] API trace trace_debug 3.000000 3.000000
39.498 + [ 2] API trace trace_dllapi 8.000000 8
39.499 + [ 3] API trace trace_newapi 0.000000 0
39.500 + [ 4] API trace trace_engine 8.000000 8
39.501 + [ 5] Adminmod users_file 0.000000 users.ini
39.502 + [ 6] Adminmod maps_file 0.000000 mapvote.txt
39.503 + [ 7] Adminmod default_access 1.000000 1
39.504 + [ 8] Adminmod ips_file 0.000000 0
39.505 + [ 9] Adminmod reserve_slots 1.000000 1
39.506 + [ 10] Adminmod reserve_slots_msg 0.000000 0
39.507 + [ 11] Adminmod admin_debug 1.000000 1
39.508 + [ 12] Adminmod password_field 0.000000 admin_password
39.509 + [ 13] Adminmod alarm_message 0.000000 0
39.510 + [ 14] Adminmod alarm_time 0.000000 0
39.511 + [ 15] Adminmod use_regex 1.000000 1
39.512 + [ 16] Adminmod models_password_fiel 0.000000 0
39.513 + [ 17] Adminmod models_file 0.000000 models.ini
39.514 + [ 18] Adminmod models_kick_msg 0.000000 Invalid model
39.515 + [ 19] Adminmod script_file 0.000000 cstrike/dlls/admin.amx
39.516 + [ 20] Adminmod help_file 0.000000 admin_help.txt
39.517 + [ 21] Adminmod vote_freq 360.000000 360
39.518 + [ 22] Adminmod encrypt_password 1.000000 1
39.519 + [ 23] Adminmod pretty_say 1.000000 1
39.520 + [ 24] Adminmod admin_mod_version 2.110000 2.11
39.521 + [ 25] Adminmod reserve_type 1.000000 1
39.522 + [ 26] Adminmod map_ratio 60.000000 60
39.523 + [ 27] Adminmod kick_ratio 75.000000 75
39.524 + [ 28] Adminmod words_file 0.000000 0
39.525 + [ 29] Adminmod password_timeout 1800.000000 1800
39.526 + [ 30] Adminmod file_access_read 0.000000 0
39.527 + [ 31] Adminmod file_access_write 0.000000 0
39.528 + [ 32] Adminmod public_slots_free 20.000000 20.000000
39.529 + [ 33] Adminmod allow_client_exec 0.000000 0
39.530 + [ 34] Adminmod admin_balance_teams 0.000000 0
39.531 + 34 cvars, 34 available
39.532 +
39.533 + meta unload stub
39.534 + Unloaded plugin 'Stub plugin'
39.535 + Currently loaded plugins:
39.536 + description stat pend file vers src load unlod
39.537 + [ 1] Trace HLSDK API RUN - mm_trace_i386.so v0.90 ini ANY Pause
39.538 + [ 2] adminmod RUN - admin_MM.so v2.11 ini Start Start
39.539 + 2 plugins, 2 running
39.540 +
39.541 + meta load stub
39.542 + Loaded plugin 'stub' successfully
39.543 + Currently loaded plugins:
39.544 + description stat pend file vers src load unlod
39.545 + [ 1] Trace HLSDK API RUN - mm_trace_i386.so v0.90 ini ANY Pause
39.546 + [ 2] adminmod RUN - admin_MM.so v2.11 ini Start Start
39.547 + [ 3] stub RUN - mm_stub_i386.so v0.90 cmd ANY Pause
39.548 + 3 plugins, 3 running
39.549 +
39.550 +--------------------------------------------------------------------------
40.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
40.2 +++ b/doc/txt/newapi_notes.txt Tue Apr 06 07:36:14 2004 +0000
40.3 @@ -0,0 +1,55 @@
40.4 +HLSDK NEWAPI Notes
40.5 +=-=-=-=-=-=-=-=-=-=
40.6 +
40.7 +--------------------------------------------------------------------------
40.8 +
40.9 + - OnFreeEntPrivateData
40.10 + - GameShutdown
40.11 + - ShouldCollide
40.12 +
40.13 +NOTE: No examples of these found in SDK...
40.14 +
40.15 +--------------------------------------------------------------------------
40.16 +
40.17 +OnFreeEntPrivateData
40.18 +
40.19 +void OnFreeEntPrivateData(edict_t pEnt);
40.20 +
40.21 +from engine/eiface.h:
40.22 +
40.23 + Called right before the object's memory is freed. Calls its
40.24 + destructor.
40.25 +
40.26 +comments:
40.27 +
40.28 + See also Ken Birdwell on constructors, from the HLCoders list.
40.29 + Added in SDK 2.0.
40.30 +
40.31 +--------------------------------------------------------------------------
40.32 +
40.33 +GameShutdown
40.34 +
40.35 +void GameShutdown(void);
40.36 +
40.37 +comments:
40.38 +
40.39 + Added in SDK 2.0.
40.40 +
40.41 +--------------------------------------------------------------------------
40.42 +
40.43 +ShouldCollide
40.44 +
40.45 +int ShouldCollide(edict_t *pentTouched, edict_t *pentOther);
40.46 +
40.47 +from [email protected], via HLCoders:
40.48 +
40.49 + ..a hook that can override if any two entities should collide when
40.50 + they try to pass through each other.
40.51 +
40.52 +comments:
40.53 +
40.54 + Mugsy from DoD indicates that the return value for normal operation is
40.55 + 1.
40.56 + Added in SDK 2.0.
40.57 +
40.58 +--------------------------------------------------------------------------
41.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
41.2 +++ b/doc/txt/release_notes.txt Tue Apr 06 07:36:14 2004 +0000
41.3 @@ -0,0 +1,77 @@
41.4 +Release Notes
41.5 +=-=-=-=-=-=-=
41.6 +
41.7 +Major changes with Metamod 1.17
41.8 +===============================
41.9 +
41.10 + - New cvar "metamod_version" that can be queried from client game
41.11 + browsers.
41.12 +
41.13 + - New console commands available to clients (much like the existing
41.14 + server console commands):
41.15 +
41.16 + - "meta version" prints out version information (date, compile type,
41.17 + etc).
41.18 + - "meta list" shows a list of the plugins running on the server
41.19 + (name, author, version, etc).
41.20 +
41.21 + - New file config.ini to provide a more reliable and flexible method of
41.22 + specifying configuration options. At the moment, the recognized
41.23 + options mirror those from +localinfo, ie:
41.24 +
41.25 + - debuglevel <number>
41.26 + - gamedll <path>
41.27 + - plugins_file <path>
41.28 + - exec_cfg <path>
41.29 +
41.30 + Default path is "addons/metamod/config.ini" but can be overridden with
41.31 + "+localinfo mm_configfile".
41.32 +
41.33 + Also, new console command "meta config" to display this information.
41.34 +
41.35 + - New console command "meta require" to force the server to exit if the
41.36 + specified plugin isn't loaded/running. Intended for use in server.cfg
41.37 + or metaexec.cfg, to keep the server from starting up if desired
41.38 + plugins don't load. For example:
41.39 +
41.40 + - meta require adminmod
41.41 + - meta require 1
41.42 +
41.43 + The former requires that a plugin with the substring "adminmod" is
41.44 + found loaded and running. The latter requires that the plugin in slot
41.45 + 1 is loaded and running.
41.46 +
41.47 + - If an override gamedll is specified and found to be invalid or
41.48 + missing, Metamod will now exit with an appropriate error message,
41.49 + rather than just falling back to the auto-detected gamedll. This
41.50 + should provide more immediate and useful feedback, and help prevent
41.51 + some confusion.
41.52 +
41.53 +--------------------------------------------------------------------------
41.54 +
41.55 +Incompatible changes with Metamod 1.13
41.56 +======================================
41.57 +
41.58 + - Config file metagame.ini is no longer supported. This file was
41.59 + deprecated in Metamod 1.08 (2001/06/16). Use instead the "+localinfo
41.60 + mm_gamedll" option.
41.61 +
41.62 +Major changes with Metamod 1.13
41.63 +===============================
41.64 +
41.65 + - New config file names and locations, per the Addon Development
41.66 + Standard rev 1.00, developed on the hlds_apps list.
41.67 +
41.68 + Default config file locations are now:
41.69 + - $gamedir/addons/metamod/plugins.ini
41.70 + - $gamedir/addons/metamod/exec.cfg
41.71 +
41.72 + Previous config file locations are also supported for backwards
41.73 + compability:
41.74 + - $gamedir/metamod.ini
41.75 + - $gamedir/metaexec.cfg
41.76 +
41.77 + Note that the pathnames in plugins.ini are unchanged, and are still
41.78 + relative to the gamedir.
41.79 +
41.80 +--------------------------------------------------------------------------
42.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
42.2 +++ b/doc/txt/supportedmods.txt Tue Apr 06 07:36:14 2004 +0000
42.3 @@ -0,0 +1,232 @@
42.4 +Supported Mods/Games
42.5 +=-=-=-=-=-=-=-=
42.6 +
42.7 +Metamod includes support for the following mods, with version and last
42.8 +update if known.
42.9 +
42.10 +To get support added for a new Mod, or for an updated version of a Mod,
42.11 +see Adding game support.
42.12 +
42.13 ++------------------------------------------------------------------------+
42.14 +| Name | Version | Last | Ent | Comments |
42.15 +| | | update | list | |
42.16 +|--------------------------------+----------+--------+--------+----------|
42.17 +| Action Half-Life | Beta 4 | 2001/ | [ents] | |
42.18 +| (ahl.action-web.net/) | | 06/14 | | |
42.19 +|--------------------------------+----------+--------+--------+----------|
42.20 +| Adrenalinegamer 3.x | - | 2001 | [ents] | |
42.21 +| | | /../.. | | |
42.22 +|--------------------------------+----------+--------+--------+----------|
42.23 +| Adrenalinegamer 4.x | v6.0 | 2002/ | [ents] | |
42.24 +| | | 10/06 | | |
42.25 +|--------------------------------+----------+--------+--------+----------|
42.26 +| Arg! | v1.0 | 2001 | [ents] | |
42.27 +| | | /../.. | | |
42.28 +|--------------------------------+----------+--------+--------+----------|
42.29 +| Azure Sheep | | 2002/ | | |
42.30 +| (www.halflifeitalia.com/ | v1.0 | 11/26 | [ents] | |
42.31 +| azuresheep/) | | | | |
42.32 +|--------------------------------+----------+--------+--------+----------|
42.33 +| The Battle Grounds | v1.2.1 | 2003/ | [ents] | |
42.34 +| (www.bgmod.com/) | | 11/15 | | |
42.35 +|--------------------------------+----------+--------+--------+----------|
42.36 +| Bot | - | 2001 | [ents] | |
42.37 +| | | /../.. | | |
42.38 +|--------------------------------+----------+--------+--------+----------|
42.39 +| Bumper Cars | | 2003/ | | |
42.40 +| (www.planethalflife.com/ | Alpha | 05/02 | [ents] | |
42.41 +| bumpercars/) | | | | |
42.42 +|--------------------------------+----------+--------+--------+----------|
42.43 +| BuzzyBots (www.buzzybots.dk/) | v2.3 | 2002/ | [ents] | |
42.44 +| | | 11/26 | | |
42.45 +|--------------------------------+----------+--------+--------+----------|
42.46 +| Counter-Strike | v1.6 | 2003/ | [ents] | |
42.47 +| (www.counter-strike.net/) | | 11/15 | | |
42.48 +|--------------------------------+----------+--------+--------+----------|
42.49 +| Desert Crisis | v1.5 | 2003/ | [ents] | |
42.50 +| (www.desertcrisis.com/) | | 04/09 | | |
42.51 +|--------------------------------+----------+--------+--------+----------|
42.52 +| Deathmatch Classic | v1.0 | 2001/ | [ents] | |
42.53 +| | | 06/07 | | |
42.54 +|--------------------------------+----------+--------+--------+----------|
42.55 +| Day of Defeat | v1.0 | 2003/ | [ents] | |
42.56 +| (www.dayofdefeatmod.com/) | | 05/03 | | |
42.57 +|--------------------------------+----------+--------+--------+----------|
42.58 +| Digital Paintball | v1.0 | 2002/ | [ents] | |
42.59 +| (www.digitalpaintball.net/) | | 10/06 | | |
42.60 +|--------------------------------+----------+--------+--------+----------|
42.61 +| Dragon Mod Z (dmz.flagrun.net | v1.7 | 2002/ | [ents] | |
42.62 +| /) | | 10/06 | | |
42.63 +|--------------------------------+----------+--------+--------+----------|
42.64 +| Earth's Special Forces | Beta 1.1 | 2003/ | [ents] | |
42.65 +| (www.esforces.com/) | | 07/30 | | |
42.66 +|--------------------------------+----------+--------+--------+----------|
42.67 +| Existence | Beta 1.3 | 2001/ | [ents] | |
42.68 +| (www.whatisexistence.com/) | | 09/19 | | |
42.69 +|--------------------------------+----------+--------+--------+----------|
42.70 +| Firearms (www.firearmsmod.com | v2.8 | 2003/ | [ents] | |
42.71 +| /) | | 11/15 | | |
42.72 +|--------------------------------+----------+--------+--------+----------|
42.73 +| Retro Firearms | v2.5 | 2002/ | [ents] | |
42.74 +| (www.firearms25mod.tk/) | | 01/11 | | |
42.75 +|--------------------------------+----------+--------+--------+----------|
42.76 +| Freeze | - | 2001 | [ents] | |
42.77 +| | | /../.. | | |
42.78 +|--------------------------------+----------+--------+--------+----------|
42.79 +| Frontline Force | v1.3 | 2001/ | [ents] | |
42.80 +| (www.frontlineforce.com/) | | 06/10 | | |
42.81 +|--------------------------------+----------+--------+--------+----------|
42.82 +| GangstaWars | | 2001 | | |
42.83 +| (gangstawars.thebackburner.com | v2.6 | /../.. | [ents] | |
42.84 +| /) | | | | |
42.85 +|--------------------------------+----------+--------+--------+----------|
42.86 +| Gangwars (www.gangwars.net/) | Beta 1.0 | 2002/ | [ents] | |
42.87 +| | | 04/21 | | |
42.88 +|--------------------------------+----------+--------+--------+----------|
42.89 +| Opposing Force | | 2001 | | |
42.90 +| (www.sierrastudios.com/games/ | - | /../.. | [ents] | |
42.91 +| opposingforce/) | | | | |
42.92 +|--------------------------------+----------+--------+--------+----------|
42.93 +| Global Warfare | Beta 2.0 | 2002/ | [ents] | |
42.94 +| (www.Globalwarfare.net/) | | 11/26 | | |
42.95 +|--------------------------------+----------+--------+--------+----------|
42.96 +| Goldeneye | v1.9C | 2002/ | [ents] | |
42.97 +| (www.goldeneye-mod.net/) | | 04/24 | | |
42.98 +|--------------------------------+----------+--------+--------+----------|
42.99 +| HL-Rally (www.hlrally.net/) | Beta 1.0 | 2003/ | [ents] | |
42.100 +| | | 11/15 | | |
42.101 +|--------------------------------+----------+--------+--------+----------|
42.102 +| Holy Wars | | 2002/ | | |
42.103 +| (www.planethalflife.com/ | Beta 2 | 10/06 | [ents] | |
42.104 +| holywars/) | | | | |
42.105 +|--------------------------------+----------+--------+--------+----------|
42.106 +| International Online Soccer | v2.0 | 2003/ | [ents] | |
42.107 +| (www.planethalflife.com/ios/) | | 07/30 | | |
42.108 +|--------------------------------+----------+--------+--------+----------|
42.109 +| Judgement | v1.0 | 2001/ | [ents] | |
42.110 +| (justicedepartment.co.uk/) | | 05/26 | | |
42.111 +|--------------------------------+----------+--------+--------+----------|
42.112 +| Kanonball | | 2003/ | | |
42.113 +| (www.planethalflife.com/ | v1.01 | 11/15 | [ents] | |
42.114 +| kanonball/) | | | | |
42.115 +|--------------------------------+----------+--------+--------+----------|
42.116 +| Monkeystrike | v1.2 | 2003/ | [ents] | |
42.117 +| (www.monkeystrike.com/) | | 07/30 | | |
42.118 +|--------------------------------+----------+--------+--------+----------|
42.119 +| Morbid Inclination | | 2003/ | | |
42.120 +| (www.planethalflife.com/morbid | v1.0 | 05/08 | [ents] | |
42.121 +| /) | | | | |
42.122 +|--------------------------------+----------+--------+--------+----------|
42.123 +| Natural Selection | v2.0 | 2003/ | [ents] | |
42.124 +| (www.natural-selection.org/) | | 07/30 | | |
42.125 +|--------------------------------+----------+--------+--------+----------|
42.126 +| OeL Half-Life (www.kixar.com/) | v4.0 | 2002/ | [ents] | |
42.127 +| | | 10/06 | | |
42.128 +|--------------------------------+----------+--------+--------+----------|
42.129 +| Over Ground | Beta 1.0 | 2003/ | [ents] | |
42.130 +| (og.portailmods.com/) | | 11/15 | | |
42.131 +|--------------------------------+----------+--------+--------+----------|
42.132 +| Outlawsmod | | 2002/ | | |
42.133 +| (www.planethalflife.com/ | Beta 1.5 | 11/26 | [ents] | |
42.134 +| outlawsmod/) | | | | |
42.135 +|--------------------------------+----------+--------+--------+----------|
42.136 +| Open-Source Jailbreak | v0.95a | 2001/ | [ents] | |
42.137 +| (www.eatsleepcode.ca/~osjb/) | | 05/26 | | |
42.138 +|--------------------------------+----------+--------+--------+----------|
42.139 +| Oz Deathmatch | v2.4.1 | 2001/ | [ents] | |
42.140 +| (www.planethalflife.com/oz/) | | 12/21 | | |
42.141 +|--------------------------------+----------+--------+--------+----------|
42.142 +| Paintball | v2.0 | 2001/ | [ents] | |
42.143 +| (www.paintball-mod.net/) | | 04/30 | | |
42.144 +|--------------------------------+----------+--------+--------+----------|
42.145 +| Public Enemy | Beta 1.0 | 2003/ | [ents] | |
42.146 +| (www.public-enemy.org/) | | 05/02 | | |
42.147 +|--------------------------------+----------+--------+--------+----------|
42.148 +| Phineas Bot | - | 2001 | [ents] | |
42.149 +| | | /../.. | | |
42.150 +|--------------------------------+----------+--------+--------+----------|
42.151 +| Point of No Return | Beta 4.0 | 2003/ | [ents] | |
42.152 +| (ponr.half-life.hu/) | | 08/01 | | |
42.153 +|--------------------------------+----------+--------+--------+----------|
42.154 +| Retro Counter-Strike | v2.5 | 2002/ | [ents] | |
42.155 +| (www.retro-cs.com/) | | 08/24 | | |
42.156 +|--------------------------------+----------+--------+--------+----------|
42.157 +| Gunman Chronicles | - | 2001/ | [ents] | |
42.158 +| (www.gunmanchronicles.com/) | | 07/05 | | |
42.159 +|--------------------------------+----------+--------+--------+----------|
42.160 +| Ricochet | v1.0 | 2002/ | [ents] | |
42.161 +| | | 07/01 | | |
42.162 +|--------------------------------+----------+--------+--------+----------|
42.163 +| Rocket Crowbar | | 2002/ | | |
42.164 +| (www.planethalflife.com/ | v1.9 | 11/26 | [ents] | |
42.165 +| rocketcrowbar/) | | | | |
42.166 +|--------------------------------+----------+--------+--------+----------|
42.167 +| Rival Species | v1.0 | 2003/ | [ents] | |
42.168 +| (www.rivalspecies.com/) | | 05/02 | | |
42.169 +|--------------------------------+----------+--------+--------+----------|
42.170 +| Scientist Hunt | | 2001/ | | |
42.171 +| (www.telefragged.com/thefatal/ | v1.2 | 09/19 | [ents] | |
42.172 +| scihunt.shtml) | | | | |
42.173 +|--------------------------------+----------+--------+--------+----------|
42.174 +| Science & Industry | v0.97 | 2001/ | [ents] | |
42.175 +| (www.planethalflife.com/si/) | | 05/23 | | |
42.176 +|--------------------------------+----------+--------+--------+----------|
42.177 +| Snow-War | | 2001/ | | |
42.178 +| (www.planethalflife.com/ | v1.0 | 12/29 | [ents] | |
42.179 +| snowwar/) | | | | |
42.180 +|--------------------------------+----------+--------+--------+----------|
42.181 +| StargateTC (www.stargatetc.com | Beta 2.2 | 2002/ | [ents] | |
42.182 +| /) | | 11/26 | | |
42.183 +|--------------------------------+----------+--------+--------+----------|
42.184 +| Sven Coop (www.svencoop.com/) | v2.1 | 2003/ | [ents] | |
42.185 +| | | 05/02 | | |
42.186 +|--------------------------------+----------+--------+--------+----------|
42.187 +| Swarm (swarm.edgegaming.com/) | - | 2001 | [ents] | |
42.188 +| | | /../.. | | |
42.189 +|--------------------------------+----------+--------+--------+----------|
42.190 +| Team Fortress Classic | | 2003/ | | |
42.191 +| (sierrastudios.com/games/tf1.5 | v1.1.1.1 | 01/18 | [ents] | |
42.192 +| /) | | | | |
42.193 +|--------------------------------+----------+--------+--------+----------|
42.194 +| The Wastes (planethalflife.com | RC 1.2 | 2003/ | [ents] | |
42.195 +| /thewastes/) | | 07/30 | | |
42.196 +|--------------------------------+----------+--------+--------+----------|
42.197 +| Project Timeless | Beta 1.0 | 2003/ | [ents] | |
42.198 +| (www.project-timeless.de/) | | 11/15 | | |
42.199 +|--------------------------------+----------+--------+--------+----------|
42.200 +| Tour of Duty | v1.1 | 2002/ | [ents] | |
42.201 +| (www.tourofdutymod.com/) | Beta | 11/26 | | |
42.202 +|--------------------------------+----------+--------+--------+----------|
42.203 +| Train Hunters (th.fragoff.net | Beta 1.0 | 2002/ | [ents] | |
42.204 +| /) | | 04/29 | | |
42.205 +|--------------------------------+----------+--------+--------+----------|
42.206 +| The Specialists | Beta 2.0 | 2003/ | [ents] | |
42.207 +| (www.specialistsmod.net/) | | 07/31 | | |
42.208 +|--------------------------------+----------+--------+--------+----------|
42.209 +| Underworld Bloodline | v2.0 | 2003/ | [ents] | |
42.210 +| (www.entertheunderworld.com/) | | 11/15 | | |
42.211 +|--------------------------------+----------+--------+--------+----------|
42.212 +| Half-Life Deathmatch | | 2001 | | |
42.213 +| (www.sierrastudios.com/games/ | v1.1.0.6 | /../.. | [ents] | |
42.214 +| half-life/bot.html) | | | | |
42.215 +|--------------------------------+----------+--------+--------+----------|
42.216 +| VampireSlayer | Chapter | 2003/ | | |
42.217 +| (www.planethalflife.com/ | V | 02/08 | [ents] | |
42.218 +| vampire/) | | | | |
42.219 +|--------------------------------+----------+--------+--------+----------|
42.220 +| Wanted! (www.wantedhl.com/) | v1.5 | 2001/ | [ents] | |
42.221 +| | | 07/11 | | |
42.222 +|--------------------------------+----------+--------+--------+----------|
42.223 +| Wasteland | Beta 2 | 2001/ | [ents] | |
42.224 +| (wastelandhalflife.com/) | | 06/07 | | |
42.225 +|--------------------------------+----------+--------+--------+----------|
42.226 +| Weapon Wars | v0.3 | 2001/ | [ents] | |
42.227 +| (wwars.hlcenter.com/) | | 08/13 | | |
42.228 +|--------------------------------+----------+--------+--------+----------|
42.229 +| Wizard Wars | | 2001/ | | |
42.230 +| (www.planethalflife.com/ | v1.0 | 07/30 | [ents] | |
42.231 +| wizardwars/) | | | | |
42.232 +|--------------------------------+----------+--------+--------+----------|
42.233 +| WormsHL (www.wormshl.com/) | Beta 3.0 | 2003/ | [ents] | |
42.234 +| | | 05/02 | | |
42.235 ++------------------------------------------------------------------------+
43.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
43.2 +++ b/doc/txt/trace.txt Tue Apr 06 07:36:14 2004 +0000
43.3 @@ -0,0 +1,70 @@
43.4 +TraceAPI plugin
43.5 +=-=-=-=-=-=-=-=
43.6 +
43.7 +This was originally intended as a (more or less) complete example of a
43.8 +Metamod plugin. It catches _every_ call available to it (dll routines both
43.9 +before and after the game, as well as engine functions both before and
43.10 +after the engine).
43.11 +
43.12 +Because it catches every routine, I figured I'd give it the ability to log
43.13 +when given routines are called, so it became an "api tracing" plugin. :)
43.14 +
43.15 +This can actually be useful for tracking the operation of the HL engine,
43.16 +as well as that of a particular HL game mod.
43.17 +
43.18 +It recognizes the following server cvars:
43.19 +
43.20 + // Tracing debug levels; higher values log increasingly frequent routines.
43.21 + // Currently 0-50. See "api_info.cpp" for the debug levels of various
43.22 + // functions.
43.23 +
43.24 + // Trace level for dllapi routines.
43.25 + trace_dllapi
43.26 +
43.27 + // Trace level for "new" dllapi routines.
43.28 + trace_newapi
43.29 +
43.30 + // Trace level for engine functions.
43.31 + trace_engine
43.32 +
43.33 + // Enable unlimited trace logging. By default (as of v1.06), it only
43.34 + // logs _one_ trace message per second, to keep from overwhelming the
43.35 + // server. Set to "1" to enable unlimited logging. (Default "0")
43.36 + trace_unlimit
43.37 +
43.38 + // General debug level, independent of trace levels. Not currently used.
43.39 + trace_debug
43.40 +
43.41 +
43.42 +and the following server commands:
43.43 +
43.44 + // Enable tracing of a given routine, independent of "trace_*" level.
43.45 + // See the list of routine names in "api_info.cpp". Case is insignificant.
43.46 + trace set <APIroutine>
43.47 +
43.48 + // Disable tracing of a given routine, iff previously enabled with "trace".
43.49 + // Doesn't affect routines being logged via "trace_*" level.
43.50 + trace unset <APIroutine>
43.51 +
43.52 + // Show the routines being traced.
43.53 + trace show
43.54 +
43.55 + // List the various routines that can be traced.
43.56 + trace list dllapi
43.57 + trace list newapi
43.58 + trace list engine
43.59 + trace list all
43.60 +
43.61 + // Prints out version/date/etc.
43.62 + trace version
43.63 +
43.64 +Note the information it logs on each routine invocation is, at the moment,
43.65 +relatively minimal. I included information that seemed obvious (args for a
43.66 +ClientCommand, etc), and I've added info for other routines as I've come
43.67 +across a need. Most routines I still know too little about to log any
43.68 +particular information (CreateBaseline, etc). Feel free to add information
43.69 +that you're interested in to the log messages in the routines; the
43.70 +examples should be pretty self-explanatory. I'd be interested in knowing
43.71 +as well, for adding it to the distribution code.
43.72 +
43.73 +--------------------------------------------------------------------------
44.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
44.2 +++ b/doc/txt/wdmisc.txt Tue Apr 06 07:36:14 2004 +0000
44.3 @@ -0,0 +1,32 @@
44.4 +WDMisc plugin
44.5 +=-=-=-=-=-=-=
44.6 +
44.7 +This is a simple plugin that I use as a testbed for various features and
44.8 +other things I need to try from a plugin.
44.9 +
44.10 +It currently provides two features:
44.11 +
44.12 +
44.13 + - a cvar "bounce" that, if set to 1, will exit the server at map change.
44.14 + I use this when I need to shutdown or the server, and don't want to
44.15 + kill it in the middle of a map, nor watch the server constantly until
44.16 + the timelimit expires.
44.17 +
44.18 + - it prints a centersay to all the players whenever someone in
44.19 + Counter-Strike plants the bomb. This was done basically as a
44.20 + proof-of-concept for catching certain game-events that aren't
44.21 + otherwise triggered by the HL API. It works only by examining every
44.22 + log message that the server generates, and checking to see if it
44.23 + includes the string indicating the particular event in question (in
44.24 + this case "Planted_The_Bomb").
44.25 +
44.26 + Although this works, it is really a rather POOR solution to the
44.27 + problem, as it assumes a LOT of string-compares, which can seriously
44.28 + degrade the performance of the server. I did try to take as many
44.29 + short-cuts as reasonable in the code, to decrease the amount of
44.30 + string-comparing going on, which makes the code a bit less readable
44.31 + than doing just a "strstr" on the log line.
44.32 +
44.33 +Other features to be added/removed in the future...
44.34 +
44.35 +--------------------------------------------------------------------------
45.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
45.2 +++ b/doc/txt/windows_notes.txt Tue Apr 06 07:36:14 2004 +0000
45.3 @@ -0,0 +1,110 @@
45.4 +# vi: set ts=4 sw=4 :
45.5 +# vim: set tw=75 :
45.6 +
45.7 +After writing and testing under linux, I then tried to move the code to
45.8 +windows, and being unfamiliar with windows coding, I ran into several
45.9 +issues I wasn't aware of, which I describe here for posterity:
45.10 +
45.11 +
45.12 + - Apparently the GiveFnptrsToDll() routine has to be declared "WINAPI",
45.13 + which is a macro for "__stdcall". Without this, the behavior I observed
45.14 + was that the routine would be called, and would return seemingly okay,
45.15 + but during the following call to GetNewDLLFunctions, the application
45.16 + would crash.
45.17 +
45.18 + This was especially confusing because, using SDK2.1 source for
45.19 + reference, the use of EXPORT and DLLEXPORT macros seemed inconsistent.
45.20 + Doing a simple grep for "define.*EXPORT" turns up these definitions:
45.21 +
45.22 + cl_dll/cl_dll.h: #define EXPORT _declspec( dllexport )
45.23 + cl_dll/hud_iface.h: #define EXPORT _declspec( dllexport )
45.24 + dlls/cbase.h: #define EXPORT _declspec( dllexport )
45.25 +
45.26 + cl_dll/in_defs.h: #define DLLEXPORT __declspec( dllexport )
45.27 + engine/eiface.h: #define DLLEXPORT __stdcall
45.28 +
45.29 + Between "EXPORT", "DLLEXPORT", and "dllexport", and then "_declspec" and
45.30 + "__declspec", they all seemed the same to me. Of course, they aren't.
45.31 +
45.32 + It seems "__declspec(dllexport)" (I'm still unsure about the single vs
45.33 + double underscore) simply says that the routine should be visible
45.34 + externally, outside the DLL. The "__stdcall" specifier, however,
45.35 + changes the way the stack is cleaned up when the routine returns, and no
45.36 + doubt having the routine itself using a different convention than the
45.37 + caller (the engine) caused memory corruption and thus application
45.38 + crashes. The specifier doesn't seem, to me, to be particularly relative
45.39 + to DLL exporting per se, so I'd say the macro name was unfortunate and
45.40 + confusing.
45.41 +
45.42 + The other confusion was that GiveFnptrsToDll is apparently the _only_
45.43 + function that needs to be declared __stdcall; declaring the other
45.44 + external functions (GetEntityAPI, etc) produced MSVC errors and other
45.45 + problems (as might be expected).
45.46 +
45.47 + Also, it seems "__declspec" has to be placed _before_ the return type,
45.48 + whereas "__stdcall" is placed _after_ the return type. Well, at least
45.49 + in MSVC; mingw appears to be looser.
45.50 +
45.51 + Further complicating this, the __stdcall generally causes the function
45.52 + to be given an internal symbol with a trailing "@" and digits specifying
45.53 + the number of bytes in the function arguments (in this case, "8"). At
45.54 + least, this is true under the mingw GNU compiler; I couldn't tell if
45.55 + MSVC was the same. In any case, by default then, the function is
45.56 + exported as "GiveFnptrsToDll@8()", and the engine can't resolve the name
45.57 + properly.
45.58 +
45.59 + In mingw you can apparently alias this to the non-@ name via ".def"
45.60 + files, but it looked like that if I have a .def file, I'd also have to
45.61 + list all the entities in linkfunc.cpp (which would be a pain to
45.62 + maintain). Under MSVC, this didn't appear to be a problem, as both the
45.63 + SDK source and adminmod source use a ".def" file, but still export all
45.64 + the other functions okay. I'm not sure why the difference; I may be
45.65 + missing a mingw link parameter/option.
45.66 +
45.67 + There are, however, mingw link options (--add-stdcall-alias, --kill-at)
45.68 + to handle the problem (the first appears to do the job; I'm unsure about
45.69 + the second), while still exporting all the other necessary functions.
45.70 + Now, reading MSDN:
45.71 + http://msdn.microsoft.com/library/devprods/vs6/visualc/vccore/_core_determine_which_exporting_method_to_use.htm
45.72 +
45.73 + there's apparently an issue of an "export ordinal" and the order of the
45.74 + list of exported functions, which is solved by using a .def file.
45.75 + Perhaps this is why the SDK uses a .def file, in which case I may have
45.76 + problems if I don't specify that GiveFnptrsToDll is the first function
45.77 + (as the SDK .def file does). Although, perhaps this isn't even an issue
45.78 + given that the DLL functions are called by name explicitly
45.79 + (dlsym/GetFuncPointer), rather than being resolved to an library offset
45.80 + at link time.
45.81 +
45.82 + In any case, apparently using the conventions in the SDK, and including
45.83 + the same headers in the same order produces the correct result, but it
45.84 + wasn't at all clear to me, when looking at the source.
45.85 +
45.86 + This one was hard for me to track down, and I also found this page to
45.87 + be helpful:
45.88 + http://www.geocities.com/Tokyo/Towers/6162/win32/dll/make.html
45.89 +
45.90 +
45.91 + - Linux appears to be either (a) much more forgiving about improper
45.92 + pointer references in memcpy, or (b) laying out its memory in a manner
45.93 + that hides problems with that. In my case, I had:
45.94 + DLL_FUNCTIONS *dllapi_table;
45.95 + dllapi_table=malloc(...)
45.96 + memcpy(pFunctionTable, &dllapi_table, sizeof(DLL_FUNCTIONS));
45.97 +
45.98 + Since the argument is already a pointer, the extra "&" is improper, and
45.99 + should instead be:
45.100 + memcpy(pFunctionTable, dllapi_table, sizeof(DLL_FUNCTIONS));
45.101 +
45.102 + Under linux, it didn't seem to be a problem, and program operation was
45.103 + (as far as I could tell) correct. Under windows, though, I got program
45.104 + crashes after calling the 4th or 5th entity in linkfunc.cpp. It
45.105 + wasn't at all obvious what the problem was, and took quite a while to
45.106 + track down.
45.107 +
45.108 +
45.109 + - missing functions (strtok_r, snprintf)
45.110 + - missing macros (PATH_MAX, NAME_MAX)
45.111 + - dlerror, getlasterror
45.112 + - LoadLibrary returning 0 on failure (vs dlclose returning 0 on success)
45.113 + - limits.h under mingw
46.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
46.2 +++ b/metamod/Config.mak Tue Apr 06 07:36:14 2004 +0000
46.3 @@ -0,0 +1,20 @@
46.4 +MODNAME = metamod
46.5 +
46.6 +EXTRA_CFLAGS =
46.7 +
46.8 +SRCFILES = api_info.cpp commands_meta.cpp conf_meta.cpp dllapi.cpp \
46.9 + engine_api.cpp game_support.cpp h_export.cpp linkent.cpp linkgame.cpp \
46.10 + linkplug.cpp log_meta.cpp metamod.cpp mhook.cpp mlist.cpp mplugin.cpp \
46.11 + mqueue.cpp mreg.cpp mutil.cpp osdep.cpp reg_support.cpp sdk_util.cpp \
46.12 + studioapi.cpp support_meta.cpp thread_logparse.cpp vdate.cpp
46.13 +
46.14 +INFOFILES = info_name.h vers_meta.h
46.15 +RESFILE = res_meta.rc
46.16 +
46.17 +GENERATED = games.h
46.18 +
46.19 +#STLFILES = mreg.cpp
46.20 +
46.21 +ifeq "$(OS)" "linux"
46.22 +MKLINKGAME := $(shell ./mklinkgame.sh)
46.23 +endif
47.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
47.2 +++ b/metamod/Makefile Tue Apr 06 07:36:14 2004 +0000
47.3 @@ -0,0 +1,380 @@
47.4 +# vi: set ts=4 sw=4 :
47.5 +# vim: set tw=75 :
47.6 +
47.7 +# MetaMod makefile
47.8 +# Copyright (c) 2001-2003 Will Day <[email protected]>
47.9 +#
47.10 +# based on the Valve SDK 2.1 Makefile as well as the Makefile
47.11 +# in adminmod by Alfred Reynolds.
47.12 +#
47.13 +# From SDK 2.1 dlls/Makefile:
47.14 +#! Half-Life StandardSDK 2.0 mp_i386.so Makefile for i386 Linux
47.15 +#! April 2000 by Leon Hartwig ([email protected])
47.16 +
47.17 +
47.18 +# NOTE: This is a generic Makefile for metamod and the bundled plugins, and
47.19 +# is symlinked into each subdir. Per-module config statements are in
47.20 +# Config.mak in each subdir.
47.21 +
47.22 +ifdef COMSPEC
47.23 + OS=windows
47.24 +else
47.25 + OS=linux
47.26 +endif
47.27 +
47.28 +#############################################################################
47.29 +# CONFIGURATION
47.30 +#############################################################################
47.31 +
47.32 +# set paths for your environment
47.33 +ifeq "$(OS)" "linux"
47.34 + PATH_WIN=/usr/local/cross-tools/i586-mingw32msvc/bin
47.35 + SDKTOP=$(HOME)/src/hl/hlsdk-2.3
47.36 + INST_DIR=$(HOME)/half-life/cstrike/dlls
47.37 + TEST_DIR=$(HOME)/test/tfc/dlls
47.38 + TST_DIR=$(HOME)/tmp
47.39 +else ## windows
47.40 + PATH_WIN=/gcc-2.95.2-msvcrt/bin
47.41 + SDKTOP=/hlsdk2.3
47.42 + INST_DIR=/hlserver/tfc/dlls
47.43 + TEST_DIR=/hlserver/tfc/dlls
47.44 +endif
47.45 +
47.46 +DLLS_DIR=../dlls
47.47 +SDKSRC=$(SDKTOP)/multiplayer
47.48 +METADIR=../metamod
47.49 +
47.50 +
47.51 +#############################################################################
47.52 +# OS DEPENDENCIES
47.53 +#############################################################################
47.54 +
47.55 +ifeq "$(OS)" "linux"
47.56 + INSTALL=install -m 644
47.57 + LD_WINDLL= PATH=$(PATH_WIN) $(PATH_WIN)/dllwrap
47.58 + TARGET=linux
47.59 + LIBFILE=$(LIBFILE_LINUX)
47.60 + TARGET_FILE=$(TARGET_LINUX)
47.61 +else ## windows
47.62 + INSTALL=cp
47.63 + LD_WINDLL= $(PATH_WIN)/dllwrap
47.64 + TARGET=win32
47.65 + LIBFILE=$(LIBFILE_WIN)
47.66 + TARGET_FILE=$(TARGET_WIN)
47.67 +endif
47.68 +
47.69 +CC_WIN=$(PATH_WIN)/gcc
47.70 +RES_WIN=$(PATH_WIN)/windres
47.71 +OBJDIR_LINUX_OPT=opt.linux
47.72 +OBJDIR_WIN_OPT=opt.win32
47.73 +OBJDIR_LINUX_DBG=debug.linux
47.74 +OBJDIR_WIN_DBG=debug.win32
47.75 +
47.76 +
47.77 +#############################################################################
47.78 +# COMPILE OPTIONS
47.79 +#############################################################################
47.80 +
47.81 +# original safe optimization, from valve Makefile
47.82 +#CCOPT = -O2 -ffast-math -funroll-loops \
47.83 +# -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
47.84 +# -malign-jumps=2 -malign-functions=2
47.85 +
47.86 +# safe optimization, adapted from adminmod Makefile
47.87 +#CCOPT = -m486 -O6 -ffast-math -funroll-loops \
47.88 +# -fexpensive-optimizations -malign-loops=2 -malign-jumps=2 \
47.89 +# -malign-functions=2 -Wall
47.90 +
47.91 +# full optimization, adapted from adminmod Makefile
47.92 +# "WONT WORK WITH omit-frame-pointer"?
47.93 +# - disable (unneeded) C++ exceptions and rtti code to save some space ?
47.94 +CCOPT = -march=i586 $(CCO) -ffast-math -funroll-loops \
47.95 + -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
47.96 + -malign-jumps=2 -malign-functions=2 -fno-exceptions -fno-rtti -s
47.97 +
47.98 +# optimization level; overridden for certain problematic files
47.99 +CCO = -O6
47.100 +
47.101 +# debugging; halt on warnings
47.102 +CCDEBUG+= -ggdb3
47.103 +
47.104 +
47.105 +#############################################################################
47.106 +# COMPILE SETUP
47.107 +#############################################################################
47.108 +
47.109 +CC=gcc-2.95
47.110 +
47.111 +SRCDIR=.
47.112 +INCLUDEDIRS=-I$(SRCDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/pm_shared -I$(SDKSRC)/dlls -I$(SDKSRC)
47.113 +FILES_ALL = *.cpp *.h [A-Z]* *.rc
47.114 +
47.115 +CFLAGS=-Wall -Wno-unknown-pragmas
47.116 +#CFLAGS += -DTEST
47.117 +
47.118 +ifeq "$(USER)" "willday"
47.119 + # extra warnings
47.120 + CFLAGS+=-W -Wundef \
47.121 + -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align \
47.122 + -Wconversion -Wsign-compare \
47.123 + -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \
47.124 + -Wmissing-noreturn -Wnested-externs -Winline \
47.125 + -Wlong-long
47.126 + # extra C++ warnings
47.127 + CFLAGS+=-Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder \
47.128 + -Woverloaded-virtual -Wsign-promo -Wsynth -Weffc++
47.129 + # undesired warnings
47.130 + #CFLAGS+=-pedantic -Waggregate-return -Wredundant-decls -Wtraditional
47.131 + # to help debugging; requires edited SDK
47.132 + CCDEBUG+=-Werror
47.133 + # link against older libc for compatibility
47.134 + EXTRA_LINK = -L../priv/libc -lc
47.135 +endif
47.136 +
47.137 +ifeq "$(OPT)" "opt"
47.138 + ODEF = -DOPT_TYPE=\"optimized\"
47.139 + CFLAGS := $(CCOPT) $(CFLAGS) $(ODEF)
47.140 + OBJDIR_LINUX = $(OBJDIR_LINUX_OPT)
47.141 + OBJDIR_WIN = $(OBJDIR_WIN_OPT)
47.142 +else # debug
47.143 + ODEF = -DOPT_TYPE=\"debugging\"
47.144 + CFLAGS := $(CCDEBUG) $(CFLAGS) $(ODEF)
47.145 + OBJDIR_LINUX = $(OBJDIR_LINUX_DBG)
47.146 + OBJDIR_WIN = $(OBJDIR_WIN_DBG)
47.147 + DLLS_DIR := $(DLLS_DIR)/debug
47.148 +endif
47.149 +
47.150 +include Config.mak
47.151 +# any local CFLAGS from Config.mak
47.152 +CFLAGS += $(EXTRA_CFLAGS)
47.153 +
47.154 +# ignore complaints from SDK files like cbase.h
47.155 +$(OBJDIR_LINUX)/sdk_util.o $(OBJDIR_WIN)/sdk_util.o: CFLAGS += -Wno-unused
47.156 +
47.157 +# ignore complaints from STL headers
47.158 +STLOBJ = $(STLFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
47.159 +STLOBJ += $(STLFILES:%.cpp=$(OBJDIR_WIN)/%.o)
47.160 +#$(OBJDIR_LINUX)/mreg.o $(OBJDIR_WIN)/mreg.o: CFLAGS += -Wno-effc++
47.161 +$(STLOBJ): FILTER= 2>&1 | ../tools/stlfilter
47.162 +$(STLOBJ): CFLAGS += -Wno-error
47.163 +
47.164 +# these files seem to create "Internal compiler error" errors under mingw
47.165 +# when using -O6
47.166 +#$(OBJDIR_WIN)/engine_api.o: CCO = -O5
47.167 +#$(OBJDIR_WIN)/dllapi_api.o: CCO = -O5
47.168 +
47.169 +#############################################################################
47.170 +# BUILDING LINUX SO
47.171 +#############################################################################
47.172 +
47.173 +# linux .so compile commands
47.174 +DO_CC_LINUX=$(CC) $(CFLAGS) -fPIC $(INCLUDEDIRS) -o $@ -c $< $(FILTER)
47.175 +LINK_LINUX=$(CC) $(CFLAGS) -shared -ldl -lm $(EXTRA_LINK) $(OBJ_LINUX) -o $@
47.176 +
47.177 +# sort by date
47.178 +ifeq "$(OS)" "linux"
47.179 +SRCFILES := $(shell ls -t $(SRCFILES))
47.180 +endif
47.181 +# linux object files
47.182 +OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
47.183 +
47.184 +# compiling linux object files
47.185 +$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.cpp
47.186 + $(DO_CC_LINUX)
47.187 +
47.188 +# linux .so target file
47.189 +LIBFILE_LINUX = $(MODNAME)_i386.so
47.190 +TARGET_LINUX = $(OBJDIR_LINUX)/$(LIBFILE_LINUX)
47.191 +
47.192 +
47.193 +#############################################################################
47.194 +# BUILDING WINDOWS DLL
47.195 +#############################################################################
47.196 +
47.197 +# windows .dll compile commands
47.198 +DO_CC_WIN=$(CC_WIN) $(CFLAGS) $(INCLUDEDIRS) -o $@ -c $<
47.199 +DO_RES_WIN=$(RES_WIN) '$(ODEF)' --include-dir . --include-dir ../metamod -i $< -O coff -o $@
47.200 +#LINK_WIN=$(LD_WINDLL) -k -mwindows --add-stdcall-alias --def metamod.def -o $@ $(OBJ_WIN)
47.201 +#LINK_WIN=$(LD_WINDLL) -A -k -mwindows --export-all-symbols -o $@ $(OBJ_WIN)
47.202 +LINK_WIN=$(LD_WINDLL) -mwindows --add-stdcall-alias $(OBJ_WIN) $(RES_OBJ_WIN) -o $@
47.203 +
47.204 +# windows object files
47.205 +OBJ_WIN := $(SRCFILES:%.cpp=$(OBJDIR_WIN)/%.o)
47.206 +RES_OBJ_WIN := $(RESFILE:%.rc=$(OBJDIR_WIN)/%.o)
47.207 +
47.208 +# compiling windows object files
47.209 +$(OBJDIR_WIN)/%.o: $(SRCDIR)/%.cpp
47.210 + $(DO_CC_WIN)
47.211 +
47.212 +# compiling windows resource file
47.213 +$(OBJDIR_WIN)/%.o: $(SRCDIR)/%.rc $(INFOFILES)
47.214 + $(DO_RES_WIN)
47.215 +
47.216 +# windows .dll target file
47.217 +LIBFILE_WIN = $(MODNAME).dll
47.218 +TARGET_WIN = $(OBJDIR_WIN)/$(LIBFILE_WIN)
47.219 +
47.220 +
47.221 +#############################################################################
47.222 +# OVERRIDES
47.223 +#############################################################################
47.224 +
47.225 +ifeq "$(PLATFORM)" "linux-only"
47.226 + LIBFILE_WIN =
47.227 + TARGET_WIN =
47.228 +endif
47.229 +ifeq "$(PLATFORM)" "win32-only"
47.230 + LIBFILE_LINUX =
47.231 + TARGET_LINUX =
47.232 + TARGET=win32
47.233 + LIBFILE=$(LIBFILE_WIN)
47.234 + TARGET_FILE=$(TARGET_WIN)
47.235 +endif
47.236 +
47.237 +
47.238 +#############################################################################
47.239 +# BUILD RULES
47.240 +#############################################################################
47.241 +
47.242 +default: $(TARGET_FILE)
47.243 +
47.244 +ifeq "$(USER)" "willday"
47.245 +include ../priv/metamod.mak
47.246 +endif
47.247 +
47.248 +all: do_dll_linux do_dll_win32
47.249 +
47.250 +opt:
47.251 + $(MAKE) default OPT=opt
47.252 +
47.253 +linux: do_dll_linux
47.254 +win32: do_dll_win32
47.255 +
47.256 +linux_opt:
47.257 + $(MAKE) linux OPT=opt
47.258 +win32_opt:
47.259 + $(MAKE) win32 OPT=opt
47.260 +
47.261 +$(TARGET_LINUX): msgs/debug msgs/log msgs/error $(OBJDIR_LINUX) $(OBJ_LINUX)
47.262 + $(LINK_LINUX)
47.263 +
47.264 +# for plugins, recompile meta_api.cpp if info_name.h changed
47.265 +$(OBJDIR_LINUX)/meta_api.o $(OBJDIR_WIN)/meta_api.o: info_name.h
47.266 +
47.267 +ifeq "$(USER)" "willday"
47.268 +$(TARGET_LINUX): .tags .htags
47.269 +endif
47.270 +
47.271 +$(TARGET_WIN): $(OBJDIR_WIN) $(OBJ_WIN) $(RES_OBJ_WIN)
47.272 + $(LINK_WIN)
47.273 +
47.274 +$(OBJDIR_LINUX) $(OBJDIR_WIN) msgs:
47.275 + mkdir $@
47.276 +
47.277 +# make sure to recompile vdate.c for each link
47.278 +$(OBJDIR_LINUX)/vdate.o $(OBJDIR_WIN)/vdate.o : $(SRCFILES) *.h
47.279 +
47.280 +domsgs: msgs/debug msgs/log msgs/error
47.281 +
47.282 +msgs/debug: $(SRCFILES) *.h msgs
47.283 + egrep "DEBUG\([0-9]" $(SRCFILES) *.h | sed "s/:[ ]*/ /" | sort -k2,2 > $@
47.284 +
47.285 +msgs/log: $(SRCFILES) *.h msgs
47.286 + egrep "META_LOG\(" $(SRCFILES) *.h | sed "s/:[ ]*/ /" | sort > $@
47.287 +
47.288 +msgs/error: $(SRCFILES) *.h msgs
47.289 + egrep "META_ERROR\(" $(SRCFILES) *.h | sed "s/:[ ]*/ /" | sort > $@
47.290 +
47.291 +tags: .tags .htags
47.292 +ctags: .tags
47.293 +htags: .htags
47.294 +
47.295 +.tags: $(SRCFILES) *.h
47.296 + -ctags -a $?
47.297 +
47.298 +.htags: *.h
47.299 + -htags $?
47.300 +
47.301 +retags:
47.302 + -rm -f .tags .htags
47.303 + ctags -f .tags `find $(SDKSRC) -name '*.h'`
47.304 + ctags -f .tags -a `find $(METADIR) -name old -prune -o -name '*.h' -print`
47.305 + ctags -f .tags -a $(SRCFILES)
47.306 + htags -R $(SDKSRC)
47.307 + htags `find $(METADIR) -name old -prune -o -name '*.h' -print`
47.308 + htags *.h
47.309 +
47.310 +clean: clean_$(TARGET)
47.311 +
47.312 +clean_linux:
47.313 + test -n "$(OBJDIR_LINUX)"
47.314 + -rm -f $(OBJDIR_LINUX)/*
47.315 +
47.316 +clean_win32:
47.317 + test -n "$(OBJDIR_WIN)"
47.318 + -rm -f $(OBJDIR_WIN)/*
47.319 +
47.320 +cleanall_linux:
47.321 + $(MAKE) clean_linux
47.322 + $(MAKE) clean_linux OPT=opt
47.323 +
47.324 +cleanall_win32:
47.325 + $(MAKE) clean_win32
47.326 + $(MAKE) clean_win32 OPT=opt
47.327 +
47.328 +cleanall: cleanall_linux cleanall_win32
47.329 +
47.330 +dll_linux dll_win32:
47.331 + $(MAKE) do_$@
47.332 + $(MAKE) do_$@ OPT=opt
47.333 +
47.334 +do_dll_linux: $(DLLS_DIR) $(DLLS_DIR)/$(LIBFILE_LINUX)
47.335 +do_dll_win32: $(DLLS_DIR) $(DLLS_DIR)/$(LIBFILE_WIN)
47.336 +
47.337 +$(DLLS_DIR):
47.338 + mkdir $(DLLS_DIR)
47.339 +
47.340 +$(DLLS_DIR)/$(LIBFILE_LINUX): $(TARGET_LINUX)
47.341 + $(INSTALL) $+ $@
47.342 +
47.343 +$(DLLS_DIR)/$(LIBFILE_WIN): $(TARGET_WIN)
47.344 + $(INSTALL) $+ $@
47.345 +
47.346 +dlls: dll_linux dll_win32
47.347 +rmdlls:
47.348 + -rm -f ../dlls/*.* ../dlls/debug/*.*
47.349 +
47.350 +spotless: cleanall
47.351 + -rmdir $(OBJDIR_LINUX) $(OBJDIR_WIN)
47.352 + -rm -f .snap $(GENERATED)
47.353 +
47.354 +distclean: spotless
47.355 +
47.356 +install: $(INST_DIR)/$(LIBFILE)
47.357 +test: $(TEST_DIR)/$(LIBFILE)
47.358 +test_opt:
47.359 + $(MAKE) test OPT=opt
47.360 +
47.361 +$(INST_DIR)/$(LIBFILE) $(TEST_DIR)/$(LIBFILE): $(TARGET_FILE)
47.362 + $(INSTALL) $< $@
47.363 +
47.364 +tst: $(TST_DIR)/$(LIBFILE_WIN)
47.365 +
47.366 +$(TST_DIR)/$(LIBFILE_WIN): $(TARGET_WIN)
47.367 + cp $< $@
47.368 +
47.369 +snap: .snap
47.370 +
47.371 +.snap: $(FILES_ALL)
47.372 + mkdir -p snapshots
47.373 + tar zcvf snapshots/`date '+%m%d-%H%M'`.tgz $(FILES_ALL)
47.374 + touch .snap
47.375 +
47.376 +depend: Rules.depend
47.377 +
47.378 +ifeq "$(OS)" "linux"
47.379 +Rules.depend: $(SRCFILES)
47.380 + $(CC) -MM $(INCLUDEDIRS) $(SRCFILES) | sed "s;\(^[^ ]*\):\(.*\);$(OBJDIR_LINUX)/\1 $(OBJDIR_WIN)/\1: \2;" > $@
47.381 +endif
47.382 +
47.383 +include Rules.depend
48.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
48.2 +++ b/metamod/Rules.depend Tue Apr 06 07:36:14 2004 +0000
48.3 @@ -0,0 +1,73 @@
48.4 +debug.linux/linkgame.o debug.win32/linkgame.o: linkgame.cpp linkent.h osdep.h types_meta.h mreg.h \
48.5 + log_meta.h sdk_util.h metamod.h meta_api.h dllapi.h engine_api.h \
48.6 + plinfo.h mutil.h mhook.h mlist.h mplugin.h api_info.h support_meta.h \
48.7 + conf_meta.h
48.8 +debug.linux/engine_api.o debug.win32/engine_api.o: engine_api.cpp engine_api.h metamod.h meta_api.h \
48.9 + dllapi.h sdk_util.h osdep.h types_meta.h mreg.h log_meta.h plinfo.h \
48.10 + mutil.h mhook.h mlist.h mplugin.h api_info.h support_meta.h \
48.11 + conf_meta.h thread_logparse.h
48.12 +debug.linux/api_info.o debug.win32/api_info.o: api_info.cpp api_info.h types_meta.h
48.13 +debug.linux/mlist.o debug.win32/mlist.o: mlist.cpp mlist.h types_meta.h mplugin.h meta_api.h dllapi.h \
48.14 + sdk_util.h osdep.h mreg.h log_meta.h engine_api.h plinfo.h mutil.h \
48.15 + mhook.h api_info.h support_meta.h commands_meta.h metamod.h \
48.16 + conf_meta.h
48.17 +debug.linux/conf_meta.o debug.win32/conf_meta.o: conf_meta.cpp conf_meta.h types_meta.h support_meta.h \
48.18 + osdep.h mreg.h log_meta.h sdk_util.h
48.19 +debug.linux/mplugin.o debug.win32/mplugin.o: mplugin.cpp mplugin.h types_meta.h meta_api.h dllapi.h \
48.20 + sdk_util.h osdep.h mreg.h log_meta.h engine_api.h plinfo.h mutil.h \
48.21 + mhook.h api_info.h support_meta.h metamod.h mlist.h conf_meta.h \
48.22 + h_export.h
48.23 +debug.linux/osdep.o debug.win32/osdep.o: osdep.cpp osdep.h types_meta.h mreg.h log_meta.h sdk_util.h \
48.24 + support_meta.h
48.25 +debug.linux/metamod.o debug.win32/metamod.o: metamod.cpp metamod.h meta_api.h dllapi.h sdk_util.h \
48.26 + osdep.h types_meta.h mreg.h log_meta.h engine_api.h plinfo.h mutil.h \
48.27 + mhook.h mlist.h mplugin.h api_info.h support_meta.h conf_meta.h \
48.28 + h_export.h reg_support.h game_support.h commands_meta.h \
48.29 + thread_logparse.h info_name.h vers_meta.h vdate.h
48.30 +debug.linux/commands_meta.o debug.win32/commands_meta.o: commands_meta.cpp commands_meta.h types_meta.h \
48.31 + metamod.h meta_api.h dllapi.h sdk_util.h osdep.h mreg.h log_meta.h \
48.32 + engine_api.h plinfo.h mutil.h mhook.h mlist.h mplugin.h api_info.h \
48.33 + support_meta.h conf_meta.h info_name.h vers_meta.h vdate.h
48.34 +debug.linux/game_support.o debug.win32/game_support.o: game_support.cpp game_support.h types_meta.h metamod.h \
48.35 + meta_api.h dllapi.h sdk_util.h osdep.h mreg.h log_meta.h engine_api.h \
48.36 + plinfo.h mutil.h mhook.h mlist.h mplugin.h api_info.h support_meta.h \
48.37 + conf_meta.h games.h
48.38 +debug.linux/dllapi.o debug.win32/dllapi.o: dllapi.cpp dllapi.h sdk_util.h osdep.h types_meta.h mreg.h \
48.39 + log_meta.h metamod.h meta_api.h engine_api.h plinfo.h mutil.h mhook.h \
48.40 + mlist.h mplugin.h api_info.h support_meta.h conf_meta.h \
48.41 + commands_meta.h
48.42 +debug.linux/log_meta.o debug.win32/log_meta.o: log_meta.cpp log_meta.h sdk_util.h osdep.h types_meta.h \
48.43 + mreg.h
48.44 +debug.linux/support_meta.o debug.win32/support_meta.o: support_meta.cpp
48.45 +debug.linux/studioapi.o debug.win32/studioapi.o: studioapi.cpp studioapi.h metamod.h meta_api.h dllapi.h \
48.46 + sdk_util.h osdep.h types_meta.h mreg.h log_meta.h engine_api.h \
48.47 + plinfo.h mutil.h mhook.h mlist.h mplugin.h api_info.h support_meta.h \
48.48 + conf_meta.h
48.49 +debug.linux/mutil.o debug.win32/mutil.o: mutil.cpp mutil.h plinfo.h mhook.h sdk_util.h linkent.h \
48.50 + osdep.h types_meta.h mreg.h log_meta.h metamod.h meta_api.h dllapi.h \
48.51 + engine_api.h mlist.h mplugin.h api_info.h support_meta.h conf_meta.h
48.52 +debug.linux/h_export.o debug.win32/h_export.o: h_export.cpp h_export.h osdep.h types_meta.h mreg.h \
48.53 + log_meta.h sdk_util.h metamod.h meta_api.h dllapi.h engine_api.h \
48.54 + plinfo.h mutil.h mhook.h mlist.h mplugin.h api_info.h support_meta.h \
48.55 + conf_meta.h
48.56 +debug.linux/reg_support.o debug.win32/reg_support.o: reg_support.cpp sdk_util.h reg_support.h mreg.h \
48.57 + types_meta.h metamod.h meta_api.h dllapi.h osdep.h log_meta.h \
48.58 + engine_api.h plinfo.h mutil.h mhook.h mlist.h mplugin.h api_info.h \
48.59 + support_meta.h conf_meta.h
48.60 +debug.linux/mreg.o debug.win32/mreg.o: mreg.cpp mreg.h types_meta.h metamod.h meta_api.h dllapi.h \
48.61 + sdk_util.h osdep.h log_meta.h engine_api.h plinfo.h mutil.h mhook.h \
48.62 + mlist.h mplugin.h api_info.h support_meta.h conf_meta.h
48.63 +debug.linux/vdate.o debug.win32/vdate.o: vdate.cpp info_name.h vers_meta.h
48.64 +debug.linux/sdk_util.o debug.win32/sdk_util.o: sdk_util.cpp sdk_util.h osdep.h types_meta.h mreg.h \
48.65 + log_meta.h
48.66 +debug.linux/linkent.o debug.win32/linkent.o: linkent.cpp linkent.h osdep.h types_meta.h mreg.h \
48.67 + log_meta.h sdk_util.h metamod.h meta_api.h dllapi.h engine_api.h \
48.68 + plinfo.h mutil.h mhook.h mlist.h mplugin.h api_info.h support_meta.h \
48.69 + conf_meta.h
48.70 +debug.linux/linkplug.o debug.win32/linkplug.o: linkplug.cpp linkent.h osdep.h types_meta.h mreg.h \
48.71 + log_meta.h sdk_util.h metamod.h meta_api.h dllapi.h engine_api.h \
48.72 + plinfo.h mutil.h mhook.h mlist.h mplugin.h api_info.h support_meta.h \
48.73 + conf_meta.h
48.74 +debug.linux/mhook.o debug.win32/mhook.o: mhook.cpp
48.75 +debug.linux/mqueue.o debug.win32/mqueue.o: mqueue.cpp
48.76 +debug.linux/thread_logparse.o debug.win32/thread_logparse.o: thread_logparse.cpp
49.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
49.2 +++ b/metamod/api_info.cpp Tue Apr 06 07:36:14 2004 +0000
49.3 @@ -0,0 +1,264 @@
49.4 +// vi: set ts=4 sw=4 :
49.5 +// vim: set tw=75 :
49.6 +
49.7 +// api_info.cpp - info for api routines
49.8 +
49.9 +/*
49.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
49.11 + *
49.12 + * This file is part of Metamod.
49.13 + *
49.14 + * Metamod is free software; you can redistribute it and/or modify it
49.15 + * under the terms of the GNU General Public License as published by the
49.16 + * Free Software Foundation; either version 2 of the License, or (at
49.17 + * your option) any later version.
49.18 + *
49.19 + * Metamod is distributed in the hope that it will be useful, but
49.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
49.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
49.22 + * General Public License for more details.
49.23 + *
49.24 + * You should have received a copy of the GNU General Public License
49.25 + * along with Metamod; if not, write to the Free Software Foundation,
49.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
49.27 + *
49.28 + * In addition, as a special exception, the author gives permission to
49.29 + * link the code of this program with the Half-Life Game Engine ("HL
49.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
49.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
49.32 + * respects for all of the code used other than the HL Engine and MODs
49.33 + * from Valve. If you modify this file, you may extend this exception
49.34 + * to your version of the file, but you are not obligated to do so. If
49.35 + * you do not wish to do so, delete this exception statement from your
49.36 + * version.
49.37 + *
49.38 + */
49.39 +
49.40 +#include <extdll.h> // always
49.41 +
49.42 +#include "api_info.h" // me
49.43 +
49.44 +// trace flag, loglevel, name
49.45 +dllapi_info_t dllapi_info = {
49.46 + { mFALSE, 3, "GameDLLInit" }, // pfnGameInit
49.47 + { mFALSE, 10, "DispatchSpawn" }, // pfnSpawn
49.48 + { mFALSE, 16, "DispatchThink" }, // pfnThink
49.49 + { mFALSE, 9, "DispatchUse" }, // pfnUse
49.50 + { mFALSE, 11, "DispatchTouch" }, // pfnTouch
49.51 + { mFALSE, 9, "DispatchBlocked" }, // pfnBlocked
49.52 + { mFALSE, 10, "DispatchKeyValue" }, // pfnKeyValue
49.53 + { mFALSE, 9, "DispatchSave" }, // pfnSave
49.54 + { mFALSE, 9, "DispatchRestore" }, // pfnRestore
49.55 + { mFALSE, 20, "DispatchObjectCollsionBox" }, // pfnSetAbsBox
49.56 + { mFALSE, 9, "SaveWriteFields" }, // pfnSaveWriteFields
49.57 + { mFALSE, 9, "SaveReadFields" }, // pfnSaveReadFields
49.58 + { mFALSE, 9, "SaveGlobalState" }, // pfnSaveGlobalState
49.59 + { mFALSE, 9, "RestoreGlobalState" }, // pfnRestoreGlobalState
49.60 + { mFALSE, 9, "ResetGlobalState" }, // pfnResetGlobalState
49.61 + { mFALSE, 3, "ClientConnect" }, // pfnClientConnect
49.62 + { mFALSE, 3, "ClientDisconnect" }, // pfnClientDisconnect
49.63 + { mFALSE, 3, "ClientKill" }, // pfnClientKill
49.64 + { mFALSE, 3, "ClientPutInServer" }, // pfnClientPutInServer
49.65 + { mFALSE, 9, "ClientCommand" }, // pfnClientCommand
49.66 + { mFALSE, 11, "ClientUserInfoChanged" }, // pfnClientUserInfoChanged
49.67 + { mFALSE, 3, "ServerActivate" }, // pfnServerActivate
49.68 + { mFALSE, 3, "ServerDeactivate" }, // pfnServerDeactivate
49.69 + { mFALSE, 14, "PlayerPreThink" }, // pfnPlayerPreThink
49.70 + { mFALSE, 14, "PlayerPostThink" }, // pfnPlayerPostThink
49.71 + { mFALSE, 18, "StartFrame" }, // pfnStartFrame
49.72 + { mFALSE, 9, "ParmsNewLevel" }, // pfnParmsNewLevel
49.73 + { mFALSE, 9, "ParmsChangeLevel" }, // pfnParmsChangeLevel
49.74 + { mFALSE, 9, "GetGameDescription" }, // pfnGetGameDescription
49.75 + { mFALSE, 9, "PlayerCustomization" }, // pfnPlayerCustomization
49.76 + { mFALSE, 9, "SpectatorConnect" }, // pfnSpectatorConnect
49.77 + { mFALSE, 9, "SpectatorDisconnect" }, // pfnSpectatorDisconnect
49.78 + { mFALSE, 9, "SpectatorThink" }, // pfnSpectatorThink
49.79 + { mFALSE, 3, "Sys_Error" }, // pfnSys_Error
49.80 + { mFALSE, 13, "PM_Move" }, // pfnPM_Move
49.81 + { mFALSE, 9, "PM_Init" }, // pfnPM_Init
49.82 + { mFALSE, 9, "PM_FindTextureType" }, // pfnPM_FindTextureType
49.83 + { mFALSE, 12, "SetupVisibility" }, // pfnSetupVisibility
49.84 + { mFALSE, 12, "UpdateClientData" }, // pfnUpdateClientData
49.85 + { mFALSE, 16, "AddToFullPack" }, // pfnAddToFullPack
49.86 + { mFALSE, 9, "CreateBaseline" }, // pfnCreateBaseline
49.87 + { mFALSE, 9, "RegisterEncoders" }, // pfnRegisterEncoders
49.88 + { mFALSE, 9, "GetWeaponData" }, // pfnGetWeaponData
49.89 + { mFALSE, 15, "CmdStart" }, // pfnCmdStart
49.90 + { mFALSE, 15, "CmdEnd" }, // pfnCmdEnd
49.91 + { mFALSE, 9, "ConnectionlessPacket" }, // pfnConnectionlessPacket
49.92 + { mFALSE, 9, "GetHullBounds" }, // pfnGetHullBounds
49.93 + { mFALSE, 9, "CreateInstancedBaselines" }, // pfnCreateInstancedBaselines
49.94 + { mFALSE, 3, "InconsistentFile" }, // pfnInconsistentFile
49.95 + { mFALSE, 20, "AllowLagCompensation" }, // pfnAllowLagCompensation
49.96 + { mFALSE, 0, NULL },
49.97 +};
49.98 +
49.99 +newapi_info_t newapi_info = {
49.100 + { mFALSE, 16, "OnFreeEntPrivateData" }, // pfnOnFreeEntPrivateData
49.101 + { mFALSE, 3, "GameShutdown" }, // pfnGameShutdown
49.102 + { mFALSE, 14, "ShouldCollide" }, // pfnShouldCollide
49.103 + { mFALSE, 0, NULL },
49.104 +};
49.105 +
49.106 +engine_info_t engine_info = {
49.107 + { mFALSE, 13, "PrecacheModel" }, // pfnPrecacheModel
49.108 + { mFALSE, 13, "PrecacheSound" }, // pfnPrecacheSound
49.109 + { mFALSE, 18, "SetModel" }, // pfnSetModel
49.110 + { mFALSE, 34, "ModelIndex" }, // pfnModelIndex
49.111 + { mFALSE, 10, "ModelFrames" }, // pfnModelFrames
49.112 + { mFALSE, 14, "SetSize" }, // pfnSetSize
49.113 + { mFALSE, 9, "ChangeLevel" }, // pfnChangeLevel
49.114 + { mFALSE, 9, "GetSpawnParms" }, // pfnGetSpawnParms
49.115 + { mFALSE, 9, "SaveSpawnParms" }, // pfnSaveSpawnParms
49.116 + { mFALSE, 9, "VecToYaw" }, // pfnVecToYaw
49.117 + { mFALSE, 14, "VecToAngles" }, // pfnVecToAngles
49.118 + { mFALSE, 9, "MoveToOrigin" }, // pfnMoveToOrigin
49.119 + { mFALSE, 9, "ChangeYaw" }, // pfnChangeYaw
49.120 + { mFALSE, 9, "ChangePitch" }, // pfnChangePitch
49.121 + { mFALSE, 32, "FindEntityByString" }, // pfnFindEntityByString
49.122 + { mFALSE, 9, "GetEntityIllum" }, // pfnGetEntityIllum
49.123 + { mFALSE, 9, "FindEntityInSphere" }, // pfnFindEntityInSphere
49.124 + { mFALSE, 19, "FindClientInPVS" }, // pfnFindClientInPVS
49.125 + { mFALSE, 9, "EntitiesInPVS" }, // pfnEntitiesInPVS
49.126 + { mFALSE, 40, "MakeVectors" }, // pfnMakeVectors
49.127 + { mFALSE, 9, "AngleVectors" }, // pfnAngleVectors
49.128 + { mFALSE, 13, "CreateEntity" }, // pfnCreateEntity
49.129 + { mFALSE, 13, "RemoveEntity" }, // pfnRemoveEntity
49.130 + { mFALSE, 13, "CreateNamedEntity" }, // pfnCreateNamedEntity
49.131 + { mFALSE, 9, "MakeStatic" }, // pfnMakeStatic
49.132 + { mFALSE, 9, "EntIsOnFloor" }, // pfnEntIsOnFloor
49.133 + { mFALSE, 9, "DropToFloor" }, // pfnDropToFloor
49.134 + { mFALSE, 9, "WalkMove" }, // pfnWalkMove
49.135 + { mFALSE, 14, "SetOrigin" }, // pfnSetOrigin
49.136 + { mFALSE, 12, "EmitSound" }, // pfnEmitSound
49.137 + { mFALSE, 12, "EmitAmbientSound" }, // pfnEmitAmbientSound
49.138 + { mFALSE, 20, "TraceLine" }, // pfnTraceLine
49.139 + { mFALSE, 9, "TraceToss" }, // pfnTraceToss
49.140 + { mFALSE, 9, "TraceMonsterHull" }, // pfnTraceMonsterHull
49.141 + { mFALSE, 9, "TraceHull" }, // pfnTraceHull
49.142 + { mFALSE, 9, "TraceModel" }, // pfnTraceModel
49.143 + { mFALSE, 15, "TraceTexture" }, // pfnTraceTexture // CS: when moving
49.144 + { mFALSE, 9, "TraceSphere" }, // pfnTraceSphere
49.145 + { mFALSE, 9, "GetAimVector" }, // pfnGetAimVector
49.146 + { mFALSE, 9, "ServerCommand" }, // pfnServerCommand
49.147 + { mFALSE, 9, "ServerExecute" }, // pfnServerExecute
49.148 + { mFALSE, 11, "engClientCommand" }, // pfnClientCommand // d'oh, ClientCommand in dllapi too
49.149 + { mFALSE, 9, "ParticleEffect" }, // pfnParticleEffect
49.150 + { mFALSE, 9, "LightStyle" }, // pfnLightStyle
49.151 + { mFALSE, 9, "DecalIndex" }, // pfnDecalIndex
49.152 + { mFALSE, 15, "PointContents" }, // pfnPointContents // CS: when moving
49.153 + { mFALSE, 22, "MessageBegin" }, // pfnMessageBegin
49.154 + { mFALSE, 22, "MessageEnd" }, // pfnMessageEnd
49.155 + { mFALSE, 30, "WriteByte" }, // pfnWriteByte
49.156 + { mFALSE, 23, "WriteChar" }, // pfnWriteChar
49.157 + { mFALSE, 24, "WriteShort" }, // pfnWriteShort
49.158 + { mFALSE, 23, "WriteLong" }, // pfnWriteLong
49.159 + { mFALSE, 23, "WriteAngle" }, // pfnWriteAngle
49.160 + { mFALSE, 23, "WriteCoord" }, // pfnWriteCoord
49.161 + { mFALSE, 25, "WriteString" }, // pfnWriteString
49.162 + { mFALSE, 23, "WriteEntity" }, // pfnWriteEntity
49.163 + { mFALSE, 9, "CVarRegister" }, // pfnCVarRegister
49.164 + { mFALSE, 21, "CVarGetFloat" }, // pfnCVarGetFloat
49.165 + { mFALSE, 9, "CVarGetString" }, // pfnCVarGetString
49.166 + { mFALSE, 10, "CVarSetFloat" }, // pfnCVarSetFloat
49.167 + { mFALSE, 9, "CVarSetString" }, // pfnCVarSetString
49.168 + { mFALSE, 15, "AlertMessage" }, // pfnAlertMessage
49.169 + { mFALSE, 17, "EngineFprintf" }, // pfnEngineFprintf
49.170 + { mFALSE, 14, "PvAllocEntPrivateData" }, // pfnPvAllocEntPrivateData
49.171 + { mFALSE, 9, "PvEntPrivateData" }, // pfnPvEntPrivateData
49.172 + { mFALSE, 9, "FreeEntPrivateData" }, // pfnFreeEntPrivateData
49.173 + { mFALSE, 9, "SzFromIndex" }, // pfnSzFromIndex
49.174 + { mFALSE, 10, "AllocString" }, // pfnAllocString
49.175 + { mFALSE, 9, "GetVarsOfEnt" }, // pfnGetVarsOfEnt
49.176 + { mFALSE, 14, "PEntityOfEntOffset" }, // pfnPEntityOfEntOffset
49.177 + { mFALSE, 19, "EntOffsetOfPEntity" }, // pfnEntOffsetOfPEntity
49.178 + { mFALSE, 14, "IndexOfEdict" }, // pfnIndexOfEdict
49.179 + { mFALSE, 17, "PEntityOfEntIndex" }, // pfnPEntityOfEntIndex
49.180 + { mFALSE, 9, "FindEntityByVars" }, // pfnFindEntityByVars
49.181 + { mFALSE, 14, "GetModelPtr" }, // pfnGetModelPtr
49.182 + { mFALSE, 9, "RegUserMsg" }, // pfnRegUserMsg
49.183 + { mFALSE, 9, "AnimationAutomove" }, // pfnAnimationAutomove
49.184 + { mFALSE, 9, "GetBonePosition" }, // pfnGetBonePosition
49.185 + { mFALSE, 9, "FunctionFromName" }, // pfnFunctionFromName
49.186 + { mFALSE, 9, "NameForFunction" }, // pfnNameForFunction
49.187 + { mFALSE, 9, "ClientPrintf" }, // pfnClientPrintf
49.188 + { mFALSE, 9, "ServerPrint" }, // pfnServerPrint
49.189 + { mFALSE, 13, "Cmd_Args" }, // pfnCmd_Args
49.190 + { mFALSE, 13, "Cmd_Argv" }, // pfnCmd_Argv
49.191 + { mFALSE, 13, "Cmd_Argc" }, // pfnCmd_Argc
49.192 + { mFALSE, 9, "GetAttachment" }, // pfnGetAttachment
49.193 + { mFALSE, 9, "CRC32_Init" }, // pfnCRC32_Init
49.194 + { mFALSE, 9, "CRC32_ProcessBuffer" }, // pfnCRC32_ProcessBuffer
49.195 + { mFALSE, 9, "CRC32_ProcessByte" }, // pfnCRC32_ProcessByte
49.196 + { mFALSE, 9, "CRC32_Final" }, // pfnCRC32_Final
49.197 + { mFALSE, 16, "RandomLong" }, // pfnRandomLong
49.198 + { mFALSE, 14, "RandomFloat" }, // pfnRandomFloat // CS: when firing
49.199 + { mFALSE, 14, "SetView" }, // pfnSetView
49.200 + { mFALSE, 9, "Time" }, // pfnTime
49.201 + { mFALSE, 9, "CrosshairAngle" }, // pfnCrosshairAngle
49.202 + { mFALSE, 10, "LoadFileForMe" }, // pfnLoadFileForMe
49.203 + { mFALSE, 10, "FreeFile" }, // pfnFreeFile
49.204 + { mFALSE, 9, "EndSection" }, // pfnEndSection
49.205 + { mFALSE, 9, "CompareFileTime" }, // pfnCompareFileTime
49.206 + { mFALSE, 9, "GetGameDir" }, // pfnGetGameDir
49.207 + { mFALSE, 9, "Cvar_RegisterVariable" }, // pfnCvar_RegisterVariable
49.208 + { mFALSE, 9, "FadeClientVolume" }, // pfnFadeClientVolume
49.209 + { mFALSE, 14, "SetClientMaxspeed" }, // pfnSetClientMaxspeed
49.210 + { mFALSE, 9, "CreateFakeClient" }, // pfnCreateFakeClient
49.211 + { mFALSE, 9, "RunPlayerMove" }, // pfnRunPlayerMove
49.212 + { mFALSE, 9, "NumberOfEntities" }, // pfnNumberOfEntities
49.213 + { mFALSE, 17, "GetInfoKeyBuffer" }, // pfnGetInfoKeyBuffer
49.214 + { mFALSE, 13, "InfoKeyValue" }, // pfnInfoKeyValue
49.215 + { mFALSE, 9, "SetKeyValue" }, // pfnSetKeyValue
49.216 + { mFALSE, 12, "SetClientKeyValue" }, // pfnSetClientKeyValue
49.217 + { mFALSE, 9, "IsMapValid" }, // pfnIsMapValid
49.218 + { mFALSE, 9, "StaticDecal" }, // pfnStaticDecal
49.219 + { mFALSE, 9, "PrecacheGeneric" }, // pfnPrecacheGeneric
49.220 + { mFALSE, 10, "GetPlayerUserId" }, // pfnGetPlayerUserId
49.221 + { mFALSE, 9, "BuildSoundMsg" }, // pfnBuildSoundMsg
49.222 + { mFALSE, 9, "IsDedicatedServer" }, // pfnIsDedicatedServer
49.223 + { mFALSE, 9, "CVarGetPointer" }, // pfnCVarGetPointer
49.224 + { mFALSE, 9, "GetPlayerWONId" }, // pfnGetPlayerWONId
49.225 + { mFALSE, 9, "Info_RemoveKey" }, // pfnInfo_RemoveKey
49.226 + { mFALSE, 15, "GetPhysicsKeyValue" }, // pfnGetPhysicsKeyValue
49.227 + { mFALSE, 14, "SetPhysicsKeyValue" }, // pfnSetPhysicsKeyValue
49.228 + { mFALSE, 15, "GetPhysicsInfoString" }, // pfnGetPhysicsInfoString
49.229 + { mFALSE, 13, "PrecacheEvent" }, // pfnPrecacheEvent
49.230 + { mFALSE, 9, "PlaybackEvent" }, // pfnPlaybackEvent
49.231 + { mFALSE, 31, "SetFatPVS" }, // pfnSetFatPVS
49.232 + { mFALSE, 31, "SetFatPAS" }, // pfnSetFatPAS
49.233 + { mFALSE, 50, "CheckVisibility" }, // pfnCheckVisibility
49.234 + { mFALSE, 37, "DeltaSetField" }, // pfnDeltaSetField
49.235 + { mFALSE, 38, "DeltaUnsetField" }, // pfnDeltaUnsetField
49.236 + { mFALSE, 9, "DeltaAddEncoder" }, // pfnDeltaAddEncoder
49.237 + { mFALSE, 45, "GetCurrentPlayer" }, // pfnGetCurrentPlayer
49.238 + { mFALSE, 14, "CanSkipPlayer" }, // pfnCanSkipPlayer
49.239 + { mFALSE, 9, "DeltaFindField" }, // pfnDeltaFindField
49.240 + { mFALSE, 37, "DeltaSetFieldByIndex" }, // pfnDeltaSetFieldByIndex
49.241 + { mFALSE, 38, "DeltaUnsetFieldByIndex" }, // pfnDeltaUnsetFieldByIndex
49.242 + { mFALSE, 9, "SetGroupMask" }, // pfnSetGroupMask
49.243 + { mFALSE, 9, "engCreateInstancedBaseline" }, // pfnCreateInstancedBaseline // d'oh, CreateInstancedBaseline in dllapi too
49.244 + { mFALSE, 9, "Cvar_DirectSet" }, // pfnCvar_DirectSet
49.245 + { mFALSE, 9, "ForceUnmodified" }, // pfnForceUnmodified
49.246 + { mFALSE, 9, "GetPlayerStats" }, // pfnGetPlayerStats
49.247 + { mFALSE, 3, "AddServerCommand" }, // pfnAddServerCommand
49.248 + // Added in SDK 2.2:
49.249 + { mFALSE, 9, "Voice_GetClientListening" }, // Voice_GetClientListening
49.250 + { mFALSE, 9, "Voice_SetClientListening" }, // Voice_SetClientListening
49.251 + // Added for HL 1109 (no SDK update):
49.252 + { mFALSE, 9, "GetPlayerAuthId" }, // pfnGetPlayerAuthId
49.253 + // Added 2003/11/10 (no SDK update):
49.254 + { mFALSE, 30, "SequenceGet" }, // pfnSequenceGet
49.255 + { mFALSE, 30, "SequencePickSentence" }, // pfnSequencePickSentence
49.256 + { mFALSE, 30, "GetFileSize" }, // pfnGetFileSize
49.257 + { mFALSE, 30, "GetApproxWavePlayLen" }, // pfnGetApproxWavePlayLen
49.258 + { mFALSE, 30, "IsCareerMatch" }, // pfnIsCareerMatch
49.259 + { mFALSE, 30, "GetLocalizedStringLength" }, // pfnGetLocalizedStringLength
49.260 + { mFALSE, 30, "RegisterTutorMessageShown" }, // pfnRegisterTutorMessageShown
49.261 + { mFALSE, 30, "GetTimesTutorMessageShown" }, // pfnGetTimesTutorMessageShown
49.262 + { mFALSE, 30, "ProcessTutorMessageDecayBuffer" }, // pfnProcessTutorMessageDecayBuffer
49.263 + { mFALSE, 30, "ConstructTutorMessageDecayBuffer" }, // pfnConstructTutorMessageDecayBuffer
49.264 + { mFALSE, 9, "ResetTutorMessageDecayData" }, // pfnResetTutorMessageDecayData
49.265 + // end
49.266 + { mFALSE, 0, NULL },
49.267 +};
50.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
50.2 +++ b/metamod/api_info.h Tue Apr 06 07:36:14 2004 +0000
50.3 @@ -0,0 +1,288 @@
50.4 +// vi: set ts=4 sw=4 :
50.5 +// vim: set tw=75 :
50.6 +
50.7 +// api_info.h - structures to store info about api routines
50.8 +
50.9 +/*
50.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
50.11 + *
50.12 + * This file is part of Metamod.
50.13 + *
50.14 + * Metamod is free software; you can redistribute it and/or modify it
50.15 + * under the terms of the GNU General Public License as published by the
50.16 + * Free Software Foundation; either version 2 of the License, or (at
50.17 + * your option) any later version.
50.18 + *
50.19 + * Metamod is distributed in the hope that it will be useful, but
50.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
50.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
50.22 + * General Public License for more details.
50.23 + *
50.24 + * You should have received a copy of the GNU General Public License
50.25 + * along with Metamod; if not, write to the Free Software Foundation,
50.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
50.27 + *
50.28 + * In addition, as a special exception, the author gives permission to
50.29 + * link the code of this program with the Half-Life Game Engine ("HL
50.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
50.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
50.32 + * respects for all of the code used other than the HL Engine and MODs
50.33 + * from Valve. If you modify this file, you may extend this exception
50.34 + * to your version of the file, but you are not obligated to do so. If
50.35 + * you do not wish to do so, delete this exception statement from your
50.36 + * version.
50.37 + *
50.38 + */
50.39 +
50.40 +#ifndef API_INFO_H
50.41 +#define API_INFO_H
50.42 +
50.43 +#include "types_meta.h" // mBOOL
50.44 +
50.45 +
50.46 +#define P_PRE 0 // plugin function called before gamedll
50.47 +#define P_POST 1 // plugin function called after gamedll
50.48 +
50.49 +
50.50 +typedef struct api_info_s {
50.51 + mBOOL trace; // if true, log info about this function
50.52 + int loglevel; // level at which to log info about this function
50.53 + char *name; // string representation of function name
50.54 +} api_info_t;
50.55 +
50.56 +
50.57 +// DLL api functions
50.58 +typedef struct dllapi_info_s {
50.59 + api_info_t pfnGameInit;
50.60 + api_info_t pfnSpawn;
50.61 + api_info_t pfnThink;
50.62 + api_info_t pfnUse;
50.63 + api_info_t pfnTouch;
50.64 + api_info_t pfnBlocked;
50.65 + api_info_t pfnKeyValue;
50.66 + api_info_t pfnSave;
50.67 + api_info_t pfnRestore;
50.68 + api_info_t pfnSetAbsBox;
50.69 + api_info_t pfnSaveWriteFields;
50.70 + api_info_t pfnSaveReadFields;
50.71 + api_info_t pfnSaveGlobalState;
50.72 + api_info_t pfnRestoreGlobalState;
50.73 + api_info_t pfnResetGlobalState;
50.74 + api_info_t pfnClientConnect;
50.75 + api_info_t pfnClientDisconnect;
50.76 + api_info_t pfnClientKill;
50.77 + api_info_t pfnClientPutInServer;
50.78 + api_info_t pfnClientCommand;
50.79 + api_info_t pfnClientUserInfoChanged;
50.80 + api_info_t pfnServerActivate;
50.81 + api_info_t pfnServerDeactivate;
50.82 + api_info_t pfnPlayerPreThink;
50.83 + api_info_t pfnPlayerPostThink;
50.84 + api_info_t pfnStartFrame;
50.85 + api_info_t pfnParmsNewLevel;
50.86 + api_info_t pfnParmsChangeLevel;
50.87 + api_info_t pfnGetGameDescription;
50.88 + api_info_t pfnPlayerCustomization;
50.89 + api_info_t pfnSpectatorConnect;
50.90 + api_info_t pfnSpectatorDisconnect;
50.91 + api_info_t pfnSpectatorThink;
50.92 + api_info_t pfnSys_Error;
50.93 + api_info_t pfnPM_Move;
50.94 + api_info_t pfnPM_Init;
50.95 + api_info_t pfnPM_FindTextureType;
50.96 + api_info_t pfnSetupVisibility;
50.97 + api_info_t pfnUpdateClientData;
50.98 + api_info_t pfnAddToFullPack;
50.99 + api_info_t pfnCreateBaseline;
50.100 + api_info_t pfnRegisterEncoders;
50.101 + api_info_t pfnGetWeaponData;
50.102 + api_info_t pfnCmdStart;
50.103 + api_info_t pfnCmdEnd;
50.104 + api_info_t pfnConnectionlessPacket;
50.105 + api_info_t pfnGetHullBounds;
50.106 + api_info_t pfnCreateInstancedBaselines;
50.107 + api_info_t pfnInconsistentFile;
50.108 + api_info_t pfnAllowLagCompensation;
50.109 + api_info_t END;
50.110 +} dllapi_info_t;
50.111 +
50.112 +
50.113 +// "New" api functions
50.114 +typedef struct newapi_info_s {
50.115 + api_info_t pfnOnFreeEntPrivateData;
50.116 + api_info_t pfnGameShutdown;
50.117 + api_info_t pfnShouldCollide;
50.118 + api_info_t END;
50.119 +} newapi_info_t;
50.120 +
50.121 +
50.122 +// Engine functions
50.123 +typedef struct engine_info_s {
50.124 + api_info_t pfnPrecacheModel;
50.125 + api_info_t pfnPrecacheSound;
50.126 + api_info_t pfnSetModel;
50.127 + api_info_t pfnModelIndex;
50.128 + api_info_t pfnModelFrames;
50.129 + api_info_t pfnSetSize;
50.130 + api_info_t pfnChangeLevel;
50.131 + api_info_t pfnGetSpawnParms;
50.132 + api_info_t pfnSaveSpawnParms;
50.133 + api_info_t pfnVecToYaw;
50.134 + api_info_t pfnVecToAngles;
50.135 + api_info_t pfnMoveToOrigin;
50.136 + api_info_t pfnChangeYaw;
50.137 + api_info_t pfnChangePitch;
50.138 + api_info_t pfnFindEntityByString;
50.139 + api_info_t pfnGetEntityIllum;
50.140 + api_info_t pfnFindEntityInSphere;
50.141 + api_info_t pfnFindClientInPVS;
50.142 + api_info_t pfnEntitiesInPVS;
50.143 + api_info_t pfnMakeVectors;
50.144 + api_info_t pfnAngleVectors;
50.145 + api_info_t pfnCreateEntity;
50.146 + api_info_t pfnRemoveEntity;
50.147 + api_info_t pfnCreateNamedEntity;
50.148 + api_info_t pfnMakeStatic;
50.149 + api_info_t pfnEntIsOnFloor;
50.150 + api_info_t pfnDropToFloor;
50.151 + api_info_t pfnWalkMove;
50.152 + api_info_t pfnSetOrigin;
50.153 + api_info_t pfnEmitSound;
50.154 + api_info_t pfnEmitAmbientSound;
50.155 + api_info_t pfnTraceLine;
50.156 + api_info_t pfnTraceToss;
50.157 + api_info_t pfnTraceMonsterHull;
50.158 + api_info_t pfnTraceHull;
50.159 + api_info_t pfnTraceModel;
50.160 + api_info_t pfnTraceTexture;
50.161 + api_info_t pfnTraceSphere;
50.162 + api_info_t pfnGetAimVector;
50.163 + api_info_t pfnServerCommand;
50.164 + api_info_t pfnServerExecute;
50.165 + api_info_t pfnClientCommand;
50.166 + api_info_t pfnParticleEffect;
50.167 + api_info_t pfnLightStyle;
50.168 + api_info_t pfnDecalIndex;
50.169 + api_info_t pfnPointContents;
50.170 + api_info_t pfnMessageBegin;
50.171 + api_info_t pfnMessageEnd;
50.172 + api_info_t pfnWriteByte;
50.173 + api_info_t pfnWriteChar;
50.174 + api_info_t pfnWriteShort;
50.175 + api_info_t pfnWriteLong;
50.176 + api_info_t pfnWriteAngle;
50.177 + api_info_t pfnWriteCoord;
50.178 + api_info_t pfnWriteString;
50.179 + api_info_t pfnWriteEntity;
50.180 + api_info_t pfnCVarRegister;
50.181 + api_info_t pfnCVarGetFloat;
50.182 + api_info_t pfnCVarGetString;
50.183 + api_info_t pfnCVarSetFloat;
50.184 + api_info_t pfnCVarSetString;
50.185 + api_info_t pfnAlertMessage;
50.186 + api_info_t pfnEngineFprintf;
50.187 + api_info_t pfnPvAllocEntPrivateData;
50.188 + api_info_t pfnPvEntPrivateData;
50.189 + api_info_t pfnFreeEntPrivateData;
50.190 + api_info_t pfnSzFromIndex;
50.191 + api_info_t pfnAllocString;
50.192 + api_info_t pfnGetVarsOfEnt;
50.193 + api_info_t pfnPEntityOfEntOffset;
50.194 + api_info_t pfnEntOffsetOfPEntity;
50.195 + api_info_t pfnIndexOfEdict;
50.196 + api_info_t pfnPEntityOfEntIndex;
50.197 + api_info_t pfnFindEntityByVars;
50.198 + api_info_t pfnGetModelPtr;
50.199 + api_info_t pfnRegUserMsg;
50.200 + api_info_t pfnAnimationAutomove;
50.201 + api_info_t pfnGetBonePosition;
50.202 + api_info_t pfnFunctionFromName;
50.203 + api_info_t pfnNameForFunction;
50.204 + api_info_t pfnClientPrintf;
50.205 + api_info_t pfnServerPrint;
50.206 + api_info_t pfnCmd_Args;
50.207 + api_info_t pfnCmd_Argv;
50.208 + api_info_t pfnCmd_Argc;
50.209 + api_info_t pfnGetAttachment;
50.210 + api_info_t pfnCRC32_Init;
50.211 + api_info_t pfnCRC32_ProcessBuffer;
50.212 + api_info_t pfnCRC32_ProcessByte;
50.213 + api_info_t pfnCRC32_Final;
50.214 + api_info_t pfnRandomLong;
50.215 + api_info_t pfnRandomFloat;
50.216 + api_info_t pfnSetView;
50.217 + api_info_t pfnTime;
50.218 + api_info_t pfnCrosshairAngle;
50.219 + api_info_t pfnLoadFileForMe;
50.220 + api_info_t pfnFreeFile;
50.221 + api_info_t pfnEndSection;
50.222 + api_info_t pfnCompareFileTime;
50.223 + api_info_t pfnGetGameDir;
50.224 + api_info_t pfnCvar_RegisterVariable;
50.225 + api_info_t pfnFadeClientVolume;
50.226 + api_info_t pfnSetClientMaxspeed;
50.227 + api_info_t pfnCreateFakeClient;
50.228 + api_info_t pfnRunPlayerMove;
50.229 + api_info_t pfnNumberOfEntities;
50.230 + api_info_t pfnGetInfoKeyBuffer;
50.231 + api_info_t pfnInfoKeyValue;
50.232 + api_info_t pfnSetKeyValue;
50.233 + api_info_t pfnSetClientKeyValue;
50.234 + api_info_t pfnIsMapValid;
50.235 + api_info_t pfnStaticDecal;
50.236 + api_info_t pfnPrecacheGeneric;
50.237 + api_info_t pfnGetPlayerUserId;
50.238 + api_info_t pfnBuildSoundMsg;
50.239 + api_info_t pfnIsDedicatedServer;
50.240 + api_info_t pfnCVarGetPointer;
50.241 + api_info_t pfnGetPlayerWONId;
50.242 + api_info_t pfnInfo_RemoveKey;
50.243 + api_info_t pfnGetPhysicsKeyValue;
50.244 + api_info_t pfnSetPhysicsKeyValue;
50.245 + api_info_t pfnGetPhysicsInfoString;
50.246 + api_info_t pfnPrecacheEvent;
50.247 + api_info_t pfnPlaybackEvent;
50.248 + api_info_t pfnSetFatPVS;
50.249 + api_info_t pfnSetFatPAS;
50.250 + api_info_t pfnCheckVisibility;
50.251 + api_info_t pfnDeltaSetField;
50.252 + api_info_t pfnDeltaUnsetField;
50.253 + api_info_t pfnDeltaAddEncoder;
50.254 + api_info_t pfnGetCurrentPlayer;
50.255 + api_info_t pfnCanSkipPlayer;
50.256 + api_info_t pfnDeltaFindField;
50.257 + api_info_t pfnDeltaSetFieldByIndex;
50.258 + api_info_t pfnDeltaUnsetFieldByIndex;
50.259 + api_info_t pfnSetGroupMask;
50.260 + api_info_t pfnCreateInstancedBaseline;
50.261 + api_info_t pfnCvar_DirectSet;
50.262 + api_info_t pfnForceUnmodified;
50.263 + api_info_t pfnGetPlayerStats;
50.264 + api_info_t pfnAddServerCommand;
50.265 + // Added in SDK 2.2:
50.266 + api_info_t pfnVoice_GetClientListening;
50.267 + api_info_t pfnVoice_SetClientListening;
50.268 + // Added for HL 1109 (no SDK update):
50.269 + api_info_t pfnGetPlayerAuthId;
50.270 + // Added 2003/11/10 (no SDK update):
50.271 + api_info_t pfnSequenceGet;
50.272 + api_info_t pfnSequencePickSentence;
50.273 + api_info_t pfnGetFileSize;
50.274 + api_info_t pfnGetApproxWavePlayLen;
50.275 + api_info_t pfnIsCareerMatch;
50.276 + api_info_t pfnGetLocalizedStringLength;
50.277 + api_info_t pfnRegisterTutorMessageShown;
50.278 + api_info_t pfnGetTimesTutorMessageShown;
50.279 + api_info_t pfnProcessTutorMessageDecayBuffer;
50.280 + api_info_t pfnConstructTutorMessageDecayBuffer;
50.281 + api_info_t pfnResetTutorMessageDecayData;
50.282 + // end
50.283 + api_info_t END;
50.284 +} engine_info_t;
50.285 +
50.286 +
50.287 +extern dllapi_info_t dllapi_info;
50.288 +extern newapi_info_t newapi_info;
50.289 +extern engine_info_t engine_info;
50.290 +
50.291 +#endif /* API_INFO_H */
51.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
51.2 +++ b/metamod/commands_meta.cpp Tue Apr 06 07:36:14 2004 +0000
51.3 @@ -0,0 +1,465 @@
51.4 +// vi: set ts=4 sw=4 :
51.5 +// vim: set tw=75 :
51.6 +
51.7 +// commands_meta.cpp - implementation of various console commands
51.8 +
51.9 +/*
51.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
51.11 + *
51.12 + * This file is part of Metamod.
51.13 + *
51.14 + * Metamod is free software; you can redistribute it and/or modify it
51.15 + * under the terms of the GNU General Public License as published by the
51.16 + * Free Software Foundation; either version 2 of the License, or (at
51.17 + * your option) any later version.
51.18 + *
51.19 + * Metamod is distributed in the hope that it will be useful, but
51.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
51.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
51.22 + * General Public License for more details.
51.23 + *
51.24 + * You should have received a copy of the GNU General Public License
51.25 + * along with Metamod; if not, write to the Free Software Foundation,
51.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
51.27 + *
51.28 + * In addition, as a special exception, the author gives permission to
51.29 + * link the code of this program with the Half-Life Game Engine ("HL
51.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
51.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
51.32 + * respects for all of the code used other than the HL Engine and MODs
51.33 + * from Valve. If you modify this file, you may extend this exception
51.34 + * to your version of the file, but you are not obligated to do so. If
51.35 + * you do not wish to do so, delete this exception statement from your
51.36 + * version.
51.37 + *
51.38 + */
51.39 +
51.40 +#include <ctype.h> // isdigit()
51.41 +
51.42 +#include <extdll.h> // always
51.43 +
51.44 +#include "commands_meta.h" // me
51.45 +#include "metamod.h" // Plugins, etc
51.46 +#include "log_meta.h" // META_CONS, etc
51.47 +#include "info_name.h" // VNAME, etc
51.48 +#include "vdate.h" // COMPILE_TIME
51.49 +
51.50 +
51.51 +// Register commands and cvars.
51.52 +void meta_register_cmdcvar() {
51.53 + CVAR_REGISTER(&meta_debug);
51.54 + CVAR_REGISTER(&meta_version);
51.55 + REG_SVR_COMMAND("meta", svr_meta);
51.56 +}
51.57 +
51.58 +// Parse "meta" console command.
51.59 +void svr_meta(void) {
51.60 + const char *cmd;
51.61 + cmd=CMD_ARGV(1);
51.62 + // arguments: none
51.63 + if(!strcasecmp(cmd, "version"))
51.64 + cmd_meta_version();
51.65 + else if(!strcasecmp(cmd, "gpl"))
51.66 + cmd_meta_gpl();
51.67 + else if(!strcasecmp(cmd, "refresh"))
51.68 + cmd_meta_refresh();
51.69 + else if(!strcasecmp(cmd, "list"))
51.70 + cmd_meta_pluginlist();
51.71 + else if(!strcasecmp(cmd, "cmds"))
51.72 + cmd_meta_cmdlist();
51.73 + else if(!strcasecmp(cmd, "cvars"))
51.74 + cmd_meta_cvarlist();
51.75 + else if(!strcasecmp(cmd, "game"))
51.76 + cmd_meta_game();
51.77 + else if(!strcasecmp(cmd, "config"))
51.78 + cmd_meta_config();
51.79 + // arguments: existing plugin(s)
51.80 + else if(!strcasecmp(cmd, "pause"))
51.81 + cmd_doplug(PC_PAUSE);
51.82 + else if(!strcasecmp(cmd, "unpause"))
51.83 + cmd_doplug(PC_UNPAUSE);
51.84 + else if(!strcasecmp(cmd, "unload"))
51.85 + cmd_doplug(PC_UNLOAD);
51.86 + else if(!strcasecmp(cmd, "force_unload"))
51.87 + cmd_doplug(PC_FORCE_UNLOAD);
51.88 + else if(!strcasecmp(cmd, "reload"))
51.89 + cmd_doplug(PC_RELOAD);
51.90 + else if(!strcasecmp(cmd, "retry"))
51.91 + cmd_doplug(PC_RETRY);
51.92 + else if(!strcasecmp(cmd, "clear"))
51.93 + cmd_doplug(PC_CLEAR);
51.94 + else if(!strcasecmp(cmd, "info"))
51.95 + cmd_doplug(PC_INFO);
51.96 + else if(!strcasecmp(cmd, "require"))
51.97 + cmd_doplug(PC_REQUIRE);
51.98 + // arguments: filename, description
51.99 + else if(!strcasecmp(cmd, "load"))
51.100 + cmd_meta_load();
51.101 + // unrecognized
51.102 + else {
51.103 + META_CONS("Unrecognized meta command: %s", cmd);
51.104 + cmd_meta_usage();
51.105 + return;
51.106 + }
51.107 +}
51.108 +
51.109 +// Parse "meta" client command.
51.110 +void client_meta(edict_t *pEntity) {
51.111 + const char *cmd;
51.112 + cmd=CMD_ARGV(1);
51.113 + META_LOG("ClientCommand 'meta %s' from player '%s'",
51.114 + CMD_ARGS(), STRING(pEntity->v.netname));
51.115 + // arguments: none
51.116 + if(strmatch(cmd, "version"))
51.117 + client_meta_version(pEntity);
51.118 + else if(strmatch(cmd, "list"))
51.119 + client_meta_pluginlist(pEntity);
51.120 + // unrecognized
51.121 + else {
51.122 + META_CLIENT(pEntity, "Unrecognized meta command: %s", cmd);
51.123 + client_meta_usage(pEntity);
51.124 + return;
51.125 + }
51.126 +}
51.127 +
51.128 +// Print usage for "meta" console command.
51.129 +void cmd_meta_usage(void) {
51.130 + META_CONS("usage: meta <command> [<arguments>]");
51.131 + META_CONS("valid commands are:");
51.132 + META_CONS(" version - display metamod version info");
51.133 + META_CONS(" game - display gamedll info");
51.134 + META_CONS(" list - list plugins currently loaded");
51.135 + META_CONS(" cmds - list console cmds registered by plugins");
51.136 + META_CONS(" cvars - list cvars registered by plugins");
51.137 + META_CONS(" refresh - load/unload any new/deleted/updated plugins");
51.138 + META_CONS(" config - show config info loaded from config.ini");
51.139 + META_CONS(" load <name> - find and load a plugin with the given name");
51.140 + META_CONS(" unload <plugin> - unload a loaded plugin");
51.141 + META_CONS(" reload <plugin> - unload a plugin and load it again");
51.142 + META_CONS(" info <plugin> - show all information about a plugin");
51.143 + META_CONS(" pause <plugin> - pause a loaded, running plugin");
51.144 + META_CONS(" unpause <plugin> - unpause a previously paused plugin");
51.145 + META_CONS(" retry <plugin> - retry a plugin that previously failed its action");
51.146 + META_CONS(" clear <plugin> - clear a failed plugin from the list");
51.147 + META_CONS(" force_unload <plugin> - forcibly unload a loaded plugin");
51.148 + META_CONS(" require <plugin> - exit server if plugin not loaded/running");
51.149 +}
51.150 +
51.151 +// Print usage for "meta" client command.
51.152 +void client_meta_usage(edict_t *pEntity) {
51.153 + META_CLIENT(pEntity, "usage: meta <command> [<arguments>]");
51.154 + META_CLIENT(pEntity, "valid commands are:");
51.155 + META_CLIENT(pEntity, " version - display metamod version info");
51.156 + META_CLIENT(pEntity, " list - list plugins currently loaded");
51.157 +}
51.158 +
51.159 +// "meta version" console command.
51.160 +void cmd_meta_version(void) {
51.161 + if(CMD_ARGC() != 2) {
51.162 + META_CONS("usage: meta version");
51.163 + return;
51.164 + }
51.165 + META_CONS("%s v%s %s", VNAME, VVERSION, VDATE);
51.166 + META_CONS("by %s", VAUTHOR);
51.167 + META_CONS(" %s", VURL);
51.168 + META_CONS("compiled: %s Eastern (%s)", COMPILE_TIME, OPT_TYPE);
51.169 +}
51.170 +
51.171 +// "meta version" client command.
51.172 +void client_meta_version(edict_t *pEntity) {
51.173 + if(CMD_ARGC() != 2) {
51.174 + META_CLIENT(pEntity, "usage: meta version");
51.175 + return;
51.176 + }
51.177 + META_CLIENT(pEntity, "%s v%s %s", VNAME, VVERSION, VDATE);
51.178 + META_CLIENT(pEntity, "by %s", VAUTHOR);
51.179 + META_CLIENT(pEntity, " %s", VURL);
51.180 + META_CLIENT(pEntity, "compiled: %s Eastern (%s)", COMPILE_TIME, OPT_TYPE);
51.181 +}
51.182 +
51.183 +// "meta gpl" console command.
51.184 +void cmd_meta_gpl(void) {
51.185 + META_CONS("%s version %s %s", VNAME, VVERSION, VDATE);
51.186 + META_CONS("Copyright (c) 2001-2003 Will Day <[email protected]>");
51.187 + META_CONS("");
51.188 + META_CONS(" Metamod is free software; you can redistribute it and/or");
51.189 + META_CONS(" modify it under the terms of the GNU General Public License");
51.190 + META_CONS(" as published by the Free Software Foundation; either");
51.191 + META_CONS(" version 2 of the License, or (at your option) any later");
51.192 + META_CONS(" version.");
51.193 + META_CONS(" ");
51.194 + META_CONS(" Metamod is distributed in the hope that it will be useful,");
51.195 + META_CONS(" but WITHOUT ANY WARRANTY; without even the implied warranty");
51.196 + META_CONS(" of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.");
51.197 + META_CONS(" See the GNU General Public License for more details.");
51.198 + META_CONS(" ");
51.199 + META_CONS(" You should have received a copy of the GNU General Public");
51.200 + META_CONS(" License along with Metamod; if not, write to the Free");
51.201 + META_CONS(" Software Foundation, Inc., 59 Temple Place, Suite 330,");
51.202 + META_CONS(" Boston, MA 02111-1307 USA");
51.203 + META_CONS(" ");
51.204 + META_CONS(" In addition, as a special exception, the author gives");
51.205 + META_CONS(" permission to link the code of this program with the");
51.206 + META_CONS(" Half-Life Game Engine (\"HL Engine\") and Modified Game");
51.207 + META_CONS(" Libraries (\"MODs\") developed by Valve, L.L.C (\"Valve\").");
51.208 + META_CONS(" You must obey the GNU General Public License in all");
51.209 + META_CONS(" respects for all of the code used other than the HL Engine");
51.210 + META_CONS(" and MODs from Valve. If you modify this file, you may");
51.211 + META_CONS(" extend this exception to your version of the file, but you");
51.212 + META_CONS(" are not obligated to do so. If you do not wish to do so,");
51.213 + META_CONS(" delete this exception statement from your version.");
51.214 +}
51.215 +
51.216 +// "meta game" console command.
51.217 +void cmd_meta_game(void) {
51.218 + if(CMD_ARGC() != 2) {
51.219 + META_CONS("usage: meta game");
51.220 + return;
51.221 + }
51.222 + META_CONS("GameDLL info:");
51.223 + META_CONS(" name: %s", GameDLL.name);
51.224 + META_CONS(" desc: %s", GameDLL.desc);
51.225 + META_CONS(" gamedir: %s", GameDLL.gamedir);
51.226 + META_CONS(" dll file: %s", GameDLL.file);
51.227 + META_CONS("dll pathname: %s", GameDLL.pathname);
51.228 + RegMsgs->show();
51.229 +}
51.230 +
51.231 +// "meta refresh" console command.
51.232 +void cmd_meta_refresh(void) {
51.233 + if(CMD_ARGC() != 2) {
51.234 + META_CONS("usage: meta refresh");
51.235 + return;
51.236 + }
51.237 + META_LOG("Refreshing the plugins on demand...");
51.238 + if(Plugins->refresh(PT_ANYTIME) != mTRUE) {
51.239 + META_LOG("Refresh failed.");
51.240 + }
51.241 +}
51.242 +
51.243 +// "meta list" console command.
51.244 +void cmd_meta_pluginlist(void) {
51.245 + if(CMD_ARGC() != 2) {
51.246 + META_CONS("usage: meta list");
51.247 + return;
51.248 + }
51.249 + Plugins->show();
51.250 +}
51.251 +
51.252 +// "meta list" client command.
51.253 +void client_meta_pluginlist(edict_t *pEntity) {
51.254 + if(CMD_ARGC() != 2) {
51.255 + META_CLIENT(pEntity, "usage: meta list");
51.256 + return;
51.257 + }
51.258 + Plugins->show_client(pEntity);
51.259 +}
51.260 +
51.261 +// "meta cmds" console command.
51.262 +void cmd_meta_cmdlist(void) {
51.263 + if(CMD_ARGC() != 2) {
51.264 + META_CONS("usage: meta cmds");
51.265 + return;
51.266 + }
51.267 + RegCmds->show();
51.268 +}
51.269 +
51.270 +// "meta cvars" console command.
51.271 +void cmd_meta_cvarlist(void) {
51.272 + if(CMD_ARGC() != 2) {
51.273 + META_CONS("usage: meta cvars");
51.274 + return;
51.275 + }
51.276 + RegCvars->show();
51.277 +}
51.278 +
51.279 +// "meta config" console command.
51.280 +void cmd_meta_config(void) {
51.281 + if(CMD_ARGC() != 2) {
51.282 + META_CONS("usage: meta cvars");
51.283 + return;
51.284 + }
51.285 + Config->show();
51.286 +}
51.287 +
51.288 +// gamedir/filename
51.289 +// gamedir/dlls/filename
51.290 +//
51.291 +// dir/mm_file
51.292 +// dir/file
51.293 +//
51.294 +// path
51.295 +// path_mm
51.296 +// path_MM
51.297 +// path.so, path.dll
51.298 +// path_i386.so, path_i486.so, etc
51.299 +
51.300 +// "meta load" console command.
51.301 +void cmd_meta_load(void) {
51.302 + int argc;
51.303 + const char *args;
51.304 + argc=CMD_ARGC();
51.305 + if(argc < 3) {
51.306 + META_CONS("usage: meta load <name> [<description>]");
51.307 + META_CONS(" where <name> is an identifier used to locate the plugin file.");
51.308 + META_CONS(" The system will look for a number of files based on this name, including:");
51.309 + META_CONS(" name");
51.310 +#ifdef linux
51.311 + META_CONS(" name.so");
51.312 + META_CONS(" name_mm.so");
51.313 + META_CONS(" name_MM.so");
51.314 + META_CONS(" mm_name.so");
51.315 + META_CONS(" name_i386.so");
51.316 + META_CONS(" name_i686.so");
51.317 +#elif defined(_WIN32)
51.318 + META_CONS(" name.dll");
51.319 + META_CONS(" name_mm.dll");
51.320 + META_CONS(" mm_name.dll");
51.321 +#endif /* linux */
51.322 + META_CONS(" in a number of directories, including:");
51.323 + META_CONS(" <gamedir>");
51.324 + META_CONS(" <gamedir>/dlls");
51.325 + META_CONS(" <given path, if absolute>");
51.326 + return;
51.327 + }
51.328 + args=CMD_ARGS();
51.329 + // cmd_addload() handles all the feedback to the console..
51.330 + Plugins->cmd_addload(args);
51.331 +}
51.332 +
51.333 +// Handle various console commands that refer to a known/loaded plugin.
51.334 +void cmd_doplug(PLUG_CMD pcmd) {
51.335 + int i=0, argc;
51.336 + const char *cmd, *arg;
51.337 + MPlugin *findp;
51.338 +
51.339 + argc=CMD_ARGC();
51.340 + cmd=CMD_ARGV(1);
51.341 + if(argc < 3) {
51.342 + META_CONS("usage: meta %s <plugin> [<plugin> ...]", cmd);
51.343 + META_CONS(" where <plugin> can be either the plugin index #");
51.344 + META_CONS(" or a non-ambiguous prefix string matching name, desc, file, or logtag");
51.345 + return;
51.346 + }
51.347 + // i=2 to skip first arg, as that's the "cmd"
51.348 + for(i=2; i < argc; i++) {
51.349 + arg=CMD_ARGV(i);
51.350 +
51.351 + // try to match plugin id first
51.352 + if(isdigit(arg[0]))
51.353 + findp=Plugins->find(atoi(arg));
51.354 + // else try to match some string (prefix)
51.355 + else
51.356 + findp=Plugins->find_match(arg);
51.357 +
51.358 + // Require that:
51.359 + // - specified plugin was found in the list of current plugins
51.360 + // - plugin successfully loaded and began running
51.361 + // Otherwise, print error and exit.
51.362 + if(pcmd==PC_REQUIRE) {
51.363 + if(findp && findp->status >= PL_RUNNING) {
51.364 + META_DEBUG(3, ("Required plugin '%s' found loaded and running.",
51.365 + arg));
51.366 + return;
51.367 + }
51.368 + // Output to both places, because we don't want the admin
51.369 + // to miss this..
51.370 + if(!findp && meta_errno == ME_NOTUNIQ) {
51.371 + META_ERROR("Unique match for required plugin '%s' was not found! Exiting.", arg);
51.372 + META_CONS("\nERROR: Unique match for required plugin '%s' was not found! Exiting.\n", arg);
51.373 + }
51.374 + else if (!findp) {
51.375 + META_ERROR("Required plugin '%s' was not found! Exiting.",
51.376 + arg);
51.377 + META_CONS("\nERROR: Required plugin '%s' was not found! Exiting.\n",
51.378 + arg);
51.379 + }
51.380 + else {
51.381 + META_ERROR("Required plugin '%s' did not load successfully! (status=%s) Exiting.", arg, findp->str_status(ST_SIMPLE));
51.382 + META_CONS("\nERROR: Required plugin '%s' did not load successfully! (status=%s) Exiting.\n", arg, findp->str_status(ST_SIMPLE));
51.383 + }
51.384 + // Allow chance to read the message, before any window closes.
51.385 + sleep(1);
51.386 +#ifdef linux
51.387 + // Argh, "quit" appears to segfault the server under linux; I
51.388 + // was unable to determine why.
51.389 + exit(1);
51.390 +#else
51.391 + // Argh, and exit() appears to generate an "Application Error"
51.392 + // under MSVC. Interestingly, both seem to work fine with
51.393 + // mingw32.
51.394 + SERVER_COMMAND("quit\n");
51.395 +#endif /* not linux */
51.396 + }
51.397 +
51.398 + if(!findp) {
51.399 + if(meta_errno == ME_NOTUNIQ)
51.400 + META_CONS("Couldn't find unique plugin matching '%s'", arg);
51.401 + else
51.402 + META_CONS("Couldn't find plugin matching '%s'", arg);
51.403 + return;
51.404 + }
51.405 +
51.406 + if(pcmd==PC_PAUSE) {
51.407 + if(findp->pause())
51.408 + META_CONS("Paused plugin '%s'", findp->desc);
51.409 + else
51.410 + META_CONS("Pause failed for plugin '%s'", findp->desc);
51.411 + }
51.412 + else if(pcmd==PC_UNPAUSE) {
51.413 + if(findp->unpause())
51.414 + META_CONS("Unpaused plugin '%s'", findp->desc);
51.415 + else
51.416 + META_CONS("Unpause failed for plugin '%s'", findp->desc);
51.417 + }
51.418 + else if(pcmd==PC_UNLOAD) {
51.419 + findp->action=PA_UNLOAD;
51.420 + if(findp->unload(PT_ANYTIME, PNL_COMMAND)) {
51.421 + META_CONS("Unloaded plugin '%s'", findp->desc);
51.422 + Plugins->show();
51.423 + }
51.424 + else if(meta_errno == ME_DELAYED)
51.425 + META_CONS("Unload delayed for plugin '%s'", findp->desc);
51.426 + else
51.427 + META_CONS("Unload failed for plugin '%s'", findp->desc);
51.428 + }
51.429 + else if(pcmd==PC_FORCE_UNLOAD) {
51.430 + findp->action=PA_UNLOAD;
51.431 + if(findp->unload(PT_ANYTIME, PNL_CMD_FORCED)) {
51.432 + META_CONS("Forced unload plugin '%s'", findp->desc);
51.433 + Plugins->show();
51.434 + }
51.435 + else
51.436 + META_CONS("Forced unload failed for plugin '%s'", findp->desc);
51.437 + }
51.438 + else if(pcmd==PC_RELOAD) {
51.439 + findp->action=PA_RELOAD;
51.440 + if(findp->reload(PT_ANYTIME, PNL_COMMAND))
51.441 + META_CONS("Reloaded plugin '%s'", findp->desc);
51.442 + else if(meta_errno == ME_DELAYED)
51.443 + META_CONS("Reload delayed for plugin '%s'", findp->desc);
51.444 + else
51.445 + META_CONS("Reload failed for plugin '%s'", findp->desc);
51.446 + }
51.447 + else if(pcmd==PC_RETRY) {
51.448 + if(findp->retry(PT_ANYTIME, PNL_COMMAND))
51.449 + META_CONS("Retry succeeded for plugin '%s'", findp->desc);
51.450 + else
51.451 + META_CONS("Retry failed for plugin '%s'", findp->desc);
51.452 + }
51.453 + else if(pcmd==PC_CLEAR) {
51.454 + if(findp->clear()) {
51.455 + META_CONS("Cleared failed plugin '%s' from list", findp->desc);
51.456 + Plugins->show();
51.457 + }
51.458 + else
51.459 + META_CONS("Clear failed for plugin '%s'", findp->desc);
51.460 + }
51.461 + else if(pcmd==PC_INFO)
51.462 + findp->show();
51.463 + else {
51.464 + META_ERROR("Unexpected plug_cmd: %d", pcmd);
51.465 + META_CONS("Command failed; see log");
51.466 + }
51.467 + }
51.468 +}
52.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
52.2 +++ b/metamod/commands_meta.h Tue Apr 06 07:36:14 2004 +0000
52.3 @@ -0,0 +1,81 @@
52.4 +// vi: set ts=4 sw=4 :
52.5 +// vim: set tw=75 :
52.6 +
52.7 +// commands_meta.h - prototypes for console commands
52.8 +
52.9 +/*
52.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
52.11 + *
52.12 + * This file is part of Metamod.
52.13 + *
52.14 + * Metamod is free software; you can redistribute it and/or modify it
52.15 + * under the terms of the GNU General Public License as published by the
52.16 + * Free Software Foundation; either version 2 of the License, or (at
52.17 + * your option) any later version.
52.18 + *
52.19 + * Metamod is distributed in the hope that it will be useful, but
52.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
52.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
52.22 + * General Public License for more details.
52.23 + *
52.24 + * You should have received a copy of the GNU General Public License
52.25 + * along with Metamod; if not, write to the Free Software Foundation,
52.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
52.27 + *
52.28 + * In addition, as a special exception, the author gives permission to
52.29 + * link the code of this program with the Half-Life Game Engine ("HL
52.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
52.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
52.32 + * respects for all of the code used other than the HL Engine and MODs
52.33 + * from Valve. If you modify this file, you may extend this exception
52.34 + * to your version of the file, but you are not obligated to do so. If
52.35 + * you do not wish to do so, delete this exception statement from your
52.36 + * version.
52.37 + *
52.38 + */
52.39 +
52.40 +#ifndef COMMANDS_META_H
52.41 +#define COMMANDS_META_H
52.42 +
52.43 +#include "types_meta.h" // mBOOL
52.44 +
52.45 +// Flags to use for meta_cmd_doplug(), to operate on existing plugins; note
52.46 +// "load" operates on a non-existing plugin thus isn't included here.
52.47 +typedef enum {
52.48 + PC_NULL = 0,
52.49 + PC_PAUSE, // pause the plugin
52.50 + PC_UNPAUSE, // unpause the plugin
52.51 + PC_UNLOAD, // unload the plugin
52.52 + PC_RELOAD, // unload the plugin and load it again
52.53 + PC_RETRY, // retry a failed operation (usually load/attach)
52.54 + PC_INFO, // show all info about the plugin
52.55 + PC_CLEAR, // remove a failed plugin from the list
52.56 + PC_FORCE_UNLOAD, // forcibly unload the plugin
52.57 + PC_REQUIRE, // require that this plugin is loaded/running
52.58 +} PLUG_CMD;
52.59 +
52.60 +void meta_register_cmdcvar();
52.61 +
52.62 +void svr_meta(void);
52.63 +
52.64 +void cmd_meta_usage(void);
52.65 +void cmd_meta_version(void);
52.66 +void cmd_meta_gpl(void);
52.67 +
52.68 +void cmd_meta_game(void);
52.69 +void cmd_meta_refresh(void);
52.70 +void cmd_meta_load(void);
52.71 +
52.72 +void cmd_meta_pluginlist(void);
52.73 +void cmd_meta_cmdlist(void);
52.74 +void cmd_meta_cvarlist(void);
52.75 +void cmd_meta_config(void);
52.76 +
52.77 +void cmd_doplug(PLUG_CMD pcmd);
52.78 +
52.79 +void client_meta(edict_t *pEntity);
52.80 +void client_meta_usage(edict_t *pEntity);
52.81 +void client_meta_version(edict_t *pEntity);
52.82 +void client_meta_pluginlist(edict_t *pEntity);
52.83 +
52.84 +#endif /* COMMANDS_META_H */
53.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
53.2 +++ b/metamod/conf_meta.cpp Tue Apr 06 07:36:14 2004 +0000
53.3 @@ -0,0 +1,241 @@
53.4 +// vi: set ts=4 sw=4 :
53.5 +// vim: set tw=75 :
53.6 +
53.7 +// conf_meta.cpp - configfile reading routines
53.8 +
53.9 +/*
53.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
53.11 + *
53.12 + * This file is part of Metamod.
53.13 + *
53.14 + * Metamod is free software; you can redistribute it and/or modify it
53.15 + * under the terms of the GNU General Public License as published by the
53.16 + * Free Software Foundation; either version 2 of the License, or (at
53.17 + * your option) any later version.
53.18 + *
53.19 + * Metamod is distributed in the hope that it will be useful, but
53.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
53.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
53.22 + * General Public License for more details.
53.23 + *
53.24 + * You should have received a copy of the GNU General Public License
53.25 + * along with Metamod; if not, write to the Free Software Foundation,
53.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
53.27 + *
53.28 + * In addition, as a special exception, the author gives permission to
53.29 + * link the code of this program with the Half-Life Game Engine ("HL
53.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
53.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
53.32 + * respects for all of the code used other than the HL Engine and MODs
53.33 + * from Valve. If you modify this file, you may extend this exception
53.34 + * to your version of the file, but you are not obligated to do so. If
53.35 + * you do not wish to do so, delete this exception statement from your
53.36 + * version.
53.37 + *
53.38 + */
53.39 +
53.40 +#include <stdio.h> // FILE,
53.41 +#include <stdlib.h> // atoi
53.42 +#include <ctype.h> // isdigit
53.43 +
53.44 +#include <extdll.h> // always
53.45 +
53.46 +#include "conf_meta.h" // me
53.47 +#include "support_meta.h" // strmatch
53.48 +#include "osdep.h" // strtok,
53.49 +
53.50 +MConfig::MConfig(void)
53.51 + : list(NULL), filename(NULL), debuglevel(0), gamedll(NULL),
53.52 + plugins_file(NULL), exec_cfg(NULL)
53.53 +{
53.54 +}
53.55 +
53.56 +// Initialize default values from the stored options struct. Has to happen
53.57 +// _after_ constructor, so that all the fields are allocated (d'oh).
53.58 +void MConfig::init(option_t *global_options) {
53.59 + option_t *optp;
53.60 + list=global_options;
53.61 + for(optp=list; optp->name; optp++)
53.62 + set(optp, optp->init);
53.63 +}
53.64 +
53.65 +option_t *MConfig::find(char *lookup) {
53.66 + option_t *optp;
53.67 +
53.68 + for(optp=list; optp->name && !strmatch(optp->name, lookup); optp++);
53.69 + if(optp->name)
53.70 + return(optp);
53.71 + else
53.72 + RETURN_ERRNO(NULL, ME_NOTFOUND);
53.73 +}
53.74 +
53.75 +mBOOL MConfig::set(char *key, char *value) {
53.76 + option_t *optp;
53.77 + optp=find(key);
53.78 + if(optp)
53.79 + return(set(optp, value));
53.80 + else
53.81 + RETURN_ERRNO(mFALSE, ME_NOTFOUND);
53.82 +}
53.83 +
53.84 +mBOOL MConfig::set(option_t *setp, char *setstr) {
53.85 + char pathbuf[PATH_MAX];
53.86 + int *optval = (int *) setp->dest;
53.87 + char **optstr = (char **) setp->dest;
53.88 + // cvar_t *optcvar = (cvar_t *) setp->dest;
53.89 + // SETOPT_FN optcmd = (SETOPT_FN) setp->dest;
53.90 +
53.91 + if(!setstr)
53.92 + return(mTRUE);
53.93 +
53.94 + switch(setp->type) {
53.95 + case CF_INT:
53.96 + if(!isdigit(setstr[0])) {
53.97 + META_ERROR("option '%s' invalid format '%s'", setp->name,
53.98 + setstr);
53.99 + RETURN_ERRNO(mFALSE, ME_FORMAT);
53.100 + }
53.101 + *optval=atoi(setstr);
53.102 + META_DEBUG(3, ("set config int: %s = %d", setp->name, *optval));
53.103 + break;
53.104 + case CF_BOOL:
53.105 + if(strmatch(setstr, "true")
53.106 + || strmatch(setstr, "yes")
53.107 + || strmatch(setstr, "1"))
53.108 + {
53.109 + *optval=1;
53.110 + }
53.111 + else if(strmatch(setstr, "false")
53.112 + || strmatch(setstr, "no")
53.113 + || strmatch(setstr, "0"))
53.114 + {
53.115 + *optval=0;
53.116 + }
53.117 + else {
53.118 + META_ERROR("option '%s' invalid format '%s'", setp->name,
53.119 + setstr);
53.120 + RETURN_ERRNO(mFALSE, ME_FORMAT);
53.121 + }
53.122 + META_DEBUG(3, ("set config bool: %s = %s", setp->name,
53.123 + *optval ? "true" : "false"));
53.124 + break;
53.125 + case CF_STR:
53.126 + if(*optstr)
53.127 + free(*optstr);
53.128 + *optstr=strdup(setstr);
53.129 + META_DEBUG(3, ("set config string: %s = %s", setp->name, *optstr));
53.130 + break;
53.131 + case CF_PATH:
53.132 + if(*optstr)
53.133 + free(*optstr);
53.134 + full_gamedir_path(setstr, pathbuf);
53.135 + *optstr=strdup(pathbuf);
53.136 + META_DEBUG(3, ("set config path: %s = %s", setp->name, *optstr));
53.137 + break;
53.138 +#if 0
53.139 + case CF_CVAR:
53.140 + CVAR_SET_STRING(optcvar->name, setstr);
53.141 + META_DEBUG(3, ("set config cvar: %s = %s", optcvar->name, setstr));
53.142 + break;
53.143 + case CF_CMD:
53.144 + optcmd(setp->name, setstr);
53.145 + META_DEBUG(3, ("set config command: %s, %s",
53.146 + optcvar->name, setstr));
53.147 + break;
53.148 +#endif
53.149 + default:
53.150 + META_ERROR("unrecognized config type '%d'", setp->type);
53.151 + RETURN_ERRNO(mFALSE, ME_ARGUMENT);
53.152 + }
53.153 + return(mTRUE);
53.154 +}
53.155 +
53.156 +mBOOL MConfig::load(char *fn) {
53.157 + FILE *fp;
53.158 + char loadfile[PATH_MAX];
53.159 + char line[MAX_CONF_LEN];
53.160 + char *optname, *optval;
53.161 + option_t *optp;
53.162 + int ln;
53.163 +
53.164 + // Make full pathname (from gamedir if relative, collapse "..",
53.165 + // backslashes, etc).
53.166 + full_gamedir_path(fn, loadfile);
53.167 +
53.168 + fp=fopen(loadfile, "r");
53.169 + if(!fp) {
53.170 + META_ERROR("unable to open config file '%s': %s", loadfile,
53.171 + strerror(errno));
53.172 + RETURN_ERRNO(mFALSE, ME_NOFILE);
53.173 + }
53.174 +
53.175 + META_DEBUG(2, ("Loading from config file: %s", loadfile));
53.176 + for(ln=1; !feof(fp) && fgets(line, sizeof(line), fp); ln++) {
53.177 + if(line[0]=='#')
53.178 + continue;
53.179 + if(line[0]==';')
53.180 + continue;
53.181 + if(strnmatch(line, "//", 2))
53.182 + continue;
53.183 + if(!(optname=strtok(line, " \t\r\n"))) {
53.184 + META_ERROR("'%s' line %d: bad config format: missing option",
53.185 + loadfile, ln);
53.186 + continue;
53.187 + }
53.188 + if(!(optval=strtok(NULL, "\r\n"))) {
53.189 + META_ERROR("'%s' line %d: bad config format: missing value",
53.190 + loadfile, ln);
53.191 + continue;
53.192 + }
53.193 +
53.194 + if(!(optp=find(optname))) {
53.195 + META_ERROR("'%s' line %d: unknown option name '%s'",
53.196 + loadfile, ln, optname);
53.197 + continue;
53.198 + }
53.199 +
53.200 + if(!set(optp, optval)) {
53.201 + META_ERROR("'%s' line %d: unable to set option '%s' value '%s'",
53.202 + loadfile, ln, optname, optval);
53.203 + continue;
53.204 + }
53.205 + }
53.206 + filename=strdup(loadfile);
53.207 + fclose(fp);
53.208 + return(mTRUE);
53.209 +}
53.210 +
53.211 +void MConfig::show(void) {
53.212 + option_t *optp;
53.213 + META_CONS("Config options from localinfo and %s:", filename);
53.214 + for(optp=list; optp->name; optp++) {
53.215 + int *optval = (int *) optp->dest;
53.216 + char **optstr = (char **) optp->dest;
53.217 + // cvar_t *optcvar = (cvar_t *) optp->dest;
53.218 + // SETOPT_FN optcmd = (SETOPT_FN) optp->dest;
53.219 + switch(optp->type) {
53.220 + case CF_INT:
53.221 + printf(" %-20s\t%d\n", optp->name, *optval);
53.222 + break;
53.223 + case CF_BOOL:
53.224 + printf(" %-20s\t%s\n", optp->name,
53.225 + *optval ? "true" : "false");
53.226 + break;
53.227 + case CF_STR:
53.228 + case CF_PATH:
53.229 + printf(" %-20s\t%s\n", optp->name,
53.230 + *optstr ? *optstr : "");
53.231 + break;
53.232 +#if 0
53.233 + case CF_CVAR:
53.234 + printf(" %-20s\tstores in: %s\n", optp->name, optcvar->name);
53.235 + break;
53.236 + case CF_CMD:
53.237 + printf(" %-20s\tparsed by: %d\n", optp->name, (int) optcmd);
53.238 + break;
53.239 +#endif
53.240 + case CF_NONE:
53.241 + break;
53.242 + }
53.243 + }
53.244 +}
54.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
54.2 +++ b/metamod/conf_meta.h Tue Apr 06 07:36:14 2004 +0000
54.3 @@ -0,0 +1,96 @@
54.4 +// vi: set ts=4 sw=4 :
54.5 +// vim: set tw=75 :
54.6 +
54.7 +// conf_meta.h - configfile reading
54.8 +
54.9 +// Modeled after mutt/init.[ch].
54.10 +
54.11 +/*
54.12 + * Copyright (c) 2001-2003 Will Day <[email protected]>
54.13 + *
54.14 + * This file is part of Metamod.
54.15 + *
54.16 + * Metamod is free software; you can redistribute it and/or modify it
54.17 + * under the terms of the GNU General Public License as published by the
54.18 + * Free Software Foundation; either version 2 of the License, or (at
54.19 + * your option) any later version.
54.20 + *
54.21 + * Metamod is distributed in the hope that it will be useful, but
54.22 + * WITHOUT ANY WARRANTY; without even the implied warranty of
54.23 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
54.24 + * General Public License for more details.
54.25 + *
54.26 + * You should have received a copy of the GNU General Public License
54.27 + * along with Metamod; if not, write to the Free Software Foundation,
54.28 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
54.29 + *
54.30 + * In addition, as a special exception, the author gives permission to
54.31 + * link the code of this program with the Half-Life Game Engine ("HL
54.32 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
54.33 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
54.34 + * respects for all of the code used other than the HL Engine and MODs
54.35 + * from Valve. If you modify this file, you may extend this exception
54.36 + * to your version of the file, but you are not obligated to do so. If
54.37 + * you do not wish to do so, delete this exception statement from your
54.38 + * version.
54.39 + *
54.40 + */
54.41 +
54.42 +#ifndef CONF_META_H
54.43 +#define CONF_META_H
54.44 +
54.45 +#include "types_meta.h" // mBOOL
54.46 +
54.47 +// Max length of line in config file.
54.48 +#define MAX_CONF_LEN 1024
54.49 +
54.50 +// Supported config value-types.
54.51 +typedef enum {
54.52 + CF_NONE=0,
54.53 + CF_INT,
54.54 + CF_BOOL,
54.55 + CF_STR,
54.56 + CF_PATH,
54.57 +#if 0
54.58 + CF_CVAR,
54.59 + CF_CMD,
54.60 +#endif
54.61 +} cf_type_t;
54.62 +
54.63 +typedef mBOOL (*SETOPT_FN) (char *key, char *value);
54.64 +
54.65 +typedef struct option_s {
54.66 + char *name; // option name
54.67 + cf_type_t type; // option type
54.68 + void *dest; // addr of destination variable, or handler function
54.69 + char *init; // initial value, as a string, just as config file would
54.70 +} option_t;
54.71 +
54.72 +class MConfig {
54.73 + private:
54.74 + // data
54.75 + option_t *list;
54.76 + char *filename;
54.77 + // functions
54.78 + option_t *find(char *lookup);
54.79 + mBOOL set(option_t *setp, char *value);
54.80 + // Private; to satisfy -Weffc++ "has pointer data members but does
54.81 + // not override" copy/assignment constructor.
54.82 + void operator=(const MConfig &src);
54.83 + MConfig(const MConfig &src);
54.84 + public:
54.85 + // contructor
54.86 + MConfig(void);
54.87 + // data
54.88 + int debuglevel; // to use for meta_debug
54.89 + char *gamedll; // string if specified in config.ini
54.90 + char *plugins_file; // ie metamod.ini, plugins.ini
54.91 + char *exec_cfg; // ie metaexec.cfg, exec.cfg
54.92 + // functions
54.93 + void init(option_t *global_options);
54.94 + mBOOL load(char *filename);
54.95 + mBOOL set(char *key, char *value);
54.96 + void show(void);
54.97 +};
54.98 +
54.99 +#endif /* CONF_META_H */
55.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
55.2 +++ b/metamod/dllapi.cpp Tue Apr 06 07:36:14 2004 +0000
55.3 @@ -0,0 +1,480 @@
55.4 +// vi: set ts=4 sw=4 :
55.5 +// vim: set tw=75 :
55.6 +
55.7 +// dllapi.cpp - implementation of Half-Life DLL routines
55.8 +
55.9 +/*
55.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
55.11 + *
55.12 + * This file is part of Metamod.
55.13 + *
55.14 + * Metamod is free software; you can redistribute it and/or modify it
55.15 + * under the terms of the GNU General Public License as published by the
55.16 + * Free Software Foundation; either version 2 of the License, or (at
55.17 + * your option) any later version.
55.18 + *
55.19 + * Metamod is distributed in the hope that it will be useful, but
55.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
55.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
55.22 + * General Public License for more details.
55.23 + *
55.24 + * You should have received a copy of the GNU General Public License
55.25 + * along with Metamod; if not, write to the Free Software Foundation,
55.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
55.27 + *
55.28 + * In addition, as a special exception, the author gives permission to
55.29 + * link the code of this program with the Half-Life Game Engine ("HL
55.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
55.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
55.32 + * respects for all of the code used other than the HL Engine and MODs
55.33 + * from Valve. If you modify this file, you may extend this exception
55.34 + * to your version of the file, but you are not obligated to do so. If
55.35 + * you do not wish to do so, delete this exception statement from your
55.36 + * version.
55.37 + *
55.38 + */
55.39 +
55.40 +#include <extdll.h> // always
55.41 +
55.42 +#include "dllapi.h" // me
55.43 +#include "metamod.h" // SETUP_API_CALLS, etc
55.44 +#include "api_info.h" // dllapi_info, etc
55.45 +#include "commands_meta.h" // client_meta, etc
55.46 +#include "log_meta.h" // META_ERROR, etc
55.47 +
55.48 +
55.49 +// Original DLL routines, functions returning "void".
55.50 +#define META_DLLAPI_HANDLE_void(FN_TYPE, pfnName, pfn_args) \
55.51 + SETUP_API_CALLS_void(FN_TYPE, pfnName, dllapi_info); \
55.52 + CALL_PLUGIN_API_void(P_PRE, pfnName, pfn_args, dllapi_table); \
55.53 + CALL_GAME_API_void(pfnName, pfn_args, dllapi_table); \
55.54 + CALL_PLUGIN_API_void(P_POST, pfnName, pfn_args, dllapi_post_table);
55.55 +
55.56 +// Original DLL routines, functions returning an actual value.
55.57 +#define META_DLLAPI_HANDLE(ret_t, ret_init, FN_TYPE, pfnName, pfn_args) \
55.58 + SETUP_API_CALLS(ret_t, ret_init, FN_TYPE, pfnName, dllapi_info); \
55.59 + CALL_PLUGIN_API(P_PRE, ret_init, pfnName, pfn_args, MRES_SUPERCEDE, dllapi_table); \
55.60 + CALL_GAME_API(pfnName, pfn_args, dllapi_table); \
55.61 + CALL_PLUGIN_API(P_POST, ret_init, pfnName, pfn_args, MRES_OVERRIDE, dllapi_post_table);
55.62 +
55.63 +
55.64 +// The "new" api routines (just 3 right now), functions returning "void".
55.65 +#define META_NEWAPI_HANDLE_void(FN_TYPE, pfnName, pfn_args) \
55.66 + SETUP_API_CALLS_void(FN_TYPE, pfnName, newapi_info); \
55.67 + CALL_PLUGIN_API_void(P_PRE, pfnName, pfn_args, newapi_table); \
55.68 + CALL_GAME_API_void(pfnName, pfn_args, newapi_table); \
55.69 + CALL_PLUGIN_API_void(P_POST, pfnName, pfn_args, newapi_post_table);
55.70 +
55.71 +// The "new" api routines (just 3 right now), functions returning an actual value.
55.72 +#define META_NEWAPI_HANDLE(ret_t, ret_init, FN_TYPE, pfnName, pfn_args) \
55.73 + SETUP_API_CALLS(ret_t, ret_init, FN_TYPE, pfnName, newapi_info); \
55.74 + CALL_PLUGIN_API(P_PRE, ret_init, pfnName, pfn_args, MRES_SUPERCEDE, newapi_table); \
55.75 + CALL_GAME_API(pfnName, pfn_args, newapi_table); \
55.76 + CALL_PLUGIN_API(P_POST, ret_init, pfnName, pfn_args, MRES_OVERRIDE, newapi_post_table);
55.77 +
55.78 +
55.79 +// From SDK dlls/game.cpp:
55.80 +void mm_GameDLLInit(void) {
55.81 + META_DLLAPI_HANDLE_void(FN_GAMEINIT, pfnGameInit, ());
55.82 + RETURN_API_void();
55.83 +}
55.84 +
55.85 +// From SDK dlls/cbase.cpp:
55.86 +int mm_DispatchSpawn(edict_t *pent) {
55.87 + // 0==Success, -1==Failure ?
55.88 + META_DLLAPI_HANDLE(int, 0, FN_DISPATCHSPAWN, pfnSpawn, (pent));
55.89 + RETURN_API();
55.90 +}
55.91 +void mm_DispatchThink(edict_t *pent) {
55.92 + META_DLLAPI_HANDLE_void(FN_DISPATCHTHINK, pfnThink, (pent));
55.93 + RETURN_API_void();
55.94 +}
55.95 +void mm_DispatchUse(edict_t *pentUsed, edict_t *pentOther) {
55.96 + META_DLLAPI_HANDLE_void(FN_DISPATCHUSE, pfnUse, (pentUsed, pentOther));
55.97 + RETURN_API_void();
55.98 +}
55.99 +void mm_DispatchTouch(edict_t *pentTouched, edict_t *pentOther) {
55.100 + META_DLLAPI_HANDLE_void(FN_DISPATCHTOUCH, pfnTouch, (pentTouched, pentOther));
55.101 + RETURN_API_void();
55.102 +}
55.103 +void mm_DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther) {
55.104 + META_DLLAPI_HANDLE_void(FN_DISPATCHBLOCKED, pfnBlocked, (pentBlocked, pentOther));
55.105 + RETURN_API_void();
55.106 +}
55.107 +void mm_DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd) {
55.108 + META_DLLAPI_HANDLE_void(FN_DISPATCHKEYVALUE, pfnKeyValue, (pentKeyvalue, pkvd));
55.109 + RETURN_API_void();
55.110 +}
55.111 +void mm_DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData) {
55.112 + META_DLLAPI_HANDLE_void(FN_DISPATCHSAVE, pfnSave, (pent, pSaveData));
55.113 + RETURN_API_void();
55.114 +}
55.115 +int mm_DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity) {
55.116 + // 0==Success, -1==Failure ?
55.117 + META_DLLAPI_HANDLE(int, 0, FN_DISPATCHRESTORE, pfnRestore, (pent, pSaveData, globalEntity));
55.118 + RETURN_API();
55.119 +}
55.120 +void mm_DispatchObjectCollsionBox(edict_t *pent) {
55.121 + META_DLLAPI_HANDLE_void(FN_DISPATCHOBJECTCOLLISIONBOX, pfnSetAbsBox, (pent));
55.122 + RETURN_API_void();
55.123 +}
55.124 +void mm_SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount) {
55.125 + META_DLLAPI_HANDLE_void(FN_SAVEWRITEFIELDS, pfnSaveWriteFields, (pSaveData, pname, pBaseData, pFields, fieldCount));
55.126 + RETURN_API_void();
55.127 +}
55.128 +void mm_SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount) {
55.129 + META_DLLAPI_HANDLE_void(FN_SAVEREADFIELDS, pfnSaveReadFields, (pSaveData, pname, pBaseData, pFields, fieldCount));
55.130 + RETURN_API_void();
55.131 +}
55.132 +
55.133 +// From SDK dlls/world.cpp:
55.134 +void mm_SaveGlobalState(SAVERESTOREDATA *pSaveData) {
55.135 + META_DLLAPI_HANDLE_void(FN_SAVEGLOBALSTATE, pfnSaveGlobalState, (pSaveData));
55.136 + RETURN_API_void();
55.137 +}
55.138 +void mm_RestoreGlobalState(SAVERESTOREDATA *pSaveData) {
55.139 + META_DLLAPI_HANDLE_void(FN_RESTOREGLOBALSTATE, pfnRestoreGlobalState, (pSaveData));
55.140 + RETURN_API_void();
55.141 +}
55.142 +void mm_ResetGlobalState(void) {
55.143 + META_DLLAPI_HANDLE_void(FN_RESETGLOBALSTATE, pfnResetGlobalState, ());
55.144 + RETURN_API_void();
55.145 +}
55.146 +
55.147 +// From SDK dlls/client.cpp:
55.148 +BOOL mm_ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] ) {
55.149 + META_DLLAPI_HANDLE(BOOL, TRUE, FN_CLIENTCONNECT, pfnClientConnect, (pEntity, pszName, pszAddress, szRejectReason));
55.150 + RETURN_API();
55.151 +}
55.152 +void mm_ClientDisconnect(edict_t *pEntity) {
55.153 + META_DLLAPI_HANDLE_void(FN_CLIENTDISCONNECT, pfnClientDisconnect, (pEntity));
55.154 + RETURN_API_void();
55.155 +}
55.156 +void mm_ClientKill(edict_t *pEntity) {
55.157 + META_DLLAPI_HANDLE_void(FN_CLIENTKILL, pfnClientKill, (pEntity));
55.158 + RETURN_API_void();
55.159 +}
55.160 +void mm_ClientPutInServer(edict_t *pEntity) {
55.161 + META_DLLAPI_HANDLE_void(FN_CLIENTPUTINSERVER, pfnClientPutInServer, (pEntity));
55.162 + RETURN_API_void();
55.163 +}
55.164 +void mm_ClientCommand(edict_t *pEntity) {
55.165 + if(strmatch(CMD_ARGV(0), "meta")) {
55.166 + client_meta(pEntity);
55.167 + }
55.168 + META_DLLAPI_HANDLE_void(FN_CLIENTCOMMAND, pfnClientCommand, (pEntity));
55.169 + RETURN_API_void();
55.170 +}
55.171 +void mm_ClientUserInfoChanged(edict_t *pEntity, char *infobuffer) {
55.172 + META_DLLAPI_HANDLE_void(FN_CLIENTUSERINFOCHANGED, pfnClientUserInfoChanged, (pEntity, infobuffer));
55.173 + RETURN_API_void();
55.174 +}
55.175 +void mm_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax) {
55.176 + META_DLLAPI_HANDLE_void(FN_SERVERACTIVATE, pfnServerActivate, (pEdictList, edictCount, clientMax));
55.177 + RETURN_API_void();
55.178 +}
55.179 +void mm_ServerDeactivate(void) {
55.180 + META_DLLAPI_HANDLE_void(FN_SERVERDEACTIVATE, pfnServerDeactivate, ());
55.181 + // Update loaded plugins. Look for new plugins in inifile, as well as
55.182 + // any plugins waiting for a changelevel to load.
55.183 + //
55.184 + // This is done in ServerDeactivate rather than Activate, as the latter
55.185 + // isn't actually the first routine to be called on a new map. In
55.186 + // particular DispatchKeyValue and DispatchSpawn are called before
55.187 + // Activate, and we want any newly loaded plugins to be able to catch
55.188 + // these.
55.189 + //
55.190 + // So, we do this from Deactivate, which is the _last_ routine called
55.191 + // from the previous map. It's also called right before shutdown,
55.192 + // which means whenever hlds quits, it'll reload the plugins just
55.193 + // before it exits, which is rather silly, but oh well.
55.194 + Plugins->refresh(PT_CHANGELEVEL);
55.195 + Plugins->unpause_all();
55.196 + // Plugins->retry_all(PT_CHANGELEVEL);
55.197 + RETURN_API_void();
55.198 +}
55.199 +void mm_PlayerPreThink(edict_t *pEntity) {
55.200 + META_DLLAPI_HANDLE_void(FN_PLAYERPRETHINK, pfnPlayerPreThink, (pEntity));
55.201 + RETURN_API_void();
55.202 +}
55.203 +void mm_PlayerPostThink(edict_t *pEntity) {
55.204 + META_DLLAPI_HANDLE_void(FN_PLAYERPOSTTHINK, pfnPlayerPostThink, (pEntity));
55.205 + RETURN_API_void();
55.206 +}
55.207 +void mm_StartFrame(void) {
55.208 + META_DLLAPI_HANDLE_void(FN_STARTFRAME, pfnStartFrame, ());
55.209 + RETURN_API_void();
55.210 +}
55.211 +void mm_ParmsNewLevel(void) {
55.212 + META_DLLAPI_HANDLE_void(FN_PARMSNEWLEVEL, pfnParmsNewLevel, ());
55.213 + RETURN_API_void();
55.214 +}
55.215 +void mm_ParmsChangeLevel(void) {
55.216 + META_DLLAPI_HANDLE_void(FN_PARMSCHANGELEVEL, pfnParmsChangeLevel, ());
55.217 + RETURN_API_void();
55.218 +}
55.219 +const char *mm_GetGameDescription(void) {
55.220 + META_DLLAPI_HANDLE(const char *, NULL, FN_GETGAMEDESCRIPTION, pfnGetGameDescription, ());
55.221 + RETURN_API();
55.222 +}
55.223 +void mm_PlayerCustomization(edict_t *pEntity, customization_t *pCust) {
55.224 + META_DLLAPI_HANDLE_void(FN_PLAYERCUSTOMIZATION, pfnPlayerCustomization, (pEntity, pCust));
55.225 + RETURN_API_void();
55.226 +}
55.227 +void mm_SpectatorConnect(edict_t *pEntity) {
55.228 + META_DLLAPI_HANDLE_void(FN_SPECTATORCONNECT, pfnSpectatorConnect, (pEntity));
55.229 + RETURN_API_void();
55.230 +}
55.231 +void mm_SpectatorDisconnect(edict_t *pEntity) {
55.232 + META_DLLAPI_HANDLE_void(FN_SPECTATORDISCONNECT, pfnSpectatorDisconnect, (pEntity));
55.233 + RETURN_API_void();
55.234 +}
55.235 +void mm_SpectatorThink(edict_t *pEntity) {
55.236 + META_DLLAPI_HANDLE_void(FN_SPECTATORTHINK, pfnSpectatorThink, (pEntity));
55.237 + RETURN_API_void();
55.238 +}
55.239 +void mm_Sys_Error(const char *error_string) {
55.240 + META_DLLAPI_HANDLE_void(FN_SYS_ERROR, pfnSys_Error, (error_string));
55.241 + RETURN_API_void();
55.242 +}
55.243 +
55.244 +// From SDK pm_shared/pm_shared.c:
55.245 +void mm_PM_Move (struct playermove_s *ppmove, int server) {
55.246 + META_DLLAPI_HANDLE_void(FN_PM_MOVE, pfnPM_Move, (ppmove, server));
55.247 + RETURN_API_void();
55.248 +}
55.249 +void mm_PM_Init(struct playermove_s *ppmove) {
55.250 + META_DLLAPI_HANDLE_void(FN_PM_INIT, pfnPM_Init, (ppmove));
55.251 + RETURN_API_void();
55.252 +}
55.253 +char mm_PM_FindTextureType(char *name) {
55.254 + META_DLLAPI_HANDLE(char, '\0', FN_PM_FINDTEXTURETYPE, pfnPM_FindTextureType, (name));
55.255 + RETURN_API();
55.256 +}
55.257 +
55.258 +// From SDK dlls/client.cpp:
55.259 +void mm_SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas) {
55.260 + META_DLLAPI_HANDLE_void(FN_SETUPVISIBILITY, pfnSetupVisibility, (pViewEntity, pClient, pvs, pas));
55.261 + RETURN_API_void();
55.262 +}
55.263 +void mm_UpdateClientData (const struct edict_s *ent, int sendweapons, struct clientdata_s *cd) {
55.264 + META_DLLAPI_HANDLE_void(FN_UPDATECLIENTDATA, pfnUpdateClientData, (ent, sendweapons, cd));
55.265 + RETURN_API_void();
55.266 +}
55.267 +int mm_AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet) {
55.268 + META_DLLAPI_HANDLE(int, 0, FN_ADDTOFULLPACK, pfnAddToFullPack, (state, e, ent, host, hostflags, player, pSet));
55.269 + RETURN_API();
55.270 +}
55.271 +void mm_CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs) {
55.272 + META_DLLAPI_HANDLE_void(FN_CREATEBASELINE, pfnCreateBaseline, (player, eindex, baseline, entity, playermodelindex, player_mins, player_maxs));
55.273 + RETURN_API_void();
55.274 +}
55.275 +void mm_RegisterEncoders(void) {
55.276 + META_DLLAPI_HANDLE_void(FN_REGISTERENCODERS, pfnRegisterEncoders, ());
55.277 + RETURN_API_void();
55.278 +}
55.279 +int mm_GetWeaponData(struct edict_s *player, struct weapon_data_s *info) {
55.280 + META_DLLAPI_HANDLE(int, 0, FN_GETWEAPONDATA, pfnGetWeaponData, (player, info));
55.281 + RETURN_API();
55.282 +}
55.283 +void mm_CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed) {
55.284 + META_DLLAPI_HANDLE_void(FN_CMDSTART, pfnCmdStart, (player, cmd, random_seed));
55.285 + RETURN_API_void();
55.286 +}
55.287 +void mm_CmdEnd (const edict_t *player) {
55.288 + META_DLLAPI_HANDLE_void(FN_CMDEND, pfnCmdEnd, (player));
55.289 + RETURN_API_void();
55.290 +}
55.291 +int mm_ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size) {
55.292 + META_DLLAPI_HANDLE(int, 0, FN_CONNECTIONLESSPACKET, pfnConnectionlessPacket, (net_from, args, response_buffer, response_buffer_size));
55.293 + RETURN_API();
55.294 +}
55.295 +int mm_GetHullBounds(int hullnumber, float *mins, float *maxs) {
55.296 + META_DLLAPI_HANDLE(int, 0, FN_GETHULLBOUNDS, pfnGetHullBounds, (hullnumber, mins, maxs));
55.297 + RETURN_API();
55.298 +}
55.299 +void mm_CreateInstancedBaselines (void) {
55.300 + META_DLLAPI_HANDLE_void(FN_CREATEINSTANCEDBASELINES, pfnCreateInstancedBaselines, ());
55.301 + RETURN_API_void();
55.302 +}
55.303 +int mm_InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message) {
55.304 + META_DLLAPI_HANDLE(int, 0, FN_INCONSISTENTFILE, pfnInconsistentFile, (player, filename, disconnect_message));
55.305 + RETURN_API();
55.306 +}
55.307 +int mm_AllowLagCompensation(void) {
55.308 + META_DLLAPI_HANDLE(int, 0, FN_ALLOWLAGCOMPENSATION, pfnAllowLagCompensation, ());
55.309 + RETURN_API();
55.310 +}
55.311 +
55.312 +
55.313 +// New API functions
55.314 +// From SDK ?
55.315 +void mm_OnFreeEntPrivateData(edict_t *pEnt) {
55.316 + META_NEWAPI_HANDLE_void(FN_ONFREEENTPRIVATEDATA, pfnOnFreeEntPrivateData, (pEnt));
55.317 + RETURN_API_void();
55.318 +}
55.319 +void mm_GameShutdown(void) {
55.320 + META_NEWAPI_HANDLE_void(FN_GAMESHUTDOWN, pfnGameShutdown, ());
55.321 + RETURN_API_void();
55.322 +}
55.323 +int mm_ShouldCollide(edict_t *pentTouched, edict_t *pentOther) {
55.324 + META_NEWAPI_HANDLE(int, 1, FN_SHOULDCOLLIDE, pfnShouldCollide, (pentTouched, pentOther));
55.325 + RETURN_API();
55.326 +}
55.327 +
55.328 +
55.329 +// From SDK dlls/cbase.cpp:
55.330 +// "(wd)" indicates my comments on the functions
55.331 +static DLL_FUNCTIONS gFunctionTable =
55.332 +{
55.333 + mm_GameDLLInit, //! pfnGameInit() Initialize the game (one-time call after loading of game .dll)
55.334 + mm_DispatchSpawn, //! pfnSpawn()
55.335 + mm_DispatchThink, //! pfnThink()
55.336 + mm_DispatchUse, //! pfnUse()
55.337 + mm_DispatchTouch, //! pfnTouch()
55.338 + mm_DispatchBlocked, //! pfnBlocked()
55.339 + mm_DispatchKeyValue, //! pfnKeyValue()
55.340 + mm_DispatchSave, //! pfnSave()
55.341 + mm_DispatchRestore, //! pfnRestore()
55.342 + mm_DispatchObjectCollsionBox, //! pfnSetAbsBox()
55.343 +
55.344 + mm_SaveWriteFields, //! pfnSaveWriteFields()
55.345 + mm_SaveReadFields, //! pfnSaveReadFields()
55.346 +
55.347 + mm_SaveGlobalState, //! pfnSaveGlobalState()
55.348 + mm_RestoreGlobalState, //! pfnRestoreGlobalState()
55.349 + mm_ResetGlobalState, //! pfnResetGlobalState()
55.350 +
55.351 + mm_ClientConnect, //! pfnClientConnect() (wd) Client has connected
55.352 + mm_ClientDisconnect, //! pfnClientDisconnect() (wd) Player has left the game
55.353 + mm_ClientKill, //! pfnClientKill() (wd) Player has typed "kill"
55.354 + mm_ClientPutInServer, //! pfnClientPutInServer() (wd) Client is entering the game
55.355 + mm_ClientCommand, //! pfnClientCommand() (wd) Player has sent a command (typed, or from a bind)
55.356 + mm_ClientUserInfoChanged, //! pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure
55.357 + mm_ServerActivate, //! pfnServerActivate() (wd) Server is starting a new map
55.358 + mm_ServerDeactivate, //! pfnServerDeactivate() (wd) Server is leaving the map (shutdown, or changelevel); SDK2
55.359 +
55.360 + mm_PlayerPreThink, //! pfnPlayerPreThink()
55.361 + mm_PlayerPostThink, //! pfnPlayerPostThink()
55.362 +
55.363 + mm_StartFrame, //! pfnStartFrame()
55.364 + mm_ParmsNewLevel, //! pfnParmsNewLevel()
55.365 + mm_ParmsChangeLevel, //! pfnParmsChangeLevel()
55.366 +
55.367 + mm_GetGameDescription, //! pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2", "Half-Life"
55.368 + mm_PlayerCustomization, //! pfnPlayerCustomization() Notifies .dll of new customization for player.
55.369 +
55.370 + mm_SpectatorConnect, //! pfnSpectatorConnect() Called when spectator joins server
55.371 + mm_SpectatorDisconnect, //! pfnSpectatorDisconnect() Called when spectator leaves the server
55.372 + mm_SpectatorThink, //! pfnSpectatorThink() Called when spectator sends a command packet (usercmd_t)
55.373 +
55.374 + mm_Sys_Error, //! pfnSys_Error() Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint. SDK2
55.375 +
55.376 + mm_PM_Move, //! pfnPM_Move() (wd) SDK2
55.377 + mm_PM_Init, //! pfnPM_Init() Server version of player movement initialization; (wd) SDK2
55.378 + mm_PM_FindTextureType, //! pfnPM_FindTextureType() (wd) SDK2
55.379 +
55.380 + mm_SetupVisibility, //! pfnSetupVisibility() Set up PVS and PAS for networking for this client; (wd) SDK2
55.381 + mm_UpdateClientData, //! pfnUpdateClientData() Set up data sent only to specific client; (wd) SDK2
55.382 + mm_AddToFullPack, //! pfnAddToFullPack() (wd) SDK2
55.383 + mm_CreateBaseline, //! pfnCreateBaseline() Tweak entity baseline for network encoding, allows setup of player baselines, too.; (wd) SDK2
55.384 + mm_RegisterEncoders, //! pfnRegisterEncoders() Callbacks for network encoding; (wd) SDK2
55.385 + mm_GetWeaponData, //! pfnGetWeaponData() (wd) SDK2
55.386 + mm_CmdStart, //! pfnCmdStart() (wd) SDK2
55.387 + mm_CmdEnd, //! pfnCmdEnd() (wd) SDK2
55.388 + mm_ConnectionlessPacket, //! pfnConnectionlessPacket() (wd) SDK2
55.389 + mm_GetHullBounds, //! pfnGetHullBounds() (wd) SDK2
55.390 + mm_CreateInstancedBaselines, //! pfnCreateInstancedBaselines() (wd) SDK2
55.391 + mm_InconsistentFile, //! pfnInconsistentFile() (wd) SDK2
55.392 + mm_AllowLagCompensation, //! pfnAllowLagCompensation() (wd) SDK2
55.393 +};
55.394 +
55.395 +// It's not clear what the difference is between GetAPI and GetAPI2; they
55.396 +// both appear to return the exact same function table.
55.397 +//
55.398 +// Only one of them appears to be ever called, though. If the DLL provides
55.399 +// GetAPI2, the engine/hlds will call that, and will not call GetAPI. If
55.400 +// the engine couldn't find GetAPI2 in the DLL, it appears to fall back to
55.401 +// GetAPI.
55.402 +//
55.403 +// So, GetAPI2 appears to replace GetAPI, and appears to have been added
55.404 +// with SDK 2.0. My best guess is that, with the new SDK, interface
55.405 +// version checking became important, and without the int ptr used in
55.406 +// GetAPI2, the engine can't find out the version of the DLL via GetAPI.
55.407 +//
55.408 +// It's unclear whether a DLL coded under SDK2 needs to provide the older
55.409 +// GetAPI or not..
55.410 +
55.411 +C_DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion)
55.412 +{
55.413 + META_DEBUG(3, ("called: GetEntityAPI; version=%d", interfaceVersion));
55.414 + if(!pFunctionTable) {
55.415 + META_ERROR("GetEntityAPI called with null pFunctionTable");
55.416 + return(FALSE);
55.417 + }
55.418 + else if(interfaceVersion != INTERFACE_VERSION) {
55.419 + META_ERROR("GetEntityAPI version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION);
55.420 + return(FALSE);
55.421 + }
55.422 + memcpy(pFunctionTable, &gFunctionTable, sizeof(DLL_FUNCTIONS));
55.423 + return(TRUE);
55.424 +}
55.425 +
55.426 +C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion)
55.427 +{
55.428 + META_DEBUG(3, ("called: GetEntityAPI2; version=%d", *interfaceVersion));
55.429 + if(!pFunctionTable) {
55.430 + META_ERROR("GetEntityAPI2 called with null pFunctionTable");
55.431 + return(FALSE);
55.432 + }
55.433 + else if(*interfaceVersion != INTERFACE_VERSION) {
55.434 + META_ERROR("GetEntityAPI2 version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION);
55.435 + //! Tell engine what version we had, so it can figure out who is out of date.
55.436 + *interfaceVersion = INTERFACE_VERSION;
55.437 + return(FALSE);
55.438 + }
55.439 + memcpy(pFunctionTable, &gFunctionTable, sizeof(DLL_FUNCTIONS));
55.440 + return(TRUE);
55.441 +}
55.442 +
55.443 +
55.444 +// I could find _no_ documentation or examples for the intended use of
55.445 +// NEW_DLL_FUNCTIONS. I wouldn't have even _known_ about the
55.446 +// GetNewDLLFunctions() function except for the reference in Adminmod.. It
55.447 +// appears to be new with SDK 2.0.
55.448 +//
55.449 +// Obviously, it seems to provide additional functions to the engine, but
55.450 +// it's unclear why a new table and interface were added, rather than
55.451 +// appending new functions to the GetAPI table/interface.
55.452 +//
55.453 +// Interestingly, it appears to be called by the engine _before_ GetAPI.
55.454 +
55.455 +static NEW_DLL_FUNCTIONS gNewFunctionTable =
55.456 +{
55.457 + mm_OnFreeEntPrivateData, //! pfnOnFreeEntPrivateData() Called right before the object's memory is freed. Calls its destructor.
55.458 + mm_GameShutdown, //! pfnGameShutdown()
55.459 + mm_ShouldCollide, //! pfnShouldCollide()
55.460 +};
55.461 +
55.462 +C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion)
55.463 +{
55.464 + META_DEBUG(6, ("called: GetNewDLLFunctions; version=%d", *interfaceVersion));
55.465 + // Don't provide these functions to engine if gamedll doesn't provide
55.466 + // them. Otherwise, we're in the position of having to provide answers
55.467 + // we can't necessarily provide (for instance, ShouldCollide())...
55.468 + if(!GameDLL.funcs.newapi_table)
55.469 + return(FALSE);
55.470 +
55.471 + if(!pNewFunctionTable) {
55.472 + META_ERROR("GetNewDLLFunctions called with null pNewFunctionTable");
55.473 + return(FALSE);
55.474 + }
55.475 + else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) {
55.476 + META_ERROR("GetNewDLLFunctions version mismatch; requested=%d ours=%d", *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION);
55.477 + //! Tell engine what version we had, so it can figure out who is out of date.
55.478 + *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION;
55.479 + return(FALSE);
55.480 + }
55.481 + memcpy(pNewFunctionTable, &gNewFunctionTable, sizeof(NEW_DLL_FUNCTIONS));
55.482 + return(TRUE);
55.483 +}
56.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
56.2 +++ b/metamod/dllapi.h Tue Apr 06 07:36:14 2004 +0000
56.3 @@ -0,0 +1,184 @@
56.4 +// vi: set ts=4 sw=4 :
56.5 +// vim: set tw=75 :
56.6 +
56.7 +// dllapi.h - prototypes and typedefs for Half-Life DLL API routines
56.8 +
56.9 +/*
56.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
56.11 + *
56.12 + * This file is part of Metamod.
56.13 + *
56.14 + * Metamod is free software; you can redistribute it and/or modify it
56.15 + * under the terms of the GNU General Public License as published by the
56.16 + * Free Software Foundation; either version 2 of the License, or (at
56.17 + * your option) any later version.
56.18 + *
56.19 + * Metamod is distributed in the hope that it will be useful, but
56.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
56.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
56.22 + * General Public License for more details.
56.23 + *
56.24 + * You should have received a copy of the GNU General Public License
56.25 + * along with Metamod; if not, write to the Free Software Foundation,
56.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
56.27 + *
56.28 + * In addition, as a special exception, the author gives permission to
56.29 + * link the code of this program with the Half-Life Game Engine ("HL
56.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
56.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
56.32 + * respects for all of the code used other than the HL Engine and MODs
56.33 + * from Valve. If you modify this file, you may extend this exception
56.34 + * to your version of the file, but you are not obligated to do so. If
56.35 + * you do not wish to do so, delete this exception statement from your
56.36 + * version.
56.37 + *
56.38 + */
56.39 +
56.40 +#ifndef DLLAPI_H
56.41 +#define DLLAPI_H
56.42 +
56.43 +#include "sdk_util.h" // BOOL
56.44 +#include "osdep.h" // DLLEXPORT, etc
56.45 +
56.46 +// Typedefs for these are provided in SDK engine/eiface.h, but I didn't
56.47 +// like the names (APIFUNCTION, APIFUNCTION2, NEW_DLL_FUNCTIONS_FN).
56.48 +typedef int (*GETENTITYAPI_FN) (DLL_FUNCTIONS *pFunctionTable, int interfaceVersion);
56.49 +typedef int (*GETENTITYAPI2_FN) (DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion);
56.50 +typedef int (*GETNEWDLLFUNCTIONS_FN) (NEW_DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion);
56.51 +
56.52 +// From SDK dlls/cbase.h:
56.53 +C_DLLEXPORT int GetEntityAPI( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion );
56.54 +C_DLLEXPORT int GetEntityAPI2( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion );
56.55 +
56.56 +// No example in SDK..
56.57 +// From Adminmod dll.cpp:
56.58 +C_DLLEXPORT int GetNewDLLFunctions( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion );
56.59 +
56.60 +
56.61 +// From SDK dlls/game.h:
56.62 +extern void mm_GameDLLInit( void );
56.63 +
56.64 +// From SDK dlls/cbase.h:
56.65 +extern int mm_DispatchSpawn( edict_t *pent );
56.66 +extern void mm_DispatchThink( edict_t *pent );
56.67 +extern void mm_DispatchUse( edict_t *pentUsed, edict_t *pentOther );
56.68 +extern void mm_DispatchTouch( edict_t *pentTouched, edict_t *pentOther );
56.69 +extern void mm_DispatchBlocked( edict_t *pentBlocked, edict_t *pentOther );
56.70 +extern void mm_DispatchKeyValue( edict_t *pentKeyvalue, KeyValueData *pkvd );
56.71 +extern void mm_DispatchSave( edict_t *pent, SAVERESTOREDATA *pSaveData );
56.72 +extern int mm_DispatchRestore( edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity );
56.73 +extern void mm_DispatchObjectCollisionBox( edict_t *pent );
56.74 +extern void mm_SaveWriteFields( SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount );
56.75 +extern void mm_SaveReadFields( SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount );
56.76 +extern void mm_SaveGlobalState( SAVERESTOREDATA *pSaveData );
56.77 +extern void mm_RestoreGlobalState( SAVERESTOREDATA *pSaveData );
56.78 +extern void mm_ResetGlobalState( void );
56.79 +
56.80 +// From SDK dlls/client.h:
56.81 +extern BOOL mm_ClientConnect( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] );
56.82 +extern void mm_ClientDisconnect( edict_t *pEntity );
56.83 +extern void mm_ClientKill( edict_t *pEntity );
56.84 +extern void mm_ClientPutInServer( edict_t *pEntity );
56.85 +extern void mm_ClientCommand( edict_t *pEntity );
56.86 +extern void mm_ClientUserInfoChanged( edict_t *pEntity, char *infobuffer );
56.87 +extern void mm_ServerActivate( edict_t *pEdictList, int edictCount, int clientMax );
56.88 +extern void mm_ServerDeactivate( void );
56.89 +extern void mm_PlayerPreThink( edict_t *pEntity );
56.90 +extern void mm_PlayerPostThink( edict_t *pEntity );
56.91 +extern void mm_StartFrame( void );
56.92 +extern void mm_ParmsNewLevel( void );
56.93 +extern void mm_ParmsChangeLevel( void );
56.94 +extern const char *mm_GetGameDescription( void );
56.95 +extern void mm_PlayerCustomization( edict_t *pEntity, customization_t *pCust );
56.96 +extern void mm_SpectatorConnect ( edict_t *pEntity );
56.97 +extern void mm_SpectatorDisconnect ( edict_t *pEntity );
56.98 +extern void mm_SpectatorThink ( edict_t *pEntity );
56.99 +extern void mm_Sys_Error( const char *error_string );
56.100 +
56.101 +// From SDK pm_shared/pm_shared.h:
56.102 +extern void mm_PM_Move ( struct playermove_s *ppmove, int server );
56.103 +extern void mm_PM_Init ( struct playermove_s *ppmove );
56.104 +extern char mm_PM_FindTextureType ( char *name );
56.105 +
56.106 +// From SDK dlls/client.h:
56.107 +extern void mm_SetupVisibility( edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas );
56.108 +extern void mm_UpdateClientData ( const struct edict_s *ent, int sendweapons, struct clientdata_s *cd );
56.109 +extern int mm_AddToFullPack( struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet );
56.110 +extern void mm_CreateBaseline( int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs );
56.111 +extern void mm_RegisterEncoders( void );
56.112 +extern int mm_GetWeaponData( struct edict_s *player, struct weapon_data_s *info );
56.113 +extern void mm_CmdStart( const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed );
56.114 +extern void mm_CmdEnd ( const edict_t *player );
56.115 +extern int mm_ConnectionlessPacket( const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size );
56.116 +extern int mm_GetHullBounds( int hullnumber, float *mins, float *maxs );
56.117 +extern void mm_CreateInstancedBaselines ( void );
56.118 +extern int mm_InconsistentFile( const edict_t *player, const char *filename, char *disconnect_message );
56.119 +extern int mm_AllowLagCompensation( void );
56.120 +
56.121 +// No example from SDK...
56.122 +extern void mm_OnFreeEntPrivateData(edict_t pEnt);
56.123 +extern void mm_GameShutdown(void);
56.124 +extern int mm_ShouldCollide(edict_t *pentTouched, edict_t *pentOther);
56.125 +
56.126 +
56.127 +// Typedefs for the above functions:
56.128 +
56.129 +typedef void (*FN_GAMEINIT) ( void );
56.130 +typedef int (*FN_DISPATCHSPAWN) ( edict_t *pent );
56.131 +typedef void (*FN_DISPATCHTHINK) ( edict_t *pent );
56.132 +typedef void (*FN_DISPATCHUSE) ( edict_t *pentUsed, edict_t *pentOther );
56.133 +typedef void (*FN_DISPATCHTOUCH) ( edict_t *pentTouched, edict_t *pentOther );
56.134 +typedef void (*FN_DISPATCHBLOCKED) ( edict_t *pentBlocked, edict_t *pentOther );
56.135 +typedef void (*FN_DISPATCHKEYVALUE) ( edict_t *pentKeyvalue, KeyValueData *pkvd );
56.136 +typedef void (*FN_DISPATCHSAVE) ( edict_t *pent, SAVERESTOREDATA *pSaveData );
56.137 +typedef int (*FN_DISPATCHRESTORE) ( edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity );
56.138 +typedef void (*FN_DISPATCHOBJECTCOLLISIONBOX) ( edict_t *pent );
56.139 +typedef void (*FN_SAVEWRITEFIELDS) ( SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount );
56.140 +typedef void (*FN_SAVEREADFIELDS) ( SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount );
56.141 +typedef void (*FN_SAVEGLOBALSTATE) ( SAVERESTOREDATA *pSaveData );
56.142 +typedef void (*FN_RESTOREGLOBALSTATE) ( SAVERESTOREDATA *pSaveData );
56.143 +typedef void (*FN_RESETGLOBALSTATE) ( void );
56.144 +
56.145 +typedef BOOL (*FN_CLIENTCONNECT) ( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] );
56.146 +typedef void (*FN_CLIENTDISCONNECT) ( edict_t *pEntity );
56.147 +typedef void (*FN_CLIENTKILL) ( edict_t *pEntity );
56.148 +typedef void (*FN_CLIENTPUTINSERVER) ( edict_t *pEntity );
56.149 +typedef void (*FN_CLIENTCOMMAND) ( edict_t *pEntity );
56.150 +typedef void (*FN_CLIENTUSERINFOCHANGED) ( edict_t *pEntity, char *infobuffer );
56.151 +typedef void (*FN_SERVERACTIVATE) ( edict_t *pEdictList, int edictCount, int clientMax );
56.152 +typedef void (*FN_SERVERDEACTIVATE) ( void );
56.153 +typedef void (*FN_PLAYERPRETHINK) ( edict_t *pEntity );
56.154 +typedef void (*FN_PLAYERPOSTTHINK) ( edict_t *pEntity );
56.155 +typedef void (*FN_STARTFRAME) ( void );
56.156 +typedef void (*FN_PARMSNEWLEVEL) ( void );
56.157 +typedef void (*FN_PARMSCHANGELEVEL) ( void );
56.158 +typedef const char *(*FN_GETGAMEDESCRIPTION) ( void );
56.159 +typedef void (*FN_PLAYERCUSTOMIZATION) ( edict_t *pEntity, customization_t *pCust );
56.160 +typedef void (*FN_SPECTATORCONNECT) ( edict_t *pEntity );
56.161 +typedef void (*FN_SPECTATORDISCONNECT) ( edict_t *pEntity );
56.162 +typedef void (*FN_SPECTATORTHINK) ( edict_t *pEntity );
56.163 +typedef void (*FN_SYS_ERROR) ( const char *error_string );
56.164 +
56.165 +typedef void (*FN_PM_MOVE) ( struct playermove_s *ppmove, int server );
56.166 +typedef void (*FN_PM_INIT) ( struct playermove_s *ppmove );
56.167 +typedef char (*FN_PM_FINDTEXTURETYPE) ( char *name );
56.168 +
56.169 +typedef void (*FN_SETUPVISIBILITY) ( edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas );
56.170 +typedef void (*FN_UPDATECLIENTDATA) ( const struct edict_s *ent, int sendweapons, struct clientdata_s *cd );
56.171 +typedef int (*FN_ADDTOFULLPACK) ( struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet );
56.172 +typedef void (*FN_CREATEBASELINE) ( int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs );
56.173 +typedef void (*FN_REGISTERENCODERS) ( void );
56.174 +typedef int (*FN_GETWEAPONDATA) ( struct edict_s *player, struct weapon_data_s *info );
56.175 +typedef void (*FN_CMDSTART) ( const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed );
56.176 +typedef void (*FN_CMDEND) ( const edict_t *player );
56.177 +typedef int (*FN_CONNECTIONLESSPACKET) ( const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size );
56.178 +typedef int (*FN_GETHULLBOUNDS) ( int hullnumber, float *mins, float *maxs );
56.179 +typedef void (*FN_CREATEINSTANCEDBASELINES) ( void );
56.180 +typedef int (*FN_INCONSISTENTFILE) ( const edict_t *player, const char *filename, char *disconnect_message );
56.181 +typedef int (*FN_ALLOWLAGCOMPENSATION) ( void );
56.182 +
56.183 +typedef void (*FN_ONFREEENTPRIVATEDATA) (edict_t *pEnt);
56.184 +typedef void (*FN_GAMESHUTDOWN) (void);
56.185 +typedef int (*FN_SHOULDCOLLIDE) (edict_t *pentTouched, edict_t *pentOther);
56.186 +
56.187 +#endif /* DLLAPI_H */
57.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
57.2 +++ b/metamod/engine_api.cpp Tue Apr 06 07:36:14 2004 +0000
57.3 @@ -0,0 +1,1045 @@
57.4 +// vi: set ts=4 sw=4 :
57.5 +// vim: set tw=75 :
57.6 +
57.7 +// engine_api.cpp - implementation of Half-Life engine functions
57.8 +
57.9 +/*
57.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
57.11 + *
57.12 + * This file is part of Metamod.
57.13 + *
57.14 + * Metamod is free software; you can redistribute it and/or modify it
57.15 + * under the terms of the GNU General Public License as published by the
57.16 + * Free Software Foundation; either version 2 of the License, or (at
57.17 + * your option) any later version.
57.18 + *
57.19 + * Metamod is distributed in the hope that it will be useful, but
57.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
57.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
57.22 + * General Public License for more details.
57.23 + *
57.24 + * You should have received a copy of the GNU General Public License
57.25 + * along with Metamod; if not, write to the Free Software Foundation,
57.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
57.27 + *
57.28 + * In addition, as a special exception, the author gives permission to
57.29 + * link the code of this program with the Half-Life Game Engine ("HL
57.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
57.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
57.32 + * respects for all of the code used other than the HL Engine and MODs
57.33 + * from Valve. If you modify this file, you may extend this exception
57.34 + * to your version of the file, but you are not obligated to do so. If
57.35 + * you do not wish to do so, delete this exception statement from your
57.36 + * version.
57.37 + *
57.38 + */
57.39 +
57.40 +#include <stdio.h> // vsnprintf, etc
57.41 +#include <stdarg.h> // va_start, etc
57.42 +
57.43 +#include <extdll.h> // always
57.44 +
57.45 +#include "engine_api.h" // me
57.46 +#include "metamod.h" // SETUP_API_CALLS, etc
57.47 +#include "thread_logparse.h" // LogQueue, etc
57.48 +#include "api_info.h" // dllapi_info, etc
57.49 +#include "log_meta.h" // META_ERROR, etc
57.50 +#include "osdep.h" // win32 vsnprintf, etc
57.51 +
57.52 +
57.53 +// Engine routines, functions returning "void".
57.54 +#define META_ENGINE_HANDLE_void(FN_TYPE, pfnName, pfn_args) \
57.55 + SETUP_API_CALLS_void(FN_TYPE, pfnName, engine_info); \
57.56 + CALL_PLUGIN_API_void(P_PRE, pfnName, pfn_args, engine_table); \
57.57 + CALL_ENGINE_API_void(pfnName, pfn_args); \
57.58 + CALL_PLUGIN_API_void(P_POST, pfnName, pfn_args, engine_post_table);
57.59 +
57.60 +// Engine routines, functions returning an actual value.
57.61 +#define META_ENGINE_HANDLE(ret_t, ret_init, FN_TYPE, pfnName, pfn_args) \
57.62 + SETUP_API_CALLS(ret_t, ret_init, FN_TYPE, pfnName, engine_info); \
57.63 + CALL_PLUGIN_API(P_PRE, ret_init, pfnName, pfn_args, MRES_SUPERCEDE, engine_table); \
57.64 + CALL_ENGINE_API(pfnName, pfn_args); \
57.65 + CALL_PLUGIN_API(P_POST, ret_init, pfnName, pfn_args, MRES_OVERRIDE, engine_post_table);
57.66 +
57.67 +
57.68 +// Engine routines, printf-style functions returning "void".
57.69 +#define META_ENGINE_HANDLE_void_varargs(FN_TYPE, pfnName, pfn_arg, fmt_arg) \
57.70 + SETUP_API_CALLS_void(FN_TYPE, pfnName, engine_info); \
57.71 + char buf[MAX_STRBUF_LEN]; \
57.72 + va_list ap; \
57.73 + META_DEBUG(loglevel, ("In %s: fmt=%s", pfn_string, fmt_arg)); \
57.74 + va_start(ap, fmt_arg); \
57.75 + vsnprintf(buf, sizeof(buf), fmt_arg, ap); \
57.76 + va_end(ap); \
57.77 + CALL_PLUGIN_API_void(P_PRE, pfnName, (pfn_arg, "%s", buf), engine_table); \
57.78 + CALL_ENGINE_API_void(pfnName, (pfn_arg, "%s", buf)); \
57.79 + CALL_PLUGIN_API_void(P_POST, pfnName, (pfn_arg, "%s", buf), engine_post_table);
57.80 +
57.81 +// Engine routines, printf-style functions returning an actual value.
57.82 +#define META_ENGINE_HANDLE_varargs(ret_t, ret_init, FN_TYPE, pfnName, pfn_arg, fmt_arg) \
57.83 + SETUP_API_CALLS(ret_t, ret_init, FN_TYPE, pfnName, engine_info); \
57.84 + char buf[MAX_STRBUF_LEN]; \
57.85 + va_list ap; \
57.86 + META_DEBUG(loglevel, ("In %s: fmt=%s", pfn_string, fmt_arg)); \
57.87 + va_start(ap, fmt_arg); \
57.88 + vsnprintf(buf, sizeof(buf), fmt_arg, ap); \
57.89 + va_end(ap); \
57.90 + CALL_PLUGIN_API(P_PRE, ret_init, pfnName, (pfn_arg, "%s", buf), MRES_SUPERCEDE, engine_table); \
57.91 + CALL_ENGINE_API(pfnName, (pfn_arg, "%s", buf)); \
57.92 + CALL_PLUGIN_API(P_POST, ret_init, pfnName, (pfn_arg, "%s", buf), MRES_OVERRIDE, engine_post_table);
57.93 +
57.94 +
57.95 +int mm_PrecacheModel(char *s) {
57.96 + META_ENGINE_HANDLE(int, 0, FN_PRECACHEMODEL, pfnPrecacheModel, (s));
57.97 + RETURN_API()
57.98 +}
57.99 +int mm_PrecacheSound(char *s) {
57.100 + META_ENGINE_HANDLE(int, 0, FN_PRECACHESOUND, pfnPrecacheSound, (s));
57.101 + RETURN_API()
57.102 +}
57.103 +void mm_SetModel(edict_t *e, const char *m) {
57.104 + META_ENGINE_HANDLE_void(FN_SETMODEL, pfnSetModel, (e, m));
57.105 + RETURN_API_void()
57.106 +}
57.107 +int mm_ModelIndex(const char *m) {
57.108 + META_ENGINE_HANDLE(int, 0, FN_MODELINDEX, pfnModelIndex, (m));
57.109 + RETURN_API()
57.110 +}
57.111 +int mm_ModelFrames(int modelIndex) {
57.112 + META_ENGINE_HANDLE(int, 0, FN_MODELFRAMES, pfnModelFrames, (modelIndex));
57.113 + RETURN_API()
57.114 +}
57.115 +
57.116 +void mm_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax) {
57.117 + META_ENGINE_HANDLE_void(FN_SETSIZE, pfnSetSize, (e, rgflMin, rgflMax));
57.118 + RETURN_API_void()
57.119 +}
57.120 +void mm_ChangeLevel(char *s1, char *s2) {
57.121 + META_ENGINE_HANDLE_void(FN_CHANGELEVEL, pfnChangeLevel, (s1, s2));
57.122 + RETURN_API_void()
57.123 +}
57.124 +void mm_GetSpawnParms(edict_t *ent) {
57.125 + META_ENGINE_HANDLE_void(FN_GETSPAWNPARMS, pfnGetSpawnParms, (ent));
57.126 + RETURN_API_void()
57.127 +}
57.128 +void mm_SaveSpawnParms(edict_t *ent) {
57.129 + META_ENGINE_HANDLE_void(FN_SAVESPAWNPARMS, pfnSaveSpawnParms, (ent));
57.130 + RETURN_API_void()
57.131 +}
57.132 +
57.133 +float mm_VecToYaw(const float *rgflVector) {
57.134 + META_ENGINE_HANDLE(float, 0.0, FN_VECTOYAW, pfnVecToYaw, (rgflVector));
57.135 + RETURN_API()
57.136 +}
57.137 +void mm_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut) {
57.138 + META_ENGINE_HANDLE_void(FN_VECTOANGLES, pfnVecToAngles, (rgflVectorIn, rgflVectorOut));
57.139 + RETURN_API_void()
57.140 +}
57.141 +void mm_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType) {
57.142 + META_ENGINE_HANDLE_void(FN_MOVETOORIGIN, pfnMoveToOrigin, (ent, pflGoal, dist, iMoveType));
57.143 + RETURN_API_void()
57.144 +}
57.145 +void mm_ChangeYaw(edict_t *ent) {
57.146 + META_ENGINE_HANDLE_void(FN_CHANGEYAW, pfnChangeYaw, (ent));
57.147 + RETURN_API_void()
57.148 +}
57.149 +void mm_ChangePitch(edict_t *ent) {
57.150 + META_ENGINE_HANDLE_void(FN_CHANGEPITCH, pfnChangePitch, (ent));
57.151 + RETURN_API_void()
57.152 +}
57.153 +
57.154 +edict_t *mm_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue) {
57.155 + META_ENGINE_HANDLE(edict_t *, NULL, FN_FINDENTITYBYSTRING, pfnFindEntityByString, (pEdictStartSearchAfter, pszField, pszValue));
57.156 + RETURN_API()
57.157 +}
57.158 +int mm_GetEntityIllum(edict_t *pEnt) {
57.159 + META_ENGINE_HANDLE(int, 0, FN_GETENTITYILLUM, pfnGetEntityIllum, (pEnt));
57.160 + RETURN_API()
57.161 +}
57.162 +edict_t *mm_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad) {
57.163 + META_ENGINE_HANDLE(edict_t *, NULL, FN_FINDENTITYINSPHERE, pfnFindEntityInSphere, (pEdictStartSearchAfter, org, rad));
57.164 + RETURN_API()
57.165 +}
57.166 +edict_t *mm_FindClientInPVS(edict_t *pEdict) {
57.167 + META_ENGINE_HANDLE(edict_t *, NULL, FN_FINDCLIENTINPVS, pfnFindClientInPVS, (pEdict));
57.168 + RETURN_API()
57.169 +}
57.170 +edict_t *mm_EntitiesInPVS(edict_t *pplayer) {
57.171 + META_ENGINE_HANDLE(edict_t *, NULL, FN_ENTITIESINPVS, pfnEntitiesInPVS, (pplayer));
57.172 + RETURN_API()
57.173 +}
57.174 +
57.175 +void mm_MakeVectors(const float *rgflVector) {
57.176 + META_ENGINE_HANDLE_void(FN_MAKEVECTORS, pfnMakeVectors, (rgflVector));
57.177 + RETURN_API_void()
57.178 +}
57.179 +void mm_AngleVectors(const float *rgflVector, float *forward, float *right, float *up) {
57.180 + META_ENGINE_HANDLE_void(FN_ANGLEVECTORS, pfnAngleVectors, (rgflVector, forward, right, up));
57.181 + RETURN_API_void()
57.182 +}
57.183 +
57.184 +edict_t *mm_CreateEntity(void) {
57.185 + META_ENGINE_HANDLE(edict_t *, NULL, FN_CREATEENTITY, pfnCreateEntity, ());
57.186 + RETURN_API()
57.187 +}
57.188 +void mm_RemoveEntity(edict_t *e) {
57.189 + META_ENGINE_HANDLE_void(FN_REMOVEENTITY, pfnRemoveEntity, (e));
57.190 + RETURN_API_void()
57.191 +}
57.192 +edict_t *mm_CreateNamedEntity(int className) {
57.193 + META_ENGINE_HANDLE(edict_t *, NULL, FN_CREATENAMEDENTITY, pfnCreateNamedEntity, (className));
57.194 + RETURN_API()
57.195 +}
57.196 +
57.197 +void mm_MakeStatic(edict_t *ent) {
57.198 + META_ENGINE_HANDLE_void(FN_MAKESTATIC, pfnMakeStatic, (ent));
57.199 + RETURN_API_void()
57.200 +}
57.201 +int mm_EntIsOnFloor(edict_t *e) {
57.202 + META_ENGINE_HANDLE(int, 0, FN_ENTISONFLOOR, pfnEntIsOnFloor, (e));
57.203 + RETURN_API()
57.204 +}
57.205 +int mm_DropToFloor(edict_t *e) {
57.206 + META_ENGINE_HANDLE(int, 0, FN_DROPTOFLOOR, pfnDropToFloor, (e));
57.207 + RETURN_API()
57.208 +}
57.209 +
57.210 +int mm_WalkMove(edict_t *ent, float yaw, float dist, int iMode) {
57.211 + META_ENGINE_HANDLE(int, 0, FN_WALKMOVE, pfnWalkMove, (ent, yaw, dist, iMode));
57.212 + RETURN_API()
57.213 +}
57.214 +void mm_SetOrigin(edict_t *e, const float *rgflOrigin) {
57.215 + META_ENGINE_HANDLE_void(FN_SETORIGIN, pfnSetOrigin, (e, rgflOrigin));
57.216 + RETURN_API_void()
57.217 +}
57.218 +
57.219 +void mm_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch) {
57.220 + META_ENGINE_HANDLE_void(FN_EMITSOUND, pfnEmitSound, (entity, channel, sample, volume, attenuation, fFlags, pitch));
57.221 + RETURN_API_void()
57.222 +}
57.223 +void mm_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch) {
57.224 + META_ENGINE_HANDLE_void(FN_EMITAMBIENTSOUND, pfnEmitAmbientSound, (entity, pos, samp, vol, attenuation, fFlags, pitch));
57.225 + RETURN_API_void()
57.226 +}
57.227 +
57.228 +void mm_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr) {
57.229 + META_ENGINE_HANDLE_void(FN_TRACELINE, pfnTraceLine, (v1, v2, fNoMonsters, pentToSkip, ptr));
57.230 + RETURN_API_void()
57.231 +}
57.232 +void mm_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr) {
57.233 + META_ENGINE_HANDLE_void(FN_TRACETOSS, pfnTraceToss, (pent, pentToIgnore, ptr));
57.234 + RETURN_API_void()
57.235 +}
57.236 +int mm_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr) {
57.237 + META_ENGINE_HANDLE(int, 0, FN_TRACEMONSTERHULL, pfnTraceMonsterHull, (pEdict, v1, v2, fNoMonsters, pentToSkip, ptr));
57.238 + RETURN_API()
57.239 +}
57.240 +void mm_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr) {
57.241 + META_ENGINE_HANDLE_void(FN_TRACEHULL, pfnTraceHull, (v1, v2, fNoMonsters, hullNumber, pentToSkip, ptr));
57.242 + RETURN_API_void()
57.243 +}
57.244 +void mm_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr) {
57.245 + META_ENGINE_HANDLE_void(FN_TRACEMODEL, pfnTraceModel, (v1, v2, hullNumber, pent, ptr));
57.246 + RETURN_API_void()
57.247 +}
57.248 +const char *mm_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ) {
57.249 + META_ENGINE_HANDLE(const char *, NULL, FN_TRACETEXTURE, pfnTraceTexture, (pTextureEntity, v1, v2));
57.250 + RETURN_API()
57.251 +}
57.252 +void mm_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr) {
57.253 + META_ENGINE_HANDLE_void(FN_TRACESPHERE, pfnTraceSphere, (v1, v2, fNoMonsters, radius, pentToSkip, ptr));
57.254 + RETURN_API_void()
57.255 +}
57.256 +void mm_GetAimVector(edict_t *ent, float speed, float *rgflReturn) {
57.257 + META_ENGINE_HANDLE_void(FN_GETAIMVECTOR, pfnGetAimVector, (ent, speed, rgflReturn));
57.258 + RETURN_API_void()
57.259 +}
57.260 +
57.261 +void mm_ServerCommand(char *str) {
57.262 + META_ENGINE_HANDLE_void(FN_SERVERCOMMAND, pfnServerCommand, (str));
57.263 + RETURN_API_void()
57.264 +}
57.265 +void mm_ServerExecute(void) {
57.266 + META_ENGINE_HANDLE_void(FN_SERVEREXECUTE, pfnServerExecute, ());
57.267 + RETURN_API_void()
57.268 +}
57.269 +void mm_engClientCommand(edict_t *pEdict, char *szFmt, ...) {
57.270 + META_ENGINE_HANDLE_void_varargs(FN_CLIENTCOMMAND_ENG, pfnClientCommand, pEdict, szFmt);
57.271 + RETURN_API_void()
57.272 +}
57.273 +
57.274 +void mm_ParticleEffect(const float *org, const float *dir, float color, float count) {
57.275 + META_ENGINE_HANDLE_void(FN_PARTICLEEFFECT, pfnParticleEffect, (org, dir, color, count));
57.276 + RETURN_API_void()
57.277 +}
57.278 +void mm_LightStyle(int style, char *val) {
57.279 + META_ENGINE_HANDLE_void(FN_LIGHTSTYLE, pfnLightStyle, (style, val));
57.280 + RETURN_API_void()
57.281 +}
57.282 +int mm_DecalIndex(const char *name) {
57.283 + META_ENGINE_HANDLE(int, 0, FN_DECALINDEX, pfnDecalIndex, (name));
57.284 + RETURN_API()
57.285 +}
57.286 +int mm_PointContents(const float *rgflVector) {
57.287 + META_ENGINE_HANDLE(int, 0, FN_POINTCONTENTS, pfnPointContents, (rgflVector));
57.288 + RETURN_API()
57.289 +}
57.290 +
57.291 +void mm_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed) {
57.292 + META_ENGINE_HANDLE_void(FN_MESSAGEBEGIN, pfnMessageBegin, (msg_dest, msg_type, pOrigin, ed));
57.293 + RETURN_API_void()
57.294 +}
57.295 +void mm_MessageEnd(void) {
57.296 + META_ENGINE_HANDLE_void(FN_MESSAGEEND, pfnMessageEnd, ());
57.297 + RETURN_API_void()
57.298 +}
57.299 +
57.300 +void mm_WriteByte(int iValue) {
57.301 + META_ENGINE_HANDLE_void(FN_WRITEBYTE, pfnWriteByte, (iValue));
57.302 + RETURN_API_void()
57.303 +}
57.304 +void mm_WriteChar(int iValue) {
57.305 + META_ENGINE_HANDLE_void(FN_WRITECHAR, pfnWriteChar, (iValue));
57.306 + RETURN_API_void()
57.307 +}
57.308 +void mm_WriteShort(int iValue) {
57.309 + META_ENGINE_HANDLE_void(FN_WRITESHORT, pfnWriteShort, (iValue));
57.310 + RETURN_API_void()
57.311 +}
57.312 +void mm_WriteLong(int iValue) {
57.313 + META_ENGINE_HANDLE_void(FN_WRITELONG, pfnWriteLong, (iValue));
57.314 + RETURN_API_void()
57.315 +}
57.316 +void mm_WriteAngle(float flValue) {
57.317 + META_ENGINE_HANDLE_void(FN_WRITEANGLE, pfnWriteAngle, (flValue));
57.318 + RETURN_API_void()
57.319 +}
57.320 +void mm_WriteCoord(float flValue) {
57.321 + META_ENGINE_HANDLE_void(FN_WRITECOORD, pfnWriteCoord, (flValue));
57.322 + RETURN_API_void()
57.323 +}
57.324 +void mm_WriteString(const char *sz) {
57.325 + META_ENGINE_HANDLE_void(FN_WRITESTRING, pfnWriteString, (sz));
57.326 + RETURN_API_void()
57.327 +}
57.328 +void mm_WriteEntity(int iValue) {
57.329 + META_ENGINE_HANDLE_void(FN_WRITEENTITY, pfnWriteEntity, (iValue));
57.330 + RETURN_API_void()
57.331 +}
57.332 +
57.333 +void mm_CVarRegister(cvar_t *pCvar) {
57.334 + META_ENGINE_HANDLE_void(FN_CVARREGISTER, pfnCVarRegister, (pCvar));
57.335 + RETURN_API_void()
57.336 +}
57.337 +float mm_CVarGetFloat(const char *szVarName) {
57.338 + META_ENGINE_HANDLE(float, 0.0, FN_CVARGETFLOAT, pfnCVarGetFloat, (szVarName));
57.339 + RETURN_API()
57.340 +}
57.341 +const char *mm_CVarGetString(const char *szVarName) {
57.342 + META_ENGINE_HANDLE(const char *, NULL, FN_CVARGETSTRING, pfnCVarGetString, (szVarName));
57.343 + RETURN_API()
57.344 +}
57.345 +void mm_CVarSetFloat(const char *szVarName, float flValue) {
57.346 + META_ENGINE_HANDLE_void(FN_CVARSETFLOAT, pfnCVarSetFloat, (szVarName, flValue));
57.347 + RETURN_API_void()
57.348 +}
57.349 +void mm_CVarSetString(const char *szVarName, const char *szValue) {
57.350 + META_ENGINE_HANDLE_void(FN_CVARSETSTRING, pfnCVarSetString, (szVarName, szValue));
57.351 + RETURN_API_void()
57.352 +}
57.353 +
57.354 +void mm_AlertMessage(ALERT_TYPE atype, char *szFmt, ...) {
57.355 +#ifndef UNFINISHED
57.356 + META_ENGINE_HANDLE_void_varargs(FN_ALERTMESSAGE, pfnAlertMessage, atype, szFmt);
57.357 +#else /* UNFINISHED */
57.358 + // Expand macro, since we need to do extra work here.
57.359 +
57.360 + // usual setup
57.361 + SETUP_API_CALLS_void(FN_ALERTMESSAGE, pfnAlertMessage, engine_info);
57.362 + char buf[MAX_STRBUF_LEN];
57.363 + va_list ap;
57.364 + int len;
57.365 + char *qmsg;
57.366 + META_DEBUG(loglevel, ("In %s: fmt=%s", pfn_string, szFmt));
57.367 + va_start(ap, szFmt);
57.368 + len=vsnprintf(buf, sizeof(buf), szFmt, ap) + 1;
57.369 + va_end(ap);
57.370 + // pass logmsg string to log parsing thread
57.371 + /// qmsg=strdup(buf);
57.372 + qmsg=(char *) malloc(len * sizeof(char));
57.373 + if(!qmsg)
57.374 + META_ERROR("malloc failed for logmsg to thread queue");
57.375 + else {
57.376 + STRNCPY(qmsg, buf, len);
57.377 + LogQueue->push(qmsg);
57.378 + }
57.379 + // usual passing to plugins/engine
57.380 + CALL_PLUGIN_API_void(P_PRE, pfnAlertMessage, (atype, "%s", buf), engine_table);
57.381 + CALL_ENGINE_API_void(pfnAlertMessage, (atype, "%s", buf));
57.382 + CALL_PLUGIN_API_void(P_POST, pfnAlertMessage, (atype, "%s", buf), engine_post_table);
57.383 +#endif /* UNFINISHED */
57.384 +
57.385 + // usual return.
57.386 + RETURN_API_void()
57.387 +}
57.388 +void mm_EngineFprintf(FILE *pfile, char *szFmt, ...) {
57.389 + META_ENGINE_HANDLE_void_varargs(FN_ENGINEFPRINTF, pfnEngineFprintf, pfile, szFmt);
57.390 + RETURN_API_void()
57.391 +}
57.392 +
57.393 +void *mm_PvAllocEntPrivateData(edict_t *pEdict, long cb) {
57.394 + META_ENGINE_HANDLE(void *, NULL, FN_PVALLOCENTPRIVATEDATA, pfnPvAllocEntPrivateData, (pEdict, cb));
57.395 + RETURN_API()
57.396 +}
57.397 +void *mm_PvEntPrivateData(edict_t *pEdict) {
57.398 + META_ENGINE_HANDLE(void *, NULL, FN_PVENTPRIVATEDATA, pfnPvEntPrivateData, (pEdict));
57.399 + RETURN_API()
57.400 +}
57.401 +void mm_FreeEntPrivateData(edict_t *pEdict) {
57.402 + META_ENGINE_HANDLE_void(FN_FREEENTPRIVATEDATA, pfnFreeEntPrivateData, (pEdict));
57.403 + RETURN_API_void()
57.404 +}
57.405 +
57.406 +const char *mm_SzFromIndex(int iString) {
57.407 + META_ENGINE_HANDLE(const char *, NULL, FN_SZFROMINDEX, pfnSzFromIndex, (iString));
57.408 + RETURN_API()
57.409 +}
57.410 +int mm_AllocString(const char *szValue) {
57.411 + META_ENGINE_HANDLE(int, 0, FN_ALLOCSTRING, pfnAllocString, (szValue));
57.412 + RETURN_API()
57.413 +}
57.414 +
57.415 +struct entvars_s *mm_GetVarsOfEnt(edict_t *pEdict) {
57.416 + META_ENGINE_HANDLE(struct entvars_s *, NULL, FN_GETVARSOFENT, pfnGetVarsOfEnt, (pEdict));
57.417 + RETURN_API()
57.418 +}
57.419 +edict_t *mm_PEntityOfEntOffset(int iEntOffset) {
57.420 + META_ENGINE_HANDLE(edict_t *, NULL, FN_PENTITYOFENTOFFSET, pfnPEntityOfEntOffset, (iEntOffset));
57.421 + RETURN_API()
57.422 +}
57.423 +int mm_EntOffsetOfPEntity(const edict_t *pEdict) {
57.424 + META_ENGINE_HANDLE(int, 0, FN_ENTOFFSETOFPENTITY, pfnEntOffsetOfPEntity, (pEdict));
57.425 + RETURN_API()
57.426 +}
57.427 +int mm_IndexOfEdict(const edict_t *pEdict) {
57.428 + META_ENGINE_HANDLE(int, 0, FN_INDEXOFEDICT, pfnIndexOfEdict, (pEdict));
57.429 + RETURN_API()
57.430 +}
57.431 +edict_t *mm_PEntityOfEntIndex(int iEntIndex) {
57.432 + META_ENGINE_HANDLE(edict_t *, NULL, FN_PENTITYOFENTINDEX, pfnPEntityOfEntIndex, (iEntIndex));
57.433 + RETURN_API()
57.434 +}
57.435 +edict_t *mm_FindEntityByVars(struct entvars_s *pvars) {
57.436 + META_ENGINE_HANDLE(edict_t *, NULL, FN_FINDENTITYBYVARS, pfnFindEntityByVars, (pvars));
57.437 + RETURN_API()
57.438 +}
57.439 +void *mm_GetModelPtr(edict_t *pEdict) {
57.440 + META_ENGINE_HANDLE(void *, NULL, FN_GETMODELPTR, pfnGetModelPtr, (pEdict));
57.441 + RETURN_API()
57.442 +}
57.443 +
57.444 +int mm_RegUserMsg(const char *pszName, int iSize) {
57.445 + int imsgid;
57.446 + MRegMsg *nmsg=NULL;
57.447 + META_ENGINE_HANDLE(int, 0, FN_REGUSERMSG, pfnRegUserMsg, (pszName, iSize));
57.448 + // Expand the macro, since we need to do extra work.
57.449 + /// RETURN_API()
57.450 + if(status==MRES_OVERRIDE) {
57.451 + META_DEBUG(loglevel, ("Returning (override) %s()", pfn_string));
57.452 + imsgid=override_ret;
57.453 + }
57.454 + else
57.455 + imsgid=orig_ret;
57.456 + // Add the msgid, name, and size to our saved list, if we haven't
57.457 + // already.
57.458 + nmsg=RegMsgs->find(imsgid);
57.459 + if(nmsg) {
57.460 + if(FStrEq(pszName, nmsg->name))
57.461 + // This name/msgid pair was already registered.
57.462 + META_DEBUG(3, ("user message registered again: name=%s, msgid=%d", pszName, imsgid));
57.463 + else
57.464 + // This msgid was previously used by a different message name.
57.465 + META_ERROR("user message id reused: msgid=%d, oldname=%s, newname=%s", imsgid, nmsg->name, pszName);
57.466 + }
57.467 + else
57.468 + RegMsgs->add(pszName, imsgid, iSize);
57.469 + return(imsgid);
57.470 +}
57.471 +
57.472 +void mm_AnimationAutomove(const edict_t *pEdict, float flTime) {
57.473 + META_ENGINE_HANDLE_void(FN_ANIMATIONAUTOMOVE, pfnAnimationAutomove, (pEdict, flTime));
57.474 + RETURN_API_void()
57.475 +}
57.476 +void mm_GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles ) {
57.477 + META_ENGINE_HANDLE_void(FN_GETBONEPOSITION, pfnGetBonePosition, (pEdict, iBone, rgflOrigin, rgflAngles));
57.478 + RETURN_API_void()
57.479 +}
57.480 +
57.481 +unsigned long mm_FunctionFromName( const char *pName ) {
57.482 + META_ENGINE_HANDLE(unsigned long, 0, FN_FUNCTIONFROMNAME, pfnFunctionFromName, (pName));
57.483 + RETURN_API()
57.484 +}
57.485 +const char *mm_NameForFunction( unsigned long function ) {
57.486 + META_ENGINE_HANDLE(const char *, NULL, FN_NAMEFORFUNCTION, pfnNameForFunction, (function));
57.487 + RETURN_API()
57.488 +}
57.489 +
57.490 +//! JOHN: engine callbacks so game DLL can print messages to individual clients
57.491 +void mm_ClientPrintf( edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg ) {
57.492 + META_ENGINE_HANDLE_void(FN_CLIENTPRINTF, pfnClientPrintf, (pEdict, ptype, szMsg));
57.493 + RETURN_API_void()
57.494 +}
57.495 +void mm_ServerPrint( const char *szMsg ) {
57.496 + META_ENGINE_HANDLE_void(FN_SERVERPRINT, pfnServerPrint, (szMsg));
57.497 + RETURN_API_void()
57.498 +}
57.499 +
57.500 +//! these 3 added so game DLL can easily access client 'cmd' strings
57.501 +const char *mm_Cmd_Args( void ) {
57.502 + META_ENGINE_HANDLE(const char *, NULL, FN_CMD_ARGS, pfnCmd_Args, ());
57.503 + RETURN_API()
57.504 +}
57.505 +const char *mm_Cmd_Argv( int argc ) {
57.506 + META_ENGINE_HANDLE(const char *, NULL, FN_CMD_ARGV, pfnCmd_Argv, (argc));
57.507 + RETURN_API()
57.508 +}
57.509 +int mm_Cmd_Argc( void ) {
57.510 + META_ENGINE_HANDLE(int, 0, FN_CMD_ARGC, pfnCmd_Argc, ());
57.511 + RETURN_API()
57.512 +}
57.513 +
57.514 +void mm_GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ) {
57.515 + META_ENGINE_HANDLE_void(FN_GETATTACHMENT, pfnGetAttachment, (pEdict, iAttachment, rgflOrigin, rgflAngles));
57.516 + RETURN_API_void()
57.517 +}
57.518 +
57.519 +void mm_CRC32_Init(CRC32_t *pulCRC) {
57.520 + META_ENGINE_HANDLE_void(FN_CRC32_INIT, pfnCRC32_Init, (pulCRC));
57.521 + RETURN_API_void()
57.522 +}
57.523 +void mm_CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len) {
57.524 + META_ENGINE_HANDLE_void(FN_CRC32_PROCESSBUFFER, pfnCRC32_ProcessBuffer, (pulCRC, p, len));
57.525 + RETURN_API_void()
57.526 +}
57.527 +void mm_CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch) {
57.528 + META_ENGINE_HANDLE_void(FN_CRC32_PROCESSBYTE, pfnCRC32_ProcessByte, (pulCRC, ch));
57.529 + RETURN_API_void()
57.530 +}
57.531 +CRC32_t mm_CRC32_Final(CRC32_t pulCRC) {
57.532 + META_ENGINE_HANDLE(CRC32_t, 0, FN_CRC32_FINAL, pfnCRC32_Final, (pulCRC));
57.533 + RETURN_API()
57.534 +}
57.535 +
57.536 +long mm_RandomLong(long lLow, long lHigh) {
57.537 + META_ENGINE_HANDLE(long, 0, FN_RANDOMLONG, pfnRandomLong, (lLow, lHigh));
57.538 + RETURN_API()
57.539 +}
57.540 +float mm_RandomFloat(float flLow, float flHigh) {
57.541 + META_ENGINE_HANDLE(float, 0.0, FN_RANDOMFLOAT, pfnRandomFloat, (flLow, flHigh));
57.542 + RETURN_API()
57.543 +}
57.544 +
57.545 +void mm_SetView(const edict_t *pClient, const edict_t *pViewent ) {
57.546 + META_ENGINE_HANDLE_void(FN_SETVIEW, pfnSetView, (pClient, pViewent));
57.547 + RETURN_API_void()
57.548 +}
57.549 +float mm_Time( void ) {
57.550 + META_ENGINE_HANDLE(float, 0.0, FN_TIME, pfnTime, ());
57.551 + RETURN_API()
57.552 +}
57.553 +void mm_CrosshairAngle(const edict_t *pClient, float pitch, float yaw) {
57.554 + META_ENGINE_HANDLE_void(FN_CROSSHAIRANGLE, pfnCrosshairAngle, (pClient, pitch, yaw));
57.555 + RETURN_API_void()
57.556 +}
57.557 +
57.558 +byte * mm_LoadFileForMe(char *filename, int *pLength) {
57.559 + META_ENGINE_HANDLE(byte *, NULL, FN_LOADFILEFORME, pfnLoadFileForMe, (filename, pLength));
57.560 + RETURN_API()
57.561 +}
57.562 +void mm_FreeFile(void *buffer) {
57.563 + META_ENGINE_HANDLE_void(FN_FREEFILE, pfnFreeFile, (buffer));
57.564 + RETURN_API_void()
57.565 +}
57.566 +
57.567 +//! trigger_endsection
57.568 +void mm_EndSection(const char *pszSectionName) {
57.569 + META_ENGINE_HANDLE_void(FN_ENDSECTION, pfnEndSection, (pszSectionName));
57.570 + RETURN_API_void()
57.571 +}
57.572 +int mm_CompareFileTime(char *filename1, char *filename2, int *iCompare) {
57.573 + META_ENGINE_HANDLE(int, 0, FN_COMPAREFILETIME, pfnCompareFileTime, (filename1, filename2, iCompare));
57.574 + RETURN_API()
57.575 +}
57.576 +void mm_GetGameDir(char *szGetGameDir) {
57.577 + META_ENGINE_HANDLE_void(FN_GETGAMEDIR, pfnGetGameDir, (szGetGameDir));
57.578 + RETURN_API_void()
57.579 +}
57.580 +void mm_Cvar_RegisterVariable(cvar_t *variable) {
57.581 + META_ENGINE_HANDLE_void(FN_CVAR_REGISTERVARIABLE, pfnCvar_RegisterVariable, (variable));
57.582 + RETURN_API_void()
57.583 +}
57.584 +void mm_FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds) {
57.585 + META_ENGINE_HANDLE_void(FN_FADECLIENTVOLUME, pfnFadeClientVolume, (pEdict, fadePercent, fadeOutSeconds, holdTime, fadeInSeconds));
57.586 + RETURN_API_void()
57.587 +}
57.588 +void mm_SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed) {
57.589 + META_ENGINE_HANDLE_void(FN_SETCLIENTMAXSPEED, pfnSetClientMaxspeed, (pEdict, fNewMaxspeed));
57.590 + RETURN_API_void()
57.591 +}
57.592 +//! returns NULL if fake client can't be created
57.593 +edict_t * mm_CreateFakeClient(const char *netname) {
57.594 + META_ENGINE_HANDLE(edict_t *, NULL, FN_CREATEFAKECLIENT, pfnCreateFakeClient, (netname));
57.595 + RETURN_API()
57.596 +}
57.597 +void mm_RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec ) {
57.598 + META_ENGINE_HANDLE_void(FN_RUNPLAYERMOVE, pfnRunPlayerMove, (fakeclient, viewangles, forwardmove, sidemove, upmove, buttons, impulse, msec));
57.599 + RETURN_API_void()
57.600 +}
57.601 +int mm_NumberOfEntities(void) {
57.602 + META_ENGINE_HANDLE(int, 0, FN_NUMBEROFENTITIES, pfnNumberOfEntities, ());
57.603 + RETURN_API()
57.604 +}
57.605 +
57.606 +//! passing in NULL gets the serverinfo
57.607 +char *mm_GetInfoKeyBuffer(edict_t *e) {
57.608 + META_ENGINE_HANDLE(char *, NULL, FN_GETINFOKEYBUFFER, pfnGetInfoKeyBuffer, (e));
57.609 + RETURN_API()
57.610 +}
57.611 +char *mm_InfoKeyValue(char *infobuffer, char *key) {
57.612 + META_ENGINE_HANDLE(char *, NULL, FN_INFOKEYVALUE, pfnInfoKeyValue, (infobuffer, key));
57.613 + RETURN_API()
57.614 +}
57.615 +void mm_SetKeyValue(char *infobuffer, char *key, char *value) {
57.616 + META_ENGINE_HANDLE_void(FN_SETKEYVALUE, pfnSetKeyValue, (infobuffer, key, value));
57.617 + RETURN_API_void()
57.618 +}
57.619 +void mm_SetClientKeyValue(int clientIndex, char *infobuffer, char *key, char *value) {
57.620 + META_ENGINE_HANDLE_void(FN_SETCLIENTKEYVALUE, pfnSetClientKeyValue, (clientIndex, infobuffer, key, value));
57.621 + RETURN_API_void()
57.622 +}
57.623 +
57.624 +int mm_IsMapValid(char *filename) {
57.625 + META_ENGINE_HANDLE(int, 0, FN_ISMAPVALID, pfnIsMapValid, (filename));
57.626 + RETURN_API()
57.627 +}
57.628 +void mm_StaticDecal( const float *origin, int decalIndex, int entityIndex, int modelIndex ) {
57.629 + META_ENGINE_HANDLE_void(FN_STATICDECAL, pfnStaticDecal, (origin, decalIndex, entityIndex, modelIndex));
57.630 + RETURN_API_void()
57.631 +}
57.632 +int mm_PrecacheGeneric(char *s) {
57.633 + META_ENGINE_HANDLE(int, 0, FN_PRECACHEGENERIC, pfnPrecacheGeneric, (s));
57.634 + RETURN_API()
57.635 +}
57.636 +//! returns the server assigned userid for this player. useful for logging frags, etc. returns -1 if the edict couldn't be found in the list of clients
57.637 +int mm_GetPlayerUserId(edict_t *e ) {
57.638 + META_ENGINE_HANDLE(int, 0, FN_GETPLAYERUSERID, pfnGetPlayerUserId, (e));
57.639 + RETURN_API()
57.640 +}
57.641 +void mm_BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed)
57.642 +{
57.643 + META_ENGINE_HANDLE_void(FN_BUILDSOUNDMSG, pfnBuildSoundMsg, (entity, channel, sample, volume, attenuation, fFlags, pitch, msg_dest, msg_type, pOrigin, ed));
57.644 + RETURN_API_void()
57.645 +}
57.646 +//! is this a dedicated server?
57.647 +int mm_IsDedicatedServer(void) {
57.648 + META_ENGINE_HANDLE(int, 0, FN_ISDEDICATEDSERVER, pfnIsDedicatedServer, ());
57.649 + RETURN_API()
57.650 +}
57.651 +cvar_t *mm_CVarGetPointer(const char *szVarName) {
57.652 + META_ENGINE_HANDLE(cvar_t *, NULL, FN_CVARGETPOINTER, pfnCVarGetPointer, (szVarName));
57.653 + RETURN_API()
57.654 +}
57.655 +//! returns the server assigned WONid for this player. useful for logging frags, etc. returns -1 if the edict couldn't be found in the list of clients
57.656 +unsigned int mm_GetPlayerWONId(edict_t *e) {
57.657 + META_ENGINE_HANDLE(unsigned int, 0, FN_GETPLAYERWONID, pfnGetPlayerWONId, (e));
57.658 + RETURN_API()
57.659 +}
57.660 +
57.661 +//! YWB 8/1/99 TFF Physics additions
57.662 +void mm_Info_RemoveKey( char *s, const char *key ) {
57.663 + META_ENGINE_HANDLE_void(FN_INFO_REMOVEKEY, pfnInfo_RemoveKey, (s, key));
57.664 + RETURN_API_void()
57.665 +}
57.666 +const char *mm_GetPhysicsKeyValue( const edict_t *pClient, const char *key ) {
57.667 + META_ENGINE_HANDLE(const char *, NULL, FN_GETPHYSICSKEYVALUE, pfnGetPhysicsKeyValue, (pClient, key));
57.668 + RETURN_API()
57.669 +}
57.670 +void mm_SetPhysicsKeyValue( const edict_t *pClient, const char *key, const char *value ) {
57.671 + META_ENGINE_HANDLE_void(FN_SETPHYSICSKEYVALUE, pfnSetPhysicsKeyValue, (pClient, key, value));
57.672 + RETURN_API_void()
57.673 +}
57.674 +const char *mm_GetPhysicsInfoString( const edict_t *pClient ) {
57.675 + META_ENGINE_HANDLE(const char *, NULL, FN_GETPHYSICSINFOSTRING, pfnGetPhysicsInfoString, (pClient));
57.676 + RETURN_API()
57.677 +}
57.678 +unsigned short mm_PrecacheEvent( int type, const char *psz ) {
57.679 + META_ENGINE_HANDLE(unsigned short, 0, FN_PRECACHEEVENT, pfnPrecacheEvent, (type, psz));
57.680 + RETURN_API()
57.681 +}
57.682 +void mm_PlaybackEvent( int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 )
57.683 +{
57.684 + META_ENGINE_HANDLE_void(FN_PLAYBACKEVENT, pfnPlaybackEvent, (flags, pInvoker, eventindex, delay, origin, angles, fparam1, fparam2, iparam1, iparam2, bparam1, bparam2));
57.685 + RETURN_API_void()
57.686 +}
57.687 +
57.688 +unsigned char *mm_SetFatPVS( float *org ) {
57.689 + META_ENGINE_HANDLE(unsigned char *, 0, FN_SETFATPVS, pfnSetFatPVS, (org));
57.690 + RETURN_API()
57.691 +}
57.692 +unsigned char *mm_SetFatPAS( float *org ) {
57.693 + META_ENGINE_HANDLE(unsigned char *, 0, FN_SETFATPAS, pfnSetFatPAS, (org));
57.694 + RETURN_API()
57.695 +}
57.696 +
57.697 +int mm_CheckVisibility( const edict_t *entity, unsigned char *pset ) {
57.698 + META_ENGINE_HANDLE(int, 0, FN_CHECKVISIBILITY, pfnCheckVisibility, (entity, pset));
57.699 + RETURN_API()
57.700 +}
57.701 +
57.702 +void mm_DeltaSetField( struct delta_s *pFields, const char *fieldname ) {
57.703 + META_ENGINE_HANDLE_void(FN_DELTASETFIELD, pfnDeltaSetField, (pFields, fieldname));
57.704 + RETURN_API_void()
57.705 +}
57.706 +void mm_DeltaUnsetField( struct delta_s *pFields, const char *fieldname ) {
57.707 + META_ENGINE_HANDLE_void(FN_DELTAUNSETFIELD, pfnDeltaUnsetField, (pFields, fieldname));
57.708 + RETURN_API_void()
57.709 +}
57.710 +void mm_DeltaAddEncoder( char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ) {
57.711 + META_ENGINE_HANDLE_void(FN_DELTAADDENCODER, pfnDeltaAddEncoder, (name, conditionalencode));
57.712 + RETURN_API_void()
57.713 +}
57.714 +int mm_GetCurrentPlayer( void ) {
57.715 + META_ENGINE_HANDLE(int, 0, FN_GETCURRENTPLAYER, pfnGetCurrentPlayer, ());
57.716 + RETURN_API()
57.717 +}
57.718 +int mm_CanSkipPlayer( const edict_t *player ) {
57.719 + META_ENGINE_HANDLE(int, 0, FN_CANSKIPPLAYER, pfnCanSkipPlayer, (player));
57.720 + RETURN_API()
57.721 +}
57.722 +int mm_DeltaFindField( struct delta_s *pFields, const char *fieldname ) {
57.723 + META_ENGINE_HANDLE(int, 0, FN_DELTAFINDFIELD, pfnDeltaFindField, (pFields, fieldname));
57.724 + RETURN_API()
57.725 +}
57.726 +void mm_DeltaSetFieldByIndex( struct delta_s *pFields, int fieldNumber ) {
57.727 + META_ENGINE_HANDLE_void(FN_DELTASETFIELDBYINDEX, pfnDeltaSetFieldByIndex, (pFields, fieldNumber));
57.728 + RETURN_API_void()
57.729 +}
57.730 +void mm_DeltaUnsetFieldByIndex( struct delta_s *pFields, int fieldNumber ) {
57.731 + META_ENGINE_HANDLE_void(FN_DELTAUNSETFIELDBYINDEX, pfnDeltaUnsetFieldByIndex, (pFields, fieldNumber));
57.732 + RETURN_API_void()
57.733 +}
57.734 +
57.735 +void mm_SetGroupMask( int mask, int op ) {
57.736 + META_ENGINE_HANDLE_void(FN_SETGROUPMASK, pfnSetGroupMask, (mask, op));
57.737 + RETURN_API_void()
57.738 +}
57.739 +
57.740 +int mm_engCreateInstancedBaseline( int classname, struct entity_state_s *baseline ) {
57.741 + META_ENGINE_HANDLE(int, 0, FN_CREATEINSTANCEDBASELINE, pfnCreateInstancedBaseline, (classname, baseline));
57.742 + RETURN_API()
57.743 +}
57.744 +void mm_Cvar_DirectSet( struct cvar_s *var, char *value ) {
57.745 + META_ENGINE_HANDLE_void(FN_CVAR_DIRECTSET, pfnCvar_DirectSet, (var, value));
57.746 + RETURN_API_void()
57.747 +}
57.748 +
57.749 +//! Forces the client and server to be running with the same version of the specified file
57.750 +//!( e.g., a player model ).
57.751 +//! Calling this has no effect in single player
57.752 +void mm_ForceUnmodified( FORCE_TYPE type, float *mins, float *maxs, const char *filename ) {
57.753 + META_ENGINE_HANDLE_void(FN_FORCEUNMODIFIED, pfnForceUnmodified, (type, mins, maxs, filename));
57.754 + RETURN_API_void()
57.755 +}
57.756 +
57.757 +void mm_GetPlayerStats( const edict_t *pClient, int *ping, int *packet_loss ) {
57.758 + META_ENGINE_HANDLE_void(FN_GETPLAYERSTATS, pfnGetPlayerStats, (pClient, ping, packet_loss));
57.759 + RETURN_API_void()
57.760 +}
57.761 +
57.762 +void mm_AddServerCommand( char *cmd_name, void (*function) (void) ) {
57.763 + META_ENGINE_HANDLE_void(FN_ADDSERVERCOMMAND, pfnAddServerCommand, (cmd_name, function));
57.764 + RETURN_API_void()
57.765 +}
57.766 +
57.767 +// Added in SDK 2.2:
57.768 +
57.769 +//! For voice communications, set which clients hear eachother.
57.770 +//! NOTE: these functions take player entity indices (starting at 1).
57.771 +qboolean mm_Voice_GetClientListening(int iReceiver, int iSender) {
57.772 + META_ENGINE_HANDLE(qboolean, false, FN_VOICE_GETCLIENTLISTENING, pfnVoice_GetClientListening, (iReceiver, iSender));
57.773 + RETURN_API()
57.774 +}
57.775 +qboolean mm_Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen) {
57.776 + META_ENGINE_HANDLE(qboolean, false, FN_VOICE_SETCLIENTLISTENING, pfnVoice_SetClientListening, (iReceiver, iSender, bListen));
57.777 + RETURN_API()
57.778 +}
57.779 +
57.780 +// Added for HL 1109 (no SDK update):
57.781 +
57.782 +const char *mm_GetPlayerAuthId(edict_t *e) {
57.783 + META_ENGINE_HANDLE(const char *, NULL, FN_GETPLAYERAUTHID, pfnGetPlayerAuthId, (e));
57.784 + RETURN_API()
57.785 +}
57.786 +
57.787 +// Added 2003/11/10 (no SDK update):
57.788 +
57.789 +void *mm_SequenceGet(const char *fileName, const char *entryName) {
57.790 + META_ENGINE_HANDLE(void *, NULL, FN_SEQUENCEGET, pfnSequenceGet, (fileName, entryName));
57.791 + RETURN_API()
57.792 +}
57.793 +
57.794 +void *mm_SequencePickSentence(const char *groupName, int pickMethod, int *picked) {
57.795 + META_ENGINE_HANDLE(void *, NULL, FN_SEQUENCEPICKSENTENCE, pfnSequencePickSentence, (groupName, pickMethod, picked));
57.796 + RETURN_API()
57.797 +}
57.798 +
57.799 +int mm_GetFileSize(char *filename) {
57.800 + META_ENGINE_HANDLE(int, 0, FN_GETFILESIZE, pfnGetFileSize, (filename));
57.801 + RETURN_API()
57.802 +}
57.803 +
57.804 +unsigned int mm_GetApproxWavePlayLen(const char *filepath) {
57.805 + META_ENGINE_HANDLE(unsigned int, 0, FN_GETAPPROXWAVEPLAYLEN, pfnGetApproxWavePlayLen, (filepath));
57.806 + RETURN_API()
57.807 +}
57.808 +
57.809 +int mm_IsCareerMatch(void) {
57.810 + META_ENGINE_HANDLE(int, 0, FN_ISCAREERMATCH, pfnIsCareerMatch, ());
57.811 + RETURN_API()
57.812 +}
57.813 +
57.814 +int mm_GetLocalizedStringLength(const char *label) {
57.815 + META_ENGINE_HANDLE(int, 0, FN_GETLOCALIZEDSTRINGLENGTH, pfnGetLocalizedStringLength, (label));
57.816 + RETURN_API()
57.817 +}
57.818 +
57.819 +void mm_RegisterTutorMessageShown(int mid) {
57.820 + META_ENGINE_HANDLE_void(FN_REGISTERTUTORMESSAGESHOWN, pfnRegisterTutorMessageShown, (mid));
57.821 + RETURN_API_void()
57.822 +}
57.823 +
57.824 +int mm_GetTimesTutorMessageShown(int mid) {
57.825 + META_ENGINE_HANDLE(int, 0, FN_GETTIMESTUTORMESSAGESHOWN, pfnGetTimesTutorMessageShown, (mid));
57.826 + RETURN_API()
57.827 +}
57.828 +
57.829 +void mm_ProcessTutorMessageDecayBuffer(int *buffer, int bufferLength) {
57.830 + META_ENGINE_HANDLE_void(FN_PROCESSTUTORMESSAGEDECAYBUFFER, pfnProcessTutorMessageDecayBuffer, (buffer, bufferLength));
57.831 + RETURN_API_void()
57.832 +}
57.833 +
57.834 +void mm_ConstructTutorMessageDecayBuffer(int *buffer, int bufferLength) {
57.835 + META_ENGINE_HANDLE_void(FN_CONSTRUCTTUTORMESSAGEDECAYBUFFER, pfnConstructTutorMessageDecayBuffer, (buffer, bufferLength));
57.836 + RETURN_API_void()
57.837 +}
57.838 +
57.839 +void mm_ResetTutorMessageDecayData(void) {
57.840 + META_ENGINE_HANDLE_void(FN_RESETTUTORMESSAGEDECAYDATA, pfnResetTutorMessageDecayData, ());
57.841 + RETURN_API_void()
57.842 +}
57.843 +
57.844 +
57.845 +enginefuncs_t meta_engfuncs = {
57.846 + mm_PrecacheModel, // pfnPrecacheModel()
57.847 + mm_PrecacheSound, // pfnPrecacheSound()
57.848 + mm_SetModel, // pfnSetModel()
57.849 + mm_ModelIndex, // pfnModelIndex()
57.850 + mm_ModelFrames, // pfnModelFrames()
57.851 +
57.852 + mm_SetSize, // pfnSetSize()
57.853 + mm_ChangeLevel, // pfnChangeLevel()
57.854 + mm_GetSpawnParms, // pfnGetSpawnParms()
57.855 + mm_SaveSpawnParms, // pfnSaveSpawnParms()
57.856 +
57.857 + mm_VecToYaw, // pfnVecToYaw()
57.858 + mm_VecToAngles, // pfnVecToAngles()
57.859 + mm_MoveToOrigin, // pfnMoveToOrigin()
57.860 + mm_ChangeYaw, // pfnChangeYaw()
57.861 + mm_ChangePitch, // pfnChangePitch()
57.862 +
57.863 + mm_FindEntityByString, // pfnFindEntityByString()
57.864 + mm_GetEntityIllum, // pfnGetEntityIllum()
57.865 + mm_FindEntityInSphere, // pfnFindEntityInSphere()
57.866 + mm_FindClientInPVS, // pfnFindClientInPVS()
57.867 + mm_EntitiesInPVS, // pfnEntitiesInPVS()
57.868 +
57.869 + mm_MakeVectors, // pfnMakeVectors()
57.870 + mm_AngleVectors, // pfnAngleVectors()
57.871 +
57.872 + mm_CreateEntity, // pfnCreateEntity()
57.873 + mm_RemoveEntity, // pfnRemoveEntity()
57.874 + mm_CreateNamedEntity, // pfnCreateNamedEntity()
57.875 +
57.876 + mm_MakeStatic, // pfnMakeStatic()
57.877 + mm_EntIsOnFloor, // pfnEntIsOnFloor()
57.878 + mm_DropToFloor, // pfnDropToFloor()
57.879 +
57.880 + mm_WalkMove, // pfnWalkMove()
57.881 + mm_SetOrigin, // pfnSetOrigin()
57.882 +
57.883 + mm_EmitSound, // pfnEmitSound()
57.884 + mm_EmitAmbientSound, // pfnEmitAmbientSound()
57.885 +
57.886 + mm_TraceLine, // pfnTraceLine()
57.887 + mm_TraceToss, // pfnTraceToss()
57.888 + mm_TraceMonsterHull, // pfnTraceMonsterHull()
57.889 + mm_TraceHull, // pfnTraceHull()
57.890 + mm_TraceModel, // pfnTraceModel()
57.891 + mm_TraceTexture, // pfnTraceTexture()
57.892 + mm_TraceSphere, // pfnTraceSphere()
57.893 + mm_GetAimVector, // pfnGetAimVector()
57.894 +
57.895 + mm_ServerCommand, // pfnServerCommand()
57.896 + mm_ServerExecute, // pfnServerExecute()
57.897 + mm_engClientCommand, // pfnClientCommand() // D'oh, ClientCommand in dllapi too.
57.898 +
57.899 + mm_ParticleEffect, // pfnParticleEffect()
57.900 + mm_LightStyle, // pfnLightStyle()
57.901 + mm_DecalIndex, // pfnDecalIndex()
57.902 + mm_PointContents, // pfnPointContents()
57.903 +
57.904 + mm_MessageBegin, // pfnMessageBegin()
57.905 + mm_MessageEnd, // pfnMessageEnd()
57.906 +
57.907 + mm_WriteByte, // pfnWriteByte()
57.908 + mm_WriteChar, // pfnWriteChar()
57.909 + mm_WriteShort, // pfnWriteShort()
57.910 + mm_WriteLong, // pfnWriteLong()
57.911 + mm_WriteAngle, // pfnWriteAngle()
57.912 + mm_WriteCoord, // pfnWriteCoord()
57.913 + mm_WriteString, // pfnWriteString()
57.914 + mm_WriteEntity, // pfnWriteEntity()
57.915 +
57.916 + mm_CVarRegister, // pfnCVarRegister()
57.917 + mm_CVarGetFloat, // pfnCVarGetFloat()
57.918 + mm_CVarGetString, // pfnCVarGetString()
57.919 + mm_CVarSetFloat, // pfnCVarSetFloat()
57.920 + mm_CVarSetString, // pfnCVarSetString()
57.921 +
57.922 + mm_AlertMessage, // pfnAlertMessage()
57.923 + mm_EngineFprintf, // pfnEngineFprintf()
57.924 +
57.925 + mm_PvAllocEntPrivateData, // pfnPvAllocEntPrivateData()
57.926 + mm_PvEntPrivateData, // pfnPvEntPrivateData()
57.927 + mm_FreeEntPrivateData, // pfnFreeEntPrivateData()
57.928 +
57.929 + mm_SzFromIndex, // pfnSzFromIndex()
57.930 + mm_AllocString, // pfnAllocString()
57.931 +
57.932 + mm_GetVarsOfEnt, // pfnGetVarsOfEnt()
57.933 + mm_PEntityOfEntOffset, // pfnPEntityOfEntOffset()
57.934 + mm_EntOffsetOfPEntity, // pfnEntOffsetOfPEntity()
57.935 + mm_IndexOfEdict, // pfnIndexOfEdict()
57.936 + mm_PEntityOfEntIndex, // pfnPEntityOfEntIndex()
57.937 + mm_FindEntityByVars, // pfnFindEntityByVars()
57.938 + mm_GetModelPtr, // pfnGetModelPtr()
57.939 +
57.940 + mm_RegUserMsg, // pfnRegUserMsg()
57.941 +
57.942 + mm_AnimationAutomove, // pfnAnimationAutomove()
57.943 + mm_GetBonePosition, // pfnGetBonePosition()
57.944 +
57.945 + mm_FunctionFromName, // pfnFunctionFromName()
57.946 + mm_NameForFunction, // pfnNameForFunction()
57.947 +
57.948 + mm_ClientPrintf, // pfnClientPrintf() //! JOHN: engine callbacks so game DLL can print messages to individual clients
57.949 + mm_ServerPrint, // pfnServerPrint()
57.950 +
57.951 + mm_Cmd_Args, // pfnCmd_Args() //! these 3 added
57.952 + mm_Cmd_Argv, // pfnCmd_Argv() //! so game DLL can easily
57.953 + mm_Cmd_Argc, // pfnCmd_Argc() //! access client 'cmd' strings
57.954 +
57.955 + mm_GetAttachment, // pfnGetAttachment()
57.956 +
57.957 + mm_CRC32_Init, // pfnCRC32_Init()
57.958 + mm_CRC32_ProcessBuffer, // pfnCRC32_ProcessBuffer()
57.959 + mm_CRC32_ProcessByte, // pfnCRC32_ProcessByte()
57.960 + mm_CRC32_Final, // pfnCRC32_Final()
57.961 +
57.962 + mm_RandomLong, // pfnRandomLong()
57.963 + mm_RandomFloat, // pfnRandomFloat()
57.964 +
57.965 + mm_SetView, // pfnSetView()
57.966 + mm_Time, // pfnTime()
57.967 + mm_CrosshairAngle, // pfnCrosshairAngle()
57.968 +
57.969 + mm_LoadFileForMe, // pfnLoadFileForMe()
57.970 + mm_FreeFile, // pfnFreeFile()
57.971 +
57.972 + mm_EndSection, // pfnEndSection() //! trigger_endsection
57.973 + mm_CompareFileTime, // pfnCompareFileTime()
57.974 + mm_GetGameDir, // pfnGetGameDir()
57.975 + mm_Cvar_RegisterVariable, // pfnCvar_RegisterVariable()
57.976 + mm_FadeClientVolume, // pfnFadeClientVolume()
57.977 + mm_SetClientMaxspeed, // pfnSetClientMaxspeed()
57.978 + mm_CreateFakeClient, // pfnCreateFakeClient() //! returns NULL if fake client can't be created
57.979 + mm_RunPlayerMove, // pfnRunPlayerMove()
57.980 + mm_NumberOfEntities, // pfnNumberOfEntities()
57.981 +
57.982 + mm_GetInfoKeyBuffer, // pfnGetInfoKeyBuffer() //! passing in NULL gets the serverinfo
57.983 + mm_InfoKeyValue, // pfnInfoKeyValue()
57.984 + mm_SetKeyValue, // pfnSetKeyValue()
57.985 + mm_SetClientKeyValue, // pfnSetClientKeyValue()
57.986 +
57.987 + mm_IsMapValid, // pfnIsMapValid()
57.988 + mm_StaticDecal, // pfnStaticDecal()
57.989 + mm_PrecacheGeneric, // pfnPrecacheGeneric()
57.990 + mm_GetPlayerUserId, // pfnGetPlayerUserId() //! returns the server assigned userid for this player.
57.991 + mm_BuildSoundMsg, // pfnBuildSoundMsg()
57.992 + mm_IsDedicatedServer, // pfnIsDedicatedServer() //! is this a dedicated server?
57.993 + mm_CVarGetPointer, // pfnCVarGetPointer()
57.994 + mm_GetPlayerWONId, // pfnGetPlayerWONId() //! returns the server assigned WONid for this player.
57.995 +
57.996 + //! YWB 8/1/99 TFF Physics additions
57.997 + mm_Info_RemoveKey, // pfnInfo_RemoveKey()
57.998 + mm_GetPhysicsKeyValue, // pfnGetPhysicsKeyValue()
57.999 + mm_SetPhysicsKeyValue, // pfnSetPhysicsKeyValue()
57.1000 + mm_GetPhysicsInfoString, // pfnGetPhysicsInfoString()
57.1001 + mm_PrecacheEvent, // pfnPrecacheEvent()
57.1002 + mm_PlaybackEvent, // pfnPlaybackEvent()
57.1003 +
57.1004 + mm_SetFatPVS, // pfnSetFatPVS()
57.1005 + mm_SetFatPAS, // pfnSetFatPAS()
57.1006 +
57.1007 + mm_CheckVisibility, // pfnCheckVisibility()
57.1008 +
57.1009 + mm_DeltaSetField, // pfnDeltaSetField()
57.1010 + mm_DeltaUnsetField, // pfnDeltaUnsetField()
57.1011 + mm_DeltaAddEncoder, // pfnDeltaAddEncoder()
57.1012 + mm_GetCurrentPlayer, // pfnGetCurrentPlayer()
57.1013 + mm_CanSkipPlayer, // pfnCanSkipPlayer()
57.1014 + mm_DeltaFindField, // pfnDeltaFindField()
57.1015 + mm_DeltaSetFieldByIndex, // pfnDeltaSetFieldByIndex()
57.1016 + mm_DeltaUnsetFieldByIndex, // pfnDeltaUnsetFieldByIndex()
57.1017 +
57.1018 + mm_SetGroupMask, // pfnSetGroupMask()
57.1019 +
57.1020 + mm_engCreateInstancedBaseline, // pfnCreateInstancedBaseline() // D'oh, CreateInstancedBaseline in dllapi too.
57.1021 + mm_Cvar_DirectSet, // pfnCvar_DirectSet()
57.1022 +
57.1023 + mm_ForceUnmodified, // pfnForceUnmodified()
57.1024 +
57.1025 + mm_GetPlayerStats, // pfnGetPlayerStats()
57.1026 +
57.1027 + mm_AddServerCommand, // pfnAddServerCommand()
57.1028 +
57.1029 + // Added in SDK 2l2:
57.1030 + mm_Voice_GetClientListening, // pfnVoice_GetClientListening()
57.1031 + mm_Voice_SetClientListening, // pfnVoice_SetClientListening()
57.1032 +
57.1033 + // Added for HL 1109 (no SDK update):
57.1034 + mm_GetPlayerAuthId, // pfnGetPlayerAuthId()
57.1035 +
57.1036 + // Added 2003/11/10 (no SDK update):
57.1037 + mm_SequenceGet, // pfnSequenceGet()
57.1038 + mm_SequencePickSentence, // pfnSequencePickSentence()
57.1039 + mm_GetFileSize, // pfnGetFileSize()
57.1040 + mm_GetApproxWavePlayLen, // pfnGetApproxWavePlayLen()
57.1041 + mm_IsCareerMatch, // pfnIsCareerMatch()
57.1042 + mm_GetLocalizedStringLength, // pfnGetLocalizedStringLength()
57.1043 + mm_RegisterTutorMessageShown, // pfnRegisterTutorMessageShown()
57.1044 + mm_GetTimesTutorMessageShown, // pfnGetTimesTutorMessageShown()
57.1045 + mm_ProcessTutorMessageDecayBuffer, // pfnProcessTutorMessageDecayBuffer()
57.1046 + mm_ConstructTutorMessageDecayBuffer, // pfnConstructTutorMessageDecayBuffer()
57.1047 + mm_ResetTutorMessageDecayData, // pfnResetTutorMessageDecayData()
57.1048 +};
58.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
58.2 +++ b/metamod/engine_api.h Tue Apr 06 07:36:14 2004 +0000
58.3 @@ -0,0 +1,416 @@
58.4 +// vi: set ts=4 sw=4 :
58.5 +// vim: set tw=75 :
58.6 +
58.7 +// engine_api.h - prototypes and typedefs for Half-Life engine functions
58.8 +
58.9 +/*
58.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
58.11 + *
58.12 + * This file is part of Metamod.
58.13 + *
58.14 + * Metamod is free software; you can redistribute it and/or modify it
58.15 + * under the terms of the GNU General Public License as published by the
58.16 + * Free Software Foundation; either version 2 of the License, or (at
58.17 + * your option) any later version.
58.18 + *
58.19 + * Metamod is distributed in the hope that it will be useful, but
58.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
58.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
58.22 + * General Public License for more details.
58.23 + *
58.24 + * You should have received a copy of the GNU General Public License
58.25 + * along with Metamod; if not, write to the Free Software Foundation,
58.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
58.27 + *
58.28 + * In addition, as a special exception, the author gives permission to
58.29 + * link the code of this program with the Half-Life Game Engine ("HL
58.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
58.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
58.32 + * respects for all of the code used other than the HL Engine and MODs
58.33 + * from Valve. If you modify this file, you may extend this exception
58.34 + * to your version of the file, but you are not obligated to do so. If
58.35 + * you do not wish to do so, delete this exception statement from your
58.36 + * version.
58.37 + *
58.38 + */
58.39 +
58.40 +#ifndef ENGINE_API_H
58.41 +#define ENGINE_API_H
58.42 +
58.43 +// Plugin's GetEngineFunctions, called by metamod.
58.44 +typedef int (*GET_ENGINE_FUNCTIONS_FN) (enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion);
58.45 +
58.46 +// According to SDK engine/eiface.h:
58.47 +//! enginefuncs_t
58.48 +//! ONLY ADD NEW FUNCTIONS TO THE END OF THIS STRUCT. INTERFACE VERSION IS FROZEN AT 138
58.49 +#define ENGINE_INTERFACE_VERSION 138
58.50 +
58.51 +extern enginefuncs_t meta_engfuncs;
58.52 +
58.53 +// From SDK engine/eiface.h:
58.54 +extern int mm_PrecacheModel(char *s);
58.55 +extern int mm_PrecacheSound(char *s);
58.56 +extern void mm_SetModel(edict_t *e, const char *m);
58.57 +extern int mm_ModelIndex(const char *m);
58.58 +extern int mm_ModelFrames(int modelIndex);
58.59 +
58.60 +extern void mm_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax);
58.61 +extern void mm_ChangeLevel(char *s1, char *s2);
58.62 +extern void mm_GetSpawnParms(edict_t *ent);
58.63 +extern void mm_SaveSpawnParms(edict_t *ent);
58.64 +
58.65 +extern float mm_VecToYaw(const float *rgflVector);
58.66 +extern void mm_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut);
58.67 +extern void mm_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType);
58.68 +extern void mm_ChangeYaw(edict_t *ent);
58.69 +extern void mm_ChangePitch(edict_t *ent);
58.70 +
58.71 +extern edict_t *mm_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue);
58.72 +extern int mm_GetEntityIllum(edict_t *pEnt);
58.73 +extern edict_t *mm_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad);
58.74 +extern edict_t *mm_FindClientInPVS(edict_t *pEdict);
58.75 +extern edict_t *mm_EntitiesInPVS(edict_t *pplayer);
58.76 +
58.77 +extern void mm_MakeVectors(const float *rgflVector);
58.78 +extern void mm_AngleVectors(const float *rgflVector, float *forward, float *right, float *up);
58.79 +
58.80 +extern edict_t *mm_CreateEntity(void);
58.81 +extern void mm_RemoveEntity(edict_t *e);
58.82 +extern edict_t *mm_CreateNamedEntity(int className);
58.83 +
58.84 +extern void mm_MakeStatic(edict_t *ent);
58.85 +extern int mm_EntIsOnFloor(edict_t *e);
58.86 +extern int mm_DropToFloor(edict_t *e);
58.87 +
58.88 +extern int mm_WalkMove(edict_t *ent, float yaw, float dist, int iMode);
58.89 +extern void mm_SetOrigin(edict_t *e, const float *rgflOrigin);
58.90 +
58.91 +extern void mm_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch);
58.92 +extern void mm_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch);
58.93 +
58.94 +extern void mm_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr);
58.95 +extern void mm_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr);
58.96 +extern int mm_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr);
58.97 +extern void mm_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr);
58.98 +extern void mm_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr);
58.99 +extern const char *mm_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 );
58.100 +extern void mm_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr);
58.101 +extern void mm_GetAimVector(edict_t *ent, float speed, float *rgflReturn);
58.102 +
58.103 +extern void mm_ServerCommand(char *str);
58.104 +extern void mm_ServerExecute(void);
58.105 +extern void ClientCommand(edict_t *pEdict, char *szFmt, ...);
58.106 +
58.107 +extern void mm_ParticleEffect(const float *org, const float *dir, float color, float count);
58.108 +extern void mm_LightStyle(int style, char *val);
58.109 +extern int mm_DecalIndex(const char *name);
58.110 +extern int mm_PointContents(const float *rgflVector);
58.111 +
58.112 +extern void mm_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed);
58.113 +extern void mm_MessageEnd(void);
58.114 +
58.115 +extern void mm_WriteByte(int iValue);
58.116 +extern void mm_WriteChar(int iValue);
58.117 +extern void mm_WriteShort(int iValue);
58.118 +extern void mm_WriteLong(int iValue);
58.119 +extern void mm_WriteAngle(float flValue);
58.120 +extern void mm_WriteCoord(float flValue);
58.121 +extern void mm_WriteString(const char *sz);
58.122 +extern void mm_WriteEntity(int iValue);
58.123 +
58.124 +extern void mm_CVarRegister(cvar_t *pCvar);
58.125 +extern float mm_CVarGetFloat(const char *szVarName);
58.126 +extern const char* mm_CVarGetString(const char *szVarName);
58.127 +extern void mm_CVarSetFloat(const char *szVarName, float flValue);
58.128 +extern void mm_CVarSetString(const char *szVarName, const char *szValue);
58.129 +
58.130 +extern void mm_AlertMessage(ALERT_TYPE atype, char *szFmt, ...);
58.131 +extern void mm_EngineFprintf(FILE *pfile, char *szFmt, ...);
58.132 +
58.133 +extern void *mm_PvAllocEntPrivateData(edict_t *pEdict, long cb);
58.134 +extern void *mm_PvEntPrivateData(edict_t *pEdict);
58.135 +extern void mm_FreeEntPrivateData(edict_t *pEdict);
58.136 +
58.137 +extern const char *mm_SzFromIndex(int iString);
58.138 +extern int mm_AllocString(const char *szValue);
58.139 +
58.140 +extern struct entvars_s *mm_GetVarsOfEnt(edict_t *pEdict);
58.141 +extern edict_t *mm_PEntityOfEntOffset(int iEntOffset);
58.142 +extern int mm_EntOffsetOfPEntity(const edict_t *pEdict);
58.143 +extern int mm_IndexOfEdict(const edict_t *pEdict);
58.144 +extern edict_t *mm_PEntityOfEntIndex(int iEntIndex);
58.145 +extern edict_t *mm_FindEntityByVars(struct entvars_s *pvars);
58.146 +extern void *mm_GetModelPtr(edict_t *pEdict);
58.147 +
58.148 +extern int mm_RegUserMsg(const char *pszName, int iSize);
58.149 +
58.150 +extern void mm_AnimationAutomove(const edict_t *pEdict, float flTime);
58.151 +extern void mm_GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles );
58.152 +
58.153 +extern unsigned long mm_FunctionFromName( const char *pName );
58.154 +extern const char *mm_NameForFunction( unsigned long function );
58.155 +
58.156 +extern void mm_ClientPrintf( edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg ); //! JOHN: engine callbacks so game DLL can print messages to individual clients
58.157 +extern void mm_ServerPrint( const char *szMsg );
58.158 +
58.159 +extern const char *mm_Cmd_Args( void ); //! these 3 added
58.160 +extern const char *mm_Cmd_Argv( int argc ); //! so game DLL can easily
58.161 +extern int mm_Cmd_Argc( void ); //! access client 'cmd' strings
58.162 +
58.163 +extern void mm_GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles );
58.164 +
58.165 +extern void mm_CRC32_Init(CRC32_t *pulCRC);
58.166 +extern void mm_CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len);
58.167 +extern void mm_CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch);
58.168 +extern CRC32_t mm_CRC32_Final(CRC32_t pulCRC);
58.169 +
58.170 +extern long mm_RandomLong(long lLow, long lHigh);
58.171 +extern float mm_RandomFloat(float flLow, float flHigh);
58.172 +
58.173 +extern void mm_SetView(const edict_t *pClient, const edict_t *pViewent );
58.174 +extern float mm_Time( void );
58.175 +extern void mm_CrosshairAngle(const edict_t *pClient, float pitch, float yaw);
58.176 +
58.177 +extern byte * mm_LoadFileForMe(char *filename, int *pLength);
58.178 +extern void mm_FreeFile(void *buffer);
58.179 +
58.180 +extern void mm_EndSection(const char *pszSectionName); //! trigger_endsection
58.181 +extern int mm_CompareFileTime(char *filename1, char *filename2, int *iCompare);
58.182 +extern void mm_GetGameDir(char *szGetGameDir);
58.183 +extern void mm_Cvar_RegisterVariable(cvar_t *variable);
58.184 +extern void mm_FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds);
58.185 +extern void mm_SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed);
58.186 +extern edict_t * mm_CreateFakeClient(const char *netname); //! returns NULL if fake client can't be created
58.187 +extern void mm_RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec );
58.188 +extern int mm_NumberOfEntities(void);
58.189 +
58.190 +extern char *mm_GetInfoKeyBuffer(edict_t *e); //! passing in NULL gets the serverinfo
58.191 +extern char *mm_InfoKeyValue(char *infobuffer, char *key);
58.192 +extern void mm_SetKeyValue(char *infobuffer, char *key, char *value);
58.193 +extern void mm_SetClientKeyValue(int clientIndex, char *infobuffer, char *key, char *value);
58.194 +
58.195 +extern int mm_IsMapValid(char *filename);
58.196 +extern void mm_StaticDecal( const float *origin, int decalIndex, int entityIndex, int modelIndex );
58.197 +extern int mm_PrecacheGeneric(char *s);
58.198 +extern int mm_GetPlayerUserId(edict_t *e ); //! returns the server assigned userid for this player. useful for logging frags, etc. returns -1 if the edict couldn't be found in the list of clients
58.199 +extern void mm_BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed);
58.200 +extern int mm_IsDedicatedServer(void);//! is this a dedicated server?
58.201 +extern cvar_t *mm_CVarGetPointer(const char *szVarName);
58.202 +extern unsigned int mm_GetPlayerWONId(edict_t *e); //! returns the server assigned WONid for this player. useful for logging frags, etc. returns -1 if the edict couldn't be found in the list of clients
58.203 +
58.204 +//! YWB 8/1/99 TFF Physics additions
58.205 +extern void mm_Info_RemoveKey( char *s, const char *key );
58.206 +extern const char *mm_GetPhysicsKeyValue( const edict_t *pClient, const char *key );
58.207 +extern void mm_SetPhysicsKeyValue( const edict_t *pClient, const char *key, const char *value );
58.208 +extern const char *mm_GetPhysicsInfoString( const edict_t *pClient );
58.209 +extern unsigned short mm_PrecacheEvent( int type, const char *psz );
58.210 +extern void mm_PlaybackEvent( int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 );
58.211 +
58.212 +extern unsigned char *mm_SetFatPVS( float *org );
58.213 +extern unsigned char *mm_SetFatPAS( float *org );
58.214 +
58.215 +extern int mm_CheckVisibility( const edict_t *entity, unsigned char *pset );
58.216 +
58.217 +extern void mm_DeltaSetField( struct delta_s *pFields, const char *fieldname );
58.218 +extern void mm_DeltaUnsetField( struct delta_s *pFields, const char *fieldname );
58.219 +extern void mm_DeltaAddEncoder( char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) );
58.220 +extern int mm_GetCurrentPlayer( void );
58.221 +extern int mm_CanSkipPlayer( const edict_t *player );
58.222 +extern int mm_DeltaFindField( struct delta_s *pFields, const char *fieldname );
58.223 +extern void mm_DeltaSetFieldByIndex( struct delta_s *pFields, int fieldNumber );
58.224 +extern void mm_DeltaUnsetFieldByIndex( struct delta_s *pFields, int fieldNumber );
58.225 +
58.226 +extern void mm_SetGroupMask( int mask, int op );
58.227 +
58.228 +extern int CreateInstancedBaseline( int classname, struct entity_state_s *baseline );
58.229 +extern void mm_Cvar_DirectSet( struct cvar_s *var, char *value );
58.230 +
58.231 +//! Forces the client and server to be running with the same version of the specified file
58.232 +//!( e.g., a player model ).
58.233 +//! Calling this has no effect in single player
58.234 +extern void mm_ForceUnmodified( FORCE_TYPE type, float *mins, float *maxs, const char *filename );
58.235 +
58.236 +extern void mm_GetPlayerStats( const edict_t *pClient, int *ping, int *packet_loss );
58.237 +
58.238 +extern void mm_AddServerCommand( char *cmd_name, void (*function) (void) );
58.239 +// Added in SDK 2.2:
58.240 +extern qboolean mm_Voice_GetClientListening(int iReceiver, int iSender);
58.241 +extern qboolean mm_Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen);
58.242 +// Added for HL 1109 (no SDK update):
58.243 +extern const char *mm_pfnGetPlayerAuthId(edict_t *e);
58.244 +// Added 2003/11/10 (no SDK update):
58.245 +extern void * mm_SequenceGet(const char* fileName, const char* entryName);
58.246 +extern void * mm_SequencePickSentence(const char* groupName, int pickMethod, int *picked);
58.247 +extern int mm_GetFileSize(char *filename);
58.248 +extern unsigned int mm_GetApproxWavePlayLen(const char *filepath);
58.249 +extern int mm_IsCareerMatch(void);
58.250 +extern int mm_GetLocalizedStringLength(const char *label);
58.251 +extern void mm_RegisterTutorMessageShown(int mid);
58.252 +extern int mm_GetTimesTutorMessageShown(int mid);
58.253 +extern void mm_ProcessTutorMessageDecayBuffer(int *buffer, int bufferLength);
58.254 +extern void mm_ConstructTutorMessageDecayBuffer(int *buffer, int bufferLength);
58.255 +extern void mm_ResetTutorMessageDecayData(void);
58.256 +
58.257 +
58.258 +// Typedefs for the above functions:
58.259 +
58.260 +typedef int (*FN_PRECACHEMODEL) (char* s);
58.261 +typedef int (*FN_PRECACHESOUND) (char* s);
58.262 +typedef void (*FN_SETMODEL) (edict_t *e, const char *m);
58.263 +typedef int (*FN_MODELINDEX) (const char *m);
58.264 +typedef int (*FN_MODELFRAMES) (int modelIndex);
58.265 +typedef void (*FN_SETSIZE) (edict_t *e, const float *rgflMin, const float *rgflMax);
58.266 +typedef void (*FN_CHANGELEVEL) (char *s1, char *s2);
58.267 +typedef void (*FN_GETSPAWNPARMS) (edict_t *ent);
58.268 +typedef void (*FN_SAVESPAWNPARMS) (edict_t *ent);
58.269 +typedef float (*FN_VECTOYAW) (const float *rgflVector);
58.270 +typedef void (*FN_VECTOANGLES) (const float *rgflVectorIn, float *rgflVectorOut);
58.271 +typedef void (*FN_MOVETOORIGIN) (edict_t *ent, const float *pflGoal, float dist, int iMoveType);
58.272 +typedef void (*FN_CHANGEYAW) (edict_t *ent);
58.273 +typedef void (*FN_CHANGEPITCH) (edict_t *ent);
58.274 +typedef edict_t * (*FN_FINDENTITYBYSTRING) (edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue);
58.275 +typedef int (*FN_GETENTITYILLUM) (edict_t *pEnt);
58.276 +typedef edict_t * (*FN_FINDENTITYINSPHERE) (edict_t *pEdictStartSearchAfter, const float *org, float rad);
58.277 +typedef edict_t * (*FN_FINDCLIENTINPVS) (edict_t *pEdict);
58.278 +typedef edict_t * (*FN_ENTITIESINPVS) (edict_t *pplayer);
58.279 +typedef void (*FN_MAKEVECTORS) (const float *rgflVector);
58.280 +typedef void (*FN_ANGLEVECTORS) (const float *rgflVector, float *forward, float *right, float *up);
58.281 +typedef edict_t * (*FN_CREATEENTITY) (void);
58.282 +typedef void (*FN_REMOVEENTITY) (edict_t *e);
58.283 +typedef edict_t * (*FN_CREATENAMEDENTITY) (int className);
58.284 +typedef void (*FN_MAKESTATIC) (edict_t *ent);
58.285 +typedef int (*FN_ENTISONFLOOR) (edict_t *e);
58.286 +typedef int (*FN_DROPTOFLOOR) (edict_t *e);
58.287 +typedef int (*FN_WALKMOVE) (edict_t *ent, float yaw, float dist, int iMode);
58.288 +typedef void (*FN_SETORIGIN) (edict_t *e, const float *rgflOrigin);
58.289 +typedef void (*FN_EMITSOUND) (edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch);
58.290 +typedef void (*FN_EMITAMBIENTSOUND) (edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch);
58.291 +typedef void (*FN_TRACELINE) (const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr);
58.292 +typedef void (*FN_TRACETOSS) (edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr);
58.293 +typedef int (*FN_TRACEMONSTERHULL) (edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr);
58.294 +typedef void (*FN_TRACEHULL) (const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr);
58.295 +typedef void (*FN_TRACEMODEL) (const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr);
58.296 +typedef const char * (*FN_TRACETEXTURE) (edict_t *pTextureEntity, const float *v1, const float *v2 );
58.297 +typedef void (*FN_TRACESPHERE) (const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr);
58.298 +typedef void (*FN_GETAIMVECTOR) (edict_t *ent, float speed, float *rgflReturn);
58.299 +typedef void (*FN_SERVERCOMMAND) (char *str);
58.300 +typedef void (*FN_SERVEREXECUTE) (void);
58.301 +typedef void (*FN_CLIENTCOMMAND_ENG) (edict_t *pEdict, char *szFmt, ...);
58.302 +typedef void (*FN_PARTICLEEFFECT) (const float *org, const float *dir, float color, float count);
58.303 +typedef void (*FN_LIGHTSTYLE) (int style, char *val);
58.304 +typedef int (*FN_DECALINDEX) (const char *name);
58.305 +typedef int (*FN_POINTCONTENTS) (const float *rgflVector);
58.306 +typedef void (*FN_MESSAGEBEGIN) (int msg_dest, int msg_type, const float *pOrigin, edict_t *ed);
58.307 +typedef void (*FN_MESSAGEEND) (void);
58.308 +typedef void (*FN_WRITEBYTE) (int iValue);
58.309 +typedef void (*FN_WRITECHAR) (int iValue);
58.310 +typedef void (*FN_WRITESHORT) (int iValue);
58.311 +typedef void (*FN_WRITELONG) (int iValue);
58.312 +typedef void (*FN_WRITEANGLE) (float flValue);
58.313 +typedef void (*FN_WRITECOORD) (float flValue);
58.314 +typedef void (*FN_WRITESTRING) (const char *sz);
58.315 +typedef void (*FN_WRITEENTITY) (int iValue);
58.316 +typedef void (*FN_CVARREGISTER) (cvar_t *pCvar);
58.317 +typedef float (*FN_CVARGETFLOAT) (const char *szVarName);
58.318 +typedef const char * (*FN_CVARGETSTRING) (const char *szVarName);
58.319 +typedef void (*FN_CVARSETFLOAT) (const char *szVarName, float flValue);
58.320 +typedef void (*FN_CVARSETSTRING) (const char *szVarName, const char *szValue);
58.321 +typedef void (*FN_ALERTMESSAGE) (ALERT_TYPE atype, char *szFmt, ...);
58.322 +typedef void (*FN_ENGINEFPRINTF) (FILE *pfile, char *szFmt, ...);
58.323 +typedef void * (*FN_PVALLOCENTPRIVATEDATA) (edict_t *pEdict, long cb);
58.324 +typedef void * (*FN_PVENTPRIVATEDATA) (edict_t *pEdict);
58.325 +typedef void (*FN_FREEENTPRIVATEDATA) (edict_t *pEdict);
58.326 +typedef const char * (*FN_SZFROMINDEX) (int iString);
58.327 +typedef int (*FN_ALLOCSTRING) (const char *szValue);
58.328 +typedef struct entvars_s * (*FN_GETVARSOFENT) (edict_t *pEdict);
58.329 +typedef edict_t * (*FN_PENTITYOFENTOFFSET) (int iEntOffset);
58.330 +typedef int (*FN_ENTOFFSETOFPENTITY) (const edict_t *pEdict);
58.331 +typedef int (*FN_INDEXOFEDICT) (const edict_t *pEdict);
58.332 +typedef edict_t * (*FN_PENTITYOFENTINDEX) (int iEntIndex);
58.333 +typedef edict_t * (*FN_FINDENTITYBYVARS) (struct entvars_s *pvars);
58.334 +typedef void * (*FN_GETMODELPTR) (edict_t *pEdict);
58.335 +typedef int (*FN_REGUSERMSG) (const char *pszName, int iSize);
58.336 +typedef void (*FN_ANIMATIONAUTOMOVE) (const edict_t *pEdict, float flTime);
58.337 +typedef void (*FN_GETBONEPOSITION) (const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles );
58.338 +typedef unsigned long (*FN_FUNCTIONFROMNAME) ( const char *pName );
58.339 +typedef const char * (*FN_NAMEFORFUNCTION) ( unsigned long function );
58.340 +typedef void (*FN_CLIENTPRINTF) ( edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg );
58.341 +typedef void (*FN_SERVERPRINT) ( const char *szMsg );
58.342 +typedef const char * (*FN_CMD_ARGS) ( void );
58.343 +typedef const char * (*FN_CMD_ARGV) ( int argc );
58.344 +typedef int (*FN_CMD_ARGC) ( void );
58.345 +typedef void (*FN_GETATTACHMENT) (const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles );
58.346 +typedef void (*FN_CRC32_INIT) (CRC32_t *pulCRC);
58.347 +typedef void (*FN_CRC32_PROCESSBUFFER) (CRC32_t *pulCRC, void *p, int len);
58.348 +typedef void (*FN_CRC32_PROCESSBYTE) (CRC32_t *pulCRC, unsigned char ch);
58.349 +typedef CRC32_t (*FN_CRC32_FINAL) (CRC32_t pulCRC);
58.350 +typedef long (*FN_RANDOMLONG) (long lLow, long lHigh);
58.351 +typedef float (*FN_RANDOMFLOAT) (float flLow, float flHigh);
58.352 +typedef void (*FN_SETVIEW) (const edict_t *pClient, const edict_t *pViewent );
58.353 +typedef float (*FN_TIME) ( void );
58.354 +typedef void (*FN_CROSSHAIRANGLE) (const edict_t *pClient, float pitch, float yaw);
58.355 +typedef byte * (*FN_LOADFILEFORME) (char *filename, int *pLength);
58.356 +typedef void (*FN_FREEFILE) (void *buffer);
58.357 +typedef void (*FN_ENDSECTION) (const char *pszSectionName);
58.358 +typedef int (*FN_COMPAREFILETIME) (char *filename1, char *filename2, int *iCompare);
58.359 +typedef void (*FN_GETGAMEDIR) (char *szGetGameDir);
58.360 +typedef void (*FN_CVAR_REGISTERVARIABLE) (cvar_t *variable);
58.361 +typedef void (*FN_FADECLIENTVOLUME) (const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds);
58.362 +typedef void (*FN_SETCLIENTMAXSPEED) (const edict_t *pEdict, float fNewMaxspeed);
58.363 +typedef edict_t * (*FN_CREATEFAKECLIENT) (const char *netname);
58.364 +typedef void (*FN_RUNPLAYERMOVE) (edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec );
58.365 +typedef int (*FN_NUMBEROFENTITIES) (void);
58.366 +typedef char * (*FN_GETINFOKEYBUFFER) (edict_t *e);
58.367 +typedef char * (*FN_INFOKEYVALUE) (char *infobuffer, char *key);
58.368 +typedef void (*FN_SETKEYVALUE) (char *infobuffer, char *key, char *value);
58.369 +typedef void (*FN_SETCLIENTKEYVALUE) (int clientIndex, char *infobuffer, char *key, char *value);
58.370 +typedef int (*FN_ISMAPVALID) (char *filename);
58.371 +typedef void (*FN_STATICDECAL) ( const float *origin, int decalIndex, int entityIndex, int modelIndex );
58.372 +typedef int (*FN_PRECACHEGENERIC) (char *s);
58.373 +typedef int (*FN_GETPLAYERUSERID) (edict_t *e );
58.374 +typedef void (*FN_BUILDSOUNDMSG) (edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed);
58.375 +typedef int (*FN_ISDEDICATEDSERVER) (void);
58.376 +typedef cvar_t * (*FN_CVARGETPOINTER) (const char *szVarName);
58.377 +typedef unsigned int (*FN_GETPLAYERWONID) (edict_t *e);
58.378 +typedef void (*FN_INFO_REMOVEKEY) ( char *s, const char *key );
58.379 +typedef const char * (*FN_GETPHYSICSKEYVALUE) ( const edict_t *pClient, const char *key );
58.380 +typedef void (*FN_SETPHYSICSKEYVALUE) ( const edict_t *pClient, const char *key, const char *value );
58.381 +typedef const char * (*FN_GETPHYSICSINFOSTRING) ( const edict_t *pClient );
58.382 +typedef unsigned short (*FN_PRECACHEEVENT) ( int type, const char *psz );
58.383 +typedef void (*FN_PLAYBACKEVENT) ( int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 );
58.384 +typedef unsigned char * (*FN_SETFATPVS) ( float *org );
58.385 +typedef unsigned char * (*FN_SETFATPAS) ( float *org );
58.386 +typedef int (*FN_CHECKVISIBILITY) ( const edict_t *entity, unsigned char *pset );
58.387 +typedef void (*FN_DELTASETFIELD) ( struct delta_s *pFields, const char *fieldname );
58.388 +typedef void (*FN_DELTAUNSETFIELD) ( struct delta_s *pFields, const char *fieldname );
58.389 +typedef void (*FN_DELTAADDENCODER) ( char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) );
58.390 +typedef int (*FN_GETCURRENTPLAYER) ( void );
58.391 +typedef int (*FN_CANSKIPPLAYER) ( const edict_t *player );
58.392 +typedef int (*FN_DELTAFINDFIELD) ( struct delta_s *pFields, const char *fieldname );
58.393 +typedef void (*FN_DELTASETFIELDBYINDEX) ( struct delta_s *pFields, int fieldNumber );
58.394 +typedef void (*FN_DELTAUNSETFIELDBYINDEX) ( struct delta_s *pFields, int fieldNumber );
58.395 +typedef void (*FN_SETGROUPMASK) ( int mask, int op );
58.396 +typedef int (*FN_CREATEINSTANCEDBASELINE) ( int classname, struct entity_state_s *baseline );
58.397 +typedef void (*FN_CVAR_DIRECTSET) ( struct cvar_s *var, char *value );
58.398 +typedef void (*FN_FORCEUNMODIFIED) ( FORCE_TYPE type, float *mins, float *maxs, const char *filename );
58.399 +typedef void (*FN_GETPLAYERSTATS) ( const edict_t *pClient, int *ping, int *packet_loss );
58.400 +typedef void (*FN_ADDSERVERCOMMAND) ( char *cmd_name, void (*function) (void) );
58.401 +// Added in SDK 2.2:
58.402 +typedef qboolean (*FN_VOICE_GETCLIENTLISTENING) (int iReceiver, int iSender);
58.403 +typedef qboolean (*FN_VOICE_SETCLIENTLISTENING) (int iReceiver, int iSender, qboolean bListen);
58.404 +// Added for HL 1109 (no SDK update):
58.405 +typedef const char * (*FN_GETPLAYERAUTHID) (edict_t *e);
58.406 +// Added 2003/11/10 (no SDK update):
58.407 +typedef void * (*FN_SEQUENCEGET) (const char* fileName, const char* entryName);
58.408 +typedef void * (*FN_SEQUENCEPICKSENTENCE) (const char* groupName, int pickMethod, int *picked);
58.409 +typedef int (*FN_GETFILESIZE) (char *filename);
58.410 +typedef unsigned int (*FN_GETAPPROXWAVEPLAYLEN) (const char *filepath);
58.411 +typedef int (*FN_ISCAREERMATCH) (void);
58.412 +typedef int (*FN_GETLOCALIZEDSTRINGLENGTH) (const char *label);
58.413 +typedef void (*FN_REGISTERTUTORMESSAGESHOWN) (int mid);
58.414 +typedef int (*FN_GETTIMESTUTORMESSAGESHOWN) (int mid);
58.415 +typedef void (*FN_PROCESSTUTORMESSAGEDECAYBUFFER) (int *buffer, int bufferLength);
58.416 +typedef void (*FN_CONSTRUCTTUTORMESSAGEDECAYBUFFER) (int *buffer, int bufferLength);
58.417 +typedef void (*FN_RESETTUTORMESSAGEDECAYDATA) (void);
58.418 +
58.419 +#endif /* ENGINE_API_H */
59.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
59.2 +++ b/metamod/ents/action Tue Apr 06 07:36:14 2004 +0000
59.3 @@ -0,0 +1,77 @@
59.4 +// vim: set ft=cpp :
59.5 +
59.6 +// Action Half-Life (version 08/23/99k)
59.7 +ammo_hkmp5
59.8 +ammo_pistol
59.9 +ammo_shells
59.10 +ammo_sniper
59.11 +item_bandolier
59.12 +item_flashlight
59.13 +item_laser
59.14 +item_silencer
59.15 +item_stealth
59.16 +item_vest
59.17 +sams_shower
59.18 +weapon_akimbob
59.19 +weapon_anaconda
59.20 +weapon_beretta
59.21 +weapon_frag
59.22 +weapon_handcannon
59.23 +weapon_hkmp5
59.24 +weapon_ithaca
59.25 +weapon_knife
59.26 +weapon_sniper
59.27 +
59.28 +// Action Half-Life
59.29 +// http://ahl.action-web.net/
59.30 +
59.31 +
59.32 +// Version Beta4
59.33 +// Additional entities, as guessed from symbol list of linux .so ...
59.34 +// (willday, Thu May 24 00:16:24 EDT 2001)
59.35 +ammo_44
59.36 +ammo_50cal
59.37 +ammo_766mm
59.38 +ammo_anaconda
59.39 +ammo_beretta
59.40 +ammo_colt
59.41 +ammo_de50
59.42 +ammo_m4
59.43 +ammo_m4clip
59.44 +ammo_msg90
59.45 +ammo_rifleclip
59.46 +ammo_rocket
59.47 +ammo_saa
59.48 +dove_flock
59.49 +dove_flyer
59.50 +follow_ent
59.51 +game_item
59.52 +game_player_die
59.53 +game_player_message
59.54 +game_roundend
59.55 +info_player_deadstart
59.56 +item_briefcase
59.57 +item_holster
59.58 +item_nightvision
59.59 +player_corpse
59.60 +thrown_knife
59.61 +trigger_coop
59.62 +trigger_deathmatch
59.63 +trigger_rndbased
59.64 +trigger_sponly
59.65 +weapon_50cal
59.66 +weapon_akimcolt
59.67 +weapon_akimsaa
59.68 +weapon_colt
59.69 +weapon_de50
59.70 +weapon_fists
59.71 +weapon_m4
59.72 +weapon_msg90
59.73 +weapon_pistol
59.74 +weapon_rifle
59.75 +weapon_saa
59.76 +
59.77 +// Additional entity from list forwarded from a dev team member.
59.78 +//
59.79 +// Date: Thu, 14 Jun 2001 23:09:46 +0200
59.80 +info_team
60.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
60.2 +++ b/metamod/ents/adrenalinegamer Tue Apr 06 07:36:14 2004 +0000
60.3 @@ -0,0 +1,28 @@
60.4 +// vim: set ft=cpp :
60.5 +
60.6 +// Adrenalinegamer
60.7 +// http://www.bullit-ag.com/
60.8 +// http://www.planethalflife.com/agmod/
60.9 +
60.10 +// Versions 3.2, 4.1
60.11 +//
60.12 +// From: "[pmers]BulliT" <[email protected]>
60.13 +// Date: Thu, 26 Jul 2001 13:13:46 +0200
60.14 +//
60.15 +// "Entities used is the same as regular HLDM standard SDK."
60.16 +
60.17 +// Version 6.0
60.18 +//
60.19 +// From: <[email protected]>
60.20 +// Date: Thu, 19 Sep 2002 18:02:37 +0200
60.21 +carried_flag_team1
60.22 +carried_flag_team2
60.23 +ctf_blueflag
60.24 +ctf_bluespawn
60.25 +ctf_redflag
60.26 +ctf_redspawn
60.27 +info_hmctfdetect
60.28 +info_player_team1
60.29 +info_player_team2
60.30 +item_flag_team1
60.31 +item_flag_team2
61.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
61.2 +++ b/metamod/ents/arg Tue Apr 06 07:36:14 2004 +0000
61.3 @@ -0,0 +1,35 @@
61.4 +// vim: set ft=cpp :
61.5 +
61.6 +// Arg 0.50
61.7 +weapon_cocogrenade
61.8 +weapon_not_in_use_grenade
61.9 +item_antidotee
61.10 +hallucgrenade
61.11 +weapon_tdagger
61.12 +weapon_longsword
61.13 +weapon_stupid
61.14 +FOOT_bolt
61.15 +ammo_FOOT
61.16 +weapon_flute
61.17 +weapon_ndagger
61.18 +FISHINGROD_bolt
61.19 +weapon_fishingrod
61.20 +ammo_FISHINGROD
61.21 +weapon_bsword
61.22 +whiskey_whisk
61.23 +weapon_whiskey
61.24 +ammo_whiskey
61.25 +weapon_mop
61.26 +
61.27 +// Arg 1.0
61.28 +item_beans
61.29 +BALLS_airball
61.30 +weapon_discoballs
61.31 +ammo_BALLS
61.32 +weapon_ga2uss
61.33 +weapon_holybsword
61.34 +weapon_aandagger
61.35 +weapon_musket
61.36 +weapon_rumgun
61.37 +monster_llama
61.38 +weapon_tucan
62.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
62.2 +++ b/metamod/ents/azuresheep Tue Apr 06 07:36:14 2004 +0000
62.3 @@ -0,0 +1,49 @@
62.4 +// vim: set ft=cpp :
62.5 +
62.6 +// Azure Sheep
62.7 +// http://www.halflifeitalia.com/azuresheep/
62.8 +
62.9 +// Version 1.0
62.10 +//
62.11 +// From: "Pierre-Marie Baty" <[email protected]>
62.12 +// Date: Mon, 25 Nov 2002 22:40:38 +0100
62.13 +
62.14 +env_spawnereffect
62.15 +monster_adrian
62.16 +monster_adrian_dead
62.17 +monster_alien_panther
62.18 +monster_archer
62.19 +monster_barniel
62.20 +monster_barniel_dead
62.21 +monster_bodypart
62.22 +monster_exp_alien_slave
62.23 +monster_garbage
62.24 +monster_gordon
62.25 +monster_gordon_dead
62.26 +monster_hevbarn
62.27 +monster_hevbarn_dead
62.28 +monster_human_spforce
62.29 +monster_human_terror
62.30 +monster_kate
62.31 +monster_kate_dead
62.32 +monster_myself
62.33 +monster_myself_dead
62.34 +monster_spforce_dead
62.35 +monster_spforce_repel
62.36 +monster_terror_dead
62.37 +monster_terror_repel
62.38 +monster_worker
62.39 +monster_worker_dead
62.40 +monster_zbarney
62.41 +trigger_die
62.42 +trigger_katehealth
62.43 +trigger_loadhazard
62.44 +trigger_sound
62.45 +weapon_9mmm41a
62.46 +weapon_barney9mmar
62.47 +weapon_barney9mmhg
62.48 +weapon_barneyhandgrenade
62.49 +weapon_barneyshotgun
62.50 +weapon_kmedkit
62.51 +weapon_poolstick
62.52 +weapon_toad
63.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
63.2 +++ b/metamod/ents/battlegrounds Tue Apr 06 07:36:14 2004 +0000
63.3 @@ -0,0 +1,72 @@
63.4 +// vim: set ft=cpp :
63.5 +
63.6 +// The Battle Grounds
63.7 +// http://www.bgmod.com/
63.8 +
63.9 +// Version 0.6
63.10 +//
63.11 +// From: "Ben Banfield" <[email protected]>
63.12 +// Date: Sun, 10 Feb 2002 18:06:36 -0000
63.13 +//
63.14 +FlyingTomaHawk
63.15 +ctb_point_one
63.16 +ctb_point_two
63.17 +info_player_observer
63.18 +info_player_team1
63.19 +info_player_team2
63.20 +info_teamplaydetect
63.21 +weapon_bandage
63.22 +weapon_knife
63.23 +weapon_musket
63.24 +weapon_pistol
63.25 +weapon_rifle
63.26 +weapon_saber
63.27 +weapon_tomahawk
63.28 +
63.29 +// Version Demo 1.0
63.30 +//
63.31 +// From: "Ben Banfield" <[email protected]>
63.32 +// Date: Fri, 8 Nov 2002 19:27:17 -0000
63.33 +//
63.34 +// Also note dllnames changed:
63.35 +// hl_i386.so -> bg_i386.so
63.36 +// hl.dll -> bg.dll
63.37 +//
63.38 +func_ctb
63.39 +func_point
63.40 +func_possesion
63.41 +info_american_line
63.42 +info_bg_detect
63.43 +info_british_line
63.44 +info_ctb_controller
63.45 +info_player_american
63.46 +info_player_british
63.47 +point_win
63.48 +weapon_BrownBess
63.49 +weapon_Charleville
63.50 +weapon_Knife
63.51 +weapon_Pennsylvania
63.52 +weapon_PistolA
63.53 +weapon_PistolB
63.54 +weapon_Revolutionnaire
63.55 +weapon_Sabre
63.56 +
63.57 +// Version 1.2
63.58 +//
63.59 +// From: Ben Banfield <[email protected]>
63.60 +// Date: Tue, 08 Jul 2003 20:36:34 +0100
63.61 +//
63.62 +func_capturepoint
63.63 +env_flag
63.64 +info_reset
63.65 +func_ammoprovider
63.66 +func_ammostripper
63.67 +
63.68 +// Version 1.2.1
63.69 +//
63.70 +// From: Ben Banfield <[email protected]>
63.71 +// Date: Fri, 31 Oct 2003 22:51:25 +0000
63.72 +//
63.73 +env_particleemitter
63.74 +game_team_score
63.75 +info_spawn_container
64.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
64.2 +++ b/metamod/ents/botman Tue Apr 06 07:36:14 2004 +0000
64.3 @@ -0,0 +1,5 @@
64.4 +// vim: set ft=cpp :
64.5 +
64.6 +// Botman's bots...
64.7 +bot
64.8 +entity_botcam
65.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
65.2 +++ b/metamod/ents/bumpercars Tue Apr 06 07:36:14 2004 +0000
65.3 @@ -0,0 +1,13 @@
65.4 +// vim: set ft=cpp :
65.5 +
65.6 +// Bumper Cars
65.7 +// http://www.planethalflife.com/bumpercars/
65.8 +//
65.9 +// From: "Sy F" <[email protected]>
65.10 +// Date: Tue, 22 Apr 2003 09:02:12 -0600
65.11 +//
65.12 +// Version "Alpha"
65.13 +
65.14 +item_powerup
65.15 +trigger_crash
65.16 +bumper_car_start
66.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
66.2 +++ b/metamod/ents/buzzybots Tue Apr 06 07:36:14 2004 +0000
66.3 @@ -0,0 +1,25 @@
66.4 +// vim: set ft=cpp :
66.5 +
66.6 +// BuzzyBots
66.7 +// http://www.buzzybots.dk/
66.8 +
66.9 +// Version 2.3
66.10 +//
66.11 +// From: "kenny" <[email protected]>
66.12 +// Date: Sat, 9 Nov 2002 02:31:15 -0700
66.13 +
66.14 +func_base
66.15 +info_chip
66.16 +info_player_blue
66.17 +info_player_observer
66.18 +info_player_red
66.19 +monster_bbturret
66.20 +npc_skrunk
66.21 +object_beacon
66.22 +object_follow
66.23 +object_superchip
66.24 +weapon_bomber
66.25 +weapon_guardian
66.26 +weapon_runner
66.27 +weapon_spy
66.28 +weapon_trooper
67.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
67.2 +++ b/metamod/ents/common Tue Apr 06 07:36:14 2004 +0000
67.3 @@ -0,0 +1,15 @@
67.4 +// vim: set ft=cpp :
67.5 +
67.6 +// Common entity names found in multiple mods (cs, firearms, frontline, action, etc).
67.7 +// Really need to be moved back into the respective mod list.
67.8 +weapon_ak47
67.9 +ammo_ak47
67.10 +weapon_aug
67.11 +ammo_aug
67.12 +weapon_frag
67.13 +weapon_knife
67.14 +weapon_flashbang
67.15 +ammo_flashbang
67.16 +weapon_ump45
67.17 +
67.18 +game_playerdie
68.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
68.2 +++ b/metamod/ents/cstrike Tue Apr 06 07:36:14 2004 +0000
68.3 @@ -0,0 +1,83 @@
68.4 +// vim: set ft=cpp :
68.5 +
68.6 +// Counter-Strike (Beta 6.2a)
68.7 +armoury_entity
68.8 +ammo_338magnum
68.9 +ammo_357sig
68.10 +ammo_45acp
68.11 +ammo_50ae
68.12 +ammo_556nato
68.13 +ammo_57mm
68.14 +ammo_762nato
68.15 +ammo_9mm
68.16 +ammo_556natobox
68.17 +ammo_flashbang
68.18 +debris
68.19 +env_bombglow
68.20 +func_bomb_target
68.21 +func_buyzone
68.22 +func_escapezone
68.23 +func_hostage_rescue
68.24 +func_vip_safetyzone
68.25 +hostage_entity
68.26 +info_bomb_target
68.27 +info_hostage_rescue
68.28 +info_vip_start
68.29 +item_assaultsuit
68.30 +item_kevlar
68.31 +item_thighpack
68.32 +weapon_ak47
68.33 +weapon_awp
68.34 +weapon_aug
68.35 +weapon_c4
68.36 +weapon_deagle
68.37 +weapon_flashbang
68.38 +weapon_g3sg1
68.39 +weapon_glock18
68.40 +weapon_hegrenade
68.41 +weapon_knife
68.42 +weapon_m249
68.43 +weapon_m3
68.44 +weapon_m4a1
68.45 +weapon_mac10
68.46 +weapon_mp5navy
68.47 +weapon_p228
68.48 +weapon_p90
68.49 +weapon_scout
68.50 +weapon_sg552
68.51 +weapon_shield
68.52 +weapon_tmp
68.53 +weapon_usp
68.54 +weapon_xm1014
68.55 +// (End cstrike 6.2a)
68.56 +
68.57 +// cstrike 6.5
68.58 +weapon_smokegrenade
68.59 +info_map_parameters
68.60 +
68.61 +// cstrike b7
68.62 +func_vehicle
68.63 +func_vehiclecontrols
68.64 +weapon_elite
68.65 +
68.66 +// cstrike 1.0
68.67 +func_grencatch
68.68 +func_weaponcheck
68.69 +weapon_fiveseven
68.70 +weapon_sg550
68.71 +
68.72 +// cstrike 1.3 (maybe earlier)
68.73 +weapon_ump45
68.74 +
68.75 +// Version 1.6
68.76 +// From: Alfred Reynolds <[email protected]>
68.77 +// Date: Thu, 16 Jan 2003 12:32:41 -0800
68.78 +//
68.79 +weapon_famas
68.80 +weapon_galil
68.81 +weapon_shieldgun
68.82 +
68.83 +// From: "judge2k91" <[email protected]>
68.84 +// Date: Wed, 15 Oct 2003 23:09:54 +0200
68.85 +env_rain
68.86 +env_snow
69.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
69.2 +++ b/metamod/ents/dayofdefeat Tue Apr 06 07:36:14 2004 +0000
69.3 @@ -0,0 +1,174 @@
69.4 +// vim: set ft=cpp :
69.5 +
69.6 +// Day of Defeat 1.0
69.7 +weapon_handgrenade_ex
69.8 +weapon_amerknife
69.9 +weapon_germanknife
69.10 +dod_object
69.11 +dod_score_ent
69.12 +dod_secondary
69.13 +func_destroy_objective
69.14 +weapon_stickgrenade_ex
69.15 +info_player_axis
69.16 +info_player_allies
69.17 +info_initial_player_axis
69.18 +info_initial_player_allies
69.19 +weapon_stickgrenade
69.20 +dod_object_goal
69.21 +trigger_control
69.22 +dod_control_point
69.23 +dod_control_point_master
69.24 +weapon_garand
69.25 +ammo_garand
69.26 +weapon_gewehr
69.27 +ammo_gewehr
69.28 +weapon_kar
69.29 +ammo_kar
69.30 +weapon_luger
69.31 +ammo_luger
69.32 +weapon_mp40
69.33 +weapon_mp44
69.34 +ammo_mp44
69.35 +ammo_mp40
69.36 +weapon_spring
69.37 +ammo_spring
69.38 +weapon_thompson
69.39 +ammo_thompson
69.40 +weapon_bar
69.41 +ammo_bar
69.42 +
69.43 +// Day of Defeat
69.44 +// http://www.dayofdefeatmod.com/
69.45 +
69.46 +
69.47 +// Version Beta1.1
69.48 +// Additional entities, as guessed from symbol list of linux .so ...
69.49 +// (willday, Sat May 26 00:47:29 EDT 2001)
69.50 +ammo_colt
69.51 +func_tankdrive
69.52 +info_player_observer
69.53 +weapon_colt
69.54 +weapon_knife
69.55 +
69.56 +// Version Beta 1.3
69.57 +// No additional entities.
69.58 +
69.59 +// Version Beta 2.0
69.60 +//
69.61 +// From: "Mugsy" <[email protected]>
69.62 +// Date: Fri, 8 Feb 2002 17:31:00 -0800
69.63 +ammo_30cal
69.64 +ammo_m1carbine
69.65 +ammo_mg34
69.66 +ammo_mg42
69.67 +dod_ammo_depot
69.68 +dod_capture_area
69.69 +dod_point_relay
69.70 +dod_round_timer
69.71 +dod_trigger_sandbag
69.72 +env_state
69.73 +info_alias
69.74 +info_group
69.75 +multi_alias
69.76 +trigger_changealias
69.77 +weapon_30cal
69.78 +weapon_gerknife
69.79 +weapon_m1carbine
69.80 +weapon_mg34
69.81 +weapon_mg42
69.82 +weapon_spade
69.83 +
69.84 +// More for Beta 2.0
69.85 +//
69.86 +// From: "CheatingDeath" <[email protected]>
69.87 +// Date: Thu, 14 Feb 2002 02:44:57 -0600
69.88 +env_customize
69.89 +env_rain
69.90 +env_warpball
69.91 +monster_allied_barney
69.92 +monster_allied_grunt
69.93 +monster_alliedgrunt_dead
69.94 +monster_axis_grunt
69.95 +monster_axisgrunt_dead
69.96 +multi_watcher
69.97 +scripted_action
69.98 +trigger_lightstyle
69.99 +trigger_startpatrol
69.100 +watcher
69.101 +
69.102 +// Version Beta 3.0
69.103 +//
69.104 +// From: "dJeyL" <[email protected]>
69.105 +// Date: Fri, 12 Jul 2002 00:40:58 +0200
69.106 +ammo_fg42
69.107 +ammo_greasegun
69.108 +ammo_k43
69.109 +ammo_scopedkar
69.110 +dod_camera
69.111 +dod_location
69.112 +dod_stats
69.113 +env_model
69.114 +info_doddetect
69.115 +info_gameplaylogic
69.116 +monster_sarge_allies
69.117 +para_roundtimer
69.118 +weapon_fg42
69.119 +weapon_greasegun
69.120 +weapon_k43
69.121 +weapon_scopedfg42
69.122 +weapon_scopedkar
69.123 +
69.124 +// Version 1.0
69.125 +//
69.126 +// From: Tim Holt <[email protected]>
69.127 +// Date: Sat, 26 Apr 2003 16:35:43 -0700
69.128 +
69.129 +ammo_bazooka
69.130 +ammo_bren
69.131 +ammo_enfield
69.132 +ammo_piat
69.133 +ammo_pschreck
69.134 +ammo_sten
69.135 +dod_preround
69.136 +weapon_bazooka
69.137 +weapon_bren
69.138 +weapon_enfield
69.139 +weapon_piat
69.140 +weapon_pschreck
69.141 +weapon_sten
69.142 +
69.143 +// Version 1.0 add'l
69.144 +//
69.145 +// From: Alfred Reynolds <[email protected]>
69.146 +// Date: Sat, 26 Apr 2003 16:17:17 -0700
69.147 +//
69.148 +// From: "Prodigy" <[email protected]>
69.149 +// Date: Thu, 1 May 2003 21:27:08 -0700
69.150 +
69.151 +ammo_generic_american
69.152 +ammo_generic_british
69.153 +ammo_generic_german
69.154 +ammo_webley
69.155 +dod_ammo
69.156 +weapon_scopedenfield
69.157 +weapon_webley
69.158 +
69.159 +// Version 1.0 add'l
69.160 +//
69.161 +// From: Alfred Reynolds <[email protected]>
69.162 +// Date: Sat, 3 May 2003 02:56:53 -0700
69.163 +
69.164 +shell_bazooka
69.165 +shell_piat
69.166 +shell_pschreck
69.167 +
69.168 +// Version 1.0 add'l
69.169 +//
69.170 +// From: Fractal <[email protected]>
69.171 +// Date: Sat, 03 May 2003 11:27:24 -0400
69.172 +
69.173 +func_tankbase
69.174 +func_tankcannon
69.175 +func_tankmg
69.176 +func_tanktarget
69.177 +particle_shooter
70.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
70.2 +++ b/metamod/ents/desertcrisis Tue Apr 06 07:36:14 2004 +0000
70.3 @@ -0,0 +1,139 @@
70.4 +// vim: set ft=cpp :
70.5 +
70.6 +// Desert Crisis
70.7 +// http://www.desertcrisis.com/
70.8 +
70.9 +// Version 1.1
70.10 +//
70.11 +// From: "Jason Gripp" <[email protected]>
70.12 +// Date: Mon, 20 May 2002 03:54:09 -0700
70.13 +boolean_multisource
70.14 +counter
70.15 +env_customize
70.16 +env_fire
70.17 +env_precip
70.18 +event_player_die
70.19 +event_player_join
70.20 +event_player_kill
70.21 +event_player_leave
70.22 +event_player_spawn
70.23 +event_round_end
70.24 +event_round_reset
70.25 +event_round_start
70.26 +event_team_die
70.27 +event_team_win
70.28 +flame_ball
70.29 +flare
70.30 +func_player_start
70.31 +func_reset
70.32 +func_use
70.33 +game_team_win
70.34 +generic_model
70.35 +info_chicken
70.36 +info_css
70.37 +info_location
70.38 +info_multiple
70.39 +info_objective
70.40 +info_orientation
70.41 +info_sprite
70.42 +info_status
70.43 +info_team
70.44 +info_upko_start
70.45 +info_usa_start
70.46 +master_key
70.47 +master_relay
70.48 +master_state
70.49 +master_team
70.50 +master_tech
70.51 +monster_alarm
70.52 +monster_c4
70.53 +npc
70.54 +object
70.55 +object_maker
70.56 +plasma_ball
70.57 +target_all_players
70.58 +target_changemaster
70.59 +target_changetarget
70.60 +target_give
70.61 +target_gravity
70.62 +target_help
70.63 +target_hurt
70.64 +target_kill
70.65 +target_print
70.66 +target_random
70.67 +target_relay
70.68 +target_reset
70.69 +target_respawn
70.70 +target_score
70.71 +target_spectate
70.72 +target_team
70.73 +target_team_score
70.74 +target_teamdie
70.75 +target_teleport
70.76 +target_weaponstrip
70.77 +throwing_knife
70.78 +thrown_knife
70.79 +timer
70.80 +trigger_hold
70.81 +trigger_npcarea
70.82 +trigger_objectcapture
70.83 +vehicle
70.84 +weapon_1100
70.85 +weapon_alarm
70.86 +weapon_c4
70.87 +weapon_chaingun
70.88 +weapon_deagle
70.89 +weapon_emsniper
70.90 +weapon_fists
70.91 +weapon_flame
70.92 +weapon_flaregun
70.93 +weapon_hk33ka2
70.94 +weapon_katana
70.95 +weapon_knife
70.96 +weapon_laser
70.97 +weapon_m79
70.98 +weapon_machete
70.99 +weapon_mp510
70.100 +weapon_mp5k
70.101 +weapon_p226
70.102 +weapon_plasma
70.103 +weapon_prifle
70.104 +weapon_sledge
70.105 +weapon_spas
70.106 +weapon_tknife
70.107 +wheel
70.108 +zone
70.109 +zone_nodamage
70.110 +
70.111 +// Version 1.5
70.112 +//
70.113 +// From: "Jason Gripp" <[email protected]>
70.114 +// Date: Mon, 7 Apr 2003 21:55:58 -0700
70.115 +env_fog
70.116 +event_round_prestart
70.117 +flame_chunk
70.118 +info_player_equip
70.119 +info_player_start_prox
70.120 +law_rocket
70.121 +master_living
70.122 +master_object_home
70.123 +master_period
70.124 +master_player
70.125 +master_round_active
70.126 +master_round_start
70.127 +master_secret
70.128 +target_animation
70.129 +target_push
70.130 +target_random_player
70.131 +target_removeobject
70.132 +target_server_command
70.133 +target_set_cvar
70.134 +target_spawnitem
70.135 +thrown_katana
70.136 +thrown_sledge
70.137 +timer_add
70.138 +trigger_speed
70.139 +weapon_lrifle
70.140 +weapon_match
70.141 +weapon_rbull
70.142 +weapon_smaw
71.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
71.2 +++ b/metamod/ents/digitalpaintball Tue Apr 06 07:36:14 2004 +0000
71.3 @@ -0,0 +1,32 @@
71.4 +// vim: set ft=cpp :
71.5 +
71.6 +// Digital Paintball
71.7 +// http://www.digitalpaintball.net/
71.8 +
71.9 +// Version 1.0
71.10 +//
71.11 +// From: <[email protected]>
71.12 +// Date: Sun, 22 Sep 2002 02:18:18 -0400 (EDT)
71.13 +cflag
71.14 +func_goalpoint
71.15 +info_paintball
71.16 +info_playerstart_blue
71.17 +info_playerstart_red
71.18 +item_flag_blue
71.19 +item_flag_center
71.20 +item_flag_red
71.21 +paintball
71.22 +trigger_teampush
71.23 +weapon_angel
71.24 +weapon_bush
71.25 +weapon_cocker
71.26 +weapon_excal
71.27 +weapon_gren
71.28 +weapon_m98
71.29 +weapon_mag
71.30 +weapon_pgp
71.31 +weapon_phantom
71.32 +weapon_pt
71.33 +weapon_shocker
71.34 +weapon_sl68
71.35 +weapon_spyder
72.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
72.2 +++ b/metamod/ents/dmclassic Tue Apr 06 07:36:14 2004 +0000
72.3 @@ -0,0 +1,37 @@
72.4 +// vim: set ft=cpp :
72.5 +
72.6 +// Deathmatch Classic
72.7 +// from Valve ?
72.8 +
72.9 +// From: Erik Johnson <[email protected]>
72.10 +// Date: Thu, 7 Jun 2001 10:08:53 -0700
72.11 +//
72.12 +// "DMC is a tribute to Quake 1 deathmatch. It looks similar, and plays
72.13 +// "pretty much identical."
72.14 +
72.15 +// Version 1
72.16 +item_armor1
72.17 +item_armor2
72.18 +item_armor3
72.19 +item_armorInv
72.20 +item_artifact_envirosuit
72.21 +item_artifact_invisibility
72.22 +item_artifact_invulnerability
72.23 +item_artifact_super_damage
72.24 +item_backpack
72.25 +item_cells
72.26 +item_rockets
72.27 +item_shells
72.28 +item_spikes
72.29 +item_weapon
72.30 +quake_nail
72.31 +quake_rocket
72.32 +teledeath
72.33 +trigger_env_hurt
72.34 +weapon_grenadelauncher
72.35 +weapon_lightning
72.36 +weapon_nailgun
72.37 +weapon_quakegun
72.38 +weapon_rocketlauncher
72.39 +weapon_supernailgun
72.40 +weapon_supershotgun
73.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
73.2 +++ b/metamod/ents/dragonmodz Tue Apr 06 07:36:14 2004 +0000
73.3 @@ -0,0 +1,33 @@
73.4 +// vim: set ft=cpp :
73.5 +
73.6 +// Dragon Mod Z
73.7 +// http://dmz.flagrun.net/
73.8 +
73.9 +// Version 1.7
73.10 +//
73.11 +// From: Satan <[email protected]>
73.12 +// Date: Thu, 19 Sep 2002 19:16:45 -0500
73.13 +beam_attack
73.14 +big_bang
73.15 +big_disk
73.16 +burning_attack
73.17 +carried_flag_team1
73.18 +carried_flag_team2
73.19 +charge
73.20 +ctf_blueflag
73.21 +ctf_redflag
73.22 +death_ball
73.23 +final_flash
73.24 +finish
73.25 +homing_balls
73.26 +info_Waterdetect
73.27 +info_player_team1
73.28 +info_player_team2
73.29 +item_flag_team1
73.30 +item_flag_team2
73.31 +kamehameha
73.32 +mazo
73.33 +mazoold
73.34 +rage
73.35 +specailbc
73.36 +spirit_bomb
74.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
74.2 +++ b/metamod/ents/esforces Tue Apr 06 07:36:14 2004 +0000
74.3 @@ -0,0 +1,75 @@
74.4 +// vim: set ft=cpp :
74.5 +
74.6 +// Earth`s Special Forces
74.7 +// http://www.esforces.com/
74.8 +
74.9 +// Version Alpha 2.0
74.10 +//
74.11 +// From: mark cook <[email protected]>
74.12 +// Date: Mon, 21 Jan 2002 10:39:07 -0700
74.13 +aura
74.14 +dragonball
74.15 +env_model
74.16 +item_dragonball
74.17 +item_sensubeanbag
74.18 +magicattack
74.19 +trip_beam
74.20 +weapon_bigbang
74.21 +weapon_burningattack
74.22 +weapon_controlled
74.23 +weapon_deathball
74.24 +weapon_destructodisc
74.25 +weapon_eyelaser
74.26 +weapon_finalflash
74.27 +weapon_fingerlaser
74.28 +weapon_friezadisc
74.29 +weapon_gallitgun
74.30 +weapon_kamehameha
74.31 +weapon_kiblast
74.32 +weapon_masenko
74.33 +weapon_melee
74.34 +weapon_spiritbomb
74.35 +
74.36 +// Version Beta 1
74.37 +//
74.38 +// From: Herwin van <[email protected]>
74.39 +// Date: Fri, 29 Nov 2002 11:03:05 -0800 (PST)
74.40 +//
74.41 +candy
74.42 +shenlong
74.43 +weapon_candy
74.44 +weapon_charged
74.45 +weapon_dragonball
74.46 +explodingattack
74.47 +weapon_finishingbuster
74.48 +weapon_genericbeam
74.49 +guidedattack
74.50 +weapon_mouthblast
74.51 +weapon_regeneration
74.52 +scatterattack
74.53 +scattersplit
74.54 +weapon_scatterbeam
74.55 +weapon_scattershot
74.56 +bean
74.57 +weapon_sensu
74.58 +weapon_solarflare
74.59 +weapon_specialbeamcannon
74.60 +//
74.61 +// From: Satan <[email protected]>
74.62 +// Date: Wed, 27 Nov 2002 23:50:19 -0500
74.63 +//
74.64 +info_evil_start
74.65 +info_good_start
74.66 +fog
74.67 +weapon_powerbeam
74.68 +weapon_shieldattack
74.69 +
74.70 +// Version Beta 1.1
74.71 +//
74.72 +// From: Satan <[email protected]>
74.73 +// Date: Mon, 19 May 2003 14:55:09 -0500
74.74 +//
74.75 +powerstruggle
74.76 +weapon_kametorpedo
74.77 +weapon_renzoku
74.78 +weapon_sword
75.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
75.2 +++ b/metamod/ents/existence Tue Apr 06 07:36:14 2004 +0000
75.3 @@ -0,0 +1,59 @@
75.4 +// vim: set ft=cpp :
75.5 +
75.6 +// Existence
75.7 +// http://www.whatisexistence.com/
75.8 +
75.9 +// Version Beta 1.3
75.10 +//
75.11 +// List provided by Alfred.
75.12 +
75.13 +AngleIMatrix
75.14 +AngleMatrix
75.15 +ammo_awm
75.16 +ammo_dualberettas
75.17 +ammo_dualscorpion
75.18 +ammo_mp5a4
75.19 +ammo_null
75.20 +ammo_stoner
75.21 +ammo_stonerscope
75.22 +ammo_stonersilencer
75.23 +ammo_uspclip
75.24 +ammo_vulcan
75.25 +ammo_xm4
75.26 +ammo_xm4slug
75.27 +drop_bomb
75.28 +func_jail_breakable
75.29 +func_jail_button
75.30 +func_jail_door
75.31 +func_jail_door_rotating
75.32 +func_jail_pushable
75.33 +info_button_phonebooth
75.34 +info_civ_start
75.35 +info_jwhite_capture
75.36 +info_jwhite_escape
75.37 +info_jwhite_rescue
75.38 +info_swat_start
75.39 +item_c4
75.40 +item_highjump
75.41 +item_newspaper
75.42 +item_speedburst
75.43 +item_upgradevest
75.44 +momentary_jail_door
75.45 +monster_civilian
75.46 +monster_civilian_dead
75.47 +monster_sitting_civilian
75.48 +player_glasses
75.49 +spy_camera
75.50 +weapon_awm
75.51 +weapon_cellphone
75.52 +weapon_dualberettas
75.53 +weapon_dualscorpion
75.54 +weapon_expgrenade
75.55 +weapon_mp5a4
75.56 +weapon_null
75.57 +weapon_spycam
75.58 +weapon_stoner
75.59 +weapon_stonerscope
75.60 +weapon_stonersilencer
75.61 +weapon_vulcan
75.62 +weapon_xm4
76.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
76.2 +++ b/metamod/ents/firearms Tue Apr 06 07:36:14 2004 +0000
76.3 @@ -0,0 +1,147 @@
76.4 +// vim: set ft=cpp :
76.5 +
76.6 +// Firearms
76.7 +// http://www.firearmsmod.com/
76.8 +
76.9 +// Version rc1
76.10 +ammo_anaconda
76.11 +ammo_benelli
76.12 +ammo_ber92f
76.13 +ammo_ber93r
76.14 +ammobox
76.15 +ammo_coltgov
76.16 +ammo_desert
76.17 +ammo_famas
76.18 +ammo_frag
76.19 +ammo_g36e
76.20 +ammo_g3a3
76.21 +ammo_m11
76.22 +ammo_m112
76.23 +ammo_m16
76.24 +ammo_m203
76.25 +ammo_m4
76.26 +ammo_m60
76.27 +ammo_m79
76.28 +ammo_m82
76.29 +ammo_mp5a5
76.30 +ammo_mp5k
76.31 +ammo_psg1
76.32 +ammo_saiga
76.33 +ammo_stg24
76.34 +bullet
76.35 +fa_drop_zone
76.36 +fa_parachute
76.37 +fa_push_flag
76.38 +fa_push_point
76.39 +fa_team_goal
76.40 +fa_team_item
76.41 +info_firearms_detect
76.42 +info_playerstart_blue
76.43 +info_playerstart_red
76.44 +item_bandage
76.45 +item_claymore
76.46 +item_flashbang
76.47 +item_frag
76.48 +item_stg24
76.49 +weapon_benelli
76.50 +weapon_ber92f
76.51 +weapon_ber93r
76.52 +weapon_claymore
76.53 +weapon_coltgov
76.54 +weapon_desert
76.55 +weapon_famas
76.56 +weapon_g36e
76.57 +weapon_g3a3
76.58 +weapon_m11
76.59 +weapon_m16
76.60 +weapon_m4
76.61 +weapon_m60
76.62 +weapon_m79
76.63 +weapon_m82
76.64 +weapon_mp5a5
76.65 +weapon_mp5k
76.66 +weapon_psg1
76.67 +weapon_saiga
76.68 +weapon_stg24
76.69 +ammo_mc51
76.70 +weapon_mc51
76.71 +
76.72 +// Version 2.2
76.73 +weapon_launcher
76.74 +ammo_launcher
76.75 +ammo_40mm
76.76 +ammo_762mmbox
76.77 +hospital
76.78 +marker
76.79 +weapmortar
76.80 +
76.81 +// Version 2.3
76.82 +weapon_bizon
76.83 +ammo_bizon
76.84 +
76.85 +// Version 2.5
76.86 +vote_llama
76.87 +fa_sd_object
76.88 +weapon_sterling
76.89 +ammo_sterling
76.90 +
76.91 +// Version 2.6
76.92 +//
76.93 +// From: alfred <[email protected]>
76.94 +// Date: Sun, 05 May 2002 12:04:31 +1000
76.95 +ammo_ak74
76.96 +ammo_concussion
76.97 +ammo_gp25
76.98 +ammo_nato308
76.99 +ammo_pkm
76.100 +ammo_sks
76.101 +ammo_ssg3000
76.102 +ammo_svd
76.103 +ammo_wa2000
76.104 +item_concussion
76.105 +mortarshell
76.106 +player_helmet
76.107 +weapon_ak74
76.108 +weapon_sks
76.109 +weapon_ssg3000
76.110 +weapon_svd
76.111 +
76.112 +// Version 2.6
76.113 +//
76.114 +// Additional ents from fa_i386.so.
76.115 +// (willday, Wed May 29 18:33:42 EDT 2002)
76.116 +ammo_ak47
76.117 +ammo_uzi
76.118 +weapon_ak47
76.119 +weapon_anaconda
76.120 +weapon_concussion
76.121 +weapon_frag
76.122 +weapon_knife
76.123 +weapon_pkm
76.124 +weapon_uzi
76.125 +
76.126 +// Version 2.6.5
76.127 +//
76.128 +// based on info at:
76.129 +// http://forums.firearmsmod.com/showthread.php?s=&threadid=26022
76.130 +env_spriteshooter
76.131 +medevac
76.132 +medivac
76.133 +trigger_zone
76.134 +
76.135 +// Version 2.7
76.136 +//
76.137 +// From: "Brian M. Schkerke" <[email protected]>
76.138 +// Date: Mon, 24 Mar 2003 14:12:37 -0600
76.139 +ammo_m249
76.140 +env_fog
76.141 +my_monster
76.142 +trip_beam
76.143 +weapon_m249
76.144 +
76.145 +// Version 2.8
76.146 +//
76.147 +// From: "[FFM2D1]Tyler_Durden" <[email protected]>
76.148 +// Date: Sat, 18 Oct 2003 13:20:53 +0200
76.149 +ammo_remington
76.150 +weapon_remington
77.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
77.2 +++ b/metamod/ents/frontline Tue Apr 06 07:36:14 2004 +0000
77.3 @@ -0,0 +1,91 @@
77.4 +// vim: set ft=cpp :
77.5 +
77.6 +// Frontline (initial version?)
77.7 +ammo_beretta
77.8 +capture_point
77.9 +ammo_mp5a2
77.10 +ammo_mp5sd
77.11 +gren_smoke
77.12 +weapon_spas12
77.13 +ammo_spas12
77.14 +my_monster
77.15 +weapon_ump45
77.16 +ammo_ump45
77.17 +info_frontline
77.18 +weapon_clip_generic
77.19 +
77.20 +// Frontline 0.46
77.21 +weapon_hk21
77.22 +ammo_hk21
77.23 +weapon_mk23
77.24 +ammo_mk23
77.25 +weapon_msg90
77.26 +ammo_msg90
77.27 +
77.28 +// Frontline 0.49
77.29 +weapon_ak5
77.30 +ammo_ak5
77.31 +
77.32 +// Frontline (more from 1.0) ("yes, my bad with this")
77.33 +trip_beam
77.34 +weapon_mp5a2
77.35 +weapon_mp5sd
77.36 +info_player_attacker
77.37 +info_player_defender
77.38 +info_player_observer
77.39 +
77.40 +// Front Line Force 1.2a
77.41 +// http://www.frontlineforce.com/
77.42 +// http://www.flfmod.com/
77.43 +//
77.44 +// From: Rat <[email protected]>
77.45 +// Date: Wed, 18 Apr 2001 01:41:56 -0700
77.46 +//
77.47 +// "I got adminmod to work with the new weapons FLF 1.2 by adding this"
77.48 +weapon_sako
77.49 +weapon_rs202m2
77.50 +ammo_sako
77.51 +ammo_rs202m2
77.52 +
77.53 +// From Botman's news page for FLF 1.2a:
77.54 +// http://www.planethalflife.com/botman/index.shtml
77.55 +target_win
77.56 +weather_genie
77.57 +weather_litnode
77.58 +
77.59 +// Additional entities for 1.2a, from list forwarded by Florian.
77.60 +ammo_famas
77.61 +ammo_m4
77.62 +ammo_mac10
77.63 +secondary_point
77.64 +weapon_beretta
77.65 +weapon_famas
77.66 +weapon_flashbang
77.67 +weapon_hegrenade
77.68 +weapon_knife
77.69 +weapon_m4
77.70 +weapon_mac10
77.71 +
77.72 +// Additional entities from source-grep, posted on AM forums:
77.73 +// SandHawk
77.74 +// 29-05 02:46am
77.75 +// http://www.cfgn.net/vbulletin/showthread.php?threadid=10427#post157571
77.76 +//
77.77 +// From: "SandHawk" <[email protected]>
77.78 +// Date: Wed, 30 May 2001 13:02:52 +1000
77.79 +//
77.80 +// "I have a complete list of ents for frontline force, just got it from
77.81 +// david, one of the programmers."
77.82 +item_capkey
77.83 +weapon_m86
77.84 +weapon_smokegrenade
77.85 +
77.86 +// Version 1.3
77.87 +// No additional entities needed.
77.88 +
77.89 +// Version 1.3a
77.90 +// Additional entities, as guessed from symbol list of linux .so ...
77.91 +// (willday, Thu Aug 2 02:48:05 EDT 2001)
77.92 +ammo_ak105
77.93 +getGlobalStunLevel
77.94 +player_flame
78.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
78.2 +++ b/metamod/ents/gangsta Tue Apr 06 07:36:14 2004 +0000
78.3 @@ -0,0 +1,53 @@
78.4 +// vim: set ft=cpp :
78.5 +
78.6 +// Gansta Wars 2.6
78.7 +bot_waypoint
78.8 +weapon_glock17
78.9 +weapon_smkgrenade
78.10 +weapon_baretta
78.11 +ammo_baretta
78.12 +weapon_ak101
78.13 +ammo_ak101
78.14 +weapon_akimbo_glocks
78.15 +weapon_bat
78.16 +weapon_baton
78.17 +item_briefcase
78.18 +item_cash
78.19 +weapon_colt
78.20 +ammo_colt
78.21 +weapon_dblshot
78.22 +weapon_dbshot
78.23 +ammo_dbshot
78.24 +info_gwars_map
78.25 +weapon_mg36
78.26 +weapon_g36k
78.27 +ammo_mg36
78.28 +ammo_g36k
78.29 +ammo_glock17
78.30 +weapon_longslide
78.31 +ammo_longslide
78.32 +weapon_mac
78.33 +ammo_mac
78.34 +ammo_mac10
78.35 +weapon_mossberg
78.36 +ammo_mossberg
78.37 +info_gangsta_dm_start
78.38 +info_italian_start
78.39 +info_russian_start
78.40 +deal_italian_start
78.41 +deal_columbian_start
78.42 +deal_swat_start
78.43 +weapon_tec9
78.44 +ammo_tec9
78.45 +item_flag1
78.46 +item_flag2
78.47 +weapon_tommygun
78.48 +ammo_tommy
78.49 +ammo_tommygun
78.50 +turf_zone
78.51 +weapon_uzi
78.52 +ammo_uzi
78.53 +// (end gansta wars 2.6)
78.54 +
78.55 +// Gangstawars
78.56 +// http://gangstawars.thebackburner.com/
79.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
79.2 +++ b/metamod/ents/gangwars Tue Apr 06 07:36:14 2004 +0000
79.3 @@ -0,0 +1,39 @@
79.4 +// vim: set ft=cpp :
79.5 +
79.6 +// Gangwars
79.7 +// http://www.gangwars.net/
79.8 +
79.9 +// Version Beta 1.0
79.10 +//
79.11 +// From: "Nawfel Tricha" <[email protected]>
79.12 +// Date: Wed, 17 Apr 2002 16:28:21 -0500
79.13 +
79.14 +weapon_1911
79.15 +weapon_92d
79.16 +weapon_ak47
79.17 +weapon_ak5
79.18 +weapon_ak5s
79.19 +weapon_aug
79.20 +weapon_b93r
79.21 +weapon_dsr1
79.22 +weapon_g36c
79.23 +weapon_g36cs
79.24 +weapon_g3sg1
79.25 +weapon_hegrenade
79.26 +weapon_knife
79.27 +weapon_lr300
79.28 +weapon_lr300s
79.29 +weapon_m16
79.30 +weapon_m3
79.31 +weapon_m4a1
79.32 +weapon_mac10
79.33 +weapon_mp5navy
79.34 +weapon_p90
79.35 +weapon_scout
79.36 +weapon_sg550
79.37 +weapon_sg552
79.38 +weapon_smokegrenade
79.39 +weapon_tmp
79.40 +weapon_ump45
79.41 +weapon_usp
79.42 +weapon_xm1014
80.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
80.2 +++ b/metamod/ents/globalwarfare Tue Apr 06 07:36:14 2004 +0000
80.3 @@ -0,0 +1,138 @@
80.4 +// vim: set ft=cpp :
80.5 +
80.6 +// Global Warfare
80.7 +// http://www.Globalwarfare.net/
80.8 +// http://www.globalwarfare.org/
80.9 +// http://www.planethalflife.com/globalwarfare/
80.10 +// http://dynamic.gamespy.com/~globalwarfare/
80.11 +
80.12 +// Version Beta 1.0
80.13 +// Entities as guessed from symbol list of linux .so ...
80.14 +// (willday, Thu Jun 7 18:02:33 EDT 2001)
80.15 +
80.16 +ammo_berettaclip
80.17 +ammo_m2
80.18 +ammo_nato
80.19 +ammo_natoclip
80.20 +func_airstrike_area
80.21 +func_capture_area
80.22 +func_land_transport
80.23 +func_landtransport
80.24 +game_endbattle
80.25 +info_airstrike_node
80.26 +info_gwGeneral_spawn
80.27 +info_gwbriefing_spawn
80.28 +info_gwinmap_spawn
80.29 +info_gwplayer_spawn
80.30 +info_gwwaiting_spawn
80.31 +info_transport_node
80.32 +item_briefcase
80.33 +item_papers
80.34 +item_parachute
80.35 +item_silvercase
80.36 +mastertoggle
80.37 +monster_a10
80.38 +monster_c4
80.39 +monster_gps
80.40 +monster_lrocket
80.41 +monster_m2
80.42 +monster_mine
80.43 +monster_prop_apache
80.44 +monster_scorpion
80.45 +monster_srocket
80.46 +transport_apc
80.47 +transport_blackhawk
80.48 +trigger_capturetimer
80.49 +trigger_captureupdate
80.50 +weapon_ak
80.51 +weapon_beretta
80.52 +weapon_binoculars
80.53 +weapon_c4
80.54 +weapon_dragunov
80.55 +weapon_famas
80.56 +weapon_g36
80.57 +weapon_grenade
80.58 +weapon_knife
80.59 +weapon_laser
80.60 +weapon_law
80.61 +weapon_m16
80.62 +weapon_m2
80.63 +weapon_medkit
80.64 +weapon_mine
80.65 +weapon_pdw
80.66 +weapon_psg
80.67 +weapon_sa80
80.68 +weapon_spas
80.69 +weapon_stinger
80.70 +
80.71 +// Version Beta 1.0 Official
80.72 +//
80.73 +// Additional entities from list provided by dev team.
80.74 +//
80.75 +// From: "Alex Peterson" <[email protected]>
80.76 +// Date: Sun, 10 Jun 2001 17:18:51 -0400
80.77 +//
80.78 +// From: "Rob G." <[email protected]>
80.79 +// Date: Sun, 10 Jun 2001 17:25:48 -0400
80.80 +
80.81 +follower_basic
80.82 +monster_parachute
80.83 +
80.84 +// Version 1.1, 1.2
80.85 +//
80.86 +// Additional entities from list provided by dev team.
80.87 +//
80.88 +// From: "Alex Peterson" <[email protected]>
80.89 +// Date: Sun, 07 Oct 2001 23:27:58 -0400
80.90 +
80.91 +ammo_40glclip
80.92 +game_clock
80.93 +weapon_1911
80.94 +weapon_40gl
80.95 +weapon_m40a1
80.96 +weapon_m60
80.97 +weapon_m96
80.98 +weapon_p99
80.99 +weapon_pkm
80.100 +weapon_sigpro
80.101 +weapon_wa2000
80.102 +
80.103 +// Version Beta 2.0
80.104 +//
80.105 +// From: "Mike hotaling" <[email protected]>
80.106 +// Date: Tue, 26 Nov 2002 17:37:17 +0000
80.107 +//
80.108 +ammo_1911clip
80.109 +ammo_ak47clip
80.110 +ammo_ak74clip
80.111 +ammo_ar10clip
80.112 +ammo_dragunovclip
80.113 +ammo_famasclip
80.114 +ammo_g36clip
80.115 +ammo_hk33clip
80.116 +ammo_m16a2clip
80.117 +ammo_m40a1clip
80.118 +ammo_m60clip
80.119 +ammo_mf2clip
80.120 +ammo_mp5pdwclip
80.121 +ammo_p99clip
80.122 +ammo_pkmclip
80.123 +ammo_psg1clip
80.124 +ammo_sa80clip
80.125 +ammo_sig245clip
80.126 +ammo_spasclip
80.127 +ammo_uziclip
80.128 +func_clouds
80.129 +func_protect
80.130 +trip_beam
80.131 +weapon_ak47
80.132 +weapon_ak74
80.133 +weapon_ar10
80.134 +weapon_gps
80.135 +weapon_hk33
80.136 +weapon_m16a2
80.137 +weapon_mf2
80.138 +weapon_mp5pdw
80.139 +weapon_psg1
80.140 +weapon_sig245
80.141 +weapon_uzi
81.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
81.2 +++ b/metamod/ents/goldeneye Tue Apr 06 07:36:14 2004 +0000
81.3 @@ -0,0 +1,71 @@
81.4 +// vim: set ft=cpp :
81.5 +//
81.6 +// GoldenEye
81.7 +// http://www.goldeneye-mod.net/
81.8 +
81.9 +// Version 1.1b
81.10 +ammo_AK47clip
81.11 +ammo_colt45clip
81.12 +ammo_d5kclip
81.13 +ammo_deagleclip
81.14 +ammo_p99clip
81.15 +ammo_rcp90clip
81.16 +ammo_veprclip
81.17 +carried_book_team1
81.18 +carried_book_team2
81.19 +info_mapdetect
81.20 +item_book_team1
81.21 +item_book_team2
81.22 +spawnfar
81.23 +weapon_colt45
81.24 +weapon_d5k
81.25 +weapon_p99
81.26 +weapon_proximity
81.27 +weapon_rcp90
81.28 +weapon_triplaser
81.29 +weapon_vepr
81.30 +
81.31 +// Version 1.5
81.32 +monster_proximity
81.33 +weapon_kf7
81.34 +ammo_kf7clip
81.35 +weapon_dd44
81.36 +ammo_dd44clip
81.37 +weapon_goldpp7
81.38 +ammo_goldpp7clip
81.39 +weapon_phantom
81.40 +ammo_phantomclip
81.41 +weapon_silverpp7
81.42 +ammo_silverpp7clip
81.43 +weapon_slappers
81.44 +weapon_zmg
81.45 +ammo_zmgclip
81.46 +
81.47 +// Version 1.6
81.48 +monster_mine
81.49 +item_armor
81.50 +knife_bolt
81.51 +ammo_knife
81.52 +weapon_pmine
81.53 +weapon_rmine
81.54 +guard_info
81.55 +info_goldeneye
81.56 +weapon_tmine
81.57 +random_weapon
81.58 +random_ammo
81.59 +spy_escape
81.60 +
81.61 +// Version 1.7
81.62 +ammo_cloaker
81.63 +ammo_areaammo
81.64 +
81.65 +// Version 1.9C
81.66 +//
81.67 +// From: "Mike Kalen" <[email protected]>
81.68 +// Date: Wed, 24 Apr 2002 21:33:57 +0000
81.69 +weapon_cougar
81.70 +ammo_cougarclip
81.71 +weapon_ar33
81.72 +ammo_ar33clip
81.73 +weapon_srifle
81.74 +ammo_srifleclip
82.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
82.2 +++ b/metamod/ents/gunman Tue Apr 06 07:36:14 2004 +0000
82.3 @@ -0,0 +1,127 @@
82.4 +// vim: set ft=cpp :
82.5 +
82.6 +// Gunman Chronicles
82.7 +// http://www.gunmanchronicles.com/
82.8 +// http://www.sierrastudios.com/games/gunman/
82.9 +// http://www.rewolfsoftware.com/gunman/
82.10 +
82.11 +// Version 1 (?)
82.12 +//
82.13 +// List provided by:
82.14 +//
82.15 +// From: "Nquik Silver" <[email protected]>
82.16 +// Date: Wed, 04 Jul 2001 00:01:46 -0500
82.17 +
82.18 +ammo_beamgunclip
82.19 +ammo_chemical
82.20 +ammo_dmlclip
82.21 +ammo_minigunClip
82.22 +button_aiwallplug
82.23 +cust_2GaussPistolSniper
82.24 +cust_2MinigunCooled
82.25 +cust_11
82.26 +cust_12
82.27 +cust_13
82.28 +cust_21
82.29 +cust_22
82.30 +cust_24
82.31 +cust_25
82.32 +cust_31
82.33 +cust_33
82.34 +cust_34
82.35 +cust_41
82.36 +cust_43
82.37 +decore_asteroid
82.38 +decore_aicore
82.39 +decore_baboon
82.40 +decore_bodygib
82.41 +decore_butterflyflock
82.42 +decore_cactus
82.43 +decore_cam
82.44 +decore_corpse
82.45 +decore_eagle
82.46 +decore_explodable
82.47 +decore_foot
82.48 +decore_goldskull
82.49 +decore_gutspile
82.50 +decore_hatgib
82.51 +decore_ice
82.52 +decore_mushroom
82.53 +decore_mushroom2
82.54 +decore_nest
82.55 +decore_pipes
82.56 +decore_prickle
82.57 +decore_pteradon
82.58 +decore_sittingtubemortar
82.59 +decore_scripted_boulder
82.60 +decore_spacebebris
82.61 +decore_swampplants
82.62 +decore_torch
82.63 +decore_torchflame
82.64 +demoman_mine
82.65 +entity_clustergod
82.66 +entity_digitgod
82.67 +entity_spritegod
82.68 +entity_volcanospew
82.69 +env_ClusterExplosion
82.70 +func_wind
82.71 +gunmancycler
82.72 +hologram_beak
82.73 +hologram_damage
82.74 +item_armor
82.75 +item_gascan
82.76 +meteor_god
82.77 +meteor_target
82.78 +monster_beak
82.79 +monster_cricket
82.80 +monster_critter
82.81 +monster_darttrap
82.82 +monster_dragonfly
82.83 +monster_flashlight
82.84 +monster_endboss
82.85 +monster_gator
82.86 +monster_gunner_friendly
82.87 +monster_hatchetfish
82.88 +monster_hiveback
82.89 +monster_human_bandit
82.90 +monster_human_chopper
82.91 +monster_human_demoman
82.92 +monster_human_gunman
82.93 +monster_human_scientist
82.94 +monster_human_unarmed
82.95 +monster_largescorpion
82.96 +monster_tank
82.97 +monster_manta
82.98 +monster_microraptor
82.99 +monster_ourano
82.100 +monster_penta
82.101 +monster_raptor
82.102 +monster_rustbattery
82.103 +monster_rustbit
82.104 +monster_rustbit_friendly
82.105 +monster_rustflier
82.106 +monster_rustgunr
82.107 +monster_sentry_mini
82.108 +monster_scorpion
82.109 +monster_targetrocket
82.110 +monster_trainingbot
82.111 +monster_tube
82.112 +monster_tube_embryo
82.113 +monster_xenome
82.114 +monster_xenome_embryo
82.115 +player_giveitems
82.116 +player_speaker
82.117 +player_togglehud
82.118 +random_speaker
82.119 +random_trigger
82.120 +sphere_explosion
82.121 +targ_speaker
82.122 +trigger_gunmanteleport
82.123 +vehicle_tank
82.124 +weapon_fists
82.125 +weapon_beamgun
82.126 +weapon_dml
82.127 +weapon_gausspistol
82.128 +weapon_minigun
82.129 +weapon_SPchemicalgun
82.130 +weapon_aicore
83.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
83.2 +++ b/metamod/ents/hlrally Tue Apr 06 07:36:14 2004 +0000
83.3 @@ -0,0 +1,19 @@
83.4 +// vim: set ft=cpp :
83.5 +
83.6 +// HL-Rally
83.7 +// http://www.hlrally.net/
83.8 +
83.9 +// Version Beta 1.0
83.10 +//
83.11 +// From: "Michael Danzo" <[email protected]>
83.12 +// Date: Thu, 7 Aug 2003 07:05:18 +0800
83.13 +//
83.14 +info_camera
83.15 +bot
83.16 +info_waypoint
83.17 +info_checkpoint
83.18 +weapon_rallyhp
83.19 +info_player_deathmatch_reverse
83.20 +info_player_start_reverse
83.21 +info_player_respawn
83.22 +info_vgui_start
84.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
84.2 +++ b/metamod/ents/holywars Tue Apr 06 07:36:14 2004 +0000
84.3 @@ -0,0 +1,24 @@
84.4 +// vim: set ft=cpp :
84.5 +
84.6 +// Holy Wars
84.7 +// http://www.planethalflife.com/holywars/
84.8 +
84.9 +// Version Beta2
84.10 +//
84.11 +// From: Satan <[email protected]>
84.12 +// Date: Thu, 19 Sep 2002 19:27:59 -0500
84.13 +ammo_doubleshotgun
84.14 +ammo_machinegun
84.15 +ammo_railgun
84.16 +ammo_rocketlauncher
84.17 +halo_base
84.18 +holywars_rocket
84.19 +info_jumppad_target
84.20 +item_armor
84.21 +jumppad_sign
84.22 +trigger_jumppad
84.23 +weapon_doubleshotgun
84.24 +weapon_jackhammer
84.25 +weapon_machinegun
84.26 +weapon_railgun
84.27 +weapon_rocketlauncher
85.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
85.2 +++ b/metamod/ents/iosoccer Tue Apr 06 07:36:14 2004 +0000
85.3 @@ -0,0 +1,64 @@
85.4 +// vim: set ft=cpp :
85.5 +
85.6 +// International Online Soccer
85.7 +// http://www.planethalflife.com/ios/
85.8 +//
85.9 +// From: "Mark Gornall" <[email protected]>
85.10 +// Date: Sun, 4 May 2003 19:41:34 +0100
85.11 +
85.12 +// Version 1.0
85.13 +football
85.14 +info_ball_start
85.15 +info_draw_slayerswin
85.16 +info_draw_vampireswin
85.17 +info_player_slayer
85.18 +info_player_vampire
85.19 +info_stadium
85.20 +info_team1_corner0
85.21 +info_team1_corner1
85.22 +info_team1_corner_player0
85.23 +info_team1_corner_player1
85.24 +info_team1_goalkick0
85.25 +info_team1_goalkick1
85.26 +info_team1_penalty_spot
85.27 +info_team1_player1
85.28 +info_team1_player10
85.29 +info_team1_player11
85.30 +info_team1_player2
85.31 +info_team1_player3
85.32 +info_team1_player4
85.33 +info_team1_player5
85.34 +info_team1_player6
85.35 +info_team1_player7
85.36 +info_team1_player8
85.37 +info_team1_player9
85.38 +info_team2_corner0
85.39 +info_team2_corner1
85.40 +info_team2_corner_player0
85.41 +info_team2_corner_player1
85.42 +info_team2_goalkick0
85.43 +info_team2_goalkick1
85.44 +info_team2_penalty_spot
85.45 +info_team2_player1
85.46 +info_team2_player10
85.47 +info_team2_player11
85.48 +info_team2_player2
85.49 +info_team2_player3
85.50 +info_team2_player4
85.51 +info_team2_player5
85.52 +info_team2_player6
85.53 +info_team2_player7
85.54 +info_team2_player8
85.55 +info_team2_player9
85.56 +info_throw_in
85.57 +trigger_GoalLine
85.58 +trigger_PenaltyBox
85.59 +trigger_SideLine
85.60 +trigger_goal
85.61 +
85.62 +// Version 2.0
85.63 +//
85.64 +// From: "Mark Gornall" <[email protected]>
85.65 +// Date: Thu, 10 Jul 2003 20:50:32 +0100
85.66 +//
85.67 +trigger_ball
86.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
86.2 +++ b/metamod/ents/jailbreak Tue Apr 06 07:36:14 2004 +0000
86.3 @@ -0,0 +1,23 @@
86.4 +// vim: set ft=cpp :
86.5 +
86.6 +// Open-Source Jailbreak
86.7 +// http://zetafleet.com/osjb/
86.8 +// http://www.planethalflife.com/jailbreak/
86.9 +// http://www.eatsleepcode.ca/~osjb/
86.10 +//
86.11 +// Version 0.95a
86.12 +
86.13 +// Removed valve ents; these should be the jailbreak-only ents.
86.14 +// (willday, Sat May 26 00:52:59 EDT 2001)
86.15 +ammo_flameammo
86.16 +func_nobuild
86.17 +info_player_jail
86.18 +jail_execute
86.19 +jail_team_master
86.20 +proj_flame
86.21 +trigger_armory
86.22 +trigger_jail
86.23 +trigger_jail_release
86.24 +trip_beam
86.25 +weapon_flamethrower
86.26 +weapon_nightstick
87.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
87.2 +++ b/metamod/ents/judgedm Tue Apr 06 07:36:14 2004 +0000
87.3 @@ -0,0 +1,47 @@
87.4 +// vim: set ft=cpp :
87.5 +
87.6 +// Judgement DM
87.7 +// http://justicedepartment.co.uk/
87.8 +//
87.9 +// Version 1.0 (?)
87.10 +//
87.11 +// From: "Paul 'MoOg' Samways" <[email protected]>
87.12 +// Date: Fri, 23 Mar 2001 13:45:25 -0000
87.13 +//
87.14 +// "I think a load are leftovers from HL that we never bothered removing"
87.15 +
87.16 +// Removed valve ents; these should be the Judgement-only ents.
87.17 +// (willday, Sat May 26 00:49:43 EDT 2001)
87.18 +ammo_grenades
87.19 +ammo_lgclip
87.20 +ammo_lrclip
87.21 +ammo_powercell
87.22 +ammo_scatterclip
87.23 +ammo_spitcarb
87.24 +ammo_spitclip
87.25 +ammo_stubcoolant
87.26 +ammo_stumpbox
87.27 +env_model
87.28 +env_sun
87.29 +func_laddertype
87.30 +game_levelmusic
87.31 +gr_shell
87.32 +in_shell
87.33 +info_defaultammo
87.34 +info_player_judge
87.35 +info_player_perp
87.36 +item_armour
87.37 +laserbolt
87.38 +powerup_candy
87.39 +rr_shell
87.40 +trip_beam
87.41 +weapon_daystick
87.42 +weapon_disintegrator
87.43 +weapon_dummy
87.44 +weapon_lawgiver
87.45 +weapon_lawrod
87.46 +weapon_scattergun
87.47 +weapon_spitcarbine
87.48 +weapon_spitpistol
87.49 +weapon_stubgun
87.50 +weapon_stumpgun
88.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
88.2 +++ b/metamod/ents/kanonball Tue Apr 06 07:36:14 2004 +0000
88.3 @@ -0,0 +1,21 @@
88.4 +// vim: set ft=cpp :
88.5 +
88.6 +// Kanonball
88.7 +// http://www.planethalflife.com/kanonball/
88.8 +
88.9 +// Version 1.01
88.10 +//
88.11 +// From: "sinistar" <[email protected]>
88.12 +// Date: Mon, 13 Oct 2003 11:45:13 -0700
88.13 +//
88.14 +crowd
88.15 +firework
88.16 +kb_fireworklauncher
88.17 +gameclock
88.18 +team_goal
88.19 +ball_launcher
88.20 +score_multiplier
88.21 +particle
88.22 +scoreboard
88.23 +scripted
88.24 +info_kb_deathmatch
89.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
89.2 +++ b/metamod/ents/monkeystrike Tue Apr 06 07:36:14 2004 +0000
89.3 @@ -0,0 +1,48 @@
89.4 +// vim: set ft=cpp :
89.5 +
89.6 +// Monkeystrike
89.7 +// http://www.monkeystrike.com/
89.8 +
89.9 +// Version 1.1
89.10 +//
89.11 +// From: Pat Magnan <[email protected]>
89.12 +// Date: Tue, 29 Jul 2003 19:08:57 -0400
89.13 +//
89.14 +arcade_points
89.15 +arrow
89.16 +banana
89.17 +env_fog
89.18 +fruit_sacrifice_point_team_green
89.19 +fruit_sacrifice_point_team_red
89.20 +func_vine
89.21 +info_banana_green_capture
89.22 +info_banana_red_capture
89.23 +info_monkey_start_team_green
89.24 +info_monkey_start_team_red
89.25 +info_msdetect
89.26 +info_observer_start
89.27 +info_particles
89.28 +item_ammoicon
89.29 +item_banana
89.30 +item_bonustime
89.31 +item_bonustime2
89.32 +item_bonustime3
89.33 +item_energy
89.34 +item_fruit
89.35 +monster_cat
89.36 +monster_skunk
89.37 +palm_tree
89.38 +pineapple
89.39 +skunk_fart
89.40 +testparticles
89.41 +trip_beam
89.42 +weapon_banana
89.43 +weapon_blowpipe
89.44 +weapon_cat
89.45 +weapon_chainsaw
89.46 +weapon_cocolauncher
89.47 +weapon_gatling
89.48 +weapon_machinegun
89.49 +weapon_plauncher
89.50 +weapon_sabers
89.51 +weapon_skunk
90.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
90.2 +++ b/metamod/ents/morbidinclination Tue Apr 06 07:36:14 2004 +0000
90.3 @@ -0,0 +1,65 @@
90.4 +// vim: set ft=cpp :
90.5 +
90.6 +// Morbid Inclination
90.7 +// http://www.planethalflife.com/morbid
90.8 +//
90.9 +// From: "Dimitri Gillis" <[email protected]>
90.10 +// Date: Sun, 4 May 2003 14:47:29 +0200 (Romance (zomertijd))
90.11 +
90.12 +// Version 1.0
90.13 +Electro_Bolt
90.14 +SA_Model
90.15 +ammo_FTclip
90.16 +ammo_flameclip
90.17 +ammo_freezeclip
90.18 +blade
90.19 +bone_follow
90.20 +bot
90.21 +entity_botcam
90.22 +env_rain
90.23 +fire_ball
90.24 +freeze_gel
90.25 +func_jail_release
90.26 +func_particle_system
90.27 +human_flashgrenade
90.28 +info_alien_return
90.29 +info_alien_start
90.30 +info_bone
90.31 +info_bone_spawn
90.32 +info_escape_start
90.33 +info_human_return
90.34 +info_human_start
90.35 +info_jail_start
90.36 +info_model
90.37 +info_monster_return
90.38 +info_monster_start
90.39 +info_morbid
90.40 +info_morbid_start
90.41 +info_robot_return
90.42 +info_robot_start
90.43 +info_team_base
90.44 +monster_player
90.45 +my_monster
90.46 +plasma
90.47 +proj_blaster
90.48 +return_axe
90.49 +trip_beam
90.50 +weapon_FT
90.51 +weapon_axe
90.52 +weapon_blaster
90.53 +weapon_bola
90.54 +weapon_claws
90.55 +weapon_electro
90.56 +weapon_flamethrower
90.57 +weapon_flashbang
90.58 +weapon_freeze
90.59 +weapon_jumpjet
90.60 +weapon_kawauso
90.61 +weapon_killsaw
90.62 +weapon_knife
90.63 +weapon_laser_rifle
90.64 +weapon_m21
90.65 +weapon_m96
90.66 +weapon_powerblade
90.67 +weapon_throwaxe
90.68 +weapon_warhammer
91.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
91.2 +++ b/metamod/ents/naturalselection Tue Apr 06 07:36:14 2004 +0000
91.3 @@ -0,0 +1,130 @@
91.4 +// vim: set ft=cpp :
91.5 +
91.6 +// Natural Selection
91.7 +// http://www.natural-selection.org/
91.8 +// http://www.readyroom.org/
91.9 +
91.10 +// Version 1.0
91.11 +//
91.12 +// From: "Charles Cleveland" <[email protected]>
91.13 +// Date: Wed, 10 Jul 2002 20:49:25 +0000
91.14 +//
91.15 +alienresourcetower
91.16 +defensechamber
91.17 +env_fog
91.18 +env_gamma
91.19 +env_particles
91.20 +env_particles_custom
91.21 +func_nobuild
91.22 +func_resource
91.23 +func_seethrough
91.24 +func_seethroughdoor
91.25 +func_weldable
91.26 +gren_projectile
91.27 +info_gameplay
91.28 +info_join_autoassign
91.29 +info_join_team
91.30 +info_leave_game
91.31 +info_location
91.32 +info_mapinfo
91.33 +info_spectate
91.34 +info_team_start
91.35 +item_genericammo
91.36 +item_health
91.37 +movementchamber
91.38 +nuke
91.39 +offensechamber
91.40 +phasegate
91.41 +resourcetower
91.42 +scan
91.43 +sensorychamber
91.44 +siegeturret
91.45 +spitgunprojectile
91.46 +sporegunprojectile
91.47 +target_mp3audio
91.48 +team_advarmory
91.49 +team_armory
91.50 +team_armslab
91.51 +team_chemlab
91.52 +team_command
91.53 +team_hive
91.54 +team_infportal
91.55 +team_medlab
91.56 +team_nukeplant
91.57 +team_observatory
91.58 +team_prototypelab
91.59 +team_turretfactory
91.60 +team_webstrand
91.61 +trigger_presence
91.62 +trigger_random
91.63 +trigger_script
91.64 +turret
91.65 +umbracloud
91.66 +weapon_acidrocket
91.67 +weapon_acidrocketgun
91.68 +weapon_babblergun
91.69 +weapon_babblerprojectile
91.70 +weapon_bilebomb
91.71 +weapon_bilebombgun
91.72 +weapon_bite2gun
91.73 +weapon_bitegun
91.74 +weapon_blink
91.75 +weapon_charge
91.76 +weapon_claws
91.77 +weapon_divinewind
91.78 +weapon_flamegun
91.79 +weapon_grenade
91.80 +weapon_grenadegun
91.81 +weapon_healingspray
91.82 +weapon_heavymachinegun
91.83 +weapon_knife
91.84 +weapon_leap
91.85 +weapon_machinegun
91.86 +weapon_mine
91.87 +weapon_nukegun
91.88 +weapon_paralysis
91.89 +weapon_parasite
91.90 +weapon_pistol
91.91 +weapon_primalscream
91.92 +weapon_shotgun
91.93 +weapon_spikegun
91.94 +weapon_spit
91.95 +weapon_spore
91.96 +weapon_swipe
91.97 +weapon_umbra
91.98 +weapon_webspinner
91.99 +weapon_welder
91.100 +webgunprojectile
91.101 +
91.102 +// Version 1.0 add'l
91.103 +//
91.104 +// From: "Charlie Cleveland" <[email protected]>
91.105 +// Date: Mon, 16 Sep 2002 12:46:55 -0400
91.106 +//
91.107 +item_heavyarmor
91.108 +item_jetpack
91.109 +
91.110 +// Version 1.0 add'l
91.111 +//
91.112 +// From: "Charlie Cleveland" <[email protected]>
91.113 +// Date: Fri, 27 Sep 2002 10:57:54 -0400
91.114 +//
91.115 +team_advturretfactory
91.116 +
91.117 +// Version 1.1
91.118 +//
91.119 +// From: "Prodigy" <[email protected]>
91.120 +// Date: Mon, 28 Apr 2003 02:57:33 -0700
91.121 +//
91.122 +kwSpikeProjectile
91.123 +umbraprojectile
91.124 +weapon_devour
91.125 +weapon_stomp
91.126 +
91.127 +// Version 2.0
91.128 +//
91.129 +// From: "Charlie Cleveland" <[email protected]>
91.130 +// Date: Tue, 8 Jul 2003 16:19:59 -0400
91.131 +//
91.132 +item_mine
91.133 +weapon_metabolize
92.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
92.2 +++ b/metamod/ents/opforce Tue Apr 06 07:36:14 2004 +0000
92.3 @@ -0,0 +1,109 @@
92.4 +// vim: set ft=cpp :
92.5 +
92.6 +// Opposing Force
92.7 +ammo_556
92.8 +ammo_762
92.9 +ammo_eagleclip
92.10 +ammo_spore
92.11 +charged_bolt
92.12 +displacer_ball
92.13 +eagle_laser
92.14 +env_blowercannon
92.15 +env_electrified_wire
92.16 +env_genewormcloud
92.17 +env_genewormspawn
92.18 +env_rope
92.19 +env_spritetrain
92.20 +func_op4mortarcontroller
92.21 +func_tank_of
92.22 +func_tankcontrols_of
92.23 +func_tanklaser_of
92.24 +func_tankmortar_of
92.25 +func_tankrocket_of
92.26 +gonomeguts
92.27 +grapple_tip
92.28 +hvr_blkop_rocket
92.29 +info_ctfdetect
92.30 +info_ctfspawn
92.31 +info_ctfspawn_powerup
92.32 +info_displacer_earth_target
92.33 +info_displacer_xen_target
92.34 +info_pitworm
92.35 +info_pitworm_steam_lock
92.36 +item_ctfaccelerator
92.37 +item_ctfbackpack
92.38 +item_ctfbase
92.39 +item_ctfflag
92.40 +item_ctflongjump
92.41 +item_ctfportablehev
92.42 +item_ctfregeneration
92.43 +item_generic
92.44 +item_nuclearbomb
92.45 +item_nuclearbombbutton
92.46 +item_nuclearbombtimer
92.47 +monster_ShockTrooper_dead
92.48 +monster_alien_babyvoltigore
92.49 +monster_alien_slave_dead
92.50 +monster_alien_voltigore
92.51 +monster_assassin_repel
92.52 +monster_blkop_apache
92.53 +monster_blkop_osprey
92.54 +monster_cleansuit_scientist
92.55 +monster_cleansuit_scientist_dead
92.56 +monster_drillsergeant
92.57 +monster_fgrunt_repel
92.58 +monster_geneworm
92.59 +monster_gonome
92.60 +monster_gonome_dead
92.61 +monster_grunt_ally_repel
92.62 +monster_hfgrunt_dead
92.63 +monster_houndeye_dead
92.64 +monster_human_friendly_grunt
92.65 +monster_human_grunt_ally
92.66 +monster_human_grunt_ally_dead
92.67 +monster_human_medic_ally
92.68 +monster_human_torch_ally
92.69 +monster_male_assassin
92.70 +monster_massassin_dead
92.71 +monster_medic_ally_repel
92.72 +monster_op4loader
92.73 +monster_otis
92.74 +monster_otis_dead
92.75 +monster_penguin
92.76 +monster_pitdrone
92.77 +monster_pitworm
92.78 +monster_pitworm_up
92.79 +monster_recruit
92.80 +monster_shockroach
92.81 +monster_shocktrooper
92.82 +monster_shocktrooper_repel
92.83 +monster_sitting_cleansuit_scientist
92.84 +monster_skeleton_dead
92.85 +monster_torch_ally_repel
92.86 +monster_zombie_barney
92.87 +monster_zombie_soldier
92.88 +monster_zombie_soldier_dead
92.89 +mortar_shell
92.90 +op4mortar
92.91 +pitdronespike
92.92 +pitworm_gib
92.93 +pitworm_gibshooter
92.94 +rope_sample
92.95 +rope_segment
92.96 +shock_beam
92.97 +spore
92.98 +trigger_ctfgeneric
92.99 +trigger_geneworm_hit
92.100 +trigger_kill_nogib
92.101 +trigger_playerfreeze
92.102 +trigger_xen_return
92.103 +weapon_displacer
92.104 +weapon_eagle
92.105 +weapon_grapple
92.106 +weapon_penguin
92.107 +weapon_pipewrench
92.108 +weapon_shockrifle
92.109 +weapon_shockroach
92.110 +weapon_sniperrifle
92.111 +weapon_sporelauncher
92.112 +// (End opposing force)
93.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
93.2 +++ b/metamod/ents/outlawsmod Tue Apr 06 07:36:14 2004 +0000
93.3 @@ -0,0 +1,53 @@
93.4 +// vim: set ft=cpp :
93.5 +
93.6 +// Outlawsmod
93.7 +// http://www.planethalflife.com/outlawsmod/
93.8 +
93.9 +// Version Beta 1.5
93.10 +//
93.11 +// From: "TonToE" <[email protected]>
93.12 +// Date: Sun, 10 Nov 2002 10:04:20 -0600
93.13 +
93.14 +ammo_dyno
93.15 +ammo_gatlinbox
93.16 +ammo_knives
93.17 +ammo_rifleshot
93.18 +ammo_sbarrelshot
93.19 +bowie_bolt
93.20 +env_rain
93.21 +flag_follow
93.22 +item_acme
93.23 +item_badge
93.24 +item_canteen
93.25 +item_chicken
93.26 +item_docbag
93.27 +item_dyno
93.28 +item_dyno1
93.29 +item_elixir
93.30 +item_knife
93.31 +item_lgboiler
93.32 +item_medboiler
93.33 +item_scope
93.34 +item_smboiler
93.35 +object_follow
93.36 +ol_bell
93.37 +ol_bluecapture
93.38 +ol_blueflag
93.39 +ol_bottle
93.40 +ol_ctf_blueteam
93.41 +ol_ctf_redteam
93.42 +ol_furniture
93.43 +ol_lantern
93.44 +ol_redcapture
93.45 +ol_redflag
93.46 +ol_spitoon
93.47 +redflag_follow
93.48 +trigger_fall
93.49 +weapon_double
93.50 +weapon_dynomite
93.51 +weapon_fist
93.52 +weapon_gatlin
93.53 +weapon_rifle
93.54 +weapon_sawgun
93.55 +weapon_sbarrel
93.56 +weapon_sixshooter
94.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
94.2 +++ b/metamod/ents/overground Tue Apr 06 07:36:14 2004 +0000
94.3 @@ -0,0 +1,56 @@
94.4 +// vim: set ft=cpp :
94.5 +
94.6 +// Over Ground
94.7 +// http://og.portailmods.com/
94.8 +
94.9 +// Version Beta 1.0
94.10 +//
94.11 +// From: "Corentin" <[email protected]>
94.12 +// Date: Wed, 3 Sep 2003 18:41:42 +0200
94.13 +//
94.14 +ammo_deploygun
94.15 +ammo_explogun
94.16 +ammo_lgrenades
94.17 +ammo_machinegun
94.18 +ammo_pistolet
94.19 +ammo_sniper
94.20 +ctf_flag_follow_blue
94.21 +ctf_flag_follow_red
94.22 +env_fog
94.23 +env_mp3
94.24 +env_music
94.25 +env_particles
94.26 +env_push
94.27 +env_timer
94.28 +env_vgui
94.29 +func_tbutton
94.30 +item_ammo
94.31 +item_armor
94.32 +item_ctf_flag
94.33 +item_dbldamage
94.34 +item_health
94.35 +item_infjetpack
94.36 +item_invincibility
94.37 +item_invisibility
94.38 +item_random
94.39 +item_regeneration
94.40 +item_teleport
94.41 +item_vengeance
94.42 +lflamme_fire
94.43 +trigger_assault
94.44 +trigger_changevalue
94.45 +trigger_course
94.46 +trigger_ctf
94.47 +trigger_execcommand
94.48 +trigger_jetpack
94.49 +trigger_particles
94.50 +trigger_sound
94.51 +trigger_war
94.52 +weapon_dblpistolet
94.53 +weapon_deploygun
94.54 +weapon_explogun
94.55 +weapon_lflamme
94.56 +weapon_lgrenades
94.57 +weapon_machinegun
94.58 +weapon_pistolet
94.59 +weapon_sniper
95.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
95.2 +++ b/metamod/ents/oz Tue Apr 06 07:36:14 2004 +0000
95.3 @@ -0,0 +1,48 @@
95.4 +// vim: set ft=cpp :
95.5 +
95.6 +// Oz Deathmatch
95.7 +// http://www.planethalflife.com/oz/
95.8 +
95.9 +// Oz
95.10 +ctf_blueflag
95.11 +ctf_bluespawn
95.12 +ctf_cloak
95.13 +ctf_crowbar
95.14 +ctf_cycle
95.15 +ctf_frag
95.16 +ctf_hook
95.17 +ctf_lowgrav
95.18 +ctf_protect
95.19 +ctf_redflag
95.20 +ctf_redspawn
95.21 +ctf_regen
95.22 +ctf_superglock
95.23 +ctf_trap
95.24 +ctf_vamp
95.25 +grapple_bolt
95.26 +
95.27 +// Version 2.3
95.28 +//
95.29 +// From: "Dave R. Meyers" <[email protected]>
95.30 +// Date: Mon, 16 Jul 2001 14:17:51 -1000
95.31 +
95.32 +ctf_blueflag
95.33 +ctf_bluespawn
95.34 +ctf_redflag
95.35 +ctf_redspawn
95.36 +ctf_rune
95.37 +grapple_bolt
95.38 +trip_beam
95.39 +
95.40 +// Version 2.4.1
95.41 +//
95.42 +// Additional entities, as guessed from symbol list of linux .so ...
95.43 +// (willday, Fri Dec 21 18:47:25 EST 2001)
95.44 +flying_crowbar
95.45 +
95.46 +// Version 2.5
95.47 +//
95.48 +// From: "CheatingDeath" <[email protected]>
95.49 +// Date: Thu, 14 Feb 2002 02:44:57 -0600
95.50 +oz_logo
95.51 +oz_rune
96.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
96.2 +++ b/metamod/ents/paintball Tue Apr 06 07:36:14 2004 +0000
96.3 @@ -0,0 +1,77 @@
96.4 +// vim: set ft=cpp :
96.5 +
96.6 +// Half-Life Paintball
96.7 +// http://www.paintball-mod.net/
96.8 +//
96.9 +// Version 2.0 (?)
96.10 +//
96.11 +// From: "mike" <[email protected]>
96.12 +// Date: Mon, 2 Apr 2001 17:45:32 -0400
96.13 +//
96.14 +// "from the Entity File for HLPB" (FGD)
96.15 +// "More entities and function will be added in as further development are
96.16 +// made to the MOD."
96.17 +
96.18 +item_flag_ctf
96.19 +item_flag_atde
96.20 +item_flag_cf
96.21 +info_player_team1
96.22 +info_player_team2
96.23 +func_buyzone
96.24 +func_goal_zone
96.25 +
96.26 +// From: "mike" <[email protected]>
96.27 +// Date: Sat, 14 Apr 2001 12:16:06 -0400
96.28 +//
96.29 +// "OK....... Finally i got all them!!!"
96.30 +
96.31 +weapon_angel
96.32 +weapon_autococker
96.33 +weapon_automag
96.34 +weapon_maverick
96.35 +weapon_model98
96.36 +weapon_pgp
96.37 +weapon_phantom
96.38 +weapon_shocker2k
96.39 +weapon_spyder
96.40 +weapon_stingray2
96.41 +weapon_sniper3
96.42 +// weapon_bushwacker
96.43 +// weapon_paintgernade
96.44 +weapon_paintball
96.45 +info_player_team1
96.46 +info_player_team2
96.47 +item_flag_team2
96.48 +item_flag_team1
96.49 +info_hlpaintctfdetect
96.50 +item_atde_object
96.51 +item_flag_ctf
96.52 +item_flag_cf
96.53 +pballblue
96.54 +pballred
96.55 +carried_flag_team1
96.56 +carried_flag_team2
96.57 +func_goal_zone
96.58 +
96.59 +// From: "mike" <[email protected]>
96.60 +// Date: Mon, 30 Apr 2001 23:03:29 -0400
96.61 +//
96.62 +// "things needing updates.... these entities were wrong.."
96.63 +
96.64 +weapon_bushmaster
96.65 +weapon_paintgrenade
96.66 +
96.67 +// Note, from hlcenter.com:
96.68 +//
96.69 +// HL-Paintball Files Chapter 11
96.70 +// Reported by: DeltaMidway
96.71 +// Saturday, June 23
96.72 +//
96.73 +// For those of you wondering what happened to HL-Paintball, well lemme
96.74 +// tell you a story. The leader of HL-Paintball, Spawn, hadn't worked on
96.75 +// the mod for quite some time so when the coder, ToonCop, left because he
96.76 +// got busy in life - Spawn was left once again with the spotlight on him.
96.77 +// After that, the interest in HLPB dropped a lot after no updates and no
96.78 +// communication with the leader. Now HLPB fans are only left with a few
96.79 +// stragglers that linger in the IRC channel. So if you totally missed the
96.80 +// mod then you can still download it at FilePlanet.
97.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
97.2 +++ b/metamod/ents/phineas Tue Apr 06 07:36:14 2004 +0000
97.3 @@ -0,0 +1,4 @@
97.4 +// vim: set ft=cpp :
97.5 +
97.6 +// Phineas Bot...
97.7 +// (NONE REQUIRED)
98.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
98.2 +++ b/metamod/ents/pointofnoreturn Tue Apr 06 07:36:14 2004 +0000
98.3 @@ -0,0 +1,56 @@
98.4 +// vim: set ft=cpp :
98.5 +
98.6 +// Point of No Return
98.7 +// http://ponr.half-life.hu/
98.8 +
98.9 +// Version Beta 4.0
98.10 +//
98.11 +// From: [email protected]
98.12 +// Date: Thu, 31 Jul 2003 10:05:45 +0200
98.13 +//
98.14 +ammo_ak47
98.15 +ammo_awp
98.16 +ammo_beretta
98.17 +ammo_deagle
98.18 +ammo_dsr1
98.19 +ammo_exploder
98.20 +ammo_famas
98.21 +ammo_fiveseven
98.22 +ammo_g11
98.23 +ammo_g36
98.24 +ammo_galil
98.25 +ammo_glock18
98.26 +ammo_jackhammer
98.27 +ammo_m134
98.28 +ammo_m4a1
98.29 +ammo_m79
98.30 +ammo_mac10
98.31 +ammo_mp5
98.32 +ammo_p99
98.33 +ammo_pdw
98.34 +ammo_rockets
98.35 +ammo_trigun
98.36 +ammo_usp
98.37 +equipment_parachute
98.38 +info_flash
98.39 +item_kevlar
98.40 +item_parachute
98.41 +m72_rocket
98.42 +monster_c4
98.43 +weapon_bang
98.44 +weapon_beretta
98.45 +weapon_dsr1
98.46 +weapon_exploder
98.47 +weapon_famas
98.48 +weapon_g11
98.49 +weapon_g36
98.50 +weapon_galil
98.51 +weapon_jackhammer
98.52 +weapon_m134
98.53 +weapon_m72
98.54 +weapon_m79
98.55 +weapon_p99
98.56 +weapon_pdw
98.57 +weapon_shield
98.58 +weapon_spas12
98.59 +weapon_trigun
99.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
99.2 +++ b/metamod/ents/publicenemy Tue Apr 06 07:36:14 2004 +0000
99.3 @@ -0,0 +1,61 @@
99.4 +// vim: set ft=cpp :
99.5 +
99.6 +// Public Enemy
99.7 +// http://www.public-enemy.org
99.8 +//
99.9 +// From: "D. Hofer" <[email protected]>
99.10 +// Date: Wed, 09 Apr 2003 14:28:58 +0200
99.11 +//
99.12 +// Version Beta 1.0
99.13 +
99.14 +item_nvg
99.15 +mapobject_asiancar
99.16 +mapobject_bluecar
99.17 +mapobject_copcar
99.18 +mapobject_npc_bum
99.19 +mapobject_npc_bum1
99.20 +mapobject_npc_bum2
99.21 +mapobject_npc_bum3
99.22 +mapobject_npc_crow
99.23 +mapobject_npc_slavebot
99.24 +mapobject_redcar
99.25 +mapobject_zeppelin
99.26 +pe_escapezone
99.27 +pe_light
99.28 +pe_light_ref
99.29 +pe_object_case
99.30 +pe_object_htool
99.31 +pe_objectclip
99.32 +pe_radar_mark
99.33 +pe_rain
99.34 +pe_spawn_corps
99.35 +pe_spawn_syndicate
99.36 +pe_terminal
99.37 +trigger_coldbreath
99.38 +weapon_ak47
99.39 +weapon_aug
99.40 +weapon_benelli
99.41 +weapon_beretta
99.42 +weapon_beretta_a
99.43 +weapon_case
99.44 +weapon_deagle
99.45 +weapon_glock_auto
99.46 +weapon_glock_auto_a
99.47 +weapon_hegrenade
99.48 +weapon_knife
99.49 +weapon_m16
99.50 +weapon_microuzi
99.51 +weapon_microuzi_a
99.52 +weapon_minigun
99.53 +weapon_mp5sd
99.54 +weapon_orbital
99.55 +weapon_p225
99.56 +weapon_p226
99.57 +weapon_p226mp
99.58 +weapon_seburo
99.59 +weapon_sig550
99.60 +weapon_spas12
99.61 +weapon_stoner
99.62 +weapon_tavor
99.63 +weapon_usp
99.64 +weapon_uspmp
100.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
100.2 +++ b/metamod/ents/ricochet Tue Apr 06 07:36:14 2004 +0000
100.3 @@ -0,0 +1,27 @@
100.4 +// vim: set ft=cpp :
100.5 +
100.6 +// Ricochet
100.7 +// from Valve
100.8 +
100.9 +// in HL 1.1.1.0
100.10 +//
100.11 +// From: "Noplay" <[email protected]>
100.12 +// Date: Wed, 19 Jun 2002 13:10:32 +0200
100.13 +//
100.14 +// From: "Alfred" <[email protected]>
100.15 +// Date: Tue, 25 Jun 2002 20:47:06 +1000
100.16 +
100.17 +disc
100.18 +disc_arena
100.19 +discarena
100.20 +func_disctoggle
100.21 +func_plat_toggleremove
100.22 +info_player_spectator
100.23 +item_powerup
100.24 +player_weaponship
100.25 +trigger_discerturn
100.26 +trigger_discreturn
100.27 +trigger_fall
100.28 +trigger_jump
100.29 +trip_beam
100.30 +weapon_disc
101.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
101.2 +++ b/metamod/ents/rivalspecies Tue Apr 06 07:36:14 2004 +0000
101.3 @@ -0,0 +1,85 @@
101.4 +// vim: set ft=cpp :
101.5 +
101.6 +// Rival Species
101.7 +// http://www.rivalspecies.com/
101.8 +//
101.9 +// From: Stuart & Renee Thayn <[email protected]>
101.10 +// Date: Thu, 17 Apr 2003 11:28:26 -0700
101.11 +//
101.12 +// Version Beta 1.0
101.13 +
101.14 +ammo_el_standard
101.15 +ammo_rs_psi
101.16 +ammo_st_far
101.17 +ammo_st_heavy
101.18 +ammo_st_medium
101.19 +ammo_st_short
101.20 +ammo_st_special1
101.21 +ammo_st_special2
101.22 +ce_psi_01
101.23 +ce_rocket_01
101.24 +cm_rocket_01
101.25 +info_player_team_ce
101.26 +info_player_team_cm
101.27 +info_player_team_s
101.28 +info_player_team_sm
101.29 +mapClassName
101.30 +mission_modifier
101.31 +monster_player
101.32 +my_monster
101.33 +rs_effect
101.34 +rs_grenade
101.35 +rs_roundend
101.36 +rs_teamslot
101.37 +rs_victorypoints
101.38 +sm_rocket_01
101.39 +st_rocket
101.40 +trigger_rs_hurt
101.41 +trip_beam
101.42 +vehicle_dreadnaught
101.43 +vehicle_dreadnaught_weapon
101.44 +vehicle_wraithlord
101.45 +vehicle_wraithlord_weapon
101.46 +weapon_ce_lasgun
101.47 +weapon_ce_powersword
101.48 +weapon_ce_psistaff
101.49 +weapon_ce_rocketlauncher
101.50 +weapon_ce_shurikencatapult
101.51 +weapon_ce_shurikenpistol
101.52 +weapon_cm_autocannon
101.53 +weapon_cm_bolter
101.54 +weapon_cm_bolterflamer
101.55 +weapon_cm_boltpistol
101.56 +weapon_cm_chainaxe
101.57 +weapon_cm_chainsword
101.58 +weapon_cm_flamer
101.59 +weapon_cm_fraggrenade
101.60 +weapon_cm_heavybolter
101.61 +weapon_cm_lascannon
101.62 +weapon_cm_missilelauncher
101.63 +weapon_cm_stormbolter
101.64 +weapon_el_standard
101.65 +weapon_sm_assaultcannon
101.66 +weapon_sm_bolter
101.67 +weapon_sm_boltpistol
101.68 +weapon_sm_combatknife
101.69 +weapon_sm_flamer
101.70 +weapon_sm_fraggrenade
101.71 +weapon_sm_heavybolter
101.72 +weapon_sm_heavyflamer
101.73 +weapon_sm_lascannon
101.74 +weapon_sm_missilelauncher
101.75 +weapon_sm_poweraxe
101.76 +weapon_sm_powersword
101.77 +weapon_sm_stormbolter
101.78 +weapon_st_far
101.79 +weapon_st_heavy
101.80 +weapon_st_medium
101.81 +weapon_st_melee
101.82 +weapon_st_power
101.83 +weapon_st_psi
101.84 +weapon_st_short
101.85 +weapon_st_special
101.86 +weapon_st_throw
101.87 +world_artefact
101.88 +world_capturelocation
102.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
102.2 +++ b/metamod/ents/rocketcrowbar Tue Apr 06 07:36:14 2004 +0000
102.3 @@ -0,0 +1,129 @@
102.4 +// vim: set ft=cpp :
102.5 +
102.6 +// Rocket Crowbar
102.7 +// http://www.planethalflife.com/rocketcrowbar/
102.8 +//
102.9 +// From: "De Leon" <[email protected]>
102.10 +// Date: Fri, 22 Jun 2001 21:37:08 -0500
102.11 +//
102.12 +// Version 18 (?)
102.13 +
102.14 +IsoBomb
102.15 +PythRound
102.16 +acidgib
102.17 +alien_slave_energy_ball
102.18 +alien_slave_sapper
102.19 +asl_charge_flare
102.20 +barneymine
102.21 +base_drive_ent
102.22 +basecurse
102.23 +bubgren
102.24 +controller_charge_ball
102.25 +controller_charged_ball
102.26 +controller_health_ball
102.27 +controller_throw_ball
102.28 +curse_spawner
102.29 +db_spawner
102.30 +deathball
102.31 +dg_streak_spiral
102.32 +dmgmirrorcurse
102.33 +dmgscalecurse
102.34 +drive_agrunt
102.35 +drive_agrunt_spawner
102.36 +drive_apache
102.37 +drive_apache_spawner
102.38 +drive_asl
102.39 +drive_assassin
102.40 +drive_assassin_spawner
102.41 +drive_bm
102.42 +drive_bm_spawner
102.43 +drive_bullsquid
102.44 +drive_bullsquid_spawner
102.45 +drive_chumtoad
102.46 +drive_controller
102.47 +drive_controller_spawner
102.48 +drive_garg
102.49 +drive_garg_spawner
102.50 +drive_headcrab
102.51 +drive_houndeye
102.52 +drive_houndeye_spawner
102.53 +drive_icky
102.54 +drive_icky_spawner
102.55 +drive_panth
102.56 +drive_panth_spawner
102.57 +drive_slave_spawner
102.58 +drive_turret
102.59 +drive_turret_spawner
102.60 +drunkcurse
102.61 +drv_hvr_rocket
102.62 +egon_mirv
102.63 +env_fadeone
102.64 +fading_corpse
102.65 +flag
102.66 +freeze_timer
102.67 +friction_timer
102.68 +func_tankgib
102.69 +func_tankgib_gib
102.70 +gonarch_headcrabifier
102.71 +he_charge_flare
102.72 +he_eye_flare
102.73 +headcrab_teather
102.74 +impail_arrow
102.75 +impgren
102.76 +info_deathball_spawn
102.77 +info_drive_agrunt_spawn
102.78 +info_drive_apache_spawn
102.79 +info_drive_assassin_spawn
102.80 +info_drive_bm_spawn
102.81 +info_drive_bullsquid_spawn
102.82 +info_drive_controller_spawn
102.83 +info_drive_garg_spawn
102.84 +info_drive_houndeye_spawn
102.85 +info_drive_icky_spawn
102.86 +info_drive_panth_spawn
102.87 +info_drive_slave_spawn
102.88 +info_drive_turret_spawn
102.89 +info_flagspawn
102.90 +info_semi_null
102.91 +info_teamspawn
102.92 +killerrat
102.93 +lc_init_ent
102.94 +lc_respawner
102.95 +lc_spawner
102.96 +monster_killerbabycrab
102.97 +my_monster
102.98 +nuke_rocket
102.99 +pickup_drive_agrunt
102.100 +pickup_drive_apache
102.101 +pickup_drive_assassin
102.102 +pickup_drive_bm
102.103 +pickup_drive_bullsquid
102.104 +pickup_drive_controller
102.105 +pickup_drive_garg
102.106 +pickup_drive_houndeye
102.107 +pickup_drive_icky
102.108 +pickup_drive_panth
102.109 +pickup_drive_slave
102.110 +pickup_drive_turret
102.111 +pipebomb
102.112 +player_corpse
102.113 +promagcurse
102.114 +reversecurse
102.115 +sci_spawner
102.116 +scientistbomb
102.117 +sdcurse
102.118 +slowcurse
102.119 +slowrefirecurse
102.120 +snark_cam
102.121 +suck_mine
102.122 +telebecon
102.123 +trip_beam
102.124 +
102.125 +// Version 1.9
102.126 +//
102.127 +// From: "Steven Linn" <[email protected]>
102.128 +// Date: Sun, 27 Oct 2002 09:03:50 -0500
102.129 +//
102.130 +// No entity changes, but dllnames changed:
102.131 +// hl_i386.so -> rc_i386.so
102.132 +// mp.dll -> rc.dll
103.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
103.2 +++ b/metamod/ents/science-industry Tue Apr 06 07:36:14 2004 +0000
103.3 @@ -0,0 +1,48 @@
103.4 +// vim: set ft=cpp :
103.5 +
103.6 +// Science & Industry
103.7 +ammo_mindrayclip
103.8 +ammo_vomitclip
103.9 +info_administrator
103.10 +info_scientist
103.11 +info_scientist_dead
103.12 +info_scientist_start
103.13 +info_transistor
103.14 +weapon_mindray
103.15 +weapon_radio
103.16 +weapon_transistor
103.17 +weapon_vomit
103.18 +
103.19 +// Science & Industry
103.20 +// http://www.planethalflife.com/si/
103.21 +//
103.22 +// Version 0.97
103.23 +// Additional entities, as guessed from symbol list of linux .so ...
103.24 +// (willday, Thu May 24 00:16:24 EDT 2001)
103.25 +info_zone
103.26 +weapon_fev
103.27 +weapon_flamegrenade
103.28 +
103.29 +// Actual list provided by SI lead programmer:
103.30 +//
103.31 +// From: "Chris Glein" <[email protected]>
103.32 +// Date: Wed, 23 May 2001 20:40:49 -0700
103.33 +ammo_rocketpistol
103.34 +ammo_snUZI
103.35 +ammo_tommygun
103.36 +carry_resource
103.37 +carry_scientist
103.38 +func_tech_breakable
103.39 +grapple_hook
103.40 +info_sidetect
103.41 +item_resource
103.42 +weapon_briefcase
103.43 +weapon_cloak
103.44 +weapon_colt
103.45 +weapon_experimental
103.46 +weapon_fleshgrenade
103.47 +weapon_generic
103.48 +weapon_grapple
103.49 +weapon_rocketpistol
103.50 +weapon_snUZI
103.51 +weapon_tommygun
104.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
104.2 +++ b/metamod/ents/scientist-hunt Tue Apr 06 07:36:14 2004 +0000
104.3 @@ -0,0 +1,15 @@
104.4 +// vim: set ft=cpp :
104.5 +
104.6 +// Scientist Hunt
104.7 +// http://www.telefragged.com/thefatal/scihunt.shtml
104.8 +
104.9 +// Version 1.2
104.10 +//
104.11 +// From: Jussi Heikki Tapio Kivilinna <[email protected]>
104.12 +// Date: Sat, 15 Sep 2001 17:22:35 +0300 (EEST)
104.13 +
104.14 +info_player_team1
104.15 +info_player_team2
104.16 +weapon_hammer
104.17 +weapon_handcannon
104.18 +weapon_chainsaw
105.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
105.2 +++ b/metamod/ents/snowwar Tue Apr 06 07:36:14 2004 +0000
105.3 @@ -0,0 +1,24 @@
105.4 +// vim: set ft=cpp :
105.5 +
105.6 +// Snow-War
105.7 +// http://www.planethalflife.com/snowwar/
105.8 +
105.9 +// Version 1.0
105.10 +//
105.11 +// From: <[email protected]>
105.12 +// Date: Sat, 29 Dec 2001 12:04:43 -0500
105.13 +
105.14 +ctf_flag
105.15 +ctf_flagzone
105.16 +grapple_hook
105.17 +info_player_blue
105.18 +info_player_observer
105.19 +info_player_red
105.20 +power_ballbag
105.21 +power_coco
105.22 +power_gloves
105.23 +power_shield
105.24 +power_shoes
105.25 +snowball
105.26 +trip_beam
105.27 +weapon_snowball
106.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
106.2 +++ b/metamod/ents/specialists Tue Apr 06 07:36:14 2004 +0000
106.3 @@ -0,0 +1,49 @@
106.4 +// vim: set ft=cpp :
106.5 +
106.6 +// The Specialists
106.7 +// http://www.specialistsmod.net/
106.8 +
106.9 +// Version Beta 1.0
106.10 +//
106.11 +// From: "Guy Meoded" <[email protected]>
106.12 +// Date: Fri, 15 Nov 2002 16:23:38 +0200
106.13 +//
106.14 +// From: Morfeo [mailto:[email protected]]
106.15 +// Sent: Wednesday, February 12, 2003 2:02 AM
106.16 +//
106.17 +TSAmmoPack
106.18 +TSWorldGun
106.19 +TS_PowerUp
106.20 +TS_bomb
106.21 +knife
106.22 +m61_grenade
106.23 +weapon_tsgun
106.24 +
106.25 +// Version Beta 2.0
106.26 +//
106.27 +// From: "Chan Kongs-sang" <[email protected]>
106.28 +// Date: Fri, 11 Jul 2003 13:48:04 +0100
106.29 +//
106.30 +deadcorpse
106.31 +ts_trigger
106.32 +ts_slowmotion
106.33 +ts_slowmotionpoint
106.34 +ts_dmhill
106.35 +ts_model
106.36 +ts_mapglobals
106.37 +ts_objective_manager
106.38 +ts_objective_ptr
106.39 +ts_wingiver
106.40 +ts_hack
106.41 +ts_groundweapon
106.42 +ts_vipescape
106.43 +ts_teamescape
106.44 +
106.45 +// Additional for Beta 2.0
106.46 +//
106.47 +// From: Alexander Else <[email protected]>
106.48 +// Date: Thu, 31 Jul 2003 20:03:05 +1000 (EST)
106.49 +//
106.50 +ts_bomb
106.51 +ts_powerup
106.52 +vipescape
107.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
107.2 +++ b/metamod/ents/stargatetc Tue Apr 06 07:36:14 2004 +0000
107.3 @@ -0,0 +1,38 @@
107.4 +// vim: set ft=cpp :
107.5 +
107.6 +// StargateTC
107.7 +// http://www.stargatetc.com/
107.8 +
107.9 +// Version Beta 2.2
107.10 +//
107.11 +// From: "Julien Duponchelle" <[email protected]>
107.12 +// Date: Mon, 7 Oct 2002 15:17:34 +0200
107.13 +
107.14 +env_particule
107.15 +env_rain
107.16 +func_tankgoauld
107.17 +info_flash
107.18 +info_player_goauld
107.19 +info_player_marine
107.20 +info_player_torri
107.21 +info_player_unas
107.22 +lance_proj
107.23 +monster_larve
107.24 +monster_replicateur
107.25 +reetou_proj
107.26 +trigger_goal
107.27 +trigger_section
107.28 +weapon_batsup
107.29 +weapon_coujaf
107.30 +weapon_couteau
107.31 +weapon_gacgoa
107.32 +weapon_invis
107.33 +weapon_lance
107.34 +weapon_larve
107.35 +weapon_m16
107.36 +weapon_m92s
107.37 +weapon_main
107.38 +weapon_psg1
107.39 +weapon_reetou
107.40 +weapon_zat
107.41 +weapon_zatarc
108.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
108.2 +++ b/metamod/ents/sturmbot Tue Apr 06 07:36:14 2004 +0000
108.3 @@ -0,0 +1,7 @@
108.4 +// vim: set ft=cpp :
108.5 +
108.6 +// Sturmbot
108.7 +//
108.8 +// From: "Johan Linde" <[email protected]>
108.9 +// Date: Sat, 19 Oct 2002 11:25:29 +0000
108.10 +sturmbody
109.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
109.2 +++ b/metamod/ents/svencoop Tue Apr 06 07:36:14 2004 +0000
109.3 @@ -0,0 +1,44 @@
109.4 +// vim: set ft=cpp :
109.5 +
109.6 +// Sven Coop
109.7 +// http://www.svencoop.com/
109.8 +
109.9 +// Svencoop 1.9
109.10 +monster_chumtoad
109.11 +squadmaker
109.12 +trigger_random
109.13 +trigger_random_time
109.14 +weapon_uziakimbo
109.15 +
109.16 +// Svencoop 2.0
109.17 +//
109.18 +// From: Eric Gisse <[email protected]>
109.19 +// Date: Sat, 22 Dec 2001 18:53:11 -0900
109.20 +
109.21 +monster_babygarg
109.22 +monster_hwgrunt
109.23 +trigger_respawn
109.24 +trigger_secret
109.25 +
109.26 +// Version 2.1
109.27 +//
109.28 +// From: Daisuke Takeda <[email protected]>
109.29 +// Date: Wed, 9 Apr 2003 12:15:29 -0700 (PDT)
109.30 +
109.31 +custom_precache
109.32 +env_xenmaker
109.33 +monster_assassin_repel
109.34 +monster_gonome
109.35 +monster_male_assassin
109.36 +monster_otis
109.37 +monster_otis_dead
109.38 +monster_pitdrone
109.39 +monster_robogrunt
109.40 +monster_robogruntrepel
109.41 +monster_shockroach
109.42 +monster_shocktrooper
109.43 +monster_zombie_barney
109.44 +monster_zombie_soldier
109.45 +weapon_medkit
109.46 +weapon_pipewrench
109.47 +weapon_uzi
110.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
110.2 +++ b/metamod/ents/swarm Tue Apr 06 07:36:14 2004 +0000
110.3 @@ -0,0 +1,38 @@
110.4 +// vim: set ft=cpp :
110.5 +
110.6 +// Swarm
110.7 +// http://swarm.edgegaming.com/
110.8 +
110.9 +// Swarm (?? version)
110.10 +ammo_adrenaline
110.11 +ammo_needle
110.12 +ammo_swarmprimary
110.13 +ammo_swarmsecondary
110.14 +ammo_swarm_xen_secondary
110.15 +garg_hull
110.16 +grapple_hook
110.17 +item_swarm_flag
110.18 +monster_c4
110.19 +swarm_garg_stomp
110.20 +swarm_spawnpt_acontroller
110.21 +swarm_spawnpt_agarg
110.22 +swarm_spawnpt_aheadcrab
110.23 +swarm_spawnpt_aslave
110.24 +swarm_spawnpt_atripod
110.25 +swarm_spawnpt_hassassin
110.26 +swarm_spawnpt_hcommander
110.27 +swarm_spawnpt_hengineer
110.28 +swarm_spawnpt_hgrunt
110.29 +swarm_spawnpt_hscientist
110.30 +swarm_spawnpt_human
110.31 +swarm_team_alien
110.32 +swarm_team_human
110.33 +trigger_regen
110.34 +weapon_adrenaline
110.35 +weapon_eballblaster
110.36 +weapon_islavezap
110.37 +weapon_needle
110.38 +weapon_pipebomb
110.39 +weapon_sonicgrenade
110.40 +weapon_swarm_gargflame
110.41 +// (end swarm)
111.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
111.2 +++ b/metamod/ents/tfc Tue Apr 06 07:36:14 2004 +0000
111.3 @@ -0,0 +1,84 @@
111.4 +// vim: set ft=cpp :
111.5 +
111.6 +// Team Fortress Classic (version 1)
111.7 +building_dispenser
111.8 +building_sentrygun
111.9 +building_sentrygun_base
111.10 +detpack
111.11 +func_nobuild
111.12 +ghost
111.13 +info_player_teamspawn
111.14 +info_tfdetect
111.15 +info_tfgoal
111.16 +info_tfgoal_timer
111.17 +item_armor1
111.18 +item_armor2
111.19 +item_armor3
111.20 +item_artifact_envirosuit
111.21 +item_artifact_invisibility
111.22 +item_artifact_invulnerability
111.23 +item_artifact_super_damage
111.24 +item_cells
111.25 +item_health
111.26 +item_rockets
111.27 +item_shells
111.28 +item_spikes
111.29 +item_tfgoal
111.30 +i_p_t
111.31 +i_t_g
111.32 +i_t_t
111.33 +teledeath
111.34 +tf_ammo_rpgclip
111.35 +tf_flame
111.36 +tf_flamethrower_burst
111.37 +tf_gl_grenade
111.38 +tf_ic_rocket
111.39 +tf_nailgun_nail
111.40 +tf_rpg_rocket
111.41 +tf_weapon_ac
111.42 +tf_weapon_autorifle
111.43 +tf_weapon_axe
111.44 +tf_weapon_caltrop
111.45 +tf_weapon_caltropgrenade
111.46 +tf_weapon_concussiongrenade
111.47 +tf_weapon_empgrenade
111.48 +tf_weapon_flamethrower
111.49 +tf_weapon_gasgrenade
111.50 +tf_weapon_genericprimedgrenade
111.51 +tf_weapon_gl
111.52 +tf_weapon_ic
111.53 +tf_weapon_knife
111.54 +tf_weapon_medikit
111.55 +tf_weapon_mirvbomblet
111.56 +tf_weapon_mirvgrenade
111.57 +tf_weapon_nailgrenade
111.58 +tf_weapon_napalmgrenade
111.59 +tf_weapon_ng
111.60 +tf_weapon_normalgrenade
111.61 +tf_weapon_pl
111.62 +tf_weapon_railgun
111.63 +tf_weapon_rpg
111.64 +tf_weapon_shotgun
111.65 +tf_weapon_sniperrifle
111.66 +tf_weapon_spanner
111.67 +tf_weapon_superng
111.68 +tf_weapon_supershotgun
111.69 +tf_weapon_tranq
111.70 +timer
111.71 +// (End TFC v1)
111.72 +
111.73 +// New tfc stuff
111.74 +CTF_Map
111.75 +
111.76 +// New tfc 1.1.0.4 stuff
111.77 +info_areadef
111.78 +info_tf_teamcheck
111.79 +info_tf_teamset
111.80 +func_nogrenades
111.81 +
111.82 +// HL 1.1.1.1 (CS 1.6)
111.83 +//
111.84 +// From: Alfred Reynolds <[email protected]>
111.85 +// Date: Thu, 16 Jan 2003 12:32:41 -0800
111.86 +//
111.87 +building_teleporter
112.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
112.2 +++ b/metamod/ents/timeless Tue Apr 06 07:36:14 2004 +0000
112.3 @@ -0,0 +1,66 @@
112.4 +// vim: set ft=cpp :
112.5 +
112.6 +// Project Timeless
112.7 +// http://www.project-timeless.de/
112.8 +// http://www.planethalflife.com/project-timeless/
112.9 +
112.10 +// Version Beta 1.0
112.11 +//
112.12 +// From: Rockefeller <[email protected]>
112.13 +// Date: Mon, 03 Nov 2003 12:50:46 +0100
112.14 +//
112.15 +pt_change_attribute
112.16 +pt_startpoint
112.17 +pt_round_info
112.18 +pt_campaign_end
112.19 +pt_mission_target
112.20 +pt_control_area
112.21 +pt_bomb_zone
112.22 +pt_defeat_victory
112.23 +pt_trigger_zone
112.24 +pt_trigger_bomb
112.25 +pt_entity_reset
112.26 +pt_score_award
112.27 +pt_toggle_respawnmode
112.28 +pt_hostage
112.29 +pt_rescue_zone
112.30 +pt_model
112.31 +env_fog
112.32 +pt_parachute_area
112.33 +pt_timer
112.34 +pt_trigger_loader
112.35 +func_vehicle
112.36 +func_modelvehicle
112.37 +func_modelvehiclemodel
112.38 +func_vehiclecontrols
112.39 +func_vehicletankcontrols
112.40 +func_modeltank
112.41 +monster_c4
112.42 +monster_pipebomb
112.43 +monster_poison
112.44 +weapon_amp
112.45 +weapon_deagle
112.46 +weapon_flamer
112.47 +weapon_g36c
112.48 +weapon_c4
112.49 +weapon_he
112.50 +weapon_pipebomb
112.51 +weapon_poison
112.52 +weapon_horar1
112.53 +weapon_horar2
112.54 +weapon_horg1
112.55 +weapon_horg2
112.56 +weapon_hormg1
112.57 +weapon_hormg2
112.58 +weapon_knife
112.59 +weapon_m4
112.60 +weapon_minigun
112.61 +weapon_mp5k
112.62 +weapon_mp5ktac
112.63 +weapon_remington
112.64 +weapon_sig
112.65 +weapon_socom
112.66 +weapon_socomtac
112.67 +weapon_spas12
112.68 +weapon_stoner
112.69 +weapon_uzi
113.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
113.2 +++ b/metamod/ents/tourofduty Tue Apr 06 07:36:14 2004 +0000
113.3 @@ -0,0 +1,101 @@
113.4 +// vim: set ft=cpp :
113.5 +
113.6 +// Tour of Duty
113.7 +// http://www.tourofdutymod.com/
113.8 +
113.9 +// Version 0.6.7
113.10 +//
113.11 +// From: "Pat Magnan" <[email protected]>
113.12 +// Date: Mon, 20 May 2002 17:31:09 -0500
113.13 +ammo_crate
113.14 +env_animsprite
113.15 +flag_capture_point
113.16 +flag_follow
113.17 +flag_world
113.18 +info_alias
113.19 +info_bomb_target
113.20 +info_boobytrap
113.21 +info_escape_target
113.22 +info_group
113.23 +info_landmine
113.24 +law_rocket
113.25 +monster_bomb
113.26 +monster_sitting_villager
113.27 +monster_villager
113.28 +monster_villager_dead
113.29 +multi_alias
113.30 +rpg7_rocket
113.31 +tod_control_point
113.32 +tod_roundend_trigger
113.33 +trigger_changealias
113.34 +weapon_ak47
113.35 +weapon_bayonet
113.36 +weapon_binos
113.37 +weapon_bomb
113.38 +weapon_colt
113.39 +weapon_dragunov
113.40 +weapon_kbar
113.41 +weapon_law
113.42 +weapon_m16
113.43 +weapon_m21
113.44 +weapon_m60
113.45 +weapon_m79
113.46 +weapon_mat49
113.47 +weapon_medkit
113.48 +weapon_nva_grenade
113.49 +weapon_rpd
113.50 +weapon_rpg7
113.51 +weapon_tokarev
113.52 +weapon_us_grenade
113.53 +
113.54 +// Version 0.8.0 update
113.55 +//
113.56 +// From: Pat Magnan <[email protected]>
113.57 +// Date: Sun, 23 Jun 2002 23:24:35 -0500
113.58 +env_model
113.59 +info_firstround_spawn
113.60 +info_rescue_monster
113.61 +info_roundx_spawn
113.62 +monster_dog
113.63 +monster_goat
113.64 +monster_kid
113.65 +monster_pig
113.66 +monster_pilot
113.67 +monster_prisoner
113.68 +monster_snake
113.69 +monster_troop
113.70 +tod_notripmine_area
113.71 +tod_roundstart_trigger
113.72 +tod_roundwon_trigger
113.73 +weapon_grease
113.74 +weapon_m14
113.75 +weapon_mortar
113.76 +weapon_mosin
113.77 +weapon_radio
113.78 +weapon_sks
113.79 +
113.80 +// Version 0.9.0
113.81 +//
113.82 +// From: Pat Magnan <[email protected]>
113.83 +// Date: Mon, 08 Jul 2002 14:10:12 -0400
113.84 +env_fog
113.85 +trigger_lightstyle
113.86 +light_glow
113.87 +
113.88 +// Version 1.1 Beta
113.89 +//
113.90 +// From: Pat Magnan <[email protected]>
113.91 +// Date: Fri, 15 Nov 2002 06:49:46 -0500
113.92 +info_minefield
113.93 +info_nomines
113.94 +info_player_nva_reenforcement
113.95 +info_player_usmc_reenforcement
113.96 +info_rescue_point
113.97 +monster_assassin_target
113.98 +monster_buffalo
113.99 +monster_chicken
113.100 +monster_cow
113.101 +monster_helicopter
113.102 +monster_monkey
113.103 +tod_control_area
113.104 +weapon_claymore
114.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
114.2 +++ b/metamod/ents/trainhunters Tue Apr 06 07:36:14 2004 +0000
114.3 @@ -0,0 +1,13 @@
114.4 +// vim: set ft=cpp :
114.5 +
114.6 +// Train Hunters
114.7 +// http://th.fragoff.net/
114.8 +
114.9 +// Version beta 1.0
114.10 +//
114.11 +// From: "Benjamin 'RirA' Rosenberger" <[email protected]>
114.12 +// Date: Sat, 18 May 2002 09:21:21 +0200
114.13 +weapon_brickcannon
114.14 +ammo_brick
114.15 +weapon_smokegrenade
114.16 +weapon_barnacle
115.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
115.2 +++ b/metamod/ents/underworld Tue Apr 06 07:36:14 2004 +0000
115.3 @@ -0,0 +1,21 @@
115.4 +// vim: set ft=cpp :
115.5 +
115.6 +// Underworld Bloodline
115.7 +// http://www.entertheunderworld.com/
115.8 +
115.9 +// Version 2.0
115.10 +//
115.11 +// From: [email protected] (p0_b0y)
115.12 +// Date: Mon, 20 Oct 2003 16:48:53 -0400 (EDT)
115.13 +//
115.14 +uw_player_vamp
115.15 +uw_player_lycan
115.16 +uw_player_view
115.17 +ammo_m4
115.18 +weapon_star
115.19 +weapon_spider
115.20 +weapon_lightning
115.21 +weapon_vulcan
115.22 +ammo_lightning
115.23 +uw_monster_michael
115.24 +uw_monster_hybrid
116.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
116.2 +++ b/metamod/ents/valve Tue Apr 06 07:36:14 2004 +0000
116.3 @@ -0,0 +1,256 @@
116.4 +// vim: set ft=cpp :
116.5 +
116.6 +// Entities for Valve's hl.dll and Standard SDK...
116.7 +aiscripted_sequence
116.8 +ambient_generic
116.9 +ammo_357
116.10 +ammo_9mmAR
116.11 +ammo_9mmbox
116.12 +ammo_9mmclip
116.13 +ammo_ARgrenades
116.14 +ammo_buckshot
116.15 +ammo_crossbow
116.16 +ammo_egonclip
116.17 +ammo_gaussclip
116.18 +ammo_glockclip
116.19 +ammo_mp5clip
116.20 +ammo_mp5grenades
116.21 +ammo_rpgclip
116.22 +beam
116.23 +bmortar
116.24 +bodyque
116.25 +button_target
116.26 +cine_blood
116.27 +controller_energy_ball
116.28 +controller_head_ball
116.29 +crossbow_bolt
116.30 +cycler
116.31 +cycler_prdroid
116.32 +cycler_sprite
116.33 +cycler_weapon
116.34 +cycler_wreckage
116.35 +DelayedUse
116.36 +env_beam
116.37 +env_beverage
116.38 +env_blood
116.39 +env_bubbles
116.40 +env_debris
116.41 +env_explosion
116.42 +env_fade
116.43 +env_funnel
116.44 +env_global
116.45 +env_glow
116.46 +env_laser
116.47 +env_lightning
116.48 +env_message
116.49 +env_render
116.50 +env_shake
116.51 +env_shooter
116.52 +env_smoker
116.53 +env_sound
116.54 +env_spark
116.55 +env_sprite
116.56 +fireanddie
116.57 +func_breakable
116.58 +func_button
116.59 +func_conveyor
116.60 +func_door
116.61 +func_door_rotating
116.62 +func_friction
116.63 +func_guntarget
116.64 +func_healthcharger
116.65 +func_illusionary
116.66 +func_ladder
116.67 +func_monsterclip
116.68 +func_mortar_field
116.69 +func_pendulum
116.70 +func_plat
116.71 +func_platrot
116.72 +func_pushable
116.73 +func_recharge
116.74 +func_rotating
116.75 +func_rot_button
116.76 +func_tank
116.77 +func_tankcontrols
116.78 +func_tanklaser
116.79 +func_tankmortar
116.80 +func_tankrocket
116.81 +func_trackautochange
116.82 +func_trackchange
116.83 +func_tracktrain
116.84 +func_train
116.85 +func_traincontrols
116.86 +func_wall
116.87 +func_wall_toggle
116.88 +func_water
116.89 +game_counter
116.90 +game_counter_set
116.91 +game_end
116.92 +game_player_equip
116.93 +game_player_hurt
116.94 +game_player_team
116.95 +game_score
116.96 +game_team_master
116.97 +game_team_set
116.98 +game_text
116.99 +game_zone_player
116.100 +garg_stomp
116.101 +gibshooter
116.102 +hornet
116.103 +hvr_rocket
116.104 +infodecal
116.105 +info_bigmomma
116.106 +info_intermission
116.107 +info_landmark
116.108 +info_node
116.109 +info_node_air
116.110 +info_null
116.111 +info_player_deathmatch
116.112 +info_player_start
116.113 +info_target
116.114 +info_teleport_destination
116.115 +item_airtank
116.116 +item_antidote
116.117 +item_battery
116.118 +item_healthkit
116.119 +item_longjump
116.120 +item_security
116.121 +item_sodacan
116.122 +item_suit
116.123 +laser_spot
116.124 +light
116.125 +light_environment
116.126 +light_spot
116.127 +momentary_door
116.128 +momentary_rot_button
116.129 +monstermaker
116.130 +monster_alien_controller
116.131 +monster_alien_grunt
116.132 +monster_alien_slave
116.133 +monster_apache
116.134 +monster_babycrab
116.135 +monster_barnacle
116.136 +monster_barney
116.137 +monster_barney_dead
116.138 +monster_bigmomma
116.139 +monster_bloater
116.140 +monster_bullchicken
116.141 +monster_cine2_hvyweapons
116.142 +monster_cine2_scientist
116.143 +monster_cine2_slave
116.144 +monster_cine3_barney
116.145 +monster_cine3_scientist
116.146 +monster_cine_barney
116.147 +monster_cine_panther
116.148 +monster_cine_scientist
116.149 +monster_cockroach
116.150 +monster_flyer
116.151 +monster_flyer_flock
116.152 +monster_furniture
116.153 +monster_gargantua
116.154 +monster_generic
116.155 +monster_gman
116.156 +monster_grunt_repel
116.157 +monster_headcrab
116.158 +monster_hevsuit_dead
116.159 +monster_hgrunt_dead
116.160 +monster_houndeye
116.161 +monster_human_assassin
116.162 +monster_human_grunt
116.163 +monster_ichthyosaur
116.164 +monster_leech
116.165 +monster_miniturret
116.166 +monster_mortar
116.167 +monster_nihilanth
116.168 +monster_osprey
116.169 +monster_rat
116.170 +monster_satchel
116.171 +monster_scientist
116.172 +monster_scientist_dead
116.173 +monster_sentry
116.174 +monster_sitting_scientist
116.175 +monster_snark
116.176 +monster_tentacle
116.177 +monster_tentaclemaw
116.178 +monster_tripmine
116.179 +monster_turret
116.180 +monster_vortigaunt
116.181 +monster_zombie
116.182 +multisource
116.183 +multi_manager
116.184 +nihilanth_energy_ball
116.185 +node_viewer
116.186 +node_viewer_fly
116.187 +node_viewer_human
116.188 +node_viewer_large
116.189 +path_corner
116.190 +path_track
116.191 +player
116.192 +player_loadsaved
116.193 +player_weaponstrip
116.194 +rpg_rocket
116.195 +scripted_sentence
116.196 +scripted_sequence
116.197 +soundent
116.198 +spark_shower
116.199 +speaker
116.200 +squidspit
116.201 +streak_spiral
116.202 +target_cdaudio
116.203 +testhull
116.204 +test_effect
116.205 +trigger
116.206 +trigger_auto
116.207 +trigger_autosave
116.208 +trigger_camera
116.209 +trigger_cdaudio
116.210 +trigger_changelevel
116.211 +trigger_changetarget
116.212 +trigger_counter
116.213 +trigger_endsection
116.214 +trigger_gravity
116.215 +trigger_hurt
116.216 +trigger_monsterjump
116.217 +trigger_multiple
116.218 +trigger_once
116.219 +trigger_push
116.220 +trigger_relay
116.221 +trigger_teleport
116.222 +trigger_transition
116.223 +weaponbox
116.224 +weapon_357
116.225 +weapon_9mmAR
116.226 +weapon_9mmhandgun
116.227 +weapon_crossbow
116.228 +weapon_crowbar
116.229 +weapon_egon
116.230 +weapon_gauss
116.231 +weapon_glock
116.232 +weapon_handgrenade
116.233 +weapon_hornetgun
116.234 +weapon_mp5
116.235 +weapon_python
116.236 +weapon_rpg
116.237 +weapon_satchel
116.238 +weapon_shotgun
116.239 +weapon_snark
116.240 +weapon_tripmine
116.241 +worldspawn
116.242 +world_items
116.243 +xen_hair
116.244 +xen_hull
116.245 +xen_plantlight
116.246 +xen_spore_large
116.247 +xen_spore_medium
116.248 +xen_spore_small
116.249 +xen_tree
116.250 +xen_ttrigger
116.251 +// (End valve hl.dll, SDK)
116.252 +
116.253 +// New Valve stuff (for 3.1.0.4)
116.254 +CreateInterface
116.255 +GetChaseOrigin
116.256 +
116.257 +// Had been moved to the "common" list.
116.258 +grenade
116.259 +weaponbox
117.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
117.2 +++ b/metamod/ents/vampireslayer Tue Apr 06 07:36:14 2004 +0000
117.3 @@ -0,0 +1,36 @@
117.4 +// vim: set ft=cpp :
117.5 +
117.6 +// VampireSlayer
117.7 +// http://www.planethalflife.com/vampire/
117.8 +//
117.9 +// From: "Mark Gornall" <[email protected]>
117.10 +// Date: Sat, 28 Apr 2001 11:57:28 +0100
117.11 +
117.12 +// Version 1.1
117.13 +info_player_vampire
117.14 +info_player_slayer
117.15 +weapon_claw
117.16 +
117.17 +// Version 2.0
117.18 +weapon_vsclaw
117.19 +weapon_vscolt
117.20 +vscrossbow_bolt
117.21 +weapon_vscrossbow
117.22 +weapon_vsdbshotgun
117.23 +weapon_vsmp5
117.24 +weapon_vsshotgun
117.25 +weapon_vsstake
117.26 +
117.27 +// Version "Chapter V"
117.28 +//
117.29 +// From: "Mark Gornall" <[email protected]>
117.30 +// Date: Thu, 6 Feb 2003 12:35:25 -0000
117.31 +//
117.32 +func_breakpoints
117.33 +info_draw_slayerswin
117.34 +info_draw_vampireswin
117.35 +item_flag_slayer
117.36 +item_flag_vampire
117.37 +weapon_vscue
117.38 +weapon_vsthunderfive
117.39 +weapon_vswinchester
118.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
118.2 +++ b/metamod/ents/wanted Tue Apr 06 07:36:14 2004 +0000
118.3 @@ -0,0 +1,145 @@
118.4 +// vim: set ft=cpp :
118.5 +
118.6 +// Wanted!
118.7 +// http://www.wantedhl.com/
118.8 +// http://www.maverickdev.com/
118.9 +//
118.10 +// From: "Mike Blowers" <[email protected]>
118.11 +// Date: Wed, 11 Jul 2001 17:20:07 +0100
118.12 +
118.13 +// Version 1.5
118.14 +monster_eagle
118.15 +monster_eagle_flock
118.16 +monster_annie
118.17 +monster_annie_dead
118.18 +item_bag1
118.19 +item_bag2
118.20 +monster_bear
118.21 +monster_beartrap
118.22 +weapon_beartrap
118.23 +monster_bigminer
118.24 +monster_bigminer_dead
118.25 +item_bottle
118.26 +weapon_buffalo
118.27 +ammo_buffalo
118.28 +item_cactus
118.29 +cannon_ball
118.30 +weapon_cannon
118.31 +ammo_cannon
118.32 +monster_chicken
118.33 +monster_colonel
118.34 +monster_colonel_dead
118.35 +monster_sitting_colonel
118.36 +monster_tied_colonel
118.37 +weapon_colts
118.38 +ammo_colts
118.39 +monster_cowboy
118.40 +monster_cowboy_dead
118.41 +monster_crispen
118.42 +monster_crispen_dead
118.43 +monster_sitting_crispen
118.44 +weapon_bow
118.45 +ammo_bow
118.46 +davespit
118.47 +monster_dave
118.48 +monster_dave_dead
118.49 +monster_sitting_dave
118.50 +item_dish
118.51 +item_elixer
118.52 +monster_flag1
118.53 +monster_flag2
118.54 +monster_flag3
118.55 +monster_flag4
118.56 +weapon_gattlinggun
118.57 +ammo_gattlinggun
118.58 +item_glass
118.59 +monster_cine_wtowna
118.60 +monster_cine_tiedcolonel
118.61 +monster_cine_wtownb
118.62 +monster_cine_townmex
118.63 +monster_cine_masala
118.64 +monster_cine_nagatow
118.65 +monster_cine_crispen
118.66 +monster_cine_dave
118.67 +monster_cine_hoss
118.68 +monster_cine_annie
118.69 +monster_cine2_wtowna
118.70 +monster_cine2_tiedcolonel
118.71 +monster_cine2_wtownb
118.72 +monster_cine2_townmex
118.73 +monster_cine2_masala
118.74 +monster_cine2_nagatow
118.75 +monster_cine2_crispen
118.76 +monster_cine2_dave
118.77 +monster_cine3_wtowna
118.78 +monster_cine3_tiedcolonel
118.79 +monster_cine3_wtownb
118.80 +monster_cine3_townmex
118.81 +monster_cine3_masala
118.82 +monster_cine3_nagatow
118.83 +monster_cine3_crispen
118.84 +monster_cine3_dave
118.85 +monster_cine3_hoss
118.86 +monster_cine3_annie
118.87 +weapon_dynamite
118.88 +item_herbs
118.89 +monster_horse
118.90 +monster_hoss
118.91 +monster_hoss_dead
118.92 +indian_arrow
118.93 +monster_kaiewi
118.94 +monster_kaiewi_dead
118.95 +knife_throw
118.96 +weapon_knife
118.97 +monster_masala
118.98 +monster_masala_dead
118.99 +monster_sitting_masala
118.100 +monster_mexbandit
118.101 +monster_mexbandit_dead
118.102 +monster_nagatow
118.103 +monster_nagatow_dead
118.104 +monster_sitting_nagatow
118.105 +weapon_pick
118.106 +item_pickaxe
118.107 +player_beartrapstrip
118.108 +monster_puma
118.109 +weapon_pistol
118.110 +ammo_pistol
118.111 +monster_ramone
118.112 +monster_ramone_repel
118.113 +monster_scorpion
118.114 +weapon_scorpion
118.115 +item_shovel
118.116 +monster_skelly
118.117 +monster_skellydance
118.118 +monster_smallminer
118.119 +monster_smallminer_dead
118.120 +monster_snake
118.121 +item_steerskull
118.122 +item_steerribs
118.123 +item_telegram
118.124 +item_telegraphkey
118.125 +my_monster
118.126 +monster_townmex
118.127 +monster_townmex_dead
118.128 +monster_sitting_townmex
118.129 +trigger_killmonster
118.130 +trigger_shutup
118.131 +mapClassName
118.132 +DLLClassName
118.133 +item_wagonwheel
118.134 +item_wheelside
118.135 +weapon_winchester
118.136 +ammo_winchesterclip
118.137 +monster_twnwesta
118.138 +monster_twnwesta_dead
118.139 +monster_sitting_twnwesta
118.140 +monster_twnwestb
118.141 +monster_twnwestb_dead
118.142 +monster_sitting_twnwestb
118.143 +info_botnode
118.144 +info_botlandmark
118.145 +ctc_chicken
118.146 +ctc_capturepoint
118.147 +tombstone
118.148 +info_wanteddetect
119.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
119.2 +++ b/metamod/ents/wasteland Tue Apr 06 07:36:14 2004 +0000
119.3 @@ -0,0 +1,49 @@
119.4 +// vim: set ft=cpp :
119.5 +
119.6 +// Wasteland
119.7 +ammo_caseless
119.8 +ammo_Deagle
119.9 +ammo_fnfal
119.10 +dc_info_objective
119.11 +dc_info_objectposition
119.12 +dc_object
119.13 +dc_trigger_objectcapture
119.14 +dc_trigger_reset
119.15 +dc_trigger_team
119.16 +info_team_ronin
119.17 +info_team_scavenger
119.18 +info_team_usmc
119.19 +laser_aimer
119.20 +weapon_boltrifle
119.21 +weapon_deserteagle
119.22 +weapon_fnfal
119.23 +weapon_g11
119.24 +weapon_G11
119.25 +weapon_jackhammer
119.26 +weapon_katana
119.27 +weapon_molotov
119.28 +weapon_rifle
119.29 +weapon_sawedoff
119.30 +weapon_sledge
119.31 +weapon_spear
119.32 +spear_bolt
119.33 +
119.34 +// Wasteland beta 2
119.35 +RONINTeamScore
119.36 +SCAVENGERTeamScore
119.37 +USMCTeamScore
119.38 +
119.39 +
119.40 +// Wasteland Half-Life
119.41 +// http://thewastes.net/
119.42 +// http://wastelandhalflife.com/
119.43 +
119.44 +
119.45 +// Version beta2
119.46 +// Additional entities, as guessed from symbol list of linux .so ...
119.47 +// (willday, Thu Jun 7 16:56:36 EDT 2001)
119.48 +weapon_bat
119.49 +weapon_colt
119.50 +weapon_deagle
119.51 +weapon_handcannon
119.52 +weapon_mp5k
120.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
120.2 +++ b/metamod/ents/wastes Tue Apr 06 07:36:14 2004 +0000
120.3 @@ -0,0 +1,58 @@
120.4 +// vim: set ft=cpp :
120.5 +
120.6 +// The Wastes
120.7 +// http://planethalflife.com/thewastes/
120.8 +
120.9 +// Version RC 1.2
120.10 +//
120.11 +// From: [email protected]
120.12 +// Date: Mon, 23 Jun 2003 16:05:08 -0400
120.13 +//
120.14 +ammo_beretta
120.15 +ammo_boltrifle
120.16 +ammo_colt
120.17 +ammo_deagle
120.18 +ammo_fnfal
120.19 +ammo_g11
120.20 +ammo_handcannon
120.21 +ammo_jackhammer
120.22 +ammo_ruger
120.23 +ammo_smg9
120.24 +ammo_sten
120.25 +ammo_tommygun
120.26 +ammo_winchester
120.27 +extra_ammo
120.28 +frag_grenade
120.29 +molotov
120.30 +pipe_bomb
120.31 +thrown_object
120.32 +trip_beam
120.33 +weapon_akimboberettas
120.34 +weapon_akimbocolts
120.35 +weapon_akimbodeagles
120.36 +weapon_akimbosawedoffs
120.37 +weapon_baseballbat
120.38 +weapon_beretta
120.39 +weapon_boltrifle
120.40 +weapon_cattleprod
120.41 +weapon_colt
120.42 +weapon_combatknife
120.43 +weapon_deagle
120.44 +weapon_fnfal
120.45 +weapon_fraggrenade
120.46 +weapon_g11
120.47 +weapon_handcannon
120.48 +weapon_jackhammer
120.49 +weapon_katana
120.50 +weapon_molotov
120.51 +weapon_mossberg
120.52 +weapon_pipebomb
120.53 +weapon_ruger
120.54 +weapon_sawedoff
120.55 +weapon_sledgehammer
120.56 +weapon_smg9
120.57 +weapon_spear
120.58 +weapon_sten
120.59 +weapon_throwingknife
120.60 +weapon_tommygun
120.61 +weapon_winchester
121.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
121.2 +++ b/metamod/ents/weaponwars Tue Apr 06 07:36:14 2004 +0000
121.3 @@ -0,0 +1,120 @@
121.4 +// vim: set ft=cpp :
121.5 +
121.6 +// Weapon Wars
121.7 +// http://wwars.hlcenter.com
121.8 +// http://wwars.thebackburner.com
121.9 +
121.10 +// Version 0.3
121.11 +//
121.12 +// List provided by dev team.
121.13 +//
121.14 +// From: mark mark <[email protected]>
121.15 +// Date: 13 Aug 2001 15:01:37 -0700
121.16 +
121.17 +Satelite__Laser
121.18 +Zombie2Spit
121.19 +_spit
121.20 +ammo_grenades
121.21 +ammo_helirockets
121.22 +autogl_gren
121.23 +beamshot
121.24 +bfg10k
121.25 +blaster_beam
121.26 +ctf_blueflag
121.27 +ctf_bluespawn
121.28 +ctf_redflag
121.29 +ctf_redspawn
121.30 +disc
121.31 +explosive_slug
121.32 +external_cam
121.33 +flak_grenade
121.34 +flakfrag
121.35 +flare_fire
121.36 +freeze_beam
121.37 +gibable_corpse
121.38 +grapple_hook
121.39 +hand_knife
121.40 +holo_player
121.41 +infect
121.42 +item_autodoc
121.43 +item_cloaker
121.44 +item_flag
121.45 +item_head
121.46 +item_metal
121.47 +item_nvg
121.48 +item_powerarmor
121.49 +item_quad
121.50 +item_tag
121.51 +laser_dot
121.52 +medal
121.53 +mini_rocket
121.54 +monster_burnmine
121.55 +monster_fakemedkit
121.56 +monster_sphere
121.57 +monster_spider
121.58 +monster_super_snark
121.59 +monster_test
121.60 +monster_turretbase
121.61 +monster_valve_turret
121.62 +monster_wwmine
121.63 +monster_zombie2
121.64 +moving_camera
121.65 +nail
121.66 +neutrinobeam
121.67 +nuke_rocket
121.68 +old_rocket
121.69 +oldbot
121.70 +pipebomb
121.71 +player_roach
121.72 +proj_flame
121.73 +pulsefrag
121.74 +satelite_laser
121.75 +sgvortex
121.76 +translocator_disc
121.77 +trigger_music
121.78 +victim_scientist
121.79 +weapon_90mm
121.80 +weapon_acannon
121.81 +weapon_aliencannon
121.82 +weapon_autogl
121.83 +weapon_battleaxe
121.84 +weapon_biggun
121.85 +weapon_cal50
121.86 +weapon_caws
121.87 +weapon_cloaker
121.88 +weapon_devastator
121.89 +weapon_disclauncher
121.90 +weapon_flakcannon
121.91 +weapon_flamethrower
121.92 +weapon_flarepistol
121.93 +weapon_freezer
121.94 +weapon_gasgrenade
121.95 +weapon_glauncher
121.96 +weapon_handcannon
121.97 +weapon_harpoongun
121.98 +weapon_hyperblaster
121.99 +weapon_infector
121.100 +weapon_jetfist
121.101 +weapon_lasergatling
121.102 +weapon_lightsabre
121.103 +weapon_lngun
121.104 +weapon_m16
121.105 +weapon_m41
121.106 +weapon_medkit
121.107 +weapon_mwgun
121.108 +weapon_ngun
121.109 +weapon_nuker
121.110 +weapon_oicw
121.111 +weapon_psg1
121.112 +weapon_railgun
121.113 +weapon_satelitelaser
121.114 +weapon_sgenerator
121.115 +weapon_shrinker
121.116 +weapon_soniccannon
121.117 +weapon_spectre
121.118 +weapon_spiderbomb
121.119 +weapon_sshotgun
121.120 +weapon_throwing_knife
121.121 +weapon_tnt
121.122 +weapon_translocator
121.123 +weapon_usas12
122.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
122.2 +++ b/metamod/ents/wizardwars Tue Apr 06 07:36:14 2004 +0000
122.3 @@ -0,0 +1,165 @@
122.4 +// vim: set ft=cpp :
122.5 +
122.6 +// Wizard Wars
122.7 +// http://www.planethalflife.com/wizardwars/
122.8 +
122.9 +// Wizard Wars beta 2
122.10 +monster_balllightning
122.11 +proj_lightningcloud
122.12 +proj_lightningsatchel
122.13 +weapon_balllightningspell
122.14 +weapon_lightningboltspell
122.15 +weapon_lightningcloudspell
122.16 +ammo_satchels
122.17 +ammo_spellbook
122.18 +beanstalk
122.19 +monster_giantplant
122.20 +monster_skeleton
122.21 +monster_spiritwiz
122.22 +monster_thornbush
122.23 +monster_tornado
122.24 +monster_wizardclone
122.25 +monster_wombat
122.26 +proj_bird
122.27 +proj_bursatchel
122.28 +proj_cocklebur
122.29 +proj_comet
122.30 +proj_doublemagicmissle
122.31 +proj_earthquakesatchel
122.32 +proj_fireball
122.33 +proj_firesatchel
122.34 +proj_firespiral
122.35 +proj_fissure
122.36 +proj_flyingskull
122.37 +proj_healhurtsatchel
122.38 +proj_icepoke
122.39 +proj_magicmissle
122.40 +proj_meteor
122.41 +proj_mindmissle
122.42 +proj_poisonsatchel
122.43 +proj_rollingstone
122.44 +proj_suctionsatchel
122.45 +proj_tcrystal
122.46 +proj_throwingbone
122.47 +proj_whirlwind
122.48 +slAGruntTakeCoverFromEnemy
122.49 +slAGruntThreatDisplay
122.50 +slAssassinTakeCoverFromBestSound
122.51 +slAssassinTakeCoverFromEnemy
122.52 +slAssassinTakeCoverFromEnemy2
122.53 +slBaFaceTarget
122.54 +slControllerTakeCover
122.55 +slFaceTarget
122.56 +slFaceTargetScared
122.57 +slGruntTakeCover
122.58 +slGruntTakeCoverFromBestSound
122.59 +slGruntTossGrenadeCover
122.60 +slIdleTrigger
122.61 +slRunToScript
122.62 +slTakeCoverFromBestSound
122.63 +slTakeCoverFromEnemy
122.64 +slTakeCoverFromOrigin
122.65 +slTlkIdleEyecontact
122.66 +slTlkIdleWatchClient
122.67 +slTwitchDie
122.68 +slWalkToScript
122.69 +tlAGruntTakeCoverFromEnemy
122.70 +tlAGruntThreatDisplay
122.71 +tlAssassinTakeCoverFromBestSound
122.72 +tlAssassinTakeCoverFromEnemy
122.73 +tlAssassinTakeCoverFromEnemy2
122.74 +tlBaFaceTarget
122.75 +tlControllerTakeCover
122.76 +tlFaceTarget
122.77 +tlFaceTargetScared
122.78 +tlGruntTakeCover1
122.79 +tlGruntTakeCoverFromBestSound
122.80 +tlGruntTossGrenadeCover1
122.81 +tlTakeCoverFromBestSound
122.82 +tlTakeCoverFromEnemy
122.83 +tlTakeCoverFromOrigin
122.84 +tlTlkIdleEyecontact
122.85 +tlTlkIdleWatchClient
122.86 +tlTlkIdleWatchClientStare
122.87 +tlTwitchDie
122.88 +weapon_beanstalkspell
122.89 +weapon_bearbite
122.90 +weapon_bearclaw
122.91 +weapon_birdspell
122.92 +weapon_cometspell
122.93 +weapon_deathrayspell
122.94 +weapon_doublemagicmisslespell
122.95 +weapon_fireballspell
122.96 +weapon_flamelickspell
122.97 +weapon_forcespell
122.98 +weapon_giantplantspell
122.99 +weapon_icepokespell
122.100 +weapon_levitationspell
122.101 +weapon_magicmisslespell
122.102 +weapon_meteorspell
122.103 +weapon_mindmisslespell
122.104 +weapon_rollingstonespell
122.105 +weapon_skeletonspell
122.106 +weapon_skullspell
122.107 +weapon_spiritwizspell
122.108 +weapon_spotboltspell
122.109 +weapon_staff
122.110 +weapon_thornblastspell
122.111 +weapon_tornadospell
122.112 +weapon_whirlwindspell
122.113 +weapon_whiterayspell
122.114 +weapon_wombatspell
122.115 +// end beta 2
122.116 +
122.117 +// Version 1.0
122.118 +//
122.119 +// From: "SirAlanF" <[email protected]>
122.120 +// Date: Mon, 30 Jul 2001 17:31:20 -0500
122.121 +
122.122 +deathsoul
122.123 +func_golem_body
122.124 +func_golem_controls_attack
122.125 +func_golem_controls_forward
122.126 +func_golem_controls_left
122.127 +func_golem_controls_right
122.128 +func_golem_leftarm
122.129 +func_golem_leftleg
122.130 +func_golem_rightarm
122.131 +func_golem_rightleg
122.132 +func_music
122.133 +i_p_t
122.134 +i_t_g
122.135 +i_t_t
122.136 +info_areamarker
122.137 +info_dragonrider_spawn
122.138 +info_player_teamspawn
122.139 +info_tf_teamcheck
122.140 +info_tf_teamset
122.141 +info_tfdetect
122.142 +info_tfgoal
122.143 +info_tfgoal_timer
122.144 +info_wwdetect
122.145 +item_armor1
122.146 +item_armor2
122.147 +item_armor3
122.148 +item_tfgoal
122.149 +lifesoul
122.150 +monster_dragon
122.151 +monster_goblin
122.152 +monster_sheep
122.153 +monster_spiritdragon
122.154 +potatoc
122.155 +proj_dragonfire
122.156 +proj_sporepod
122.157 +proj_toothsatchel
122.158 +proj_wyvern
122.159 +trigger_comet
122.160 +trigger_golem
122.161 +weapon_combospell
122.162 +weapon_dragonbreathspell
122.163 +weapon_dragonspell
122.164 +weapon_freezerayspell
122.165 +weapon_shieldspell
122.166 +weapon_updraftspell
122.167 +weapon_wyvernspell
122.168 +ww_monstermaker
123.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
123.2 +++ b/metamod/ents/wormshl Tue Apr 06 07:36:14 2004 +0000
123.3 @@ -0,0 +1,98 @@
123.4 +// vim: set ft=cpp :
123.5 +
123.6 +// WormsHL
123.7 +// http://www.wormshl.fr.st/
123.8 +// http://www.wormshl.com/
123.9 +
123.10 +// Version Beta 2.0
123.11 +//
123.12 +// From: <[email protected]>
123.13 +// Date: Thu, 18 Apr 2002 23:58:37 +0200
123.14 +
123.15 +balle
123.16 +flamme
123.17 +info_caisse_128
123.18 +info_caisse_16
123.19 +info_caisse_256
123.20 +info_caisse_32
123.21 +info_caisse_64
123.22 +info_player_observer
123.23 +info_zone_caisse
123.24 +item_baril
123.25 +item_caisse_arme
123.26 +item_caisse_mega
123.27 +item_caisse_outil
123.28 +item_caisse_vie
123.29 +item_mine
123.30 +item_tombe_bleu
123.31 +item_tombe_rouge
123.32 +monster_mouton
123.33 +rocket_air_strike
123.34 +rocket_croix
123.35 +rocket_napalm
123.36 +rocket_pigeon
123.37 +rocket_snipe
123.38 +trigger_baril
123.39 +trigger_hurt_bleu
123.40 +trigger_hurt_rouge
123.41 +trigger_mine
123.42 +trigger_zone_bleu
123.43 +trigger_zone_rouge
123.44 +trip_beam
123.45 +weapon_air_strike
123.46 +weapon_banane
123.47 +weapon_batte
123.48 +weapon_bazooka
123.49 +weapon_camera
123.50 +weapon_cluster
123.51 +weapon_croix
123.52 +weapon_dynamite
123.53 +weapon_fusil
123.54 +weapon_grappin
123.55 +weapon_grenade
123.56 +weapon_hache
123.57 +weapon_jetpack
123.58 +weapon_kamikaze
123.59 +weapon_laser
123.60 +weapon_mine
123.61 +weapon_minicanon
123.62 +weapon_molotov
123.63 +weapon_mortier
123.64 +weapon_morve
123.65 +weapon_mouton
123.66 +weapon_napalm
123.67 +weapon_pigeon
123.68 +weapon_sainte
123.69 +weapon_snipe
123.70 +weapon_super_mouton
123.71 +weapon_teleporteur
123.72 +weapon_trident
123.73 +
123.74 +// Version Beta 2.1
123.75 +//
123.76 +// From: anybody <[email protected]>
123.77 +// Date: Fri, 19 Jul 2002 13:36:48 +0200
123.78 +
123.79 +info_bananier
123.80 +item_baril_bleu
123.81 +item_baril_rouge
123.82 +trigger_point_controle
123.83 +weapon_helico
123.84 +weapon_kameha
123.85 +
123.86 +// Version Beta 3.0
123.87 +//
123.88 +// From: "europium" <[email protected]>
123.89 +// Date: Thu, 10 Apr 2003 21:23:15 +0200
123.90 +//
123.91 +
123.92 +fire_ball
123.93 +func_water_up
123.94 +info_elephant
123.95 +info_marguerite
123.96 +info_sapin
123.97 +item_grappin
123.98 +rocket_phoenix
123.99 +weapon_lanceflamme
123.100 +weapon_phoenix
123.101 +weapon_ruche
124.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
124.2 +++ b/metamod/game_support.cpp Tue Apr 06 07:36:14 2004 +0000
124.3 @@ -0,0 +1,146 @@
124.4 +// vi: set ts=4 sw=4 :
124.5 +// vim: set tw=75 :
124.6 +
124.7 +// game_support.cpp - info to recognize different HL mod "games"
124.8 +
124.9 +/*
124.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
124.11 + *
124.12 + * This file is part of Metamod.
124.13 + *
124.14 + * Metamod is free software; you can redistribute it and/or modify it
124.15 + * under the terms of the GNU General Public License as published by the
124.16 + * Free Software Foundation; either version 2 of the License, or (at
124.17 + * your option) any later version.
124.18 + *
124.19 + * Metamod is distributed in the hope that it will be useful, but
124.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
124.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
124.22 + * General Public License for more details.
124.23 + *
124.24 + * You should have received a copy of the GNU General Public License
124.25 + * along with Metamod; if not, write to the Free Software Foundation,
124.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
124.27 + *
124.28 + * In addition, as a special exception, the author gives permission to
124.29 + * link the code of this program with the Half-Life Game Engine ("HL
124.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
124.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
124.32 + * respects for all of the code used other than the HL Engine and MODs
124.33 + * from Valve. If you modify this file, you may extend this exception
124.34 + * to your version of the file, but you are not obligated to do so. If
124.35 + * you do not wish to do so, delete this exception statement from your
124.36 + * version.
124.37 + *
124.38 + */
124.39 +
124.40 +#include <extdll.h> // always
124.41 +
124.42 +#include "game_support.h" // me
124.43 +#include "log_meta.h" // META_LOG, etc
124.44 +#include "types_meta.h" // mBOOL
124.45 +#include "osdep.h" // win32 snprintf, etc
124.46 +
124.47 +// Adapted from adminmod h_export.cpp:
124.48 +//! this structure contains a list of supported mods and their dlls names
124.49 +//! To add support for another mod add an entry here, and add all the
124.50 +//! exported entities to link_func.cpp
124.51 +game_modlist_t known_games = {
124.52 + // name/gamedir linux_so win_dll desc
124.53 + //
124.54 + // Previously enumerated in this sourcefile, the list is now kept in a
124.55 + // separate file, generated based on game information stored in a
124.56 + // convenient db.
124.57 + //
124.58 +#include "games.h"
124.59 + // End of list terminator:
124.60 + {NULL, NULL, NULL, NULL}
124.61 +};
124.62 +
124.63 +// Find a modinfo corresponding to the given game name.
124.64 +game_modinfo_t *lookup_game(const char *name) {
124.65 + game_modinfo_t *imod;
124.66 + int i;
124.67 + for(i=0; known_games[i].name; i++) {
124.68 + imod=&known_games[i];
124.69 + if(strmatch(imod->name, name))
124.70 + return(imod);
124.71 + }
124.72 + // no match found
124.73 + return(NULL);
124.74 +}
124.75 +
124.76 +// Set all the fields in the gamedll struct, - based either on an entry in
124.77 +// known_games matching the current gamedir, or on one specified manually
124.78 +// by the server admin.
124.79 +//
124.80 +// meta_errno values:
124.81 +// - ME_NOTFOUND couldn't recognize game
124.82 +mBOOL setup_gamedll(gamedll_t *gamedll) {
124.83 + static char override_desc_buf[256];
124.84 + game_modinfo_t *known;
124.85 + char *cp, *knownfn;
124.86 + int override=0;
124.87 +
124.88 + // Check for old-style "metagame.ini" file and complain.
124.89 + if(valid_gamedir_file(OLD_GAMEDLL_TXT))
124.90 + META_ERROR("File '%s' is no longer supported; instead, specify override gamedll in %s or with '+localinfo mm_gamedll <dllfile>'", OLD_GAMEDLL_TXT, CONFIG_INI);
124.91 +
124.92 + // First, look for a known game, based on gamedir.
124.93 + if((known=lookup_game(gamedll->name))) {
124.94 +#ifdef _WIN32
124.95 + knownfn=known->win_dll;
124.96 +#elif defined(linux)
124.97 + knownfn=known->linux_so;
124.98 +#else
124.99 +#error "OS unrecognized"
124.100 +#endif /* _WIN32 */
124.101 + }
124.102 +
124.103 + // Neither override nor auto-detect found a gamedll.
124.104 + if(!known && !Config->gamedll)
124.105 + RETURN_ERRNO(mFALSE, ME_NOTFOUND);
124.106 +
124.107 + // Use override-dll if specified.
124.108 + if(Config->gamedll) {
124.109 + STRNCPY(gamedll->pathname, Config->gamedll,
124.110 + sizeof(gamedll->pathname));
124.111 + override=1;
124.112 + }
124.113 + // Else use Auto-detect dll.
124.114 + else {
124.115 + snprintf(gamedll->pathname, sizeof(gamedll->pathname), "%s/dlls/%s",
124.116 + gamedll->gamedir, knownfn);
124.117 + }
124.118 +
124.119 + // get filename from pathname
124.120 + cp=strrchr(gamedll->pathname, '/');
124.121 + if(cp) cp++;
124.122 + else cp=gamedll->pathname;
124.123 + gamedll->file=cp;
124.124 +
124.125 + // If found, store also the supposed "real" dll path based on the
124.126 + // gamedir, in case it differs from the "override" dll path.
124.127 + if(known && override)
124.128 + snprintf(gamedll->real_pathname, sizeof(gamedll->real_pathname),
124.129 + "%s/dlls/%s", gamedll->gamedir, knownfn);
124.130 + else // !known or !override
124.131 + STRNCPY(gamedll->real_pathname, gamedll->pathname,
124.132 + sizeof(gamedll->real_pathname));
124.133 +
124.134 + if(override) {
124.135 + // generate a desc
124.136 + snprintf(override_desc_buf, sizeof(override_desc_buf),
124.137 + "%s (override)", gamedll->file);
124.138 + gamedll->desc=override_desc_buf;
124.139 + // log result
124.140 + META_LOG("Overriding game '%s' with dllfile '%s'", gamedll->name,
124.141 + gamedll->file);
124.142 + }
124.143 + else {
124.144 + gamedll->desc=known->desc;
124.145 + META_LOG("Recognized game '%s'; using dllfile '%s'", gamedll->name,
124.146 + gamedll->file);
124.147 + }
124.148 + return(mTRUE);
124.149 +}
125.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
125.2 +++ b/metamod/game_support.h Tue Apr 06 07:36:14 2004 +0000
125.3 @@ -0,0 +1,55 @@
125.4 +// vi: set ts=4 sw=4 :
125.5 +// vim: set tw=75 :
125.6 +
125.7 +// game_support.h - structures for supporting different HL mod "games"
125.8 +
125.9 +/*
125.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
125.11 + *
125.12 + * This file is part of Metamod.
125.13 + *
125.14 + * Metamod is free software; you can redistribute it and/or modify it
125.15 + * under the terms of the GNU General Public License as published by the
125.16 + * Free Software Foundation; either version 2 of the License, or (at
125.17 + * your option) any later version.
125.18 + *
125.19 + * Metamod is distributed in the hope that it will be useful, but
125.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
125.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
125.22 + * General Public License for more details.
125.23 + *
125.24 + * You should have received a copy of the GNU General Public License
125.25 + * along with Metamod; if not, write to the Free Software Foundation,
125.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
125.27 + *
125.28 + * In addition, as a special exception, the author gives permission to
125.29 + * link the code of this program with the Half-Life Game Engine ("HL
125.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
125.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
125.32 + * respects for all of the code used other than the HL Engine and MODs
125.33 + * from Valve. If you modify this file, you may extend this exception
125.34 + * to your version of the file, but you are not obligated to do so. If
125.35 + * you do not wish to do so, delete this exception statement from your
125.36 + * version.
125.37 + *
125.38 + */
125.39 +
125.40 +#ifndef GAME_SUPPORT_H
125.41 +#define GAME_SUPPORT_H
125.42 +
125.43 +#include "types_meta.h" // mBOOL
125.44 +#include "metamod.h" // gamedll_t
125.45 +
125.46 +// Information we have about each game/mod DLL.
125.47 +typedef struct game_modinfo_s {
125.48 + char *name; // name (the game dir)
125.49 + char *linux_so; // filename of linux shared lib
125.50 + char *win_dll; // filename of win32 dll
125.51 + char *desc; // our long-name description
125.52 +} game_modinfo_t;
125.53 +
125.54 +typedef game_modinfo_t game_modlist_t[];
125.55 +game_modinfo_t *lookup_game(const char *name);
125.56 +mBOOL setup_gamedll(gamedll_t *gamedll);
125.57 +
125.58 +#endif /* GAME_SUPPORT_H */
126.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
126.2 +++ b/metamod/games.h Tue Apr 06 07:36:14 2004 +0000
126.3 @@ -0,0 +1,108 @@
126.4 +// vi: set ts=4 sw=4 :
126.5 +// vim: set tw=75 :
126.6 +
126.7 +// games.h - list of supported game mods and their data
126.8 +
126.9 +/*
126.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
126.11 + *
126.12 + * This file is part of Metamod.
126.13 + *
126.14 + * Metamod is free software; you can redistribute it and/or modify it
126.15 + * under the terms of the GNU General Public License as published by the
126.16 + * Free Software Foundation; either version 2 of the License, or (at
126.17 + * your option) any later version.
126.18 + *
126.19 + * Metamod is distributed in the hope that it will be useful, but
126.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
126.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
126.22 + * General Public License for more details.
126.23 + *
126.24 + * You should have received a copy of the GNU General Public License
126.25 + * along with Metamod; if not, write to the Free Software Foundation,
126.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
126.27 + *
126.28 + * In addition, as a special exception, the author gives permission to
126.29 + * link the code of this program with the Half-Life Game Engine ("HL
126.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
126.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
126.32 + * respects for all of the code used other than the HL Engine and MODs
126.33 + * from Valve. If you modify this file, you may extend this exception
126.34 + * to your version of the file, but you are not obligated to do so. If
126.35 + * you do not wish to do so, delete this exception statement from your
126.36 + * version.
126.37 + *
126.38 + */
126.39 +
126.40 +// This list is now kept in a separate file to facilitate generating the
126.41 +// list from game data stored in a convenient db.
126.42 +
126.43 +
126.44 + {"action", "ahl_i386.so", "ahl.dll", "Action Half-Life"},
126.45 + {"ag", "hl_i386.so", "hl.dll", "Adrenalinegamer 3.x"},
126.46 + {"aghl", "ag_i386.so", "ag.dll", "Adrenalinegamer 4.x"},
126.47 + {"arg", "arg_i386.so", "hl.dll", "Arg!"},
126.48 + {"asheep", "hl_i386.so", "hl.dll", "Azure Sheep"},
126.49 + {"bg", "bg_i386.so", "bg.dll", "The Battle Grounds"},
126.50 + {"bot", "bot_i386.so", "bot.dll", "Bot"},
126.51 + {"bumpercars", "hl_i386.so", "hl.dll", "Bumper Cars"},
126.52 + {"buzzybots", "bb_i386.so", "bb.dll", "BuzzyBots"},
126.53 + {"cstrike", "cs_i386.so", "mp.dll", "Counter-Strike"},
126.54 + {"dcrisis", "dc_i386.so", "dc.dll", "Desert Crisis"},
126.55 + {"dmc", "dmc_i386.so", "dmc.dll", "Deathmatch Classic"},
126.56 + {"dod", "dod_i386.so", "dod.dll", "Day of Defeat"},
126.57 + {"dpb", "pb_i686.so", "pb.dll", "Digital Paintball"},
126.58 + {"dragonmodz", "hl_i386.so", "mp.dll", "Dragon Mod Z"},
126.59 + {"esf", "hl_i386.so", "hl.dll", "Earth's Special Forces"},
126.60 + {"existence", "ex_i386.so", "existence.dll", "Existence"},
126.61 + {"firearms", "fa_i386.so", "firearms.dll", "Firearms"},
126.62 + {"firearms25", "fa_i386.so", "firearms.dll", "Retro Firearms"},
126.63 + {"freeze", "mp_i386.so", "mp.dll", "Freeze"},
126.64 + {"frontline", "front_i386.so", "frontline.dll", "Frontline Force"},
126.65 + {"gangstawars", "gansta_i386.so", "hl.dll", "GangstaWars"},
126.66 + {"gangwars", "mp_i386.so", "mp.dll", "Gangwars"},
126.67 + {"gearbox", "opfor_i386.so", "opfor.dll", "Opposing Force"},
126.68 + {"globalwarfare", "gw_i386.so", "mp.dll", "Global Warfare"},
126.69 + {"goldeneye", "golden_i386.so", "mp.dll", "Goldeneye"},
126.70 + {"hlrally", "hlr_i386.so", "hlrally.dll", "HL-Rally"},
126.71 + {"holywars", "hl_i386.so", "holywars.dll", "Holy Wars"},
126.72 + {"ios", "ios_i386.so", "ios.dll", "International Online Soccer"},
126.73 + {"judgedm", "judge_i386.so", "mp.dll", "Judgement"},
126.74 + {"kanonball", "hl_i386.so", "kanonball.dll", "Kanonball"},
126.75 + {"monkeystrike", "ms_i386.so", "monkey.dll", "Monkeystrike"},
126.76 + {"MorbidPR", "morbid_i386.so", "morbid.dll", "Morbid Inclination"},
126.77 + {"ns", "ns_i386.so", "ns.dll", "Natural Selection"},
126.78 + {"oel", "hl_i386.so", "hl.dll", "OeL Half-Life"},
126.79 + {"og", "og_i386.so", "og.dll", "Over Ground"},
126.80 + {"ol", "ol_i386.so", "hl.dll", "Outlawsmod"},
126.81 + {"osjb", "osjb_i386.so", "jail.dll", "Open-Source Jailbreak"},
126.82 + {"oz", "mp_i386.so", "mp.dll", "Oz Deathmatch"},
126.83 + {"paintball", "pb_i386.so", "mp.dll", "Paintball"},
126.84 + {"penemy", "pe_i386.so", "pe.dll", "Public Enemy"},
126.85 + {"phineas", "phineas_i386.so", "phineas.dll", "Phineas Bot"},
126.86 + {"ponreturn", "ponr_i386.so", "mp.dll", "Point of No Return"},
126.87 + {"retrocs", "rcs_i386.so", "rcs.dll", "Retro Counter-Strike"},
126.88 + {"rewolf", "hl_i386.so", "gunman.dll", "Gunman Chronicles"},
126.89 + {"ricochet", "ricochet_i386.so", "mp.dll", "Ricochet"},
126.90 + {"rockcrowbar", "rc_i386.so", "rc.dll", "Rocket Crowbar"},
126.91 + {"rspecies", "hl_i386.so", "hl.dll", "Rival Species"},
126.92 + {"scihunt", "shunt.so", "shunt.dll", "Scientist Hunt"},
126.93 + {"si", "si_i386.so", "si.dll", "Science & Industry"},
126.94 + {"snow", "hl_i386.so", "snow.dll", "Snow-War"},
126.95 + {"stargatetc", "hl_i386.so", "hl.dll", "StargateTC"},
126.96 + {"svencoop", "hl_i386.so", "hl.dll", "Sven Coop"},
126.97 + {"swarm", "swarm_i386.so", "swarm.dll", "Swarm"},
126.98 + {"tfc", "tfc_i386.so", "tfc.dll", "Team Fortress Classic"},
126.99 + {"thewastes", "thewastes_i386.so", "thewastes.dll", "The Wastes"},
126.100 + {"timeless", "pt_i386.so", "timeless.dll", "Project Timeless"},
126.101 + {"tod", "hl_i386.so", "hl.dll", "Tour of Duty"},
126.102 + {"trainhunters", "th_i386.so", "th.dll", "Train Hunters"},
126.103 + {"TS", "ts_i386.so", "mp.dll", "The Specialists"},
126.104 + {"underworld", "uw_i386.so", "uw.dll", "Underworld Bloodline"},
126.105 + {"valve", "hl_i386.so", "hl.dll", "Half-Life Deathmatch"},
126.106 + {"vs", "vs_i386.so", "mp.dll", "VampireSlayer"},
126.107 + {"wantedhl", "hl_i386.so", "wanted.dll", "Wanted!"},
126.108 + {"wasteland", "whl_linux.so", "mp.dll", "Wasteland"},
126.109 + {"weapon_wars", "ww_i386.so", "hl.dll", "Weapon Wars"},
126.110 + {"wizwars", "mp_i386.so", "hl.dll", "Wizard Wars"},
126.111 + {"wormshl", "wormshl_i586.so", "wormshl.dll", "WormsHL"},
127.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
127.2 +++ b/metamod/h_export.cpp Tue Apr 06 07:36:14 2004 +0000
127.3 @@ -0,0 +1,93 @@
127.4 +// vi: set ts=4 sw=4 :
127.5 +// vim: set tw=75 :
127.6 +
127.7 +// h_export.cpp - main exported DLL functionality
127.8 +
127.9 +// From SDK dlls/h_export.cpp:
127.10 +
127.11 +/***
127.12 +*
127.13 +* Copyright (c) 1999, 2000 Valve LLC. All rights reserved.
127.14 +*
127.15 +* This product contains software technology licensed from Id
127.16 +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
127.17 +* All Rights Reserved.
127.18 +*
127.19 +* Use, distribution, and modification of this source code and/or resulting
127.20 +* object code is restricted to non-commercial enhancements to products from
127.21 +* Valve LLC. All other use, distribution, or modification is prohibited
127.22 +* without written permission from Valve LLC.
127.23 +*
127.24 +****/
127.25 +/*
127.26 +
127.27 +===== h_export.cpp ========================================================
127.28 +
127.29 + Entity classes exported by Halflife.
127.30 +
127.31 +*/
127.32 +
127.33 +
127.34 +#include <extdll.h> // always
127.35 +
127.36 +#include "h_export.h" // me
127.37 +#include "metamod.h" // engine_t, etc
127.38 +#include "log_meta.h" // META_DEV, etc
127.39 +
127.40 +// From SDK dlls/h_export.cpp:
127.41 +
127.42 +#ifdef _WIN32
127.43 +//! Required DLL entry point
127.44 +// The above SDK comment indicates this routine is required, but the MSDN
127.45 +// documentation indicates it's actually optional. We keep it, though, for
127.46 +// completeness.
127.47 +BOOL WINAPI DllMain(HINSTANCE /* hinstDLL */, DWORD fdwReason,
127.48 + LPVOID /* lpvReserved */)
127.49 +{
127.50 + if (fdwReason == DLL_PROCESS_ATTACH) {
127.51 + /* nothing */
127.52 + }
127.53 + else if (fdwReason == DLL_PROCESS_DETACH) {
127.54 + /* nothing */
127.55 + }
127.56 + return(TRUE);
127.57 +}
127.58 +#elif defined(linux)
127.59 +// Linux routines to correspond to ATTACH and DETACH cases above. These
127.60 +// aren't required by linux, but are included here for completeness, and
127.61 +// just in case we come across a need to do something at dll load or
127.62 +// unload.
127.63 +void _init(void) {
127.64 + // called before dlopen() returns
127.65 +}
127.66 +void _fini(void) {
127.67 + // called before dlclose() returns
127.68 +}
127.69 +#endif
127.70 +
127.71 +//! Holds engine functionality callbacks
127.72 +enginefuncs_t g_engfuncs;
127.73 +globalvars_t *gpGlobals;
127.74 +engine_t Engine;
127.75 +
127.76 +// Receive engine function table from engine.
127.77 +//
127.78 +// This appears to be the _first_ DLL routine called by the engine, so this
127.79 +// is where we hook to load all the other DLLs (game, plugins, etc), which
127.80 +// is actually all done in meta_startup().
127.81 +void WINAPI GiveFnptrsToDll(enginefuncs_t *pengfuncsFromEngine,
127.82 + globalvars_t *pGlobals)
127.83 +{
127.84 + memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(g_engfuncs));
127.85 + gpGlobals = pGlobals;
127.86 + Engine.funcs = &g_engfuncs;
127.87 + Engine.globals = pGlobals;
127.88 + // NOTE! Have to call logging function _after_ copying into g_engfuncs, so
127.89 + // that g_engfuncs.pfnAlertMessage() can be resolved properly, heh. :)
127.90 + META_DEV("called: GiveFnptrsToDll");
127.91 +
127.92 + // Load plugins, load game dll.
127.93 + metamod_startup();
127.94 +
127.95 + return;
127.96 +}
128.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
128.2 +++ b/metamod/h_export.h Tue Apr 06 07:36:14 2004 +0000
128.3 @@ -0,0 +1,49 @@
128.4 +// vi: set ts=4 sw=4 :
128.5 +// vim: set tw=75 :
128.6 +
128.7 +// h_export.h - prototypes for h_export.cpp
128.8 +
128.9 +/*
128.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
128.11 + *
128.12 + * This file is part of Metamod.
128.13 + *
128.14 + * Metamod is free software; you can redistribute it and/or modify it
128.15 + * under the terms of the GNU General Public License as published by the
128.16 + * Free Software Foundation; either version 2 of the License, or (at
128.17 + * your option) any later version.
128.18 + *
128.19 + * Metamod is distributed in the hope that it will be useful, but
128.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
128.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
128.22 + * General Public License for more details.
128.23 + *
128.24 + * You should have received a copy of the GNU General Public License
128.25 + * along with Metamod; if not, write to the Free Software Foundation,
128.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
128.27 + *
128.28 + * In addition, as a special exception, the author gives permission to
128.29 + * link the code of this program with the Half-Life Game Engine ("HL
128.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
128.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
128.32 + * respects for all of the code used other than the HL Engine and MODs
128.33 + * from Valve. If you modify this file, you may extend this exception
128.34 + * to your version of the file, but you are not obligated to do so. If
128.35 + * you do not wish to do so, delete this exception statement from your
128.36 + * version.
128.37 + *
128.38 + */
128.39 +
128.40 +#ifndef H_EXPORT_H
128.41 +#define H_EXPORT_H
128.42 +
128.43 +#include "osdep.h" // DLLEXPORT, WINAPI, etc
128.44 +
128.45 +// Our GiveFnptrsToDll, called by engine.
128.46 +typedef void (WINAPI *GIVE_ENGINE_FUNCTIONS_FN) (enginefuncs_t
128.47 + *pengfuncsFromEngine, globalvars_t *pGlobals);
128.48 +
128.49 +C_DLLEXPORT void WINAPI GiveFnptrsToDll(enginefuncs_t *pengfuncsFromEngine,
128.50 + globalvars_t *pGlobals);
128.51 +
128.52 +#endif /* H_EXPORT_H */
129.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
129.2 +++ b/metamod/info_name.h Tue Apr 06 07:36:14 2004 +0000
129.3 @@ -0,0 +1,53 @@
129.4 +// vi: set ts=4 sw=4 :
129.5 +// vim: set tw=75 :
129.6 +
129.7 +// info_name.h - name, desc, author, etc
129.8 +
129.9 +/*
129.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
129.11 + *
129.12 + * This file is part of Metamod.
129.13 + *
129.14 + * Metamod is free software; you can redistribute it and/or modify it
129.15 + * under the terms of the GNU General Public License as published by the
129.16 + * Free Software Foundation; either version 2 of the License, or (at
129.17 + * your option) any later version.
129.18 + *
129.19 + * Metamod is distributed in the hope that it will be useful, but
129.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
129.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
129.22 + * General Public License for more details.
129.23 + *
129.24 + * You should have received a copy of the GNU General Public License
129.25 + * along with Metamod; if not, write to the Free Software Foundation,
129.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
129.27 + *
129.28 + * In addition, as a special exception, the author gives permission to
129.29 + * link the code of this program with the Half-Life Game Engine ("HL
129.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
129.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
129.32 + * respects for all of the code used other than the HL Engine and MODs
129.33 + * from Valve. If you modify this file, you may extend this exception
129.34 + * to your version of the file, but you are not obligated to do so. If
129.35 + * you do not wish to do so, delete this exception statement from your
129.36 + * version.
129.37 + *
129.38 + */
129.39 +
129.40 +#ifndef INFO_NAME_H
129.41 +#define INFO_NAME_H
129.42 +
129.43 +#include "vers_meta.h" // VDATE, VVERSION, etc
129.44 +
129.45 +#define VNAME "Metamod"
129.46 +#define VAUTHOR "Will Day <[email protected]>"
129.47 +#define VURL "http://www.metamod.org/"
129.48 +
129.49 +// Various strings for the Windows DLL Resources in res_meta.rc
129.50 +#define RC_COMMENTS "Metamod allows running multiple mod-like plugin DLLs, to add functionality or change the behavior of the running HLDS game mod. See " VURL
129.51 +#define RC_DESC "Metamod Half-Life MOD DLL"
129.52 +#define RC_FILENAME "METAMOD.DLL"
129.53 +#define RC_INTERNAL "METAMOD"
129.54 +#define RC_COPYRIGHT "Copyright� 2001-2003 Will Day; licensed under the GPL"
129.55 +
129.56 +#endif /* INFO_NAME_H */
130.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
130.2 +++ b/metamod/linkent.cpp Tue Apr 06 07:36:14 2004 +0000
130.3 @@ -0,0 +1,62 @@
130.4 +// vi: set ts=4 sw=4 :
130.5 +// vim: set tw=75 :
130.6 +
130.7 +// linkent.cpp - export entities from mod "games" back to the HL engine
130.8 +
130.9 +/*
130.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
130.11 + *
130.12 + * This file is part of Metamod.
130.13 + *
130.14 + * Metamod is free software; you can redistribute it and/or modify it
130.15 + * under the terms of the GNU General Public License as published by the
130.16 + * Free Software Foundation; either version 2 of the License, or (at
130.17 + * your option) any later version.
130.18 + *
130.19 + * Metamod is distributed in the hope that it will be useful, but
130.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
130.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
130.22 + * General Public License for more details.
130.23 + *
130.24 + * You should have received a copy of the GNU General Public License
130.25 + * along with Metamod; if not, write to the Free Software Foundation,
130.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
130.27 + *
130.28 + * In addition, as a special exception, the author gives permission to
130.29 + * link the code of this program with the Half-Life Game Engine ("HL
130.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
130.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
130.32 + * respects for all of the code used other than the HL Engine and MODs
130.33 + * from Valve. If you modify this file, you may extend this exception
130.34 + * to your version of the file, but you are not obligated to do so. If
130.35 + * you do not wish to do so, delete this exception statement from your
130.36 + * version.
130.37 + *
130.38 + */
130.39 +
130.40 +#include <extdll.h> // always
130.41 +
130.42 +#include "linkent.h" // LINK_ENTITY_TO_GAME
130.43 +
130.44 +// Function to perform common code of LINK_ENTITY_TO_GAME, rather than
130.45 +// duplicating the code in ~2000 expanded macros. Based on code from Jussi
130.46 +// Kivilinna <[email protected]>.
130.47 +void do_link_ent(ENTITY_FN *pfnEntity, int *missing, char *entStr,
130.48 + entvars_t *pev)
130.49 +{;
130.50 + if(*missing) {
130.51 + META_DEBUG(9, ("Skipping entity '%s'; was previously found missing", entStr));
130.52 + return;
130.53 + }
130.54 + if(!*pfnEntity) {
130.55 + META_DEBUG(9, ("Looking up game entity '%s'", entStr));
130.56 + *pfnEntity = (ENTITY_FN) DLSYM(GameDLL.handle, entStr);
130.57 + }
130.58 + if(!*pfnEntity) {
130.59 + META_ERROR("Couldn't find game entity '%s' in game DLL '%s': %s", entStr, GameDLL.name, DLERROR());
130.60 + *missing=1;
130.61 + return;
130.62 + }
130.63 + META_DEBUG(8, ("Linking game entity '%s'", entStr));
130.64 + (*pfnEntity)(pev);
130.65 +}
131.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
131.2 +++ b/metamod/linkent.h Tue Apr 06 07:36:14 2004 +0000
131.3 @@ -0,0 +1,117 @@
131.4 +// vi: set ts=4 sw=4 :
131.5 +// vim: set tw=75 :
131.6 +
131.7 +// linkent.h - export entities from mod "games" back to the HL engine
131.8 +
131.9 +/*
131.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
131.11 + *
131.12 + * This file is part of Metamod.
131.13 + *
131.14 + * Metamod is free software; you can redistribute it and/or modify it
131.15 + * under the terms of the GNU General Public License as published by the
131.16 + * Free Software Foundation; either version 2 of the License, or (at
131.17 + * your option) any later version.
131.18 + *
131.19 + * Metamod is distributed in the hope that it will be useful, but
131.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
131.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
131.22 + * General Public License for more details.
131.23 + *
131.24 + * You should have received a copy of the GNU General Public License
131.25 + * along with Metamod; if not, write to the Free Software Foundation,
131.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
131.27 + *
131.28 + * In addition, as a special exception, the author gives permission to
131.29 + * link the code of this program with the Half-Life Game Engine ("HL
131.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
131.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
131.32 + * respects for all of the code used other than the HL Engine and MODs
131.33 + * from Valve. If you modify this file, you may extend this exception
131.34 + * to your version of the file, but you are not obligated to do so. If
131.35 + * you do not wish to do so, delete this exception statement from your
131.36 + * version.
131.37 + *
131.38 + */
131.39 +
131.40 +#ifndef LINK_ENT_H
131.41 +#define LINK_ENT_H
131.42 +
131.43 +#include <extdll.h> // always
131.44 +
131.45 +#include "osdep.h" // DLLEXPORT, etc
131.46 +#include "metamod.h" // GameDLL, etc
131.47 +#include "mlist.h" // MPluginList::find_match, etc
131.48 +#include "mplugin.h" // MPlugin::info, etc
131.49 +#include "log_meta.h" // META_DEBUG, etc
131.50 +
131.51 +// Comments from SDK dlls/util.h:
131.52 +//! This is the glue that hooks .MAP entity class names to our CPP classes.
131.53 +//! The _declspec forces them to be exported by name so we can do a lookup with GetProcAddress().
131.54 +//! The function is used to intialize / allocate the object for the entity.
131.55 +
131.56 +// Adapted from LINK_ENTITY_TO_FUNC in adminmod linkfunc.cpp.
131.57 +
131.58 +typedef void (*ENTITY_FN) (entvars_t *);
131.59 +
131.60 +// Function to perform common code of LINK_ENTITY_TO_GAME.
131.61 +void do_link_ent(ENTITY_FN *pfnEntity, int *missing, char *entStr,
131.62 + entvars_t *pev);
131.63 +
131.64 +#define LINK_ENTITY_TO_GAME(entityName) \
131.65 + C_DLLEXPORT void entityName(entvars_t *pev); \
131.66 + void entityName(entvars_t *pev) { \
131.67 + static ENTITY_FN pfnEntity = NULL; \
131.68 + static int missing=0; \
131.69 + char *entStr; \
131.70 + entStr = STRINGIZE(entityName, 0); \
131.71 + do_link_ent(&pfnEntity, &missing, entStr, pev); \
131.72 + }
131.73 +
131.74 +// For now, we have to explicitly export functions for plugin entities,
131.75 +// just as for gamedll entities. Ideally, this could be generalized in
131.76 +// some manner, so that plugins can declare and use their own entities
131.77 +// without having them explicitly supported by metamod, but I don't know
131.78 +// yet if that is actually possible.
131.79 +//
131.80 +// LINK_ENTITY_TO_PLUGIN
131.81 +// - if plugin not loaded & running, return
131.82 +// - plugin has to be set loadable=startup only, else log error, return
131.83 +// - (plugin loaded) if func missing, return
131.84 +// - (plugin loaded) if func not found, dlsym
131.85 +// - (plugin loaded) if func still not found, set missing, return
131.86 +// - (plugin loaded, func found) call func
131.87 +#define LINK_ENTITY_TO_PLUGIN(entityName, pluginName) \
131.88 + C_DLLEXPORT void entityName(entvars_t *pev); \
131.89 + void entityName(entvars_t *pev) { \
131.90 + static ENTITY_FN pfnEntity = NULL; \
131.91 + static int missing=0; \
131.92 + char *entStr; \
131.93 + MPlugin *findp; \
131.94 + entStr = STRINGIZE(entityName, 0); \
131.95 + if(missing) \
131.96 + return; \
131.97 + if(!pfnEntity) { \
131.98 + if(!(findp=Plugins->find_match(pluginName))) { \
131.99 + META_ERROR("Couldn't find loaded plugin '%s' for plugin entity '%s'", pluginName, entStr); \
131.100 + missing=1; \
131.101 + return; \
131.102 + } \
131.103 + if(findp->info && findp->info->loadable != PT_STARTUP) { \
131.104 + META_ERROR("Can't link entity '%s' for plugin '%s'; loadable != startup: %s", entStr, pluginName, findp->str_loadable()); \
131.105 + missing=1; \
131.106 + return; \
131.107 + } \
131.108 + META_DEBUG(9, ("Looking up plugin entity '%s'", entStr)); \
131.109 + pfnEntity = (ENTITY_FN) DLSYM(findp->handle, entStr); \
131.110 + } \
131.111 + if(!pfnEntity) { \
131.112 + META_ERROR("Couldn't find plugin entity '%s' in plugin DLL '%s'", entStr, findp->file); \
131.113 + missing=1; \
131.114 + return; \
131.115 + } \
131.116 + META_DEBUG(8, ("Linking plugin entity '%s'", entStr)); \
131.117 + (*pfnEntity)(pev); \
131.118 + }
131.119 +
131.120 +#endif /* LINK_ENT_H */
132.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
132.2 +++ b/metamod/linkgame.cpp Tue Apr 06 07:36:14 2004 +0000
132.3 @@ -0,0 +1,2896 @@
132.4 +// vi: set ts=4 sw=4 :
132.5 +// vim: set tw=75 :
132.6 +
132.7 +// linkgame.cpp - export entities from mod "games" back to the HL engine
132.8 +
132.9 +/*
132.10 + * Copyright (c) 2001-2002 Will Day <[email protected]>
132.11 + *
132.12 + * This file is part of Metamod.
132.13 + *
132.14 + * Metamod is free software; you can redistribute it and/or modify it
132.15 + * under the terms of the GNU General Public License as published by the
132.16 + * Free Software Foundation; either version 2 of the License, or (at
132.17 + * your option) any later version.
132.18 + *
132.19 + * Metamod is distributed in the hope that it will be useful, but
132.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
132.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
132.22 + * General Public License for more details.
132.23 + *
132.24 + * You should have received a copy of the GNU General Public License
132.25 + * along with Metamod; if not, write to the Free Software Foundation,
132.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
132.27 + *
132.28 + * In addition, as a special exception, the author gives permission to
132.29 + * link the code of this program with the Half-Life Game Engine ("HL
132.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
132.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
132.32 + * respects for all of the code used other than the HL Engine and MODs
132.33 + * from Valve. If you modify this file, you may extend this exception
132.34 + * to your version of the file, but you are not obligated to do so. If
132.35 + * you do not wish to do so, delete this exception statement from your
132.36 + * version.
132.37 + *
132.38 + */
132.39 +
132.40 +#include <extdll.h> // always
132.41 +
132.42 +#include "linkent.h" // LINK_ENTITY_TO_GAME
132.43 +
132.44 +// Entity list for gamedlls adapted from adminmod linkfunc.cpp.
132.45 +
132.46 +// NOTE: This list of entities is automatically generated via the script
132.47 +// "mklinkgame.sh". See the files in the directory "ents" for the actual
132.48 +// list of entities.
132.49 +
132.50 +LINK_ENTITY_TO_GAME(AngleIMatrix);
132.51 +LINK_ENTITY_TO_GAME(AngleMatrix);
132.52 +LINK_ENTITY_TO_GAME(BALLS_airball);
132.53 +LINK_ENTITY_TO_GAME(CTF_Map);
132.54 +LINK_ENTITY_TO_GAME(CreateInterface);
132.55 +LINK_ENTITY_TO_GAME(DLLClassName);
132.56 +LINK_ENTITY_TO_GAME(DelayedUse);
132.57 +LINK_ENTITY_TO_GAME(Electro_Bolt);
132.58 +LINK_ENTITY_TO_GAME(FISHINGROD_bolt);
132.59 +LINK_ENTITY_TO_GAME(FOOT_bolt);
132.60 +LINK_ENTITY_TO_GAME(FlyingTomaHawk);
132.61 +LINK_ENTITY_TO_GAME(GetChaseOrigin);
132.62 +LINK_ENTITY_TO_GAME(IsoBomb);
132.63 +LINK_ENTITY_TO_GAME(PythRound);
132.64 +LINK_ENTITY_TO_GAME(RONINTeamScore);
132.65 +LINK_ENTITY_TO_GAME(SA_Model);
132.66 +LINK_ENTITY_TO_GAME(SCAVENGERTeamScore);
132.67 +LINK_ENTITY_TO_GAME(Satelite__Laser);
132.68 +LINK_ENTITY_TO_GAME(TSAmmoPack);
132.69 +LINK_ENTITY_TO_GAME(TSWorldGun);
132.70 +LINK_ENTITY_TO_GAME(TS_PowerUp);
132.71 +LINK_ENTITY_TO_GAME(TS_bomb);
132.72 +LINK_ENTITY_TO_GAME(USMCTeamScore);
132.73 +LINK_ENTITY_TO_GAME(Zombie2Spit);
132.74 +LINK_ENTITY_TO_GAME(_spit);
132.75 +LINK_ENTITY_TO_GAME(acidgib);
132.76 +LINK_ENTITY_TO_GAME(aiscripted_sequence);
132.77 +LINK_ENTITY_TO_GAME(alien_slave_energy_ball);
132.78 +LINK_ENTITY_TO_GAME(alien_slave_sapper);
132.79 +LINK_ENTITY_TO_GAME(alienresourcetower);
132.80 +LINK_ENTITY_TO_GAME(ambient_generic);
132.81 +LINK_ENTITY_TO_GAME(ammo_1911clip);
132.82 +LINK_ENTITY_TO_GAME(ammo_30cal);
132.83 +LINK_ENTITY_TO_GAME(ammo_338magnum);
132.84 +LINK_ENTITY_TO_GAME(ammo_357);
132.85 +LINK_ENTITY_TO_GAME(ammo_357sig);
132.86 +LINK_ENTITY_TO_GAME(ammo_40glclip);
132.87 +LINK_ENTITY_TO_GAME(ammo_40mm);
132.88 +LINK_ENTITY_TO_GAME(ammo_44);
132.89 +LINK_ENTITY_TO_GAME(ammo_45acp);
132.90 +LINK_ENTITY_TO_GAME(ammo_50ae);
132.91 +LINK_ENTITY_TO_GAME(ammo_50cal);
132.92 +LINK_ENTITY_TO_GAME(ammo_556);
132.93 +LINK_ENTITY_TO_GAME(ammo_556nato);
132.94 +LINK_ENTITY_TO_GAME(ammo_556natobox);
132.95 +LINK_ENTITY_TO_GAME(ammo_57mm);
132.96 +LINK_ENTITY_TO_GAME(ammo_762);
132.97 +LINK_ENTITY_TO_GAME(ammo_762mmbox);
132.98 +LINK_ENTITY_TO_GAME(ammo_762nato);
132.99 +LINK_ENTITY_TO_GAME(ammo_766mm);
132.100 +LINK_ENTITY_TO_GAME(ammo_9mm);
132.101 +LINK_ENTITY_TO_GAME(ammo_9mmAR);
132.102 +LINK_ENTITY_TO_GAME(ammo_9mmbox);
132.103 +LINK_ENTITY_TO_GAME(ammo_9mmclip);
132.104 +LINK_ENTITY_TO_GAME(ammo_AK47clip);
132.105 +LINK_ENTITY_TO_GAME(ammo_ARgrenades);
132.106 +LINK_ENTITY_TO_GAME(ammo_BALLS);
132.107 +LINK_ENTITY_TO_GAME(ammo_Deagle);
132.108 +LINK_ENTITY_TO_GAME(ammo_FISHINGROD);
132.109 +LINK_ENTITY_TO_GAME(ammo_FOOT);
132.110 +LINK_ENTITY_TO_GAME(ammo_FTclip);
132.111 +LINK_ENTITY_TO_GAME(ammo_adrenaline);
132.112 +LINK_ENTITY_TO_GAME(ammo_ak101);
132.113 +LINK_ENTITY_TO_GAME(ammo_ak105);
132.114 +LINK_ENTITY_TO_GAME(ammo_ak47);
132.115 +LINK_ENTITY_TO_GAME(ammo_ak47clip);
132.116 +LINK_ENTITY_TO_GAME(ammo_ak5);
132.117 +LINK_ENTITY_TO_GAME(ammo_ak74);
132.118 +LINK_ENTITY_TO_GAME(ammo_ak74clip);
132.119 +LINK_ENTITY_TO_GAME(ammo_anaconda);
132.120 +LINK_ENTITY_TO_GAME(ammo_ar10clip);
132.121 +LINK_ENTITY_TO_GAME(ammo_ar33clip);
132.122 +LINK_ENTITY_TO_GAME(ammo_areaammo);
132.123 +LINK_ENTITY_TO_GAME(ammo_aug);
132.124 +LINK_ENTITY_TO_GAME(ammo_awm);
132.125 +LINK_ENTITY_TO_GAME(ammo_awp);
132.126 +LINK_ENTITY_TO_GAME(ammo_bar);
132.127 +LINK_ENTITY_TO_GAME(ammo_baretta);
132.128 +LINK_ENTITY_TO_GAME(ammo_bazooka);
132.129 +LINK_ENTITY_TO_GAME(ammo_beamgunclip);
132.130 +LINK_ENTITY_TO_GAME(ammo_benelli);
132.131 +LINK_ENTITY_TO_GAME(ammo_ber92f);
132.132 +LINK_ENTITY_TO_GAME(ammo_ber93r);
132.133 +LINK_ENTITY_TO_GAME(ammo_beretta);
132.134 +LINK_ENTITY_TO_GAME(ammo_berettaclip);
132.135 +LINK_ENTITY_TO_GAME(ammo_bizon);
132.136 +LINK_ENTITY_TO_GAME(ammo_boltrifle);
132.137 +LINK_ENTITY_TO_GAME(ammo_bow);
132.138 +LINK_ENTITY_TO_GAME(ammo_bren);
132.139 +LINK_ENTITY_TO_GAME(ammo_brick);
132.140 +LINK_ENTITY_TO_GAME(ammo_buckshot);
132.141 +LINK_ENTITY_TO_GAME(ammo_buffalo);
132.142 +LINK_ENTITY_TO_GAME(ammo_cannon);
132.143 +LINK_ENTITY_TO_GAME(ammo_caseless);
132.144 +LINK_ENTITY_TO_GAME(ammo_chemical);
132.145 +LINK_ENTITY_TO_GAME(ammo_cloaker);
132.146 +LINK_ENTITY_TO_GAME(ammo_colt);
132.147 +LINK_ENTITY_TO_GAME(ammo_colt45clip);
132.148 +LINK_ENTITY_TO_GAME(ammo_coltgov);
132.149 +LINK_ENTITY_TO_GAME(ammo_colts);
132.150 +LINK_ENTITY_TO_GAME(ammo_concussion);
132.151 +LINK_ENTITY_TO_GAME(ammo_cougarclip);
132.152 +LINK_ENTITY_TO_GAME(ammo_crate);
132.153 +LINK_ENTITY_TO_GAME(ammo_crossbow);
132.154 +LINK_ENTITY_TO_GAME(ammo_d5kclip);
132.155 +LINK_ENTITY_TO_GAME(ammo_dbshot);
132.156 +LINK_ENTITY_TO_GAME(ammo_dd44clip);
132.157 +LINK_ENTITY_TO_GAME(ammo_de50);
132.158 +LINK_ENTITY_TO_GAME(ammo_deagle);
132.159 +LINK_ENTITY_TO_GAME(ammo_deagleclip);
132.160 +LINK_ENTITY_TO_GAME(ammo_deploygun);
132.161 +LINK_ENTITY_TO_GAME(ammo_desert);
132.162 +LINK_ENTITY_TO_GAME(ammo_dmlclip);
132.163 +LINK_ENTITY_TO_GAME(ammo_doubleshotgun);
132.164 +LINK_ENTITY_TO_GAME(ammo_dragunovclip);
132.165 +LINK_ENTITY_TO_GAME(ammo_dsr1);
132.166 +LINK_ENTITY_TO_GAME(ammo_dualberettas);
132.167 +LINK_ENTITY_TO_GAME(ammo_dualscorpion);
132.168 +LINK_ENTITY_TO_GAME(ammo_dyno);
132.169 +LINK_ENTITY_TO_GAME(ammo_eagleclip);
132.170 +LINK_ENTITY_TO_GAME(ammo_egonclip);
132.171 +LINK_ENTITY_TO_GAME(ammo_el_standard);
132.172 +LINK_ENTITY_TO_GAME(ammo_enfield);
132.173 +LINK_ENTITY_TO_GAME(ammo_exploder);
132.174 +LINK_ENTITY_TO_GAME(ammo_explogun);
132.175 +LINK_ENTITY_TO_GAME(ammo_famas);
132.176 +LINK_ENTITY_TO_GAME(ammo_famasclip);
132.177 +LINK_ENTITY_TO_GAME(ammo_fg42);
132.178 +LINK_ENTITY_TO_GAME(ammo_fiveseven);
132.179 +LINK_ENTITY_TO_GAME(ammo_flameammo);
132.180 +LINK_ENTITY_TO_GAME(ammo_flameclip);
132.181 +LINK_ENTITY_TO_GAME(ammo_flashbang);
132.182 +LINK_ENTITY_TO_GAME(ammo_fnfal);
132.183 +LINK_ENTITY_TO_GAME(ammo_frag);
132.184 +LINK_ENTITY_TO_GAME(ammo_freezeclip);
132.185 +LINK_ENTITY_TO_GAME(ammo_g11);
132.186 +LINK_ENTITY_TO_GAME(ammo_g36);
132.187 +LINK_ENTITY_TO_GAME(ammo_g36clip);
132.188 +LINK_ENTITY_TO_GAME(ammo_g36e);
132.189 +LINK_ENTITY_TO_GAME(ammo_g36k);
132.190 +LINK_ENTITY_TO_GAME(ammo_g3a3);
132.191 +LINK_ENTITY_TO_GAME(ammo_galil);
132.192 +LINK_ENTITY_TO_GAME(ammo_garand);
132.193 +LINK_ENTITY_TO_GAME(ammo_gatlinbox);
132.194 +LINK_ENTITY_TO_GAME(ammo_gattlinggun);
132.195 +LINK_ENTITY_TO_GAME(ammo_gaussclip);
132.196 +LINK_ENTITY_TO_GAME(ammo_generic_american);
132.197 +LINK_ENTITY_TO_GAME(ammo_generic_british);
132.198 +LINK_ENTITY_TO_GAME(ammo_generic_german);
132.199 +LINK_ENTITY_TO_GAME(ammo_gewehr);
132.200 +LINK_ENTITY_TO_GAME(ammo_glock17);
132.201 +LINK_ENTITY_TO_GAME(ammo_glock18);
132.202 +LINK_ENTITY_TO_GAME(ammo_glockclip);
132.203 +LINK_ENTITY_TO_GAME(ammo_goldpp7clip);
132.204 +LINK_ENTITY_TO_GAME(ammo_gp25);
132.205 +LINK_ENTITY_TO_GAME(ammo_greasegun);
132.206 +LINK_ENTITY_TO_GAME(ammo_grenades);
132.207 +LINK_ENTITY_TO_GAME(ammo_handcannon);
132.208 +LINK_ENTITY_TO_GAME(ammo_helirockets);
132.209 +LINK_ENTITY_TO_GAME(ammo_hk21);
132.210 +LINK_ENTITY_TO_GAME(ammo_hk33clip);
132.211 +LINK_ENTITY_TO_GAME(ammo_hkmp5);
132.212 +LINK_ENTITY_TO_GAME(ammo_jackhammer);
132.213 +LINK_ENTITY_TO_GAME(ammo_k43);
132.214 +LINK_ENTITY_TO_GAME(ammo_kar);
132.215 +LINK_ENTITY_TO_GAME(ammo_kf7clip);
132.216 +LINK_ENTITY_TO_GAME(ammo_knife);
132.217 +LINK_ENTITY_TO_GAME(ammo_knives);
132.218 +LINK_ENTITY_TO_GAME(ammo_launcher);
132.219 +LINK_ENTITY_TO_GAME(ammo_lgclip);
132.220 +LINK_ENTITY_TO_GAME(ammo_lgrenades);
132.221 +LINK_ENTITY_TO_GAME(ammo_lightning);
132.222 +LINK_ENTITY_TO_GAME(ammo_longslide);
132.223 +LINK_ENTITY_TO_GAME(ammo_lrclip);
132.224 +LINK_ENTITY_TO_GAME(ammo_luger);
132.225 +LINK_ENTITY_TO_GAME(ammo_m11);
132.226 +LINK_ENTITY_TO_GAME(ammo_m112);
132.227 +LINK_ENTITY_TO_GAME(ammo_m134);
132.228 +LINK_ENTITY_TO_GAME(ammo_m16);
132.229 +LINK_ENTITY_TO_GAME(ammo_m16a2clip);
132.230 +LINK_ENTITY_TO_GAME(ammo_m1carbine);
132.231 +LINK_ENTITY_TO_GAME(ammo_m2);
132.232 +LINK_ENTITY_TO_GAME(ammo_m203);
132.233 +LINK_ENTITY_TO_GAME(ammo_m249);
132.234 +LINK_ENTITY_TO_GAME(ammo_m4);
132.235 +LINK_ENTITY_TO_GAME(ammo_m40a1clip);
132.236 +LINK_ENTITY_TO_GAME(ammo_m4a1);
132.237 +LINK_ENTITY_TO_GAME(ammo_m4clip);
132.238 +LINK_ENTITY_TO_GAME(ammo_m60);
132.239 +LINK_ENTITY_TO_GAME(ammo_m60clip);
132.240 +LINK_ENTITY_TO_GAME(ammo_m79);
132.241 +LINK_ENTITY_TO_GAME(ammo_m82);
132.242 +LINK_ENTITY_TO_GAME(ammo_mac);
132.243 +LINK_ENTITY_TO_GAME(ammo_mac10);
132.244 +LINK_ENTITY_TO_GAME(ammo_machinegun);
132.245 +LINK_ENTITY_TO_GAME(ammo_mc51);
132.246 +LINK_ENTITY_TO_GAME(ammo_mf2clip);
132.247 +LINK_ENTITY_TO_GAME(ammo_mg34);
132.248 +LINK_ENTITY_TO_GAME(ammo_mg36);
132.249 +LINK_ENTITY_TO_GAME(ammo_mg42);
132.250 +LINK_ENTITY_TO_GAME(ammo_mindrayclip);
132.251 +LINK_ENTITY_TO_GAME(ammo_minigunClip);
132.252 +LINK_ENTITY_TO_GAME(ammo_mk23);
132.253 +LINK_ENTITY_TO_GAME(ammo_mossberg);
132.254 +LINK_ENTITY_TO_GAME(ammo_mp40);
132.255 +LINK_ENTITY_TO_GAME(ammo_mp44);
132.256 +LINK_ENTITY_TO_GAME(ammo_mp5);
132.257 +LINK_ENTITY_TO_GAME(ammo_mp5a2);
132.258 +LINK_ENTITY_TO_GAME(ammo_mp5a4);
132.259 +LINK_ENTITY_TO_GAME(ammo_mp5a5);
132.260 +LINK_ENTITY_TO_GAME(ammo_mp5clip);
132.261 +LINK_ENTITY_TO_GAME(ammo_mp5grenades);
132.262 +LINK_ENTITY_TO_GAME(ammo_mp5k);
132.263 +LINK_ENTITY_TO_GAME(ammo_mp5pdwclip);
132.264 +LINK_ENTITY_TO_GAME(ammo_mp5sd);
132.265 +LINK_ENTITY_TO_GAME(ammo_msg90);
132.266 +LINK_ENTITY_TO_GAME(ammo_nato);
132.267 +LINK_ENTITY_TO_GAME(ammo_nato308);
132.268 +LINK_ENTITY_TO_GAME(ammo_natoclip);
132.269 +LINK_ENTITY_TO_GAME(ammo_needle);
132.270 +LINK_ENTITY_TO_GAME(ammo_null);
132.271 +LINK_ENTITY_TO_GAME(ammo_p99);
132.272 +LINK_ENTITY_TO_GAME(ammo_p99clip);
132.273 +LINK_ENTITY_TO_GAME(ammo_pdw);
132.274 +LINK_ENTITY_TO_GAME(ammo_phantomclip);
132.275 +LINK_ENTITY_TO_GAME(ammo_piat);
132.276 +LINK_ENTITY_TO_GAME(ammo_pistol);
132.277 +LINK_ENTITY_TO_GAME(ammo_pistolet);
132.278 +LINK_ENTITY_TO_GAME(ammo_pkm);
132.279 +LINK_ENTITY_TO_GAME(ammo_pkmclip);
132.280 +LINK_ENTITY_TO_GAME(ammo_powercell);
132.281 +LINK_ENTITY_TO_GAME(ammo_pschreck);
132.282 +LINK_ENTITY_TO_GAME(ammo_psg1);
132.283 +LINK_ENTITY_TO_GAME(ammo_psg1clip);
132.284 +LINK_ENTITY_TO_GAME(ammo_railgun);
132.285 +LINK_ENTITY_TO_GAME(ammo_rcp90clip);
132.286 +LINK_ENTITY_TO_GAME(ammo_remington);
132.287 +LINK_ENTITY_TO_GAME(ammo_rifleclip);
132.288 +LINK_ENTITY_TO_GAME(ammo_rifleshot);
132.289 +LINK_ENTITY_TO_GAME(ammo_rocket);
132.290 +LINK_ENTITY_TO_GAME(ammo_rocketlauncher);
132.291 +LINK_ENTITY_TO_GAME(ammo_rocketpistol);
132.292 +LINK_ENTITY_TO_GAME(ammo_rockets);
132.293 +LINK_ENTITY_TO_GAME(ammo_rpgclip);
132.294 +LINK_ENTITY_TO_GAME(ammo_rs202m2);
132.295 +LINK_ENTITY_TO_GAME(ammo_rs_psi);
132.296 +LINK_ENTITY_TO_GAME(ammo_ruger);
132.297 +LINK_ENTITY_TO_GAME(ammo_sa80clip);
132.298 +LINK_ENTITY_TO_GAME(ammo_saa);
132.299 +LINK_ENTITY_TO_GAME(ammo_saiga);
132.300 +LINK_ENTITY_TO_GAME(ammo_sako);
132.301 +LINK_ENTITY_TO_GAME(ammo_satchels);
132.302 +LINK_ENTITY_TO_GAME(ammo_sbarrelshot);
132.303 +LINK_ENTITY_TO_GAME(ammo_scatterclip);
132.304 +LINK_ENTITY_TO_GAME(ammo_scopedkar);
132.305 +LINK_ENTITY_TO_GAME(ammo_shells);
132.306 +LINK_ENTITY_TO_GAME(ammo_sig245clip);
132.307 +LINK_ENTITY_TO_GAME(ammo_silverpp7clip);
132.308 +LINK_ENTITY_TO_GAME(ammo_sks);
132.309 +LINK_ENTITY_TO_GAME(ammo_smg9);
132.310 +LINK_ENTITY_TO_GAME(ammo_snUZI);
132.311 +LINK_ENTITY_TO_GAME(ammo_sniper);
132.312 +LINK_ENTITY_TO_GAME(ammo_spas12);
132.313 +LINK_ENTITY_TO_GAME(ammo_spasclip);
132.314 +LINK_ENTITY_TO_GAME(ammo_spellbook);
132.315 +LINK_ENTITY_TO_GAME(ammo_spitcarb);
132.316 +LINK_ENTITY_TO_GAME(ammo_spitclip);
132.317 +LINK_ENTITY_TO_GAME(ammo_spore);
132.318 +LINK_ENTITY_TO_GAME(ammo_spring);
132.319 +LINK_ENTITY_TO_GAME(ammo_srifleclip);
132.320 +LINK_ENTITY_TO_GAME(ammo_ssg3000);
132.321 +LINK_ENTITY_TO_GAME(ammo_st_far);
132.322 +LINK_ENTITY_TO_GAME(ammo_st_heavy);
132.323 +LINK_ENTITY_TO_GAME(ammo_st_medium);
132.324 +LINK_ENTITY_TO_GAME(ammo_st_short);
132.325 +LINK_ENTITY_TO_GAME(ammo_st_special1);
132.326 +LINK_ENTITY_TO_GAME(ammo_st_special2);
132.327 +LINK_ENTITY_TO_GAME(ammo_sten);
132.328 +LINK_ENTITY_TO_GAME(ammo_sterling);
132.329 +LINK_ENTITY_TO_GAME(ammo_stg24);
132.330 +LINK_ENTITY_TO_GAME(ammo_stoner);
132.331 +LINK_ENTITY_TO_GAME(ammo_stonerscope);
132.332 +LINK_ENTITY_TO_GAME(ammo_stonersilencer);
132.333 +LINK_ENTITY_TO_GAME(ammo_stubcoolant);
132.334 +LINK_ENTITY_TO_GAME(ammo_stumpbox);
132.335 +LINK_ENTITY_TO_GAME(ammo_svd);
132.336 +LINK_ENTITY_TO_GAME(ammo_swarm_xen_secondary);
132.337 +LINK_ENTITY_TO_GAME(ammo_swarmprimary);
132.338 +LINK_ENTITY_TO_GAME(ammo_swarmsecondary);
132.339 +LINK_ENTITY_TO_GAME(ammo_tec9);
132.340 +LINK_ENTITY_TO_GAME(ammo_thompson);
132.341 +LINK_ENTITY_TO_GAME(ammo_tommy);
132.342 +LINK_ENTITY_TO_GAME(ammo_tommygun);
132.343 +LINK_ENTITY_TO_GAME(ammo_trigun);
132.344 +LINK_ENTITY_TO_GAME(ammo_ump45);
132.345 +LINK_ENTITY_TO_GAME(ammo_usp);
132.346 +LINK_ENTITY_TO_GAME(ammo_uspclip);
132.347 +LINK_ENTITY_TO_GAME(ammo_uzi);
132.348 +LINK_ENTITY_TO_GAME(ammo_uziclip);
132.349 +LINK_ENTITY_TO_GAME(ammo_veprclip);
132.350 +LINK_ENTITY_TO_GAME(ammo_vomitclip);
132.351 +LINK_ENTITY_TO_GAME(ammo_vulcan);
132.352 +LINK_ENTITY_TO_GAME(ammo_wa2000);
132.353 +LINK_ENTITY_TO_GAME(ammo_webley);
132.354 +LINK_ENTITY_TO_GAME(ammo_whiskey);
132.355 +LINK_ENTITY_TO_GAME(ammo_winchester);
132.356 +LINK_ENTITY_TO_GAME(ammo_winchesterclip);
132.357 +LINK_ENTITY_TO_GAME(ammo_xm4);
132.358 +LINK_ENTITY_TO_GAME(ammo_xm4slug);
132.359 +LINK_ENTITY_TO_GAME(ammo_zmgclip);
132.360 +LINK_ENTITY_TO_GAME(ammobox);
132.361 +LINK_ENTITY_TO_GAME(arcade_points);
132.362 +LINK_ENTITY_TO_GAME(armoury_entity);
132.363 +LINK_ENTITY_TO_GAME(arrow);
132.364 +LINK_ENTITY_TO_GAME(asl_charge_flare);
132.365 +LINK_ENTITY_TO_GAME(aura);
132.366 +LINK_ENTITY_TO_GAME(autogl_gren);
132.367 +LINK_ENTITY_TO_GAME(ball_launcher);
132.368 +LINK_ENTITY_TO_GAME(balle);
132.369 +LINK_ENTITY_TO_GAME(banana);
132.370 +LINK_ENTITY_TO_GAME(barneymine);
132.371 +LINK_ENTITY_TO_GAME(base_drive_ent);
132.372 +LINK_ENTITY_TO_GAME(basecurse);
132.373 +LINK_ENTITY_TO_GAME(beam);
132.374 +LINK_ENTITY_TO_GAME(beam_attack);
132.375 +LINK_ENTITY_TO_GAME(beamshot);
132.376 +LINK_ENTITY_TO_GAME(bean);
132.377 +LINK_ENTITY_TO_GAME(beanstalk);
132.378 +LINK_ENTITY_TO_GAME(bfg10k);
132.379 +LINK_ENTITY_TO_GAME(big_bang);
132.380 +LINK_ENTITY_TO_GAME(big_disk);
132.381 +LINK_ENTITY_TO_GAME(blade);
132.382 +LINK_ENTITY_TO_GAME(blaster_beam);
132.383 +LINK_ENTITY_TO_GAME(bmortar);
132.384 +LINK_ENTITY_TO_GAME(bodyque);
132.385 +LINK_ENTITY_TO_GAME(bone_follow);
132.386 +LINK_ENTITY_TO_GAME(boolean_multisource);
132.387 +LINK_ENTITY_TO_GAME(bot);
132.388 +LINK_ENTITY_TO_GAME(bot_waypoint);
132.389 +LINK_ENTITY_TO_GAME(bowie_bolt);
132.390 +LINK_ENTITY_TO_GAME(bubgren);
132.391 +LINK_ENTITY_TO_GAME(building_dispenser);
132.392 +LINK_ENTITY_TO_GAME(building_sentrygun);
132.393 +LINK_ENTITY_TO_GAME(building_sentrygun_base);
132.394 +LINK_ENTITY_TO_GAME(building_teleporter);
132.395 +LINK_ENTITY_TO_GAME(bullet);
132.396 +LINK_ENTITY_TO_GAME(bumper_car_start);
132.397 +LINK_ENTITY_TO_GAME(burning_attack);
132.398 +LINK_ENTITY_TO_GAME(button_aiwallplug);
132.399 +LINK_ENTITY_TO_GAME(button_target);
132.400 +LINK_ENTITY_TO_GAME(candy);
132.401 +LINK_ENTITY_TO_GAME(cannon_ball);
132.402 +LINK_ENTITY_TO_GAME(capture_point);
132.403 +LINK_ENTITY_TO_GAME(carried_book_team1);
132.404 +LINK_ENTITY_TO_GAME(carried_book_team2);
132.405 +LINK_ENTITY_TO_GAME(carried_flag_team1);
132.406 +LINK_ENTITY_TO_GAME(carried_flag_team2);
132.407 +LINK_ENTITY_TO_GAME(carry_resource);
132.408 +LINK_ENTITY_TO_GAME(carry_scientist);
132.409 +LINK_ENTITY_TO_GAME(ce_psi_01);
132.410 +LINK_ENTITY_TO_GAME(ce_rocket_01);
132.411 +LINK_ENTITY_TO_GAME(cflag);
132.412 +LINK_ENTITY_TO_GAME(charge);
132.413 +LINK_ENTITY_TO_GAME(charged_bolt);
132.414 +LINK_ENTITY_TO_GAME(cine_blood);
132.415 +LINK_ENTITY_TO_GAME(cm_rocket_01);
132.416 +LINK_ENTITY_TO_GAME(controller_charge_ball);
132.417 +LINK_ENTITY_TO_GAME(controller_charged_ball);
132.418 +LINK_ENTITY_TO_GAME(controller_energy_ball);
132.419 +LINK_ENTITY_TO_GAME(controller_head_ball);
132.420 +LINK_ENTITY_TO_GAME(controller_health_ball);
132.421 +LINK_ENTITY_TO_GAME(controller_throw_ball);
132.422 +LINK_ENTITY_TO_GAME(counter);
132.423 +LINK_ENTITY_TO_GAME(crossbow_bolt);
132.424 +LINK_ENTITY_TO_GAME(crowd);
132.425 +LINK_ENTITY_TO_GAME(ctb_point_one);
132.426 +LINK_ENTITY_TO_GAME(ctb_point_two);
132.427 +LINK_ENTITY_TO_GAME(ctc_capturepoint);
132.428 +LINK_ENTITY_TO_GAME(ctc_chicken);
132.429 +LINK_ENTITY_TO_GAME(ctf_blueflag);
132.430 +LINK_ENTITY_TO_GAME(ctf_bluespawn);
132.431 +LINK_ENTITY_TO_GAME(ctf_cloak);
132.432 +LINK_ENTITY_TO_GAME(ctf_crowbar);
132.433 +LINK_ENTITY_TO_GAME(ctf_cycle);
132.434 +LINK_ENTITY_TO_GAME(ctf_flag);
132.435 +LINK_ENTITY_TO_GAME(ctf_flag_follow_blue);
132.436 +LINK_ENTITY_TO_GAME(ctf_flag_follow_red);
132.437 +LINK_ENTITY_TO_GAME(ctf_flagzone);
132.438 +LINK_ENTITY_TO_GAME(ctf_frag);
132.439 +LINK_ENTITY_TO_GAME(ctf_hook);
132.440 +LINK_ENTITY_TO_GAME(ctf_lowgrav);
132.441 +LINK_ENTITY_TO_GAME(ctf_protect);
132.442 +LINK_ENTITY_TO_GAME(ctf_redflag);
132.443 +LINK_ENTITY_TO_GAME(ctf_redspawn);
132.444 +LINK_ENTITY_TO_GAME(ctf_regen);
132.445 +LINK_ENTITY_TO_GAME(ctf_rune);
132.446 +LINK_ENTITY_TO_GAME(ctf_superglock);
132.447 +LINK_ENTITY_TO_GAME(ctf_trap);
132.448 +LINK_ENTITY_TO_GAME(ctf_vamp);
132.449 +LINK_ENTITY_TO_GAME(curse_spawner);
132.450 +LINK_ENTITY_TO_GAME(cust_11);
132.451 +LINK_ENTITY_TO_GAME(cust_12);
132.452 +LINK_ENTITY_TO_GAME(cust_13);
132.453 +LINK_ENTITY_TO_GAME(cust_21);
132.454 +LINK_ENTITY_TO_GAME(cust_22);
132.455 +LINK_ENTITY_TO_GAME(cust_24);
132.456 +LINK_ENTITY_TO_GAME(cust_25);
132.457 +LINK_ENTITY_TO_GAME(cust_2GaussPistolSniper);
132.458 +LINK_ENTITY_TO_GAME(cust_2MinigunCooled);
132.459 +LINK_ENTITY_TO_GAME(cust_31);
132.460 +LINK_ENTITY_TO_GAME(cust_33);
132.461 +LINK_ENTITY_TO_GAME(cust_34);
132.462 +LINK_ENTITY_TO_GAME(cust_41);
132.463 +LINK_ENTITY_TO_GAME(cust_43);
132.464 +LINK_ENTITY_TO_GAME(custom_precache);
132.465 +LINK_ENTITY_TO_GAME(cycler);
132.466 +LINK_ENTITY_TO_GAME(cycler_prdroid);
132.467 +LINK_ENTITY_TO_GAME(cycler_sprite);
132.468 +LINK_ENTITY_TO_GAME(cycler_weapon);
132.469 +LINK_ENTITY_TO_GAME(cycler_wreckage);
132.470 +LINK_ENTITY_TO_GAME(davespit);
132.471 +LINK_ENTITY_TO_GAME(db_spawner);
132.472 +LINK_ENTITY_TO_GAME(dc_info_objective);
132.473 +LINK_ENTITY_TO_GAME(dc_info_objectposition);
132.474 +LINK_ENTITY_TO_GAME(dc_object);
132.475 +LINK_ENTITY_TO_GAME(dc_trigger_objectcapture);
132.476 +LINK_ENTITY_TO_GAME(dc_trigger_reset);
132.477 +LINK_ENTITY_TO_GAME(dc_trigger_team);
132.478 +LINK_ENTITY_TO_GAME(deadcorpse);
132.479 +LINK_ENTITY_TO_GAME(deal_columbian_start);
132.480 +LINK_ENTITY_TO_GAME(deal_italian_start);
132.481 +LINK_ENTITY_TO_GAME(deal_swat_start);
132.482 +LINK_ENTITY_TO_GAME(death_ball);
132.483 +LINK_ENTITY_TO_GAME(deathball);
132.484 +LINK_ENTITY_TO_GAME(deathsoul);
132.485 +LINK_ENTITY_TO_GAME(debris);
132.486 +LINK_ENTITY_TO_GAME(decore_aicore);
132.487 +LINK_ENTITY_TO_GAME(decore_asteroid);
132.488 +LINK_ENTITY_TO_GAME(decore_baboon);
132.489 +LINK_ENTITY_TO_GAME(decore_bodygib);
132.490 +LINK_ENTITY_TO_GAME(decore_butterflyflock);
132.491 +LINK_ENTITY_TO_GAME(decore_cactus);
132.492 +LINK_ENTITY_TO_GAME(decore_cam);
132.493 +LINK_ENTITY_TO_GAME(decore_corpse);
132.494 +LINK_ENTITY_TO_GAME(decore_eagle);
132.495 +LINK_ENTITY_TO_GAME(decore_explodable);
132.496 +LINK_ENTITY_TO_GAME(decore_foot);
132.497 +LINK_ENTITY_TO_GAME(decore_goldskull);
132.498 +LINK_ENTITY_TO_GAME(decore_gutspile);
132.499 +LINK_ENTITY_TO_GAME(decore_hatgib);
132.500 +LINK_ENTITY_TO_GAME(decore_ice);
132.501 +LINK_ENTITY_TO_GAME(decore_mushroom);
132.502 +LINK_ENTITY_TO_GAME(decore_mushroom2);
132.503 +LINK_ENTITY_TO_GAME(decore_nest);
132.504 +LINK_ENTITY_TO_GAME(decore_pipes);
132.505 +LINK_ENTITY_TO_GAME(decore_prickle);
132.506 +LINK_ENTITY_TO_GAME(decore_pteradon);
132.507 +LINK_ENTITY_TO_GAME(decore_scripted_boulder);
132.508 +LINK_ENTITY_TO_GAME(decore_sittingtubemortar);
132.509 +LINK_ENTITY_TO_GAME(decore_spacebebris);
132.510 +LINK_ENTITY_TO_GAME(decore_swampplants);
132.511 +LINK_ENTITY_TO_GAME(decore_torch);
132.512 +LINK_ENTITY_TO_GAME(decore_torchflame);
132.513 +LINK_ENTITY_TO_GAME(defensechamber);
132.514 +LINK_ENTITY_TO_GAME(demoman_mine);
132.515 +LINK_ENTITY_TO_GAME(detpack);
132.516 +LINK_ENTITY_TO_GAME(dg_streak_spiral);
132.517 +LINK_ENTITY_TO_GAME(disc);
132.518 +LINK_ENTITY_TO_GAME(disc_arena);
132.519 +LINK_ENTITY_TO_GAME(discarena);
132.520 +LINK_ENTITY_TO_GAME(displacer_ball);
132.521 +LINK_ENTITY_TO_GAME(dmgmirrorcurse);
132.522 +LINK_ENTITY_TO_GAME(dmgscalecurse);
132.523 +LINK_ENTITY_TO_GAME(dod_ammo);
132.524 +LINK_ENTITY_TO_GAME(dod_ammo_depot);
132.525 +LINK_ENTITY_TO_GAME(dod_camera);
132.526 +LINK_ENTITY_TO_GAME(dod_capture_area);
132.527 +LINK_ENTITY_TO_GAME(dod_control_point);
132.528 +LINK_ENTITY_TO_GAME(dod_control_point_master);
132.529 +LINK_ENTITY_TO_GAME(dod_location);
132.530 +LINK_ENTITY_TO_GAME(dod_object);
132.531 +LINK_ENTITY_TO_GAME(dod_object_goal);
132.532 +LINK_ENTITY_TO_GAME(dod_point_relay);
132.533 +LINK_ENTITY_TO_GAME(dod_preround);
132.534 +LINK_ENTITY_TO_GAME(dod_round_timer);
132.535 +LINK_ENTITY_TO_GAME(dod_score_ent);
132.536 +LINK_ENTITY_TO_GAME(dod_secondary);
132.537 +LINK_ENTITY_TO_GAME(dod_stats);
132.538 +LINK_ENTITY_TO_GAME(dod_trigger_sandbag);
132.539 +LINK_ENTITY_TO_GAME(dove_flock);
132.540 +LINK_ENTITY_TO_GAME(dove_flyer);
132.541 +LINK_ENTITY_TO_GAME(dragonball);
132.542 +LINK_ENTITY_TO_GAME(drive_agrunt);
132.543 +LINK_ENTITY_TO_GAME(drive_agrunt_spawner);
132.544 +LINK_ENTITY_TO_GAME(drive_apache);
132.545 +LINK_ENTITY_TO_GAME(drive_apache_spawner);
132.546 +LINK_ENTITY_TO_GAME(drive_asl);
132.547 +LINK_ENTITY_TO_GAME(drive_assassin);
132.548 +LINK_ENTITY_TO_GAME(drive_assassin_spawner);
132.549 +LINK_ENTITY_TO_GAME(drive_bm);
132.550 +LINK_ENTITY_TO_GAME(drive_bm_spawner);
132.551 +LINK_ENTITY_TO_GAME(drive_bullsquid);
132.552 +LINK_ENTITY_TO_GAME(drive_bullsquid_spawner);
132.553 +LINK_ENTITY_TO_GAME(drive_chumtoad);
132.554 +LINK_ENTITY_TO_GAME(drive_controller);
132.555 +LINK_ENTITY_TO_GAME(drive_controller_spawner);
132.556 +LINK_ENTITY_TO_GAME(drive_garg);
132.557 +LINK_ENTITY_TO_GAME(drive_garg_spawner);
132.558 +LINK_ENTITY_TO_GAME(drive_headcrab);
132.559 +LINK_ENTITY_TO_GAME(drive_houndeye);
132.560 +LINK_ENTITY_TO_GAME(drive_houndeye_spawner);
132.561 +LINK_ENTITY_TO_GAME(drive_icky);
132.562 +LINK_ENTITY_TO_GAME(drive_icky_spawner);
132.563 +LINK_ENTITY_TO_GAME(drive_panth);
132.564 +LINK_ENTITY_TO_GAME(drive_panth_spawner);
132.565 +LINK_ENTITY_TO_GAME(drive_slave_spawner);
132.566 +LINK_ENTITY_TO_GAME(drive_turret);
132.567 +LINK_ENTITY_TO_GAME(drive_turret_spawner);
132.568 +LINK_ENTITY_TO_GAME(drop_bomb);
132.569 +LINK_ENTITY_TO_GAME(drunkcurse);
132.570 +LINK_ENTITY_TO_GAME(drv_hvr_rocket);
132.571 +LINK_ENTITY_TO_GAME(eagle_laser);
132.572 +LINK_ENTITY_TO_GAME(egon_mirv);
132.573 +LINK_ENTITY_TO_GAME(entity_botcam);
132.574 +LINK_ENTITY_TO_GAME(entity_clustergod);
132.575 +LINK_ENTITY_TO_GAME(entity_digitgod);
132.576 +LINK_ENTITY_TO_GAME(entity_spritegod);
132.577 +LINK_ENTITY_TO_GAME(entity_volcanospew);
132.578 +LINK_ENTITY_TO_GAME(env_ClusterExplosion);
132.579 +LINK_ENTITY_TO_GAME(env_animsprite);
132.580 +LINK_ENTITY_TO_GAME(env_beam);
132.581 +LINK_ENTITY_TO_GAME(env_beverage);
132.582 +LINK_ENTITY_TO_GAME(env_blood);
132.583 +LINK_ENTITY_TO_GAME(env_blowercannon);
132.584 +LINK_ENTITY_TO_GAME(env_bombglow);
132.585 +LINK_ENTITY_TO_GAME(env_bubbles);
132.586 +LINK_ENTITY_TO_GAME(env_customize);
132.587 +LINK_ENTITY_TO_GAME(env_debris);
132.588 +LINK_ENTITY_TO_GAME(env_electrified_wire);
132.589 +LINK_ENTITY_TO_GAME(env_explosion);
132.590 +LINK_ENTITY_TO_GAME(env_fade);
132.591 +LINK_ENTITY_TO_GAME(env_fadeone);
132.592 +LINK_ENTITY_TO_GAME(env_fire);
132.593 +LINK_ENTITY_TO_GAME(env_flag);
132.594 +LINK_ENTITY_TO_GAME(env_fog);
132.595 +LINK_ENTITY_TO_GAME(env_funnel);
132.596 +LINK_ENTITY_TO_GAME(env_gamma);
132.597 +LINK_ENTITY_TO_GAME(env_genewormcloud);
132.598 +LINK_ENTITY_TO_GAME(env_genewormspawn);
132.599 +LINK_ENTITY_TO_GAME(env_global);
132.600 +LINK_ENTITY_TO_GAME(env_glow);
132.601 +LINK_ENTITY_TO_GAME(env_laser);
132.602 +LINK_ENTITY_TO_GAME(env_lightning);
132.603 +LINK_ENTITY_TO_GAME(env_message);
132.604 +LINK_ENTITY_TO_GAME(env_model);
132.605 +LINK_ENTITY_TO_GAME(env_mp3);
132.606 +LINK_ENTITY_TO_GAME(env_music);
132.607 +LINK_ENTITY_TO_GAME(env_particleemitter);
132.608 +LINK_ENTITY_TO_GAME(env_particles);
132.609 +LINK_ENTITY_TO_GAME(env_particles_custom);
132.610 +LINK_ENTITY_TO_GAME(env_particule);
132.611 +LINK_ENTITY_TO_GAME(env_precip);
132.612 +LINK_ENTITY_TO_GAME(env_push);
132.613 +LINK_ENTITY_TO_GAME(env_rain);
132.614 +LINK_ENTITY_TO_GAME(env_render);
132.615 +LINK_ENTITY_TO_GAME(env_rope);
132.616 +LINK_ENTITY_TO_GAME(env_shake);
132.617 +LINK_ENTITY_TO_GAME(env_shooter);
132.618 +LINK_ENTITY_TO_GAME(env_smoker);
132.619 +LINK_ENTITY_TO_GAME(env_snow);
132.620 +LINK_ENTITY_TO_GAME(env_sound);
132.621 +LINK_ENTITY_TO_GAME(env_spark);
132.622 +LINK_ENTITY_TO_GAME(env_spawnereffect);
132.623 +LINK_ENTITY_TO_GAME(env_sprite);
132.624 +LINK_ENTITY_TO_GAME(env_spriteshooter);
132.625 +LINK_ENTITY_TO_GAME(env_spritetrain);
132.626 +LINK_ENTITY_TO_GAME(env_state);
132.627 +LINK_ENTITY_TO_GAME(env_sun);
132.628 +LINK_ENTITY_TO_GAME(env_timer);
132.629 +LINK_ENTITY_TO_GAME(env_vgui);
132.630 +LINK_ENTITY_TO_GAME(env_warpball);
132.631 +LINK_ENTITY_TO_GAME(env_xenmaker);
132.632 +LINK_ENTITY_TO_GAME(equipment_parachute);
132.633 +LINK_ENTITY_TO_GAME(event_player_die);
132.634 +LINK_ENTITY_TO_GAME(event_player_join);
132.635 +LINK_ENTITY_TO_GAME(event_player_kill);
132.636 +LINK_ENTITY_TO_GAME(event_player_leave);
132.637 +LINK_ENTITY_TO_GAME(event_player_spawn);
132.638 +LINK_ENTITY_TO_GAME(event_round_end);
132.639 +LINK_ENTITY_TO_GAME(event_round_prestart);
132.640 +LINK_ENTITY_TO_GAME(event_round_reset);
132.641 +LINK_ENTITY_TO_GAME(event_round_start);
132.642 +LINK_ENTITY_TO_GAME(event_team_die);
132.643 +LINK_ENTITY_TO_GAME(event_team_win);
132.644 +LINK_ENTITY_TO_GAME(explodingattack);
132.645 +LINK_ENTITY_TO_GAME(explosive_slug);
132.646 +LINK_ENTITY_TO_GAME(external_cam);
132.647 +LINK_ENTITY_TO_GAME(extra_ammo);
132.648 +LINK_ENTITY_TO_GAME(fa_drop_zone);
132.649 +LINK_ENTITY_TO_GAME(fa_parachute);
132.650 +LINK_ENTITY_TO_GAME(fa_push_flag);
132.651 +LINK_ENTITY_TO_GAME(fa_push_point);
132.652 +LINK_ENTITY_TO_GAME(fa_sd_object);
132.653 +LINK_ENTITY_TO_GAME(fa_team_goal);
132.654 +LINK_ENTITY_TO_GAME(fa_team_item);
132.655 +LINK_ENTITY_TO_GAME(fading_corpse);
132.656 +LINK_ENTITY_TO_GAME(final_flash);
132.657 +LINK_ENTITY_TO_GAME(finish);
132.658 +LINK_ENTITY_TO_GAME(fire_ball);
132.659 +LINK_ENTITY_TO_GAME(fireanddie);
132.660 +LINK_ENTITY_TO_GAME(firework);
132.661 +LINK_ENTITY_TO_GAME(flag);
132.662 +LINK_ENTITY_TO_GAME(flag_capture_point);
132.663 +LINK_ENTITY_TO_GAME(flag_follow);
132.664 +LINK_ENTITY_TO_GAME(flag_world);
132.665 +LINK_ENTITY_TO_GAME(flak_grenade);
132.666 +LINK_ENTITY_TO_GAME(flakfrag);
132.667 +LINK_ENTITY_TO_GAME(flame_ball);
132.668 +LINK_ENTITY_TO_GAME(flame_chunk);
132.669 +LINK_ENTITY_TO_GAME(flamme);
132.670 +LINK_ENTITY_TO_GAME(flare);
132.671 +LINK_ENTITY_TO_GAME(flare_fire);
132.672 +LINK_ENTITY_TO_GAME(flying_crowbar);
132.673 +LINK_ENTITY_TO_GAME(fog);
132.674 +LINK_ENTITY_TO_GAME(follow_ent);
132.675 +LINK_ENTITY_TO_GAME(follower_basic);
132.676 +LINK_ENTITY_TO_GAME(football);
132.677 +LINK_ENTITY_TO_GAME(frag_grenade);
132.678 +LINK_ENTITY_TO_GAME(freeze_beam);
132.679 +LINK_ENTITY_TO_GAME(freeze_gel);
132.680 +LINK_ENTITY_TO_GAME(freeze_timer);
132.681 +LINK_ENTITY_TO_GAME(friction_timer);
132.682 +LINK_ENTITY_TO_GAME(fruit_sacrifice_point_team_green);
132.683 +LINK_ENTITY_TO_GAME(fruit_sacrifice_point_team_red);
132.684 +LINK_ENTITY_TO_GAME(func_airstrike_area);
132.685 +LINK_ENTITY_TO_GAME(func_ammoprovider);
132.686 +LINK_ENTITY_TO_GAME(func_ammostripper);
132.687 +LINK_ENTITY_TO_GAME(func_base);
132.688 +LINK_ENTITY_TO_GAME(func_bomb_target);
132.689 +LINK_ENTITY_TO_GAME(func_breakable);
132.690 +LINK_ENTITY_TO_GAME(func_breakpoints);
132.691 +LINK_ENTITY_TO_GAME(func_button);
132.692 +LINK_ENTITY_TO_GAME(func_buyzone);
132.693 +LINK_ENTITY_TO_GAME(func_capture_area);
132.694 +LINK_ENTITY_TO_GAME(func_capturepoint);
132.695 +LINK_ENTITY_TO_GAME(func_clouds);
132.696 +LINK_ENTITY_TO_GAME(func_conveyor);
132.697 +LINK_ENTITY_TO_GAME(func_ctb);
132.698 +LINK_ENTITY_TO_GAME(func_destroy_objective);
132.699 +LINK_ENTITY_TO_GAME(func_disctoggle);
132.700 +LINK_ENTITY_TO_GAME(func_door);
132.701 +LINK_ENTITY_TO_GAME(func_door_rotating);
132.702 +LINK_ENTITY_TO_GAME(func_escapezone);
132.703 +LINK_ENTITY_TO_GAME(func_friction);
132.704 +LINK_ENTITY_TO_GAME(func_goal_zone);
132.705 +LINK_ENTITY_TO_GAME(func_goalpoint);
132.706 +LINK_ENTITY_TO_GAME(func_golem_body);
132.707 +LINK_ENTITY_TO_GAME(func_golem_controls_attack);
132.708 +LINK_ENTITY_TO_GAME(func_golem_controls_forward);
132.709 +LINK_ENTITY_TO_GAME(func_golem_controls_left);
132.710 +LINK_ENTITY_TO_GAME(func_golem_controls_right);
132.711 +LINK_ENTITY_TO_GAME(func_golem_leftarm);
132.712 +LINK_ENTITY_TO_GAME(func_golem_leftleg);
132.713 +LINK_ENTITY_TO_GAME(func_golem_rightarm);
132.714 +LINK_ENTITY_TO_GAME(func_golem_rightleg);
132.715 +LINK_ENTITY_TO_GAME(func_grencatch);
132.716 +LINK_ENTITY_TO_GAME(func_guntarget);
132.717 +LINK_ENTITY_TO_GAME(func_healthcharger);
132.718 +LINK_ENTITY_TO_GAME(func_hostage_rescue);
132.719 +LINK_ENTITY_TO_GAME(func_illusionary);
132.720 +LINK_ENTITY_TO_GAME(func_jail_breakable);
132.721 +LINK_ENTITY_TO_GAME(func_jail_button);
132.722 +LINK_ENTITY_TO_GAME(func_jail_door);
132.723 +LINK_ENTITY_TO_GAME(func_jail_door_rotating);
132.724 +LINK_ENTITY_TO_GAME(func_jail_pushable);
132.725 +LINK_ENTITY_TO_GAME(func_jail_release);
132.726 +LINK_ENTITY_TO_GAME(func_ladder);
132.727 +LINK_ENTITY_TO_GAME(func_laddertype);
132.728 +LINK_ENTITY_TO_GAME(func_land_transport);
132.729 +LINK_ENTITY_TO_GAME(func_landtransport);
132.730 +LINK_ENTITY_TO_GAME(func_modeltank);
132.731 +LINK_ENTITY_TO_GAME(func_modelvehicle);
132.732 +LINK_ENTITY_TO_GAME(func_modelvehiclemodel);
132.733 +LINK_ENTITY_TO_GAME(func_monsterclip);
132.734 +LINK_ENTITY_TO_GAME(func_mortar_field);
132.735 +LINK_ENTITY_TO_GAME(func_music);
132.736 +LINK_ENTITY_TO_GAME(func_nobuild);
132.737 +LINK_ENTITY_TO_GAME(func_nogrenades);
132.738 +LINK_ENTITY_TO_GAME(func_op4mortarcontroller);
132.739 +LINK_ENTITY_TO_GAME(func_particle_system);
132.740 +LINK_ENTITY_TO_GAME(func_pendulum);
132.741 +LINK_ENTITY_TO_GAME(func_plat);
132.742 +LINK_ENTITY_TO_GAME(func_plat_toggleremove);
132.743 +LINK_ENTITY_TO_GAME(func_platrot);
132.744 +LINK_ENTITY_TO_GAME(func_player_start);
132.745 +LINK_ENTITY_TO_GAME(func_point);
132.746 +LINK_ENTITY_TO_GAME(func_possesion);
132.747 +LINK_ENTITY_TO_GAME(func_protect);
132.748 +LINK_ENTITY_TO_GAME(func_pushable);
132.749 +LINK_ENTITY_TO_GAME(func_recharge);
132.750 +LINK_ENTITY_TO_GAME(func_reset);
132.751 +LINK_ENTITY_TO_GAME(func_resource);
132.752 +LINK_ENTITY_TO_GAME(func_rot_button);
132.753 +LINK_ENTITY_TO_GAME(func_rotating);
132.754 +LINK_ENTITY_TO_GAME(func_seethrough);
132.755 +LINK_ENTITY_TO_GAME(func_seethroughdoor);
132.756 +LINK_ENTITY_TO_GAME(func_tank);
132.757 +LINK_ENTITY_TO_GAME(func_tank_of);
132.758 +LINK_ENTITY_TO_GAME(func_tankbase);
132.759 +LINK_ENTITY_TO_GAME(func_tankcannon);
132.760 +LINK_ENTITY_TO_GAME(func_tankcontrols);
132.761 +LINK_ENTITY_TO_GAME(func_tankcontrols_of);
132.762 +LINK_ENTITY_TO_GAME(func_tankdrive);
132.763 +LINK_ENTITY_TO_GAME(func_tankgib);
132.764 +LINK_ENTITY_TO_GAME(func_tankgib_gib);
132.765 +LINK_ENTITY_TO_GAME(func_tankgoauld);
132.766 +LINK_ENTITY_TO_GAME(func_tanklaser);
132.767 +LINK_ENTITY_TO_GAME(func_tanklaser_of);
132.768 +LINK_ENTITY_TO_GAME(func_tankmg);
132.769 +LINK_ENTITY_TO_GAME(func_tankmortar);
132.770 +LINK_ENTITY_TO_GAME(func_tankmortar_of);
132.771 +LINK_ENTITY_TO_GAME(func_tankrocket);
132.772 +LINK_ENTITY_TO_GAME(func_tankrocket_of);
132.773 +LINK_ENTITY_TO_GAME(func_tanktarget);
132.774 +LINK_ENTITY_TO_GAME(func_tbutton);
132.775 +LINK_ENTITY_TO_GAME(func_tech_breakable);
132.776 +LINK_ENTITY_TO_GAME(func_trackautochange);
132.777 +LINK_ENTITY_TO_GAME(func_trackchange);
132.778 +LINK_ENTITY_TO_GAME(func_tracktrain);
132.779 +LINK_ENTITY_TO_GAME(func_train);
132.780 +LINK_ENTITY_TO_GAME(func_traincontrols);
132.781 +LINK_ENTITY_TO_GAME(func_use);
132.782 +LINK_ENTITY_TO_GAME(func_vehicle);
132.783 +LINK_ENTITY_TO_GAME(func_vehiclecontrols);
132.784 +LINK_ENTITY_TO_GAME(func_vehicletankcontrols);
132.785 +LINK_ENTITY_TO_GAME(func_vine);
132.786 +LINK_ENTITY_TO_GAME(func_vip_safetyzone);
132.787 +LINK_ENTITY_TO_GAME(func_wall);
132.788 +LINK_ENTITY_TO_GAME(func_wall_toggle);
132.789 +LINK_ENTITY_TO_GAME(func_water);
132.790 +LINK_ENTITY_TO_GAME(func_water_up);
132.791 +LINK_ENTITY_TO_GAME(func_weaponcheck);
132.792 +LINK_ENTITY_TO_GAME(func_weldable);
132.793 +LINK_ENTITY_TO_GAME(func_wind);
132.794 +LINK_ENTITY_TO_GAME(game_clock);
132.795 +LINK_ENTITY_TO_GAME(game_counter);
132.796 +LINK_ENTITY_TO_GAME(game_counter_set);
132.797 +LINK_ENTITY_TO_GAME(game_end);
132.798 +LINK_ENTITY_TO_GAME(game_endbattle);
132.799 +LINK_ENTITY_TO_GAME(game_item);
132.800 +LINK_ENTITY_TO_GAME(game_levelmusic);
132.801 +LINK_ENTITY_TO_GAME(game_player_die);
132.802 +LINK_ENTITY_TO_GAME(game_player_equip);
132.803 +LINK_ENTITY_TO_GAME(game_player_hurt);
132.804 +LINK_ENTITY_TO_GAME(game_player_message);
132.805 +LINK_ENTITY_TO_GAME(game_player_team);
132.806 +LINK_ENTITY_TO_GAME(game_playerdie);
132.807 +LINK_ENTITY_TO_GAME(game_roundend);
132.808 +LINK_ENTITY_TO_GAME(game_score);
132.809 +LINK_ENTITY_TO_GAME(game_team_master);
132.810 +LINK_ENTITY_TO_GAME(game_team_score);
132.811 +LINK_ENTITY_TO_GAME(game_team_set);
132.812 +LINK_ENTITY_TO_GAME(game_team_win);
132.813 +LINK_ENTITY_TO_GAME(game_text);
132.814 +LINK_ENTITY_TO_GAME(game_zone_player);
132.815 +LINK_ENTITY_TO_GAME(gameclock);
132.816 +LINK_ENTITY_TO_GAME(garg_hull);
132.817 +LINK_ENTITY_TO_GAME(garg_stomp);
132.818 +LINK_ENTITY_TO_GAME(generic_model);
132.819 +LINK_ENTITY_TO_GAME(getGlobalStunLevel);
132.820 +LINK_ENTITY_TO_GAME(ghost);
132.821 +LINK_ENTITY_TO_GAME(gibable_corpse);
132.822 +LINK_ENTITY_TO_GAME(gibshooter);
132.823 +LINK_ENTITY_TO_GAME(gonarch_headcrabifier);
132.824 +LINK_ENTITY_TO_GAME(gonomeguts);
132.825 +LINK_ENTITY_TO_GAME(gr_shell);
132.826 +LINK_ENTITY_TO_GAME(grapple_bolt);
132.827 +LINK_ENTITY_TO_GAME(grapple_hook);
132.828 +LINK_ENTITY_TO_GAME(grapple_tip);
132.829 +LINK_ENTITY_TO_GAME(gren_projectile);
132.830 +LINK_ENTITY_TO_GAME(gren_smoke);
132.831 +LINK_ENTITY_TO_GAME(grenade);
132.832 +LINK_ENTITY_TO_GAME(guard_info);
132.833 +LINK_ENTITY_TO_GAME(guidedattack);
132.834 +LINK_ENTITY_TO_GAME(gunmancycler);
132.835 +LINK_ENTITY_TO_GAME(hallucgrenade);
132.836 +LINK_ENTITY_TO_GAME(halo_base);
132.837 +LINK_ENTITY_TO_GAME(hand_knife);
132.838 +LINK_ENTITY_TO_GAME(he_charge_flare);
132.839 +LINK_ENTITY_TO_GAME(he_eye_flare);
132.840 +LINK_ENTITY_TO_GAME(headcrab_teather);
132.841 +LINK_ENTITY_TO_GAME(holo_player);
132.842 +LINK_ENTITY_TO_GAME(hologram_beak);
132.843 +LINK_ENTITY_TO_GAME(hologram_damage);
132.844 +LINK_ENTITY_TO_GAME(holywars_rocket);
132.845 +LINK_ENTITY_TO_GAME(homing_balls);
132.846 +LINK_ENTITY_TO_GAME(hornet);
132.847 +LINK_ENTITY_TO_GAME(hospital);
132.848 +LINK_ENTITY_TO_GAME(hostage_entity);
132.849 +LINK_ENTITY_TO_GAME(human_flashgrenade);
132.850 +LINK_ENTITY_TO_GAME(hvr_blkop_rocket);
132.851 +LINK_ENTITY_TO_GAME(hvr_rocket);
132.852 +LINK_ENTITY_TO_GAME(i_p_t);
132.853 +LINK_ENTITY_TO_GAME(i_t_g);
132.854 +LINK_ENTITY_TO_GAME(i_t_t);
132.855 +LINK_ENTITY_TO_GAME(impail_arrow);
132.856 +LINK_ENTITY_TO_GAME(impgren);
132.857 +LINK_ENTITY_TO_GAME(in_shell);
132.858 +LINK_ENTITY_TO_GAME(indian_arrow);
132.859 +LINK_ENTITY_TO_GAME(infect);
132.860 +LINK_ENTITY_TO_GAME(info_Waterdetect);
132.861 +LINK_ENTITY_TO_GAME(info_administrator);
132.862 +LINK_ENTITY_TO_GAME(info_airstrike_node);
132.863 +LINK_ENTITY_TO_GAME(info_alias);
132.864 +LINK_ENTITY_TO_GAME(info_alien_return);
132.865 +LINK_ENTITY_TO_GAME(info_alien_start);
132.866 +LINK_ENTITY_TO_GAME(info_american_line);
132.867 +LINK_ENTITY_TO_GAME(info_areadef);
132.868 +LINK_ENTITY_TO_GAME(info_areamarker);
132.869 +LINK_ENTITY_TO_GAME(info_ball_start);
132.870 +LINK_ENTITY_TO_GAME(info_banana_green_capture);
132.871 +LINK_ENTITY_TO_GAME(info_banana_red_capture);
132.872 +LINK_ENTITY_TO_GAME(info_bananier);
132.873 +LINK_ENTITY_TO_GAME(info_bg_detect);
132.874 +LINK_ENTITY_TO_GAME(info_bigmomma);
132.875 +LINK_ENTITY_TO_GAME(info_bomb_target);
132.876 +LINK_ENTITY_TO_GAME(info_bone);
132.877 +LINK_ENTITY_TO_GAME(info_bone_spawn);
132.878 +LINK_ENTITY_TO_GAME(info_boobytrap);
132.879 +LINK_ENTITY_TO_GAME(info_botlandmark);
132.880 +LINK_ENTITY_TO_GAME(info_botnode);
132.881 +LINK_ENTITY_TO_GAME(info_british_line);
132.882 +LINK_ENTITY_TO_GAME(info_button_phonebooth);
132.883 +LINK_ENTITY_TO_GAME(info_caisse_128);
132.884 +LINK_ENTITY_TO_GAME(info_caisse_16);
132.885 +LINK_ENTITY_TO_GAME(info_caisse_256);
132.886 +LINK_ENTITY_TO_GAME(info_caisse_32);
132.887 +LINK_ENTITY_TO_GAME(info_caisse_64);
132.888 +LINK_ENTITY_TO_GAME(info_camera);
132.889 +LINK_ENTITY_TO_GAME(info_checkpoint);
132.890 +LINK_ENTITY_TO_GAME(info_chicken);
132.891 +LINK_ENTITY_TO_GAME(info_chip);
132.892 +LINK_ENTITY_TO_GAME(info_civ_start);
132.893 +LINK_ENTITY_TO_GAME(info_css);
132.894 +LINK_ENTITY_TO_GAME(info_ctb_controller);
132.895 +LINK_ENTITY_TO_GAME(info_ctfdetect);
132.896 +LINK_ENTITY_TO_GAME(info_ctfspawn);
132.897 +LINK_ENTITY_TO_GAME(info_ctfspawn_powerup);
132.898 +LINK_ENTITY_TO_GAME(info_deathball_spawn);
132.899 +LINK_ENTITY_TO_GAME(info_defaultammo);
132.900 +LINK_ENTITY_TO_GAME(info_displacer_earth_target);
132.901 +LINK_ENTITY_TO_GAME(info_displacer_xen_target);
132.902 +LINK_ENTITY_TO_GAME(info_doddetect);
132.903 +LINK_ENTITY_TO_GAME(info_dragonrider_spawn);
132.904 +LINK_ENTITY_TO_GAME(info_draw_slayerswin);
132.905 +LINK_ENTITY_TO_GAME(info_draw_vampireswin);
132.906 +LINK_ENTITY_TO_GAME(info_drive_agrunt_spawn);
132.907 +LINK_ENTITY_TO_GAME(info_drive_apache_spawn);
132.908 +LINK_ENTITY_TO_GAME(info_drive_assassin_spawn);
132.909 +LINK_ENTITY_TO_GAME(info_drive_bm_spawn);
132.910 +LINK_ENTITY_TO_GAME(info_drive_bullsquid_spawn);
132.911 +LINK_ENTITY_TO_GAME(info_drive_controller_spawn);
132.912 +LINK_ENTITY_TO_GAME(info_drive_garg_spawn);
132.913 +LINK_ENTITY_TO_GAME(info_drive_houndeye_spawn);
132.914 +LINK_ENTITY_TO_GAME(info_drive_icky_spawn);
132.915 +LINK_ENTITY_TO_GAME(info_drive_panth_spawn);
132.916 +LINK_ENTITY_TO_GAME(info_drive_slave_spawn);
132.917 +LINK_ENTITY_TO_GAME(info_drive_turret_spawn);
132.918 +LINK_ENTITY_TO_GAME(info_elephant);
132.919 +LINK_ENTITY_TO_GAME(info_escape_start);
132.920 +LINK_ENTITY_TO_GAME(info_escape_target);
132.921 +LINK_ENTITY_TO_GAME(info_evil_start);
132.922 +LINK_ENTITY_TO_GAME(info_firearms_detect);
132.923 +LINK_ENTITY_TO_GAME(info_firstround_spawn);
132.924 +LINK_ENTITY_TO_GAME(info_flagspawn);
132.925 +LINK_ENTITY_TO_GAME(info_flash);
132.926 +LINK_ENTITY_TO_GAME(info_frontline);
132.927 +LINK_ENTITY_TO_GAME(info_gameplay);
132.928 +LINK_ENTITY_TO_GAME(info_gameplaylogic);
132.929 +LINK_ENTITY_TO_GAME(info_gangsta_dm_start);
132.930 +LINK_ENTITY_TO_GAME(info_goldeneye);
132.931 +LINK_ENTITY_TO_GAME(info_good_start);
132.932 +LINK_ENTITY_TO_GAME(info_group);
132.933 +LINK_ENTITY_TO_GAME(info_gwGeneral_spawn);
132.934 +LINK_ENTITY_TO_GAME(info_gwars_map);
132.935 +LINK_ENTITY_TO_GAME(info_gwbriefing_spawn);
132.936 +LINK_ENTITY_TO_GAME(info_gwinmap_spawn);
132.937 +LINK_ENTITY_TO_GAME(info_gwplayer_spawn);
132.938 +LINK_ENTITY_TO_GAME(info_gwwaiting_spawn);
132.939 +LINK_ENTITY_TO_GAME(info_hlpaintctfdetect);
132.940 +LINK_ENTITY_TO_GAME(info_hmctfdetect);
132.941 +LINK_ENTITY_TO_GAME(info_hostage_rescue);
132.942 +LINK_ENTITY_TO_GAME(info_human_return);
132.943 +LINK_ENTITY_TO_GAME(info_human_start);
132.944 +LINK_ENTITY_TO_GAME(info_initial_player_allies);
132.945 +LINK_ENTITY_TO_GAME(info_initial_player_axis);
132.946 +LINK_ENTITY_TO_GAME(info_intermission);
132.947 +LINK_ENTITY_TO_GAME(info_italian_start);
132.948 +LINK_ENTITY_TO_GAME(info_jail_start);
132.949 +LINK_ENTITY_TO_GAME(info_join_autoassign);
132.950 +LINK_ENTITY_TO_GAME(info_join_team);
132.951 +LINK_ENTITY_TO_GAME(info_jumppad_target);
132.952 +LINK_ENTITY_TO_GAME(info_jwhite_capture);
132.953 +LINK_ENTITY_TO_GAME(info_jwhite_escape);
132.954 +LINK_ENTITY_TO_GAME(info_jwhite_rescue);
132.955 +LINK_ENTITY_TO_GAME(info_kb_deathmatch);
132.956 +LINK_ENTITY_TO_GAME(info_landmark);
132.957 +LINK_ENTITY_TO_GAME(info_landmine);
132.958 +LINK_ENTITY_TO_GAME(info_leave_game);
132.959 +LINK_ENTITY_TO_GAME(info_location);
132.960 +LINK_ENTITY_TO_GAME(info_map_parameters);
132.961 +LINK_ENTITY_TO_GAME(info_mapdetect);
132.962 +LINK_ENTITY_TO_GAME(info_mapinfo);
132.963 +LINK_ENTITY_TO_GAME(info_marguerite);
132.964 +LINK_ENTITY_TO_GAME(info_minefield);
132.965 +LINK_ENTITY_TO_GAME(info_model);
132.966 +LINK_ENTITY_TO_GAME(info_monkey_start_team_green);
132.967 +LINK_ENTITY_TO_GAME(info_monkey_start_team_red);
132.968 +LINK_ENTITY_TO_GAME(info_monster_return);
132.969 +LINK_ENTITY_TO_GAME(info_monster_start);
132.970 +LINK_ENTITY_TO_GAME(info_morbid);
132.971 +LINK_ENTITY_TO_GAME(info_morbid_start);
132.972 +LINK_ENTITY_TO_GAME(info_msdetect);
132.973 +LINK_ENTITY_TO_GAME(info_multiple);
132.974 +LINK_ENTITY_TO_GAME(info_node);
132.975 +LINK_ENTITY_TO_GAME(info_node_air);
132.976 +LINK_ENTITY_TO_GAME(info_nomines);
132.977 +LINK_ENTITY_TO_GAME(info_null);
132.978 +LINK_ENTITY_TO_GAME(info_objective);
132.979 +LINK_ENTITY_TO_GAME(info_observer_start);
132.980 +LINK_ENTITY_TO_GAME(info_orientation);
132.981 +LINK_ENTITY_TO_GAME(info_paintball);
132.982 +LINK_ENTITY_TO_GAME(info_particles);
132.983 +LINK_ENTITY_TO_GAME(info_pitworm);
132.984 +LINK_ENTITY_TO_GAME(info_pitworm_steam_lock);
132.985 +LINK_ENTITY_TO_GAME(info_player_allies);
132.986 +LINK_ENTITY_TO_GAME(info_player_american);
132.987 +LINK_ENTITY_TO_GAME(info_player_attacker);
132.988 +LINK_ENTITY_TO_GAME(info_player_axis);
132.989 +LINK_ENTITY_TO_GAME(info_player_blue);
132.990 +LINK_ENTITY_TO_GAME(info_player_british);
132.991 +LINK_ENTITY_TO_GAME(info_player_deadstart);
132.992 +LINK_ENTITY_TO_GAME(info_player_deathmatch);
132.993 +LINK_ENTITY_TO_GAME(info_player_deathmatch_reverse);
132.994 +LINK_ENTITY_TO_GAME(info_player_defender);
132.995 +LINK_ENTITY_TO_GAME(info_player_equip);
132.996 +LINK_ENTITY_TO_GAME(info_player_goauld);
132.997 +LINK_ENTITY_TO_GAME(info_player_jail);
132.998 +LINK_ENTITY_TO_GAME(info_player_judge);
132.999 +LINK_ENTITY_TO_GAME(info_player_marine);
132.1000 +LINK_ENTITY_TO_GAME(info_player_nva_reenforcement);
132.1001 +LINK_ENTITY_TO_GAME(info_player_observer);
132.1002 +LINK_ENTITY_TO_GAME(info_player_perp);
132.1003 +LINK_ENTITY_TO_GAME(info_player_red);
132.1004 +LINK_ENTITY_TO_GAME(info_player_respawn);
132.1005 +LINK_ENTITY_TO_GAME(info_player_slayer);
132.1006 +LINK_ENTITY_TO_GAME(info_player_spectator);
132.1007 +LINK_ENTITY_TO_GAME(info_player_start);
132.1008 +LINK_ENTITY_TO_GAME(info_player_start_prox);
132.1009 +LINK_ENTITY_TO_GAME(info_player_start_reverse);
132.1010 +LINK_ENTITY_TO_GAME(info_player_team1);
132.1011 +LINK_ENTITY_TO_GAME(info_player_team2);
132.1012 +LINK_ENTITY_TO_GAME(info_player_team_ce);
132.1013 +LINK_ENTITY_TO_GAME(info_player_team_cm);
132.1014 +LINK_ENTITY_TO_GAME(info_player_team_s);
132.1015 +LINK_ENTITY_TO_GAME(info_player_team_sm);
132.1016 +LINK_ENTITY_TO_GAME(info_player_teamspawn);
132.1017 +LINK_ENTITY_TO_GAME(info_player_torri);
132.1018 +LINK_ENTITY_TO_GAME(info_player_unas);
132.1019 +LINK_ENTITY_TO_GAME(info_player_usmc_reenforcement);
132.1020 +LINK_ENTITY_TO_GAME(info_player_vampire);
132.1021 +LINK_ENTITY_TO_GAME(info_playerstart_blue);
132.1022 +LINK_ENTITY_TO_GAME(info_playerstart_red);
132.1023 +LINK_ENTITY_TO_GAME(info_rescue_monster);
132.1024 +LINK_ENTITY_TO_GAME(info_rescue_point);
132.1025 +LINK_ENTITY_TO_GAME(info_reset);
132.1026 +LINK_ENTITY_TO_GAME(info_robot_return);
132.1027 +LINK_ENTITY_TO_GAME(info_robot_start);
132.1028 +LINK_ENTITY_TO_GAME(info_roundx_spawn);
132.1029 +LINK_ENTITY_TO_GAME(info_russian_start);
132.1030 +LINK_ENTITY_TO_GAME(info_sapin);
132.1031 +LINK_ENTITY_TO_GAME(info_scientist);
132.1032 +LINK_ENTITY_TO_GAME(info_scientist_dead);
132.1033 +LINK_ENTITY_TO_GAME(info_scientist_start);
132.1034 +LINK_ENTITY_TO_GAME(info_semi_null);
132.1035 +LINK_ENTITY_TO_GAME(info_sidetect);
132.1036 +LINK_ENTITY_TO_GAME(info_spawn_container);
132.1037 +LINK_ENTITY_TO_GAME(info_spectate);
132.1038 +LINK_ENTITY_TO_GAME(info_sprite);
132.1039 +LINK_ENTITY_TO_GAME(info_stadium);
132.1040 +LINK_ENTITY_TO_GAME(info_status);
132.1041 +LINK_ENTITY_TO_GAME(info_swat_start);
132.1042 +LINK_ENTITY_TO_GAME(info_target);
132.1043 +LINK_ENTITY_TO_GAME(info_team);
132.1044 +LINK_ENTITY_TO_GAME(info_team1_corner0);
132.1045 +LINK_ENTITY_TO_GAME(info_team1_corner1);
132.1046 +LINK_ENTITY_TO_GAME(info_team1_corner_player0);
132.1047 +LINK_ENTITY_TO_GAME(info_team1_corner_player1);
132.1048 +LINK_ENTITY_TO_GAME(info_team1_goalkick0);
132.1049 +LINK_ENTITY_TO_GAME(info_team1_goalkick1);
132.1050 +LINK_ENTITY_TO_GAME(info_team1_penalty_spot);
132.1051 +LINK_ENTITY_TO_GAME(info_team1_player1);
132.1052 +LINK_ENTITY_TO_GAME(info_team1_player10);
132.1053 +LINK_ENTITY_TO_GAME(info_team1_player11);
132.1054 +LINK_ENTITY_TO_GAME(info_team1_player2);
132.1055 +LINK_ENTITY_TO_GAME(info_team1_player3);
132.1056 +LINK_ENTITY_TO_GAME(info_team1_player4);
132.1057 +LINK_ENTITY_TO_GAME(info_team1_player5);
132.1058 +LINK_ENTITY_TO_GAME(info_team1_player6);
132.1059 +LINK_ENTITY_TO_GAME(info_team1_player7);
132.1060 +LINK_ENTITY_TO_GAME(info_team1_player8);
132.1061 +LINK_ENTITY_TO_GAME(info_team1_player9);
132.1062 +LINK_ENTITY_TO_GAME(info_team2_corner0);
132.1063 +LINK_ENTITY_TO_GAME(info_team2_corner1);
132.1064 +LINK_ENTITY_TO_GAME(info_team2_corner_player0);
132.1065 +LINK_ENTITY_TO_GAME(info_team2_corner_player1);
132.1066 +LINK_ENTITY_TO_GAME(info_team2_goalkick0);
132.1067 +LINK_ENTITY_TO_GAME(info_team2_goalkick1);
132.1068 +LINK_ENTITY_TO_GAME(info_team2_penalty_spot);
132.1069 +LINK_ENTITY_TO_GAME(info_team2_player1);
132.1070 +LINK_ENTITY_TO_GAME(info_team2_player10);
132.1071 +LINK_ENTITY_TO_GAME(info_team2_player11);
132.1072 +LINK_ENTITY_TO_GAME(info_team2_player2);
132.1073 +LINK_ENTITY_TO_GAME(info_team2_player3);
132.1074 +LINK_ENTITY_TO_GAME(info_team2_player4);
132.1075 +LINK_ENTITY_TO_GAME(info_team2_player5);
132.1076 +LINK_ENTITY_TO_GAME(info_team2_player6);
132.1077 +LINK_ENTITY_TO_GAME(info_team2_player7);
132.1078 +LINK_ENTITY_TO_GAME(info_team2_player8);
132.1079 +LINK_ENTITY_TO_GAME(info_team2_player9);
132.1080 +LINK_ENTITY_TO_GAME(info_team_base);
132.1081 +LINK_ENTITY_TO_GAME(info_team_ronin);
132.1082 +LINK_ENTITY_TO_GAME(info_team_scavenger);
132.1083 +LINK_ENTITY_TO_GAME(info_team_start);
132.1084 +LINK_ENTITY_TO_GAME(info_team_usmc);
132.1085 +LINK_ENTITY_TO_GAME(info_teamplaydetect);
132.1086 +LINK_ENTITY_TO_GAME(info_teamspawn);
132.1087 +LINK_ENTITY_TO_GAME(info_teleport_destination);
132.1088 +LINK_ENTITY_TO_GAME(info_tf_teamcheck);
132.1089 +LINK_ENTITY_TO_GAME(info_tf_teamset);
132.1090 +LINK_ENTITY_TO_GAME(info_tfdetect);
132.1091 +LINK_ENTITY_TO_GAME(info_tfgoal);
132.1092 +LINK_ENTITY_TO_GAME(info_tfgoal_timer);
132.1093 +LINK_ENTITY_TO_GAME(info_throw_in);
132.1094 +LINK_ENTITY_TO_GAME(info_transistor);
132.1095 +LINK_ENTITY_TO_GAME(info_transport_node);
132.1096 +LINK_ENTITY_TO_GAME(info_upko_start);
132.1097 +LINK_ENTITY_TO_GAME(info_usa_start);
132.1098 +LINK_ENTITY_TO_GAME(info_vgui_start);
132.1099 +LINK_ENTITY_TO_GAME(info_vip_start);
132.1100 +LINK_ENTITY_TO_GAME(info_wanteddetect);
132.1101 +LINK_ENTITY_TO_GAME(info_waypoint);
132.1102 +LINK_ENTITY_TO_GAME(info_wwdetect);
132.1103 +LINK_ENTITY_TO_GAME(info_zone);
132.1104 +LINK_ENTITY_TO_GAME(info_zone_caisse);
132.1105 +LINK_ENTITY_TO_GAME(infodecal);
132.1106 +LINK_ENTITY_TO_GAME(item_acme);
132.1107 +LINK_ENTITY_TO_GAME(item_airtank);
132.1108 +LINK_ENTITY_TO_GAME(item_ammo);
132.1109 +LINK_ENTITY_TO_GAME(item_ammoicon);
132.1110 +LINK_ENTITY_TO_GAME(item_antidote);
132.1111 +LINK_ENTITY_TO_GAME(item_antidotee);
132.1112 +LINK_ENTITY_TO_GAME(item_armor);
132.1113 +LINK_ENTITY_TO_GAME(item_armor1);
132.1114 +LINK_ENTITY_TO_GAME(item_armor2);
132.1115 +LINK_ENTITY_TO_GAME(item_armor3);
132.1116 +LINK_ENTITY_TO_GAME(item_armorInv);
132.1117 +LINK_ENTITY_TO_GAME(item_armour);
132.1118 +LINK_ENTITY_TO_GAME(item_artifact_envirosuit);
132.1119 +LINK_ENTITY_TO_GAME(item_artifact_invisibility);
132.1120 +LINK_ENTITY_TO_GAME(item_artifact_invulnerability);
132.1121 +LINK_ENTITY_TO_GAME(item_artifact_super_damage);
132.1122 +LINK_ENTITY_TO_GAME(item_assaultsuit);
132.1123 +LINK_ENTITY_TO_GAME(item_atde_object);
132.1124 +LINK_ENTITY_TO_GAME(item_autodoc);
132.1125 +LINK_ENTITY_TO_GAME(item_backpack);
132.1126 +LINK_ENTITY_TO_GAME(item_badge);
132.1127 +LINK_ENTITY_TO_GAME(item_bag1);
132.1128 +LINK_ENTITY_TO_GAME(item_bag2);
132.1129 +LINK_ENTITY_TO_GAME(item_banana);
132.1130 +LINK_ENTITY_TO_GAME(item_bandage);
132.1131 +LINK_ENTITY_TO_GAME(item_bandolier);
132.1132 +LINK_ENTITY_TO_GAME(item_baril);
132.1133 +LINK_ENTITY_TO_GAME(item_baril_bleu);
132.1134 +LINK_ENTITY_TO_GAME(item_baril_rouge);
132.1135 +LINK_ENTITY_TO_GAME(item_battery);
132.1136 +LINK_ENTITY_TO_GAME(item_beans);
132.1137 +LINK_ENTITY_TO_GAME(item_bonustime);
132.1138 +LINK_ENTITY_TO_GAME(item_bonustime2);
132.1139 +LINK_ENTITY_TO_GAME(item_bonustime3);
132.1140 +LINK_ENTITY_TO_GAME(item_book_team1);
132.1141 +LINK_ENTITY_TO_GAME(item_book_team2);
132.1142 +LINK_ENTITY_TO_GAME(item_bottle);
132.1143 +LINK_ENTITY_TO_GAME(item_briefcase);
132.1144 +LINK_ENTITY_TO_GAME(item_c4);
132.1145 +LINK_ENTITY_TO_GAME(item_cactus);
132.1146 +LINK_ENTITY_TO_GAME(item_caisse_arme);
132.1147 +LINK_ENTITY_TO_GAME(item_caisse_mega);
132.1148 +LINK_ENTITY_TO_GAME(item_caisse_outil);
132.1149 +LINK_ENTITY_TO_GAME(item_caisse_vie);
132.1150 +LINK_ENTITY_TO_GAME(item_canteen);
132.1151 +LINK_ENTITY_TO_GAME(item_capkey);
132.1152 +LINK_ENTITY_TO_GAME(item_cash);
132.1153 +LINK_ENTITY_TO_GAME(item_cells);
132.1154 +LINK_ENTITY_TO_GAME(item_chicken);
132.1155 +LINK_ENTITY_TO_GAME(item_claymore);
132.1156 +LINK_ENTITY_TO_GAME(item_cloaker);
132.1157 +LINK_ENTITY_TO_GAME(item_concussion);
132.1158 +LINK_ENTITY_TO_GAME(item_ctf_flag);
132.1159 +LINK_ENTITY_TO_GAME(item_ctfaccelerator);
132.1160 +LINK_ENTITY_TO_GAME(item_ctfbackpack);
132.1161 +LINK_ENTITY_TO_GAME(item_ctfbase);
132.1162 +LINK_ENTITY_TO_GAME(item_ctfflag);
132.1163 +LINK_ENTITY_TO_GAME(item_ctflongjump);
132.1164 +LINK_ENTITY_TO_GAME(item_ctfportablehev);
132.1165 +LINK_ENTITY_TO_GAME(item_ctfregeneration);
132.1166 +LINK_ENTITY_TO_GAME(item_dbldamage);
132.1167 +LINK_ENTITY_TO_GAME(item_dish);
132.1168 +LINK_ENTITY_TO_GAME(item_docbag);
132.1169 +LINK_ENTITY_TO_GAME(item_dragonball);
132.1170 +LINK_ENTITY_TO_GAME(item_dyno);
132.1171 +LINK_ENTITY_TO_GAME(item_dyno1);
132.1172 +LINK_ENTITY_TO_GAME(item_elixer);
132.1173 +LINK_ENTITY_TO_GAME(item_elixir);
132.1174 +LINK_ENTITY_TO_GAME(item_energy);
132.1175 +LINK_ENTITY_TO_GAME(item_flag);
132.1176 +LINK_ENTITY_TO_GAME(item_flag1);
132.1177 +LINK_ENTITY_TO_GAME(item_flag2);
132.1178 +LINK_ENTITY_TO_GAME(item_flag_atde);
132.1179 +LINK_ENTITY_TO_GAME(item_flag_blue);
132.1180 +LINK_ENTITY_TO_GAME(item_flag_center);
132.1181 +LINK_ENTITY_TO_GAME(item_flag_cf);
132.1182 +LINK_ENTITY_TO_GAME(item_flag_ctf);
132.1183 +LINK_ENTITY_TO_GAME(item_flag_red);
132.1184 +LINK_ENTITY_TO_GAME(item_flag_slayer);
132.1185 +LINK_ENTITY_TO_GAME(item_flag_team1);
132.1186 +LINK_ENTITY_TO_GAME(item_flag_team2);
132.1187 +LINK_ENTITY_TO_GAME(item_flag_vampire);
132.1188 +LINK_ENTITY_TO_GAME(item_flashbang);
132.1189 +LINK_ENTITY_TO_GAME(item_flashlight);
132.1190 +LINK_ENTITY_TO_GAME(item_frag);
132.1191 +LINK_ENTITY_TO_GAME(item_fruit);
132.1192 +LINK_ENTITY_TO_GAME(item_gascan);
132.1193 +LINK_ENTITY_TO_GAME(item_generic);
132.1194 +LINK_ENTITY_TO_GAME(item_genericammo);
132.1195 +LINK_ENTITY_TO_GAME(item_glass);
132.1196 +LINK_ENTITY_TO_GAME(item_grappin);
132.1197 +LINK_ENTITY_TO_GAME(item_head);
132.1198 +LINK_ENTITY_TO_GAME(item_health);
132.1199 +LINK_ENTITY_TO_GAME(item_healthkit);
132.1200 +LINK_ENTITY_TO_GAME(item_heavyarmor);
132.1201 +LINK_ENTITY_TO_GAME(item_herbs);
132.1202 +LINK_ENTITY_TO_GAME(item_highjump);
132.1203 +LINK_ENTITY_TO_GAME(item_holster);
132.1204 +LINK_ENTITY_TO_GAME(item_infjetpack);
132.1205 +LINK_ENTITY_TO_GAME(item_invincibility);
132.1206 +LINK_ENTITY_TO_GAME(item_invisibility);
132.1207 +LINK_ENTITY_TO_GAME(item_jetpack);
132.1208 +LINK_ENTITY_TO_GAME(item_kevlar);
132.1209 +LINK_ENTITY_TO_GAME(item_knife);
132.1210 +LINK_ENTITY_TO_GAME(item_laser);
132.1211 +LINK_ENTITY_TO_GAME(item_lgboiler);
132.1212 +LINK_ENTITY_TO_GAME(item_longjump);
132.1213 +LINK_ENTITY_TO_GAME(item_medboiler);
132.1214 +LINK_ENTITY_TO_GAME(item_metal);
132.1215 +LINK_ENTITY_TO_GAME(item_mine);
132.1216 +LINK_ENTITY_TO_GAME(item_newspaper);
132.1217 +LINK_ENTITY_TO_GAME(item_nightvision);
132.1218 +LINK_ENTITY_TO_GAME(item_nuclearbomb);
132.1219 +LINK_ENTITY_TO_GAME(item_nuclearbombbutton);
132.1220 +LINK_ENTITY_TO_GAME(item_nuclearbombtimer);
132.1221 +LINK_ENTITY_TO_GAME(item_nvg);
132.1222 +LINK_ENTITY_TO_GAME(item_papers);
132.1223 +LINK_ENTITY_TO_GAME(item_parachute);
132.1224 +LINK_ENTITY_TO_GAME(item_pickaxe);
132.1225 +LINK_ENTITY_TO_GAME(item_powerarmor);
132.1226 +LINK_ENTITY_TO_GAME(item_powerup);
132.1227 +LINK_ENTITY_TO_GAME(item_quad);
132.1228 +LINK_ENTITY_TO_GAME(item_random);
132.1229 +LINK_ENTITY_TO_GAME(item_regeneration);
132.1230 +LINK_ENTITY_TO_GAME(item_resource);
132.1231 +LINK_ENTITY_TO_GAME(item_rockets);
132.1232 +LINK_ENTITY_TO_GAME(item_scope);
132.1233 +LINK_ENTITY_TO_GAME(item_security);
132.1234 +LINK_ENTITY_TO_GAME(item_sensubeanbag);
132.1235 +LINK_ENTITY_TO_GAME(item_shells);
132.1236 +LINK_ENTITY_TO_GAME(item_shovel);
132.1237 +LINK_ENTITY_TO_GAME(item_silencer);
132.1238 +LINK_ENTITY_TO_GAME(item_silvercase);
132.1239 +LINK_ENTITY_TO_GAME(item_smboiler);
132.1240 +LINK_ENTITY_TO_GAME(item_sodacan);
132.1241 +LINK_ENTITY_TO_GAME(item_speedburst);
132.1242 +LINK_ENTITY_TO_GAME(item_spikes);
132.1243 +LINK_ENTITY_TO_GAME(item_stealth);
132.1244 +LINK_ENTITY_TO_GAME(item_steerribs);
132.1245 +LINK_ENTITY_TO_GAME(item_steerskull);
132.1246 +LINK_ENTITY_TO_GAME(item_stg24);
132.1247 +LINK_ENTITY_TO_GAME(item_suit);
132.1248 +LINK_ENTITY_TO_GAME(item_swarm_flag);
132.1249 +LINK_ENTITY_TO_GAME(item_tag);
132.1250 +LINK_ENTITY_TO_GAME(item_telegram);
132.1251 +LINK_ENTITY_TO_GAME(item_telegraphkey);
132.1252 +LINK_ENTITY_TO_GAME(item_teleport);
132.1253 +LINK_ENTITY_TO_GAME(item_tfgoal);
132.1254 +LINK_ENTITY_TO_GAME(item_thighpack);
132.1255 +LINK_ENTITY_TO_GAME(item_tombe_bleu);
132.1256 +LINK_ENTITY_TO_GAME(item_tombe_rouge);
132.1257 +LINK_ENTITY_TO_GAME(item_upgradevest);
132.1258 +LINK_ENTITY_TO_GAME(item_vengeance);
132.1259 +LINK_ENTITY_TO_GAME(item_vest);
132.1260 +LINK_ENTITY_TO_GAME(item_wagonwheel);
132.1261 +LINK_ENTITY_TO_GAME(item_weapon);
132.1262 +LINK_ENTITY_TO_GAME(item_wheelside);
132.1263 +LINK_ENTITY_TO_GAME(jail_execute);
132.1264 +LINK_ENTITY_TO_GAME(jail_team_master);
132.1265 +LINK_ENTITY_TO_GAME(jumppad_sign);
132.1266 +LINK_ENTITY_TO_GAME(kamehameha);
132.1267 +LINK_ENTITY_TO_GAME(kb_fireworklauncher);
132.1268 +LINK_ENTITY_TO_GAME(killerrat);
132.1269 +LINK_ENTITY_TO_GAME(knife);
132.1270 +LINK_ENTITY_TO_GAME(knife_bolt);
132.1271 +LINK_ENTITY_TO_GAME(knife_throw);
132.1272 +LINK_ENTITY_TO_GAME(kwSpikeProjectile);
132.1273 +LINK_ENTITY_TO_GAME(lance_proj);
132.1274 +LINK_ENTITY_TO_GAME(laser_aimer);
132.1275 +LINK_ENTITY_TO_GAME(laser_dot);
132.1276 +LINK_ENTITY_TO_GAME(laser_spot);
132.1277 +LINK_ENTITY_TO_GAME(laserbolt);
132.1278 +LINK_ENTITY_TO_GAME(law_rocket);
132.1279 +LINK_ENTITY_TO_GAME(lc_init_ent);
132.1280 +LINK_ENTITY_TO_GAME(lc_respawner);
132.1281 +LINK_ENTITY_TO_GAME(lc_spawner);
132.1282 +LINK_ENTITY_TO_GAME(lflamme_fire);
132.1283 +LINK_ENTITY_TO_GAME(lifesoul);
132.1284 +LINK_ENTITY_TO_GAME(light);
132.1285 +LINK_ENTITY_TO_GAME(light_environment);
132.1286 +LINK_ENTITY_TO_GAME(light_glow);
132.1287 +LINK_ENTITY_TO_GAME(light_spot);
132.1288 +LINK_ENTITY_TO_GAME(m61_grenade);
132.1289 +LINK_ENTITY_TO_GAME(m72_rocket);
132.1290 +LINK_ENTITY_TO_GAME(magicattack);
132.1291 +LINK_ENTITY_TO_GAME(mapClassName);
132.1292 +LINK_ENTITY_TO_GAME(mapobject_asiancar);
132.1293 +LINK_ENTITY_TO_GAME(mapobject_bluecar);
132.1294 +LINK_ENTITY_TO_GAME(mapobject_copcar);
132.1295 +LINK_ENTITY_TO_GAME(mapobject_npc_bum);
132.1296 +LINK_ENTITY_TO_GAME(mapobject_npc_bum1);
132.1297 +LINK_ENTITY_TO_GAME(mapobject_npc_bum2);
132.1298 +LINK_ENTITY_TO_GAME(mapobject_npc_bum3);
132.1299 +LINK_ENTITY_TO_GAME(mapobject_npc_crow);
132.1300 +LINK_ENTITY_TO_GAME(mapobject_npc_slavebot);
132.1301 +LINK_ENTITY_TO_GAME(mapobject_redcar);
132.1302 +LINK_ENTITY_TO_GAME(mapobject_zeppelin);
132.1303 +LINK_ENTITY_TO_GAME(marker);
132.1304 +LINK_ENTITY_TO_GAME(master_key);
132.1305 +LINK_ENTITY_TO_GAME(master_living);
132.1306 +LINK_ENTITY_TO_GAME(master_object_home);
132.1307 +LINK_ENTITY_TO_GAME(master_period);
132.1308 +LINK_ENTITY_TO_GAME(master_player);
132.1309 +LINK_ENTITY_TO_GAME(master_relay);
132.1310 +LINK_ENTITY_TO_GAME(master_round_active);
132.1311 +LINK_ENTITY_TO_GAME(master_round_start);
132.1312 +LINK_ENTITY_TO_GAME(master_secret);
132.1313 +LINK_ENTITY_TO_GAME(master_state);
132.1314 +LINK_ENTITY_TO_GAME(master_team);
132.1315 +LINK_ENTITY_TO_GAME(master_tech);
132.1316 +LINK_ENTITY_TO_GAME(mastertoggle);
132.1317 +LINK_ENTITY_TO_GAME(mazo);
132.1318 +LINK_ENTITY_TO_GAME(mazoold);
132.1319 +LINK_ENTITY_TO_GAME(medal);
132.1320 +LINK_ENTITY_TO_GAME(medevac);
132.1321 +LINK_ENTITY_TO_GAME(medivac);
132.1322 +LINK_ENTITY_TO_GAME(meteor_god);
132.1323 +LINK_ENTITY_TO_GAME(meteor_target);
132.1324 +LINK_ENTITY_TO_GAME(mini_rocket);
132.1325 +LINK_ENTITY_TO_GAME(mission_modifier);
132.1326 +LINK_ENTITY_TO_GAME(molotov);
132.1327 +LINK_ENTITY_TO_GAME(momentary_door);
132.1328 +LINK_ENTITY_TO_GAME(momentary_jail_door);
132.1329 +LINK_ENTITY_TO_GAME(momentary_rot_button);
132.1330 +LINK_ENTITY_TO_GAME(monster_ShockTrooper_dead);
132.1331 +LINK_ENTITY_TO_GAME(monster_a10);
132.1332 +LINK_ENTITY_TO_GAME(monster_adrian);
132.1333 +LINK_ENTITY_TO_GAME(monster_adrian_dead);
132.1334 +LINK_ENTITY_TO_GAME(monster_alarm);
132.1335 +LINK_ENTITY_TO_GAME(monster_alien_babyvoltigore);
132.1336 +LINK_ENTITY_TO_GAME(monster_alien_controller);
132.1337 +LINK_ENTITY_TO_GAME(monster_alien_grunt);
132.1338 +LINK_ENTITY_TO_GAME(monster_alien_panther);
132.1339 +LINK_ENTITY_TO_GAME(monster_alien_slave);
132.1340 +LINK_ENTITY_TO_GAME(monster_alien_slave_dead);
132.1341 +LINK_ENTITY_TO_GAME(monster_alien_voltigore);
132.1342 +LINK_ENTITY_TO_GAME(monster_allied_barney);
132.1343 +LINK_ENTITY_TO_GAME(monster_allied_grunt);
132.1344 +LINK_ENTITY_TO_GAME(monster_alliedgrunt_dead);
132.1345 +LINK_ENTITY_TO_GAME(monster_annie);
132.1346 +LINK_ENTITY_TO_GAME(monster_annie_dead);
132.1347 +LINK_ENTITY_TO_GAME(monster_apache);
132.1348 +LINK_ENTITY_TO_GAME(monster_archer);
132.1349 +LINK_ENTITY_TO_GAME(monster_assassin_repel);
132.1350 +LINK_ENTITY_TO_GAME(monster_assassin_target);
132.1351 +LINK_ENTITY_TO_GAME(monster_axis_grunt);
132.1352 +LINK_ENTITY_TO_GAME(monster_axisgrunt_dead);
132.1353 +LINK_ENTITY_TO_GAME(monster_babycrab);
132.1354 +LINK_ENTITY_TO_GAME(monster_babygarg);
132.1355 +LINK_ENTITY_TO_GAME(monster_balllightning);
132.1356 +LINK_ENTITY_TO_GAME(monster_barnacle);
132.1357 +LINK_ENTITY_TO_GAME(monster_barney);
132.1358 +LINK_ENTITY_TO_GAME(monster_barney_dead);
132.1359 +LINK_ENTITY_TO_GAME(monster_barniel);
132.1360 +LINK_ENTITY_TO_GAME(monster_barniel_dead);
132.1361 +LINK_ENTITY_TO_GAME(monster_bbturret);
132.1362 +LINK_ENTITY_TO_GAME(monster_beak);
132.1363 +LINK_ENTITY_TO_GAME(monster_bear);
132.1364 +LINK_ENTITY_TO_GAME(monster_beartrap);
132.1365 +LINK_ENTITY_TO_GAME(monster_bigminer);
132.1366 +LINK_ENTITY_TO_GAME(monster_bigminer_dead);
132.1367 +LINK_ENTITY_TO_GAME(monster_bigmomma);
132.1368 +LINK_ENTITY_TO_GAME(monster_blkop_apache);
132.1369 +LINK_ENTITY_TO_GAME(monster_blkop_osprey);
132.1370 +LINK_ENTITY_TO_GAME(monster_bloater);
132.1371 +LINK_ENTITY_TO_GAME(monster_bodypart);
132.1372 +LINK_ENTITY_TO_GAME(monster_bomb);
132.1373 +LINK_ENTITY_TO_GAME(monster_buffalo);
132.1374 +LINK_ENTITY_TO_GAME(monster_bullchicken);
132.1375 +LINK_ENTITY_TO_GAME(monster_burnmine);
132.1376 +LINK_ENTITY_TO_GAME(monster_c4);
132.1377 +LINK_ENTITY_TO_GAME(monster_cat);
132.1378 +LINK_ENTITY_TO_GAME(monster_chicken);
132.1379 +LINK_ENTITY_TO_GAME(monster_chumtoad);
132.1380 +LINK_ENTITY_TO_GAME(monster_cine2_crispen);
132.1381 +LINK_ENTITY_TO_GAME(monster_cine2_dave);
132.1382 +LINK_ENTITY_TO_GAME(monster_cine2_hvyweapons);
132.1383 +LINK_ENTITY_TO_GAME(monster_cine2_masala);
132.1384 +LINK_ENTITY_TO_GAME(monster_cine2_nagatow);
132.1385 +LINK_ENTITY_TO_GAME(monster_cine2_scientist);
132.1386 +LINK_ENTITY_TO_GAME(monster_cine2_slave);
132.1387 +LINK_ENTITY_TO_GAME(monster_cine2_tiedcolonel);
132.1388 +LINK_ENTITY_TO_GAME(monster_cine2_townmex);
132.1389 +LINK_ENTITY_TO_GAME(monster_cine2_wtowna);
132.1390 +LINK_ENTITY_TO_GAME(monster_cine2_wtownb);
132.1391 +LINK_ENTITY_TO_GAME(monster_cine3_annie);
132.1392 +LINK_ENTITY_TO_GAME(monster_cine3_barney);
132.1393 +LINK_ENTITY_TO_GAME(monster_cine3_crispen);
132.1394 +LINK_ENTITY_TO_GAME(monster_cine3_dave);
132.1395 +LINK_ENTITY_TO_GAME(monster_cine3_hoss);
132.1396 +LINK_ENTITY_TO_GAME(monster_cine3_masala);
132.1397 +LINK_ENTITY_TO_GAME(monster_cine3_nagatow);
132.1398 +LINK_ENTITY_TO_GAME(monster_cine3_scientist);
132.1399 +LINK_ENTITY_TO_GAME(monster_cine3_tiedcolonel);
132.1400 +LINK_ENTITY_TO_GAME(monster_cine3_townmex);
132.1401 +LINK_ENTITY_TO_GAME(monster_cine3_wtowna);
132.1402 +LINK_ENTITY_TO_GAME(monster_cine3_wtownb);
132.1403 +LINK_ENTITY_TO_GAME(monster_cine_annie);
132.1404 +LINK_ENTITY_TO_GAME(monster_cine_barney);
132.1405 +LINK_ENTITY_TO_GAME(monster_cine_crispen);
132.1406 +LINK_ENTITY_TO_GAME(monster_cine_dave);
132.1407 +LINK_ENTITY_TO_GAME(monster_cine_hoss);
132.1408 +LINK_ENTITY_TO_GAME(monster_cine_masala);
132.1409 +LINK_ENTITY_TO_GAME(monster_cine_nagatow);
132.1410 +LINK_ENTITY_TO_GAME(monster_cine_panther);
132.1411 +LINK_ENTITY_TO_GAME(monster_cine_scientist);
132.1412 +LINK_ENTITY_TO_GAME(monster_cine_tiedcolonel);
132.1413 +LINK_ENTITY_TO_GAME(monster_cine_townmex);
132.1414 +LINK_ENTITY_TO_GAME(monster_cine_wtowna);
132.1415 +LINK_ENTITY_TO_GAME(monster_cine_wtownb);
132.1416 +LINK_ENTITY_TO_GAME(monster_civilian);
132.1417 +LINK_ENTITY_TO_GAME(monster_civilian_dead);
132.1418 +LINK_ENTITY_TO_GAME(monster_cleansuit_scientist);
132.1419 +LINK_ENTITY_TO_GAME(monster_cleansuit_scientist_dead);
132.1420 +LINK_ENTITY_TO_GAME(monster_cockroach);
132.1421 +LINK_ENTITY_TO_GAME(monster_colonel);
132.1422 +LINK_ENTITY_TO_GAME(monster_colonel_dead);
132.1423 +LINK_ENTITY_TO_GAME(monster_cow);
132.1424 +LINK_ENTITY_TO_GAME(monster_cowboy);
132.1425 +LINK_ENTITY_TO_GAME(monster_cowboy_dead);
132.1426 +LINK_ENTITY_TO_GAME(monster_cricket);
132.1427 +LINK_ENTITY_TO_GAME(monster_crispen);
132.1428 +LINK_ENTITY_TO_GAME(monster_crispen_dead);
132.1429 +LINK_ENTITY_TO_GAME(monster_critter);
132.1430 +LINK_ENTITY_TO_GAME(monster_darttrap);
132.1431 +LINK_ENTITY_TO_GAME(monster_dave);
132.1432 +LINK_ENTITY_TO_GAME(monster_dave_dead);
132.1433 +LINK_ENTITY_TO_GAME(monster_dog);
132.1434 +LINK_ENTITY_TO_GAME(monster_dragon);
132.1435 +LINK_ENTITY_TO_GAME(monster_dragonfly);
132.1436 +LINK_ENTITY_TO_GAME(monster_drillsergeant);
132.1437 +LINK_ENTITY_TO_GAME(monster_eagle);
132.1438 +LINK_ENTITY_TO_GAME(monster_eagle_flock);
132.1439 +LINK_ENTITY_TO_GAME(monster_endboss);
132.1440 +LINK_ENTITY_TO_GAME(monster_exp_alien_slave);
132.1441 +LINK_ENTITY_TO_GAME(monster_fakemedkit);
132.1442 +LINK_ENTITY_TO_GAME(monster_fgrunt_repel);
132.1443 +LINK_ENTITY_TO_GAME(monster_flag1);
132.1444 +LINK_ENTITY_TO_GAME(monster_flag2);
132.1445 +LINK_ENTITY_TO_GAME(monster_flag3);
132.1446 +LINK_ENTITY_TO_GAME(monster_flag4);
132.1447 +LINK_ENTITY_TO_GAME(monster_flashlight);
132.1448 +LINK_ENTITY_TO_GAME(monster_flyer);
132.1449 +LINK_ENTITY_TO_GAME(monster_flyer_flock);
132.1450 +LINK_ENTITY_TO_GAME(monster_furniture);
132.1451 +LINK_ENTITY_TO_GAME(monster_garbage);
132.1452 +LINK_ENTITY_TO_GAME(monster_gargantua);
132.1453 +LINK_ENTITY_TO_GAME(monster_gator);
132.1454 +LINK_ENTITY_TO_GAME(monster_generic);
132.1455 +LINK_ENTITY_TO_GAME(monster_geneworm);
132.1456 +LINK_ENTITY_TO_GAME(monster_giantplant);
132.1457 +LINK_ENTITY_TO_GAME(monster_gman);
132.1458 +LINK_ENTITY_TO_GAME(monster_goat);
132.1459 +LINK_ENTITY_TO_GAME(monster_goblin);
132.1460 +LINK_ENTITY_TO_GAME(monster_gonome);
132.1461 +LINK_ENTITY_TO_GAME(monster_gonome_dead);
132.1462 +LINK_ENTITY_TO_GAME(monster_gordon);
132.1463 +LINK_ENTITY_TO_GAME(monster_gordon_dead);
132.1464 +LINK_ENTITY_TO_GAME(monster_gps);
132.1465 +LINK_ENTITY_TO_GAME(monster_grunt_ally_repel);
132.1466 +LINK_ENTITY_TO_GAME(monster_grunt_repel);
132.1467 +LINK_ENTITY_TO_GAME(monster_gunner_friendly);
132.1468 +LINK_ENTITY_TO_GAME(monster_hatchetfish);
132.1469 +LINK_ENTITY_TO_GAME(monster_headcrab);
132.1470 +LINK_ENTITY_TO_GAME(monster_helicopter);
132.1471 +LINK_ENTITY_TO_GAME(monster_hevbarn);
132.1472 +LINK_ENTITY_TO_GAME(monster_hevbarn_dead);
132.1473 +LINK_ENTITY_TO_GAME(monster_hevsuit_dead);
132.1474 +LINK_ENTITY_TO_GAME(monster_hfgrunt_dead);
132.1475 +LINK_ENTITY_TO_GAME(monster_hgrunt_dead);
132.1476 +LINK_ENTITY_TO_GAME(monster_hiveback);
132.1477 +LINK_ENTITY_TO_GAME(monster_horse);
132.1478 +LINK_ENTITY_TO_GAME(monster_hoss);
132.1479 +LINK_ENTITY_TO_GAME(monster_hoss_dead);
132.1480 +LINK_ENTITY_TO_GAME(monster_houndeye);
132.1481 +LINK_ENTITY_TO_GAME(monster_houndeye_dead);
132.1482 +LINK_ENTITY_TO_GAME(monster_human_assassin);
132.1483 +LINK_ENTITY_TO_GAME(monster_human_bandit);
132.1484 +LINK_ENTITY_TO_GAME(monster_human_chopper);
132.1485 +LINK_ENTITY_TO_GAME(monster_human_demoman);
132.1486 +LINK_ENTITY_TO_GAME(monster_human_friendly_grunt);
132.1487 +LINK_ENTITY_TO_GAME(monster_human_grunt);
132.1488 +LINK_ENTITY_TO_GAME(monster_human_grunt_ally);
132.1489 +LINK_ENTITY_TO_GAME(monster_human_grunt_ally_dead);
132.1490 +LINK_ENTITY_TO_GAME(monster_human_gunman);
132.1491 +LINK_ENTITY_TO_GAME(monster_human_medic_ally);
132.1492 +LINK_ENTITY_TO_GAME(monster_human_scientist);
132.1493 +LINK_ENTITY_TO_GAME(monster_human_spforce);
132.1494 +LINK_ENTITY_TO_GAME(monster_human_terror);
132.1495 +LINK_ENTITY_TO_GAME(monster_human_torch_ally);
132.1496 +LINK_ENTITY_TO_GAME(monster_human_unarmed);
132.1497 +LINK_ENTITY_TO_GAME(monster_hwgrunt);
132.1498 +LINK_ENTITY_TO_GAME(monster_ichthyosaur);
132.1499 +LINK_ENTITY_TO_GAME(monster_kaiewi);
132.1500 +LINK_ENTITY_TO_GAME(monster_kaiewi_dead);
132.1501 +LINK_ENTITY_TO_GAME(monster_kate);
132.1502 +LINK_ENTITY_TO_GAME(monster_kate_dead);
132.1503 +LINK_ENTITY_TO_GAME(monster_kid);
132.1504 +LINK_ENTITY_TO_GAME(monster_killerbabycrab);
132.1505 +LINK_ENTITY_TO_GAME(monster_largescorpion);
132.1506 +LINK_ENTITY_TO_GAME(monster_larve);
132.1507 +LINK_ENTITY_TO_GAME(monster_leech);
132.1508 +LINK_ENTITY_TO_GAME(monster_llama);
132.1509 +LINK_ENTITY_TO_GAME(monster_lrocket);
132.1510 +LINK_ENTITY_TO_GAME(monster_m2);
132.1511 +LINK_ENTITY_TO_GAME(monster_male_assassin);
132.1512 +LINK_ENTITY_TO_GAME(monster_manta);
132.1513 +LINK_ENTITY_TO_GAME(monster_masala);
132.1514 +LINK_ENTITY_TO_GAME(monster_masala_dead);
132.1515 +LINK_ENTITY_TO_GAME(monster_massassin_dead);
132.1516 +LINK_ENTITY_TO_GAME(monster_medic_ally_repel);
132.1517 +LINK_ENTITY_TO_GAME(monster_mexbandit);
132.1518 +LINK_ENTITY_TO_GAME(monster_mexbandit_dead);
132.1519 +LINK_ENTITY_TO_GAME(monster_microraptor);
132.1520 +LINK_ENTITY_TO_GAME(monster_mine);
132.1521 +LINK_ENTITY_TO_GAME(monster_miniturret);
132.1522 +LINK_ENTITY_TO_GAME(monster_monkey);
132.1523 +LINK_ENTITY_TO_GAME(monster_mortar);
132.1524 +LINK_ENTITY_TO_GAME(monster_mouton);
132.1525 +LINK_ENTITY_TO_GAME(monster_myself);
132.1526 +LINK_ENTITY_TO_GAME(monster_myself_dead);
132.1527 +LINK_ENTITY_TO_GAME(monster_nagatow);
132.1528 +LINK_ENTITY_TO_GAME(monster_nagatow_dead);
132.1529 +LINK_ENTITY_TO_GAME(monster_nihilanth);
132.1530 +LINK_ENTITY_TO_GAME(monster_op4loader);
132.1531 +LINK_ENTITY_TO_GAME(monster_osprey);
132.1532 +LINK_ENTITY_TO_GAME(monster_otis);
132.1533 +LINK_ENTITY_TO_GAME(monster_otis_dead);
132.1534 +LINK_ENTITY_TO_GAME(monster_ourano);
132.1535 +LINK_ENTITY_TO_GAME(monster_parachute);
132.1536 +LINK_ENTITY_TO_GAME(monster_penguin);
132.1537 +LINK_ENTITY_TO_GAME(monster_penta);
132.1538 +LINK_ENTITY_TO_GAME(monster_pig);
132.1539 +LINK_ENTITY_TO_GAME(monster_pilot);
132.1540 +LINK_ENTITY_TO_GAME(monster_pipebomb);
132.1541 +LINK_ENTITY_TO_GAME(monster_pitdrone);
132.1542 +LINK_ENTITY_TO_GAME(monster_pitworm);
132.1543 +LINK_ENTITY_TO_GAME(monster_pitworm_up);
132.1544 +LINK_ENTITY_TO_GAME(monster_player);
132.1545 +LINK_ENTITY_TO_GAME(monster_poison);
132.1546 +LINK_ENTITY_TO_GAME(monster_prisoner);
132.1547 +LINK_ENTITY_TO_GAME(monster_prop_apache);
132.1548 +LINK_ENTITY_TO_GAME(monster_proximity);
132.1549 +LINK_ENTITY_TO_GAME(monster_puma);
132.1550 +LINK_ENTITY_TO_GAME(monster_ramone);
132.1551 +LINK_ENTITY_TO_GAME(monster_ramone_repel);
132.1552 +LINK_ENTITY_TO_GAME(monster_raptor);
132.1553 +LINK_ENTITY_TO_GAME(monster_rat);
132.1554 +LINK_ENTITY_TO_GAME(monster_recruit);
132.1555 +LINK_ENTITY_TO_GAME(monster_replicateur);
132.1556 +LINK_ENTITY_TO_GAME(monster_robogrunt);
132.1557 +LINK_ENTITY_TO_GAME(monster_robogruntrepel);
132.1558 +LINK_ENTITY_TO_GAME(monster_rustbattery);
132.1559 +LINK_ENTITY_TO_GAME(monster_rustbit);
132.1560 +LINK_ENTITY_TO_GAME(monster_rustbit_friendly);
132.1561 +LINK_ENTITY_TO_GAME(monster_rustflier);
132.1562 +LINK_ENTITY_TO_GAME(monster_rustgunr);
132.1563 +LINK_ENTITY_TO_GAME(monster_sarge_allies);
132.1564 +LINK_ENTITY_TO_GAME(monster_satchel);
132.1565 +LINK_ENTITY_TO_GAME(monster_scientist);
132.1566 +LINK_ENTITY_TO_GAME(monster_scientist_dead);
132.1567 +LINK_ENTITY_TO_GAME(monster_scorpion);
132.1568 +LINK_ENTITY_TO_GAME(monster_sentry);
132.1569 +LINK_ENTITY_TO_GAME(monster_sentry_mini);
132.1570 +LINK_ENTITY_TO_GAME(monster_sheep);
132.1571 +LINK_ENTITY_TO_GAME(monster_shockroach);
132.1572 +LINK_ENTITY_TO_GAME(monster_shocktrooper);
132.1573 +LINK_ENTITY_TO_GAME(monster_shocktrooper_repel);
132.1574 +LINK_ENTITY_TO_GAME(monster_sitting_civilian);
132.1575 +LINK_ENTITY_TO_GAME(monster_sitting_cleansuit_scientist);
132.1576 +LINK_ENTITY_TO_GAME(monster_sitting_colonel);
132.1577 +LINK_ENTITY_TO_GAME(monster_sitting_crispen);
132.1578 +LINK_ENTITY_TO_GAME(monster_sitting_dave);
132.1579 +LINK_ENTITY_TO_GAME(monster_sitting_masala);
132.1580 +LINK_ENTITY_TO_GAME(monster_sitting_nagatow);
132.1581 +LINK_ENTITY_TO_GAME(monster_sitting_scientist);
132.1582 +LINK_ENTITY_TO_GAME(monster_sitting_townmex);
132.1583 +LINK_ENTITY_TO_GAME(monster_sitting_twnwesta);
132.1584 +LINK_ENTITY_TO_GAME(monster_sitting_twnwestb);
132.1585 +LINK_ENTITY_TO_GAME(monster_sitting_villager);
132.1586 +LINK_ENTITY_TO_GAME(monster_skeleton);
132.1587 +LINK_ENTITY_TO_GAME(monster_skeleton_dead);
132.1588 +LINK_ENTITY_TO_GAME(monster_skelly);
132.1589 +LINK_ENTITY_TO_GAME(monster_skellydance);
132.1590 +LINK_ENTITY_TO_GAME(monster_skunk);
132.1591 +LINK_ENTITY_TO_GAME(monster_smallminer);
132.1592 +LINK_ENTITY_TO_GAME(monster_smallminer_dead);
132.1593 +LINK_ENTITY_TO_GAME(monster_snake);
132.1594 +LINK_ENTITY_TO_GAME(monster_snark);
132.1595 +LINK_ENTITY_TO_GAME(monster_spforce_dead);
132.1596 +LINK_ENTITY_TO_GAME(monster_spforce_repel);
132.1597 +LINK_ENTITY_TO_GAME(monster_sphere);
132.1598 +LINK_ENTITY_TO_GAME(monster_spider);
132.1599 +LINK_ENTITY_TO_GAME(monster_spiritdragon);
132.1600 +LINK_ENTITY_TO_GAME(monster_spiritwiz);
132.1601 +LINK_ENTITY_TO_GAME(monster_srocket);
132.1602 +LINK_ENTITY_TO_GAME(monster_super_snark);
132.1603 +LINK_ENTITY_TO_GAME(monster_tank);
132.1604 +LINK_ENTITY_TO_GAME(monster_targetrocket);
132.1605 +LINK_ENTITY_TO_GAME(monster_tentacle);
132.1606 +LINK_ENTITY_TO_GAME(monster_tentaclemaw);
132.1607 +LINK_ENTITY_TO_GAME(monster_terror_dead);
132.1608 +LINK_ENTITY_TO_GAME(monster_terror_repel);
132.1609 +LINK_ENTITY_TO_GAME(monster_test);
132.1610 +LINK_ENTITY_TO_GAME(monster_thornbush);
132.1611 +LINK_ENTITY_TO_GAME(monster_tied_colonel);
132.1612 +LINK_ENTITY_TO_GAME(monster_torch_ally_repel);
132.1613 +LINK_ENTITY_TO_GAME(monster_tornado);
132.1614 +LINK_ENTITY_TO_GAME(monster_townmex);
132.1615 +LINK_ENTITY_TO_GAME(monster_townmex_dead);
132.1616 +LINK_ENTITY_TO_GAME(monster_trainingbot);
132.1617 +LINK_ENTITY_TO_GAME(monster_tripmine);
132.1618 +LINK_ENTITY_TO_GAME(monster_troop);
132.1619 +LINK_ENTITY_TO_GAME(monster_tube);
132.1620 +LINK_ENTITY_TO_GAME(monster_tube_embryo);
132.1621 +LINK_ENTITY_TO_GAME(monster_turret);
132.1622 +LINK_ENTITY_TO_GAME(monster_turretbase);
132.1623 +LINK_ENTITY_TO_GAME(monster_twnwesta);
132.1624 +LINK_ENTITY_TO_GAME(monster_twnwesta_dead);
132.1625 +LINK_ENTITY_TO_GAME(monster_twnwestb);
132.1626 +LINK_ENTITY_TO_GAME(monster_twnwestb_dead);
132.1627 +LINK_ENTITY_TO_GAME(monster_valve_turret);
132.1628 +LINK_ENTITY_TO_GAME(monster_villager);
132.1629 +LINK_ENTITY_TO_GAME(monster_villager_dead);
132.1630 +LINK_ENTITY_TO_GAME(monster_vortigaunt);
132.1631 +LINK_ENTITY_TO_GAME(monster_wizardclone);
132.1632 +LINK_ENTITY_TO_GAME(monster_wombat);
132.1633 +LINK_ENTITY_TO_GAME(monster_worker);
132.1634 +LINK_ENTITY_TO_GAME(monster_worker_dead);
132.1635 +LINK_ENTITY_TO_GAME(monster_wwmine);
132.1636 +LINK_ENTITY_TO_GAME(monster_xenome);
132.1637 +LINK_ENTITY_TO_GAME(monster_xenome_embryo);
132.1638 +LINK_ENTITY_TO_GAME(monster_zbarney);
132.1639 +LINK_ENTITY_TO_GAME(monster_zombie);
132.1640 +LINK_ENTITY_TO_GAME(monster_zombie2);
132.1641 +LINK_ENTITY_TO_GAME(monster_zombie_barney);
132.1642 +LINK_ENTITY_TO_GAME(monster_zombie_soldier);
132.1643 +LINK_ENTITY_TO_GAME(monster_zombie_soldier_dead);
132.1644 +LINK_ENTITY_TO_GAME(monstermaker);
132.1645 +LINK_ENTITY_TO_GAME(mortar_shell);
132.1646 +LINK_ENTITY_TO_GAME(mortarshell);
132.1647 +LINK_ENTITY_TO_GAME(movementchamber);
132.1648 +LINK_ENTITY_TO_GAME(moving_camera);
132.1649 +LINK_ENTITY_TO_GAME(multi_alias);
132.1650 +LINK_ENTITY_TO_GAME(multi_manager);
132.1651 +LINK_ENTITY_TO_GAME(multi_watcher);
132.1652 +LINK_ENTITY_TO_GAME(multisource);
132.1653 +LINK_ENTITY_TO_GAME(my_monster);
132.1654 +LINK_ENTITY_TO_GAME(nail);
132.1655 +LINK_ENTITY_TO_GAME(neutrinobeam);
132.1656 +LINK_ENTITY_TO_GAME(nihilanth_energy_ball);
132.1657 +LINK_ENTITY_TO_GAME(node_viewer);
132.1658 +LINK_ENTITY_TO_GAME(node_viewer_fly);
132.1659 +LINK_ENTITY_TO_GAME(node_viewer_human);
132.1660 +LINK_ENTITY_TO_GAME(node_viewer_large);
132.1661 +LINK_ENTITY_TO_GAME(npc);
132.1662 +LINK_ENTITY_TO_GAME(npc_skrunk);
132.1663 +LINK_ENTITY_TO_GAME(nuke);
132.1664 +LINK_ENTITY_TO_GAME(nuke_rocket);
132.1665 +LINK_ENTITY_TO_GAME(object);
132.1666 +LINK_ENTITY_TO_GAME(object_beacon);
132.1667 +LINK_ENTITY_TO_GAME(object_follow);
132.1668 +LINK_ENTITY_TO_GAME(object_maker);
132.1669 +LINK_ENTITY_TO_GAME(object_superchip);
132.1670 +LINK_ENTITY_TO_GAME(offensechamber);
132.1671 +LINK_ENTITY_TO_GAME(ol_bell);
132.1672 +LINK_ENTITY_TO_GAME(ol_bluecapture);
132.1673 +LINK_ENTITY_TO_GAME(ol_blueflag);
132.1674 +LINK_ENTITY_TO_GAME(ol_bottle);
132.1675 +LINK_ENTITY_TO_GAME(ol_ctf_blueteam);
132.1676 +LINK_ENTITY_TO_GAME(ol_ctf_redteam);
132.1677 +LINK_ENTITY_TO_GAME(ol_furniture);
132.1678 +LINK_ENTITY_TO_GAME(ol_lantern);
132.1679 +LINK_ENTITY_TO_GAME(ol_redcapture);
132.1680 +LINK_ENTITY_TO_GAME(ol_redflag);
132.1681 +LINK_ENTITY_TO_GAME(ol_spitoon);
132.1682 +LINK_ENTITY_TO_GAME(old_rocket);
132.1683 +LINK_ENTITY_TO_GAME(oldbot);
132.1684 +LINK_ENTITY_TO_GAME(op4mortar);
132.1685 +LINK_ENTITY_TO_GAME(oz_logo);
132.1686 +LINK_ENTITY_TO_GAME(oz_rune);
132.1687 +LINK_ENTITY_TO_GAME(paintball);
132.1688 +LINK_ENTITY_TO_GAME(palm_tree);
132.1689 +LINK_ENTITY_TO_GAME(para_roundtimer);
132.1690 +LINK_ENTITY_TO_GAME(particle);
132.1691 +LINK_ENTITY_TO_GAME(particle_shooter);
132.1692 +LINK_ENTITY_TO_GAME(path_corner);
132.1693 +LINK_ENTITY_TO_GAME(path_track);
132.1694 +LINK_ENTITY_TO_GAME(pballblue);
132.1695 +LINK_ENTITY_TO_GAME(pballred);
132.1696 +LINK_ENTITY_TO_GAME(pe_escapezone);
132.1697 +LINK_ENTITY_TO_GAME(pe_light);
132.1698 +LINK_ENTITY_TO_GAME(pe_light_ref);
132.1699 +LINK_ENTITY_TO_GAME(pe_object_case);
132.1700 +LINK_ENTITY_TO_GAME(pe_object_htool);
132.1701 +LINK_ENTITY_TO_GAME(pe_objectclip);
132.1702 +LINK_ENTITY_TO_GAME(pe_radar_mark);
132.1703 +LINK_ENTITY_TO_GAME(pe_rain);
132.1704 +LINK_ENTITY_TO_GAME(pe_spawn_corps);
132.1705 +LINK_ENTITY_TO_GAME(pe_spawn_syndicate);
132.1706 +LINK_ENTITY_TO_GAME(pe_terminal);
132.1707 +LINK_ENTITY_TO_GAME(phasegate);
132.1708 +LINK_ENTITY_TO_GAME(pickup_drive_agrunt);
132.1709 +LINK_ENTITY_TO_GAME(pickup_drive_apache);
132.1710 +LINK_ENTITY_TO_GAME(pickup_drive_assassin);
132.1711 +LINK_ENTITY_TO_GAME(pickup_drive_bm);
132.1712 +LINK_ENTITY_TO_GAME(pickup_drive_bullsquid);
132.1713 +LINK_ENTITY_TO_GAME(pickup_drive_controller);
132.1714 +LINK_ENTITY_TO_GAME(pickup_drive_garg);
132.1715 +LINK_ENTITY_TO_GAME(pickup_drive_houndeye);
132.1716 +LINK_ENTITY_TO_GAME(pickup_drive_icky);
132.1717 +LINK_ENTITY_TO_GAME(pickup_drive_panth);
132.1718 +LINK_ENTITY_TO_GAME(pickup_drive_slave);
132.1719 +LINK_ENTITY_TO_GAME(pickup_drive_turret);
132.1720 +LINK_ENTITY_TO_GAME(pineapple);
132.1721 +LINK_ENTITY_TO_GAME(pipe_bomb);
132.1722 +LINK_ENTITY_TO_GAME(pipebomb);
132.1723 +LINK_ENTITY_TO_GAME(pitdronespike);
132.1724 +LINK_ENTITY_TO_GAME(pitworm_gib);
132.1725 +LINK_ENTITY_TO_GAME(pitworm_gibshooter);
132.1726 +LINK_ENTITY_TO_GAME(plasma);
132.1727 +LINK_ENTITY_TO_GAME(plasma_ball);
132.1728 +LINK_ENTITY_TO_GAME(player);
132.1729 +LINK_ENTITY_TO_GAME(player_beartrapstrip);
132.1730 +LINK_ENTITY_TO_GAME(player_corpse);
132.1731 +LINK_ENTITY_TO_GAME(player_flame);
132.1732 +LINK_ENTITY_TO_GAME(player_giveitems);
132.1733 +LINK_ENTITY_TO_GAME(player_glasses);
132.1734 +LINK_ENTITY_TO_GAME(player_helmet);
132.1735 +LINK_ENTITY_TO_GAME(player_loadsaved);
132.1736 +LINK_ENTITY_TO_GAME(player_roach);
132.1737 +LINK_ENTITY_TO_GAME(player_speaker);
132.1738 +LINK_ENTITY_TO_GAME(player_togglehud);
132.1739 +LINK_ENTITY_TO_GAME(player_weaponship);
132.1740 +LINK_ENTITY_TO_GAME(player_weaponstrip);
132.1741 +LINK_ENTITY_TO_GAME(point_win);
132.1742 +LINK_ENTITY_TO_GAME(potatoc);
132.1743 +LINK_ENTITY_TO_GAME(power_ballbag);
132.1744 +LINK_ENTITY_TO_GAME(power_coco);
132.1745 +LINK_ENTITY_TO_GAME(power_gloves);
132.1746 +LINK_ENTITY_TO_GAME(power_shield);
132.1747 +LINK_ENTITY_TO_GAME(power_shoes);
132.1748 +LINK_ENTITY_TO_GAME(powerstruggle);
132.1749 +LINK_ENTITY_TO_GAME(powerup_candy);
132.1750 +LINK_ENTITY_TO_GAME(proj_bird);
132.1751 +LINK_ENTITY_TO_GAME(proj_blaster);
132.1752 +LINK_ENTITY_TO_GAME(proj_bursatchel);
132.1753 +LINK_ENTITY_TO_GAME(proj_cocklebur);
132.1754 +LINK_ENTITY_TO_GAME(proj_comet);
132.1755 +LINK_ENTITY_TO_GAME(proj_doublemagicmissle);
132.1756 +LINK_ENTITY_TO_GAME(proj_dragonfire);
132.1757 +LINK_ENTITY_TO_GAME(proj_earthquakesatchel);
132.1758 +LINK_ENTITY_TO_GAME(proj_fireball);
132.1759 +LINK_ENTITY_TO_GAME(proj_firesatchel);
132.1760 +LINK_ENTITY_TO_GAME(proj_firespiral);
132.1761 +LINK_ENTITY_TO_GAME(proj_fissure);
132.1762 +LINK_ENTITY_TO_GAME(proj_flame);
132.1763 +LINK_ENTITY_TO_GAME(proj_flyingskull);
132.1764 +LINK_ENTITY_TO_GAME(proj_healhurtsatchel);
132.1765 +LINK_ENTITY_TO_GAME(proj_icepoke);
132.1766 +LINK_ENTITY_TO_GAME(proj_lightningcloud);
132.1767 +LINK_ENTITY_TO_GAME(proj_lightningsatchel);
132.1768 +LINK_ENTITY_TO_GAME(proj_magicmissle);
132.1769 +LINK_ENTITY_TO_GAME(proj_meteor);
132.1770 +LINK_ENTITY_TO_GAME(proj_mindmissle);
132.1771 +LINK_ENTITY_TO_GAME(proj_poisonsatchel);
132.1772 +LINK_ENTITY_TO_GAME(proj_rollingstone);
132.1773 +LINK_ENTITY_TO_GAME(proj_sporepod);
132.1774 +LINK_ENTITY_TO_GAME(proj_suctionsatchel);
132.1775 +LINK_ENTITY_TO_GAME(proj_tcrystal);
132.1776 +LINK_ENTITY_TO_GAME(proj_throwingbone);
132.1777 +LINK_ENTITY_TO_GAME(proj_toothsatchel);
132.1778 +LINK_ENTITY_TO_GAME(proj_whirlwind);
132.1779 +LINK_ENTITY_TO_GAME(proj_wyvern);
132.1780 +LINK_ENTITY_TO_GAME(promagcurse);
132.1781 +LINK_ENTITY_TO_GAME(pt_bomb_zone);
132.1782 +LINK_ENTITY_TO_GAME(pt_campaign_end);
132.1783 +LINK_ENTITY_TO_GAME(pt_change_attribute);
132.1784 +LINK_ENTITY_TO_GAME(pt_control_area);
132.1785 +LINK_ENTITY_TO_GAME(pt_defeat_victory);
132.1786 +LINK_ENTITY_TO_GAME(pt_entity_reset);
132.1787 +LINK_ENTITY_TO_GAME(pt_hostage);
132.1788 +LINK_ENTITY_TO_GAME(pt_mission_target);
132.1789 +LINK_ENTITY_TO_GAME(pt_model);
132.1790 +LINK_ENTITY_TO_GAME(pt_parachute_area);
132.1791 +LINK_ENTITY_TO_GAME(pt_rescue_zone);
132.1792 +LINK_ENTITY_TO_GAME(pt_round_info);
132.1793 +LINK_ENTITY_TO_GAME(pt_score_award);
132.1794 +LINK_ENTITY_TO_GAME(pt_startpoint);
132.1795 +LINK_ENTITY_TO_GAME(pt_timer);
132.1796 +LINK_ENTITY_TO_GAME(pt_toggle_respawnmode);
132.1797 +LINK_ENTITY_TO_GAME(pt_trigger_bomb);
132.1798 +LINK_ENTITY_TO_GAME(pt_trigger_loader);
132.1799 +LINK_ENTITY_TO_GAME(pt_trigger_zone);
132.1800 +LINK_ENTITY_TO_GAME(pulsefrag);
132.1801 +LINK_ENTITY_TO_GAME(quake_nail);
132.1802 +LINK_ENTITY_TO_GAME(quake_rocket);
132.1803 +LINK_ENTITY_TO_GAME(rage);
132.1804 +LINK_ENTITY_TO_GAME(random_ammo);
132.1805 +LINK_ENTITY_TO_GAME(random_speaker);
132.1806 +LINK_ENTITY_TO_GAME(random_trigger);
132.1807 +LINK_ENTITY_TO_GAME(random_weapon);
132.1808 +LINK_ENTITY_TO_GAME(redflag_follow);
132.1809 +LINK_ENTITY_TO_GAME(reetou_proj);
132.1810 +LINK_ENTITY_TO_GAME(resourcetower);
132.1811 +LINK_ENTITY_TO_GAME(return_axe);
132.1812 +LINK_ENTITY_TO_GAME(reversecurse);
132.1813 +LINK_ENTITY_TO_GAME(rocket_air_strike);
132.1814 +LINK_ENTITY_TO_GAME(rocket_croix);
132.1815 +LINK_ENTITY_TO_GAME(rocket_napalm);
132.1816 +LINK_ENTITY_TO_GAME(rocket_phoenix);
132.1817 +LINK_ENTITY_TO_GAME(rocket_pigeon);
132.1818 +LINK_ENTITY_TO_GAME(rocket_snipe);
132.1819 +LINK_ENTITY_TO_GAME(rope_sample);
132.1820 +LINK_ENTITY_TO_GAME(rope_segment);
132.1821 +LINK_ENTITY_TO_GAME(rpg7_rocket);
132.1822 +LINK_ENTITY_TO_GAME(rpg_rocket);
132.1823 +LINK_ENTITY_TO_GAME(rr_shell);
132.1824 +LINK_ENTITY_TO_GAME(rs_effect);
132.1825 +LINK_ENTITY_TO_GAME(rs_grenade);
132.1826 +LINK_ENTITY_TO_GAME(rs_roundend);
132.1827 +LINK_ENTITY_TO_GAME(rs_teamslot);
132.1828 +LINK_ENTITY_TO_GAME(rs_victorypoints);
132.1829 +LINK_ENTITY_TO_GAME(sams_shower);
132.1830 +LINK_ENTITY_TO_GAME(satelite_laser);
132.1831 +LINK_ENTITY_TO_GAME(scan);
132.1832 +LINK_ENTITY_TO_GAME(scatterattack);
132.1833 +LINK_ENTITY_TO_GAME(scattersplit);
132.1834 +LINK_ENTITY_TO_GAME(sci_spawner);
132.1835 +LINK_ENTITY_TO_GAME(scientistbomb);
132.1836 +LINK_ENTITY_TO_GAME(score_multiplier);
132.1837 +LINK_ENTITY_TO_GAME(scoreboard);
132.1838 +LINK_ENTITY_TO_GAME(scripted);
132.1839 +LINK_ENTITY_TO_GAME(scripted_action);
132.1840 +LINK_ENTITY_TO_GAME(scripted_sentence);
132.1841 +LINK_ENTITY_TO_GAME(scripted_sequence);
132.1842 +LINK_ENTITY_TO_GAME(sdcurse);
132.1843 +LINK_ENTITY_TO_GAME(secondary_point);
132.1844 +LINK_ENTITY_TO_GAME(sensorychamber);
132.1845 +LINK_ENTITY_TO_GAME(sgvortex);
132.1846 +LINK_ENTITY_TO_GAME(shell_bazooka);
132.1847 +LINK_ENTITY_TO_GAME(shell_piat);
132.1848 +LINK_ENTITY_TO_GAME(shell_pschreck);
132.1849 +LINK_ENTITY_TO_GAME(shenlong);
132.1850 +LINK_ENTITY_TO_GAME(shock_beam);
132.1851 +LINK_ENTITY_TO_GAME(siegeturret);
132.1852 +LINK_ENTITY_TO_GAME(skunk_fart);
132.1853 +LINK_ENTITY_TO_GAME(slAGruntTakeCoverFromEnemy);
132.1854 +LINK_ENTITY_TO_GAME(slAGruntThreatDisplay);
132.1855 +LINK_ENTITY_TO_GAME(slAssassinTakeCoverFromBestSound);
132.1856 +LINK_ENTITY_TO_GAME(slAssassinTakeCoverFromEnemy);
132.1857 +LINK_ENTITY_TO_GAME(slAssassinTakeCoverFromEnemy2);
132.1858 +LINK_ENTITY_TO_GAME(slBaFaceTarget);
132.1859 +LINK_ENTITY_TO_GAME(slControllerTakeCover);
132.1860 +LINK_ENTITY_TO_GAME(slFaceTarget);
132.1861 +LINK_ENTITY_TO_GAME(slFaceTargetScared);
132.1862 +LINK_ENTITY_TO_GAME(slGruntTakeCover);
132.1863 +LINK_ENTITY_TO_GAME(slGruntTakeCoverFromBestSound);
132.1864 +LINK_ENTITY_TO_GAME(slGruntTossGrenadeCover);
132.1865 +LINK_ENTITY_TO_GAME(slIdleTrigger);
132.1866 +LINK_ENTITY_TO_GAME(slRunToScript);
132.1867 +LINK_ENTITY_TO_GAME(slTakeCoverFromBestSound);
132.1868 +LINK_ENTITY_TO_GAME(slTakeCoverFromEnemy);
132.1869 +LINK_ENTITY_TO_GAME(slTakeCoverFromOrigin);
132.1870 +LINK_ENTITY_TO_GAME(slTlkIdleEyecontact);
132.1871 +LINK_ENTITY_TO_GAME(slTlkIdleWatchClient);
132.1872 +LINK_ENTITY_TO_GAME(slTwitchDie);
132.1873 +LINK_ENTITY_TO_GAME(slWalkToScript);
132.1874 +LINK_ENTITY_TO_GAME(slowcurse);
132.1875 +LINK_ENTITY_TO_GAME(slowrefirecurse);
132.1876 +LINK_ENTITY_TO_GAME(sm_rocket_01);
132.1877 +LINK_ENTITY_TO_GAME(snark_cam);
132.1878 +LINK_ENTITY_TO_GAME(snowball);
132.1879 +LINK_ENTITY_TO_GAME(soundent);
132.1880 +LINK_ENTITY_TO_GAME(spark_shower);
132.1881 +LINK_ENTITY_TO_GAME(spawnfar);
132.1882 +LINK_ENTITY_TO_GAME(speaker);
132.1883 +LINK_ENTITY_TO_GAME(spear_bolt);
132.1884 +LINK_ENTITY_TO_GAME(specailbc);
132.1885 +LINK_ENTITY_TO_GAME(sphere_explosion);
132.1886 +LINK_ENTITY_TO_GAME(spirit_bomb);
132.1887 +LINK_ENTITY_TO_GAME(spitgunprojectile);
132.1888 +LINK_ENTITY_TO_GAME(spore);
132.1889 +LINK_ENTITY_TO_GAME(sporegunprojectile);
132.1890 +LINK_ENTITY_TO_GAME(spy_camera);
132.1891 +LINK_ENTITY_TO_GAME(spy_escape);
132.1892 +LINK_ENTITY_TO_GAME(squadmaker);
132.1893 +LINK_ENTITY_TO_GAME(squidspit);
132.1894 +LINK_ENTITY_TO_GAME(st_rocket);
132.1895 +LINK_ENTITY_TO_GAME(streak_spiral);
132.1896 +LINK_ENTITY_TO_GAME(sturmbody);
132.1897 +LINK_ENTITY_TO_GAME(suck_mine);
132.1898 +LINK_ENTITY_TO_GAME(swarm_garg_stomp);
132.1899 +LINK_ENTITY_TO_GAME(swarm_spawnpt_acontroller);
132.1900 +LINK_ENTITY_TO_GAME(swarm_spawnpt_agarg);
132.1901 +LINK_ENTITY_TO_GAME(swarm_spawnpt_aheadcrab);
132.1902 +LINK_ENTITY_TO_GAME(swarm_spawnpt_aslave);
132.1903 +LINK_ENTITY_TO_GAME(swarm_spawnpt_atripod);
132.1904 +LINK_ENTITY_TO_GAME(swarm_spawnpt_hassassin);
132.1905 +LINK_ENTITY_TO_GAME(swarm_spawnpt_hcommander);
132.1906 +LINK_ENTITY_TO_GAME(swarm_spawnpt_hengineer);
132.1907 +LINK_ENTITY_TO_GAME(swarm_spawnpt_hgrunt);
132.1908 +LINK_ENTITY_TO_GAME(swarm_spawnpt_hscientist);
132.1909 +LINK_ENTITY_TO_GAME(swarm_spawnpt_human);
132.1910 +LINK_ENTITY_TO_GAME(swarm_team_alien);
132.1911 +LINK_ENTITY_TO_GAME(swarm_team_human);
132.1912 +LINK_ENTITY_TO_GAME(targ_speaker);
132.1913 +LINK_ENTITY_TO_GAME(target_all_players);
132.1914 +LINK_ENTITY_TO_GAME(target_animation);
132.1915 +LINK_ENTITY_TO_GAME(target_cdaudio);
132.1916 +LINK_ENTITY_TO_GAME(target_changemaster);
132.1917 +LINK_ENTITY_TO_GAME(target_changetarget);
132.1918 +LINK_ENTITY_TO_GAME(target_give);
132.1919 +LINK_ENTITY_TO_GAME(target_gravity);
132.1920 +LINK_ENTITY_TO_GAME(target_help);
132.1921 +LINK_ENTITY_TO_GAME(target_hurt);
132.1922 +LINK_ENTITY_TO_GAME(target_kill);
132.1923 +LINK_ENTITY_TO_GAME(target_mp3audio);
132.1924 +LINK_ENTITY_TO_GAME(target_print);
132.1925 +LINK_ENTITY_TO_GAME(target_push);
132.1926 +LINK_ENTITY_TO_GAME(target_random);
132.1927 +LINK_ENTITY_TO_GAME(target_random_player);
132.1928 +LINK_ENTITY_TO_GAME(target_relay);
132.1929 +LINK_ENTITY_TO_GAME(target_removeobject);
132.1930 +LINK_ENTITY_TO_GAME(target_reset);
132.1931 +LINK_ENTITY_TO_GAME(target_respawn);
132.1932 +LINK_ENTITY_TO_GAME(target_score);
132.1933 +LINK_ENTITY_TO_GAME(target_server_command);
132.1934 +LINK_ENTITY_TO_GAME(target_set_cvar);
132.1935 +LINK_ENTITY_TO_GAME(target_spawnitem);
132.1936 +LINK_ENTITY_TO_GAME(target_spectate);
132.1937 +LINK_ENTITY_TO_GAME(target_team);
132.1938 +LINK_ENTITY_TO_GAME(target_team_score);
132.1939 +LINK_ENTITY_TO_GAME(target_teamdie);
132.1940 +LINK_ENTITY_TO_GAME(target_teleport);
132.1941 +LINK_ENTITY_TO_GAME(target_weaponstrip);
132.1942 +LINK_ENTITY_TO_GAME(target_win);
132.1943 +LINK_ENTITY_TO_GAME(team_advarmory);
132.1944 +LINK_ENTITY_TO_GAME(team_advturretfactory);
132.1945 +LINK_ENTITY_TO_GAME(team_armory);
132.1946 +LINK_ENTITY_TO_GAME(team_armslab);
132.1947 +LINK_ENTITY_TO_GAME(team_chemlab);
132.1948 +LINK_ENTITY_TO_GAME(team_command);
132.1949 +LINK_ENTITY_TO_GAME(team_goal);
132.1950 +LINK_ENTITY_TO_GAME(team_hive);
132.1951 +LINK_ENTITY_TO_GAME(team_infportal);
132.1952 +LINK_ENTITY_TO_GAME(team_medlab);
132.1953 +LINK_ENTITY_TO_GAME(team_nukeplant);
132.1954 +LINK_ENTITY_TO_GAME(team_observatory);
132.1955 +LINK_ENTITY_TO_GAME(team_prototypelab);
132.1956 +LINK_ENTITY_TO_GAME(team_turretfactory);
132.1957 +LINK_ENTITY_TO_GAME(team_webstrand);
132.1958 +LINK_ENTITY_TO_GAME(telebecon);
132.1959 +LINK_ENTITY_TO_GAME(teledeath);
132.1960 +LINK_ENTITY_TO_GAME(test_effect);
132.1961 +LINK_ENTITY_TO_GAME(testhull);
132.1962 +LINK_ENTITY_TO_GAME(testparticles);
132.1963 +LINK_ENTITY_TO_GAME(tf_ammo_rpgclip);
132.1964 +LINK_ENTITY_TO_GAME(tf_flame);
132.1965 +LINK_ENTITY_TO_GAME(tf_flamethrower_burst);
132.1966 +LINK_ENTITY_TO_GAME(tf_gl_grenade);
132.1967 +LINK_ENTITY_TO_GAME(tf_ic_rocket);
132.1968 +LINK_ENTITY_TO_GAME(tf_nailgun_nail);
132.1969 +LINK_ENTITY_TO_GAME(tf_rpg_rocket);
132.1970 +LINK_ENTITY_TO_GAME(tf_weapon_ac);
132.1971 +LINK_ENTITY_TO_GAME(tf_weapon_autorifle);
132.1972 +LINK_ENTITY_TO_GAME(tf_weapon_axe);
132.1973 +LINK_ENTITY_TO_GAME(tf_weapon_caltrop);
132.1974 +LINK_ENTITY_TO_GAME(tf_weapon_caltropgrenade);
132.1975 +LINK_ENTITY_TO_GAME(tf_weapon_concussiongrenade);
132.1976 +LINK_ENTITY_TO_GAME(tf_weapon_empgrenade);
132.1977 +LINK_ENTITY_TO_GAME(tf_weapon_flamethrower);
132.1978 +LINK_ENTITY_TO_GAME(tf_weapon_gasgrenade);
132.1979 +LINK_ENTITY_TO_GAME(tf_weapon_genericprimedgrenade);
132.1980 +LINK_ENTITY_TO_GAME(tf_weapon_gl);
132.1981 +LINK_ENTITY_TO_GAME(tf_weapon_ic);
132.1982 +LINK_ENTITY_TO_GAME(tf_weapon_knife);
132.1983 +LINK_ENTITY_TO_GAME(tf_weapon_medikit);
132.1984 +LINK_ENTITY_TO_GAME(tf_weapon_mirvbomblet);
132.1985 +LINK_ENTITY_TO_GAME(tf_weapon_mirvgrenade);
132.1986 +LINK_ENTITY_TO_GAME(tf_weapon_nailgrenade);
132.1987 +LINK_ENTITY_TO_GAME(tf_weapon_napalmgrenade);
132.1988 +LINK_ENTITY_TO_GAME(tf_weapon_ng);
132.1989 +LINK_ENTITY_TO_GAME(tf_weapon_normalgrenade);
132.1990 +LINK_ENTITY_TO_GAME(tf_weapon_pl);
132.1991 +LINK_ENTITY_TO_GAME(tf_weapon_railgun);
132.1992 +LINK_ENTITY_TO_GAME(tf_weapon_rpg);
132.1993 +LINK_ENTITY_TO_GAME(tf_weapon_shotgun);
132.1994 +LINK_ENTITY_TO_GAME(tf_weapon_sniperrifle);
132.1995 +LINK_ENTITY_TO_GAME(tf_weapon_spanner);
132.1996 +LINK_ENTITY_TO_GAME(tf_weapon_superng);
132.1997 +LINK_ENTITY_TO_GAME(tf_weapon_supershotgun);
132.1998 +LINK_ENTITY_TO_GAME(tf_weapon_tranq);
132.1999 +LINK_ENTITY_TO_GAME(throwing_knife);
132.2000 +LINK_ENTITY_TO_GAME(thrown_katana);
132.2001 +LINK_ENTITY_TO_GAME(thrown_knife);
132.2002 +LINK_ENTITY_TO_GAME(thrown_object);
132.2003 +LINK_ENTITY_TO_GAME(thrown_sledge);
132.2004 +LINK_ENTITY_TO_GAME(timer);
132.2005 +LINK_ENTITY_TO_GAME(timer_add);
132.2006 +LINK_ENTITY_TO_GAME(tlAGruntTakeCoverFromEnemy);
132.2007 +LINK_ENTITY_TO_GAME(tlAGruntThreatDisplay);
132.2008 +LINK_ENTITY_TO_GAME(tlAssassinTakeCoverFromBestSound);
132.2009 +LINK_ENTITY_TO_GAME(tlAssassinTakeCoverFromEnemy);
132.2010 +LINK_ENTITY_TO_GAME(tlAssassinTakeCoverFromEnemy2);
132.2011 +LINK_ENTITY_TO_GAME(tlBaFaceTarget);
132.2012 +LINK_ENTITY_TO_GAME(tlControllerTakeCover);
132.2013 +LINK_ENTITY_TO_GAME(tlFaceTarget);
132.2014 +LINK_ENTITY_TO_GAME(tlFaceTargetScared);
132.2015 +LINK_ENTITY_TO_GAME(tlGruntTakeCover1);
132.2016 +LINK_ENTITY_TO_GAME(tlGruntTakeCoverFromBestSound);
132.2017 +LINK_ENTITY_TO_GAME(tlGruntTossGrenadeCover1);
132.2018 +LINK_ENTITY_TO_GAME(tlTakeCoverFromBestSound);
132.2019 +LINK_ENTITY_TO_GAME(tlTakeCoverFromEnemy);
132.2020 +LINK_ENTITY_TO_GAME(tlTakeCoverFromOrigin);
132.2021 +LINK_ENTITY_TO_GAME(tlTlkIdleEyecontact);
132.2022 +LINK_ENTITY_TO_GAME(tlTlkIdleWatchClient);
132.2023 +LINK_ENTITY_TO_GAME(tlTlkIdleWatchClientStare);
132.2024 +LINK_ENTITY_TO_GAME(tlTwitchDie);
132.2025 +LINK_ENTITY_TO_GAME(tod_control_area);
132.2026 +LINK_ENTITY_TO_GAME(tod_control_point);
132.2027 +LINK_ENTITY_TO_GAME(tod_notripmine_area);
132.2028 +LINK_ENTITY_TO_GAME(tod_roundend_trigger);
132.2029 +LINK_ENTITY_TO_GAME(tod_roundstart_trigger);
132.2030 +LINK_ENTITY_TO_GAME(tod_roundwon_trigger);
132.2031 +LINK_ENTITY_TO_GAME(tombstone);
132.2032 +LINK_ENTITY_TO_GAME(translocator_disc);
132.2033 +LINK_ENTITY_TO_GAME(transport_apc);
132.2034 +LINK_ENTITY_TO_GAME(transport_blackhawk);
132.2035 +LINK_ENTITY_TO_GAME(trigger);
132.2036 +LINK_ENTITY_TO_GAME(trigger_GoalLine);
132.2037 +LINK_ENTITY_TO_GAME(trigger_PenaltyBox);
132.2038 +LINK_ENTITY_TO_GAME(trigger_SideLine);
132.2039 +LINK_ENTITY_TO_GAME(trigger_armory);
132.2040 +LINK_ENTITY_TO_GAME(trigger_assault);
132.2041 +LINK_ENTITY_TO_GAME(trigger_auto);
132.2042 +LINK_ENTITY_TO_GAME(trigger_autosave);
132.2043 +LINK_ENTITY_TO_GAME(trigger_ball);
132.2044 +LINK_ENTITY_TO_GAME(trigger_baril);
132.2045 +LINK_ENTITY_TO_GAME(trigger_camera);
132.2046 +LINK_ENTITY_TO_GAME(trigger_capturetimer);
132.2047 +LINK_ENTITY_TO_GAME(trigger_captureupdate);
132.2048 +LINK_ENTITY_TO_GAME(trigger_cdaudio);
132.2049 +LINK_ENTITY_TO_GAME(trigger_changealias);
132.2050 +LINK_ENTITY_TO_GAME(trigger_changelevel);
132.2051 +LINK_ENTITY_TO_GAME(trigger_changetarget);
132.2052 +LINK_ENTITY_TO_GAME(trigger_changevalue);
132.2053 +LINK_ENTITY_TO_GAME(trigger_coldbreath);
132.2054 +LINK_ENTITY_TO_GAME(trigger_comet);
132.2055 +LINK_ENTITY_TO_GAME(trigger_control);
132.2056 +LINK_ENTITY_TO_GAME(trigger_coop);
132.2057 +LINK_ENTITY_TO_GAME(trigger_counter);
132.2058 +LINK_ENTITY_TO_GAME(trigger_course);
132.2059 +LINK_ENTITY_TO_GAME(trigger_crash);
132.2060 +LINK_ENTITY_TO_GAME(trigger_ctf);
132.2061 +LINK_ENTITY_TO_GAME(trigger_ctfgeneric);
132.2062 +LINK_ENTITY_TO_GAME(trigger_deathmatch);
132.2063 +LINK_ENTITY_TO_GAME(trigger_die);
132.2064 +LINK_ENTITY_TO_GAME(trigger_discerturn);
132.2065 +LINK_ENTITY_TO_GAME(trigger_discreturn);
132.2066 +LINK_ENTITY_TO_GAME(trigger_endsection);
132.2067 +LINK_ENTITY_TO_GAME(trigger_env_hurt);
132.2068 +LINK_ENTITY_TO_GAME(trigger_execcommand);
132.2069 +LINK_ENTITY_TO_GAME(trigger_fall);
132.2070 +LINK_ENTITY_TO_GAME(trigger_geneworm_hit);
132.2071 +LINK_ENTITY_TO_GAME(trigger_goal);
132.2072 +LINK_ENTITY_TO_GAME(trigger_golem);
132.2073 +LINK_ENTITY_TO_GAME(trigger_gravity);
132.2074 +LINK_ENTITY_TO_GAME(trigger_gunmanteleport);
132.2075 +LINK_ENTITY_TO_GAME(trigger_hold);
132.2076 +LINK_ENTITY_TO_GAME(trigger_hurt);
132.2077 +LINK_ENTITY_TO_GAME(trigger_hurt_bleu);
132.2078 +LINK_ENTITY_TO_GAME(trigger_hurt_rouge);
132.2079 +LINK_ENTITY_TO_GAME(trigger_jail);
132.2080 +LINK_ENTITY_TO_GAME(trigger_jail_release);
132.2081 +LINK_ENTITY_TO_GAME(trigger_jetpack);
132.2082 +LINK_ENTITY_TO_GAME(trigger_jump);
132.2083 +LINK_ENTITY_TO_GAME(trigger_jumppad);
132.2084 +LINK_ENTITY_TO_GAME(trigger_katehealth);
132.2085 +LINK_ENTITY_TO_GAME(trigger_kill_nogib);
132.2086 +LINK_ENTITY_TO_GAME(trigger_killmonster);
132.2087 +LINK_ENTITY_TO_GAME(trigger_lightstyle);
132.2088 +LINK_ENTITY_TO_GAME(trigger_loadhazard);
132.2089 +LINK_ENTITY_TO_GAME(trigger_mine);
132.2090 +LINK_ENTITY_TO_GAME(trigger_monsterjump);
132.2091 +LINK_ENTITY_TO_GAME(trigger_multiple);
132.2092 +LINK_ENTITY_TO_GAME(trigger_music);
132.2093 +LINK_ENTITY_TO_GAME(trigger_npcarea);
132.2094 +LINK_ENTITY_TO_GAME(trigger_objectcapture);
132.2095 +LINK_ENTITY_TO_GAME(trigger_once);
132.2096 +LINK_ENTITY_TO_GAME(trigger_particles);
132.2097 +LINK_ENTITY_TO_GAME(trigger_playerfreeze);
132.2098 +LINK_ENTITY_TO_GAME(trigger_point_controle);
132.2099 +LINK_ENTITY_TO_GAME(trigger_presence);
132.2100 +LINK_ENTITY_TO_GAME(trigger_push);
132.2101 +LINK_ENTITY_TO_GAME(trigger_random);
132.2102 +LINK_ENTITY_TO_GAME(trigger_random_time);
132.2103 +LINK_ENTITY_TO_GAME(trigger_regen);
132.2104 +LINK_ENTITY_TO_GAME(trigger_relay);
132.2105 +LINK_ENTITY_TO_GAME(trigger_respawn);
132.2106 +LINK_ENTITY_TO_GAME(trigger_rndbased);
132.2107 +LINK_ENTITY_TO_GAME(trigger_rs_hurt);
132.2108 +LINK_ENTITY_TO_GAME(trigger_script);
132.2109 +LINK_ENTITY_TO_GAME(trigger_secret);
132.2110 +LINK_ENTITY_TO_GAME(trigger_section);
132.2111 +LINK_ENTITY_TO_GAME(trigger_shutup);
132.2112 +LINK_ENTITY_TO_GAME(trigger_sound);
132.2113 +LINK_ENTITY_TO_GAME(trigger_speed);
132.2114 +LINK_ENTITY_TO_GAME(trigger_sponly);
132.2115 +LINK_ENTITY_TO_GAME(trigger_startpatrol);
132.2116 +LINK_ENTITY_TO_GAME(trigger_teampush);
132.2117 +LINK_ENTITY_TO_GAME(trigger_teleport);
132.2118 +LINK_ENTITY_TO_GAME(trigger_transition);
132.2119 +LINK_ENTITY_TO_GAME(trigger_war);
132.2120 +LINK_ENTITY_TO_GAME(trigger_xen_return);
132.2121 +LINK_ENTITY_TO_GAME(trigger_zone);
132.2122 +LINK_ENTITY_TO_GAME(trigger_zone_bleu);
132.2123 +LINK_ENTITY_TO_GAME(trigger_zone_rouge);
132.2124 +LINK_ENTITY_TO_GAME(trip_beam);
132.2125 +LINK_ENTITY_TO_GAME(ts_bomb);
132.2126 +LINK_ENTITY_TO_GAME(ts_dmhill);
132.2127 +LINK_ENTITY_TO_GAME(ts_groundweapon);
132.2128 +LINK_ENTITY_TO_GAME(ts_hack);
132.2129 +LINK_ENTITY_TO_GAME(ts_mapglobals);
132.2130 +LINK_ENTITY_TO_GAME(ts_model);
132.2131 +LINK_ENTITY_TO_GAME(ts_objective_manager);
132.2132 +LINK_ENTITY_TO_GAME(ts_objective_ptr);
132.2133 +LINK_ENTITY_TO_GAME(ts_powerup);
132.2134 +LINK_ENTITY_TO_GAME(ts_slowmotion);
132.2135 +LINK_ENTITY_TO_GAME(ts_slowmotionpoint);
132.2136 +LINK_ENTITY_TO_GAME(ts_teamescape);
132.2137 +LINK_ENTITY_TO_GAME(ts_trigger);
132.2138 +LINK_ENTITY_TO_GAME(ts_vipescape);
132.2139 +LINK_ENTITY_TO_GAME(ts_wingiver);
132.2140 +LINK_ENTITY_TO_GAME(turf_zone);
132.2141 +LINK_ENTITY_TO_GAME(turret);
132.2142 +LINK_ENTITY_TO_GAME(umbracloud);
132.2143 +LINK_ENTITY_TO_GAME(umbraprojectile);
132.2144 +LINK_ENTITY_TO_GAME(uw_monster_hybrid);
132.2145 +LINK_ENTITY_TO_GAME(uw_monster_michael);
132.2146 +LINK_ENTITY_TO_GAME(uw_player_lycan);
132.2147 +LINK_ENTITY_TO_GAME(uw_player_vamp);
132.2148 +LINK_ENTITY_TO_GAME(uw_player_view);
132.2149 +LINK_ENTITY_TO_GAME(vehicle);
132.2150 +LINK_ENTITY_TO_GAME(vehicle_dreadnaught);
132.2151 +LINK_ENTITY_TO_GAME(vehicle_dreadnaught_weapon);
132.2152 +LINK_ENTITY_TO_GAME(vehicle_tank);
132.2153 +LINK_ENTITY_TO_GAME(vehicle_wraithlord);
132.2154 +LINK_ENTITY_TO_GAME(vehicle_wraithlord_weapon);
132.2155 +LINK_ENTITY_TO_GAME(victim_scientist);
132.2156 +LINK_ENTITY_TO_GAME(vipescape);
132.2157 +LINK_ENTITY_TO_GAME(vote_llama);
132.2158 +LINK_ENTITY_TO_GAME(vscrossbow_bolt);
132.2159 +LINK_ENTITY_TO_GAME(watcher);
132.2160 +LINK_ENTITY_TO_GAME(weapmortar);
132.2161 +LINK_ENTITY_TO_GAME(weapon_1100);
132.2162 +LINK_ENTITY_TO_GAME(weapon_1911);
132.2163 +LINK_ENTITY_TO_GAME(weapon_30cal);
132.2164 +LINK_ENTITY_TO_GAME(weapon_357);
132.2165 +LINK_ENTITY_TO_GAME(weapon_40gl);
132.2166 +LINK_ENTITY_TO_GAME(weapon_50cal);
132.2167 +LINK_ENTITY_TO_GAME(weapon_90mm);
132.2168 +LINK_ENTITY_TO_GAME(weapon_92d);
132.2169 +LINK_ENTITY_TO_GAME(weapon_9mmAR);
132.2170 +LINK_ENTITY_TO_GAME(weapon_9mmhandgun);
132.2171 +LINK_ENTITY_TO_GAME(weapon_9mmm41a);
132.2172 +LINK_ENTITY_TO_GAME(weapon_BrownBess);
132.2173 +LINK_ENTITY_TO_GAME(weapon_Charleville);
132.2174 +LINK_ENTITY_TO_GAME(weapon_FT);
132.2175 +LINK_ENTITY_TO_GAME(weapon_G11);
132.2176 +LINK_ENTITY_TO_GAME(weapon_Knife);
132.2177 +LINK_ENTITY_TO_GAME(weapon_Pennsylvania);
132.2178 +LINK_ENTITY_TO_GAME(weapon_PistolA);
132.2179 +LINK_ENTITY_TO_GAME(weapon_PistolB);
132.2180 +LINK_ENTITY_TO_GAME(weapon_Revolutionnaire);
132.2181 +LINK_ENTITY_TO_GAME(weapon_SPchemicalgun);
132.2182 +LINK_ENTITY_TO_GAME(weapon_Sabre);
132.2183 +LINK_ENTITY_TO_GAME(weapon_aandagger);
132.2184 +LINK_ENTITY_TO_GAME(weapon_acannon);
132.2185 +LINK_ENTITY_TO_GAME(weapon_acidrocket);
132.2186 +LINK_ENTITY_TO_GAME(weapon_acidrocketgun);
132.2187 +LINK_ENTITY_TO_GAME(weapon_adrenaline);
132.2188 +LINK_ENTITY_TO_GAME(weapon_aicore);
132.2189 +LINK_ENTITY_TO_GAME(weapon_air_strike);
132.2190 +LINK_ENTITY_TO_GAME(weapon_ak);
132.2191 +LINK_ENTITY_TO_GAME(weapon_ak101);
132.2192 +LINK_ENTITY_TO_GAME(weapon_ak47);
132.2193 +LINK_ENTITY_TO_GAME(weapon_ak5);
132.2194 +LINK_ENTITY_TO_GAME(weapon_ak5s);
132.2195 +LINK_ENTITY_TO_GAME(weapon_ak74);
132.2196 +LINK_ENTITY_TO_GAME(weapon_akimbo_glocks);
132.2197 +LINK_ENTITY_TO_GAME(weapon_akimbob);
132.2198 +LINK_ENTITY_TO_GAME(weapon_akimboberettas);
132.2199 +LINK_ENTITY_TO_GAME(weapon_akimbocolts);
132.2200 +LINK_ENTITY_TO_GAME(weapon_akimbodeagles);
132.2201 +LINK_ENTITY_TO_GAME(weapon_akimbosawedoffs);
132.2202 +LINK_ENTITY_TO_GAME(weapon_akimcolt);
132.2203 +LINK_ENTITY_TO_GAME(weapon_akimsaa);
132.2204 +LINK_ENTITY_TO_GAME(weapon_alarm);
132.2205 +LINK_ENTITY_TO_GAME(weapon_aliencannon);
132.2206 +LINK_ENTITY_TO_GAME(weapon_amerknife);
132.2207 +LINK_ENTITY_TO_GAME(weapon_amp);
132.2208 +LINK_ENTITY_TO_GAME(weapon_anaconda);
132.2209 +LINK_ENTITY_TO_GAME(weapon_angel);
132.2210 +LINK_ENTITY_TO_GAME(weapon_ar10);
132.2211 +LINK_ENTITY_TO_GAME(weapon_ar33);
132.2212 +LINK_ENTITY_TO_GAME(weapon_aug);
132.2213 +LINK_ENTITY_TO_GAME(weapon_autococker);
132.2214 +LINK_ENTITY_TO_GAME(weapon_autogl);
132.2215 +LINK_ENTITY_TO_GAME(weapon_automag);
132.2216 +LINK_ENTITY_TO_GAME(weapon_awm);
132.2217 +LINK_ENTITY_TO_GAME(weapon_awp);
132.2218 +LINK_ENTITY_TO_GAME(weapon_axe);
132.2219 +LINK_ENTITY_TO_GAME(weapon_b93r);
132.2220 +LINK_ENTITY_TO_GAME(weapon_babblergun);
132.2221 +LINK_ENTITY_TO_GAME(weapon_babblerprojectile);
132.2222 +LINK_ENTITY_TO_GAME(weapon_balllightningspell);
132.2223 +LINK_ENTITY_TO_GAME(weapon_banana);
132.2224 +LINK_ENTITY_TO_GAME(weapon_banane);
132.2225 +LINK_ENTITY_TO_GAME(weapon_bandage);
132.2226 +LINK_ENTITY_TO_GAME(weapon_bang);
132.2227 +LINK_ENTITY_TO_GAME(weapon_bar);
132.2228 +LINK_ENTITY_TO_GAME(weapon_baretta);
132.2229 +LINK_ENTITY_TO_GAME(weapon_barnacle);
132.2230 +LINK_ENTITY_TO_GAME(weapon_barney9mmar);
132.2231 +LINK_ENTITY_TO_GAME(weapon_barney9mmhg);
132.2232 +LINK_ENTITY_TO_GAME(weapon_barneyhandgrenade);
132.2233 +LINK_ENTITY_TO_GAME(weapon_barneyshotgun);
132.2234 +LINK_ENTITY_TO_GAME(weapon_baseballbat);
132.2235 +LINK_ENTITY_TO_GAME(weapon_bat);
132.2236 +LINK_ENTITY_TO_GAME(weapon_baton);
132.2237 +LINK_ENTITY_TO_GAME(weapon_batsup);
132.2238 +LINK_ENTITY_TO_GAME(weapon_batte);
132.2239 +LINK_ENTITY_TO_GAME(weapon_battleaxe);
132.2240 +LINK_ENTITY_TO_GAME(weapon_bayonet);
132.2241 +LINK_ENTITY_TO_GAME(weapon_bazooka);
132.2242 +LINK_ENTITY_TO_GAME(weapon_beamgun);
132.2243 +LINK_ENTITY_TO_GAME(weapon_beanstalkspell);
132.2244 +LINK_ENTITY_TO_GAME(weapon_bearbite);
132.2245 +LINK_ENTITY_TO_GAME(weapon_bearclaw);
132.2246 +LINK_ENTITY_TO_GAME(weapon_beartrap);
132.2247 +LINK_ENTITY_TO_GAME(weapon_benelli);
132.2248 +LINK_ENTITY_TO_GAME(weapon_ber92f);
132.2249 +LINK_ENTITY_TO_GAME(weapon_ber93r);
132.2250 +LINK_ENTITY_TO_GAME(weapon_beretta);
132.2251 +LINK_ENTITY_TO_GAME(weapon_beretta_a);
132.2252 +LINK_ENTITY_TO_GAME(weapon_bigbang);
132.2253 +LINK_ENTITY_TO_GAME(weapon_biggun);
132.2254 +LINK_ENTITY_TO_GAME(weapon_bilebomb);
132.2255 +LINK_ENTITY_TO_GAME(weapon_bilebombgun);
132.2256 +LINK_ENTITY_TO_GAME(weapon_binoculars);
132.2257 +LINK_ENTITY_TO_GAME(weapon_binos);
132.2258 +LINK_ENTITY_TO_GAME(weapon_birdspell);
132.2259 +LINK_ENTITY_TO_GAME(weapon_bite2gun);
132.2260 +LINK_ENTITY_TO_GAME(weapon_bitegun);
132.2261 +LINK_ENTITY_TO_GAME(weapon_bizon);
132.2262 +LINK_ENTITY_TO_GAME(weapon_blaster);
132.2263 +LINK_ENTITY_TO_GAME(weapon_blink);
132.2264 +LINK_ENTITY_TO_GAME(weapon_blowpipe);
132.2265 +LINK_ENTITY_TO_GAME(weapon_bola);
132.2266 +LINK_ENTITY_TO_GAME(weapon_boltrifle);
132.2267 +LINK_ENTITY_TO_GAME(weapon_bomb);
132.2268 +LINK_ENTITY_TO_GAME(weapon_bomber);
132.2269 +LINK_ENTITY_TO_GAME(weapon_bow);
132.2270 +LINK_ENTITY_TO_GAME(weapon_bren);
132.2271 +LINK_ENTITY_TO_GAME(weapon_brickcannon);
132.2272 +LINK_ENTITY_TO_GAME(weapon_briefcase);
132.2273 +LINK_ENTITY_TO_GAME(weapon_bsword);
132.2274 +LINK_ENTITY_TO_GAME(weapon_buffalo);
132.2275 +LINK_ENTITY_TO_GAME(weapon_burningattack);
132.2276 +LINK_ENTITY_TO_GAME(weapon_bush);
132.2277 +LINK_ENTITY_TO_GAME(weapon_bushmaster);
132.2278 +LINK_ENTITY_TO_GAME(weapon_c4);
132.2279 +LINK_ENTITY_TO_GAME(weapon_cal50);
132.2280 +LINK_ENTITY_TO_GAME(weapon_camera);
132.2281 +LINK_ENTITY_TO_GAME(weapon_candy);
132.2282 +LINK_ENTITY_TO_GAME(weapon_cannon);
132.2283 +LINK_ENTITY_TO_GAME(weapon_case);
132.2284 +LINK_ENTITY_TO_GAME(weapon_cat);
132.2285 +LINK_ENTITY_TO_GAME(weapon_cattleprod);
132.2286 +LINK_ENTITY_TO_GAME(weapon_caws);
132.2287 +LINK_ENTITY_TO_GAME(weapon_ce_lasgun);
132.2288 +LINK_ENTITY_TO_GAME(weapon_ce_powersword);
132.2289 +LINK_ENTITY_TO_GAME(weapon_ce_psistaff);
132.2290 +LINK_ENTITY_TO_GAME(weapon_ce_rocketlauncher);
132.2291 +LINK_ENTITY_TO_GAME(weapon_ce_shurikencatapult);
132.2292 +LINK_ENTITY_TO_GAME(weapon_ce_shurikenpistol);
132.2293 +LINK_ENTITY_TO_GAME(weapon_cellphone);
132.2294 +LINK_ENTITY_TO_GAME(weapon_chaingun);
132.2295 +LINK_ENTITY_TO_GAME(weapon_chainsaw);
132.2296 +LINK_ENTITY_TO_GAME(weapon_charge);
132.2297 +LINK_ENTITY_TO_GAME(weapon_charged);
132.2298 +LINK_ENTITY_TO_GAME(weapon_claw);
132.2299 +LINK_ENTITY_TO_GAME(weapon_claws);
132.2300 +LINK_ENTITY_TO_GAME(weapon_claymore);
132.2301 +LINK_ENTITY_TO_GAME(weapon_clip_generic);
132.2302 +LINK_ENTITY_TO_GAME(weapon_cloak);
132.2303 +LINK_ENTITY_TO_GAME(weapon_cloaker);
132.2304 +LINK_ENTITY_TO_GAME(weapon_cluster);
132.2305 +LINK_ENTITY_TO_GAME(weapon_cm_autocannon);
132.2306 +LINK_ENTITY_TO_GAME(weapon_cm_bolter);
132.2307 +LINK_ENTITY_TO_GAME(weapon_cm_bolterflamer);
132.2308 +LINK_ENTITY_TO_GAME(weapon_cm_boltpistol);
132.2309 +LINK_ENTITY_TO_GAME(weapon_cm_chainaxe);
132.2310 +LINK_ENTITY_TO_GAME(weapon_cm_chainsword);
132.2311 +LINK_ENTITY_TO_GAME(weapon_cm_flamer);
132.2312 +LINK_ENTITY_TO_GAME(weapon_cm_fraggrenade);
132.2313 +LINK_ENTITY_TO_GAME(weapon_cm_heavybolter);
132.2314 +LINK_ENTITY_TO_GAME(weapon_cm_lascannon);
132.2315 +LINK_ENTITY_TO_GAME(weapon_cm_missilelauncher);
132.2316 +LINK_ENTITY_TO_GAME(weapon_cm_stormbolter);
132.2317 +LINK_ENTITY_TO_GAME(weapon_cocker);
132.2318 +LINK_ENTITY_TO_GAME(weapon_cocogrenade);
132.2319 +LINK_ENTITY_TO_GAME(weapon_cocolauncher);
132.2320 +LINK_ENTITY_TO_GAME(weapon_colt);
132.2321 +LINK_ENTITY_TO_GAME(weapon_colt45);
132.2322 +LINK_ENTITY_TO_GAME(weapon_coltgov);
132.2323 +LINK_ENTITY_TO_GAME(weapon_colts);
132.2324 +LINK_ENTITY_TO_GAME(weapon_combatknife);
132.2325 +LINK_ENTITY_TO_GAME(weapon_combospell);
132.2326 +LINK_ENTITY_TO_GAME(weapon_cometspell);
132.2327 +LINK_ENTITY_TO_GAME(weapon_concussion);
132.2328 +LINK_ENTITY_TO_GAME(weapon_controlled);
132.2329 +LINK_ENTITY_TO_GAME(weapon_cougar);
132.2330 +LINK_ENTITY_TO_GAME(weapon_coujaf);
132.2331 +LINK_ENTITY_TO_GAME(weapon_couteau);
132.2332 +LINK_ENTITY_TO_GAME(weapon_croix);
132.2333 +LINK_ENTITY_TO_GAME(weapon_crossbow);
132.2334 +LINK_ENTITY_TO_GAME(weapon_crowbar);
132.2335 +LINK_ENTITY_TO_GAME(weapon_d5k);
132.2336 +LINK_ENTITY_TO_GAME(weapon_daystick);
132.2337 +LINK_ENTITY_TO_GAME(weapon_dblpistolet);
132.2338 +LINK_ENTITY_TO_GAME(weapon_dblshot);
132.2339 +LINK_ENTITY_TO_GAME(weapon_dbshot);
132.2340 +LINK_ENTITY_TO_GAME(weapon_dd44);
132.2341 +LINK_ENTITY_TO_GAME(weapon_de50);
132.2342 +LINK_ENTITY_TO_GAME(weapon_deagle);
132.2343 +LINK_ENTITY_TO_GAME(weapon_deathball);
132.2344 +LINK_ENTITY_TO_GAME(weapon_deathrayspell);
132.2345 +LINK_ENTITY_TO_GAME(weapon_deploygun);
132.2346 +LINK_ENTITY_TO_GAME(weapon_desert);
132.2347 +LINK_ENTITY_TO_GAME(weapon_deserteagle);
132.2348 +LINK_ENTITY_TO_GAME(weapon_destructodisc);
132.2349 +LINK_ENTITY_TO_GAME(weapon_devastator);
132.2350 +LINK_ENTITY_TO_GAME(weapon_devour);
132.2351 +LINK_ENTITY_TO_GAME(weapon_disc);
132.2352 +LINK_ENTITY_TO_GAME(weapon_disclauncher);
132.2353 +LINK_ENTITY_TO_GAME(weapon_discoballs);
132.2354 +LINK_ENTITY_TO_GAME(weapon_disintegrator);
132.2355 +LINK_ENTITY_TO_GAME(weapon_displacer);
132.2356 +LINK_ENTITY_TO_GAME(weapon_divinewind);
132.2357 +LINK_ENTITY_TO_GAME(weapon_dml);
132.2358 +LINK_ENTITY_TO_GAME(weapon_double);
132.2359 +LINK_ENTITY_TO_GAME(weapon_doublemagicmisslespell);
132.2360 +LINK_ENTITY_TO_GAME(weapon_doubleshotgun);
132.2361 +LINK_ENTITY_TO_GAME(weapon_dragonball);
132.2362 +LINK_ENTITY_TO_GAME(weapon_dragonbreathspell);
132.2363 +LINK_ENTITY_TO_GAME(weapon_dragonspell);
132.2364 +LINK_ENTITY_TO_GAME(weapon_dragunov);
132.2365 +LINK_ENTITY_TO_GAME(weapon_dsr1);
132.2366 +LINK_ENTITY_TO_GAME(weapon_dualberettas);
132.2367 +LINK_ENTITY_TO_GAME(weapon_dualscorpion);
132.2368 +LINK_ENTITY_TO_GAME(weapon_dummy);
132.2369 +LINK_ENTITY_TO_GAME(weapon_dynamite);
132.2370 +LINK_ENTITY_TO_GAME(weapon_dynomite);
132.2371 +LINK_ENTITY_TO_GAME(weapon_eagle);
132.2372 +LINK_ENTITY_TO_GAME(weapon_eballblaster);
132.2373 +LINK_ENTITY_TO_GAME(weapon_egon);
132.2374 +LINK_ENTITY_TO_GAME(weapon_el_standard);
132.2375 +LINK_ENTITY_TO_GAME(weapon_electro);
132.2376 +LINK_ENTITY_TO_GAME(weapon_elite);
132.2377 +LINK_ENTITY_TO_GAME(weapon_emsniper);
132.2378 +LINK_ENTITY_TO_GAME(weapon_enfield);
132.2379 +LINK_ENTITY_TO_GAME(weapon_excal);
132.2380 +LINK_ENTITY_TO_GAME(weapon_experimental);
132.2381 +LINK_ENTITY_TO_GAME(weapon_expgrenade);
132.2382 +LINK_ENTITY_TO_GAME(weapon_exploder);
132.2383 +LINK_ENTITY_TO_GAME(weapon_explogun);
132.2384 +LINK_ENTITY_TO_GAME(weapon_eyelaser);
132.2385 +LINK_ENTITY_TO_GAME(weapon_famas);
132.2386 +LINK_ENTITY_TO_GAME(weapon_fev);
132.2387 +LINK_ENTITY_TO_GAME(weapon_fg42);
132.2388 +LINK_ENTITY_TO_GAME(weapon_finalflash);
132.2389 +LINK_ENTITY_TO_GAME(weapon_fingerlaser);
132.2390 +LINK_ENTITY_TO_GAME(weapon_finishingbuster);
132.2391 +LINK_ENTITY_TO_GAME(weapon_fireballspell);
132.2392 +LINK_ENTITY_TO_GAME(weapon_fishingrod);
132.2393 +LINK_ENTITY_TO_GAME(weapon_fist);
132.2394 +LINK_ENTITY_TO_GAME(weapon_fists);
132.2395 +LINK_ENTITY_TO_GAME(weapon_fiveseven);
132.2396 +LINK_ENTITY_TO_GAME(weapon_flakcannon);
132.2397 +LINK_ENTITY_TO_GAME(weapon_flame);
132.2398 +LINK_ENTITY_TO_GAME(weapon_flamegrenade);
132.2399 +LINK_ENTITY_TO_GAME(weapon_flamegun);
132.2400 +LINK_ENTITY_TO_GAME(weapon_flamelickspell);
132.2401 +LINK_ENTITY_TO_GAME(weapon_flamer);
132.2402 +LINK_ENTITY_TO_GAME(weapon_flamethrower);
132.2403 +LINK_ENTITY_TO_GAME(weapon_flaregun);
132.2404 +LINK_ENTITY_TO_GAME(weapon_flarepistol);
132.2405 +LINK_ENTITY_TO_GAME(weapon_flashbang);
132.2406 +LINK_ENTITY_TO_GAME(weapon_fleshgrenade);
132.2407 +LINK_ENTITY_TO_GAME(weapon_flute);
132.2408 +LINK_ENTITY_TO_GAME(weapon_fnfal);
132.2409 +LINK_ENTITY_TO_GAME(weapon_forcespell);
132.2410 +LINK_ENTITY_TO_GAME(weapon_frag);
132.2411 +LINK_ENTITY_TO_GAME(weapon_fraggrenade);
132.2412 +LINK_ENTITY_TO_GAME(weapon_freeze);
132.2413 +LINK_ENTITY_TO_GAME(weapon_freezer);
132.2414 +LINK_ENTITY_TO_GAME(weapon_freezerayspell);
132.2415 +LINK_ENTITY_TO_GAME(weapon_friezadisc);
132.2416 +LINK_ENTITY_TO_GAME(weapon_fusil);
132.2417 +LINK_ENTITY_TO_GAME(weapon_g11);
132.2418 +LINK_ENTITY_TO_GAME(weapon_g36);
132.2419 +LINK_ENTITY_TO_GAME(weapon_g36c);
132.2420 +LINK_ENTITY_TO_GAME(weapon_g36cs);
132.2421 +LINK_ENTITY_TO_GAME(weapon_g36e);
132.2422 +LINK_ENTITY_TO_GAME(weapon_g36k);
132.2423 +LINK_ENTITY_TO_GAME(weapon_g3a3);
132.2424 +LINK_ENTITY_TO_GAME(weapon_g3sg1);
132.2425 +LINK_ENTITY_TO_GAME(weapon_ga2uss);
132.2426 +LINK_ENTITY_TO_GAME(weapon_gacgoa);
132.2427 +LINK_ENTITY_TO_GAME(weapon_galil);
132.2428 +LINK_ENTITY_TO_GAME(weapon_gallitgun);
132.2429 +LINK_ENTITY_TO_GAME(weapon_garand);
132.2430 +LINK_ENTITY_TO_GAME(weapon_gasgrenade);
132.2431 +LINK_ENTITY_TO_GAME(weapon_gatlin);
132.2432 +LINK_ENTITY_TO_GAME(weapon_gatling);
132.2433 +LINK_ENTITY_TO_GAME(weapon_gattlinggun);
132.2434 +LINK_ENTITY_TO_GAME(weapon_gauss);
132.2435 +LINK_ENTITY_TO_GAME(weapon_gausspistol);
132.2436 +LINK_ENTITY_TO_GAME(weapon_generic);
132.2437 +LINK_ENTITY_TO_GAME(weapon_genericbeam);
132.2438 +LINK_ENTITY_TO_GAME(weapon_gerknife);
132.2439 +LINK_ENTITY_TO_GAME(weapon_germanknife);
132.2440 +LINK_ENTITY_TO_GAME(weapon_gewehr);
132.2441 +LINK_ENTITY_TO_GAME(weapon_giantplantspell);
132.2442 +LINK_ENTITY_TO_GAME(weapon_glauncher);
132.2443 +LINK_ENTITY_TO_GAME(weapon_glock);
132.2444 +LINK_ENTITY_TO_GAME(weapon_glock17);
132.2445 +LINK_ENTITY_TO_GAME(weapon_glock18);
132.2446 +LINK_ENTITY_TO_GAME(weapon_glock_auto);
132.2447 +LINK_ENTITY_TO_GAME(weapon_glock_auto_a);
132.2448 +LINK_ENTITY_TO_GAME(weapon_goldpp7);
132.2449 +LINK_ENTITY_TO_GAME(weapon_gps);
132.2450 +LINK_ENTITY_TO_GAME(weapon_grappin);
132.2451 +LINK_ENTITY_TO_GAME(weapon_grapple);
132.2452 +LINK_ENTITY_TO_GAME(weapon_grease);
132.2453 +LINK_ENTITY_TO_GAME(weapon_greasegun);
132.2454 +LINK_ENTITY_TO_GAME(weapon_gren);
132.2455 +LINK_ENTITY_TO_GAME(weapon_grenade);
132.2456 +LINK_ENTITY_TO_GAME(weapon_grenadegun);
132.2457 +LINK_ENTITY_TO_GAME(weapon_grenadelauncher);
132.2458 +LINK_ENTITY_TO_GAME(weapon_guardian);
132.2459 +LINK_ENTITY_TO_GAME(weapon_hache);
132.2460 +LINK_ENTITY_TO_GAME(weapon_hammer);
132.2461 +LINK_ENTITY_TO_GAME(weapon_handcannon);
132.2462 +LINK_ENTITY_TO_GAME(weapon_handgrenade);
132.2463 +LINK_ENTITY_TO_GAME(weapon_handgrenade_ex);
132.2464 +LINK_ENTITY_TO_GAME(weapon_harpoongun);
132.2465 +LINK_ENTITY_TO_GAME(weapon_he);
132.2466 +LINK_ENTITY_TO_GAME(weapon_healingspray);
132.2467 +LINK_ENTITY_TO_GAME(weapon_heavymachinegun);
132.2468 +LINK_ENTITY_TO_GAME(weapon_hegrenade);
132.2469 +LINK_ENTITY_TO_GAME(weapon_helico);
132.2470 +LINK_ENTITY_TO_GAME(weapon_hk21);
132.2471 +LINK_ENTITY_TO_GAME(weapon_hk33);
132.2472 +LINK_ENTITY_TO_GAME(weapon_hk33ka2);
132.2473 +LINK_ENTITY_TO_GAME(weapon_hkmp5);
132.2474 +LINK_ENTITY_TO_GAME(weapon_holybsword);
132.2475 +LINK_ENTITY_TO_GAME(weapon_horar1);
132.2476 +LINK_ENTITY_TO_GAME(weapon_horar2);
132.2477 +LINK_ENTITY_TO_GAME(weapon_horg1);
132.2478 +LINK_ENTITY_TO_GAME(weapon_horg2);
132.2479 +LINK_ENTITY_TO_GAME(weapon_hormg1);
132.2480 +LINK_ENTITY_TO_GAME(weapon_hormg2);
132.2481 +LINK_ENTITY_TO_GAME(weapon_hornetgun);
132.2482 +LINK_ENTITY_TO_GAME(weapon_hyperblaster);
132.2483 +LINK_ENTITY_TO_GAME(weapon_icepokespell);
132.2484 +LINK_ENTITY_TO_GAME(weapon_infector);
132.2485 +LINK_ENTITY_TO_GAME(weapon_invis);
132.2486 +LINK_ENTITY_TO_GAME(weapon_islavezap);
132.2487 +LINK_ENTITY_TO_GAME(weapon_ithaca);
132.2488 +LINK_ENTITY_TO_GAME(weapon_jackhammer);
132.2489 +LINK_ENTITY_TO_GAME(weapon_jetfist);
132.2490 +LINK_ENTITY_TO_GAME(weapon_jetpack);
132.2491 +LINK_ENTITY_TO_GAME(weapon_jumpjet);
132.2492 +LINK_ENTITY_TO_GAME(weapon_k43);
132.2493 +LINK_ENTITY_TO_GAME(weapon_kameha);
132.2494 +LINK_ENTITY_TO_GAME(weapon_kamehameha);
132.2495 +LINK_ENTITY_TO_GAME(weapon_kametorpedo);
132.2496 +LINK_ENTITY_TO_GAME(weapon_kamikaze);
132.2497 +LINK_ENTITY_TO_GAME(weapon_kar);
132.2498 +LINK_ENTITY_TO_GAME(weapon_katana);
132.2499 +LINK_ENTITY_TO_GAME(weapon_kawauso);
132.2500 +LINK_ENTITY_TO_GAME(weapon_kbar);
132.2501 +LINK_ENTITY_TO_GAME(weapon_kf7);
132.2502 +LINK_ENTITY_TO_GAME(weapon_kiblast);
132.2503 +LINK_ENTITY_TO_GAME(weapon_killsaw);
132.2504 +LINK_ENTITY_TO_GAME(weapon_kmedkit);
132.2505 +LINK_ENTITY_TO_GAME(weapon_knife);
132.2506 +LINK_ENTITY_TO_GAME(weapon_lance);
132.2507 +LINK_ENTITY_TO_GAME(weapon_lanceflamme);
132.2508 +LINK_ENTITY_TO_GAME(weapon_larve);
132.2509 +LINK_ENTITY_TO_GAME(weapon_laser);
132.2510 +LINK_ENTITY_TO_GAME(weapon_laser_rifle);
132.2511 +LINK_ENTITY_TO_GAME(weapon_lasergatling);
132.2512 +LINK_ENTITY_TO_GAME(weapon_launcher);
132.2513 +LINK_ENTITY_TO_GAME(weapon_law);
132.2514 +LINK_ENTITY_TO_GAME(weapon_lawgiver);
132.2515 +LINK_ENTITY_TO_GAME(weapon_lawrod);
132.2516 +LINK_ENTITY_TO_GAME(weapon_leap);
132.2517 +LINK_ENTITY_TO_GAME(weapon_levitationspell);
132.2518 +LINK_ENTITY_TO_GAME(weapon_lflamme);
132.2519 +LINK_ENTITY_TO_GAME(weapon_lgrenades);
132.2520 +LINK_ENTITY_TO_GAME(weapon_lightning);
132.2521 +LINK_ENTITY_TO_GAME(weapon_lightningboltspell);
132.2522 +LINK_ENTITY_TO_GAME(weapon_lightningcloudspell);
132.2523 +LINK_ENTITY_TO_GAME(weapon_lightsabre);
132.2524 +LINK_ENTITY_TO_GAME(weapon_lngun);
132.2525 +LINK_ENTITY_TO_GAME(weapon_longslide);
132.2526 +LINK_ENTITY_TO_GAME(weapon_longsword);
132.2527 +LINK_ENTITY_TO_GAME(weapon_lr300);
132.2528 +LINK_ENTITY_TO_GAME(weapon_lr300s);
132.2529 +LINK_ENTITY_TO_GAME(weapon_lrifle);
132.2530 +LINK_ENTITY_TO_GAME(weapon_luger);
132.2531 +LINK_ENTITY_TO_GAME(weapon_m11);
132.2532 +LINK_ENTITY_TO_GAME(weapon_m134);
132.2533 +LINK_ENTITY_TO_GAME(weapon_m14);
132.2534 +LINK_ENTITY_TO_GAME(weapon_m16);
132.2535 +LINK_ENTITY_TO_GAME(weapon_m16a2);
132.2536 +LINK_ENTITY_TO_GAME(weapon_m1carbine);
132.2537 +LINK_ENTITY_TO_GAME(weapon_m2);
132.2538 +LINK_ENTITY_TO_GAME(weapon_m21);
132.2539 +LINK_ENTITY_TO_GAME(weapon_m249);
132.2540 +LINK_ENTITY_TO_GAME(weapon_m3);
132.2541 +LINK_ENTITY_TO_GAME(weapon_m4);
132.2542 +LINK_ENTITY_TO_GAME(weapon_m40a1);
132.2543 +LINK_ENTITY_TO_GAME(weapon_m41);
132.2544 +LINK_ENTITY_TO_GAME(weapon_m4a1);
132.2545 +LINK_ENTITY_TO_GAME(weapon_m60);
132.2546 +LINK_ENTITY_TO_GAME(weapon_m72);
132.2547 +LINK_ENTITY_TO_GAME(weapon_m79);
132.2548 +LINK_ENTITY_TO_GAME(weapon_m82);
132.2549 +LINK_ENTITY_TO_GAME(weapon_m86);
132.2550 +LINK_ENTITY_TO_GAME(weapon_m92s);
132.2551 +LINK_ENTITY_TO_GAME(weapon_m96);
132.2552 +LINK_ENTITY_TO_GAME(weapon_m98);
132.2553 +LINK_ENTITY_TO_GAME(weapon_mac);
132.2554 +LINK_ENTITY_TO_GAME(weapon_mac10);
132.2555 +LINK_ENTITY_TO_GAME(weapon_machete);
132.2556 +LINK_ENTITY_TO_GAME(weapon_machinegun);
132.2557 +LINK_ENTITY_TO_GAME(weapon_mag);
132.2558 +LINK_ENTITY_TO_GAME(weapon_magicmisslespell);
132.2559 +LINK_ENTITY_TO_GAME(weapon_main);
132.2560 +LINK_ENTITY_TO_GAME(weapon_masenko);
132.2561 +LINK_ENTITY_TO_GAME(weapon_mat49);
132.2562 +LINK_ENTITY_TO_GAME(weapon_match);
132.2563 +LINK_ENTITY_TO_GAME(weapon_maverick);
132.2564 +LINK_ENTITY_TO_GAME(weapon_mc51);
132.2565 +LINK_ENTITY_TO_GAME(weapon_medkit);
132.2566 +LINK_ENTITY_TO_GAME(weapon_melee);
132.2567 +LINK_ENTITY_TO_GAME(weapon_metabolize);
132.2568 +LINK_ENTITY_TO_GAME(weapon_meteorspell);
132.2569 +LINK_ENTITY_TO_GAME(weapon_mf2);
132.2570 +LINK_ENTITY_TO_GAME(weapon_mg34);
132.2571 +LINK_ENTITY_TO_GAME(weapon_mg36);
132.2572 +LINK_ENTITY_TO_GAME(weapon_mg42);
132.2573 +LINK_ENTITY_TO_GAME(weapon_microuzi);
132.2574 +LINK_ENTITY_TO_GAME(weapon_microuzi_a);
132.2575 +LINK_ENTITY_TO_GAME(weapon_mindmisslespell);
132.2576 +LINK_ENTITY_TO_GAME(weapon_mindray);
132.2577 +LINK_ENTITY_TO_GAME(weapon_mine);
132.2578 +LINK_ENTITY_TO_GAME(weapon_minicanon);
132.2579 +LINK_ENTITY_TO_GAME(weapon_minigun);
132.2580 +LINK_ENTITY_TO_GAME(weapon_mk23);
132.2581 +LINK_ENTITY_TO_GAME(weapon_model98);
132.2582 +LINK_ENTITY_TO_GAME(weapon_molotov);
132.2583 +LINK_ENTITY_TO_GAME(weapon_mop);
132.2584 +LINK_ENTITY_TO_GAME(weapon_mortar);
132.2585 +LINK_ENTITY_TO_GAME(weapon_mortier);
132.2586 +LINK_ENTITY_TO_GAME(weapon_morve);
132.2587 +LINK_ENTITY_TO_GAME(weapon_mosin);
132.2588 +LINK_ENTITY_TO_GAME(weapon_mossberg);
132.2589 +LINK_ENTITY_TO_GAME(weapon_mouthblast);
132.2590 +LINK_ENTITY_TO_GAME(weapon_mouton);
132.2591 +LINK_ENTITY_TO_GAME(weapon_mp40);
132.2592 +LINK_ENTITY_TO_GAME(weapon_mp44);
132.2593 +LINK_ENTITY_TO_GAME(weapon_mp5);
132.2594 +LINK_ENTITY_TO_GAME(weapon_mp510);
132.2595 +LINK_ENTITY_TO_GAME(weapon_mp5a2);
132.2596 +LINK_ENTITY_TO_GAME(weapon_mp5a4);
132.2597 +LINK_ENTITY_TO_GAME(weapon_mp5a5);
132.2598 +LINK_ENTITY_TO_GAME(weapon_mp5k);
132.2599 +LINK_ENTITY_TO_GAME(weapon_mp5ktac);
132.2600 +LINK_ENTITY_TO_GAME(weapon_mp5navy);
132.2601 +LINK_ENTITY_TO_GAME(weapon_mp5pdw);
132.2602 +LINK_ENTITY_TO_GAME(weapon_mp5sd);
132.2603 +LINK_ENTITY_TO_GAME(weapon_msg90);
132.2604 +LINK_ENTITY_TO_GAME(weapon_musket);
132.2605 +LINK_ENTITY_TO_GAME(weapon_mwgun);
132.2606 +LINK_ENTITY_TO_GAME(weapon_nailgun);
132.2607 +LINK_ENTITY_TO_GAME(weapon_napalm);
132.2608 +LINK_ENTITY_TO_GAME(weapon_ndagger);
132.2609 +LINK_ENTITY_TO_GAME(weapon_needle);
132.2610 +LINK_ENTITY_TO_GAME(weapon_ngun);
132.2611 +LINK_ENTITY_TO_GAME(weapon_nightstick);
132.2612 +LINK_ENTITY_TO_GAME(weapon_not_in_use_grenade);
132.2613 +LINK_ENTITY_TO_GAME(weapon_nukegun);
132.2614 +LINK_ENTITY_TO_GAME(weapon_nuker);
132.2615 +LINK_ENTITY_TO_GAME(weapon_null);
132.2616 +LINK_ENTITY_TO_GAME(weapon_nva_grenade);
132.2617 +LINK_ENTITY_TO_GAME(weapon_oicw);
132.2618 +LINK_ENTITY_TO_GAME(weapon_orbital);
132.2619 +LINK_ENTITY_TO_GAME(weapon_p225);
132.2620 +LINK_ENTITY_TO_GAME(weapon_p226);
132.2621 +LINK_ENTITY_TO_GAME(weapon_p226mp);
132.2622 +LINK_ENTITY_TO_GAME(weapon_p228);
132.2623 +LINK_ENTITY_TO_GAME(weapon_p90);
132.2624 +LINK_ENTITY_TO_GAME(weapon_p99);
132.2625 +LINK_ENTITY_TO_GAME(weapon_paintball);
132.2626 +LINK_ENTITY_TO_GAME(weapon_paintgrenade);
132.2627 +LINK_ENTITY_TO_GAME(weapon_paralysis);
132.2628 +LINK_ENTITY_TO_GAME(weapon_parasite);
132.2629 +LINK_ENTITY_TO_GAME(weapon_pdw);
132.2630 +LINK_ENTITY_TO_GAME(weapon_penguin);
132.2631 +LINK_ENTITY_TO_GAME(weapon_pgp);
132.2632 +LINK_ENTITY_TO_GAME(weapon_phantom);
132.2633 +LINK_ENTITY_TO_GAME(weapon_phoenix);
132.2634 +LINK_ENTITY_TO_GAME(weapon_piat);
132.2635 +LINK_ENTITY_TO_GAME(weapon_pick);
132.2636 +LINK_ENTITY_TO_GAME(weapon_pigeon);
132.2637 +LINK_ENTITY_TO_GAME(weapon_pipebomb);
132.2638 +LINK_ENTITY_TO_GAME(weapon_pipewrench);
132.2639 +LINK_ENTITY_TO_GAME(weapon_pistol);
132.2640 +LINK_ENTITY_TO_GAME(weapon_pistolet);
132.2641 +LINK_ENTITY_TO_GAME(weapon_pkm);
132.2642 +LINK_ENTITY_TO_GAME(weapon_plasma);
132.2643 +LINK_ENTITY_TO_GAME(weapon_plauncher);
132.2644 +LINK_ENTITY_TO_GAME(weapon_pmine);
132.2645 +LINK_ENTITY_TO_GAME(weapon_poison);
132.2646 +LINK_ENTITY_TO_GAME(weapon_poolstick);
132.2647 +LINK_ENTITY_TO_GAME(weapon_powerbeam);
132.2648 +LINK_ENTITY_TO_GAME(weapon_powerblade);
132.2649 +LINK_ENTITY_TO_GAME(weapon_prifle);
132.2650 +LINK_ENTITY_TO_GAME(weapon_primalscream);
132.2651 +LINK_ENTITY_TO_GAME(weapon_proximity);
132.2652 +LINK_ENTITY_TO_GAME(weapon_pschreck);
132.2653 +LINK_ENTITY_TO_GAME(weapon_psg);
132.2654 +LINK_ENTITY_TO_GAME(weapon_psg1);
132.2655 +LINK_ENTITY_TO_GAME(weapon_pt);
132.2656 +LINK_ENTITY_TO_GAME(weapon_python);
132.2657 +LINK_ENTITY_TO_GAME(weapon_quakegun);
132.2658 +LINK_ENTITY_TO_GAME(weapon_radio);
132.2659 +LINK_ENTITY_TO_GAME(weapon_railgun);
132.2660 +LINK_ENTITY_TO_GAME(weapon_rallyhp);
132.2661 +LINK_ENTITY_TO_GAME(weapon_rbull);
132.2662 +LINK_ENTITY_TO_GAME(weapon_rcp90);
132.2663 +LINK_ENTITY_TO_GAME(weapon_reetou);
132.2664 +LINK_ENTITY_TO_GAME(weapon_regeneration);
132.2665 +LINK_ENTITY_TO_GAME(weapon_remington);
132.2666 +LINK_ENTITY_TO_GAME(weapon_renzoku);
132.2667 +LINK_ENTITY_TO_GAME(weapon_rifle);
132.2668 +LINK_ENTITY_TO_GAME(weapon_rmine);
132.2669 +LINK_ENTITY_TO_GAME(weapon_rocketlauncher);
132.2670 +LINK_ENTITY_TO_GAME(weapon_rocketpistol);
132.2671 +LINK_ENTITY_TO_GAME(weapon_rollingstonespell);
132.2672 +LINK_ENTITY_TO_GAME(weapon_rpd);
132.2673 +LINK_ENTITY_TO_GAME(weapon_rpg);
132.2674 +LINK_ENTITY_TO_GAME(weapon_rpg7);
132.2675 +LINK_ENTITY_TO_GAME(weapon_rs202m2);
132.2676 +LINK_ENTITY_TO_GAME(weapon_ruche);
132.2677 +LINK_ENTITY_TO_GAME(weapon_ruger);
132.2678 +LINK_ENTITY_TO_GAME(weapon_rumgun);
132.2679 +LINK_ENTITY_TO_GAME(weapon_runner);
132.2680 +LINK_ENTITY_TO_GAME(weapon_sa80);
132.2681 +LINK_ENTITY_TO_GAME(weapon_saa);
132.2682 +LINK_ENTITY_TO_GAME(weapon_saber);
132.2683 +LINK_ENTITY_TO_GAME(weapon_sabers);
132.2684 +LINK_ENTITY_TO_GAME(weapon_saiga);
132.2685 +LINK_ENTITY_TO_GAME(weapon_sainte);
132.2686 +LINK_ENTITY_TO_GAME(weapon_sako);
132.2687 +LINK_ENTITY_TO_GAME(weapon_satchel);
132.2688 +LINK_ENTITY_TO_GAME(weapon_satelitelaser);
132.2689 +LINK_ENTITY_TO_GAME(weapon_sawedoff);
132.2690 +LINK_ENTITY_TO_GAME(weapon_sawgun);
132.2691 +LINK_ENTITY_TO_GAME(weapon_sbarrel);
132.2692 +LINK_ENTITY_TO_GAME(weapon_scatterbeam);
132.2693 +LINK_ENTITY_TO_GAME(weapon_scattergun);
132.2694 +LINK_ENTITY_TO_GAME(weapon_scattershot);
132.2695 +LINK_ENTITY_TO_GAME(weapon_scopedenfield);
132.2696 +LINK_ENTITY_TO_GAME(weapon_scopedfg42);
132.2697 +LINK_ENTITY_TO_GAME(weapon_scopedkar);
132.2698 +LINK_ENTITY_TO_GAME(weapon_scorpion);
132.2699 +LINK_ENTITY_TO_GAME(weapon_scout);
132.2700 +LINK_ENTITY_TO_GAME(weapon_seburo);
132.2701 +LINK_ENTITY_TO_GAME(weapon_sensu);
132.2702 +LINK_ENTITY_TO_GAME(weapon_sg550);
132.2703 +LINK_ENTITY_TO_GAME(weapon_sg552);
132.2704 +LINK_ENTITY_TO_GAME(weapon_sgenerator);
132.2705 +LINK_ENTITY_TO_GAME(weapon_shield);
132.2706 +LINK_ENTITY_TO_GAME(weapon_shieldattack);
132.2707 +LINK_ENTITY_TO_GAME(weapon_shieldgun);
132.2708 +LINK_ENTITY_TO_GAME(weapon_shieldspell);
132.2709 +LINK_ENTITY_TO_GAME(weapon_shocker);
132.2710 +LINK_ENTITY_TO_GAME(weapon_shocker2k);
132.2711 +LINK_ENTITY_TO_GAME(weapon_shockrifle);
132.2712 +LINK_ENTITY_TO_GAME(weapon_shockroach);
132.2713 +LINK_ENTITY_TO_GAME(weapon_shotgun);
132.2714 +LINK_ENTITY_TO_GAME(weapon_shrinker);
132.2715 +LINK_ENTITY_TO_GAME(weapon_sig);
132.2716 +LINK_ENTITY_TO_GAME(weapon_sig245);
132.2717 +LINK_ENTITY_TO_GAME(weapon_sig550);
132.2718 +LINK_ENTITY_TO_GAME(weapon_sigpro);
132.2719 +LINK_ENTITY_TO_GAME(weapon_silverpp7);
132.2720 +LINK_ENTITY_TO_GAME(weapon_sixshooter);
132.2721 +LINK_ENTITY_TO_GAME(weapon_skeletonspell);
132.2722 +LINK_ENTITY_TO_GAME(weapon_sks);
132.2723 +LINK_ENTITY_TO_GAME(weapon_skullspell);
132.2724 +LINK_ENTITY_TO_GAME(weapon_skunk);
132.2725 +LINK_ENTITY_TO_GAME(weapon_sl68);
132.2726 +LINK_ENTITY_TO_GAME(weapon_slappers);
132.2727 +LINK_ENTITY_TO_GAME(weapon_sledge);
132.2728 +LINK_ENTITY_TO_GAME(weapon_sledgehammer);
132.2729 +LINK_ENTITY_TO_GAME(weapon_sm_assaultcannon);
132.2730 +LINK_ENTITY_TO_GAME(weapon_sm_bolter);
132.2731 +LINK_ENTITY_TO_GAME(weapon_sm_boltpistol);
132.2732 +LINK_ENTITY_TO_GAME(weapon_sm_combatknife);
132.2733 +LINK_ENTITY_TO_GAME(weapon_sm_flamer);
132.2734 +LINK_ENTITY_TO_GAME(weapon_sm_fraggrenade);
132.2735 +LINK_ENTITY_TO_GAME(weapon_sm_heavybolter);
132.2736 +LINK_ENTITY_TO_GAME(weapon_sm_heavyflamer);
132.2737 +LINK_ENTITY_TO_GAME(weapon_sm_lascannon);
132.2738 +LINK_ENTITY_TO_GAME(weapon_sm_missilelauncher);
132.2739 +LINK_ENTITY_TO_GAME(weapon_sm_poweraxe);
132.2740 +LINK_ENTITY_TO_GAME(weapon_sm_powersword);
132.2741 +LINK_ENTITY_TO_GAME(weapon_sm_stormbolter);
132.2742 +LINK_ENTITY_TO_GAME(weapon_smaw);
132.2743 +LINK_ENTITY_TO_GAME(weapon_smg9);
132.2744 +LINK_ENTITY_TO_GAME(weapon_smkgrenade);
132.2745 +LINK_ENTITY_TO_GAME(weapon_smokegrenade);
132.2746 +LINK_ENTITY_TO_GAME(weapon_snUZI);
132.2747 +LINK_ENTITY_TO_GAME(weapon_snark);
132.2748 +LINK_ENTITY_TO_GAME(weapon_snipe);
132.2749 +LINK_ENTITY_TO_GAME(weapon_sniper);
132.2750 +LINK_ENTITY_TO_GAME(weapon_sniper3);
132.2751 +LINK_ENTITY_TO_GAME(weapon_sniperrifle);
132.2752 +LINK_ENTITY_TO_GAME(weapon_snowball);
132.2753 +LINK_ENTITY_TO_GAME(weapon_socom);
132.2754 +LINK_ENTITY_TO_GAME(weapon_socomtac);
132.2755 +LINK_ENTITY_TO_GAME(weapon_solarflare);
132.2756 +LINK_ENTITY_TO_GAME(weapon_soniccannon);
132.2757 +LINK_ENTITY_TO_GAME(weapon_sonicgrenade);
132.2758 +LINK_ENTITY_TO_GAME(weapon_spade);
132.2759 +LINK_ENTITY_TO_GAME(weapon_spas);
132.2760 +LINK_ENTITY_TO_GAME(weapon_spas12);
132.2761 +LINK_ENTITY_TO_GAME(weapon_spear);
132.2762 +LINK_ENTITY_TO_GAME(weapon_specialbeamcannon);
132.2763 +LINK_ENTITY_TO_GAME(weapon_spectre);
132.2764 +LINK_ENTITY_TO_GAME(weapon_spider);
132.2765 +LINK_ENTITY_TO_GAME(weapon_spiderbomb);
132.2766 +LINK_ENTITY_TO_GAME(weapon_spikegun);
132.2767 +LINK_ENTITY_TO_GAME(weapon_spiritbomb);
132.2768 +LINK_ENTITY_TO_GAME(weapon_spiritwizspell);
132.2769 +LINK_ENTITY_TO_GAME(weapon_spit);
132.2770 +LINK_ENTITY_TO_GAME(weapon_spitcarbine);
132.2771 +LINK_ENTITY_TO_GAME(weapon_spitpistol);
132.2772 +LINK_ENTITY_TO_GAME(weapon_spore);
132.2773 +LINK_ENTITY_TO_GAME(weapon_sporelauncher);
132.2774 +LINK_ENTITY_TO_GAME(weapon_spotboltspell);
132.2775 +LINK_ENTITY_TO_GAME(weapon_spring);
132.2776 +LINK_ENTITY_TO_GAME(weapon_spy);
132.2777 +LINK_ENTITY_TO_GAME(weapon_spycam);
132.2778 +LINK_ENTITY_TO_GAME(weapon_spyder);
132.2779 +LINK_ENTITY_TO_GAME(weapon_srifle);
132.2780 +LINK_ENTITY_TO_GAME(weapon_ssg3000);
132.2781 +LINK_ENTITY_TO_GAME(weapon_sshotgun);
132.2782 +LINK_ENTITY_TO_GAME(weapon_st_far);
132.2783 +LINK_ENTITY_TO_GAME(weapon_st_heavy);
132.2784 +LINK_ENTITY_TO_GAME(weapon_st_medium);
132.2785 +LINK_ENTITY_TO_GAME(weapon_st_melee);
132.2786 +LINK_ENTITY_TO_GAME(weapon_st_power);
132.2787 +LINK_ENTITY_TO_GAME(weapon_st_psi);
132.2788 +LINK_ENTITY_TO_GAME(weapon_st_short);
132.2789 +LINK_ENTITY_TO_GAME(weapon_st_special);
132.2790 +LINK_ENTITY_TO_GAME(weapon_st_throw);
132.2791 +LINK_ENTITY_TO_GAME(weapon_staff);
132.2792 +LINK_ENTITY_TO_GAME(weapon_star);
132.2793 +LINK_ENTITY_TO_GAME(weapon_sten);
132.2794 +LINK_ENTITY_TO_GAME(weapon_sterling);
132.2795 +LINK_ENTITY_TO_GAME(weapon_stg24);
132.2796 +LINK_ENTITY_TO_GAME(weapon_stickgrenade);
132.2797 +LINK_ENTITY_TO_GAME(weapon_stickgrenade_ex);
132.2798 +LINK_ENTITY_TO_GAME(weapon_stinger);
132.2799 +LINK_ENTITY_TO_GAME(weapon_stingray2);
132.2800 +LINK_ENTITY_TO_GAME(weapon_stomp);
132.2801 +LINK_ENTITY_TO_GAME(weapon_stoner);
132.2802 +LINK_ENTITY_TO_GAME(weapon_stonerscope);
132.2803 +LINK_ENTITY_TO_GAME(weapon_stonersilencer);
132.2804 +LINK_ENTITY_TO_GAME(weapon_stubgun);
132.2805 +LINK_ENTITY_TO_GAME(weapon_stumpgun);
132.2806 +LINK_ENTITY_TO_GAME(weapon_stupid);
132.2807 +LINK_ENTITY_TO_GAME(weapon_super_mouton);
132.2808 +LINK_ENTITY_TO_GAME(weapon_supernailgun);
132.2809 +LINK_ENTITY_TO_GAME(weapon_supershotgun);
132.2810 +LINK_ENTITY_TO_GAME(weapon_svd);
132.2811 +LINK_ENTITY_TO_GAME(weapon_swarm_gargflame);
132.2812 +LINK_ENTITY_TO_GAME(weapon_swipe);
132.2813 +LINK_ENTITY_TO_GAME(weapon_sword);
132.2814 +LINK_ENTITY_TO_GAME(weapon_tavor);
132.2815 +LINK_ENTITY_TO_GAME(weapon_tdagger);
132.2816 +LINK_ENTITY_TO_GAME(weapon_tec9);
132.2817 +LINK_ENTITY_TO_GAME(weapon_teleporteur);
132.2818 +LINK_ENTITY_TO_GAME(weapon_thompson);
132.2819 +LINK_ENTITY_TO_GAME(weapon_thornblastspell);
132.2820 +LINK_ENTITY_TO_GAME(weapon_throwaxe);
132.2821 +LINK_ENTITY_TO_GAME(weapon_throwing_knife);
132.2822 +LINK_ENTITY_TO_GAME(weapon_throwingknife);
132.2823 +LINK_ENTITY_TO_GAME(weapon_tknife);
132.2824 +LINK_ENTITY_TO_GAME(weapon_tmine);
132.2825 +LINK_ENTITY_TO_GAME(weapon_tmp);
132.2826 +LINK_ENTITY_TO_GAME(weapon_tnt);
132.2827 +LINK_ENTITY_TO_GAME(weapon_toad);
132.2828 +LINK_ENTITY_TO_GAME(weapon_tokarev);
132.2829 +LINK_ENTITY_TO_GAME(weapon_tomahawk);
132.2830 +LINK_ENTITY_TO_GAME(weapon_tommygun);
132.2831 +LINK_ENTITY_TO_GAME(weapon_tornadospell);
132.2832 +LINK_ENTITY_TO_GAME(weapon_transistor);
132.2833 +LINK_ENTITY_TO_GAME(weapon_translocator);
132.2834 +LINK_ENTITY_TO_GAME(weapon_trident);
132.2835 +LINK_ENTITY_TO_GAME(weapon_trigun);
132.2836 +LINK_ENTITY_TO_GAME(weapon_triplaser);
132.2837 +LINK_ENTITY_TO_GAME(weapon_tripmine);
132.2838 +LINK_ENTITY_TO_GAME(weapon_trooper);
132.2839 +LINK_ENTITY_TO_GAME(weapon_tsgun);
132.2840 +LINK_ENTITY_TO_GAME(weapon_tucan);
132.2841 +LINK_ENTITY_TO_GAME(weapon_umbra);
132.2842 +LINK_ENTITY_TO_GAME(weapon_ump45);
132.2843 +LINK_ENTITY_TO_GAME(weapon_updraftspell);
132.2844 +LINK_ENTITY_TO_GAME(weapon_us_grenade);
132.2845 +LINK_ENTITY_TO_GAME(weapon_usas12);
132.2846 +LINK_ENTITY_TO_GAME(weapon_usp);
132.2847 +LINK_ENTITY_TO_GAME(weapon_uspmp);
132.2848 +LINK_ENTITY_TO_GAME(weapon_uzi);
132.2849 +LINK_ENTITY_TO_GAME(weapon_uziakimbo);
132.2850 +LINK_ENTITY_TO_GAME(weapon_vepr);
132.2851 +LINK_ENTITY_TO_GAME(weapon_vomit);
132.2852 +LINK_ENTITY_TO_GAME(weapon_vsclaw);
132.2853 +LINK_ENTITY_TO_GAME(weapon_vscolt);
132.2854 +LINK_ENTITY_TO_GAME(weapon_vscrossbow);
132.2855 +LINK_ENTITY_TO_GAME(weapon_vscue);
132.2856 +LINK_ENTITY_TO_GAME(weapon_vsdbshotgun);
132.2857 +LINK_ENTITY_TO_GAME(weapon_vsmp5);
132.2858 +LINK_ENTITY_TO_GAME(weapon_vsshotgun);
132.2859 +LINK_ENTITY_TO_GAME(weapon_vsstake);
132.2860 +LINK_ENTITY_TO_GAME(weapon_vsthunderfive);
132.2861 +LINK_ENTITY_TO_GAME(weapon_vswinchester);
132.2862 +LINK_ENTITY_TO_GAME(weapon_vulcan);
132.2863 +LINK_ENTITY_TO_GAME(weapon_wa2000);
132.2864 +LINK_ENTITY_TO_GAME(weapon_warhammer);
132.2865 +LINK_ENTITY_TO_GAME(weapon_webley);
132.2866 +LINK_ENTITY_TO_GAME(weapon_webspinner);
132.2867 +LINK_ENTITY_TO_GAME(weapon_welder);
132.2868 +LINK_ENTITY_TO_GAME(weapon_whirlwindspell);
132.2869 +LINK_ENTITY_TO_GAME(weapon_whiskey);
132.2870 +LINK_ENTITY_TO_GAME(weapon_whiterayspell);
132.2871 +LINK_ENTITY_TO_GAME(weapon_winchester);
132.2872 +LINK_ENTITY_TO_GAME(weapon_wombatspell);
132.2873 +LINK_ENTITY_TO_GAME(weapon_wyvernspell);
132.2874 +LINK_ENTITY_TO_GAME(weapon_xm1014);
132.2875 +LINK_ENTITY_TO_GAME(weapon_xm4);
132.2876 +LINK_ENTITY_TO_GAME(weapon_zat);
132.2877 +LINK_ENTITY_TO_GAME(weapon_zatarc);
132.2878 +LINK_ENTITY_TO_GAME(weapon_zmg);
132.2879 +LINK_ENTITY_TO_GAME(weaponbox);
132.2880 +LINK_ENTITY_TO_GAME(weather_genie);
132.2881 +LINK_ENTITY_TO_GAME(weather_litnode);
132.2882 +LINK_ENTITY_TO_GAME(webgunprojectile);
132.2883 +LINK_ENTITY_TO_GAME(wheel);
132.2884 +LINK_ENTITY_TO_GAME(whiskey_whisk);
132.2885 +LINK_ENTITY_TO_GAME(world_artefact);
132.2886 +LINK_ENTITY_TO_GAME(world_capturelocation);
132.2887 +LINK_ENTITY_TO_GAME(world_items);
132.2888 +LINK_ENTITY_TO_GAME(worldspawn);
132.2889 +LINK_ENTITY_TO_GAME(ww_monstermaker);
132.2890 +LINK_ENTITY_TO_GAME(xen_hair);
132.2891 +LINK_ENTITY_TO_GAME(xen_hull);
132.2892 +LINK_ENTITY_TO_GAME(xen_plantlight);
132.2893 +LINK_ENTITY_TO_GAME(xen_spore_large);
132.2894 +LINK_ENTITY_TO_GAME(xen_spore_medium);
132.2895 +LINK_ENTITY_TO_GAME(xen_spore_small);
132.2896 +LINK_ENTITY_TO_GAME(xen_tree);
132.2897 +LINK_ENTITY_TO_GAME(xen_ttrigger);
132.2898 +LINK_ENTITY_TO_GAME(zone);
132.2899 +LINK_ENTITY_TO_GAME(zone_nodamage);
133.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
133.2 +++ b/metamod/linkplug.cpp Tue Apr 06 07:36:14 2004 +0000
133.3 @@ -0,0 +1,42 @@
133.4 +// vi: set ts=4 sw=4 :
133.5 +// vim: set tw=75 :
133.6 +
133.7 +// linkplug.cpp - export entities from plugins back to the HL engine
133.8 +
133.9 +/*
133.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
133.11 + *
133.12 + * This file is part of Metamod.
133.13 + *
133.14 + * Metamod is free software; you can redistribute it and/or modify it
133.15 + * under the terms of the GNU General Public License as published by the
133.16 + * Free Software Foundation; either version 2 of the License, or (at
133.17 + * your option) any later version.
133.18 + *
133.19 + * Metamod is distributed in the hope that it will be useful, but
133.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
133.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
133.22 + * General Public License for more details.
133.23 + *
133.24 + * You should have received a copy of the GNU General Public License
133.25 + * along with Metamod; if not, write to the Free Software Foundation,
133.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
133.27 + *
133.28 + * In addition, as a special exception, the author gives permission to
133.29 + * link the code of this program with the Half-Life Game Engine ("HL
133.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
133.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
133.32 + * respects for all of the code used other than the HL Engine and MODs
133.33 + * from Valve. If you modify this file, you may extend this exception
133.34 + * to your version of the file, but you are not obligated to do so. If
133.35 + * you do not wish to do so, delete this exception statement from your
133.36 + * version.
133.37 + *
133.38 + */
133.39 +
133.40 +#include <extdll.h> // always
133.41 +
133.42 +#include "linkent.h" // LINK_ENTITY_TO_PLUGIN
133.43 +
133.44 +// Entity lists for plugins
133.45 +LINK_ENTITY_TO_PLUGIN(adminmod_timer, "adminmod");
134.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
134.2 +++ b/metamod/log_meta.cpp Tue Apr 06 07:36:14 2004 +0000
134.3 @@ -0,0 +1,120 @@
134.4 +// vi: set ts=4 sw=4 :
134.5 +// vim: set tw=75 :
134.6 +
134.7 +// log_mega.cpp - logging routines
134.8 +
134.9 +/*
134.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
134.11 + *
134.12 + * This file is part of Metamod.
134.13 + *
134.14 + * Metamod is free software; you can redistribute it and/or modify it
134.15 + * under the terms of the GNU General Public License as published by the
134.16 + * Free Software Foundation; either version 2 of the License, or (at
134.17 + * your option) any later version.
134.18 + *
134.19 + * Metamod is distributed in the hope that it will be useful, but
134.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
134.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
134.22 + * General Public License for more details.
134.23 + *
134.24 + * You should have received a copy of the GNU General Public License
134.25 + * along with Metamod; if not, write to the Free Software Foundation,
134.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
134.27 + *
134.28 + * In addition, as a special exception, the author gives permission to
134.29 + * link the code of this program with the Half-Life Game Engine ("HL
134.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
134.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
134.32 + * respects for all of the code used other than the HL Engine and MODs
134.33 + * from Valve. If you modify this file, you may extend this exception
134.34 + * to your version of the file, but you are not obligated to do so. If
134.35 + * you do not wish to do so, delete this exception statement from your
134.36 + * version.
134.37 + *
134.38 + */
134.39 +
134.40 +#include <stdio.h> // vsnprintf, etc
134.41 +#include <stdarg.h> // va_start, etc
134.42 +
134.43 +#include <extdll.h> // always
134.44 +#include <enginecallback.h> // ALERT, etc
134.45 +
134.46 +#include "log_meta.h" // me
134.47 +#include "osdep.h" // win32 vsnprintf, etc
134.48 +
134.49 +cvar_t meta_debug = {"meta_debug", "0", FCVAR_EXTDLL, 0, NULL};
134.50 +
134.51 +// Print to console.
134.52 +void META_CONS(char *fmt, ...) {
134.53 + va_list ap;
134.54 + char buf[MAX_LOGMSG_LEN];
134.55 + unsigned int len;
134.56 +
134.57 + va_start(ap, fmt);
134.58 + vsnprintf(buf, sizeof(buf), fmt, ap);
134.59 + va_end(ap);
134.60 + len=strlen(buf);
134.61 + if(len < sizeof(buf)-2) // -1 null, -1 for newline
134.62 + strcat(buf, "\n");
134.63 + else
134.64 + buf[len-1] = '\n';
134.65 +
134.66 + SERVER_PRINT(buf);
134.67 +}
134.68 +
134.69 +// Log developer-level messages (obsoleted).
134.70 +void META_DEV(char *fmt, ...) {
134.71 + va_list ap;
134.72 + char buf[MAX_LOGMSG_LEN];
134.73 + int dev;
134.74 +
134.75 + dev=(int) CVAR_GET_FLOAT("developer");
134.76 + if(dev==0) return;
134.77 +
134.78 + va_start(ap, fmt);
134.79 + vsnprintf(buf, sizeof(buf), fmt, ap);
134.80 + va_end(ap);
134.81 + ALERT(at_logged, "[META] dev: %s\n", buf);
134.82 +}
134.83 +
134.84 +// Log errors.
134.85 +void META_ERROR(char *fmt, ...) {
134.86 + va_list ap;
134.87 + char buf[MAX_LOGMSG_LEN];
134.88 +
134.89 + va_start(ap, fmt);
134.90 + vsnprintf(buf, sizeof(buf), fmt, ap);
134.91 + va_end(ap);
134.92 + ALERT(at_logged, "[META] ERROR: %s\n", buf);
134.93 +}
134.94 +
134.95 +// Normal log messages.
134.96 +void META_LOG(char *fmt, ...) {
134.97 + va_list ap;
134.98 + char buf[MAX_LOGMSG_LEN];
134.99 +
134.100 + va_start(ap, fmt);
134.101 + vsnprintf(buf, sizeof(buf), fmt, ap);
134.102 + va_end(ap);
134.103 + ALERT(at_logged, "[META] %s\n", buf);
134.104 +}
134.105 +
134.106 +// Print to client.
134.107 +void META_CLIENT(edict_t *pEntity, char *fmt, ...) {
134.108 + va_list ap;
134.109 + char buf[MAX_CLIENTMSG_LEN];
134.110 + unsigned int len;
134.111 +
134.112 + va_start(ap, fmt);
134.113 + vsnprintf(buf, sizeof(buf), fmt, ap);
134.114 + va_end(ap);
134.115 + len=strlen(buf);
134.116 + if(len < sizeof(buf)-2) // -1 null, -1 for newline
134.117 + strcat(buf, "\n");
134.118 + else
134.119 + buf[len-1] = '\n';
134.120 +
134.121 + CLIENT_PRINTF(pEntity, print_console, buf);
134.122 +}
134.123 +
135.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
135.2 +++ b/metamod/log_meta.h Tue Apr 06 07:36:14 2004 +0000
135.3 @@ -0,0 +1,93 @@
135.4 +// vi: set ts=4 sw=4 :
135.5 +// vim: set tw=75 :
135.6 +
135.7 +// log_meta.h - functions & macros for logging
135.8 +
135.9 +/*
135.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
135.11 + *
135.12 + * This file is part of Metamod.
135.13 + *
135.14 + * Metamod is free software; you can redistribute it and/or modify it
135.15 + * under the terms of the GNU General Public License as published by the
135.16 + * Free Software Foundation; either version 2 of the License, or (at
135.17 + * your option) any later version.
135.18 + *
135.19 + * Metamod is distributed in the hope that it will be useful, but
135.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
135.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
135.22 + * General Public License for more details.
135.23 + *
135.24 + * You should have received a copy of the GNU General Public License
135.25 + * along with Metamod; if not, write to the Free Software Foundation,
135.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
135.27 + *
135.28 + * In addition, as a special exception, the author gives permission to
135.29 + * link the code of this program with the Half-Life Game Engine ("HL
135.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
135.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
135.32 + * respects for all of the code used other than the HL Engine and MODs
135.33 + * from Valve. If you modify this file, you may extend this exception
135.34 + * to your version of the file, but you are not obligated to do so. If
135.35 + * you do not wish to do so, delete this exception statement from your
135.36 + * version.
135.37 + *
135.38 + */
135.39 +
135.40 +#ifndef LOG_META_H
135.41 +#define LOG_META_H
135.42 +
135.43 +#include <enginecallback.h> // ALERT, etc
135.44 +#include "sdk_util.h" // UTIL_VarArgs, etc
135.45 +
135.46 +// Debug logging.
135.47 +//
135.48 +// This is done as a macro, rather than a function. This way, you can add
135.49 +// DEBUG statements all over, without worrying about performance
135.50 +// implications. If the debugging level is set low, all those statements
135.51 +// will only generate a simple float/int compare each; if we were to use a
135.52 +// function instead of a macro, it would end up wasting a lot of cpu cycles
135.53 +// calling/returning from the function every time. With a fair number of
135.54 +// DEBUG statements, or if they're placed in frequently excuted code, the
135.55 +// overhead of the wasted function calls could significantly impact server
135.56 +// performance.
135.57 +//
135.58 +// For this reason, we also compare directly to the float value of the
135.59 +// cvar, rather than calling CVAR_GET_FLOAT() and thus generating a string
135.60 +// compare for each DEBUG statement.
135.61 +//
135.62 +// Called as:
135.63 +// META_DEBUG(3, ("return code: %d", ret));
135.64 +//
135.65 +// Note the double parens, and the missing parens around "args" in the
135.66 +// macro itself. Note also the "do..while(0)" loop wrapping the
135.67 +// statements, so they become a single statement when expanded, necessary
135.68 +// for times when it might be called as a single-statement result of an
135.69 +// else (or other flow control).
135.70 +//
135.71 +// Yes, it's all a bit of a hack.
135.72 +
135.73 +#define META_DEBUG(level, args) \
135.74 + do { if(meta_debug.value >= level) ALERT(at_logged, "[META] (debug:%d) %s\n", level, UTIL_VarArgs args ); } while(0)
135.75 +
135.76 +// max buffer size for printed messages
135.77 +#define MAX_LOGMSG_LEN 1024
135.78 +
135.79 +// max buffer size for client messages
135.80 +#define MAX_CLIENTMSG_LEN 128
135.81 +
135.82 +extern cvar_t meta_debug;
135.83 +
135.84 +// META_DEV provides debug logging via the cvar "developer" (when set to 1)
135.85 +// and uses a function call rather than a macro as it's really intended to
135.86 +// be used only during startup, before meta_debug has been set from reading
135.87 +// server.cfg.
135.88 +// NOTE: META_DEV has now been mostly obsoleted in the code.
135.89 +
135.90 +void META_CONS(char *fmt, ...);
135.91 +void META_DEV(char *fmt, ...);
135.92 +void META_ERROR(char *fmt, ...);
135.93 +void META_LOG(char *fmt, ...);
135.94 +void META_CLIENT(edict_t *pEntity, char *fmt, ...);
135.95 +
135.96 +#endif /* LOG_META_H */
136.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
136.2 +++ b/metamod/meta_api.h Tue Apr 06 07:36:14 2004 +0000
136.3 @@ -0,0 +1,242 @@
136.4 +// vi: set ts=4 sw=4 :
136.5 +// vim: set tw=75 :
136.6 +
136.7 +// meta_api.h - description of metamod's DLL interface
136.8 +
136.9 +/*
136.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
136.11 + *
136.12 + * This file is part of Metamod.
136.13 + *
136.14 + * Metamod is free software; you can redistribute it and/or modify it
136.15 + * under the terms of the GNU General Public License as published by the
136.16 + * Free Software Foundation; either version 2 of the License, or (at
136.17 + * your option) any later version.
136.18 + *
136.19 + * Metamod is distributed in the hope that it will be useful, but
136.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
136.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
136.22 + * General Public License for more details.
136.23 + *
136.24 + * You should have received a copy of the GNU General Public License
136.25 + * along with Metamod; if not, write to the Free Software Foundation,
136.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
136.27 + *
136.28 + * In addition, as a special exception, the author gives permission to
136.29 + * link the code of this program with the Half-Life Game Engine ("HL
136.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
136.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
136.32 + * respects for all of the code used other than the HL Engine and MODs
136.33 + * from Valve. If you modify this file, you may extend this exception
136.34 + * to your version of the file, but you are not obligated to do so. If
136.35 + * you do not wish to do so, delete this exception statement from your
136.36 + * version.
136.37 + *
136.38 + */
136.39 +
136.40 +#ifndef META_API_H
136.41 +#define META_API_H
136.42 +
136.43 +#include "dllapi.h" // GETENTITYAPI_FN, etc
136.44 +#include "engine_api.h" // GET_ENGINE_FUNCTIONS_FN, etc
136.45 +#include "plinfo.h" // plugin_info_t, etc
136.46 +#include "mutil.h" // mutil_funcs_t, etc
136.47 +#include "osdep.h" // DLLEXPORT, etc
136.48 +
136.49 +// Version consists of "major:minor", two separate integer numbers.
136.50 +// Version 1 original
136.51 +// Version 2 added plugin_info_t **pinfo
136.52 +// Version 3 init split into query and attach, added detach
136.53 +// Version 4 added (PLUG_LOADTIME now) to attach
136.54 +// Version 5 changed mm ifvers int* to string, moved pl ifvers to info
136.55 +// Version 5:1 added link support for entity "adminmod_timer" (adminmod)
136.56 +// Version 5:2 added gamedll_funcs to meta_attach() [v1.0-rc2]
136.57 +// Version 5:3 added mutil_funcs to meta_query() [v1.05]
136.58 +// Version 5:4 added centersay utility functions [v1.06]
136.59 +// Version 5:5 added Meta_Init to plugin API [v1.08]
136.60 +// Version 5:6 added CallGameEntity utility function [v1.09]
136.61 +// Version 5:7 added GetUserMsgID, GetUserMsgName util funcs [v1.11]
136.62 +// Version 5:8 added GetPluginPath [v1.11]
136.63 +// Version 5:9 added GetGameInfo [v1.14]
136.64 +// Version 5:10 added GINFO_REALDLL_FULLPATH for GetGameInfo [v1.17]
136.65 +#define META_INTERFACE_VERSION "5:10"
136.66 +
136.67 +#ifdef UNFINISHED
136.68 +// Version 5:99 added event hook utility functions [v.???]
136.69 +#define META_INTERFACE_VERSION "5:99"
136.70 +#endif /* UNFINISHED */
136.71 +
136.72 +// Flags to indicate why the plugin is being unloaded.
136.73 +typedef enum {
136.74 + PNL_NULL = 0,
136.75 + PNL_INI_DELETED, // was deleted from plugins.ini
136.76 + PNL_FILE_NEWER, // file on disk is newer than last load
136.77 + PNL_COMMAND, // requested by server/console command
136.78 + PNL_CMD_FORCED, // forced by server/console command
136.79 + PNL_DELAYED, // delayed from previous request; can't tell origin
136.80 +} PL_UNLOAD_REASON;
136.81 +
136.82 +// Flags returned by a plugin's api function.
136.83 +// NOTE: order is crucial, as greater/less comparisons are made.
136.84 +typedef enum {
136.85 + MRES_UNSET = 0,
136.86 + MRES_IGNORED, // plugin didn't take any action
136.87 + MRES_HANDLED, // plugin did something, but real function should still be called
136.88 + MRES_OVERRIDE, // call real function, but use my return value
136.89 + MRES_SUPERCEDE, // skip real function; use my return value
136.90 +} META_RES;
136.91 +
136.92 +// Variables provided to plugins.
136.93 +typedef struct meta_globals_s {
136.94 + META_RES mres; // writable; plugin's return flag
136.95 + META_RES prev_mres; // readable; return flag of the previous plugin called
136.96 + META_RES status; // readable; "highest" return flag so far
136.97 + void *orig_ret; // readable; return value from "real" function
136.98 + void *override_ret; // readable; return value from overriding/superceding plugin
136.99 +} meta_globals_t;
136.100 +
136.101 +extern meta_globals_t *gpMetaGlobals;
136.102 +#define SET_META_RESULT(result) gpMetaGlobals->mres=result
136.103 +#define RETURN_META(result) \
136.104 + do { gpMetaGlobals->mres=result; return; } while(0)
136.105 +#define RETURN_META_VALUE(result, value) \
136.106 + do { gpMetaGlobals->mres=result; return(value); } while(0)
136.107 +#define META_RESULT_STATUS gpMetaGlobals->status
136.108 +#define META_RESULT_PREVIOUS gpMetaGlobals->prev_mres
136.109 +#define META_RESULT_ORIG_RET(type) *(type *)gpMetaGlobals->orig_ret
136.110 +#define META_RESULT_OVERRIDE_RET(type) *(type *)gpMetaGlobals->override_ret
136.111 +
136.112 +// Table of getapi functions, retrieved from each plugin.
136.113 +typedef struct {
136.114 + GETENTITYAPI_FN pfnGetEntityAPI;
136.115 + GETENTITYAPI_FN pfnGetEntityAPI_Post;
136.116 + GETENTITYAPI2_FN pfnGetEntityAPI2;
136.117 + GETENTITYAPI2_FN pfnGetEntityAPI2_Post;
136.118 + GETNEWDLLFUNCTIONS_FN pfnGetNewDLLFunctions;
136.119 + GETNEWDLLFUNCTIONS_FN pfnGetNewDLLFunctions_Post;
136.120 + GET_ENGINE_FUNCTIONS_FN pfnGetEngineFunctions;
136.121 + GET_ENGINE_FUNCTIONS_FN pfnGetEngineFunctions_Post;
136.122 +} META_FUNCTIONS;
136.123 +
136.124 +// Pair of function tables provided by game DLL.
136.125 +typedef struct {
136.126 + DLL_FUNCTIONS *dllapi_table;
136.127 + NEW_DLL_FUNCTIONS *newapi_table;
136.128 +} gamedll_funcs_t;
136.129 +
136.130 +// Declared in plugin; referenced in macros.
136.131 +extern gamedll_funcs_t *gpGamedllFuncs;
136.132 +extern mutil_funcs_t *gpMetaUtilFuncs;
136.133 +
136.134 +// Tell the dll that we'll be loading it as a metamod plugin, in case it
136.135 +// needs to do something special prior to the standard query/attach
136.136 +// procedure. In particular, this will allow for DLL's that can be used as
136.137 +// both standalone DLL's and metamod plugins. (optional; not required in
136.138 +// plugin)
136.139 +C_DLLEXPORT void Meta_Init(void);
136.140 +typedef void (*META_INIT_FN) (void);
136.141 +
136.142 +// Get info about plugin, compare meta_interface versions, provide meta
136.143 +// utility callback functions.
136.144 +C_DLLEXPORT int Meta_Query(char *interfaceVersion,
136.145 + plugin_info_t **plinfo,
136.146 + mutil_funcs_t *pMetaUtilFuncs);
136.147 +typedef int (*META_QUERY_FN) (char *interfaceVersion,
136.148 + plugin_info_t **plinfo,
136.149 + mutil_funcs_t *pMetaUtilFuncs);
136.150 +
136.151 +// Attach the plugin to the API; get the table of getapi functions; give
136.152 +// meta_globals and gamedll_funcs.
136.153 +C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now,
136.154 + META_FUNCTIONS *pFunctionTable,
136.155 + meta_globals_t *pMGlobals,
136.156 + gamedll_funcs_t *pGamedllFuncs);
136.157 +typedef int (*META_ATTACH_FN) (PLUG_LOADTIME now,
136.158 + META_FUNCTIONS *pFunctionTable,
136.159 + meta_globals_t *pMGlobals,
136.160 + gamedll_funcs_t *pGamedllFuncs);
136.161 +
136.162 +// Detach the plugin; tell why and when.
136.163 +C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason);
136.164 +typedef int (*META_DETACH_FN) (PLUG_LOADTIME now, PL_UNLOAD_REASON reason);
136.165 +
136.166 +// Standard HL SDK interface function prototypes.
136.167 +C_DLLEXPORT int GetEntityAPI_Post(DLL_FUNCTIONS *pFunctionTable,
136.168 + int interfaceVersion );
136.169 +C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable,
136.170 + int *interfaceVersion );
136.171 +
136.172 +// Additional SDK-like interface function prototypes.
136.173 +C_DLLEXPORT int GetNewDLLFunctions_Post(NEW_DLL_FUNCTIONS *pNewFunctionTable,
136.174 + int *interfaceVersion );
136.175 +C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine,
136.176 + int *interfaceVersion);
136.177 +C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine,
136.178 + int *interfaceVersion);
136.179 +
136.180 +// Convenience macros for accessing GameDLL functions. Note: these talk
136.181 +// _directly_ to the gamedll, and are not multiplexed through Metamod to
136.182 +// the other plugins.
136.183 +
136.184 +// DLL API functions:
136.185 +#define MDLL_FUNC gpGamedllFuncs->dllapi_table
136.186 +
136.187 +#define MDLL_GameDLLInit MDLL_FUNC->pfnGameInit
136.188 +#define MDLL_Spawn MDLL_FUNC->pfnSpawn
136.189 +#define MDLL_Think MDLL_FUNC->pfnThink
136.190 +#define MDLL_Use MDLL_FUNC->pfnUse
136.191 +#define MDLL_Touch MDLL_FUNC->pfnTouch
136.192 +#define MDLL_Blocked MDLL_FUNC->pfnBlocked
136.193 +#define MDLL_KeyValue MDLL_FUNC->pfnKeyValue
136.194 +#define MDLL_Save MDLL_FUNC->pfnSave
136.195 +#define MDLL_Restore MDLL_FUNC->pfnRestore
136.196 +#define MDLL_ObjectCollsionBox MDLL_FUNC->pfnAbsBox
136.197 +#define MDLL_SaveWriteFields MDLL_FUNC->pfnSaveWriteFields
136.198 +#define MDLL_SaveReadFields MDLL_FUNC->pfnSaveReadFields
136.199 +#define MDLL_SaveGlobalState MDLL_FUNC->pfnSaveGlobalState
136.200 +#define MDLL_RestoreGlobalState MDLL_FUNC->pfnRestoreGlobalState
136.201 +#define MDLL_ResetGlobalState MDLL_FUNC->pfnResetGlobalState
136.202 +#define MDLL_ClientConnect MDLL_FUNC->pfnClientConnect
136.203 +#define MDLL_ClientDisconnect MDLL_FUNC->pfnClientDisconnect
136.204 +#define MDLL_ClientKill MDLL_FUNC->pfnClientKill
136.205 +#define MDLL_ClientPutInServer MDLL_FUNC->pfnClientPutInServer
136.206 +#define MDLL_ClientCommand MDLL_FUNC->pfnClientCommand
136.207 +#define MDLL_ClientUserInfoChanged MDLL_FUNC->pfnClientUserInfoChanged
136.208 +#define MDLL_ServerActivate MDLL_FUNC->pfnServerActivate
136.209 +#define MDLL_ServerDeactivate MDLL_FUNC->pfnServerDeactivate
136.210 +#define MDLL_PlayerPreThink MDLL_FUNC->pfnPlayerPreThink
136.211 +#define MDLL_PlayerPostThink MDLL_FUNC->pfnPlayerPostThink
136.212 +#define MDLL_StartFrame MDLL_FUNC->pfnStartFrame
136.213 +#define MDLL_ParmsNewLevel MDLL_FUNC->pfnParmsNewLevel
136.214 +#define MDLL_ParmsChangeLevel MDLL_FUNC->pfnParmsChangeLevel
136.215 +#define MDLL_GetGameDescription MDLL_FUNC->pfnGetGameDescription
136.216 +#define MDLL_PlayerCustomization MDLL_FUNC->pfnPlayerCustomization
136.217 +#define MDLL_SpectatorConnect MDLL_FUNC->pfnSpectatorConnect
136.218 +#define MDLL_SpectatorDisconnect MDLL_FUNC->pfnSpectatorDisconnect
136.219 +#define MDLL_SpectatorThink MDLL_FUNC->pfnSpectatorThink
136.220 +#define MDLL_Sys_Error MDLL_FUNC->pfnSys_Error
136.221 +#define MDLL_PM_Move MDLL_FUNC->pfnPM_Move
136.222 +#define MDLL_PM_Init MDLL_FUNC->pfnPM_Init
136.223 +#define MDLL_PM_FindTextureType MDLL_FUNC->pfnPM_FindTextureType
136.224 +#define MDLL_SetupVisibility MDLL_FUNC->pfnSetupVisibility
136.225 +#define MDLL_UpdateClientData MDLL_FUNC->pfnUpdateClientData
136.226 +#define MDLL_AddToFullPack MDLL_FUNC->pfnAddToFullPack
136.227 +#define MDLL_CreateBaseline MDLL_FUNC->pfnCreateBaseline
136.228 +#define MDLL_RegisterEncoders MDLL_FUNC->pfnRegisterEncoders
136.229 +#define MDLL_GetWeaponData MDLL_FUNC->pfnGetWeaponData
136.230 +#define MDLL_CmdStart MDLL_FUNC->pfnCmdStart
136.231 +#define MDLL_CmdEnd MDLL_FUNC->pfnCmdEnd
136.232 +#define MDLL_ConnectionlessPacket MDLL_FUNC->pfnConnectionlessPacket
136.233 +#define MDLL_GetHullBounds MDLL_FUNC->pfnGetHullBounds
136.234 +#define MDLL_CreateInstancedBaselines MDLL_FUNC->pfnCreateInstancedBaselines
136.235 +#define MDLL_InconsistentFile MDLL_FUNC->pfnInconsistentFile
136.236 +#define MDLL_AllowLagCompensation MDLL_FUNC->pfnAllowLagCompensation
136.237 +
136.238 +// NEW API functions:
136.239 +#define MNEW_FUNC gpGamedllFuncs->newapi_table
136.240 +
136.241 +#define MNEW_OnFreeEntPrivateData MNEW_FUNC->pfnOnFreeEntPrivateData
136.242 +#define MNEW_GameShutdown MNEW_FUNC->pfnGameShutdown
136.243 +#define MNEW_ShouldCollide MNEW_FUNC->pfnShouldCollide
136.244 +
136.245 +#endif /* META_API_H */
137.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
137.2 +++ b/metamod/metamod.cpp Tue Apr 06 07:36:14 2004 +0000
137.3 @@ -0,0 +1,427 @@
137.4 +// vi: set ts=4 sw=4 :
137.5 +// vim: set tw=75 :
137.6 +
137.7 +// metamod.cpp - (main) implementation of metamod operations
137.8 +
137.9 +/*
137.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
137.11 + *
137.12 + * This file is part of Metamod.
137.13 + *
137.14 + * Metamod is free software; you can redistribute it and/or modify it
137.15 + * under the terms of the GNU General Public License as published by the
137.16 + * Free Software Foundation; either version 2 of the License, or (at
137.17 + * your option) any later version.
137.18 + *
137.19 + * Metamod is distributed in the hope that it will be useful, but
137.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
137.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
137.22 + * General Public License for more details.
137.23 + *
137.24 + * You should have received a copy of the GNU General Public License
137.25 + * along with Metamod; if not, write to the Free Software Foundation,
137.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
137.27 + *
137.28 + * In addition, as a special exception, the author gives permission to
137.29 + * link the code of this program with the Half-Life Game Engine ("HL
137.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
137.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
137.32 + * respects for all of the code used other than the HL Engine and MODs
137.33 + * from Valve. If you modify this file, you may extend this exception
137.34 + * to your version of the file, but you are not obligated to do so. If
137.35 + * you do not wish to do so, delete this exception statement from your
137.36 + * version.
137.37 + *
137.38 + */
137.39 +
137.40 +#include <malloc.h> // malloc, etc
137.41 +#include <errno.h> // errno, etc
137.42 +#include <new.h> // set_new_handler(), etc
137.43 +
137.44 +#include <extdll.h> // always
137.45 +#include <enginecallback.h> // GET_GAME_DIR, etc
137.46 +
137.47 +#include "metamod.h" // me
137.48 +#include "h_export.h" // GIVE_ENGINE_FUNCTIONS_FN, etc
137.49 +#include "mreg.h" // class MRegCmdList, etc
137.50 +#include "meta_api.h" // meta_globals_t, etc
137.51 +#include "mutil.h" // mutil_funcs_t, etc
137.52 +#include "osdep.h" // DLOPEN, getcwd, is_absolute_path,
137.53 +#include "reg_support.h" // meta_AddServerCommand, etc
137.54 +#include "game_support.h" // lookup_game, etc
137.55 +#include "commands_meta.h" // meta_register_cmdcvar, etc
137.56 +#include "thread_logparse.h" // logparse_handle, etc
137.57 +#include "support_meta.h" // valid_gamedir_file, etc
137.58 +#include "log_meta.h" // META_LOG, etc
137.59 +#include "types_meta.h" // mBOOL
137.60 +#include "info_name.h" // VNAME, etc
137.61 +#include "vdate.h" // COMPILE_TIME, etc
137.62 +
137.63 +cvar_t meta_version = {"metamod_version", VVERSION, FCVAR_SERVER, 0, NULL};
137.64 +
137.65 +MConfig static_config;
137.66 +MConfig *Config=&static_config;
137.67 +option_t global_options[] = {
137.68 + { "debuglevel", CF_INT, &Config->debuglevel, "0" },
137.69 + { "gamedll", CF_PATH, &Config->gamedll, NULL },
137.70 + { "plugins_file", CF_PATH, &Config->plugins_file, PLUGINS_INI },
137.71 + { "exec_cfg", CF_STR, &Config->exec_cfg, EXEC_CFG },
137.72 + // list terminator
137.73 + { NULL, CF_NONE, NULL, NULL }
137.74 +};
137.75 +
137.76 +gamedll_t GameDLL;
137.77 +
137.78 +meta_globals_t PublicMetaGlobals;
137.79 +meta_globals_t PrivateMetaGlobals;
137.80 +
137.81 +enginefuncs_t g_plugin_engfuncs;
137.82 +
137.83 +MPluginList *Plugins;
137.84 +MRegCmdList *RegCmds;
137.85 +MRegCvarList *RegCvars;
137.86 +MRegMsgList *RegMsgs;
137.87 +
137.88 +#ifdef UNFINISHED
137.89 +MHookList *Hooks;
137.90 +#endif /* UNFINISHED */
137.91 +
137.92 +// Very first metamod function that's run.
137.93 +// Do startup operations...
137.94 +void metamod_startup(void) {
137.95 + char *cp, *mmfile=NULL, *cfile=NULL;
137.96 +
137.97 + META_CONS(" ");
137.98 + META_CONS(" %s version %s Copyright (c) 2001-2003 %s", VNAME, VVERSION, VAUTHOR);
137.99 + META_CONS(" %s comes with ABSOLUTELY NO WARRANTY; for details type `meta gpl'.", VNAME);
137.100 + META_CONS(" This is free software, and you are welcome to redistribute it");
137.101 + META_CONS(" under certain conditions; type `meta gpl' for details.");
137.102 + META_CONS(" ");
137.103 +
137.104 + META_LOG("%s v%s %s", VNAME, VVERSION, VDATE);
137.105 + META_LOG("by %s", VAUTHOR);
137.106 + META_LOG(" %s", VURL);
137.107 + META_LOG("compiled: %s Eastern (%s)", COMPILE_TIME, OPT_TYPE);
137.108 +
137.109 + // If running with "+developer", allow an opportunity to break in with
137.110 + // a debugger.
137.111 + if((int) CVAR_GET_FLOAT("developer") != 0)
137.112 + sleep(1);
137.113 +
137.114 + // specify our new() handler
137.115 + set_new_handler(meta_new_handler);
137.116 +
137.117 + // Get gamedir, very early on, because it seems we need it all over the
137.118 + // place here at the start.
137.119 + if(!meta_init_gamedll()) {
137.120 + META_ERROR("Failure to init game DLL; exiting...");
137.121 + do_exit(1);
137.122 + }
137.123 +
137.124 + // Register various console commands and cvars.
137.125 + // Can I do these here, rather than waiting for GameDLLInit() ?
137.126 + // Looks like it works okay..
137.127 + meta_register_cmdcvar();
137.128 +
137.129 + // Set a slight debug level for developer mode, if debug level not
137.130 + // already set.
137.131 + if((int) CVAR_GET_FLOAT("developer") != 0 && meta_debug.value == 0)
137.132 + CVAR_SET_FLOAT("meta_debug", 3.0);
137.133 +
137.134 + // Init default values
137.135 + Config->init(global_options);
137.136 + // Find config file
137.137 + cfile=CONFIG_INI;
137.138 + if((cp=LOCALINFO("mm_configfile")) && *cp != '\0') {
137.139 + META_LOG("Configfile specified via localinfo: %s", cp);
137.140 + if(valid_gamedir_file(cp))
137.141 + cfile=cp;
137.142 + else
137.143 + META_ERROR("Empty/missing config.ini file: %s; falling back to %s",
137.144 + cp, cfile);
137.145 + }
137.146 + // Load config file
137.147 + if(valid_gamedir_file(cfile))
137.148 + Config->load(cfile);
137.149 + else
137.150 + META_DEBUG(2, ("No config.ini file found: %s", CONFIG_INI));
137.151 +
137.152 + // Now, override config options with localinfo commandline options.
137.153 + if((cp=LOCALINFO("mm_debug")) && *cp != '\0') {
137.154 + META_LOG("Debuglevel specified via localinfo: %s", cp);
137.155 + Config->set("debuglevel", cp);
137.156 + }
137.157 + if((cp=LOCALINFO("mm_gamedll")) && *cp != '\0') {
137.158 + META_LOG("Gamedll specified via localinfo: %s", cp);
137.159 + Config->set("gamedll", cp);
137.160 + }
137.161 + if((cp=LOCALINFO("mm_pluginsfile")) && *cp != '\0') {
137.162 + META_LOG("Pluginsfile specified via localinfo: %s", cp);
137.163 + Config->set("plugins_file", cp);
137.164 + }
137.165 + if((cp=LOCALINFO("mm_execcfg")) && *cp != '\0') {
137.166 + META_LOG("Execcfg specified via localinfo: %s", cp);
137.167 + Config->set("exec_cfg", cp);
137.168 + }
137.169 +
137.170 +
137.171 + // Check for an initial debug level, since cfg files don't get exec'd
137.172 + // until later.
137.173 + if(Config->debuglevel != 0)
137.174 + CVAR_SET_FLOAT("meta_debug", Config->debuglevel);
137.175 +
137.176 + // Prepare for registered commands from plugins.
137.177 + RegCmds = new MRegCmdList();
137.178 + RegCvars = new MRegCvarList();
137.179 +
137.180 + // Prepare for registered user messages from gamedll.
137.181 + RegMsgs = new MRegMsgList();
137.182 +
137.183 + // Copy, and store pointer in Engine struct. Yes, we could just store
137.184 + // the actual engine_t struct in Engine, but then it wouldn't be a
137.185 + // pointer to match the other g_engfuncs.
137.186 + memcpy(&g_plugin_engfuncs, Engine.funcs, sizeof(g_plugin_engfuncs));
137.187 + Engine.pl_funcs=&g_plugin_engfuncs;
137.188 + // substitute our special versions of various commands
137.189 + Engine.pl_funcs->pfnAddServerCommand = meta_AddServerCommand;
137.190 + Engine.pl_funcs->pfnCVarRegister = meta_CVarRegister;
137.191 + Engine.pl_funcs->pfnCvar_RegisterVariable = meta_CVarRegister;
137.192 + Engine.pl_funcs->pfnRegUserMsg = meta_RegUserMsg;
137.193 +
137.194 +#ifdef UNFINISHED
137.195 + // Init the list of event/logline hooks.
137.196 + Hooks = new MHookList();
137.197 +#endif /* UNFINISHED */
137.198 +
137.199 + // Before, we loaded plugins before loading the game DLL, so that if no
137.200 + // plugins caught engine functions, we could pass engine funcs straight
137.201 + // to game dll, rather than acting as intermediary. (Should perform
137.202 + // better, right?)
137.203 + //
137.204 + // But since a plugin can be loaded at any time, we have to go ahead
137.205 + // and catch the engine funcs regardless. Also, we want to give each
137.206 + // plugin a copy of the gameDLL's api tables, in case they need to call
137.207 + // API functions directly.
137.208 + //
137.209 + // Thus, load gameDLL first, then plugins.
137.210 + //
137.211 + // However, we have to init the Plugins object first, because if the
137.212 + // gamedll calls engine functions during GiveFnptrsToDll (like hpb_bot
137.213 + // does) then it needs to be non-null so META_ENGINE_HANDLE won't crash.
137.214 + //
137.215 + // However, having replaced valid_file with valid_gamedir_file, we need
137.216 + // to at least initialize the gameDLL to include the gamedir, before
137.217 + // looking for plugins.ini.
137.218 + //
137.219 + // In fact, we need gamedir even earlier, so moved up above.
137.220 +
137.221 + // Fall back to old plugins filename, if configured one isn't found.
137.222 + mmfile=PLUGINS_INI;
137.223 + if(!valid_gamedir_file(PLUGINS_INI) && valid_gamedir_file(OLD_PLUGINS_INI))
137.224 + mmfile=OLD_PLUGINS_INI;
137.225 + if(valid_gamedir_file(Config->plugins_file))
137.226 + mmfile=Config->plugins_file;
137.227 + else
137.228 + META_ERROR("Plugins file is empty/missing: %s; falling back to %s",
137.229 + Config->plugins_file, mmfile);
137.230 +
137.231 + Plugins = new MPluginList(mmfile);
137.232 +
137.233 + if(!meta_load_gamedll()) {
137.234 + META_ERROR("Failure to load game DLL; exiting...");
137.235 + do_exit(1);
137.236 + }
137.237 + if(!Plugins->load()) {
137.238 + META_ERROR("Failure to load plugins...");
137.239 + // Exit on failure here? Dunno...
137.240 + }
137.241 +
137.242 +#ifdef UNFINISHED
137.243 + // Start up the log parsing thread.
137.244 + startup_logparse_thread();
137.245 +#endif /* UNFINISHED */
137.246 +
137.247 + // Allow for commands to metamod plugins at startup. Autoexec.cfg is
137.248 + // read too early, and server.cfg is read too late.
137.249 + //
137.250 + // Only attempt load if the file appears to exist and be non-empty, to
137.251 + // avoid confusing users with "couldn't exec exec.cfg" console
137.252 + // messages.
137.253 + if(valid_gamedir_file(Config->exec_cfg))
137.254 + mmfile=Config->exec_cfg;
137.255 + else if(valid_gamedir_file(OLD_EXEC_CFG))
137.256 + mmfile=OLD_EXEC_CFG;
137.257 + else
137.258 + mmfile=NULL;
137.259 +
137.260 + if(mmfile) {
137.261 + if(mmfile[0]=='/')
137.262 + META_ERROR("Cannot exec absolute pathnames: %s", mmfile);
137.263 + else {
137.264 + char cmd[NAME_MAX];
137.265 + META_LOG("Exec'ing metamod exec.cfg: %s...", mmfile);
137.266 + snprintf(cmd, sizeof(cmd), "exec %s\n", mmfile);
137.267 + SERVER_COMMAND(cmd);
137.268 + }
137.269 + }
137.270 +}
137.271 +
137.272 +// Set initial GameDLL fields (name, gamedir).
137.273 +// meta_errno values:
137.274 +// - ME_NULLRESULT getcwd failed
137.275 +mBOOL meta_init_gamedll(void) {
137.276 + char gamedir[PATH_MAX];
137.277 + char *cp;
137.278 +
137.279 + memset(&GameDLL, 0, sizeof(GameDLL));
137.280 +
137.281 + GET_GAME_DIR(gamedir);
137.282 + normalize_pathname(gamedir);
137.283 + //
137.284 + // As of 1.1.1.1, the engine routine GET_GAME_DIR no longer returns a
137.285 + // full-pathname, but rather just the path specified as the argument to
137.286 + // "-game".
137.287 + //
137.288 + // However, since we have to work properly under both the new version
137.289 + // as well as previous versions, we have to support both possibilities.
137.290 + //
137.291 + // Note: the code has always assumed the server op wouldn't do:
137.292 + // hlds -game other/firearms
137.293 + //
137.294 + if(is_absolute_path(gamedir)) {
137.295 + // Old style; GET_GAME_DIR returned full pathname. Copy this into
137.296 + // our gamedir, and truncate to get the game name.
137.297 + // (note check for both linux and win32 full pathname.)
137.298 + STRNCPY(GameDLL.gamedir, gamedir, sizeof(GameDLL.gamedir));
137.299 + cp=strrchr(gamedir, '/') + 1;
137.300 + STRNCPY(GameDLL.name, cp, sizeof(GameDLL.name));
137.301 + }
137.302 + else {
137.303 + // New style; GET_GAME_DIR returned game name. Copy this into our
137.304 + // game name, and prepend the current working directory.
137.305 + char buf[PATH_MAX];
137.306 + if(!getcwd(buf, sizeof(buf))) {
137.307 + META_ERROR("dll: Couldn't get cwd; %s", strerror(errno));
137.308 + RETURN_ERRNO(mFALSE, ME_NULLRESULT);
137.309 + }
137.310 + snprintf(GameDLL.gamedir, sizeof(GameDLL.gamedir),
137.311 + "%s/%s", buf, gamedir);
137.312 + STRNCPY(GameDLL.name, gamedir, sizeof(GameDLL.name));
137.313 + }
137.314 +
137.315 + META_DEBUG(3, ("Game: %s", GameDLL.name));
137.316 +
137.317 + return(mTRUE);
137.318 +}
137.319 +
137.320 +// Load game DLL.
137.321 +// meta_errno values:
137.322 +// - ME_DLOPEN couldn't dlopen game dll file
137.323 +// - ME_DLMISSING couldn't find required routine in game dll
137.324 +// (GiveFnptrsToDll, GetEntityAPI, GetEntityAPI2)
137.325 +mBOOL meta_load_gamedll(void) {
137.326 + int iface_vers;
137.327 + int found=0;
137.328 +
137.329 + GIVE_ENGINE_FUNCTIONS_FN pfn_give_engfuncs;
137.330 + GETNEWDLLFUNCTIONS_FN pfn_getapinew;
137.331 + GETENTITYAPI2_FN pfn_getapi2;
137.332 + GETENTITYAPI_FN pfn_getapi;
137.333 +
137.334 + if(!setup_gamedll(&GameDLL)) {
137.335 + META_ERROR("dll: Unrecognized game: %s", GameDLL.name);
137.336 + // meta_errno should be already set in lookup_game()
137.337 + return(mFALSE);
137.338 + }
137.339 +
137.340 + // open the game DLL
137.341 + if(!(GameDLL.handle=DLOPEN(GameDLL.pathname))) {
137.342 + META_ERROR("dll: Couldn't load game DLL %s: %s", GameDLL.pathname,
137.343 + DLERROR());
137.344 + RETURN_ERRNO(mFALSE, ME_DLOPEN);
137.345 + }
137.346 +
137.347 + // Used to only pass our table of engine funcs if a loaded plugin
137.348 + // wanted to catch one of the functions, but now that plugins are
137.349 + // dynamically loadable at any time, we have to always pass our table,
137.350 + // so that any plugin loaded later can catch what they need to.
137.351 + if((pfn_give_engfuncs = (GIVE_ENGINE_FUNCTIONS_FN) DLSYM(GameDLL.handle,
137.352 + "GiveFnptrsToDll")))
137.353 + {
137.354 + pfn_give_engfuncs(&meta_engfuncs, gpGlobals);
137.355 + META_DEBUG(3, ("dll: Game '%s': Called GiveFnptrsToDll",
137.356 + GameDLL.name));
137.357 + }
137.358 + else {
137.359 + META_ERROR("dll: Couldn't find GiveFnptrsToDll() in game DLL '%s': %s",
137.360 + GameDLL.name, DLERROR());
137.361 + RETURN_ERRNO(mFALSE, ME_DLMISSING);
137.362 + }
137.363 +
137.364 + // Yes...another macro.
137.365 +#define GET_FUNC_TABLE_FROM_GAME(gamedll, pfnGetFuncs, STR_GetFuncs, struct_field, API_TYPE, TABLE_TYPE, vers_pass, vers_int, vers_want, gotit) \
137.366 + if((pfnGetFuncs = (API_TYPE) DLSYM(gamedll.handle, STR_GetFuncs))) { \
137.367 + gamedll.funcs.struct_field = (TABLE_TYPE*) malloc(sizeof(TABLE_TYPE)); \
137.368 + memset(gamedll.funcs.struct_field, 0, sizeof(gamedll.funcs.struct_field)); \
137.369 + if(!gamedll.funcs.struct_field) {\
137.370 + META_ERROR("malloc failed for gamedll struct_field: %s", STR_GetFuncs); \
137.371 + } \
137.372 + else if(pfnGetFuncs(gamedll.funcs.struct_field, vers_pass)) { \
137.373 + META_DEBUG(3, ("dll: Game '%s': Found %s", gamedll.name, STR_GetFuncs)); \
137.374 + gotit=1; \
137.375 + } \
137.376 + else { \
137.377 + META_ERROR("dll: Failure calling %s in game '%s'", STR_GetFuncs, gamedll.name); \
137.378 + free(gamedll.funcs.struct_field); \
137.379 + gamedll.funcs.struct_field=NULL; \
137.380 + if(vers_int != vers_want) { \
137.381 + META_ERROR("dll: Interface version didn't match; we wanted %d, they had %d", vers_want, vers_int); \
137.382 + /* reproduce error from engine */ \
137.383 + META_CONS("=================="); \
137.384 + META_CONS("Game DLL version mismatch"); \
137.385 + META_CONS("DLL version is %d, engine version is %d", vers_int, vers_want); \
137.386 + if(vers_int > vers_want) \
137.387 + META_CONS("Engine appears to be outdated, check for updates"); \
137.388 + else \
137.389 + META_CONS("The game DLL for %s appears to be outdated, check for updates", GameDLL.name); \
137.390 + META_CONS("=================="); \
137.391 + ALERT(at_error, "Exiting...\n"); \
137.392 + } \
137.393 + } \
137.394 + } \
137.395 + else { \
137.396 + META_DEBUG(5, ("dll: Game '%s': No %s", gamedll.name, STR_GetFuncs)); \
137.397 + gamedll.funcs.struct_field=NULL; \
137.398 + }
137.399 +
137.400 + // Look for API-NEW interface in Game dll. We do this before API2/API, because
137.401 + // that's what the engine appears to do..
137.402 + iface_vers=NEW_DLL_FUNCTIONS_VERSION;
137.403 + GET_FUNC_TABLE_FROM_GAME(GameDLL, pfn_getapinew, "GetNewDLLFunctions", newapi_table,
137.404 + GETNEWDLLFUNCTIONS_FN, NEW_DLL_FUNCTIONS,
137.405 + &iface_vers, iface_vers, NEW_DLL_FUNCTIONS_VERSION, found);
137.406 +
137.407 + // Look for API2 interface in plugin; preferred over API-1.
137.408 + found=0;
137.409 + iface_vers=INTERFACE_VERSION;
137.410 + GET_FUNC_TABLE_FROM_GAME(GameDLL, pfn_getapi2, "GetEntityAPI2", dllapi_table,
137.411 + GETENTITYAPI2_FN, DLL_FUNCTIONS,
137.412 + &iface_vers, iface_vers, INTERFACE_VERSION, found);
137.413 +
137.414 + // Look for API-1 in plugin, if API2 interface wasn't found.
137.415 + if(!found) {
137.416 + found=0;
137.417 + GET_FUNC_TABLE_FROM_GAME(GameDLL, pfn_getapi, "GetEntityAPI", dllapi_table,
137.418 + GETENTITYAPI_FN, DLL_FUNCTIONS,
137.419 + INTERFACE_VERSION, INTERFACE_VERSION, INTERFACE_VERSION, found);
137.420 + }
137.421 +
137.422 + // If didn't find either, return failure.
137.423 + if(!found) {
137.424 + META_ERROR("dll: Couldn't find either GetEntityAPI nor GetEntityAPI2 in game DLL '%s'", GameDLL.name);
137.425 + RETURN_ERRNO(mFALSE, ME_DLMISSING);
137.426 + }
137.427 +
137.428 + META_LOG("Game DLL for '%s' loaded successfully", GameDLL.desc);
137.429 + return(mTRUE);
137.430 +}
138.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
138.2 +++ b/metamod/metamod.h Tue Apr 06 07:36:14 2004 +0000
138.3 @@ -0,0 +1,391 @@
138.4 +// vi: set ts=4 sw=4 :
138.5 +// vim: set tw=75 :
138.6 +
138.7 +// metamod.h - (main) description of metamod operations
138.8 +
138.9 +/*
138.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
138.11 + *
138.12 + * This file is part of Metamod.
138.13 + *
138.14 + * Metamod is free software; you can redistribute it and/or modify it
138.15 + * under the terms of the GNU General Public License as published by the
138.16 + * Free Software Foundation; either version 2 of the License, or (at
138.17 + * your option) any later version.
138.18 + *
138.19 + * Metamod is distributed in the hope that it will be useful, but
138.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
138.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
138.22 + * General Public License for more details.
138.23 + *
138.24 + * You should have received a copy of the GNU General Public License
138.25 + * along with Metamod; if not, write to the Free Software Foundation,
138.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
138.27 + *
138.28 + * In addition, as a special exception, the author gives permission to
138.29 + * link the code of this program with the Half-Life Game Engine ("HL
138.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
138.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
138.32 + * respects for all of the code used other than the HL Engine and MODs
138.33 + * from Valve. If you modify this file, you may extend this exception
138.34 + * to your version of the file, but you are not obligated to do so. If
138.35 + * you do not wish to do so, delete this exception statement from your
138.36 + * version.
138.37 + *
138.38 + */
138.39 +
138.40 +#ifndef METAMOD_H
138.41 +#define METAMOD_H
138.42 +
138.43 +#include "meta_api.h" // META_RES, etc
138.44 +#include "mlist.h" // MPluginList, etc
138.45 +#include "mreg.h" // MRegCmdList, etc
138.46 +#include "conf_meta.h" // MConfig
138.47 +#include "osdep.h" // NAME_MAX, etc
138.48 +#include "types_meta.h" // mBOOL
138.49 +
138.50 +// file that lists plugins to load at startup
138.51 +#define PLUGINS_INI "addons/metamod/plugins.ini"
138.52 +#define OLD_PLUGINS_INI "metamod.ini"
138.53 +
138.54 +// file that contains commands to metamod plugins at startup
138.55 +#define EXEC_CFG "addons/metamod/exec.cfg"
138.56 +#define OLD_EXEC_CFG "metaexec.cfg"
138.57 +
138.58 +// previously, file that contained path for an override-gamedll
138.59 +#define OLD_GAMEDLL_TXT "metagame.ini"
138.60 +
138.61 +// generic config file
138.62 +#define CONFIG_INI "addons/metamod/config.ini"
138.63 +
138.64 +// cvar to contain version
138.65 +extern cvar_t meta_version;
138.66 +
138.67 +// Info about the game dll/mod.
138.68 +typedef struct gamedll_s {
138.69 + char name[NAME_MAX]; // ie "cstrike" (from gamedir)
138.70 + char *desc; // ie "Counter-Strike"
138.71 + char gamedir[PATH_MAX]; // ie "/home/willday/half-life/cstrike"
138.72 + char pathname[PATH_MAX]; // ie "/home/willday/half-life/cstrike/dlls/cs_i386.so"
138.73 + char const *file; // ie "cs_i386.so"
138.74 + char real_pathname[PATH_MAX]; // in case pathname overridden by bot, etc
138.75 + DLHANDLE handle;
138.76 + gamedll_funcs_t funcs; // dllapi_table, newapi_table
138.77 +} gamedll_t;
138.78 +extern gamedll_t GameDLL;
138.79 +
138.80 +// SDK variables for storing engine funcs and globals.
138.81 +extern enginefuncs_t g_engfuncs;
138.82 +extern globalvars_t *gpGlobals;
138.83 +
138.84 +// Our modified version of the engine funcs, to give to plugins.
138.85 +extern enginefuncs_t g_plugin_engfuncs;
138.86 +
138.87 +// Our structure for storing engine references.
138.88 +typedef struct engine_s {
138.89 + enginefuncs_t *funcs; // engine funcs
138.90 + globalvars_t *globals; // engine globals
138.91 + enginefuncs_t *pl_funcs; // "modified" eng funcs we give to plugins
138.92 +} engine_t;
138.93 +extern engine_t Engine;
138.94 +
138.95 +// Config structure.
138.96 +extern MConfig *Config;
138.97 +
138.98 +// List of plugins loaded/opened/running.
138.99 +extern MPluginList *Plugins;
138.100 +
138.101 +// List of command functions registered by plugins.
138.102 +extern MRegCmdList *RegCmds;
138.103 +
138.104 +// List of cvar structures registered by plugins.
138.105 +extern MRegCvarList *RegCvars;
138.106 +
138.107 +// List of user messages registered by gamedll.
138.108 +extern MRegMsgList *RegMsgs;
138.109 +
138.110 +#ifdef UNFINISHED
138.111 +// List of event/logline hooks requested by plugins.
138.112 +extern MHookList *Hooks;
138.113 +#endif /* UNFINISHED */
138.114 +
138.115 +// Data provided to plugins.
138.116 +// Separate copies to prevent plugins from modifying "readable" parts.
138.117 +// See meta_api.h for meta_globals_t structure.
138.118 +extern meta_globals_t PublicMetaGlobals;
138.119 +extern meta_globals_t PrivateMetaGlobals;
138.120 +
138.121 +void metamod_startup(void);
138.122 +
138.123 +mBOOL meta_init_gamedll(void);
138.124 +mBOOL meta_load_gamedll(void);
138.125 +
138.126 +// ===== lotsa macros... ======================================================
138.127 +
138.128 +// These are the meat of the metamod processing, and are as ugly as (or
138.129 +// uglier) than they look. This is done via macros, because of the varying
138.130 +// parameter types (int, void, edict_t*, etc) as well as varying
138.131 +// function-pointer types and different api tables (dllapi, newapi,
138.132 +// engine), which just can't be passed to a function. And, since the
138.133 +// operation is similar for each api call, I didn't want to keep
138.134 +// duplicating code all over the place. Thus the ugly macros.
138.135 +//
138.136 +// The basic operation is, for each api call:
138.137 +// - iterate through list of plugins
138.138 +// - for each plugin, if it provides this api call, then call the
138.139 +// function in the plugin
138.140 +// - call the "real" function (in the game dll, or from the engine)
138.141 +// - for each plugin, check for a "post" version of the function, and call
138.142 +// if present
138.143 +//
138.144 +//
138.145 +// Also, for any api call, each plugin has the opportunity to replace the
138.146 +// real routine, in two ways:
138.147 +// - prevent the real routine from being called ("supercede")
138.148 +// - allow the real routine to be called, but change the value that's
138.149 +// returned ("override")
138.150 +//
138.151 +// Thus after each plugin is called, its META_RETURN flag is checked, and
138.152 +// action taken appropriately. Note that supercede/override only affects
138.153 +// the _real_ routine; other plugins will still be called.
138.154 +//
138.155 +// In addition to the SUPERCEDE and OVERRIDE flags, there are two
138.156 +// additional flags a plugin can return:
138.157 +// - HANDLED ("I did something here")
138.158 +// - IGNORED ("I didn't really do anything")
138.159 +//
138.160 +// These aren't used by metamod itself, but could be used by plugins to
138.161 +// get an idea if a previous plugin did anything.
138.162 +//
138.163 +//
138.164 +// The 5 basic macros are:
138.165 +// SETUP
138.166 +// CALL_PLUGIN
138.167 +// CALL_GAME and CALL_ENGINE
138.168 +// RETURN
138.169 +//
138.170 +// These 5 are actually used to build second level macros for each api type
138.171 +// (dllapi, newapi, engine), with the CALL_PLUGIN macro being used twice
138.172 +// (before and after). Altogether, they end up expanding to approx 150
138.173 +// lines of code for _each_ api call. Ack, ugly indeed.
138.174 +//
138.175 +// However, due to some functions returning 'void', and others returning an
138.176 +// actual value, I had to have separate macros for the two, since I
138.177 +// couldn't seem to generalize the two into a form that the compiler would
138.178 +// accept. Thus there are "_void" versions of the 5 macros; these are
138.179 +// listed first.
138.180 +
138.181 +// ===== macros for void-returning functions ==================================
138.182 +
138.183 +// declare/init some variables
138.184 +#define SETUP_API_CALLS_void(FN_TYPE, pfnName, api_info_table) \
138.185 + int i; \
138.186 + META_RES mres=MRES_UNSET, status=MRES_UNSET, prev_mres=MRES_UNSET; \
138.187 + MPlugin *iplug; \
138.188 + FN_TYPE pfn_routine=NULL; \
138.189 + int loglevel=api_info_table.pfnName.loglevel; \
138.190 + char *pfn_string=api_info_table.pfnName.name; \
138.191 + memset(&PublicMetaGlobals, 0, sizeof(PublicMetaGlobals));
138.192 +
138.193 +// call each plugin
138.194 +#define CALL_PLUGIN_API_void(post, pfnName, pfn_args, api_table) \
138.195 + prev_mres=MRES_UNSET; \
138.196 + for(i=0; i < Plugins->endlist; i++) { \
138.197 + iplug=&Plugins->plist[i]; \
138.198 + if (iplug->status != PL_RUNNING) \
138.199 + continue; \
138.200 + if(iplug->api_table && (pfn_routine=iplug->api_table->pfnName)); \
138.201 + else \
138.202 + /* plugin doesn't provide this function */ \
138.203 + continue; \
138.204 + /* initialize PublicMetaGlobals */ \
138.205 + PublicMetaGlobals.mres = MRES_UNSET; \
138.206 + PublicMetaGlobals.prev_mres = prev_mres; \
138.207 + PublicMetaGlobals.status = status; \
138.208 + /* call plugin */ \
138.209 + META_DEBUG(loglevel, ("Calling %s:%s%s()", iplug->file, pfn_string, (post?"_Post":""))); \
138.210 + pfn_routine pfn_args; \
138.211 + /* plugin's result code */ \
138.212 + mres=PublicMetaGlobals.mres; \
138.213 + if(mres > status) \
138.214 + status = mres; \
138.215 + /* save this for successive plugins to see */ \
138.216 + prev_mres = mres; \
138.217 + if(mres==MRES_UNSET) \
138.218 + META_ERROR("Plugin didn't set meta_result: %s:%s%s()", iplug->file, pfn_string, (post?"_Post":"")); \
138.219 + if(post && mres==MRES_SUPERCEDE) \
138.220 + META_ERROR("MRES_SUPERCEDE not valid in Post functions: %s:%s%s()", iplug->file, pfn_string, (post?"_Post":"")); \
138.221 + }
138.222 +
138.223 +// call "real" function, from gamedll
138.224 +#define CALL_GAME_API_void(pfnName, pfn_args, api_table) \
138.225 + if(status==MRES_SUPERCEDE) { \
138.226 + META_DEBUG(loglevel, ("Skipped (supercede) %s:%s()", GameDLL.file, pfn_string)); \
138.227 + /* don't return here; superceded game routine, but still allow \
138.228 + * _post routines to run. \
138.229 + */ \
138.230 + } \
138.231 + else if(GameDLL.funcs.api_table) { \
138.232 + pfn_routine=NULL; \
138.233 + if(GameDLL.funcs.api_table && (pfn_routine=GameDLL.funcs.api_table->pfnName)); \
138.234 + if(pfn_routine) { \
138.235 + META_DEBUG(loglevel, ("Calling %s:%s()", GameDLL.file, pfn_string)); \
138.236 + pfn_routine pfn_args; \
138.237 + } \
138.238 + /* don't complain for NULL routines in NEW_DLL_FUNCTIONS */ \
138.239 + else if((void*) GameDLL.funcs.api_table != (void*) GameDLL.funcs.newapi_table) { \
138.240 + META_ERROR("Couldn't find api call: %s:%s", GameDLL.file, pfn_string); \
138.241 + status=MRES_UNSET; \
138.242 + } \
138.243 + } \
138.244 + else { \
138.245 + META_DEBUG(loglevel, ("No api table defined for api call: %s:%s", GameDLL.file, pfn_string)); \
138.246 + }
138.247 +
138.248 +// call "real" function, from engine
138.249 +#define CALL_ENGINE_API_void(pfnName, pfn_args) \
138.250 + if(status==MRES_SUPERCEDE) { \
138.251 + META_DEBUG(loglevel, ("Skipped (supercede) engine:%s()", pfn_string)); \
138.252 + /* don't return here; superceded game routine, but still allow \
138.253 + * _post routines to run. \
138.254 + */ \
138.255 + } \
138.256 + else { \
138.257 + pfn_routine=NULL; \
138.258 + pfn_routine=Engine.funcs->pfnName; \
138.259 + if(pfn_routine) { \
138.260 + META_DEBUG(loglevel, ("Calling engine:%s()", pfn_string)); \
138.261 + pfn_routine pfn_args; \
138.262 + } \
138.263 + else { \
138.264 + META_ERROR("Couldn't find api call: engine:%s", pfn_string); \
138.265 + status=MRES_UNSET; \
138.266 + } \
138.267 + }
138.268 +
138.269 +// return (void)
138.270 +#define RETURN_API_void() \
138.271 + return;
138.272 +
138.273 +
138.274 +// ===== macros for type-returning functions ==================================
138.275 +
138.276 +// declare/init some variables
138.277 +#define SETUP_API_CALLS(ret_t, ret_init, FN_TYPE, pfnName, api_info_table) \
138.278 + int i; \
138.279 + ret_t dllret=ret_init; \
138.280 + ret_t override_ret=ret_init; \
138.281 + ret_t pub_override_ret=ret_init; \
138.282 + ret_t orig_ret=ret_init; \
138.283 + ret_t pub_orig_ret=ret_init; \
138.284 + META_RES mres=MRES_UNSET, status=MRES_UNSET, prev_mres=MRES_UNSET; \
138.285 + MPlugin *iplug; \
138.286 + FN_TYPE pfn_routine=NULL; \
138.287 + int loglevel=api_info_table.pfnName.loglevel; \
138.288 + char *pfn_string=api_info_table.pfnName.name; \
138.289 + memset(&PublicMetaGlobals, 0, sizeof(PublicMetaGlobals));
138.290 +
138.291 +// call each plugin
138.292 +#define CALL_PLUGIN_API(post, ret_init, pfnName, pfn_args, MRES_TYPE, api_table) \
138.293 + override_ret=ret_init; \
138.294 + prev_mres=MRES_UNSET; \
138.295 + for(i=0; i < Plugins->endlist; i++) { \
138.296 + if (Plugins->plist[i].status != PL_RUNNING) \
138.297 + continue; \
138.298 + iplug=&Plugins->plist[i]; \
138.299 + if(iplug->api_table && (pfn_routine=iplug->api_table->pfnName)); \
138.300 + else \
138.301 + /* plugin doesn't provide this function */ \
138.302 + continue; \
138.303 + /* initialize PublicMetaGlobals */ \
138.304 + PublicMetaGlobals.mres = MRES_UNSET; \
138.305 + PublicMetaGlobals.prev_mres = prev_mres; \
138.306 + PublicMetaGlobals.status = status; \
138.307 + pub_orig_ret = orig_ret; \
138.308 + PublicMetaGlobals.orig_ret = &pub_orig_ret; \
138.309 + if(status==MRES_TYPE) { \
138.310 + pub_override_ret = override_ret; \
138.311 + PublicMetaGlobals.override_ret = &pub_override_ret; \
138.312 + } \
138.313 + /* call plugin */ \
138.314 + META_DEBUG(loglevel, ("Calling %s:%s%s()", iplug->file, pfn_string, (post?"_Post":""))); \
138.315 + dllret=pfn_routine pfn_args; \
138.316 + /* plugin's result code */ \
138.317 + mres=PublicMetaGlobals.mres; \
138.318 + if(mres > status) \
138.319 + status = mres; \
138.320 + /* save this for successive plugins to see */ \
138.321 + prev_mres = mres; \
138.322 + if(mres==MRES_TYPE) \
138.323 + override_ret = pub_override_ret = dllret; \
138.324 + else if(mres==MRES_UNSET) \
138.325 + META_ERROR("Plugin didn't set meta_result: %s:%s%s()", iplug->file, pfn_string, (post?"_Post":"")); \
138.326 + else if(post && mres==MRES_SUPERCEDE) \
138.327 + META_ERROR("MRES_SUPERCEDE not valid in Post functions: %s:%s%s()", iplug->file, pfn_string, (post?"_Post":"")); \
138.328 + }
138.329 +
138.330 +// call "real" function, from gamedll
138.331 +#define CALL_GAME_API(pfnName, pfn_args, api_table) \
138.332 + if(status==MRES_SUPERCEDE) { \
138.333 + META_DEBUG(loglevel, ("Skipped (supercede) %s:%s()", GameDLL.file, pfn_string)); \
138.334 + orig_ret = pub_orig_ret = override_ret; \
138.335 + PublicMetaGlobals.orig_ret = &pub_orig_ret; \
138.336 + /* don't return here; superceded game routine, but still allow \
138.337 + * _post routines to run. \
138.338 + */ \
138.339 + } \
138.340 + else if(GameDLL.funcs.api_table) { \
138.341 + pfn_routine=NULL; \
138.342 + if(GameDLL.funcs.api_table && (pfn_routine=GameDLL.funcs.api_table->pfnName)); \
138.343 + if(pfn_routine) { \
138.344 + META_DEBUG(loglevel, ("Calling %s:%s()", GameDLL.file, pfn_string)); \
138.345 + dllret=pfn_routine pfn_args; \
138.346 + orig_ret = dllret; \
138.347 + } \
138.348 + /* don't complain for NULL routines in NEW_DLL_FUNCTIONS */ \
138.349 + else if((void*) GameDLL.funcs.api_table != (void*) GameDLL.funcs.newapi_table) { \
138.350 + META_ERROR("Couldn't find api call: %s:%s", GameDLL.file, pfn_string); \
138.351 + status=MRES_UNSET; \
138.352 + } \
138.353 + } \
138.354 + else { \
138.355 + META_DEBUG(loglevel, ("No api table defined for api call: %s:%s", GameDLL.file, pfn_string)); \
138.356 + }
138.357 +
138.358 +// call "real" function, from engine
138.359 +#define CALL_ENGINE_API(pfnName, pfn_args) \
138.360 + if(status==MRES_SUPERCEDE) { \
138.361 + META_DEBUG(loglevel, ("Skipped (supercede) engine:%s()", pfn_string)); \
138.362 + orig_ret = pub_orig_ret = override_ret; \
138.363 + PublicMetaGlobals.orig_ret = &pub_orig_ret; \
138.364 + /* don't return here; superceded game routine, but still allow \
138.365 + * _post routines to run. \
138.366 + */ \
138.367 + } \
138.368 + else { \
138.369 + pfn_routine=NULL; \
138.370 + pfn_routine=Engine.funcs->pfnName; \
138.371 + if(pfn_routine) { \
138.372 + META_DEBUG(loglevel, ("Calling engine:%s()", pfn_string)); \
138.373 + dllret=pfn_routine pfn_args; \
138.374 + orig_ret = dllret; \
138.375 + } \
138.376 + else { \
138.377 + META_ERROR("Couldn't find api call: engine:%s", pfn_string); \
138.378 + status=MRES_UNSET; \
138.379 + } \
138.380 + }
138.381 +
138.382 +// return a value
138.383 +#define RETURN_API() \
138.384 + if(status==MRES_OVERRIDE) { \
138.385 + META_DEBUG(loglevel, ("Returning (override) %s()", pfn_string)); \
138.386 + return(override_ret); \
138.387 + } \
138.388 + else \
138.389 + return(orig_ret);
138.390 +
138.391 +// ===== end macros ===========================================================
138.392 +
138.393 +
138.394 +#endif /* METAMOD_H */
139.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
139.2 +++ b/metamod/mhook.cpp Tue Apr 06 07:36:14 2004 +0000
139.3 @@ -0,0 +1,400 @@
139.4 +// vi: set ts=4 sw=4 :
139.5 +// vim: set tw=75 :
139.6 +
139.7 +#ifdef UNFINISHED
139.8 +
139.9 +// mhook.cpp - functions for list of hooked events (class MHookList)
139.10 +
139.11 +/*
139.12 + * Copyright (c) 2001-2003 Will Day <[email protected]>
139.13 + *
139.14 + * This file is part of Metamod.
139.15 + *
139.16 + * Metamod is free software; you can redistribute it and/or modify it
139.17 + * under the terms of the GNU General Public License as published by the
139.18 + * Free Software Foundation; either version 2 of the License, or (at
139.19 + * your option) any later version.
139.20 + *
139.21 + * Metamod is distributed in the hope that it will be useful, but
139.22 + * WITHOUT ANY WARRANTY; without even the implied warranty of
139.23 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
139.24 + * General Public License for more details.
139.25 + *
139.26 + * You should have received a copy of the GNU General Public License
139.27 + * along with Metamod; if not, write to the Free Software Foundation,
139.28 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
139.29 + *
139.30 + * In addition, as a special exception, the author gives permission to
139.31 + * link the code of this program with the Half-Life Game Engine ("HL
139.32 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
139.33 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
139.34 + * respects for all of the code used other than the HL Engine and MODs
139.35 + * from Valve. If you modify this file, you may extend this exception
139.36 + * to your version of the file, but you are not obligated to do so. If
139.37 + * you do not wish to do so, delete this exception statement from your
139.38 + * version.
139.39 + *
139.40 + */
139.41 +
139.42 +#include <errno.h> // strerror, etc
139.43 +
139.44 +#include <extdll.h> // always
139.45 +
139.46 +#include "mhook.h" // me
139.47 +#include "mplugin.h" // class MPlugin, etc
139.48 +#include "mqueue.h" // class MFuncQueue, etc
139.49 +#include "metamod.h" // global Plugins, etc
139.50 +#include "log_meta.h" // META_ERROR, etc
139.51 +#include "osdep.h" // MUTEX_INIT, etc
139.52 +#include "types_meta.h" // mBOOL
139.53 +
139.54 +
139.55 +///// class MHook:
139.56 +
139.57 +// Note: values are assigned with member initialization lists rather than
139.58 +// using assignment statements, to satisfy -Weffc++, and as described in
139.59 +// O'Reilly "C++: The Core Language" page 109.
139.60 +
139.61 +// Constructor, generic
139.62 +MHook::MHook(void)
139.63 + : index(-1), type(H_NONE), plid(NULL), pl_index(0), pfnHandle(NULL),
139.64 + event(EV_NONE), match(NULL)
139.65 +{
139.66 + return;
139.67 +}
139.68 +
139.69 +// Constructor for Game Event
139.70 +MHook::MHook(int idx, plid_t pid, game_event_t evt, event_func_t pfn)
139.71 + : index(idx), type(H_EVENT), plid(pid), pl_index(0), pfnHandle(pfn),
139.72 + event(evt), match(NULL)
139.73 +{
139.74 + MPlugin *plug;
139.75 + if((plug=Plugins->find(pid))) {
139.76 + pl_index=plug->index;
139.77 + }
139.78 + return;
139.79 +}
139.80 +
139.81 +// Constructor for Log matches
139.82 +MHook::MHook(int idx, plid_t pid, hook_t tp, const char *cp, logmatch_func_t pfn)
139.83 + : index(idx), type(tp), plid(pid), pl_index(0), pfnHandle(pfn),
139.84 + event(EV_NONE), match(cp)
139.85 +{
139.86 + MPlugin *plug;
139.87 + if((plug=Plugins->find(pid))) {
139.88 + pl_index=plug->index;
139.89 + }
139.90 + return;
139.91 +}
139.92 +
139.93 +// Call the hook directly. This should be done only from the main
139.94 +// thread.
139.95 +//
139.96 +// meta_errno values:
139.97 +// - ME_BADREQ missing necessary info
139.98 +// - ME_NOTFOUND couldn't find plugin for this hook ?
139.99 +// - ME_SKIPPED plugin isn't running (paused, etc)
139.100 +// - ME_ARGUMENT unrecognized hook type
139.101 +mBOOL MHook::call(event_args_t *args, const char *logline) {
139.102 + MPlugin *plug;
139.103 + // missing necessary data
139.104 + if(type==H_NONE || !pfnHandle)
139.105 + RETURN_ERRNO(mFALSE, ME_BADREQ);
139.106 + // no event for event hook
139.107 + if(type==H_EVENT && event==EV_NONE)
139.108 + RETURN_ERRNO(mFALSE, ME_BADREQ);
139.109 + // no match string for logline hook
139.110 + if(type!=H_EVENT && !match)
139.111 + RETURN_ERRNO(mFALSE, ME_BADREQ);
139.112 +
139.113 + if(!(plug=Plugins->find(pl_index))) {
139.114 + META_ERROR("Couldn't find plugin index '%d' for hook", pl_index);
139.115 + RETURN_ERRNO(mFALSE, ME_NOTFOUND);
139.116 + }
139.117 +
139.118 + // Skip any paused plugins, for instance...
139.119 + if(plug->status!=PL_RUNNING)
139.120 + RETURN_ERRNO(mFALSE, ME_SKIPPED);
139.121 +
139.122 + switch(type) {
139.123 + case H_EVENT:
139.124 + {
139.125 + event_func_t pfn;
139.126 + pfn=(event_func_t) pfnHandle;
139.127 + pfn(event, args, logline);
139.128 + }
139.129 + break;
139.130 + case H_TRIGGER:
139.131 + case H_STRING:
139.132 + case H_REGEX:
139.133 + {
139.134 + logmatch_func_t pfn;
139.135 + pfn=(logmatch_func_t) pfnHandle;
139.136 + pfn(match, args, logline);
139.137 + }
139.138 + break;
139.139 + default:
139.140 + META_ERROR("Unrecognized hook type (%d) from plugin '%s'",
139.141 + type, plid->name);
139.142 + RETURN_ERRNO(mFALSE, ME_ARGUMENT);
139.143 + break;
139.144 + }
139.145 + return(mTRUE);
139.146 +}
139.147 +
139.148 +// Place function in the queue, to be subsequently called by the main
139.149 +// thread. This should be done only from the log parsing thread.
139.150 +//
139.151 +// meta_errno values:
139.152 +// - ME_ARGUMENT null queue, event args, or logline
139.153 +// - ME_NOMEM malloc failed for new entry to queue
139.154 +mBOOL MHook::enqueue(MFuncQueue *mfq, event_args_t *args, const char *logline) {
139.155 + func_item_t *fp;
139.156 +
139.157 + if(!mfq || !args || !logline)
139.158 + RETURN_ERRNO(mFALSE, ME_ARGUMENT);
139.159 +
139.160 + fp = (func_item_t *) malloc(sizeof(func_item_t));
139.161 + if(!fp) {
139.162 + META_ERROR("malloc failed for func_item_t");
139.163 + RETURN_ERRNO(mFALSE, ME_NOMEM);
139.164 + }
139.165 + fp->hook=this;
139.166 + fp->evargs=args;
139.167 + fp->logline=logline;
139.168 + mfq->push(fp);
139.169 + return(mTRUE);
139.170 +}
139.171 +
139.172 +
139.173 +///// class MHookList:
139.174 +
139.175 +// Constructor
139.176 +MHookList::MHookList(void)
139.177 + : size(MAX_HOOKS), endlist(0), mx_hlist()
139.178 +{
139.179 + // initialize array
139.180 + memset(hlist, 0, sizeof(hlist));
139.181 + endlist=0;
139.182 + MUTEX_INIT(&mx_hlist);
139.183 +}
139.184 +
139.185 +// Add a GameEvent hook to the list.
139.186 +// Returns index of hook (hookid); zero on failure.
139.187 +// meta_errno values:
139.188 +// - ME_ARGUMENT null plid or pfn
139.189 +// - ME_BADREQ no event specified
139.190 +// - ME_MAXREACHED reached max hooks
139.191 +// - ME_NOMEM couldn't malloc to create MHook entry
139.192 +int MHookList::add(plid_t plid, game_event_t event, event_func_t pfnHandle)
139.193 +{
139.194 + int i;
139.195 +
139.196 + if(!plid || !pfnHandle)
139.197 + RETURN_ERRNO(0, ME_ARGUMENT);
139.198 + if(event == EV_NONE)
139.199 + RETURN_ERRNO(0, ME_BADREQ);
139.200 +
139.201 + // any open slots?
139.202 + if(endlist==size) {
139.203 + plugin_info_t *plinfo;
139.204 + plinfo=(plugin_info_t *) plid;
139.205 + META_ERROR("Couldn't add game event hook for plugin '%s'; reached max hooks (%d)", plinfo->name, size);
139.206 + RETURN_ERRNO(0, ME_MAXREACHED);
139.207 + }
139.208 +
139.209 + // Find either:
139.210 + // - a slot in the list that's not being used (malloc'd)
139.211 + // - the end of the list
139.212 + for(i=0; hlist[i]; i++);
139.213 + if(i==endlist)
139.214 + endlist++;
139.215 +
139.216 + MXlock();
139.217 + hlist[i] = new MHook(i+1, plid, event, pfnHandle);
139.218 + MXunlock();
139.219 +
139.220 + // malloc failed?
139.221 + if(!hlist[i]) {
139.222 + plugin_info_t *plinfo;
139.223 + plinfo=(plugin_info_t *) plid;
139.224 + META_ERROR("Couldn't add game event hook for plugin '%s'; malloc failed: %s", plinfo->name, strerror(errno));
139.225 + RETURN_ERRNO(0, ME_NOMEM);
139.226 + }
139.227 +
139.228 + return(i);
139.229 +}
139.230 +
139.231 +// Add a LogEvent hook (trigger, string, or regex) to the list.
139.232 +// Returns index of hook (hookid); zero on failure.
139.233 +// meta_errno values:
139.234 +// - ME_ARGUMENT null plid, match string, or pfn
139.235 +// - ME_BADREQ hook type is none or event (should be trigger, string,
139.236 +// or regex)
139.237 +// - ME_MAXREACHED reached max hooks
139.238 +// - ME_NOMEM couldn't malloc to create MHook entry
139.239 +int MHookList::add(plid_t plid, hook_t type, const char *match,
139.240 + logmatch_func_t pfnHandle)
139.241 +{
139.242 + int i;
139.243 +
139.244 + if(!plid || !match || !pfnHandle)
139.245 + RETURN_ERRNO(0, ME_ARGUMENT);
139.246 + if(type == H_NONE || type == H_EVENT)
139.247 + RETURN_ERRNO(0, ME_BADREQ);
139.248 +
139.249 + // any open slots?
139.250 + if(endlist==size) {
139.251 + plugin_info_t *plinfo;
139.252 + plinfo=(plugin_info_t *) plid;
139.253 + META_ERROR("Couldn't add log hook '%s' for plugin '%s'; reached max hooks (%d)", match, plinfo->name, size);
139.254 + RETURN_ERRNO(0, ME_MAXREACHED);
139.255 + }
139.256 +
139.257 + // Find either:
139.258 + // - a slot in the list that's not being used (malloc'd)
139.259 + // - the end of the list
139.260 + for(i=0; hlist[i]; i++);
139.261 + if(i==endlist)
139.262 + endlist++;
139.263 +
139.264 + MXlock();
139.265 + hlist[i] = new MHook(i+1, plid, type, match, pfnHandle);
139.266 + MXunlock();
139.267 +
139.268 + // malloc failed?
139.269 + if(!hlist[i]) {
139.270 + plugin_info_t *plinfo;
139.271 + plinfo=(plugin_info_t *) plid;
139.272 + META_ERROR("Couldn't add game event hook for plugin '%s'; malloc failed: %s", plinfo->name, strerror(errno));
139.273 + RETURN_ERRNO(0, ME_NOMEM);
139.274 + }
139.275 +
139.276 + return(i);
139.277 +}
139.278 +
139.279 +// Remove hook at the given index in list.
139.280 +//
139.281 +// meta_errno values:
139.282 +// - ME_NOTFOUND no hook at that index
139.283 +// - ME_BADREQ plugin trying to remove another plugin's hook?
139.284 +mBOOL MHookList::remove(plid_t plid, int hindex) {
139.285 + int i=hindex;
139.286 + if(!hlist[i])
139.287 + RETURN_ERRNO(mFALSE, ME_NOTFOUND);
139.288 + if(hlist[i]->plid != plid)
139.289 + RETURN_ERRNO(mFALSE, ME_BADREQ);
139.290 +
139.291 + MXlock();
139.292 + delete(hlist[i]);
139.293 + hlist[i]=NULL;
139.294 + MXunlock();
139.295 + return(mTRUE);
139.296 +}
139.297 +
139.298 +// Remove any hooks for the specified plugin.
139.299 +int MHookList::remove_all(plid_t plid) {
139.300 + int i;
139.301 + int count=0;
139.302 +
139.303 + for(i=0; i < endlist && hlist[i]; i++) {
139.304 + if(hlist[i]->plid == plid) {
139.305 + MXlock();
139.306 + delete(hlist[i]);
139.307 + hlist[i]=NULL;
139.308 + MXunlock();
139.309 + count++;
139.310 + }
139.311 + }
139.312 + return(count);
139.313 +}
139.314 +
139.315 +// Call a hook directly. This should only be done from the main thread,
139.316 +// and then only for pre-determined-event hooks. Note logline is allowed
139.317 +// to be empty, as some events aren't logmsg-detected.
139.318 +//
139.319 +// meta_errno values:
139.320 +// - ME_ARGUMENT null args
139.321 +// - ME_BADREQ args doesn't correspond to an Event hook
139.322 +mBOOL MHookList::call(event_args_t *evargs, const char *logline)
139.323 +{
139.324 + int i;
139.325 +
139.326 + if(!evargs)
139.327 + RETURN_ERRNO(mFALSE, ME_ARGUMENT);
139.328 + if(evargs->evtype==EV_NONE)
139.329 + RETURN_ERRNO(mFALSE, ME_BADREQ);
139.330 +
139.331 + MXlock();
139.332 + for(i=0; i < endlist && hlist[i]; i++) {
139.333 + if(hlist[i]->event == evargs->evtype)
139.334 + hlist[i]->call(evargs, logline);
139.335 + }
139.336 + MXunlock();
139.337 + return(mTRUE);
139.338 +}
139.339 +
139.340 +// Find any matching hooks, and place them in the queue, to be subsequently
139.341 +// called by the main thread. This should be done only from the log
139.342 +// parsing thread.
139.343 +// meta_errno values:
139.344 +// - ME_ARGUMENT null args
139.345 +// - ME_BADREQ invalid hook type
139.346 +mBOOL MHookList::enqueue(MFuncQueue *mfq, hook_t htype, event_args_t *evargs,
139.347 + const char *logline)
139.348 +{
139.349 + int i;
139.350 + META_ERRNO ret=ME_NOERROR;
139.351 +
139.352 + if(!mfq || !evargs || !logline)
139.353 + RETURN_ERRNO(mFALSE, ME_ARGUMENT);
139.354 + if(htype==H_NONE)
139.355 + RETURN_ERRNO(mFALSE, ME_BADREQ);
139.356 +
139.357 + MXlock();
139.358 + for(i=0; i < endlist && hlist[i] && hlist[i]->type==htype; i++) {
139.359 + MHook *ihook;
139.360 + ihook=hlist[i];
139.361 + switch(ihook->type) {
139.362 + case H_EVENT:
139.363 + if(ihook->event == evargs->evtype)
139.364 + ihook->enqueue(mfq, evargs, logline);
139.365 + break;
139.366 + case H_TRIGGER:
139.367 + if(strmatch(ihook->match, evargs->action))
139.368 + ihook->enqueue(mfq, evargs, logline);
139.369 + break;
139.370 + case H_STRING:
139.371 + if(strstr(logline, ihook->match))
139.372 + ihook->enqueue(mfq, evargs, logline);
139.373 + break;
139.374 + case H_REGEX:
139.375 + META_LOG("Not currently handling REGEX hooks...");
139.376 + ret=ME_BADREQ;
139.377 + break;
139.378 + default:
139.379 + META_ERROR("Invalid hook type (%d) encountered", ihook->type);
139.380 + ret=ME_BADREQ;
139.381 + break;
139.382 + }
139.383 + }
139.384 + MXunlock();
139.385 + if(ret==ME_NOERROR)
139.386 + return(mTRUE);
139.387 + else
139.388 + RETURN_ERRNO(mFALSE, ret);
139.389 +}
139.390 +
139.391 +// Return a string corresponding to the hook type.
139.392 +char *MHookList::str_htype(hook_t htype) {
139.393 + switch(htype) {
139.394 + case H_NONE: return("NONE");
139.395 + case H_EVENT: return("EVENT");
139.396 + case H_TRIGGER: return("TRIGGER");
139.397 + case H_STRING: return("STRING");
139.398 + case H_REGEX: return("REGEX");
139.399 + default: return("(unknown)");
139.400 + }
139.401 +}
139.402 +
139.403 +#endif /* UNFINISHED */
140.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
140.2 +++ b/metamod/mhook.h Tue Apr 06 07:36:14 2004 +0000
140.3 @@ -0,0 +1,160 @@
140.4 +// vi: set ts=4 sw=4 :
140.5 +// vim: set tw=75 :
140.6 +
140.7 +#ifdef UNFINISHED
140.8 +
140.9 +// mhook.h - class and types to describe hooks and hooklists
140.10 +
140.11 +/*
140.12 + * Copyright (c) 2001-2003 Will Day <[email protected]>
140.13 + *
140.14 + * This file is part of Metamod.
140.15 + *
140.16 + * Metamod is free software; you can redistribute it and/or modify it
140.17 + * under the terms of the GNU General Public License as published by the
140.18 + * Free Software Foundation; either version 2 of the License, or (at
140.19 + * your option) any later version.
140.20 + *
140.21 + * Metamod is distributed in the hope that it will be useful, but
140.22 + * WITHOUT ANY WARRANTY; without even the implied warranty of
140.23 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
140.24 + * General Public License for more details.
140.25 + *
140.26 + * You should have received a copy of the GNU General Public License
140.27 + * along with Metamod; if not, write to the Free Software Foundation,
140.28 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
140.29 + *
140.30 + * In addition, as a special exception, the author gives permission to
140.31 + * link the code of this program with the Half-Life Game Engine ("HL
140.32 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
140.33 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
140.34 + * respects for all of the code used other than the HL Engine and MODs
140.35 + * from Valve. If you modify this file, you may extend this exception
140.36 + * to your version of the file, but you are not obligated to do so. If
140.37 + * you do not wish to do so, delete this exception statement from your
140.38 + * version.
140.39 + *
140.40 + */
140.41 +
140.42 +#ifndef MHOOK_H
140.43 +#define MHOOK_H
140.44 +
140.45 +#include "plinfo.h" // plid_t, etc
140.46 +#include "types_meta.h" // mBOOL
140.47 +#include "osdep.h" // MUTEX_T, etc
140.48 +
140.49 +#define MAX_HOOKS 100
140.50 +
140.51 +// Particular game events that we detect, though whatever means we can best
140.52 +// find.
140.53 +typedef enum {
140.54 + EV_NONE = 0, // no event here...
140.55 + // non-log detected
140.56 + EV_PLAYER_CONNECT, // ie ClientConnect
140.57 + EV_PLAYER_ENTER, // ie ClientPutInServer
140.58 + EV_PLAYER_LEAVE, // ie ClientDisconnect (opposite PutInServer)
140.59 + EV_PLAYER_SPAWN, // deadflag change to DEAD_NO
140.60 + EV_PLAYER_DEATH, // deadflag change to DEAD_DEAD
140.61 + EV_PLAYER_CHANGE_NAME, // netname change in ClientUserInfoChanged
140.62 + // log detected
140.63 + EV_PLAYER_JOIN_TEAM, // ie "Joe<15><785><>" joined team "CT"
140.64 + EV_PLAYER_SUICIDE, // ie "Joe<15><785><CT>" committed suicide ...
140.65 + EV_PLAYER_CHANGE_ROLE, // TFC: ie "Joe<15><785><Red>" changed role to "Pyro"
140.66 + EV_TEAM_KILL, // ie "Joe<15><785><CT>" killed "Bob<16><342><CT>" ...
140.67 + EV_WEAPON_KILL, // ie "Joe<15><785><CT>" killed "Sam<17><197><TERRORIST>" with "sg552"
140.68 + EV_TEAM_SCORE, // ie Team "CT" scored "7" with "2" players
140.69 +} game_event_t;
140.70 +
140.71 +// Info corresponding to a player, in particular the info found in the logline.
140.72 +typedef struct {
140.73 + char *name;
140.74 + int userid;
140.75 + int wonid;
140.76 + char *team;
140.77 +} event_player_t;
140.78 +
140.79 +// Info for an event, mostly corresponding to info from a logline.
140.80 +typedef struct {
140.81 + game_event_t evtype; // specific event, if identified.
140.82 + char *buf; // copy of the logmsg, with embedded NULLs
140.83 + event_player_t *player;
140.84 + char *action; // "triggered" string, or a generic action string
140.85 + event_player_t *target;
140.86 + char *with;
140.87 +} event_args_t;
140.88 +
140.89 +// Types for callback functions to be called for requested event/logline.
140.90 +typedef void (*event_func_t) (game_event_t event, event_args_t *args,
140.91 + const char *logline);
140.92 +typedef void (*logmatch_func_t) (const char *pattern, event_args_t *args,
140.93 + const char *logline);
140.94 +
140.95 +// The 4 types of hook requests we accept.
140.96 +typedef enum {
140.97 + H_NONE = 0,
140.98 + H_EVENT, // Specific event, from a short list.
140.99 + H_TRIGGER, // A given "triggered" string.
140.100 + H_STRING, // Any substring of logline.
140.101 + H_REGEX, // A regular expression matching of logline.
140.102 +} hook_t;
140.103 +
140.104 +
140.105 +// Class for individual hook function, as registered by a plugin.
140.106 +class MHook {
140.107 + friend class MHookList;
140.108 + friend class MFuncQueue;
140.109 + private:
140.110 + // data:
140.111 + int index;
140.112 + hook_t type; // EVENT, TRIGGER, etc
140.113 + plid_t plid;
140.114 + int pl_index; // index of matching plugin
140.115 + void *pfnHandle;
140.116 + game_event_t event; // if type is H_EVENT
140.117 + const char *match; // if type is TRIGGER, STRING, or REGEX
140.118 + // Copy/Assignment constructors, to satisfy -Weffc++.
140.119 + // Note however, we declare them private and don't define them, since
140.120 + // we don't ever want to copy or assign instances of the class.
140.121 + // (thanks to O'Reilly "C++: The Core Language", page 113)
140.122 + MHook(const MHook &src);
140.123 + void operator=(const MHook &src);
140.124 + // constructors:
140.125 + MHook(void);
140.126 + MHook(int idx, plid_t pid, game_event_t evt, event_func_t pfn);
140.127 + MHook(int idx, plid_t pid, hook_t tp, const char *cp, logmatch_func_t pfn);
140.128 + // functions:
140.129 + mBOOL call(event_args_t *args, const char *logline);
140.130 + mBOOL enqueue(MFuncQueue *mfq, event_args_t *args, const char *logline);
140.131 + public:
140.132 + // no public interfaces; everything done from friend MHookList.
140.133 +};
140.134 +
140.135 +
140.136 +// Class for list of registered hook functions.
140.137 +class MHookList {
140.138 + private:
140.139 + // data:
140.140 + MHook *hlist[MAX_HOOKS];
140.141 + int size; // set to MAX_HOOKS in constructor
140.142 + int endlist;
140.143 + MUTEX_T mx_hlist;
140.144 + int MXlock(void) { return(MUTEX_LOCK(&mx_hlist)); };
140.145 + int MXunlock(void) { return(MUTEX_UNLOCK(&mx_hlist)); };
140.146 + public:
140.147 + // constructor:
140.148 + MHookList(void);
140.149 + // functions:
140.150 + int add(plid_t plid, game_event_t event, event_func_t pfnHandle);
140.151 + int add(plid_t plid, hook_t type, const char *match,
140.152 + logmatch_func_t pfnHandle);
140.153 + mBOOL remove(plid_t plid, int hindex);
140.154 + int remove_all(plid_t plid);
140.155 + mBOOL call(event_args_t *args, const char *logline);
140.156 + mBOOL enqueue(MFuncQueue *mfq, hook_t htype, event_args_t *evargs,
140.157 + const char *logline);
140.158 + char *str_htype(hook_t htype);
140.159 +};
140.160 +
140.161 +#endif /* MHOOK_H */
140.162 +
140.163 +#endif /* UNFINISHED */
141.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
141.2 +++ b/metamod/mklinkgame.sh Tue Apr 06 07:36:14 2004 +0000
141.3 @@ -0,0 +1,69 @@
141.4 +#!/bin/sh
141.5 +PATH=/bin:/usr/bin:/usr/sbin
141.6 +
141.7 +build=0
141.8 +if [ ! -s linkgame.cpp ]; then
141.9 + build=1
141.10 +else
141.11 + for i in ents/*; do
141.12 + if [ $i -nt linkgame.cpp ]; then
141.13 + build=1
141.14 + fi
141.15 + done
141.16 +fi
141.17 +
141.18 +if [ "$build" = 0 ]; then
141.19 + exit
141.20 +fi
141.21 +echo "Building linkgame.cpp" >& 2
141.22 +
141.23 +cat > linkgame.cpp <<EOC
141.24 +// vi: set ts=4 sw=4 :
141.25 +// vim: set tw=75 :
141.26 +
141.27 +// linkgame.cpp - export entities from mod "games" back to the HL engine
141.28 +
141.29 +/*
141.30 + * Copyright (c) 2001-2002 Will Day <[email protected]>
141.31 + *
141.32 + * This file is part of Metamod.
141.33 + *
141.34 + * Metamod is free software; you can redistribute it and/or modify it
141.35 + * under the terms of the GNU General Public License as published by the
141.36 + * Free Software Foundation; either version 2 of the License, or (at
141.37 + * your option) any later version.
141.38 + *
141.39 + * Metamod is distributed in the hope that it will be useful, but
141.40 + * WITHOUT ANY WARRANTY; without even the implied warranty of
141.41 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
141.42 + * General Public License for more details.
141.43 + *
141.44 + * You should have received a copy of the GNU General Public License
141.45 + * along with Metamod; if not, write to the Free Software Foundation,
141.46 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
141.47 + *
141.48 + * In addition, as a special exception, the author gives permission to
141.49 + * link the code of this program with the Half-Life Game Engine ("HL
141.50 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
141.51 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
141.52 + * respects for all of the code used other than the HL Engine and MODs
141.53 + * from Valve. If you modify this file, you may extend this exception
141.54 + * to your version of the file, but you are not obligated to do so. If
141.55 + * you do not wish to do so, delete this exception statement from your
141.56 + * version.
141.57 + *
141.58 + */
141.59 +
141.60 +#include <extdll.h> // always
141.61 +
141.62 +#include "linkent.h" // LINK_ENTITY_TO_GAME
141.63 +
141.64 +// Entity list for gamedlls adapted from adminmod linkfunc.cpp.
141.65 +
141.66 +// NOTE: This list of entities is automatically generated via the script
141.67 +// "mklinkgame.sh". See the files in the directory "ents" for the actual
141.68 +// list of entities.
141.69 +
141.70 +EOC
141.71 +
141.72 +egrep -hv "^#|^//|^$" ents/* | sort -u | sed "s/.*/LINK_ENTITY_TO_GAME(&);/" >> linkgame.cpp
142.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
142.2 +++ b/metamod/mlist.cpp Tue Apr 06 07:36:14 2004 +0000
142.3 @@ -0,0 +1,656 @@
142.4 +// vi: set ts=4 sw=4 :
142.5 +// vim: set tw=75 :
142.6 +
142.7 +// mlist.cpp - functions for list of plugins (class MPluginList)
142.8 +
142.9 +/*
142.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
142.11 + *
142.12 + * This file is part of Metamod.
142.13 + *
142.14 + * Metamod is free software; you can redistribute it and/or modify it
142.15 + * under the terms of the GNU General Public License as published by the
142.16 + * Free Software Foundation; either version 2 of the License, or (at
142.17 + * your option) any later version.
142.18 + *
142.19 + * Metamod is distributed in the hope that it will be useful, but
142.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
142.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
142.22 + * General Public License for more details.
142.23 + *
142.24 + * You should have received a copy of the GNU General Public License
142.25 + * along with Metamod; if not, write to the Free Software Foundation,
142.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
142.27 + *
142.28 + * In addition, as a special exception, the author gives permission to
142.29 + * link the code of this program with the Half-Life Game Engine ("HL
142.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
142.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
142.32 + * respects for all of the code used other than the HL Engine and MODs
142.33 + * from Valve. If you modify this file, you may extend this exception
142.34 + * to your version of the file, but you are not obligated to do so. If
142.35 + * you do not wish to do so, delete this exception statement from your
142.36 + * version.
142.37 + *
142.38 + */
142.39 +
142.40 +#include <errno.h> // errno, etc
142.41 +
142.42 +#include <extdll.h> // always
142.43 +
142.44 +#include "mlist.h" // me
142.45 +#include "mplugin.h" // class MPlugin
142.46 +#include "plinfo.h" // plid_t, etc
142.47 +#include "commands_meta.h" // cmd_meta_pluginlist, etc
142.48 +#include "metamod.h" // GameDLL, etc
142.49 +#include "types_meta.h" // mBOOL
142.50 +#include "log_meta.h" // META_LOG, etc
142.51 +#include "osdep.h" // win32 snprintf, normalize_pathname,
142.52 +
142.53 +// Constructor
142.54 +MPluginList::MPluginList(const char *ifile)
142.55 + : size(MAX_PLUGINS), endlist(0)
142.56 +{
142.57 + int i;
142.58 + // store filename of ini file
142.59 + STRNCPY(inifile, ifile, sizeof(inifile));
142.60 + // initialize array
142.61 + memset(plist, 0, sizeof(plist));
142.62 + for(i=0; i< size; i++) {
142.63 + plist[i].index=i+1; // 1-based
142.64 + }
142.65 + endlist=0;
142.66 +}
142.67 +
142.68 +// Find a plugin based on the plugin index #.
142.69 +// meta_errno values:
142.70 +// - ME_ARGUMENT invalid pindex
142.71 +// - ME_NOTFOUND couldn't find a matching plugin
142.72 +MPlugin *MPluginList::find(int pindex) {
142.73 + MPlugin *pfound;
142.74 + if(pindex <= 0)
142.75 + RETURN_ERRNO(NULL, ME_ARGUMENT);
142.76 + pfound=&plist[pindex-1];
142.77 + if(pfound->status < PL_VALID)
142.78 + RETURN_ERRNO(NULL, ME_NOTFOUND);
142.79 + else
142.80 + return(pfound);
142.81 +}
142.82 +
142.83 +// Find a plugin with the given plid.
142.84 +// meta_errno values:
142.85 +// - ME_ARGUMENT null plid_t
142.86 +// - ME_NOTFOUND couldn't find a matching plugin
142.87 +MPlugin *MPluginList::find(plid_t id) {
142.88 + int i;
142.89 +
142.90 + if(!id)
142.91 + RETURN_ERRNO(NULL, ME_ARGUMENT);
142.92 + for(i=0; i < endlist; i++) {
142.93 + if(plist[i].status < PL_VALID)
142.94 + continue;
142.95 + if(plist[i].info == id)
142.96 + return(&plist[i]);
142.97 + }
142.98 + RETURN_ERRNO(NULL, ME_NOTFOUND);
142.99 +}
142.100 +
142.101 +// Find a plugin with the given pathname.
142.102 +// meta_errno values:
142.103 +// - ME_ARGUMENT null path
142.104 +// - ME_NOTFOUND couldn't find a matching plugin
142.105 +MPlugin *MPluginList::find(const char *findpath) {
142.106 + int i;
142.107 +
142.108 + if(!findpath)
142.109 + RETURN_ERRNO(NULL, ME_ARGUMENT);
142.110 + META_DEBUG(8, ("Looking for loaded plugin with dlfnamepath: %s", findpath));
142.111 + for(i=0; i < endlist; i++) {
142.112 + META_DEBUG(9, ("Looking at: plugin %s loadedpath: %s", plist[i].file, plist[i].pathname));
142.113 + if(plist[i].status < PL_VALID)
142.114 + continue;
142.115 + if(strmatch(plist[i].pathname, findpath)) {
142.116 + META_DEBUG(8, ("Found loaded plugin %s", plist[i].file));
142.117 + return(&plist[i]);
142.118 + }
142.119 + }
142.120 + META_DEBUG(8, ("No loaded plugin found with path: %s", findpath));
142.121 + RETURN_ERRNO(NULL, ME_NOTFOUND);
142.122 +}
142.123 +
142.124 +// Find a plugin that uses the given memory location.
142.125 +// meta_errno values:
142.126 +// - ME_ARGUMENT null memptr
142.127 +// - ME_NOTFOUND couldn't find a matching plugin
142.128 +// - errno's from DLFNAME()
142.129 +MPlugin *MPluginList::find_memloc(void *memptr) {
142.130 + const char *dlfile;
142.131 +
142.132 + if(!memptr)
142.133 + RETURN_ERRNO(NULL, ME_ARGUMENT);
142.134 + if(!(dlfile=DLFNAME(memptr))) {
142.135 + META_DEBUG(8, ("DLFNAME failed to find memloc %d", memptr));
142.136 + // meta_errno should be already set in DLFNAME
142.137 + return(NULL);
142.138 + }
142.139 + return(find(dlfile));
142.140 +}
142.141 +
142.142 +// Find a plugin with non-ambiguous prefix string matching desc, file,
142.143 +// name, or logtag.
142.144 +// meta_errno values:
142.145 +// - ME_ARGUMENT null prefix
142.146 +// - ME_NOTFOUND couldn't find a matching plugin
142.147 +// - ME_NOTUNIQ found multiple matches; no unique match
142.148 +MPlugin *MPluginList::find_match(const char *prefix) {
142.149 + int i, len;
142.150 + MPlugin *iplug, *pfound;
142.151 + char buf[NAME_MAX];
142.152 +
142.153 + if(!prefix)
142.154 + RETURN_ERRNO(NULL, ME_ARGUMENT);
142.155 + pfound=NULL;
142.156 + len=strlen(prefix);
142.157 + snprintf(buf, sizeof(buf), "mm_%s", prefix);
142.158 + for(i=0; i < endlist; i++) {
142.159 + iplug=&plist[i];
142.160 + if(iplug->status < PL_VALID)
142.161 + continue;
142.162 + if(iplug->info && strncasecmp(iplug->info->name, prefix, len) == 0) {
142.163 + if(pfound)
142.164 + RETURN_ERRNO(NULL, ME_NOTUNIQ);
142.165 + pfound=iplug;
142.166 + continue;
142.167 + }
142.168 + else if(strncasecmp(iplug->desc, prefix, len) == 0) {
142.169 + if(pfound)
142.170 + RETURN_ERRNO(NULL, ME_NOTUNIQ);
142.171 + pfound=iplug;
142.172 + continue;
142.173 + }
142.174 + else if(strncasecmp(iplug->file, prefix, len) == 0) {
142.175 + if(pfound)
142.176 + RETURN_ERRNO(NULL, ME_NOTUNIQ);
142.177 + pfound=iplug;
142.178 + continue;
142.179 + }
142.180 + else if(strncasecmp(iplug->file, buf, strlen(buf)) == 0) {
142.181 + if(pfound)
142.182 + RETURN_ERRNO(NULL, ME_NOTUNIQ);
142.183 + pfound=iplug;
142.184 + continue;
142.185 + }
142.186 + else if(iplug->info
142.187 + && strncasecmp(iplug->info->logtag, prefix, len) == 0)
142.188 + {
142.189 + if(pfound)
142.190 + RETURN_ERRNO(NULL, ME_NOTUNIQ);
142.191 + pfound=iplug;
142.192 + continue;
142.193 + }
142.194 + }
142.195 + if(pfound)
142.196 + return(pfound);
142.197 + else
142.198 + RETURN_ERRNO(NULL, ME_NOTFOUND);
142.199 +}
142.200 +
142.201 +// Add a plugin to the list.
142.202 +// meta_errno values:
142.203 +// - ME_MAXREACHED reached max plugins
142.204 +MPlugin *MPluginList::add(MPlugin *padd) {
142.205 + int i;
142.206 + MPlugin *iplug;
142.207 +
142.208 + // Find either:
142.209 + // - a slot in the list that's not being used
142.210 + // - the end of the list
142.211 + for(i=0; i < endlist && plist[i].status != PL_EMPTY; i++);
142.212 +
142.213 + // couldn't find a slot to use
142.214 + if(i==size) {
142.215 + META_ERROR("Couldn't add plugin '%s' to list; reached max plugins (%d)",
142.216 + padd->file, i);
142.217 + RETURN_ERRNO(NULL, ME_MAXREACHED);
142.218 + }
142.219 +
142.220 + // if we found the end of the list, advance end marker
142.221 + if(i==endlist)
142.222 + endlist++;
142.223 + iplug = &plist[i];
142.224 +
142.225 + // copy filename into this free slot
142.226 + STRNCPY(iplug->filename, padd->filename, sizeof(iplug->filename));
142.227 + // Copy file offset ptr.
142.228 + // Can't just copy ptr, as it points to offset in padd, which will go
142.229 + // away; need to point to corresponding offset in iplug.
142.230 + iplug->file = iplug->filename + (padd->file - padd->filename);
142.231 + // copy description
142.232 + STRNCPY(iplug->desc, padd->desc, sizeof(iplug->desc));
142.233 + // copy pathname
142.234 + STRNCPY(iplug->pathname, padd->pathname, sizeof(iplug->pathname));
142.235 + // copy source
142.236 + iplug->source=padd->source;
142.237 + // copy status
142.238 + iplug->status=padd->status;
142.239 +
142.240 + return(iplug);
142.241 +}
142.242 +
142.243 +
142.244 +// Read plugins.ini at server startup.
142.245 +// meta_errno values:
142.246 +// - ME_NOFILE ini file missing or empty
142.247 +mBOOL MPluginList::ini_startup() {
142.248 + FILE *fp;
142.249 + char line[MAX_STRBUF_LEN];
142.250 + int n, ln;
142.251 +
142.252 + if(!valid_gamedir_file(inifile)) {
142.253 + META_ERROR("ini: Metamod plugins file empty or missing: %s", inifile);
142.254 + RETURN_ERRNO(mFALSE, ME_NOFILE);
142.255 + }
142.256 + full_gamedir_path(inifile, inifile);
142.257 +
142.258 + fp=fopen(inifile, "r");
142.259 + if(!fp) {
142.260 + META_ERROR("ini: Unable to open plugins file '%s': %s", inifile,
142.261 + strerror(errno));
142.262 + RETURN_ERRNO(mFALSE, ME_NOFILE);
142.263 + }
142.264 +
142.265 + META_LOG("ini: Begin reading plugins list: %s", inifile);
142.266 + for(n=0, ln=1;
142.267 + !feof(fp) && fgets(line, sizeof(line), fp) && n < size;
142.268 + ln++)
142.269 + {
142.270 + // Remove line terminations.
142.271 + char *cp;
142.272 + if((cp=strrchr(line, '\r')))
142.273 + *cp='\0';
142.274 + if((cp=strrchr(line, '\n')))
142.275 + *cp='\0';
142.276 + // Parse directly into next entry in array
142.277 + if(!plist[n].ini_parseline(line)) {
142.278 + if(meta_errno==ME_FORMAT)
142.279 + META_ERROR("ini: Skipping malformed line %d of %s", ln,
142.280 + inifile);
142.281 + continue;
142.282 + }
142.283 + // Check for a duplicate - an existing entry with this pathname.
142.284 + if(find(plist[n].pathname)) {
142.285 + META_ERROR("ini: Skipping duplicate plugin, line %d of %s: %s",
142.286 + ln, inifile, plist[n].pathname);
142.287 + continue;
142.288 + }
142.289 + plist[n].action=PA_LOAD;
142.290 + META_LOG("ini: Read plugin config for: %s", plist[n].desc);
142.291 + n++;
142.292 + endlist=n; // mark end of list
142.293 + }
142.294 + META_LOG("ini: Finished reading plugins list: %s; Found %d plugins to load",
142.295 + inifile, n);
142.296 +
142.297 + fclose(fp);
142.298 + if(!n) {
142.299 + META_ERROR("ini: Warning; no plugins found to load?");
142.300 + }
142.301 + return(mTRUE);
142.302 +}
142.303 +
142.304 +// Re-read plugins.ini looking for added/deleted/changed plugins.
142.305 +// meta_errno values:
142.306 +// - ME_NOFILE ini file missing or empty
142.307 +mBOOL MPluginList::ini_refresh() {
142.308 + FILE *fp;
142.309 + char line[MAX_STRBUF_LEN];
142.310 + int n, ln;
142.311 + MPlugin pl_temp;
142.312 + MPlugin *pl_found, *pl_added;
142.313 +
142.314 + fp=fopen(inifile, "r");
142.315 + if(!fp) {
142.316 + META_ERROR("ini: Unable to open plugins file '%s': %s", inifile,
142.317 + strerror(errno));
142.318 + RETURN_ERRNO(mFALSE, ME_NOFILE);
142.319 + }
142.320 +
142.321 + META_LOG("ini: Begin re-reading plugins list: %s", inifile);
142.322 + for(n=0, ln=1;
142.323 + !feof(fp) && fgets(line, sizeof(line), fp) && n < size;
142.324 + ln++)
142.325 + {
142.326 + // Remove line terminations.
142.327 + char *cp;
142.328 + if((cp=strrchr(line, '\r')))
142.329 + *cp='\0';
142.330 + if((cp=strrchr(line, '\n')))
142.331 + *cp='\0';
142.332 + // Parse into a temp plugin
142.333 + memset(&pl_temp, 0, sizeof(pl_temp));
142.334 + if(!pl_temp.ini_parseline(line)) {
142.335 + if(meta_errno==ME_FORMAT)
142.336 + META_ERROR("ini: Skipping malformed line %d of %s",
142.337 + ln, inifile);
142.338 + continue;
142.339 + }
142.340 + // Try to find plugin with this pathname in the current list of
142.341 + // plugins.
142.342 + if(!(pl_found=find(pl_temp.pathname))) {
142.343 + // new plugin; add to list
142.344 + if((pl_added=add(&pl_temp))) {
142.345 + // try to load this plugin at the next opportunity
142.346 + pl_added->action=PA_LOAD;
142.347 + }
142.348 + else
142.349 + // error details logged in add()
142.350 + continue;
142.351 + }
142.352 + else {
142.353 + // This plugin is already in the current list of plugins.
142.354 + // Pathname already matches. Recopy desc, if specified in
142.355 + // plugins.ini.
142.356 + if(pl_temp.desc[0] != '<')
142.357 + STRNCPY(pl_found->desc, pl_temp.desc, sizeof(pl_found->desc));
142.358 +
142.359 + // Check the file to see if it looks like it's been modified
142.360 + // since we last loaded it.
142.361 + if(!pl_found->newer_file()) {
142.362 + if(meta_errno==ME_NOFILE) {
142.363 + META_ERROR("ini: Skipping plugin, couldn't stat file '%s': %s",
142.364 + pl_found->pathname, strerror(errno));
142.365 + continue;
142.366 + }
142.367 + else {
142.368 + // File hasn't been updated.
142.369 + // Keep plugin (don't let refresh() unload it).
142.370 + pl_found->action=PA_KEEP;
142.371 + }
142.372 + }
142.373 + // Newer file on disk.
142.374 + else if(pl_found->status >= PL_OPENED) {
142.375 + META_DEBUG(2, ("ini: Plugin '%s' has newer file on disk", pl_found->desc));
142.376 + pl_found->action=PA_RELOAD;
142.377 + }
142.378 + else
142.379 + META_ERROR("ini: Plugin '%s' has newer file, but unexpected status (%s)",
142.380 + pl_found->desc, pl_found->str_status());
142.381 + }
142.382 + META_LOG("ini: Read plugin config for: %s", plist[n].desc);
142.383 + n++;
142.384 + }
142.385 + META_LOG("ini: Finished reading plugins list: %s; Found %d plugins", inifile, n);
142.386 +
142.387 + fclose(fp);
142.388 + if(!n) {
142.389 + META_ERROR("ini: Warning; no plugins found to load?");
142.390 + }
142.391 + return(mTRUE);
142.392 +}
142.393 +
142.394 +// Load a plugin from a console command.
142.395 +// meta_errno values:
142.396 +// - errno's from cmd_parseline()
142.397 +// - errno's from resolve()
142.398 +// - ME_ALREADY this plugin already loaded
142.399 +// - errno's from add()
142.400 +// - errno's from load()
142.401 +mBOOL MPluginList::cmd_addload(const char *args) {
142.402 + MPlugin pl_temp;
142.403 + MPlugin *pl_found, *pl_added;
142.404 +
142.405 + // XXX move back to comands_meta ?
142.406 +
142.407 + // parse into a temp plugin
142.408 + memset(&pl_temp, 0, sizeof(pl_temp));
142.409 + if(pl_temp.cmd_parseline(args) != mTRUE) {
142.410 + META_CONS("Couldn't parse 'meta load' arguments: %s", args);
142.411 + // meta_errno should be already set in cmd_parseline()
142.412 + return(mFALSE);
142.413 + }
142.414 +
142.415 + // resolve given path into a file; accepts various "shortcut"
142.416 + // pathnames.
142.417 + if(pl_temp.resolve() != mTRUE) {
142.418 + // Couldn't find a matching file on disk
142.419 + META_CONS("Couldn't resolve given path into a file: %s",
142.420 + pl_temp.file);
142.421 + // meta_errno should be already set in resolve()
142.422 + return(mFALSE);
142.423 + }
142.424 +
142.425 + // Try to find plugin with this pathname in the current list of
142.426 + // plugins.
142.427 + if((pl_found=find(pl_temp.pathname))) {
142.428 + // Already in list
142.429 + META_CONS("Plugin '%s' already in current list; file=%s desc='%s'",
142.430 + pl_temp.file, pl_found->file, pl_found->desc);
142.431 + RETURN_ERRNO(mFALSE, ME_ALREADY);
142.432 + }
142.433 + // new plugin; add to list
142.434 + if(!(pl_added=add(&pl_temp))) {
142.435 + META_CONS("Couldn't add plugin '%s' to list; see log", pl_temp.desc);
142.436 + // meta_errno should be already set in add()
142.437 + return(mFALSE);
142.438 + }
142.439 +
142.440 + // try to load new plugin
142.441 + pl_added->action=PA_LOAD;
142.442 + if(!pl_added->load(PT_ANYTIME)) {
142.443 + // load failed
142.444 + if(meta_errno==ME_DELAYED)
142.445 + META_CONS("Loaded plugin '%s', but will wait to become active, %s",
142.446 + pl_added->desc, pl_added->str_loadable(SL_ALLOWED));
142.447 + else if(meta_errno==ME_NOTALLOWED) {
142.448 + META_CONS("Plugin '%s' couldn't attach; only allowed %s",
142.449 + pl_added->desc, pl_added->str_loadable(SL_ALLOWED));
142.450 + pl_added->clear();
142.451 + }
142.452 + else if(pl_added->status == PL_OPENED)
142.453 + META_CONS("Opened plugin '%s', but failed to attach; see log", pl_added->desc);
142.454 + else
142.455 + META_CONS("Couldn't load plugin '%s'; see log", pl_added->desc);
142.456 + show();
142.457 + // meta_errno should be already set in load()
142.458 + return(mFALSE);
142.459 + }
142.460 + META_CONS("Loaded plugin '%s' successfully", pl_added->desc);
142.461 + show();
142.462 + return(mTRUE);
142.463 +}
142.464 +
142.465 +// Load plugins at startup.
142.466 +// meta_errno values:
142.467 +// - errno's from ini_startup()
142.468 +mBOOL MPluginList::load() {
142.469 + int i, n;
142.470 +
142.471 + if (!ini_startup()) {
142.472 + META_ERROR("Problem loading plugins.ini: %s", inifile);
142.473 + // meta_errno should be already set in ini_startup()
142.474 + return(mFALSE);
142.475 + }
142.476 +
142.477 + META_LOG("dll: Loading plugins...");
142.478 + for(i=0, n=0; i < endlist; i++) {
142.479 + if(plist[i].status < PL_VALID)
142.480 + continue;
142.481 + if(plist[i].load(PT_STARTUP) == mTRUE)
142.482 + n++;
142.483 + else
142.484 + // all plugins should be loadable at startup...
142.485 + META_ERROR("dll: Failed to load plugin '%s'", plist[i].file);
142.486 + }
142.487 + META_LOG("dll: Finished loading %d plugins", n);
142.488 + return(mTRUE);
142.489 +}
142.490 +
142.491 +// Update list of loaded plugins from ini file, and load any new/changed plugins.
142.492 +// meta_errno values:
142.493 +// - errno's from ini_refresh()
142.494 +mBOOL MPluginList::refresh(PLUG_LOADTIME now) {
142.495 + int i, ndone=0, nkept=0, nloaded=0, nunloaded=0, nreloaded=0, ndelayed=0;
142.496 + MPlugin *iplug;
142.497 +
142.498 + if (!ini_refresh()) {
142.499 + META_ERROR("dll: Problem reloading plugins.ini: %s", inifile);
142.500 + // meta_errno should be already set in ini_refresh()
142.501 + return(mFALSE);
142.502 + }
142.503 +
142.504 + META_LOG("dll: Updating plugins...");
142.505 + for(i=0; i < endlist; i++) {
142.506 + iplug=&plist[i];
142.507 + if(iplug->status < PL_VALID)
142.508 + continue;
142.509 + switch(iplug->action) {
142.510 + case PA_KEEP:
142.511 + META_DEBUG(1, ("Keeping plugin '%s'", iplug->desc));
142.512 + iplug->action=PA_NONE;
142.513 + nkept++;
142.514 + break;
142.515 + case PA_LOAD:
142.516 + META_DEBUG(1, ("Loading plugin '%s'", iplug->desc));
142.517 + if(iplug->load(now))
142.518 + nloaded++;
142.519 + else if(meta_errno==ME_DELAYED)
142.520 + ndelayed++;
142.521 + break;
142.522 + case PA_RELOAD:
142.523 + META_DEBUG(1, ("Reloading plugin '%s'", iplug->desc));
142.524 + if(iplug->reload(now, PNL_FILE_NEWER))
142.525 + nreloaded++;
142.526 + else if(meta_errno==ME_DELAYED)
142.527 + ndelayed++;
142.528 + break;
142.529 + case PA_NONE:
142.530 + // If previously loaded from ini, but apparently removed from new ini.
142.531 + if(iplug->source==PS_INI && iplug->status >= PL_RUNNING) {
142.532 + META_DEBUG(1, ("Unloading plugin '%s'", iplug->desc));
142.533 + iplug->action=PA_UNLOAD;
142.534 + if(iplug->unload(now, PNL_INI_DELETED))
142.535 + nunloaded++;
142.536 + else if(meta_errno==ME_DELAYED)
142.537 + ndelayed++;
142.538 + }
142.539 + break;
142.540 + case PA_ATTACH:
142.541 + // Previously requested attach, but was delayed?
142.542 + META_DEBUG(1, ("Retrying attach plugin '%s'", iplug->desc));
142.543 + if(iplug->retry(now, PNL_DELAYED))
142.544 + nloaded++;
142.545 + else if(meta_errno==ME_DELAYED)
142.546 + ndelayed++;
142.547 + break;
142.548 + case PA_UNLOAD:
142.549 + // Previously requested unload, but was delayed?
142.550 + META_DEBUG(1, ("Retrying unload plugin '%s'", iplug->desc));
142.551 + if(iplug->retry(now, PNL_DELAYED))
142.552 + nunloaded++;
142.553 + else if(meta_errno==ME_DELAYED)
142.554 + ndelayed++;
142.555 + break;
142.556 + case PA_NULL:
142.557 + META_ERROR("dll: Unexpected action for plugin '%s': '%s'", iplug->desc, iplug->str_action());
142.558 + break;
142.559 + default:
142.560 + META_ERROR("dll: Unrecognized action for plugin '%s': '%s'", iplug->desc, iplug->str_action());
142.561 + break;
142.562 + }
142.563 + ndone++;
142.564 + }
142.565 + META_LOG("dll: Finished updating %d plugins; kept %d, loaded %d, unloaded %d, reloaded %d, delayed %d",
142.566 + ndone, nkept, nloaded, nunloaded, nreloaded, ndelayed);
142.567 + return(mTRUE);
142.568 +}
142.569 +
142.570 +// Re-enable any plugins currently paused.
142.571 +// meta_errno values:
142.572 +// - none
142.573 +void MPluginList::unpause_all(void) {
142.574 + int i;
142.575 + MPlugin *iplug;
142.576 + for(i=0; i < endlist; i++) {
142.577 + iplug=&plist[i];
142.578 + if(iplug->status==PL_PAUSED)
142.579 + iplug->unpause();
142.580 + }
142.581 +}
142.582 +
142.583 +// Retry any pending actions on plugins, for instance load/unload delayed
142.584 +// until changelevel.
142.585 +// meta_errno values:
142.586 +// - none
142.587 +void MPluginList::retry_all(PLUG_LOADTIME now) {
142.588 + int i;
142.589 + MPlugin *iplug;
142.590 + for(i=0; i < endlist; i++) {
142.591 + iplug=&plist[i];
142.592 + if(iplug->action != PA_NONE)
142.593 + iplug->retry(now, PNL_DELAYED);
142.594 + }
142.595 +}
142.596 +
142.597 +// List plugins and information about them in a formatted table.
142.598 +// meta_errno values:
142.599 +// - none
142.600 +void MPluginList::show() {
142.601 + int i, n=0, r=0;
142.602 + MPlugin *pl;
142.603 + char desc[15+1], file[16+1], vers[7+1]; // plus 1 for term null
142.604 +
142.605 + META_CONS("Currently loaded plugins:");
142.606 + META_CONS(" %*s %-*s %-4s %-4s %-*s v%-*s %-3s %-5s %-5s",
142.607 + WIDTH_MAX_PLUGINS, "",
142.608 + sizeof(desc)-1, "description",
142.609 + "stat", "pend",
142.610 + sizeof(file)-1, "file", sizeof(vers)-1, "ers",
142.611 + "src", "load ", "unlod");
142.612 + for(i=0; i < endlist; i++) {
142.613 + pl=&plist[i];
142.614 + if(pl->status < PL_VALID)
142.615 + continue;
142.616 + STRNCPY(desc, pl->desc, sizeof(desc));
142.617 + STRNCPY(file, pl->file, sizeof(file));
142.618 + if(pl->info && pl->info->version) STRNCPY(vers, pl->info->version, sizeof(vers));
142.619 + else STRNCPY(vers, " -", sizeof(vers));
142.620 + META_CONS(" [%*d] %-*s %-4s %-4s %-*s v%-*s %-3s %-5s %-5s",
142.621 + WIDTH_MAX_PLUGINS, pl->index,
142.622 + sizeof(desc)-1, desc,
142.623 + pl->str_status(ST_SHOW), pl->str_action(SA_SHOW),
142.624 + sizeof(file)-1, file, sizeof(vers)-1, vers,
142.625 + pl->str_source(SO_SHOW),
142.626 + pl->str_loadable(SL_SHOW), pl->str_unloadable(SL_SHOW));
142.627 + if(pl->status == PL_RUNNING)
142.628 + r++;
142.629 + n++;
142.630 + }
142.631 + META_CONS("%d plugins, %d running", n, r);
142.632 +}
142.633 +
142.634 +// List plugins and information to Player/client entity. Differs from the
142.635 +// "meta list" console command in that:
142.636 +// - Shows only "running" plugins, skipping any failed or paused plugins.
142.637 +// - Limited info about each plugin, mostly the "public" info (name, author,
142.638 +// etc).
142.639 +// meta_errno values:
142.640 +// - none
142.641 +void MPluginList::show_client(edict_t *pEntity) {
142.642 + int i, n=0;
142.643 + MPlugin *pl;
142.644 + META_CLIENT(pEntity, "Currently running plugins:");
142.645 + for(i=0; i < endlist; i++) {
142.646 + pl=&plist[i];
142.647 + if(pl->status != PL_RUNNING)
142.648 + continue;
142.649 + n++;
142.650 + META_CLIENT(pEntity, " [%3d] %s, v%s, %s, by %s, see %s",
142.651 + n,
142.652 + pl->info->name ? pl->info->name : "<unknown>",
142.653 + pl->info->version ? pl->info->version : "<?>",
142.654 + pl->info->date ? pl->info->date : "<../../..>",
142.655 + pl->info->author ? pl->info->author : "<unknown>",
142.656 + pl->info->url ? pl->info->url : "<unknown>");
142.657 + }
142.658 + META_CLIENT(pEntity, "%d plugins", n);
142.659 +}
143.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
143.2 +++ b/metamod/mlist.h Tue Apr 06 07:36:14 2004 +0000
143.3 @@ -0,0 +1,84 @@
143.4 +// vi: set ts=4 sw=4 :
143.5 +// vim: set tw=75 :
143.6 +
143.7 +// mlist.h - class and constants to describe a list of plugins
143.8 +
143.9 +/*
143.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
143.11 + *
143.12 + * This file is part of Metamod.
143.13 + *
143.14 + * Metamod is free software; you can redistribute it and/or modify it
143.15 + * under the terms of the GNU General Public License as published by the
143.16 + * Free Software Foundation; either version 2 of the License, or (at
143.17 + * your option) any later version.
143.18 + *
143.19 + * Metamod is distributed in the hope that it will be useful, but
143.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
143.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
143.22 + * General Public License for more details.
143.23 + *
143.24 + * You should have received a copy of the GNU General Public License
143.25 + * along with Metamod; if not, write to the Free Software Foundation,
143.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
143.27 + *
143.28 + * In addition, as a special exception, the author gives permission to
143.29 + * link the code of this program with the Half-Life Game Engine ("HL
143.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
143.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
143.32 + * respects for all of the code used other than the HL Engine and MODs
143.33 + * from Valve. If you modify this file, you may extend this exception
143.34 + * to your version of the file, but you are not obligated to do so. If
143.35 + * you do not wish to do so, delete this exception statement from your
143.36 + * version.
143.37 + *
143.38 + */
143.39 +
143.40 +#ifndef MLIST_H
143.41 +#define MLIST_H
143.42 +
143.43 +#include "types_meta.h" // mBOOL
143.44 +#include "mplugin.h" // class MPlugin
143.45 +#include "plinfo.h" // plid_t, etc
143.46 +
143.47 +// Max number of plugins we can manage. This is an arbitrary, fixed number,
143.48 +// for convenience. It would probably be better to dynamically grow the
143.49 +// list as needed, but we do this for now.
143.50 +#define MAX_PLUGINS 50
143.51 +// Width required to printf above MAX, for show() functions.
143.52 +#define WIDTH_MAX_PLUGINS 2
143.53 +
143.54 +
143.55 +// A list of plugins.
143.56 +class MPluginList {
143.57 + public:
143.58 + // data:
143.59 + char inifile[PATH_MAX]; // full pathname
143.60 + MPlugin plist[MAX_PLUGINS]; // array of plugins
143.61 + int size; // size of list, ie MAX_PLUGINS
143.62 + int endlist; // index of last used entry
143.63 +
143.64 + // constructor:
143.65 + MPluginList(const char *ifile);
143.66 +
143.67 + // functions:
143.68 + MPlugin *find(int pindex); // find by index
143.69 + MPlugin *find(const char *findpath); // find by pathname
143.70 + MPlugin *find(plid_t id); // find by plid_t
143.71 + MPlugin *find_memloc(void *memptr); // find by memory location
143.72 + MPlugin *find_match(const char *prefix); // find by partial prefix match
143.73 + MPlugin *add(MPlugin *padd);
143.74 +
143.75 + mBOOL ini_startup(void); // read inifile at startup
143.76 + mBOOL ini_refresh(void); // re-read inifile
143.77 + mBOOL cmd_addload(const char *args); // load from console command
143.78 +
143.79 + mBOOL load(void); // load the list, at startup
143.80 + mBOOL refresh(PLUG_LOADTIME now); // update from re-read inifile
143.81 + void unpause_all(void); // unpause any paused plugins
143.82 + void retry_all(PLUG_LOADTIME now); // retry any pending plugin actions
143.83 + void show(void); // list plugins to console
143.84 + void show_client(edict_t *pEntity); // list plugins to player client
143.85 +};
143.86 +
143.87 +#endif /* MLIST_H */
144.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
144.2 +++ b/metamod/mplugin.cpp Tue Apr 06 07:36:14 2004 +0000
144.3 @@ -0,0 +1,1240 @@
144.4 +// vi: set ts=4 sw=4 :
144.5 +// vim: set tw=75 :
144.6 +
144.7 +// mplugin.cpp - functions for individual plugin (class MPlugin)
144.8 +
144.9 +/*
144.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
144.11 + *
144.12 + * This file is part of Metamod.
144.13 + *
144.14 + * Metamod is free software; you can redistribute it and/or modify it
144.15 + * under the terms of the GNU General Public License as published by the
144.16 + * Free Software Foundation; either version 2 of the License, or (at
144.17 + * your option) any later version.
144.18 + *
144.19 + * Metamod is distributed in the hope that it will be useful, but
144.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
144.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
144.22 + * General Public License for more details.
144.23 + *
144.24 + * You should have received a copy of the GNU General Public License
144.25 + * along with Metamod; if not, write to the Free Software Foundation,
144.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
144.27 + *
144.28 + * In addition, as a special exception, the author gives permission to
144.29 + * link the code of this program with the Half-Life Game Engine ("HL
144.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
144.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
144.32 + * respects for all of the code used other than the HL Engine and MODs
144.33 + * from Valve. If you modify this file, you may extend this exception
144.34 + * to your version of the file, but you are not obligated to do so. If
144.35 + * you do not wish to do so, delete this exception statement from your
144.36 + * version.
144.37 + *
144.38 + */
144.39 +
144.40 +#include <errno.h> // errno, etc
144.41 +#include <malloc.h> // malloc, etc
144.42 +#include <sys/types.h> // stat
144.43 +#include <sys/stat.h> // stat
144.44 +
144.45 +#include <extdll.h> // always
144.46 +
144.47 +#include "mplugin.h" // me
144.48 +#include "metamod.h" // GameDLL, etc
144.49 +#include "mreg.h" // MRegCmdList::show(int), etc
144.50 +#include "mhook.h" // class MHook
144.51 +#include "h_export.h" // GIVE_ENGINE_FUNCTIONS_FN, etc
144.52 +#include "dllapi.h" // FN_GAMEINIT, etc
144.53 +#include "support_meta.h" // full_gamedir_path,
144.54 +#include "types_meta.h" // mBOOL
144.55 +#include "log_meta.h" // logging functions, etc
144.56 +#include "osdep.h" // win32 snprintf, is_absolute_path,
144.57 +
144.58 +
144.59 +// Parse a line from plugins.ini into a plugin.
144.60 +// meta_errno values:
144.61 +// - ME_COMMENT ignored commented line
144.62 +// - ME_FORMAT invalid line format
144.63 +// - ME_OSNOTSUP plugin is not for this OS
144.64 +mBOOL MPlugin::ini_parseline(char *line) {
144.65 + char *token;
144.66 + char *ptr_token;
144.67 + char *cp;
144.68 +
144.69 + if(line[0]=='#' || line[0]==';' || strstr(line, "//")==line) {
144.70 + META_DEBUG(7, ("ini: Ignoring commented line: %s", line));
144.71 + RETURN_ERRNO(mFALSE, ME_COMMENT);
144.72 + }
144.73 +
144.74 + // grab platform ("win32" or "linux")
144.75 + token=strtok_r(line, " \t", &ptr_token);
144.76 + if(!token)
144.77 + RETURN_ERRNO(mFALSE, ME_FORMAT);
144.78 + if(strcasecmp(token, PLATFORM)) {
144.79 + // plugin is not for this OS
144.80 + META_DEBUG(7, ("ini: Ignoring entry for %s", token));
144.81 + RETURN_ERRNO(mFALSE, ME_OSNOTSUP);
144.82 + }
144.83 +
144.84 + // grab filename
144.85 + token=strtok_r(NULL, " \t\r\n", &ptr_token);
144.86 + if(!token)
144.87 + RETURN_ERRNO(mFALSE, ME_FORMAT);
144.88 + STRNCPY(filename, token, sizeof(filename));
144.89 + normalize_pathname(filename);
144.90 + // Store name of just the actual _file_, without dir components.
144.91 + cp=strrchr(filename, '/');
144.92 + if(cp)
144.93 + file=cp+1;
144.94 + else
144.95 + file=filename;
144.96 +
144.97 + // Grab description.
144.98 + // Just get the the rest of the line, minus line-termination.
144.99 + token=strtok_r(NULL, "\n\r", &ptr_token);
144.100 + if(token) {
144.101 + token=token+strspn(token, " \t"); // skip whitespace
144.102 + STRNCPY(desc, token, sizeof(desc));
144.103 + }
144.104 + else {
144.105 + // If no description is specified, temporarily use plugin file,
144.106 + // until plugin can be queried, and desc replaced with info->name.
144.107 + snprintf(desc, sizeof(desc), "<%s>", file);
144.108 + }
144.109 +
144.110 + // Make full pathname (from gamedir if relative, remove "..",
144.111 + // backslashes, etc).
144.112 + full_gamedir_path(filename, pathname);
144.113 +
144.114 + source=PS_INI;
144.115 + status=PL_VALID;
144.116 + return(mTRUE);
144.117 +}
144.118 +
144.119 +// Parse a line from console "load" command into a plugin.
144.120 +// meta_errno values:
144.121 +// - ME_FORMAT invalid line format
144.122 +mBOOL MPlugin::cmd_parseline(const char *line) {
144.123 + char buf[NAME_MAX + PATH_MAX + MAX_DESC_LEN];
144.124 + char *token;
144.125 + char *ptr_token;
144.126 + char *cp;
144.127 +
144.128 + STRNCPY(buf, line, sizeof(buf));
144.129 +
144.130 + // remove "load"
144.131 + token=strtok_r(buf, " \t", &ptr_token);
144.132 + if(!token)
144.133 + RETURN_ERRNO(mFALSE, ME_FORMAT);
144.134 +
144.135 + // grab filename
144.136 + token=strtok_r(NULL, " \t", &ptr_token);
144.137 + if(!token)
144.138 + RETURN_ERRNO(mFALSE, ME_FORMAT);
144.139 + STRNCPY(filename, token, sizeof(filename));
144.140 + normalize_pathname(filename);
144.141 + // store name of just the actual _file_, without dir components
144.142 + cp=strrchr(filename, '/');
144.143 + if(cp)
144.144 + file=cp+1;
144.145 + else
144.146 + file=filename;
144.147 +
144.148 + // Grab description.
144.149 + // Specify no delimiter chars, as we just want the rest of the line.
144.150 + token=strtok_r(NULL, "", &ptr_token);
144.151 + if(token) {
144.152 + token=token+strspn(token, " \t"); // skip whitespace
144.153 + STRNCPY(desc, token, sizeof(desc));
144.154 + }
144.155 + else {
144.156 + // if no description is specified, temporarily use plugin file,
144.157 + // until plugin can be queried, and desc replaced with info->name.
144.158 + snprintf(desc, sizeof(desc), "<%s>", file);
144.159 + }
144.160 +
144.161 + // Make full pathname (from gamedir if relative, remove "..",
144.162 + // backslashes, etc).
144.163 + full_gamedir_path(filename, pathname);
144.164 +
144.165 + source=PS_CMD;
144.166 + status=PL_VALID;
144.167 + return(mTRUE);
144.168 +}
144.169 +
144.170 +// Make sure this plugin has the necessary minimal information.
144.171 +// meta_errno values:
144.172 +// - ME_ARGUMENT missing necessary fields in plugin
144.173 +mBOOL MPlugin::check_input(void) {
144.174 + // doublecheck our input/state
144.175 + if(status < PL_VALID) {
144.176 + META_ERROR("dll: Tried to operate on plugin[%d] with a non-valid status (%d)", index, str_status());
144.177 + RETURN_ERRNO(mFALSE, ME_ARGUMENT);
144.178 + }
144.179 + if(!file || !file[0]) {
144.180 + META_ERROR("dll: Tried to operate on plugin[%d] with an empty file",
144.181 + index);
144.182 + RETURN_ERRNO(mFALSE, ME_ARGUMENT);
144.183 + }
144.184 + if(!filename[0]) {
144.185 + META_ERROR("dll: Tried to operate on plugin[%d] with an empty filename",
144.186 + index);
144.187 + RETURN_ERRNO(mFALSE, ME_ARGUMENT);
144.188 + }
144.189 + if(!pathname[0]) {
144.190 + META_ERROR("dll: Tried to operate on plugin[%d] with an empty pathname",
144.191 + index);
144.192 + RETURN_ERRNO(mFALSE, ME_ARGUMENT);
144.193 + }
144.194 + if(!desc[0]) {
144.195 + // if no description is specified, temporarily use plugin file,
144.196 + // until plugin can be queried, and desc replaced with info->name.
144.197 + snprintf(desc, sizeof(desc), "<%s>", file);
144.198 + }
144.199 + return(mTRUE);
144.200 +}
144.201 +
144.202 +// Try to resolve a plugin's filename as a (possibly partial) path to an
144.203 +// actual filename on disk, to facilitate easier console load-command
144.204 +// arguments. Uses resolve_dirs, resolve_prefix, and resolve_suffix below.
144.205 +// Example paths that it tries:
144.206 +// filename
144.207 +// Gamedir/filename.dll, Gamedir/filename.so
144.208 +// Gamedir/filename_i386.so
144.209 +// Gamedir/dlls/mm_filename_i386.so
144.210 +// Gamedir/dlls/filename_mm_i386.so
144.211 +// Gamedir/dlls/filename_MM_i386.so
144.212 +// meta_errno values:
144.213 +// - ME_NOTFOUND couldn't find a matching file for the partial name
144.214 +// - errno's from check_input()
144.215 +mBOOL MPlugin::resolve(void) {
144.216 + char *found;
144.217 + char *cp;
144.218 + int len;
144.219 + if(!check_input()) {
144.220 + // details logged, meta_errno set in check_input()
144.221 + return(mFALSE);
144.222 + }
144.223 + if(is_absolute_path(filename))
144.224 + found=resolve_prefix(filename);
144.225 + else
144.226 + found=resolve_dirs(filename);
144.227 +
144.228 + if(!found) {
144.229 + META_DEBUG(2, ("Couldn't resolve '%s' to file", filename));
144.230 + RETURN_ERRNO(mFALSE, ME_NOTFOUND);
144.231 + }
144.232 + META_DEBUG(2, ("Resolved '%s' to file '%s'", filename, found));
144.233 + // store pathname: the resolved path (should be absolute)
144.234 + STRNCPY(pathname, found, sizeof(pathname));
144.235 + // store file: the name of the file (without dir)
144.236 + cp=strrchr(pathname, '/');
144.237 + if(cp)
144.238 + file=cp+1;
144.239 + else
144.240 + file=pathname;
144.241 + // store pathname: the gamedir relative path, or an absolute path
144.242 + len=strlen(GameDLL.gamedir);
144.243 + if(strncasecmp(pathname, GameDLL.gamedir, len) == 0)
144.244 + STRNCPY(filename, pathname+len+1, sizeof(filename));
144.245 + else
144.246 + STRNCPY(filename, pathname, sizeof(filename));
144.247 +
144.248 + return(mTRUE);
144.249 +}
144.250 +
144.251 +// For the given path, tries to find file in several possible
144.252 +// directories.
144.253 +// Try:
144.254 +// GAMEDIR/filename
144.255 +// GAMEDIR/dlls/filename
144.256 +// meta_errno values:
144.257 +// - none
144.258 +char *MPlugin::resolve_dirs(char *path) {
144.259 + struct stat st;
144.260 + static char buf[PATH_MAX];
144.261 + char *found;
144.262 +
144.263 + snprintf(buf, sizeof(buf), "%s/%s", GameDLL.gamedir, path);
144.264 + // try this path
144.265 + if(stat(buf, &st) == 0 && S_ISREG(st.st_mode))
144.266 + return(buf);
144.267 + // try other file prefixes in this path
144.268 + if((found=resolve_prefix(buf)))
144.269 + return(found);
144.270 +
144.271 + snprintf(buf, sizeof(buf), "%s/dlls/%s", GameDLL.gamedir, path);
144.272 + // try this path
144.273 + if(stat(buf, &st) == 0 && S_ISREG(st.st_mode))
144.274 + return(buf);
144.275 + // try other file prefixes for this path
144.276 + if((found=resolve_prefix(buf)))
144.277 + return(found);
144.278 +
144.279 + return(NULL);
144.280 +}
144.281 +
144.282 +// For the given path, tries several possible filename prefixes.
144.283 +// Try:
144.284 +// dir/mm_file
144.285 +// dir/file
144.286 +// meta_errno values:
144.287 +// - none
144.288 +char *MPlugin::resolve_prefix(char *path) {
144.289 + struct stat st;
144.290 + char *cp, *fname;
144.291 + char dname[PATH_MAX];
144.292 + static char buf[PATH_MAX];
144.293 + char *found;
144.294 +
144.295 + // try "mm_" prefix FIRST.
144.296 + // split into dirname and filename
144.297 + STRNCPY(dname, path, sizeof(dname));
144.298 + cp=strrchr(dname, '/');
144.299 + if(cp) {
144.300 + *cp='\0';
144.301 + fname=cp+1;
144.302 + snprintf(buf, sizeof(buf), "%s/mm_%s", dname, fname);
144.303 + }
144.304 + else {
144.305 + // no directory in given path
144.306 + snprintf(buf, sizeof(buf), "mm_%s", path);
144.307 + }
144.308 + // try this path
144.309 + if(stat(buf, &st) == 0 && S_ISREG(st.st_mode))
144.310 + return(buf);
144.311 + // try other suffixes for this path
144.312 + if((found=resolve_suffix(buf)))
144.313 + return(found);
144.314 +
144.315 + // try other suffixes for the original path
144.316 + if((found=resolve_suffix(path)))
144.317 + return(found);
144.318 +
144.319 + return(NULL);
144.320 +}
144.321 +
144.322 +// For the given path, tries several different filename suffixes.
144.323 +// Try:
144.324 +// path
144.325 +// path_mm
144.326 +// path_MM
144.327 +// path.so (linux), path.dll (win32)
144.328 +// path_i386.so, path_i486.so, etc (if linux)
144.329 +// meta_errno values:
144.330 +// - none
144.331 +char *MPlugin::resolve_suffix(char *path) {
144.332 + struct stat st;
144.333 + static char buf[PATH_MAX];
144.334 + char *found;
144.335 +
144.336 + // Hmm, recursion.
144.337 + if(!strstr(path, "_mm")) {
144.338 + char *tmpbuf;
144.339 + snprintf(buf, sizeof(buf), "%s_mm", path);
144.340 + tmpbuf=strdup(buf);
144.341 + found=resolve_suffix(tmpbuf);
144.342 + free(tmpbuf);
144.343 + if(found) return(found);
144.344 + }
144.345 + if(!strstr(path, "_MM")) {
144.346 + char *tmpbuf;
144.347 + snprintf(buf, sizeof(buf), "%s_MM", path);
144.348 + tmpbuf=strdup(buf);
144.349 + found=resolve_suffix(tmpbuf);
144.350 + free(tmpbuf);
144.351 + if(found) return(found);
144.352 + }
144.353 +
144.354 +#ifdef _WIN32
144.355 + snprintf(buf, sizeof(buf), "%s.dll", path);
144.356 +#elif defined(linux)
144.357 + snprintf(buf, sizeof(buf), "%s.so", path);
144.358 +#else
144.359 +#error "OS unrecognized"
144.360 +#endif /* _WIN32 */
144.361 + if(stat(buf, &st) == 0 && S_ISREG(st.st_mode))
144.362 + return(buf);
144.363 +
144.364 +#ifdef linux
144.365 + snprintf(buf, sizeof(buf), "%s_i386.so", path);
144.366 + if(stat(buf, &st) == 0 && S_ISREG(st.st_mode))
144.367 + return(buf);
144.368 + snprintf(buf, sizeof(buf), "%s_i486.so", path);
144.369 + if(stat(buf, &st) == 0 && S_ISREG(st.st_mode))
144.370 + return(buf);
144.371 + snprintf(buf, sizeof(buf), "%s_i586.so", path);
144.372 + if(stat(buf, &st) == 0 && S_ISREG(st.st_mode))
144.373 + return(buf);
144.374 + snprintf(buf, sizeof(buf), "%s_i686.so", path);
144.375 + if(stat(buf, &st) == 0 && S_ISREG(st.st_mode))
144.376 + return(buf);
144.377 +#endif /* linux */
144.378 +
144.379 + return(NULL);
144.380 +}
144.381 +
144.382 +// Load a plugin; query, check allowed time, attach.
144.383 +// meta_errno values:
144.384 +// - ME_ARGUMENT missing necessary fields in plugin
144.385 +// - ME_ALREADY this plugin already loaded
144.386 +// - ME_BADREQ plugin not marked for load
144.387 +// - ME_DELAYED load request is delayed (till changelevel?)
144.388 +// - ME_NOTALLOWED plugin not loadable after startup
144.389 +// - errno's from query()
144.390 +// - errno's from attach()
144.391 +// - errno's from check_input()
144.392 +mBOOL MPlugin::load(PLUG_LOADTIME now) {
144.393 + if(!check_input()) {
144.394 + // details logged, meta_errno set in check_input()
144.395 + RETURN_ERRNO(mFALSE, ME_ARGUMENT);
144.396 + }
144.397 + if(status >= PL_RUNNING) {
144.398 + META_ERROR("dll: Not loading plugin '%s'; already loaded (status=%s)",
144.399 + desc, str_status());
144.400 + RETURN_ERRNO(mFALSE, ME_ALREADY);
144.401 + }
144.402 + if(action != PA_LOAD && action != PA_ATTACH) {
144.403 + META_ERROR("dll: Not loading plugin '%s'; not marked for load (action=%s)", desc, str_action());
144.404 + RETURN_ERRNO(mFALSE, ME_BADREQ);
144.405 + }
144.406 +
144.407 + if(status != PL_OPENED) {
144.408 + // query plugin; open file and get info about it
144.409 + if(!query()) {
144.410 + META_ERROR("dll: Skipping plugin '%s'; couldn't query", desc);
144.411 + if(meta_errno != ME_DLOPEN) {
144.412 + if(DLCLOSE(handle) != 0) {
144.413 + META_ERROR("dll: Couldn't close plugin file '%s': %s",
144.414 + file, DLERROR());
144.415 + }
144.416 + else
144.417 + handle=NULL;
144.418 + }
144.419 + status=PL_BADFILE;
144.420 + // meta_errno should be already set in query()
144.421 + return(mFALSE);
144.422 + }
144.423 + status=PL_OPENED;
144.424 + }
144.425 +
144.426 + // are we allowed to attach this plugin at this time?
144.427 + if(info->loadable < now) {
144.428 + if(info->loadable > PT_STARTUP) {
144.429 + // will try to attach again at next opportunity
144.430 + META_DEBUG(2, ("dll: Delaying load plugin '%s'; can't attach now: allowed=%s; now=%s",
144.431 + desc, str_loadable(), str_loadtime(now, SL_SIMPLE)));
144.432 + RETURN_ERRNO(mFALSE, ME_DELAYED);
144.433 + }
144.434 + else {
144.435 + META_DEBUG(2, ("dll: Failed load plugin '%s'; can't attach now: allowed=%s; now=%s",
144.436 + desc, str_loadable(), str_loadtime(now, SL_SIMPLE)));
144.437 + // don't try to attach again later
144.438 + action=PA_NONE;
144.439 + RETURN_ERRNO(mFALSE, ME_NOTALLOWED);
144.440 + }
144.441 + }
144.442 +
144.443 + // attach plugin; get function tables
144.444 + if(attach(now) != mTRUE) {
144.445 + META_ERROR("dll: Failed to attach plugin '%s'", desc);
144.446 + // Note we don't dlclose() here, since we're returning PL_FAILED,
144.447 + // which implies that it's been dlopened and queried successfully.
144.448 + // Doing so causes crashes, because things like "meta list" try to
144.449 + // look at *info, which is in the DLL memory space and unaccessible
144.450 + // (segfault) after dlclosed.
144.451 + status=PL_FAILED;
144.452 + // meta_errno should be already set in attach()
144.453 + return(mFALSE);
144.454 + }
144.455 + status=PL_RUNNING;
144.456 + action=PA_NONE;
144.457 +
144.458 + // If not loading at server startup, then need to call plugin's
144.459 + // GameInit, since we've passed that.
144.460 + if(now != PT_STARTUP) {
144.461 + FN_GAMEINIT pfn_gameinit=NULL;
144.462 + if(dllapi_table && (pfn_gameinit=dllapi_table->pfnGameInit))
144.463 + pfn_gameinit();
144.464 + }
144.465 + // If loading during map, then I'd like to call plugin's
144.466 + // ServerActivate, since we've passed that. However, I'm not sure what
144.467 + // arguments to give it... So, we'll just have to say for the
144.468 + // moment that plugins that are loadable during a map can't need to
144.469 + // hook ServerActivate.
144.470 +
144.471 + META_LOG("dll: Loaded plugin '%s': %s v%s %s, %s", desc, info->name,
144.472 + info->version, info->date, info->author);
144.473 + return(mTRUE);
144.474 +}
144.475 +
144.476 +// Query a plugin:
144.477 +// - dlopen() the file, store the handle
144.478 +// - dlsym() and call:
144.479 +// Meta_Init (if present) - tell dll it'll be used as a metamod plugin
144.480 +// GiveFnptrsToDll - give engine function ptrs
144.481 +// Meta_Query - say "hi" and get info about plugin
144.482 +// meta_errno values:
144.483 +// - ME_DLOPEN dlopen/loadlibrary failed; see dlerror() for details
144.484 +// - ME_DLMISSING couldn't find a query() or giveFuncs() in plugin
144.485 +// - ME_DLERROR plugin query() returned error
144.486 +// - ME_NULLDATA info struct from query() was null
144.487 +mBOOL MPlugin::query(void) {
144.488 + META_INIT_FN pfn_init;
144.489 + GIVE_ENGINE_FUNCTIONS_FN pfn_give_engfuncs;
144.490 + META_QUERY_FN pfn_query;
144.491 +
144.492 + // open the plugin DLL
144.493 + if(!(handle=DLOPEN(pathname))) {
144.494 + META_ERROR("dll: Failed query plugin '%s'; Couldn't open file '%s': %s",
144.495 + desc, pathname, DLERROR());
144.496 + RETURN_ERRNO(mFALSE, ME_DLOPEN);
144.497 + }
144.498 +
144.499 + // First, we check to see if they have a Meta_Query. We would normally
144.500 + // dlsym this just prior to calling it, after having called
144.501 + // GiveFnptrsToDll, but things like standalone-DLL bots do all their
144.502 + // startup in GiveFnptrsToDll, and trying to load them as metamod
144.503 + // plugins creates all sorts of crashes. So, we do a trivial check
144.504 + // first to see if the DLL looks like a metamod plugin before
144.505 + // proceeding with the normal order. Note that we still have to call
144.506 + // GiveFnptrsToDll before Meta_Query, because the latter typically uses
144.507 + // engine functions like AlertMessage, which have to be passed along via
144.508 + // GiveFnptrsToDll.
144.509 + pfn_query = (META_QUERY_FN) DLSYM(handle, "Meta_Query");
144.510 + if(!pfn_query) {
144.511 + META_ERROR("dll: Failed query plugin '%s'; Couldn't find Meta_Query(): %s", desc, DLERROR());
144.512 + // caller will dlclose()
144.513 + RETURN_ERRNO(mFALSE, ME_DLMISSING);
144.514 + }
144.515 +
144.516 + // Call Meta_Init, if present. This is an optional plugin routine to
144.517 + // allow plugin to do any special initializing or other processing
144.518 + // prior to the standard query/attach procedure.
144.519 + //
144.520 + // In particular, this should allow for DLL's that can operate as both
144.521 + // a standalone dll AND a metamod plugin. This routine has to be
144.522 + // called _before_ GiveFnptrsToDll, since the dll will usually do all
144.523 + // its startup processing in GiveFn, and has to know at that point
144.524 + // whether it needs to do just mm plugin startup, or all the extra
144.525 + // startup needed for a standalone DLL.
144.526 + //
144.527 + // This passes nothing and returns nothing, and the routine in the
144.528 + // plugin can NOT use any Engine functions, as they haven't been
144.529 + // provided yet (done next, in GiveFnptrsToDll).
144.530 + pfn_init = (META_INIT_FN) DLSYM(handle, "Meta_Init");
144.531 + if(pfn_init) {
144.532 + pfn_init();
144.533 + META_DEBUG(6, ("dll: Plugin '%s': Called Meta_Init()", desc));
144.534 + }
144.535 + else {
144.536 + META_DEBUG(5, ("dll: no Meta_Init present in plugin '%s'", desc));
144.537 + // don't return; not an error
144.538 + }
144.539 +
144.540 + // pass on engine function table and globals to plugin
144.541 + if(!(pfn_give_engfuncs = (GIVE_ENGINE_FUNCTIONS_FN) DLSYM(handle, "GiveFnptrsToDll"))) {
144.542 + // META_ERROR("dll: Couldn't find GiveFnptrsToDll() in plugin '%s': %s", desc, DLERROR());
144.543 + META_ERROR("dll: Failed query plugin '%s'; Couldn't find GiveFnptrsToDll(): %s", desc, DLERROR());
144.544 + // caller will dlclose()
144.545 + RETURN_ERRNO(mFALSE, ME_DLMISSING);
144.546 + }
144.547 + pfn_give_engfuncs(Engine.pl_funcs, Engine.globals);
144.548 + META_DEBUG(6, ("dll: Plugin '%s': Called GiveFnptrsToDll()", desc));
144.549 +
144.550 + // Call plugin's Meta_Query(), to pass our meta interface version, and get
144.551 + // plugin's info structure.
144.552 + meta_errno=ME_NOERROR;
144.553 + info=NULL;
144.554 + // Make a copy of the meta_util function table for each plugin, for the
144.555 + // same reason.
144.556 + memcpy(&mutil_funcs, &MetaUtilFunctions, sizeof(mutil_funcs));
144.557 +
144.558 + if(pfn_query(META_INTERFACE_VERSION, &info, &mutil_funcs) != TRUE) {
144.559 + META_ERROR("dll: Failed query plugin '%s'; Meta_Query returned error",
144.560 + desc);
144.561 + meta_errno=ME_DLERROR;
144.562 + }
144.563 + else {
144.564 + META_DEBUG(6, ("dll: Plugin '%s': Called Meta_Query() successfully",
144.565 + desc));
144.566 + }
144.567 +
144.568 + // Check for interface differences... Generally, a difference in major
144.569 + // version will be incompatible, and a plugin that expects a later
144.570 + // minor version will be incompatible (it's expecting things that this
144.571 + // Metamod won't be supplying). Plugins that use an older minor
144.572 + // version will still work, as backward-compability within major
144.573 + // version is expected (forward-compatibility is not).
144.574 + //
144.575 + // Note, this check is done regardless of whether meta_query returns an
144.576 + // error.
144.577 + if(info && !FStrEq(info->ifvers, META_INTERFACE_VERSION)) {
144.578 + int mmajor=0, mminor=0, pmajor=0, pminor=0;
144.579 + META_DEBUG(3, ("dll: Note: Plugin '%s' interface version didn't match; expected %s, found %s", desc, META_INTERFACE_VERSION, info->ifvers));
144.580 + sscanf(META_INTERFACE_VERSION, "%d:%d", &mmajor, &mminor);
144.581 + sscanf(info->ifvers, "%d:%d", &pmajor, &pminor);
144.582 + // If plugin has later interface version, it's incompatible
144.583 + // (update metamod).
144.584 + if(pmajor > mmajor || (pmajor==mmajor && pminor > mminor)) {
144.585 + META_ERROR("dll: Plugin '%s' requires a newer version of Metamod (Metamod needs at least interface %s not the current %s)", desc, info->ifvers, META_INTERFACE_VERSION);
144.586 + meta_errno=ME_IFVERSION;
144.587 + }
144.588 + // If plugin has older major interface version, it's incompatible
144.589 + // (update plugin).
144.590 + else if(pmajor < mmajor) {
144.591 + META_ERROR("dll: Plugin '%s' is out of date and incompatible with this version of Metamod; please find a newer version of the plugin (plugin needs at least interface %s not the current %s)", desc, META_INTERFACE_VERSION, info->ifvers);
144.592 + meta_errno=ME_IFVERSION;
144.593 + }
144.594 + // Plugin has identical major, with older minor. This is supposed to be
144.595 + // backwards compatible, so we warn, but we still accept it.
144.596 + else if(pmajor==mmajor && pminor < mminor)
144.597 + META_LOG("dll: Note: plugin '%s' is using an older interface version (%s), not the latest interface version (%s); there might be an updated version of the plugin", desc, info->ifvers, META_INTERFACE_VERSION);
144.598 + else
144.599 + META_LOG("dll: Plugin '%s': unexpected version comparision; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d",
144.600 + desc, META_INTERFACE_VERSION, mmajor, mminor, info->ifvers, pmajor, pminor);
144.601 + }
144.602 +
144.603 + if(meta_errno == ME_IFVERSION) {
144.604 + META_ERROR("dll: Rejected plugin '%s' due to interface version incompatibility (mm=%s, pl=%s)", desc, META_INTERFACE_VERSION, info->ifvers);
144.605 + // meta_errno is set already above
144.606 + // caller will dlclose()
144.607 + return(mFALSE);
144.608 + }
144.609 + else if(meta_errno != ME_NOERROR)
144.610 + // some other error, already logged
144.611 + return(mFALSE);
144.612 +
144.613 + if(!info) {
144.614 + META_ERROR("dll: Failed query plugin '%s'; Empty info structure", desc);
144.615 + // caller will dlclose()
144.616 + RETURN_ERRNO(mFALSE, ME_NULLRESULT);
144.617 + }
144.618 + // Replace temporary desc with plugin's internal name.
144.619 + if(desc[0] == '<')
144.620 + STRNCPY(desc, info->name, sizeof(desc));
144.621 + META_DEBUG(6, ("dll: Plugin '%s': Query successful", desc));
144.622 + return(mTRUE);
144.623 +}
144.624 +
144.625 +// Attach a plugin:
144.626 +// - dlsym() and call:
144.627 +// Meta_Attach - get table of api tables, give meta_globals
144.628 +// - if provided by plugin, call various "Get" function pointers,
144.629 +// and store resulting function tables:
144.630 +// GetEntityAPI (std)
144.631 +// GetEntityAPI2 (std sdk2)
144.632 +// GetNewDLLFunctions (std sdk2)
144.633 +//
144.634 +// GetEntityAPI_Post (meta)
144.635 +// GetEntityAPI2_Post (meta)
144.636 +// GetNewDLLFunctions_Post (meta)
144.637 +//
144.638 +// GetEngineFunctions (meta)
144.639 +// GetEngineFunctions_Post (meta)
144.640 +// meta_errno values:
144.641 +// - ME_DLMISSING couldn't find meta_attach() in plugin
144.642 +// - ME_DLERROR plugin attach() returned error
144.643 +// - ME_NOMEM failed malloc
144.644 +mBOOL MPlugin::attach(PLUG_LOADTIME now) {
144.645 + int ret;
144.646 + int iface_vers;
144.647 +
144.648 + META_ATTACH_FN pfn_attach;
144.649 + META_FUNCTIONS meta_table;
144.650 +
144.651 + // Make copy of gameDLL's function tables for each plugin, so we don't
144.652 + // risk the plugins screwing with the tables everyone uses.
144.653 + if(GameDLL.funcs.dllapi_table && !gamedll_funcs.dllapi_table) {
144.654 + gamedll_funcs.dllapi_table = (DLL_FUNCTIONS *) malloc(sizeof(DLL_FUNCTIONS));
144.655 + if(!gamedll_funcs.dllapi_table) {
144.656 + META_ERROR("dll: Failed attach plugin '%s': Failed malloc() for dllapi_table");
144.657 + RETURN_ERRNO(mFALSE, ME_NOMEM);
144.658 + }
144.659 + memcpy(gamedll_funcs.dllapi_table, GameDLL.funcs.dllapi_table,
144.660 + sizeof(DLL_FUNCTIONS));
144.661 + }
144.662 + if(GameDLL.funcs.newapi_table && !gamedll_funcs.newapi_table) {
144.663 + gamedll_funcs.newapi_table = (NEW_DLL_FUNCTIONS *) malloc(sizeof(NEW_DLL_FUNCTIONS));
144.664 + if(!gamedll_funcs.newapi_table) {
144.665 + META_ERROR("dll: Failed attach plugin '%s': Failed malloc() for newapi_table");
144.666 + RETURN_ERRNO(mFALSE, ME_NOMEM);
144.667 + }
144.668 + memcpy(gamedll_funcs.newapi_table, GameDLL.funcs.newapi_table,
144.669 + sizeof(NEW_DLL_FUNCTIONS));
144.670 + }
144.671 + if(!(pfn_attach = (META_ATTACH_FN) DLSYM(handle, "Meta_Attach"))) {
144.672 + META_ERROR("dll: Failed attach plugin '%s': Couldn't find Meta_Attach(): %s", desc, DLERROR());
144.673 + // caller will dlclose()
144.674 + RETURN_ERRNO(mFALSE, ME_DLMISSING);
144.675 + }
144.676 +
144.677 + memset(&meta_table, 0, sizeof(meta_table));
144.678 + // get table of function tables,
144.679 + // give public meta globals
144.680 + ret=pfn_attach(now, &meta_table, &PublicMetaGlobals, &gamedll_funcs);
144.681 + if(ret != TRUE) {
144.682 + META_ERROR("dll: Failed attach plugin '%s': Error from Meta_Attach(): %d", desc, ret);
144.683 + // caller will dlclose()
144.684 + RETURN_ERRNO(mFALSE, ME_DLERROR);
144.685 + }
144.686 + META_DEBUG(6, ("dll: Plugin '%s': Called Meta_Attach() successfully", desc));
144.687 +
144.688 + // Rather than duplicate code, we use another ugly macro. Again,
144.689 + // a function isn't an option since we have varying types.
144.690 +#define GET_FUNC_TABLE_FROM_PLUGIN(pfnGetFuncs, STR_GetFuncs, struct_field, API_TYPE, TABLE_TYPE, vers_pass, vers_int, vers_want) \
144.691 + if(meta_table.pfnGetFuncs) { \
144.692 + struct_field = (TABLE_TYPE*) malloc(sizeof(TABLE_TYPE)); \
144.693 + if(meta_table.pfnGetFuncs(struct_field, vers_pass)) { \
144.694 + META_DEBUG(3, ("dll: Plugin '%s': Found %s", desc, STR_GetFuncs)); \
144.695 + } \
144.696 + else { \
144.697 + META_ERROR("dll: Failure calling %s in plugin '%s'", STR_GetFuncs, desc); \
144.698 + if(vers_int != vers_want) \
144.699 + META_ERROR("dll: Interface version didn't match; expected %d, found %d", vers_want, vers_int); \
144.700 + } \
144.701 + } \
144.702 + else { \
144.703 + META_DEBUG(5, ("dll: Plugin '%s': No %s", desc, STR_GetFuncs)); \
144.704 + struct_field=NULL; \
144.705 + }
144.706 +
144.707 + // Look for API-NEW interface in plugin. We do this before API2/API, because
144.708 + // that's what the engine appears to do..
144.709 + // But we only do this if the gamedll provides these, so that we don't
144.710 + // give a plugin the idea that we'll call them, when in fact we won't
144.711 + // (since we don't export them to the engine when the gamedll doesn't
144.712 + // provide them).
144.713 + if(GameDLL.funcs.newapi_table) {
144.714 + iface_vers=NEW_DLL_FUNCTIONS_VERSION;
144.715 + GET_FUNC_TABLE_FROM_PLUGIN(pfnGetNewDLLFunctions,
144.716 + "GetNewDLLFunctions", newapi_table,
144.717 + NEW_DLL_FUNCTIONS_FN, NEW_DLL_FUNCTIONS,
144.718 + &iface_vers, iface_vers, NEW_DLL_FUNCTIONS_VERSION);
144.719 + iface_vers=NEW_DLL_FUNCTIONS_VERSION;
144.720 + GET_FUNC_TABLE_FROM_PLUGIN(pfnGetNewDLLFunctions_Post,
144.721 + "GetNewDLLFunctions_Post", newapi_post_table,
144.722 + NEW_DLL_FUNCTIONS_FN, NEW_DLL_FUNCTIONS,
144.723 + &iface_vers, iface_vers, NEW_DLL_FUNCTIONS_VERSION);
144.724 + }
144.725 +
144.726 + // Look for API2 interface in plugin; preferred over API-1.
144.727 + iface_vers=INTERFACE_VERSION;
144.728 + GET_FUNC_TABLE_FROM_PLUGIN(pfnGetEntityAPI2,
144.729 + "GetEntityAPI2", dllapi_table,
144.730 + APIFUNCTION2, DLL_FUNCTIONS,
144.731 + &iface_vers, iface_vers, INTERFACE_VERSION);
144.732 + iface_vers=INTERFACE_VERSION;
144.733 + GET_FUNC_TABLE_FROM_PLUGIN(pfnGetEntityAPI2_Post,
144.734 + "GetEntityAPI2_Post", dllapi_post_table,
144.735 + APIFUNCTION2, DLL_FUNCTIONS,
144.736 + &iface_vers, iface_vers, INTERFACE_VERSION);
144.737 +
144.738 + // Look for old-style API in plugin, if API2 interface wasn't found.
144.739 + if(!dllapi_table && !dllapi_post_table) {
144.740 + GET_FUNC_TABLE_FROM_PLUGIN(pfnGetEntityAPI,
144.741 + "GetEntityAPI", dllapi_table,
144.742 + APIFUNCTION, DLL_FUNCTIONS,
144.743 + INTERFACE_VERSION, INTERFACE_VERSION, INTERFACE_VERSION);
144.744 + GET_FUNC_TABLE_FROM_PLUGIN(pfnGetEntityAPI_Post,
144.745 + "GetEntityAPI_Post", dllapi_post_table,
144.746 + APIFUNCTION, DLL_FUNCTIONS,
144.747 + INTERFACE_VERSION, INTERFACE_VERSION, INTERFACE_VERSION);
144.748 + }
144.749 +
144.750 + // Look for Engine interface.
144.751 + iface_vers=ENGINE_INTERFACE_VERSION;
144.752 + GET_FUNC_TABLE_FROM_PLUGIN(pfnGetEngineFunctions,
144.753 + "GetEngineFunctions", engine_table,
144.754 + GET_ENGINE_FUNCTIONS_FN, enginefuncs_t,
144.755 + &iface_vers, iface_vers, ENGINE_INTERFACE_VERSION);
144.756 + iface_vers=ENGINE_INTERFACE_VERSION;
144.757 + GET_FUNC_TABLE_FROM_PLUGIN(pfnGetEngineFunctions_Post,
144.758 + "GetEngineFunctions_Post", engine_post_table,
144.759 + GET_ENGINE_FUNCTIONS_FN, enginefuncs_t,
144.760 + &iface_vers, iface_vers, ENGINE_INTERFACE_VERSION);
144.761 +
144.762 + if(!dllapi_table && !dllapi_post_table
144.763 + && !newapi_table && !newapi_post_table
144.764 + && !engine_table && !engine_post_table)
144.765 + {
144.766 + META_LOG("dll: Plugin '%s' isn't catching _any_ functions ??", desc);
144.767 + }
144.768 +
144.769 + time_loaded=time(NULL);
144.770 + return(mTRUE);
144.771 +}
144.772 +
144.773 +// Unload a plugin. Check time, detach.
144.774 +// meta_errno values:
144.775 +// - ME_ARGUMENT missing necessary fields in plugin
144.776 +// - ME_ALREADY this plugin already unloaded
144.777 +// - ME_BADREQ plugin not marked for unload
144.778 +// - ME_DELAYED unload request is delayed (till changelevel?)
144.779 +// - ME_NOTALLOWED plugin not unloadable after startup
144.780 +// - errno's from check_input()
144.781 +mBOOL MPlugin::unload(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) {
144.782 + if(!check_input()) {
144.783 + // details logged, meta_errno set in check_input()
144.784 + RETURN_ERRNO(mFALSE, ME_ARGUMENT);
144.785 + }
144.786 + if(status < PL_RUNNING) {
144.787 + META_ERROR("dll: Not unloading plugin '%s'; already unloaded (status=%s)", desc, str_status());
144.788 + RETURN_ERRNO(mFALSE, ME_ALREADY);
144.789 + }
144.790 + if(action != PA_UNLOAD && action != PA_RELOAD) {
144.791 + META_ERROR("dll: Not unloading plugin '%s'; not marked for unload (action=%s)", desc, str_action());
144.792 + RETURN_ERRNO(mFALSE, ME_BADREQ);
144.793 + }
144.794 +
144.795 + // Are we allowed to detach this plugin at this time?
144.796 + // If forcing unload, we disregard when plugin wants to be unloaded.
144.797 + if(info->unloadable < now) {
144.798 + if(reason == PNL_CMD_FORCED) {
144.799 + META_DEBUG(2, ("dll: Forced unload plugin '%s' overriding allowed times: allowed=%s; now=%s", desc, str_unloadable(), str_loadtime(now, SL_SIMPLE)));
144.800 + }
144.801 + else {
144.802 + if(info->unloadable > PT_STARTUP) {
144.803 + META_DEBUG(2, ("dll: Delaying unload plugin '%s'; can't detach now: allowed=%s; now=%s", desc, str_unloadable(), str_loadtime(now, SL_SIMPLE)));
144.804 + // caller should give message to user
144.805 + // try to unload again at next opportunity
144.806 + RETURN_ERRNO(mFALSE, ME_DELAYED);
144.807 + }
144.808 + else {
144.809 + META_DEBUG(2, ("dll: Failed unload plugin '%s'; can't detach now: allowed=%s; now=%s", desc, str_unloadable(), str_loadtime(now, SL_SIMPLE)));
144.810 + // don't try to unload again later
144.811 + action=PA_NONE;
144.812 + RETURN_ERRNO(mFALSE, ME_NOTALLOWED);
144.813 + }
144.814 + }
144.815 + }
144.816 +
144.817 + // If unloading during map, then I'd like to call plugin's
144.818 + // ServerDeactivate. However, I don't want to do this until I start
144.819 + // calling ServerActivate when loading during map, since the SDK
144.820 + // indicates these two routines should match call for call.
144.821 +
144.822 + // detach plugin
144.823 + if(!detach(now, reason)) {
144.824 + if(reason == PNL_CMD_FORCED) {
144.825 + META_DEBUG(2, ("dll: Forced unload plugin '%s' overriding failed detach"));
144.826 + }
144.827 + else {
144.828 + META_ERROR("dll: Failed to detach plugin '%s'; ", desc);
144.829 + // meta_errno should be already set in detach()
144.830 + return(mFALSE);
144.831 + }
144.832 + }
144.833 +
144.834 + // successful detach, or forced unload
144.835 +
144.836 + // Unmark registered commands for this plugin (by index number).
144.837 + RegCmds->disable(index);
144.838 + // Unmark registered cvars for this plugin (by index number).
144.839 + RegCvars->disable(index);
144.840 +
144.841 +#ifdef UNFINISHED
144.842 + // Remove all requested hooks from this plugin (by index number).
144.843 + Hooks->remove_all(info);
144.844 +#endif /* UNFINISHED */
144.845 +
144.846 + // Close the file. Note: after this, attempts to reference any memory
144.847 + // locations in the file will produce a segfault.
144.848 + if(DLCLOSE(handle) != 0) {
144.849 + META_ERROR("dll: Couldn't close plugin file '%s': %s", file, DLERROR());
144.850 + status=PL_FAILED;
144.851 + RETURN_ERRNO(mFALSE, ME_DLERROR);
144.852 + }
144.853 + handle=NULL;
144.854 +
144.855 + if(action==PA_UNLOAD) {
144.856 + status=PL_EMPTY;
144.857 + clear();
144.858 + }
144.859 + else if(action==PA_RELOAD) {
144.860 + status=PL_VALID;
144.861 + action=PA_LOAD;
144.862 + }
144.863 + META_LOG("dll: Unloaded plugin '%s' for reason '%s'", desc, str_reason(reason));
144.864 + return(mTRUE);
144.865 +}
144.866 +
144.867 +// Inform plugin we're going to unload it.
144.868 +// meta_errno values:
144.869 +// - ME_DLMISSING couldn't find meta_detach() in plugin
144.870 +// - ME_DLERROR plugin detach() returned error
144.871 +mBOOL MPlugin::detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) {
144.872 + int ret;
144.873 + META_DETACH_FN pfn_detach;
144.874 +
144.875 + if(!(pfn_detach = (META_DETACH_FN) DLSYM(handle, "Meta_Detach"))) {
144.876 + META_ERROR("dll: Error detach plugin '%s': Couldn't find Meta_detach(): %s", desc, DLERROR());
144.877 + // caller will dlclose()
144.878 + RETURN_ERRNO(mFALSE, ME_DLMISSING);
144.879 + }
144.880 +
144.881 + ret=pfn_detach(now, reason);
144.882 + if(ret != TRUE) {
144.883 + META_ERROR("dll: Failed detach plugin '%s': Error from Meta_Detach(): %d", desc, ret);
144.884 + RETURN_ERRNO(mFALSE, ME_DLERROR);
144.885 + }
144.886 + META_DEBUG(6, ("dll: Plugin '%s': Called Meta_Detach() successfully", desc));
144.887 + return(mTRUE);
144.888 +}
144.889 +
144.890 +// Reload a plugin; unload and load again.
144.891 +// meta_errno values:
144.892 +// - errno's from unload()
144.893 +// - errno's from load()
144.894 +mBOOL MPlugin::reload(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) {
144.895 + if(!unload(now, reason)) {
144.896 + META_ERROR("dll: Failed to unload plugin '%s' for reloading", desc);
144.897 + // meta_errno should be set already in unload()
144.898 + return(mFALSE);
144.899 + }
144.900 + if(!load(now)) {
144.901 + META_ERROR("dll: Failed to reload plugin '%s' after unloading", desc);
144.902 + // meta_errno should be set already in load()
144.903 + return(mFALSE);
144.904 + }
144.905 + return(mTRUE);
144.906 +}
144.907 +
144.908 +// Pause a plugin; temporarily disabled for API routines.
144.909 +// meta_errno values:
144.910 +// - ME_ALREADY this plugin already paused
144.911 +// - ME_BADREQ can't pause; not running
144.912 +// - ME_NOTALLOWED plugin doesn't want to be paused
144.913 +mBOOL MPlugin::pause(void) {
144.914 + if(status == PL_PAUSED) {
144.915 + META_ERROR("Not pausing plugin '%s'; already paused", desc);
144.916 + RETURN_ERRNO(mFALSE, ME_ALREADY);
144.917 + }
144.918 + if(status != PL_RUNNING) {
144.919 + META_ERROR("Cannot pause plugin '%s'; not currently running (status=%s)", desc, str_status());
144.920 + RETURN_ERRNO(mFALSE, ME_BADREQ);
144.921 + }
144.922 +
144.923 + // are we allowed to pause this plugin?
144.924 + if(info->unloadable < PT_ANYPAUSE) {
144.925 + META_ERROR("Cannot pause plugin '%s'; not allowed by plugin (allowed=%s)", desc, str_unloadable());
144.926 + action=PA_NONE;
144.927 + RETURN_ERRNO(mFALSE, ME_NOTALLOWED);
144.928 + }
144.929 +
144.930 + status=PL_PAUSED;
144.931 + META_LOG("Paused plugin '%s'", desc);
144.932 + return(mTRUE);
144.933 +}
144.934 +
144.935 +// Unpause a plugin.
144.936 +// meta_errno values:
144.937 +// - ME_BADREQ can't unpause; not paused
144.938 +mBOOL MPlugin::unpause(void) {
144.939 + if(status != PL_PAUSED) {
144.940 + META_ERROR("Cannot unpause plugin '%s'; not currently paused (status=%s)", desc, str_status());
144.941 + RETURN_ERRNO(mFALSE, ME_BADREQ);
144.942 + }
144.943 + status=PL_RUNNING;
144.944 + META_LOG("Unpaused plugin '%s'", desc);
144.945 + return(mTRUE);
144.946 +}
144.947 +
144.948 +// Retry pending action, presumably from a previous failure.
144.949 +// meta_errno values:
144.950 +// - ME_BADREQ no pending action
144.951 +// - errno's from load()
144.952 +// - errno's from unload()
144.953 +// - errno's from reload()
144.954 +mBOOL MPlugin::retry(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) {
144.955 + if(action==PA_LOAD)
144.956 + return(load(now));
144.957 + else if(action==PA_ATTACH)
144.958 + return(load(now));
144.959 + else if(action==PA_UNLOAD)
144.960 + return(unload(now, reason));
144.961 + else if(action==PA_RELOAD)
144.962 + return(reload(now, reason));
144.963 + else {
144.964 + META_ERROR("No pending action to retry for plugin '%s'; (status=%s, action=%s)", desc, str_status(), str_action());
144.965 + RETURN_ERRNO(mFALSE, ME_BADREQ);
144.966 + }
144.967 +}
144.968 +
144.969 +// Clear a plugin (it failed a previous action and should be
144.970 +// removed from the list, or it's being unloaded).
144.971 +// meta_errno values:
144.972 +// - ME_BADREQ not marked for clearing
144.973 +// - ME_DLERROR failed to dlclose
144.974 +mBOOL MPlugin::clear(void) {
144.975 + if(status != PL_FAILED && status != PL_BADFILE
144.976 + && status != PL_EMPTY && status != PL_OPENED) {
144.977 + META_ERROR("Cannot clear plugin '%s'; not marked as failed, empty, or open (status=%s)", desc, str_status());
144.978 + RETURN_ERRNO(mFALSE, ME_BADREQ);
144.979 + }
144.980 + // If file is open, close the file. Note: after this, attempts to
144.981 + // reference any memory locations in the file will produce a segfault.
144.982 + if(handle && DLCLOSE(handle) != 0) {
144.983 + META_ERROR("dll: Couldn't close plugin file '%s': %s", file, DLERROR());
144.984 + status=PL_FAILED;
144.985 + RETURN_ERRNO(mFALSE, ME_DLERROR);
144.986 + }
144.987 + handle=NULL;
144.988 +
144.989 + if(gamedll_funcs.dllapi_table) free(gamedll_funcs.dllapi_table);
144.990 + if(gamedll_funcs.newapi_table) free(gamedll_funcs.newapi_table);
144.991 +
144.992 + status=PL_EMPTY;
144.993 + action=PA_NULL;
144.994 + handle=NULL;
144.995 + info=NULL;
144.996 + time_loaded=0;
144.997 + dllapi_table=NULL;
144.998 + dllapi_post_table=NULL;
144.999 + newapi_table=NULL;
144.1000 + newapi_post_table=NULL;
144.1001 + engine_table=NULL;
144.1002 + engine_post_table=NULL;
144.1003 + return(mTRUE);
144.1004 +}
144.1005 +
144.1006 +// List information about plugin to console.
144.1007 +void MPlugin::show(void) {
144.1008 + char *cp, *tstr;
144.1009 + int n, width;
144.1010 + width=13;
144.1011 + META_CONS("%*s: %s", width, "name", info ? info->name : "(nil)");
144.1012 + META_CONS("%*s: %s", width, "desc", desc);
144.1013 + META_CONS("%*s: %s", width, "status", str_status());
144.1014 + META_CONS("%*s: %s", width, "action", str_action());
144.1015 + META_CONS("%*s: %s", width, "filename", filename);
144.1016 + META_CONS("%*s: %s", width, "file", file);
144.1017 + META_CONS("%*s: %s", width, "pathname", pathname);
144.1018 + META_CONS("%*s: %d", width, "index", index);
144.1019 + META_CONS("%*s: %s", width, "source", str_source());
144.1020 + META_CONS("%*s: %s", width, "loadable", str_loadable(SL_ALLOWED));
144.1021 + META_CONS("%*s: %s", width, "unloadable", str_unloadable(SL_ALLOWED));
144.1022 + META_CONS("%*s: %s", width, "version", info ? info->version : "(nil)");
144.1023 + META_CONS("%*s: %s", width, "date", info ? info->date : "(nil)");
144.1024 + META_CONS("%*s: %s", width, "author", info ? info->author : "(nil)");
144.1025 + META_CONS("%*s: %s", width, "url", info ? info->url : "(nil)");
144.1026 + META_CONS("%*s: %s", width, "logtag", info ? info->logtag : "(nil)");
144.1027 + // ctime() includes newline at EOL
144.1028 + tstr=ctime(&time_loaded);
144.1029 + if((cp=strchr(tstr, '\n')))
144.1030 + *cp='\0';
144.1031 + META_CONS("%*s: %s", width, "last loaded", tstr);
144.1032 + // XXX show file time ?
144.1033 +
144.1034 + if(dllapi_table) {
144.1035 + META_CONS("DLLAPI functions:");
144.1036 + SHOW_DEF_DLLAPI(dllapi_table, " ", "");
144.1037 + META_CONS("%d functions (dllapi)", n);
144.1038 + }
144.1039 + else
144.1040 + META_CONS("No DLLAPI functions.");
144.1041 + if(dllapi_post_table) {
144.1042 + META_CONS("DLLAPI-Post functions:");
144.1043 + SHOW_DEF_DLLAPI(dllapi_post_table, " ", "_Post");
144.1044 + META_CONS("%d functions (dllapi post)", n);
144.1045 + }
144.1046 + else
144.1047 + META_CONS("No DLLAPI-Post functions.");
144.1048 +
144.1049 + if(newapi_table) {
144.1050 + META_CONS("NEWAPI functions:");
144.1051 + SHOW_DEF_NEWAPI(newapi_table, " ", "");
144.1052 + META_CONS("%d functions (newapi)", n);
144.1053 + }
144.1054 + else
144.1055 + META_CONS("No NEWAPI functions.");
144.1056 + if(newapi_post_table) {
144.1057 + META_CONS("NEWAPI-Post functions:");
144.1058 + SHOW_DEF_NEWAPI(newapi_post_table, " ", "_Post");
144.1059 + META_CONS("%d functions (newapi post)", n);
144.1060 + }
144.1061 + else
144.1062 + META_CONS("No NEWAPI-Post functions.");
144.1063 +
144.1064 + if(engine_table) {
144.1065 + META_CONS("Engine functions:");
144.1066 + SHOW_DEF_ENGINE(engine_table, " ", "");
144.1067 + META_CONS("%d functions (engine)", n);
144.1068 + }
144.1069 + else
144.1070 + META_CONS("No Engine functions.");
144.1071 + if(engine_post_table) {
144.1072 + META_CONS("Engine-Post functions:");
144.1073 + SHOW_DEF_ENGINE(engine_post_table, " ", "_Post");
144.1074 + META_CONS("%d functions (engine post)", n);
144.1075 + }
144.1076 + else
144.1077 + META_CONS("No Engine-Post functions.");
144.1078 + RegCmds->show(index);
144.1079 + RegCvars->show(index);
144.1080 +}
144.1081 +
144.1082 +// Check whether the file on disk looks like it's been updated since we
144.1083 +// last loaded the plugin.
144.1084 +// meta_errno values:
144.1085 +// - ME_NOFILE couldn't find file
144.1086 +// - ME_NOERROR no error; false indicates file not newer
144.1087 +mBOOL MPlugin::newer_file(void) {
144.1088 + struct stat st;
144.1089 + time_t file_time;
144.1090 +
144.1091 + if(stat(pathname, &st) != 0)
144.1092 + RETURN_ERRNO(mFALSE, ME_NOFILE);
144.1093 + file_time=max(st.st_ctime, st.st_mtime);
144.1094 + META_DEBUG(5, ("newer_file? file=%s; load=%d, file=%d; ctime=%d, mtime=%d",
144.1095 + file, time_loaded, file_time, st.st_ctime, st.st_mtime));
144.1096 + if(file_time > time_loaded)
144.1097 + return(mTRUE);
144.1098 + else
144.1099 + RETURN_ERRNO(mFALSE, ME_NOERROR);
144.1100 +}
144.1101 +
144.1102 +// Return a string describing status of plugin.
144.1103 +// SIMPLE is the default.
144.1104 +// SHOW is max 4 chars, for "show" output.
144.1105 +// meta_errno values:
144.1106 +// - none
144.1107 +char *MPlugin::str_status(STR_STATUS fmt) {
144.1108 + switch(status) {
144.1109 + case PL_EMPTY:
144.1110 + if(fmt==ST_SHOW) return("empt");
144.1111 + else return("empty");
144.1112 + case PL_VALID:
144.1113 + if(fmt==ST_SHOW) return("info");
144.1114 + else return("valid");
144.1115 + case PL_BADFILE:
144.1116 + if(fmt==ST_SHOW) return("badf");
144.1117 + else return("badfile");
144.1118 + case PL_OPENED:
144.1119 + if(fmt==ST_SHOW) return("open");
144.1120 + else return("opened");
144.1121 + case PL_FAILED:
144.1122 + if(fmt==ST_SHOW) return("fail");
144.1123 + else return("failed");
144.1124 + case PL_RUNNING:
144.1125 + if(fmt==ST_SHOW) return("RUN");
144.1126 + else return("running");
144.1127 + case PL_PAUSED:
144.1128 + if(fmt==ST_SHOW) return("PAUS");
144.1129 + else return("paused");
144.1130 + default:
144.1131 + if(fmt==ST_SHOW) return(UTIL_VarArgs("UNK%d", status));
144.1132 + return(UTIL_VarArgs("unknown (%d)", status));
144.1133 + }
144.1134 +}
144.1135 +
144.1136 +// Return a string (one word) describing requested action for plugin.
144.1137 +// SIMPLE is the default.
144.1138 +// SHOW is max 4 chars, for "show" output.
144.1139 +// meta_errno values:
144.1140 +// - none
144.1141 +char *MPlugin::str_action(STR_ACTION fmt) {
144.1142 + switch(action) {
144.1143 + case PA_NULL:
144.1144 + if(fmt==SA_SHOW) return("NULL");
144.1145 + else return("null");
144.1146 + case PA_NONE:
144.1147 + if(fmt==SA_SHOW) return(" - ");
144.1148 + else return("none");
144.1149 + case PA_KEEP:
144.1150 + if(fmt==SA_SHOW) return("keep");
144.1151 + else return("keep");
144.1152 + case PA_LOAD:
144.1153 + if(fmt==SA_SHOW) return("load");
144.1154 + else return("load");
144.1155 + case PA_ATTACH:
144.1156 + if(fmt==SA_SHOW) return("atch");
144.1157 + else return("attach");
144.1158 + case PA_UNLOAD:
144.1159 + if(fmt==SA_SHOW) return("unld");
144.1160 + else return("unload");
144.1161 + case PA_RELOAD:
144.1162 + if(fmt==SA_SHOW) return("relo");
144.1163 + else return("reload");
144.1164 + default:
144.1165 + if(fmt==SA_SHOW) return(UTIL_VarArgs("UNK%d", action));
144.1166 + else return(UTIL_VarArgs("unknown (%d)", action));
144.1167 + }
144.1168 +}
144.1169 +
144.1170 +// Return a string describing given plugin loadtime.
144.1171 +// SIMPLE is the default.
144.1172 +// SHOW is max 3 chars, for "show" output.
144.1173 +// ALLOWED is in terms of when it's allowed to load/unload.
144.1174 +// NOW is to describe current situation of load/unload attempt.
144.1175 +// meta_errno values:
144.1176 +// - none
144.1177 +char *MPlugin::str_loadtime(PLUG_LOADTIME ptime, STR_LOADTIME fmt) {
144.1178 + switch(ptime) {
144.1179 + case PT_NEVER:
144.1180 + if(fmt==SL_SHOW) return("Never");
144.1181 + else return("never");
144.1182 + case PT_STARTUP:
144.1183 + if(fmt==SL_SHOW) return("Start");
144.1184 + else if(fmt==SL_ALLOWED) return("at server startup");
144.1185 + else if(fmt==SL_NOW) return("during server startup");
144.1186 + else return("startup");
144.1187 + case PT_CHANGELEVEL:
144.1188 + if(fmt==SL_SHOW) return("Chlvl");
144.1189 + else if(fmt==SL_ALLOWED) return("at changelevel");
144.1190 + else if(fmt==SL_NOW) return("during changelevel");
144.1191 + else return("changelevel");
144.1192 + case PT_ANYTIME:
144.1193 + if(fmt==SL_SHOW) return("ANY");
144.1194 + else if(fmt==SL_ALLOWED) return("at any time");
144.1195 + else if(fmt==SL_NOW) return("during map");
144.1196 + else return("anytime");
144.1197 + case PT_ANYPAUSE:
144.1198 + if(fmt==SL_SHOW) return("Pause");
144.1199 + else if(fmt==SL_ALLOWED) return("at any time, and pausable");
144.1200 + else if(fmt==SL_NOW) return("for requested pause");
144.1201 + else return("pausable");
144.1202 + default:
144.1203 + if(fmt==SL_SHOW) return(UTIL_VarArgs("UNK-%d", ptime));
144.1204 + else return(UTIL_VarArgs("unknown (%d)", ptime));
144.1205 + }
144.1206 +}
144.1207 +
144.1208 +// Return a string describing why a plugin is to be unloaded.
144.1209 +// meta_errno values:
144.1210 +// - none
144.1211 +char *MPlugin::str_reason(PL_UNLOAD_REASON preason) {
144.1212 + switch(preason) {
144.1213 + case PNL_NULL:
144.1214 + return("null");
144.1215 + case PNL_INI_DELETED:
144.1216 + return("deleted from ini file");
144.1217 + case PNL_FILE_NEWER:
144.1218 + return("file on disk is newer");
144.1219 + case PNL_COMMAND:
144.1220 + return("server command");
144.1221 + case PNL_CMD_FORCED:
144.1222 + return("forced by server command");
144.1223 + default:
144.1224 + return(UTIL_VarArgs("unknown (%d)", preason));
144.1225 + }
144.1226 +}
144.1227 +
144.1228 +// Return a string describing how the plugin was loaded.
144.1229 +// meta_errno values:
144.1230 +// - none
144.1231 +char *MPlugin::str_source(STR_SOURCE fmt) {
144.1232 + switch(source) {
144.1233 + case PS_INI:
144.1234 + if(fmt==SO_SHOW) return("ini");
144.1235 + else return("ini file");
144.1236 + case PS_CMD:
144.1237 + if(fmt==SO_SHOW) return("cmd");
144.1238 + else return("console command");
144.1239 + default:
144.1240 + if(fmt==SO_SHOW) return(UTIL_VarArgs("UNK%d", source));
144.1241 + else return(UTIL_VarArgs("unknown (%d)", source));
144.1242 + }
144.1243 +}
145.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
145.2 +++ b/metamod/mplugin.h Tue Apr 06 07:36:14 2004 +0000
145.3 @@ -0,0 +1,410 @@
145.4 +// vi: set ts=4 sw=4 :
145.5 +// vim: set tw=75 :
145.6 +
145.7 +// mplugin.h - class and types to describe an individual plugin
145.8 +
145.9 +/*
145.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
145.11 + *
145.12 + * This file is part of Metamod.
145.13 + *
145.14 + * Metamod is free software; you can redistribute it and/or modify it
145.15 + * under the terms of the GNU General Public License as published by the
145.16 + * Free Software Foundation; either version 2 of the License, or (at
145.17 + * your option) any later version.
145.18 + *
145.19 + * Metamod is distributed in the hope that it will be useful, but
145.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
145.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
145.22 + * General Public License for more details.
145.23 + *
145.24 + * You should have received a copy of the GNU General Public License
145.25 + * along with Metamod; if not, write to the Free Software Foundation,
145.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
145.27 + *
145.28 + * In addition, as a special exception, the author gives permission to
145.29 + * link the code of this program with the Half-Life Game Engine ("HL
145.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
145.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
145.32 + * respects for all of the code used other than the HL Engine and MODs
145.33 + * from Valve. If you modify this file, you may extend this exception
145.34 + * to your version of the file, but you are not obligated to do so. If
145.35 + * you do not wish to do so, delete this exception statement from your
145.36 + * version.
145.37 + *
145.38 + */
145.39 +
145.40 +#ifndef MPLUGIN_H
145.41 +#define MPLUGIN_H
145.42 +
145.43 +#include <time.h> // time_t, etc
145.44 +
145.45 +#include <eiface.h> // DLL_FUNCTIONS, etc
145.46 +
145.47 +#include "types_meta.h" // mBOOL
145.48 +#include "meta_api.h" // GETENTITYAPI_FN, etc
145.49 +#include "api_info.h" // dllapi_info, etc
145.50 +#include "support_meta.h" // MAX_DESC_LEN
145.51 +
145.52 +
145.53 +// Flags to indicate current "load" state of plugin.
145.54 +// NOTE: order is important, as greater/less comparisons are made.
145.55 +typedef enum {
145.56 + PL_EMPTY = 0, // empty slot
145.57 + PL_VALID, // has valid info in it
145.58 + PL_BADFILE, // nonexistent file (open failed),
145.59 + // or not a valid plugin file (query failed)
145.60 + PL_OPENED, // dlopened and queried
145.61 + PL_FAILED, // opened, but failed to attach or unattach
145.62 + PL_RUNNING, // attached and running
145.63 + PL_PAUSED, // attached but paused
145.64 +} PLUG_STATUS;
145.65 +
145.66 +// Action to take for plugin at next opportunity.
145.67 +typedef enum {
145.68 + PA_NULL = 0,
145.69 + PA_NONE, // no action needed right now
145.70 + PA_KEEP, // keep, after ini refresh
145.71 + PA_LOAD, // load (dlopen, query) and try to attach
145.72 + PA_ATTACH, // attach
145.73 + PA_UNLOAD, // unload (detach, dlclose)
145.74 + PA_RELOAD, // unload and load again
145.75 +} PLUG_ACTION;
145.76 +
145.77 +// Flags to indicate from where the plugin was loaded.
145.78 +typedef enum {
145.79 + PS_INI = 0, // was loaded from the plugins.ini
145.80 + PS_CMD, // was loaded via a server command
145.81 +} PLOAD_SOURCE;
145.82 +
145.83 +// Flags for how to word description of plugin loadtime.
145.84 +typedef enum {
145.85 + SL_SIMPLE = 0, // single word
145.86 + SL_SHOW, // for "show" output, 5 chars
145.87 + SL_ALLOWED, // when plugin is allowed to load/unload
145.88 + SL_NOW, // current situation
145.89 +} STR_LOADTIME;
145.90 +
145.91 +// Flags for how to format description of status.
145.92 +typedef enum {
145.93 + ST_SIMPLE = 0, // single word
145.94 + ST_SHOW, // for "show" output, 4 chars
145.95 +} STR_STATUS;
145.96 +
145.97 +// Flags for how to format description of action.
145.98 +typedef enum {
145.99 + SA_SIMPLE = 0, // single word
145.100 + SA_SHOW, // for "show" output, 4 chars
145.101 +} STR_ACTION;
145.102 +
145.103 +// Flags for how to format description of source.
145.104 +typedef enum {
145.105 + SO_SIMPLE = 0, // two words
145.106 + SO_SHOW, // for "list" output, 3 chars
145.107 +} STR_SOURCE;
145.108 +
145.109 +// An individual plugin.
145.110 +class MPlugin {
145.111 + private:
145.112 + mBOOL query(void);
145.113 + mBOOL attach(PLUG_LOADTIME now);
145.114 + mBOOL detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason);
145.115 + gamedll_funcs_t gamedll_funcs;
145.116 + mutil_funcs_t mutil_funcs;
145.117 + public:
145.118 + // data:
145.119 + int index; // 1-based
145.120 + char filename[PATH_MAX]; // ie "dlls/mm_test_i386.so", from inifile
145.121 + char *file; // ie "mm_test_i386.so", ptr from filename
145.122 + char desc[MAX_DESC_LEN]; // ie "Test metamod plugin", from inifile
145.123 + char pathname[PATH_MAX]; // UNIQUE, ie "/home/willday/half-life/cstrike/dlls/mm_test_i386.so", built with GameDLL.gamedir
145.124 + PLUG_STATUS status; // current status of plugin (loaded, etc)
145.125 + PLUG_ACTION action; // what to do with plugin (load, unload, etc)
145.126 + PLOAD_SOURCE source; // source of the request to load the plugin
145.127 +
145.128 + DLHANDLE handle; // handle for dlopen, dlsym, etc
145.129 + plugin_info_t *info; // information plugin provides about itself
145.130 + time_t time_loaded; // when plugin was loaded
145.131 +
145.132 + DLL_FUNCTIONS *dllapi_table;
145.133 + DLL_FUNCTIONS *dllapi_post_table;
145.134 + NEW_DLL_FUNCTIONS *newapi_table;
145.135 + NEW_DLL_FUNCTIONS *newapi_post_table;
145.136 + enginefuncs_t *engine_table;
145.137 + enginefuncs_t *engine_post_table;
145.138 +
145.139 + // functions:
145.140 + mBOOL ini_parseline(char *line); // parse line from inifile
145.141 + mBOOL cmd_parseline(const char *line); // parse from console command
145.142 + mBOOL check_input(void);
145.143 +
145.144 + mBOOL resolve(void); // find a matching file on disk
145.145 + char *resolve_dirs(char *path);
145.146 + char *resolve_prefix(char *path);
145.147 + char *resolve_suffix(char *path);
145.148 +
145.149 + mBOOL load(PLUG_LOADTIME now);
145.150 + mBOOL unload(PLUG_LOADTIME now, PL_UNLOAD_REASON reason);
145.151 + mBOOL reload(PLUG_LOADTIME now, PL_UNLOAD_REASON reason);
145.152 + mBOOL pause(void);
145.153 + mBOOL unpause(void);
145.154 + mBOOL retry(PLUG_LOADTIME now, PL_UNLOAD_REASON reason); // if previously failed
145.155 + mBOOL clear(void);
145.156 + void show(void); // print info about plugin to console
145.157 +
145.158 + mBOOL newer_file(void); // check for newer file on disk
145.159 +
145.160 + // output string functions
145.161 + char *str_status(STR_STATUS fmt);
145.162 + char *str_action(STR_ACTION fmt);
145.163 + char *str_source(STR_SOURCE fmt);
145.164 +
145.165 + char *str_reason(PL_UNLOAD_REASON preason);
145.166 + char *str_loadtime(PLUG_LOADTIME pallow, STR_LOADTIME fmt);
145.167 +
145.168 + char *str_status(void) { return(str_status(ST_SIMPLE)); };
145.169 + char *str_action(void) { return(str_action(SA_SIMPLE)); };
145.170 + char *str_source(void) { return(str_source(SO_SIMPLE)); };
145.171 +
145.172 + char *str_loadable(void) {
145.173 + if(info) return(str_loadtime(info->loadable, SL_SIMPLE));
145.174 + else return(" -");
145.175 + };
145.176 + char *str_unloadable(void) {
145.177 + if(info) return(str_loadtime(info->unloadable, SL_SIMPLE));
145.178 + else return(" -");
145.179 + };
145.180 + char *str_loadable(STR_LOADTIME fmt) {
145.181 + if(info) return(str_loadtime(info->loadable, fmt));
145.182 + else return(" -");
145.183 + };
145.184 + char *str_unloadable(STR_LOADTIME fmt) {
145.185 + if(info) return(str_loadtime(info->unloadable, fmt));
145.186 + else return(" -");
145.187 + };
145.188 +};
145.189 +
145.190 +// Macros used by MPlugin::show(), to list the functions that the plugin
145.191 +// catches.
145.192 +#define SHOW_IFDEF(api_table, info_table, pfnName, pre_str, post_str) \
145.193 + if(api_table->pfnName) { META_CONS("%s%s%s", pre_str, info_table.pfnName.name, post_str); n++;}
145.194 +
145.195 +#define SHOW_DEF_DLLAPI(api_table, pre_str, post_str) \
145.196 + n=0; \
145.197 + SHOW_IFDEF(api_table, dllapi_info, pfnGameInit, pre_str, post_str); \
145.198 + SHOW_IFDEF(api_table, dllapi_info, pfnSpawn, pre_str, post_str); \
145.199 + SHOW_IFDEF(api_table, dllapi_info, pfnThink, pre_str, post_str); \
145.200 + SHOW_IFDEF(api_table, dllapi_info, pfnUse, pre_str, post_str); \
145.201 + SHOW_IFDEF(api_table, dllapi_info, pfnTouch, pre_str, post_str); \
145.202 + SHOW_IFDEF(api_table, dllapi_info, pfnBlocked, pre_str, post_str); \
145.203 + SHOW_IFDEF(api_table, dllapi_info, pfnKeyValue, pre_str, post_str); \
145.204 + SHOW_IFDEF(api_table, dllapi_info, pfnSave, pre_str, post_str); \
145.205 + SHOW_IFDEF(api_table, dllapi_info, pfnRestore, pre_str, post_str); \
145.206 + SHOW_IFDEF(api_table, dllapi_info, pfnSetAbsBox, pre_str, post_str); \
145.207 + SHOW_IFDEF(api_table, dllapi_info, pfnSaveWriteFields, pre_str, post_str); \
145.208 + SHOW_IFDEF(api_table, dllapi_info, pfnSaveReadFields, pre_str, post_str); \
145.209 + SHOW_IFDEF(api_table, dllapi_info, pfnSaveGlobalState, pre_str, post_str); \
145.210 + SHOW_IFDEF(api_table, dllapi_info, pfnRestoreGlobalState, pre_str, post_str); \
145.211 + SHOW_IFDEF(api_table, dllapi_info, pfnResetGlobalState, pre_str, post_str); \
145.212 + SHOW_IFDEF(api_table, dllapi_info, pfnClientConnect, pre_str, post_str); \
145.213 + SHOW_IFDEF(api_table, dllapi_info, pfnClientDisconnect, pre_str, post_str); \
145.214 + SHOW_IFDEF(api_table, dllapi_info, pfnClientKill, pre_str, post_str); \
145.215 + SHOW_IFDEF(api_table, dllapi_info, pfnClientPutInServer, pre_str, post_str); \
145.216 + SHOW_IFDEF(api_table, dllapi_info, pfnClientCommand, pre_str, post_str); \
145.217 + SHOW_IFDEF(api_table, dllapi_info, pfnClientUserInfoChanged, pre_str, post_str); \
145.218 + SHOW_IFDEF(api_table, dllapi_info, pfnServerActivate, pre_str, post_str); \
145.219 + SHOW_IFDEF(api_table, dllapi_info, pfnServerDeactivate, pre_str, post_str); \
145.220 + SHOW_IFDEF(api_table, dllapi_info, pfnPlayerPreThink, pre_str, post_str); \
145.221 + SHOW_IFDEF(api_table, dllapi_info, pfnPlayerPostThink, pre_str, post_str); \
145.222 + SHOW_IFDEF(api_table, dllapi_info, pfnStartFrame, pre_str, post_str); \
145.223 + SHOW_IFDEF(api_table, dllapi_info, pfnParmsNewLevel, pre_str, post_str); \
145.224 + SHOW_IFDEF(api_table, dllapi_info, pfnParmsChangeLevel, pre_str, post_str); \
145.225 + SHOW_IFDEF(api_table, dllapi_info, pfnGetGameDescription, pre_str, post_str); \
145.226 + SHOW_IFDEF(api_table, dllapi_info, pfnPlayerCustomization, pre_str, post_str); \
145.227 + SHOW_IFDEF(api_table, dllapi_info, pfnSpectatorConnect, pre_str, post_str); \
145.228 + SHOW_IFDEF(api_table, dllapi_info, pfnSpectatorDisconnect, pre_str, post_str); \
145.229 + SHOW_IFDEF(api_table, dllapi_info, pfnSpectatorThink, pre_str, post_str); \
145.230 + SHOW_IFDEF(api_table, dllapi_info, pfnSys_Error, pre_str, post_str); \
145.231 + SHOW_IFDEF(api_table, dllapi_info, pfnPM_Move, pre_str, post_str); \
145.232 + SHOW_IFDEF(api_table, dllapi_info, pfnPM_Init, pre_str, post_str); \
145.233 + SHOW_IFDEF(api_table, dllapi_info, pfnPM_FindTextureType, pre_str, post_str); \
145.234 + SHOW_IFDEF(api_table, dllapi_info, pfnSetupVisibility, pre_str, post_str); \
145.235 + SHOW_IFDEF(api_table, dllapi_info, pfnUpdateClientData, pre_str, post_str); \
145.236 + SHOW_IFDEF(api_table, dllapi_info, pfnAddToFullPack, pre_str, post_str); \
145.237 + SHOW_IFDEF(api_table, dllapi_info, pfnCreateBaseline, pre_str, post_str); \
145.238 + SHOW_IFDEF(api_table, dllapi_info, pfnRegisterEncoders, pre_str, post_str); \
145.239 + SHOW_IFDEF(api_table, dllapi_info, pfnGetWeaponData, pre_str, post_str); \
145.240 + SHOW_IFDEF(api_table, dllapi_info, pfnCmdStart, pre_str, post_str); \
145.241 + SHOW_IFDEF(api_table, dllapi_info, pfnCmdEnd, pre_str, post_str); \
145.242 + SHOW_IFDEF(api_table, dllapi_info, pfnConnectionlessPacket, pre_str, post_str); \
145.243 + SHOW_IFDEF(api_table, dllapi_info, pfnGetHullBounds, pre_str, post_str); \
145.244 + SHOW_IFDEF(api_table, dllapi_info, pfnCreateInstancedBaselines, pre_str, post_str); \
145.245 + SHOW_IFDEF(api_table, dllapi_info, pfnInconsistentFile, pre_str, post_str); \
145.246 + SHOW_IFDEF(api_table, dllapi_info, pfnAllowLagCompensation, pre_str, post_str);
145.247 +
145.248 +#define SHOW_DEF_NEWAPI(api_table, pre_str, post_str) \
145.249 + n=0; \
145.250 + SHOW_IFDEF(api_table, newapi_info, pfnOnFreeEntPrivateData, pre_str, post_str); \
145.251 + SHOW_IFDEF(api_table, newapi_info, pfnGameShutdown, pre_str, post_str); \
145.252 + SHOW_IFDEF(api_table, newapi_info, pfnShouldCollide, pre_str, post_str)
145.253 +
145.254 +#define SHOW_DEF_ENGINE(api_table, pre_str, post_str) \
145.255 + n=0; \
145.256 + SHOW_IFDEF(api_table, engine_info, pfnPrecacheModel, pre_str, post_str); \
145.257 + SHOW_IFDEF(api_table, engine_info, pfnPrecacheSound, pre_str, post_str); \
145.258 + SHOW_IFDEF(api_table, engine_info, pfnSetModel, pre_str, post_str); \
145.259 + SHOW_IFDEF(api_table, engine_info, pfnModelIndex, pre_str, post_str); \
145.260 + SHOW_IFDEF(api_table, engine_info, pfnModelFrames, pre_str, post_str); \
145.261 + SHOW_IFDEF(api_table, engine_info, pfnSetSize, pre_str, post_str); \
145.262 + SHOW_IFDEF(api_table, engine_info, pfnChangeLevel, pre_str, post_str); \
145.263 + SHOW_IFDEF(api_table, engine_info, pfnGetSpawnParms, pre_str, post_str); \
145.264 + SHOW_IFDEF(api_table, engine_info, pfnSaveSpawnParms, pre_str, post_str); \
145.265 + SHOW_IFDEF(api_table, engine_info, pfnVecToYaw, pre_str, post_str); \
145.266 + SHOW_IFDEF(api_table, engine_info, pfnVecToAngles, pre_str, post_str); \
145.267 + SHOW_IFDEF(api_table, engine_info, pfnMoveToOrigin, pre_str, post_str); \
145.268 + SHOW_IFDEF(api_table, engine_info, pfnChangeYaw, pre_str, post_str); \
145.269 + SHOW_IFDEF(api_table, engine_info, pfnChangePitch, pre_str, post_str); \
145.270 + SHOW_IFDEF(api_table, engine_info, pfnFindEntityByString, pre_str, post_str); \
145.271 + SHOW_IFDEF(api_table, engine_info, pfnGetEntityIllum, pre_str, post_str); \
145.272 + SHOW_IFDEF(api_table, engine_info, pfnFindEntityInSphere, pre_str, post_str); \
145.273 + SHOW_IFDEF(api_table, engine_info, pfnFindClientInPVS, pre_str, post_str); \
145.274 + SHOW_IFDEF(api_table, engine_info, pfnEntitiesInPVS, pre_str, post_str); \
145.275 + SHOW_IFDEF(api_table, engine_info, pfnMakeVectors, pre_str, post_str); \
145.276 + SHOW_IFDEF(api_table, engine_info, pfnAngleVectors, pre_str, post_str); \
145.277 + SHOW_IFDEF(api_table, engine_info, pfnCreateEntity, pre_str, post_str); \
145.278 + SHOW_IFDEF(api_table, engine_info, pfnRemoveEntity, pre_str, post_str); \
145.279 + SHOW_IFDEF(api_table, engine_info, pfnCreateNamedEntity, pre_str, post_str); \
145.280 + SHOW_IFDEF(api_table, engine_info, pfnMakeStatic, pre_str, post_str); \
145.281 + SHOW_IFDEF(api_table, engine_info, pfnEntIsOnFloor, pre_str, post_str); \
145.282 + SHOW_IFDEF(api_table, engine_info, pfnDropToFloor, pre_str, post_str); \
145.283 + SHOW_IFDEF(api_table, engine_info, pfnWalkMove, pre_str, post_str); \
145.284 + SHOW_IFDEF(api_table, engine_info, pfnSetOrigin, pre_str, post_str); \
145.285 + SHOW_IFDEF(api_table, engine_info, pfnEmitSound, pre_str, post_str); \
145.286 + SHOW_IFDEF(api_table, engine_info, pfnEmitAmbientSound, pre_str, post_str); \
145.287 + SHOW_IFDEF(api_table, engine_info, pfnTraceLine, pre_str, post_str); \
145.288 + SHOW_IFDEF(api_table, engine_info, pfnTraceToss, pre_str, post_str); \
145.289 + SHOW_IFDEF(api_table, engine_info, pfnTraceMonsterHull, pre_str, post_str); \
145.290 + SHOW_IFDEF(api_table, engine_info, pfnTraceHull, pre_str, post_str); \
145.291 + SHOW_IFDEF(api_table, engine_info, pfnTraceModel, pre_str, post_str); \
145.292 + SHOW_IFDEF(api_table, engine_info, pfnTraceTexture, pre_str, post_str); \
145.293 + SHOW_IFDEF(api_table, engine_info, pfnTraceSphere, pre_str, post_str); \
145.294 + SHOW_IFDEF(api_table, engine_info, pfnGetAimVector, pre_str, post_str); \
145.295 + SHOW_IFDEF(api_table, engine_info, pfnServerCommand, pre_str, post_str); \
145.296 + SHOW_IFDEF(api_table, engine_info, pfnServerExecute, pre_str, post_str); \
145.297 + SHOW_IFDEF(api_table, engine_info, pfnClientCommand, pre_str, post_str); \
145.298 + SHOW_IFDEF(api_table, engine_info, pfnParticleEffect, pre_str, post_str); \
145.299 + SHOW_IFDEF(api_table, engine_info, pfnLightStyle, pre_str, post_str); \
145.300 + SHOW_IFDEF(api_table, engine_info, pfnDecalIndex, pre_str, post_str); \
145.301 + SHOW_IFDEF(api_table, engine_info, pfnPointContents, pre_str, post_str); \
145.302 + SHOW_IFDEF(api_table, engine_info, pfnMessageBegin, pre_str, post_str); \
145.303 + SHOW_IFDEF(api_table, engine_info, pfnMessageEnd, pre_str, post_str); \
145.304 + SHOW_IFDEF(api_table, engine_info, pfnWriteByte, pre_str, post_str); \
145.305 + SHOW_IFDEF(api_table, engine_info, pfnWriteChar, pre_str, post_str); \
145.306 + SHOW_IFDEF(api_table, engine_info, pfnWriteShort, pre_str, post_str); \
145.307 + SHOW_IFDEF(api_table, engine_info, pfnWriteLong, pre_str, post_str); \
145.308 + SHOW_IFDEF(api_table, engine_info, pfnWriteAngle, pre_str, post_str); \
145.309 + SHOW_IFDEF(api_table, engine_info, pfnWriteCoord, pre_str, post_str); \
145.310 + SHOW_IFDEF(api_table, engine_info, pfnWriteString, pre_str, post_str); \
145.311 + SHOW_IFDEF(api_table, engine_info, pfnWriteEntity, pre_str, post_str); \
145.312 + SHOW_IFDEF(api_table, engine_info, pfnCVarRegister, pre_str, post_str); \
145.313 + SHOW_IFDEF(api_table, engine_info, pfnCVarGetFloat, pre_str, post_str); \
145.314 + SHOW_IFDEF(api_table, engine_info, pfnCVarGetString, pre_str, post_str); \
145.315 + SHOW_IFDEF(api_table, engine_info, pfnCVarSetFloat, pre_str, post_str); \
145.316 + SHOW_IFDEF(api_table, engine_info, pfnCVarSetString, pre_str, post_str); \
145.317 + SHOW_IFDEF(api_table, engine_info, pfnAlertMessage, pre_str, post_str); \
145.318 + SHOW_IFDEF(api_table, engine_info, pfnEngineFprintf, pre_str, post_str); \
145.319 + SHOW_IFDEF(api_table, engine_info, pfnPvAllocEntPrivateData, pre_str, post_str); \
145.320 + SHOW_IFDEF(api_table, engine_info, pfnPvEntPrivateData, pre_str, post_str); \
145.321 + SHOW_IFDEF(api_table, engine_info, pfnFreeEntPrivateData, pre_str, post_str); \
145.322 + SHOW_IFDEF(api_table, engine_info, pfnSzFromIndex, pre_str, post_str); \
145.323 + SHOW_IFDEF(api_table, engine_info, pfnAllocString, pre_str, post_str); \
145.324 + SHOW_IFDEF(api_table, engine_info, pfnGetVarsOfEnt, pre_str, post_str); \
145.325 + SHOW_IFDEF(api_table, engine_info, pfnPEntityOfEntOffset, pre_str, post_str); \
145.326 + SHOW_IFDEF(api_table, engine_info, pfnEntOffsetOfPEntity, pre_str, post_str); \
145.327 + SHOW_IFDEF(api_table, engine_info, pfnIndexOfEdict, pre_str, post_str); \
145.328 + SHOW_IFDEF(api_table, engine_info, pfnPEntityOfEntIndex, pre_str, post_str); \
145.329 + SHOW_IFDEF(api_table, engine_info, pfnFindEntityByVars, pre_str, post_str); \
145.330 + SHOW_IFDEF(api_table, engine_info, pfnGetModelPtr, pre_str, post_str); \
145.331 + SHOW_IFDEF(api_table, engine_info, pfnRegUserMsg, pre_str, post_str); \
145.332 + SHOW_IFDEF(api_table, engine_info, pfnAnimationAutomove, pre_str, post_str); \
145.333 + SHOW_IFDEF(api_table, engine_info, pfnGetBonePosition, pre_str, post_str); \
145.334 + SHOW_IFDEF(api_table, engine_info, pfnFunctionFromName, pre_str, post_str); \
145.335 + SHOW_IFDEF(api_table, engine_info, pfnNameForFunction, pre_str, post_str); \
145.336 + SHOW_IFDEF(api_table, engine_info, pfnClientPrintf, pre_str, post_str); \
145.337 + SHOW_IFDEF(api_table, engine_info, pfnServerPrint, pre_str, post_str); \
145.338 + SHOW_IFDEF(api_table, engine_info, pfnCmd_Args, pre_str, post_str); \
145.339 + SHOW_IFDEF(api_table, engine_info, pfnCmd_Argv, pre_str, post_str); \
145.340 + SHOW_IFDEF(api_table, engine_info, pfnCmd_Argc, pre_str, post_str); \
145.341 + SHOW_IFDEF(api_table, engine_info, pfnGetAttachment, pre_str, post_str); \
145.342 + SHOW_IFDEF(api_table, engine_info, pfnCRC32_Init, pre_str, post_str); \
145.343 + SHOW_IFDEF(api_table, engine_info, pfnCRC32_ProcessBuffer, pre_str, post_str); \
145.344 + SHOW_IFDEF(api_table, engine_info, pfnCRC32_ProcessByte, pre_str, post_str); \
145.345 + SHOW_IFDEF(api_table, engine_info, pfnCRC32_Final, pre_str, post_str); \
145.346 + SHOW_IFDEF(api_table, engine_info, pfnRandomLong, pre_str, post_str); \
145.347 + SHOW_IFDEF(api_table, engine_info, pfnRandomFloat, pre_str, post_str); \
145.348 + SHOW_IFDEF(api_table, engine_info, pfnSetView, pre_str, post_str); \
145.349 + SHOW_IFDEF(api_table, engine_info, pfnTime, pre_str, post_str); \
145.350 + SHOW_IFDEF(api_table, engine_info, pfnCrosshairAngle, pre_str, post_str); \
145.351 + SHOW_IFDEF(api_table, engine_info, pfnLoadFileForMe, pre_str, post_str); \
145.352 + SHOW_IFDEF(api_table, engine_info, pfnFreeFile, pre_str, post_str); \
145.353 + SHOW_IFDEF(api_table, engine_info, pfnEndSection, pre_str, post_str); \
145.354 + SHOW_IFDEF(api_table, engine_info, pfnCompareFileTime, pre_str, post_str); \
145.355 + SHOW_IFDEF(api_table, engine_info, pfnGetGameDir, pre_str, post_str); \
145.356 + SHOW_IFDEF(api_table, engine_info, pfnCvar_RegisterVariable, pre_str, post_str); \
145.357 + SHOW_IFDEF(api_table, engine_info, pfnFadeClientVolume, pre_str, post_str); \
145.358 + SHOW_IFDEF(api_table, engine_info, pfnSetClientMaxspeed, pre_str, post_str); \
145.359 + SHOW_IFDEF(api_table, engine_info, pfnCreateFakeClient, pre_str, post_str); \
145.360 + SHOW_IFDEF(api_table, engine_info, pfnRunPlayerMove, pre_str, post_str); \
145.361 + SHOW_IFDEF(api_table, engine_info, pfnNumberOfEntities, pre_str, post_str); \
145.362 + SHOW_IFDEF(api_table, engine_info, pfnGetInfoKeyBuffer, pre_str, post_str); \
145.363 + SHOW_IFDEF(api_table, engine_info, pfnInfoKeyValue, pre_str, post_str); \
145.364 + SHOW_IFDEF(api_table, engine_info, pfnSetKeyValue, pre_str, post_str); \
145.365 + SHOW_IFDEF(api_table, engine_info, pfnSetClientKeyValue, pre_str, post_str); \
145.366 + SHOW_IFDEF(api_table, engine_info, pfnIsMapValid, pre_str, post_str); \
145.367 + SHOW_IFDEF(api_table, engine_info, pfnStaticDecal, pre_str, post_str); \
145.368 + SHOW_IFDEF(api_table, engine_info, pfnPrecacheGeneric, pre_str, post_str); \
145.369 + SHOW_IFDEF(api_table, engine_info, pfnGetPlayerUserId, pre_str, post_str); \
145.370 + SHOW_IFDEF(api_table, engine_info, pfnBuildSoundMsg, pre_str, post_str); \
145.371 + SHOW_IFDEF(api_table, engine_info, pfnIsDedicatedServer, pre_str, post_str); \
145.372 + SHOW_IFDEF(api_table, engine_info, pfnCVarGetPointer, pre_str, post_str); \
145.373 + SHOW_IFDEF(api_table, engine_info, pfnGetPlayerWONId, pre_str, post_str); \
145.374 + SHOW_IFDEF(api_table, engine_info, pfnInfo_RemoveKey, pre_str, post_str); \
145.375 + SHOW_IFDEF(api_table, engine_info, pfnGetPhysicsKeyValue, pre_str, post_str); \
145.376 + SHOW_IFDEF(api_table, engine_info, pfnSetPhysicsKeyValue, pre_str, post_str); \
145.377 + SHOW_IFDEF(api_table, engine_info, pfnGetPhysicsInfoString, pre_str, post_str); \
145.378 + SHOW_IFDEF(api_table, engine_info, pfnPrecacheEvent, pre_str, post_str); \
145.379 + SHOW_IFDEF(api_table, engine_info, pfnPlaybackEvent, pre_str, post_str); \
145.380 + SHOW_IFDEF(api_table, engine_info, pfnSetFatPVS, pre_str, post_str); \
145.381 + SHOW_IFDEF(api_table, engine_info, pfnSetFatPAS, pre_str, post_str); \
145.382 + SHOW_IFDEF(api_table, engine_info, pfnCheckVisibility, pre_str, post_str); \
145.383 + SHOW_IFDEF(api_table, engine_info, pfnDeltaSetField, pre_str, post_str); \
145.384 + SHOW_IFDEF(api_table, engine_info, pfnDeltaUnsetField, pre_str, post_str); \
145.385 + SHOW_IFDEF(api_table, engine_info, pfnDeltaAddEncoder, pre_str, post_str); \
145.386 + SHOW_IFDEF(api_table, engine_info, pfnGetCurrentPlayer, pre_str, post_str); \
145.387 + SHOW_IFDEF(api_table, engine_info, pfnCanSkipPlayer, pre_str, post_str); \
145.388 + SHOW_IFDEF(api_table, engine_info, pfnDeltaFindField, pre_str, post_str); \
145.389 + SHOW_IFDEF(api_table, engine_info, pfnDeltaSetFieldByIndex, pre_str, post_str); \
145.390 + SHOW_IFDEF(api_table, engine_info, pfnDeltaUnsetFieldByIndex, pre_str, post_str); \
145.391 + SHOW_IFDEF(api_table, engine_info, pfnSetGroupMask, pre_str, post_str); \
145.392 + SHOW_IFDEF(api_table, engine_info, pfnCreateInstancedBaseline, pre_str, post_str); \
145.393 + SHOW_IFDEF(api_table, engine_info, pfnCvar_DirectSet, pre_str, post_str); \
145.394 + SHOW_IFDEF(api_table, engine_info, pfnForceUnmodified, pre_str, post_str); \
145.395 + SHOW_IFDEF(api_table, engine_info, pfnGetPlayerStats, pre_str, post_str); \
145.396 + SHOW_IFDEF(api_table, engine_info, pfnAddServerCommand, pre_str, post_str); \
145.397 + SHOW_IFDEF(api_table, engine_info, pfnVoice_GetClientListening, pre_str, post_str); \
145.398 + SHOW_IFDEF(api_table, engine_info, pfnVoice_SetClientListening, pre_str, post_str); \
145.399 + SHOW_IFDEF(api_table, engine_info, pfnGetPlayerAuthId, pre_str, post_str); \
145.400 + SHOW_IFDEF(api_table, engine_info, pfnSequenceGet, pre_str, post_str); \
145.401 + SHOW_IFDEF(api_table, engine_info, pfnSequencePickSentence, pre_str, post_str); \
145.402 + SHOW_IFDEF(api_table, engine_info, pfnGetFileSize, pre_str, post_str); \
145.403 + SHOW_IFDEF(api_table, engine_info, pfnGetApproxWavePlayLen, pre_str, post_str); \
145.404 + SHOW_IFDEF(api_table, engine_info, pfnIsCareerMatch, pre_str, post_str); \
145.405 + SHOW_IFDEF(api_table, engine_info, pfnGetLocalizedStringLength, pre_str, post_str); \
145.406 + SHOW_IFDEF(api_table, engine_info, pfnRegisterTutorMessageShown, pre_str, post_str); \
145.407 + SHOW_IFDEF(api_table, engine_info, pfnGetTimesTutorMessageShown, pre_str, post_str); \
145.408 + SHOW_IFDEF(api_table, engine_info, pfnProcessTutorMessageDecayBuffer, pre_str, post_str); \
145.409 + SHOW_IFDEF(api_table, engine_info, pfnConstructTutorMessageDecayBuffer, pre_str, post_str); \
145.410 + SHOW_IFDEF(api_table, engine_info, pfnResetTutorMessageDecayData, pre_str, post_str); \
145.411 +
145.412 +
145.413 +#endif /* MPLUGIN_H */
146.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
146.2 +++ b/metamod/mqueue.cpp Tue Apr 06 07:36:14 2004 +0000
146.3 @@ -0,0 +1,57 @@
146.4 +// vi: set ts=4 sw=4 :
146.5 +// vim: set tw=75 :
146.6 +
146.7 +#ifdef UNFINISHED
146.8 +
146.9 +// mqueue.cpp - functions for queue (classes MBaseQueue, MBaseQItem)
146.10 +
146.11 +/*
146.12 + * Copyright (c) 2001-2003 Will Day <[email protected]>
146.13 + *
146.14 + * This file is part of Metamod.
146.15 + *
146.16 + * Metamod is free software; you can redistribute it and/or modify it
146.17 + * under the terms of the GNU General Public License as published by the
146.18 + * Free Software Foundation; either version 2 of the License, or (at
146.19 + * your option) any later version.
146.20 + *
146.21 + * Metamod is distributed in the hope that it will be useful, but
146.22 + * WITHOUT ANY WARRANTY; without even the implied warranty of
146.23 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
146.24 + * General Public License for more details.
146.25 + *
146.26 + * You should have received a copy of the GNU General Public License
146.27 + * along with Metamod; if not, write to the Free Software Foundation,
146.28 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
146.29 + *
146.30 + * In addition, as a special exception, the author gives permission to
146.31 + * link the code of this program with the Half-Life Game Engine ("HL
146.32 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
146.33 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
146.34 + * respects for all of the code used other than the HL Engine and MODs
146.35 + * from Valve. If you modify this file, you may extend this exception
146.36 + * to your version of the file, but you are not obligated to do so. If
146.37 + * you do not wish to do so, delete this exception statement from your
146.38 + * version.
146.39 + *
146.40 + */
146.41 +
146.42 +#include <extdll.h> // always
146.43 +
146.44 +#include "mqueue.h" // me
146.45 +
146.46 +
146.47 +void MFuncQueue::remove(plid_t plid) {
146.48 + QItem *fp;
146.49 +
146.50 + MXlock();
146.51 + for(fp=front; fp && fp->data->hook; fp=fp->next) {
146.52 + if(fp->data->hook->plid==plid) {
146.53 + delete fp->data->hook;
146.54 + fp->data->hook = NULL;
146.55 + }
146.56 + }
146.57 + MXunlock();
146.58 +}
146.59 +
146.60 +#endif /* UNFINISHED */
147.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
147.2 +++ b/metamod/mqueue.h Tue Apr 06 07:36:14 2004 +0000
147.3 @@ -0,0 +1,68 @@
147.4 +// vi: set ts=4 sw=4 :
147.5 +// vim: set tw=75 :
147.6 +
147.7 +#ifdef UNFINISHED
147.8 +
147.9 +// mqueue.h - class and types for queues
147.10 +
147.11 +/*
147.12 + * Copyright (c) 2001-2003 Will Day <[email protected]>
147.13 + *
147.14 + * This file is part of Metamod.
147.15 + *
147.16 + * Metamod is free software; you can redistribute it and/or modify it
147.17 + * under the terms of the GNU General Public License as published by the
147.18 + * Free Software Foundation; either version 2 of the License, or (at
147.19 + * your option) any later version.
147.20 + *
147.21 + * Metamod is distributed in the hope that it will be useful, but
147.22 + * WITHOUT ANY WARRANTY; without even the implied warranty of
147.23 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
147.24 + * General Public License for more details.
147.25 + *
147.26 + * You should have received a copy of the GNU General Public License
147.27 + * along with Metamod; if not, write to the Free Software Foundation,
147.28 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
147.29 + *
147.30 + * In addition, as a special exception, the author gives permission to
147.31 + * link the code of this program with the Half-Life Game Engine ("HL
147.32 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
147.33 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
147.34 + * respects for all of the code used other than the HL Engine and MODs
147.35 + * from Valve. If you modify this file, you may extend this exception
147.36 + * to your version of the file, but you are not obligated to do so. If
147.37 + * you do not wish to do so, delete this exception statement from your
147.38 + * version.
147.39 + *
147.40 + */
147.41 +
147.42 +#ifndef MQUEUE_H
147.43 +#define MQUEUE_H
147.44 +
147.45 +#include "plinfo.h" // plid_t, etc
147.46 +#include "tqueue.h" // templates Queue<>, QItem<>, etc
147.47 +#include "mhook.h" // event_args_t, etc
147.48 +#include "types_meta.h" // mBOOL
147.49 +#include "osdep.h" // MUTEX_T, etc
147.50 +
147.51 +// Our queue types.
147.52 +typedef Queue<const char> MLogmsgQueue;
147.53 +
147.54 +typedef struct {
147.55 + MHook *hook;
147.56 + event_args_t *evargs;
147.57 + const char *logline;
147.58 +} func_item_t;
147.59 +
147.60 +class MFuncQueue : public Queue<func_item_t> {
147.61 + public:
147.62 + // renamed constructors:
147.63 + MFuncQueue(void) :Queue<func_item_t>() { };
147.64 + MFuncQueue(int qmaxsize) :Queue<func_item_t>(qmaxsize) { };
147.65 + // added functions:
147.66 + void remove(plid_t plid);
147.67 +};
147.68 +
147.69 +#endif /* MQUEUE_H */
147.70 +
147.71 +#endif /* UNFINISHED */
148.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
148.2 +++ b/metamod/mreg.cpp Tue Apr 06 07:36:14 2004 +0000
148.3 @@ -0,0 +1,511 @@
148.4 +// vi: set ts=4 sw=4 :
148.5 +// vim: set tw=75 :
148.6 +
148.7 +// mreg.cpp - functions for registered items (classes MRegCmd, MRegCmdList)
148.8 +
148.9 +/*
148.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
148.11 + *
148.12 + * This file is part of Metamod.
148.13 + *
148.14 + * Metamod is free software; you can redistribute it and/or modify it
148.15 + * under the terms of the GNU General Public License as published by the
148.16 + * Free Software Foundation; either version 2 of the License, or (at
148.17 + * your option) any later version.
148.18 + *
148.19 + * Metamod is distributed in the hope that it will be useful, but
148.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
148.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
148.22 + * General Public License for more details.
148.23 + *
148.24 + * You should have received a copy of the GNU General Public License
148.25 + * along with Metamod; if not, write to the Free Software Foundation,
148.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
148.27 + *
148.28 + * In addition, as a special exception, the author gives permission to
148.29 + * link the code of this program with the Half-Life Game Engine ("HL
148.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
148.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
148.32 + * respects for all of the code used other than the HL Engine and MODs
148.33 + * from Valve. If you modify this file, you may extend this exception
148.34 + * to your version of the file, but you are not obligated to do so. If
148.35 + * you do not wish to do so, delete this exception statement from your
148.36 + * version.
148.37 + *
148.38 + */
148.39 +
148.40 +#ifdef linux
148.41 +// enable extra routines in system header files, like strsignal
148.42 +#define _GNU_SOURCE
148.43 +#endif /* linux */
148.44 +
148.45 +#include <string.h> // strsignal, strdup, etc
148.46 +#include <errno.h> // strerror, etc
148.47 +
148.48 +#include <extdll.h> // always
148.49 +
148.50 +#include "mreg.h" // me
148.51 +#include "metamod.h" // Plugins, etc
148.52 +#include "mlist.h" // class MPluginList
148.53 +#include "mplugin.h" // class MPlugin
148.54 +#include "types_meta.h" // mBOOL
148.55 +#include "log_meta.h" // META_LOG, etc
148.56 +#include "osdep.h" // os_safe_call, etc
148.57 +
148.58 +
148.59 +///// class MRegCmd:
148.60 +
148.61 +// Init values. It would probably be more "proper" to use containers and
148.62 +// constructors, rather than arrays and init-functions.
148.63 +void MRegCmd::init(int idx)
148.64 +{
148.65 + index = idx;
148.66 + name = NULL;
148.67 + pfnCmd = NULL;
148.68 + plugid = 0;
148.69 + status = RG_INVALID;
148.70 +}
148.71 +
148.72 +// Try to call the function. Relies on OS-specific routine to attempt
148.73 +// calling the function without generating a segfault from an unloaded
148.74 +// plugin DLL.
148.75 +// meta_errno values:
148.76 +// - ME_BADREQ function disabled/invalid
148.77 +// - ME_ARGUMENT function pointer is null
148.78 +mBOOL MRegCmd::call(void) {
148.79 + mBOOL ret;
148.80 +
148.81 + // can we expect to call this function?
148.82 + if(status != RG_VALID)
148.83 + RETURN_ERRNO(mFALSE, ME_BADREQ);
148.84 + if(!pfnCmd)
148.85 + RETURN_ERRNO(mFALSE, ME_ARGUMENT);
148.86 +
148.87 + // try to call this function
148.88 + ret=os_safe_call(pfnCmd);
148.89 + if(!ret) {
148.90 + META_DEBUG(4, ("Plugin reg_cmd '%s' called after unloaded; removed from list", name));
148.91 + status=RG_INVALID;
148.92 + pfnCmd=NULL;
148.93 + // NOTE: we can't free the malloc'd space for the name, as that
148.94 + // would just re-introduce the segfault problem..
148.95 + }
148.96 + // meta_errno (if failed) is set already in os_safe_call()
148.97 + return(ret);
148.98 +}
148.99 +
148.100 +
148.101 +///// class MRegCmdList:
148.102 +
148.103 +// Constructor
148.104 +MRegCmdList::MRegCmdList(void)
148.105 + : mlist(0), size(REG_CMD_GROWSIZE), endlist(0)
148.106 +{
148.107 + int i;
148.108 + mlist = (MRegCmd *) malloc(size * sizeof(MRegCmd));
148.109 + // initialize array
148.110 + for(i=0; i< size; i++)
148.111 + mlist[i].init(i+1); // 1-based index
148.112 + endlist=0;
148.113 +}
148.114 +
148.115 +// Try to find a registered function with the given name.
148.116 +// meta_errno values:
148.117 +// - ME_NOTFOUND couldn't find a matching function
148.118 +MRegCmd *MRegCmdList::find(const char *findname) {
148.119 + int i;
148.120 + for(i=0; i < endlist; i++) {
148.121 + if(!strcasecmp(mlist[i].name, findname))
148.122 + return(&mlist[i]);
148.123 + }
148.124 + RETURN_ERRNO(NULL, ME_NOTFOUND);
148.125 +}
148.126 +
148.127 +// Add the given name to the list and return the instance. This only
148.128 +// writes the "name" to the new cmd; other fields are writtin by caller
148.129 +// (meta_AddServerCommand).
148.130 +// meta_errno values:
148.131 +// - ME_NOMEM couldn't realloc or malloc for various parts
148.132 +MRegCmd *MRegCmdList::add(const char *addname) {
148.133 + MRegCmd *icmd;
148.134 +
148.135 + if(endlist==size) {
148.136 + // grow array
148.137 + MRegCmd *temp;
148.138 + int i, newsize;
148.139 + newsize=size+REG_CMD_GROWSIZE;
148.140 + META_DEBUG(6, ("Growing reg cmd list from %d to %d", size, newsize));
148.141 + temp = (MRegCmd *) realloc(mlist, newsize*sizeof(MRegCmd));
148.142 + if(!temp) {
148.143 + META_ERROR("Couldn't grow registered command list to %d for '%s': %s", newsize, addname, strerror(errno));
148.144 + RETURN_ERRNO(NULL, ME_NOMEM);
148.145 + }
148.146 + mlist=temp;
148.147 + size=newsize;
148.148 + // initialize new (unused) entries
148.149 + for(i=endlist; i<size; i++)
148.150 + mlist[i].init(i+1); // 1-based
148.151 + }
148.152 + icmd = &mlist[endlist];
148.153 +
148.154 + // Malloc space separately for the command name, because:
148.155 + // - Can't point to memory loc in plugin (another segv waiting to
148.156 + // happen).
148.157 + // - Can't point to memory in mlist which might get moved later by
148.158 + // realloc (again, segv).
148.159 + icmd->name=strdup(addname);
148.160 + if(!icmd->name) {
148.161 + META_ERROR("Couldn't strdup for adding reg cmd name '%s': %s",
148.162 + addname, strerror(errno));
148.163 + RETURN_ERRNO(NULL, ME_NOMEM);
148.164 + }
148.165 + endlist++;
148.166 +
148.167 + return(icmd);
148.168 +}
148.169 +
148.170 +// Disable any functions belonging to the given plugin (by index id).
148.171 +void MRegCmdList::disable(int plugin_id) {
148.172 + int i;
148.173 + for(i=0; i< size; i++) {
148.174 + if(mlist[i].plugid == plugin_id)
148.175 + mlist[i].status = RG_INVALID;
148.176 + }
148.177 +}
148.178 +
148.179 +// List all the registered commands.
148.180 +void MRegCmdList::show(void) {
148.181 + int i, n=0, a=0;
148.182 + MRegCmd *icmd;
148.183 + MPlugin *iplug;
148.184 + char bplug[18+1]; // +1 for term null
148.185 +
148.186 + META_CONS("Registered plugin commands:");
148.187 + META_CONS(" %*s %-*s %-s",
148.188 + WIDTH_MAX_REG, "",
148.189 + sizeof(bplug)-1, "plugin", "command");
148.190 + for(i=0; i < endlist; i++) {
148.191 + icmd = &mlist[i];
148.192 + if(icmd->status==RG_VALID) {
148.193 + iplug=Plugins->find(icmd->plugid);
148.194 + if(iplug)
148.195 + STRNCPY(bplug, iplug->desc, sizeof(bplug));
148.196 + else
148.197 + STRNCPY(bplug, "(unknown)", sizeof(bplug));
148.198 + }
148.199 + else
148.200 + STRNCPY(bplug, "(unloaded)", sizeof(bplug));
148.201 + META_CONS(" [%*d] %-*s %-s",
148.202 + WIDTH_MAX_REG, icmd->index,
148.203 + sizeof(bplug)-1, bplug,
148.204 + icmd->name);
148.205 + if(icmd->status==RG_VALID) a++;
148.206 + n++;
148.207 + }
148.208 + META_CONS("%d commands, %d available (%d allocated)", n, a, size);
148.209 +}
148.210 +
148.211 +// List all the registered commands for the given plugin id.
148.212 +void MRegCmdList::show(int plugin_id) {
148.213 + int i, n=0;
148.214 + MRegCmd *icmd;
148.215 +
148.216 + // If OS doesn't support DLFNAME, then we can't know what the plugin's
148.217 + // registered cvars are.
148.218 + DLFNAME(NULL);
148.219 + if(meta_errno==ME_OSNOTSUP) {
148.220 + META_CONS("Registered commands: unknown (can't get info under this OS)");
148.221 + return;
148.222 + }
148.223 + META_CONS("Registered commands:");
148.224 + for(i=0; i < endlist; i++) {
148.225 + icmd = &mlist[i];
148.226 + if(icmd->plugid != plugin_id)
148.227 + continue;
148.228 + META_CONS(" %s", icmd->name);
148.229 + n++;
148.230 + }
148.231 + META_CONS("%d commands", n);
148.232 +}
148.233 +
148.234 +
148.235 +///// class MRegCvar:
148.236 +
148.237 +// Init values. It would probably be more "proper" to use containers and
148.238 +// constructors, rather than arrays and init-functions.
148.239 +void MRegCvar::init(int idx)
148.240 +{
148.241 + index = idx;
148.242 + data = NULL;
148.243 + plugid = 0;
148.244 + status = RG_INVALID;
148.245 +}
148.246 +
148.247 +// Set the cvar, copying values from given cvar.
148.248 +// meta_errno values:
148.249 +// - ME_ARGUMENT given cvar doesn't match this cvar
148.250 +mBOOL MRegCvar::set(cvar_t *src) {
148.251 + if(strcasecmp(src->name, data->name)) {
148.252 + META_ERROR("Tried to set cvar with mismatched name; src=%s dst=%s",
148.253 + src->name, data->name);
148.254 + RETURN_ERRNO(mFALSE, ME_ARGUMENT);
148.255 + }
148.256 + // Would like to free() existing string, but can't tell where it was
148.257 + // allocated...
148.258 + data->string = strdup(src->string);
148.259 + data->flags = src->flags;
148.260 + data->value = src->value;
148.261 + data->next = src->next;
148.262 + return(mTRUE);
148.263 +}
148.264 +
148.265 +
148.266 +///// class MRegCvarList:
148.267 +
148.268 +// Constructor
148.269 +MRegCvarList::MRegCvarList(void)
148.270 + : vlist(0), size(REG_CVAR_GROWSIZE), endlist(0)
148.271 +{
148.272 + int i;
148.273 + vlist = (MRegCvar *) malloc(size * sizeof(MRegCvar));
148.274 + // initialize array
148.275 + for(i=0; i< size; i++)
148.276 + vlist[i].init(i+1); // 1-based
148.277 + endlist=0;
148.278 +}
148.279 +
148.280 +// Add the given cvar name to the list and return the instance. This only
148.281 +// writes the "name" to the new cvar; other fields are written with
148.282 +// cvar::set().
148.283 +// meta_errno values:
148.284 +// - ME_NOMEM couldn't alloc or realloc for various parts
148.285 +MRegCvar *MRegCvarList::add(const char *addname) {
148.286 + MRegCvar *icvar;
148.287 +
148.288 + if(endlist==size) {
148.289 + // grow array
148.290 + MRegCvar *temp;
148.291 + int i, newsize;
148.292 + newsize=size+REG_CVAR_GROWSIZE;
148.293 + META_DEBUG(6, ("Growing reg cvar list from %d to %d", size, newsize));
148.294 + temp = (MRegCvar *) realloc(vlist, newsize*sizeof(MRegCvar));
148.295 + if(!temp) {
148.296 + META_ERROR("Couldn't grow registered cvar list to %d for '%s'; %s", newsize, addname, strerror(errno));
148.297 + RETURN_ERRNO(NULL, ME_NOMEM);
148.298 + }
148.299 + vlist=temp;
148.300 + size=newsize;
148.301 + // initialize new (unused) entries
148.302 + for(i=endlist; i<size; i++)
148.303 + vlist[i].init(i+1); // 1-based
148.304 + }
148.305 +
148.306 + icvar = &vlist[endlist];
148.307 +
148.308 + // Malloc space for the cvar and cvar name, for two reasons:
148.309 + // - Can't point to memory loc in plugin (another segv waiting to
148.310 + // happen).
148.311 + // - Can't point to memory in vlist which might get moved later by
148.312 + // realloc (again, segv).
148.313 + icvar->data = (cvar_t *) malloc(sizeof(cvar_t));
148.314 + if(!icvar->data) {
148.315 + META_ERROR("Couldn't malloc cvar for adding reg cvar name '%s': %s",
148.316 + addname, strerror(errno));
148.317 + RETURN_ERRNO(NULL, ME_NOMEM);
148.318 + }
148.319 + icvar->data->name=strdup(addname);
148.320 + if(!icvar->data->name) {
148.321 + META_ERROR("Couldn't strdup for adding reg cvar name '%s': %s",
148.322 + addname, strerror(errno));
148.323 + RETURN_ERRNO(NULL, ME_NOMEM);
148.324 + }
148.325 + endlist++;
148.326 +
148.327 + return(icvar);
148.328 +}
148.329 +
148.330 +// Try to find a registered cvar with the given name.
148.331 +// meta_errno values:
148.332 +// - ME_NOTFOUND couldn't find a matching cvar
148.333 +MRegCvar *MRegCvarList::find(const char *findname) {
148.334 + int i;
148.335 + for(i=0; i < endlist; i++) {
148.336 + if(!strcasecmp(vlist[i].data->name, findname))
148.337 + return(&vlist[i]);
148.338 + }
148.339 + RETURN_ERRNO(NULL, ME_NOTFOUND);
148.340 +}
148.341 +
148.342 +// Disable any cvars belonging to the given plugin (by index id).
148.343 +void MRegCvarList::disable(int plugin_id) {
148.344 + int i;
148.345 + MRegCvar *icvar;
148.346 + for(i=0; i< size; i++) {
148.347 + icvar=&vlist[i];
148.348 + if(icvar->plugid == plugin_id) {
148.349 + icvar->status = RG_INVALID;
148.350 + icvar->plugid = 0;
148.351 + // Decided not to do this, in order to keep pre-existing values
148.352 + // after a plugin reload.
148.353 + // CVAR_SET_STRING(icvar->data->name, "[metamod: cvar invalid; plugin unloaded]");
148.354 + }
148.355 + }
148.356 +}
148.357 +
148.358 +// List all the registered cvars.
148.359 +void MRegCvarList::show(void) {
148.360 + int i, n=0, a=0;
148.361 + MRegCvar *icvar;
148.362 + MPlugin *iplug;
148.363 + char bplug[13+1], bname[20+1], bval[15+1]; // +1 for term null
148.364 +
148.365 + META_CONS("Registered plugin cvars:");
148.366 + META_CONS(" %*s %-*s %-*s %*s %s",
148.367 + WIDTH_MAX_REG, "",
148.368 + sizeof(bplug)-1, "plugin",
148.369 + sizeof(bname)-1, "cvar",
148.370 + sizeof(bval)-1, "float value",
148.371 + "string value");
148.372 + for(i=0; i < endlist; i++) {
148.373 + icvar = &vlist[i];
148.374 + if(icvar->status==RG_VALID) {
148.375 + iplug=Plugins->find(icvar->plugid);
148.376 + if(iplug)
148.377 + STRNCPY(bplug, iplug->desc, sizeof(bplug));
148.378 + else
148.379 + STRNCPY(bplug, "(unknown)", sizeof(bplug));
148.380 + }
148.381 + else
148.382 + STRNCPY(bplug, "(unloaded)", sizeof(bplug));
148.383 + STRNCPY(bname, icvar->data->name, sizeof(bname));
148.384 + snprintf(bval, sizeof(bval), "%f", icvar->data->value);
148.385 + META_CONS(" [%*d] %-*s %-*s %*s %s",
148.386 + WIDTH_MAX_REG, icvar->index,
148.387 + sizeof(bplug)-1, bplug,
148.388 + sizeof(bname)-1, bname,
148.389 + sizeof(bval)-1, bval,
148.390 + icvar->data->string);
148.391 + if(icvar->status==RG_VALID) a++;
148.392 + n++;
148.393 + }
148.394 + META_CONS("%d cvars, %d available (%d allocated)", n, a, size);
148.395 +}
148.396 +
148.397 +// List the registered cvars for the given plugin id.
148.398 +void MRegCvarList::show(int plugin_id) {
148.399 + int i, n=0;
148.400 + MRegCvar *icvar;
148.401 + char bname[30+1], bval[15+1]; // +1 for term null
148.402 +
148.403 + // If OS doesn't support DLFNAME, then we can't know what the plugin's
148.404 + // registered cvars are.
148.405 + DLFNAME(NULL);
148.406 + if(meta_errno==ME_OSNOTSUP) {
148.407 + META_CONS("Registered cvars: unknown (can't get info under this OS)");
148.408 + return;
148.409 + }
148.410 + META_CONS("%-*s %*s %s",
148.411 + sizeof(bname)-1, "Registered cvars:",
148.412 + sizeof(bval)-1, "float value",
148.413 + "string value");
148.414 + for(i=0; i < endlist; i++) {
148.415 + icvar = &vlist[i];
148.416 + if(icvar->plugid != plugin_id)
148.417 + continue;
148.418 + STRNCPY(bname, icvar->data->name, sizeof(bname));
148.419 + snprintf(bval, sizeof(bval), "%f", icvar->data->value);
148.420 + META_CONS(" %-*s %*s %s",
148.421 + sizeof(bname)-1, bname,
148.422 + sizeof(bval)-1, bval,
148.423 + icvar->data->string);
148.424 + n++;
148.425 + }
148.426 + META_CONS("%d cvars", n);
148.427 +}
148.428 +
148.429 +
148.430 +///// class MRegMsgList:
148.431 +
148.432 +// Constructor
148.433 +MRegMsgList::MRegMsgList(void)
148.434 + : size(MAX_REG_MSGS), endlist(0)
148.435 +{
148.436 + int i;
148.437 + // initialize array
148.438 + memset(mlist, 0, sizeof(mlist));
148.439 + for(i=0; i< size; i++) {
148.440 + mlist[i].index=i+1; // 1-based
148.441 + }
148.442 + endlist=0;
148.443 +}
148.444 +
148.445 +// Add the given user msg the list and return the instance.
148.446 +// meta_errno values:
148.447 +// - ME_MAXREACHED reached max number of msgs allowed
148.448 +MRegMsg *MRegMsgList::add(const char *addname, int addmsgid, int addsize) {
148.449 + MRegMsg *imsg;
148.450 +
148.451 + if(endlist==size) {
148.452 + // all slots used
148.453 + META_ERROR("Couldn't add registered msg '%s' to list; reached max msgs (%d)",
148.454 + addname, size);
148.455 + RETURN_ERRNO(NULL, ME_MAXREACHED);
148.456 + }
148.457 +
148.458 + imsg = &mlist[endlist];
148.459 + endlist++;
148.460 +
148.461 + // Copy msg data into empty slot.
148.462 + // Note: 'addname' assumed to be a constant string allocated in the
148.463 + // gamedll.
148.464 + imsg->name=addname;
148.465 + imsg->msgid=addmsgid;
148.466 + imsg->size=addsize;
148.467 +
148.468 + return(imsg);
148.469 +}
148.470 +
148.471 +// Try to find a registered msg with the given name.
148.472 +// meta_errno values:
148.473 +// - ME_NOTFOUND couldn't find a matching cvar
148.474 +MRegMsg *MRegMsgList::find(const char *findname) {
148.475 + int i;
148.476 + for(i=0; i < endlist; i++) {
148.477 + if(!strcmp(mlist[i].name, findname))
148.478 + return(&mlist[i]);
148.479 + }
148.480 + RETURN_ERRNO(NULL, ME_NOTFOUND);
148.481 +}
148.482 +
148.483 +// Try to find a registered msg with the given msgid.
148.484 +// meta_errno values:
148.485 +// - ME_NOTFOUND couldn't find a matching cvar
148.486 +MRegMsg *MRegMsgList::find(int findmsgid) {
148.487 + int i;
148.488 + for(i=0; i < endlist; i++) {
148.489 + if(mlist[i].msgid == findmsgid)
148.490 + return(&mlist[i]);
148.491 + }
148.492 + RETURN_ERRNO(NULL, ME_NOTFOUND);
148.493 +}
148.494 +
148.495 +// List the registered usermsgs for the gamedll.
148.496 +void MRegMsgList::show(void) {
148.497 + int i, n=0;
148.498 + MRegMsg *imsg;
148.499 + char bname[25+1]; // +1 for term null
148.500 +
148.501 + META_CONS("%-*s %5s %5s",
148.502 + sizeof(bname)-1, "Game registered user msgs:", "msgid", "size");
148.503 + for(i=0; i < endlist; i++) {
148.504 + imsg = &mlist[i];
148.505 + STRNCPY(bname, imsg->name, sizeof(bname));
148.506 + META_CONS(" %-*s %3d %3d",
148.507 + sizeof(bname)-1, bname,
148.508 + imsg->msgid,
148.509 + imsg->size);
148.510 + n++;
148.511 + }
148.512 + META_CONS("%d game user msgs", n);
148.513 +}
148.514 +
149.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
149.2 +++ b/metamod/mreg.h Tue Apr 06 07:36:14 2004 +0000
149.3 @@ -0,0 +1,186 @@
149.4 +// vi: set ts=4 sw=4 :
149.5 +// vim: set tw=75 :
149.6 +
149.7 +// mreg.h - description of registered items (classes MRegCmd, MRegCmdList)
149.8 +
149.9 +/*
149.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
149.11 + *
149.12 + * This file is part of Metamod.
149.13 + *
149.14 + * Metamod is free software; you can redistribute it and/or modify it
149.15 + * under the terms of the GNU General Public License as published by the
149.16 + * Free Software Foundation; either version 2 of the License, or (at
149.17 + * your option) any later version.
149.18 + *
149.19 + * Metamod is distributed in the hope that it will be useful, but
149.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
149.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
149.22 + * General Public License for more details.
149.23 + *
149.24 + * You should have received a copy of the GNU General Public License
149.25 + * along with Metamod; if not, write to the Free Software Foundation,
149.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
149.27 + *
149.28 + * In addition, as a special exception, the author gives permission to
149.29 + * link the code of this program with the Half-Life Game Engine ("HL
149.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
149.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
149.32 + * respects for all of the code used other than the HL Engine and MODs
149.33 + * from Valve. If you modify this file, you may extend this exception
149.34 + * to your version of the file, but you are not obligated to do so. If
149.35 + * you do not wish to do so, delete this exception statement from your
149.36 + * version.
149.37 + *
149.38 + */
149.39 +
149.40 +#ifndef MREG_H
149.41 +#define MREG_H
149.42 +
149.43 +#include "types_meta.h" // mBOOL
149.44 +
149.45 +// Number of entries to add to reglists when they need to grow. Typically
149.46 +// more cvars than commands, so we grow them at different increments.
149.47 +#define REG_CMD_GROWSIZE 32
149.48 +#define REG_CVAR_GROWSIZE 64
149.49 +
149.50 +// Width required to printf a Reg*List index number, for show() functions.
149.51 +// This used to correspond to the number of digits in MAX_REG, which was a
149.52 +// fixed, compile-time limit. However, now that the reg lists are grown
149.53 +// dynamically, this has less strong correspondance to list sizes. So for
149.54 +// the moment, it reflects what one might normally expect to be the max
149.55 +// width needed to print an index number; 4 allows 9999 (which is a damn
149.56 +// lot, if you ask me).
149.57 +#define WIDTH_MAX_REG 4
149.58 +
149.59 +// Max number of registered user msgs we can manage.
149.60 +#define MAX_REG_MSGS 256
149.61 +
149.62 +// Flags to indicate if given cvar or func is part of a loaded plugin.
149.63 +typedef enum {
149.64 + RG_INVALID,
149.65 + RG_VALID,
149.66 +} REG_STATUS;
149.67 +
149.68 +// Pointer to function registered by AddServerCommand.
149.69 +typedef void (*REG_CMD_FN) (void);
149.70 +
149.71 +
149.72 +// An individual registered function/command.
149.73 +class MRegCmd {
149.74 + friend class MRegCmdList;
149.75 + private:
149.76 + // data:
149.77 + int index; // 1-based
149.78 + public:
149.79 + char *name; // space is malloc'd
149.80 + REG_CMD_FN pfnCmd; // pointer to the function
149.81 + int plugid; // index id of corresponding plugin
149.82 + REG_STATUS status; // whether corresponding plugin is loaded
149.83 + // functions:
149.84 + void init(int idx); // init values, as not using constructors
149.85 + mBOOL call(void); // try to call the function
149.86 +};
149.87 +
149.88 +
149.89 +// A list of registered commands.
149.90 +class MRegCmdList {
149.91 + private:
149.92 + // data:
149.93 + MRegCmd *mlist; // malloc'd array of registered commands
149.94 + int size; // current size of list
149.95 + int endlist; // index of last used entry
149.96 + // Private; to satisfy -Weffc++ "has pointer data members but does
149.97 + // not override" copy/assignment constructor.
149.98 + void operator=(const MRegCmdList &src);
149.99 + MRegCmdList(const MRegCmdList &src);
149.100 +
149.101 + public:
149.102 + // constructor:
149.103 + MRegCmdList(void);
149.104 +
149.105 + // functions:
149.106 + MRegCmd *find(const char *findname); // find by MRegCmd->name
149.107 + MRegCmd *add(const char *addname);
149.108 + void disable(int plugin_id); // change status to Invalid
149.109 + void show(void); // list all funcs to console
149.110 + void show(int plugin_id); // list given plugin's funcs to console
149.111 +};
149.112 +
149.113 +
149.114 +
149.115 +// An individual registered cvar.
149.116 +class MRegCvar {
149.117 + friend class MRegCvarList;
149.118 + private:
149.119 + // data:
149.120 + int index; // 1-based
149.121 + public:
149.122 + cvar_t *data; // actual cvar structure, malloc'd
149.123 + int plugid; // index id of corresponding plugin
149.124 + REG_STATUS status; // whether corresponding plugin is loaded
149.125 + // functions:
149.126 + void init(int idx); // init values, as not using constructors
149.127 + mBOOL set(cvar_t *src);
149.128 +};
149.129 +
149.130 +
149.131 +// A list of registered cvars.
149.132 +class MRegCvarList {
149.133 + private:
149.134 + // data:
149.135 + MRegCvar *vlist; // malloc'd array of registered cvars
149.136 + int size; // size of list, ie MAX_REG_CVARS
149.137 + int endlist; // index of last used entry
149.138 + // Private; to satisfy -Weffc++ "has pointer data members but does
149.139 + // not override" copy/assignment constructor.
149.140 + void operator=(const MRegCvarList &src);
149.141 + MRegCvarList(const MRegCvarList &src);
149.142 +
149.143 + public:
149.144 + // constructor:
149.145 + MRegCvarList(void);
149.146 +
149.147 + // functions:
149.148 + MRegCvar *add(const char *addname);
149.149 + MRegCvar *find(const char *findname); // find by MRegCvar->data.name
149.150 + void disable(int plugin_id); // change status to Invalid
149.151 + void show(void); // list all cvars to console
149.152 + void show(int plugin_id); // list given plugin's cvars to console
149.153 +};
149.154 +
149.155 +
149.156 +
149.157 +// An individual registered user msg, from gamedll.
149.158 +class MRegMsg {
149.159 + friend class MRegMsgList;
149.160 + private:
149.161 + // data:
149.162 + int index; // 1-based
149.163 + public:
149.164 + const char *name; // name, assumed constant string in gamedll
149.165 + int msgid; // msgid, assigned by engine
149.166 + int size; // size, if given by gamedll
149.167 +};
149.168 +
149.169 +
149.170 +// A list of registered user msgs.
149.171 +class MRegMsgList {
149.172 + private:
149.173 + // data:
149.174 + MRegMsg mlist[MAX_REG_MSGS]; // array of registered msgs
149.175 + int size; // size of list, ie MAX_REG_MSGS
149.176 + int endlist; // index of last used entry
149.177 +
149.178 + public:
149.179 + // constructor:
149.180 + MRegMsgList(void);
149.181 +
149.182 + // functions:
149.183 + MRegMsg *add(const char *addname, int addmsgid, int addsize);
149.184 + MRegMsg *find(const char *findname);
149.185 + MRegMsg *find(int findmsgid);
149.186 + void show(void); // list all msgs to console
149.187 +};
149.188 +
149.189 +#endif /* MREG_H */
150.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
150.2 +++ b/metamod/msgs/debug Tue Apr 06 07:36:14 2004 +0000
150.3 @@ -0,0 +1,78 @@
150.4 +log_meta.h // META_DEBUG(3, ("return code: %d", ret));
150.5 +mlist.cpp META_DEBUG(1, ("Keeping plugin '%s'", iplug->desc));
150.6 +mlist.cpp META_DEBUG(1, ("Loading plugin '%s'", iplug->desc));
150.7 +mlist.cpp META_DEBUG(1, ("Reloading plugin '%s'", iplug->desc));
150.8 +mlist.cpp META_DEBUG(1, ("Retrying attach plugin '%s'", iplug->desc));
150.9 +mlist.cpp META_DEBUG(1, ("Retrying unload plugin '%s'", iplug->desc));
150.10 +mlist.cpp META_DEBUG(1, ("Unloading plugin '%s'", iplug->desc));
150.11 +reg_support.cpp META_DEBUG(1, ("Failed to find memloc for regcvar '%s'",
150.12 +conf_meta.cpp META_DEBUG(2, ("Loading from config file: %s", loadfile));
150.13 +metamod.cpp META_DEBUG(2, ("No config.ini file found: %s", CONFIG_INI));
150.14 +mlist.cpp META_DEBUG(2, ("ini: Plugin '%s' has newer file on disk", pl_found->desc));
150.15 +mplugin.cpp META_DEBUG(2, ("Couldn't resolve '%s' to file", filename));
150.16 +mplugin.cpp META_DEBUG(2, ("Resolved '%s' to file '%s'", filename, found));
150.17 +mplugin.cpp META_DEBUG(2, ("dll: Delaying load plugin '%s'; can't attach now: allowed=%s; now=%s",
150.18 +mplugin.cpp META_DEBUG(2, ("dll: Delaying unload plugin '%s'; can't detach now: allowed=%s; now=%s", desc, str_unloadable(), str_loadtime(now, SL_SIMPLE)));
150.19 +mplugin.cpp META_DEBUG(2, ("dll: Failed load plugin '%s'; can't attach now: allowed=%s; now=%s",
150.20 +mplugin.cpp META_DEBUG(2, ("dll: Failed unload plugin '%s'; can't detach now: allowed=%s; now=%s", desc, str_unloadable(), str_loadtime(now, SL_SIMPLE)));
150.21 +mplugin.cpp META_DEBUG(2, ("dll: Forced unload plugin '%s' overriding allowed times: allowed=%s; now=%s", desc, str_unloadable(), str_loadtime(now, SL_SIMPLE)));
150.22 +mplugin.cpp META_DEBUG(2, ("dll: Forced unload plugin '%s' overriding failed detach"));
150.23 +commands_meta.cpp META_DEBUG(3, ("Required plugin '%s' found loaded and running.",
150.24 +conf_meta.cpp META_DEBUG(3, ("set config bool: %s = %s", setp->name,
150.25 +conf_meta.cpp META_DEBUG(3, ("set config command: %s, %s",
150.26 +conf_meta.cpp META_DEBUG(3, ("set config cvar: %s = %s", optcvar->name, setstr));
150.27 +conf_meta.cpp META_DEBUG(3, ("set config int: %s = %d", setp->name, *optval));
150.28 +conf_meta.cpp META_DEBUG(3, ("set config path: %s = %s", setp->name, *optstr));
150.29 +conf_meta.cpp META_DEBUG(3, ("set config string: %s = %s", setp->name, *optstr));
150.30 +dllapi.cpp META_DEBUG(3, ("called: GetEntityAPI2; version=%d", *interfaceVersion));
150.31 +dllapi.cpp META_DEBUG(3, ("called: GetEntityAPI; version=%d", interfaceVersion));
150.32 +engine_api.cpp META_DEBUG(3, ("user message registered again: name=%s, msgid=%d", pszName, imsgid));
150.33 +metamod.cpp META_DEBUG(3, ("Game: %s", GameDLL.name));
150.34 +metamod.cpp META_DEBUG(3, ("dll: Game '%s': Called GiveFnptrsToDll",
150.35 +metamod.cpp META_DEBUG(3, ("dll: Game '%s': Found %s", gamedll.name, STR_GetFuncs)); \
150.36 +mplugin.cpp META_DEBUG(3, ("dll: Note: Plugin '%s' interface version didn't match; expected %s, found %s", desc, META_INTERFACE_VERSION, info->ifvers));
150.37 +mplugin.cpp META_DEBUG(3, ("dll: Plugin '%s': Found %s", desc, STR_GetFuncs)); \
150.38 +mreg.cpp META_DEBUG(4, ("Plugin reg_cmd '%s' called after unloaded; removed from list", name));
150.39 +reg_support.cpp META_DEBUG(4, ("called: meta_AddServerCommand; cmd_name=%s, function=%d", cmd_name, function));
150.40 +reg_support.cpp META_DEBUG(4, ("called: meta_CVarRegister; name=%s", pCvar->name));
150.41 +support_meta.cpp META_DEBUG(4, ("Unable to get realpath for '%s': %s", buf,
150.42 +metamod.cpp META_DEBUG(5, ("dll: Game '%s': No %s", gamedll.name, STR_GetFuncs)); \
150.43 +mplugin.cpp META_DEBUG(5, ("dll: Plugin '%s': No %s", desc, STR_GetFuncs)); \
150.44 +mplugin.cpp META_DEBUG(5, ("dll: no Meta_Init present in plugin '%s'", desc));
150.45 +mplugin.cpp META_DEBUG(5, ("newer_file? file=%s; load=%d, file=%d; ctime=%d, mtime=%d",
150.46 +reg_support.cpp META_DEBUG(5, ("called: meta_command_handler; arg0=%s args='%s'", CMD_ARGV(0), CMD_ARGS()));
150.47 +support_meta.cpp META_DEBUG(5, ("Empty file: %s", buf));
150.48 +support_meta.cpp META_DEBUG(5, ("Not a regular file: %s", buf));
150.49 +support_meta.cpp META_DEBUG(5, ("Unable to stat '%s': %s", buf, strerror(errno)));
150.50 +dllapi.cpp META_DEBUG(6, ("called: GetNewDLLFunctions; version=%d", *interfaceVersion));
150.51 +mplugin.cpp META_DEBUG(6, ("dll: Plugin '%s': Called GiveFnptrsToDll()", desc));
150.52 +mplugin.cpp META_DEBUG(6, ("dll: Plugin '%s': Called Meta_Attach() successfully", desc));
150.53 +mplugin.cpp META_DEBUG(6, ("dll: Plugin '%s': Called Meta_Detach() successfully", desc));
150.54 +mplugin.cpp META_DEBUG(6, ("dll: Plugin '%s': Called Meta_Init()", desc));
150.55 +mplugin.cpp META_DEBUG(6, ("dll: Plugin '%s': Called Meta_Query() successfully",
150.56 +mplugin.cpp META_DEBUG(6, ("dll: Plugin '%s': Query successful", desc));
150.57 +mreg.cpp META_DEBUG(6, ("Growing reg cmd list from %d to %d", size, newsize));
150.58 +mreg.cpp META_DEBUG(6, ("Growing reg cvar list from %d to %d", size, newsize));
150.59 +studioapi.cpp META_DEBUG(6, ("Calling Server_GetBlendingInterface"));
150.60 +studioapi.cpp META_DEBUG(6, ("Couldn't find Server_GetBlendingInterface in game DLL '%s': %s", GameDLL.name, DLERROR()));
150.61 +studioapi.cpp META_DEBUG(6, ("Looking up Server_GetBlendingInterface"));
150.62 +studioapi.cpp META_DEBUG(6, ("Skipping Server_GetBlendingInterface; was previously found missing"));
150.63 +studioapi.cpp META_DEBUG(6, ("called: Server_GetBlendingInterface; version=%d", version));
150.64 +mplugin.cpp META_DEBUG(7, ("ini: Ignoring commented line: %s", line));
150.65 +mplugin.cpp META_DEBUG(7, ("ini: Ignoring entry for %s", token));
150.66 +mutil.cpp META_DEBUG(7, ("Calling game entity '%s' for plugin '%s'", entStr,
150.67 +linkent.cpp META_DEBUG(8, ("Linking game entity '%s'", entStr));
150.68 +linkent.h META_DEBUG(8, ("Linking plugin entity '%s'", entStr)); \
150.69 +mlist.cpp META_DEBUG(8, ("DLFNAME failed to find memloc %d", memptr));
150.70 +mlist.cpp META_DEBUG(8, ("Found loaded plugin %s", plist[i].file));
150.71 +mlist.cpp META_DEBUG(8, ("Looking for loaded plugin with dlfnamepath: %s", findpath));
150.72 +mlist.cpp META_DEBUG(8, ("No loaded plugin found with path: %s", findpath));
150.73 +mutil.cpp META_DEBUG(8, ("Looking up game entity '%s' for plugin '%s'", entStr,
150.74 +mutil.cpp META_DEBUG(8, ("Looking up usermsg id '%d' for plugin '%s'", msgid,
150.75 +mutil.cpp META_DEBUG(8, ("Looking up usermsg name '%s' for plugin '%s'", msgname,
150.76 +osdep.h META_DEBUG(8, ("normalize: %s", path));
150.77 +osdep.h META_DEBUG(8, ("normalized: %s", path));
150.78 +linkent.cpp META_DEBUG(9, ("Looking up game entity '%s'", entStr));
150.79 +linkent.cpp META_DEBUG(9, ("Skipping entity '%s'; was previously found missing", entStr));
150.80 +linkent.h META_DEBUG(9, ("Looking up plugin entity '%s'", entStr)); \
150.81 +mlist.cpp META_DEBUG(9, ("Looking at: plugin %s loadedpath: %s", plist[i].file, plist[i].pathname));
151.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
151.2 +++ b/metamod/msgs/error Tue Apr 06 07:36:14 2004 +0000
151.3 @@ -0,0 +1,138 @@
151.4 +commands_meta.cpp META_ERROR("Required plugin '%s' did not load successfully! (status=%s) Exiting.", arg, findp->str_status(ST_SIMPLE));
151.5 +commands_meta.cpp META_ERROR("Required plugin '%s' was not found! Exiting.",
151.6 +commands_meta.cpp META_ERROR("Unexpected plug_cmd: %d", pcmd);
151.7 +commands_meta.cpp META_ERROR("Unique match for required plugin '%s' was not found! Exiting.", arg);
151.8 +conf_meta.cpp META_ERROR("'%s' line %d: bad config format: missing option",
151.9 +conf_meta.cpp META_ERROR("'%s' line %d: bad config format: missing value",
151.10 +conf_meta.cpp META_ERROR("'%s' line %d: unable to set option '%s' value '%s'",
151.11 +conf_meta.cpp META_ERROR("'%s' line %d: unknown option name '%s'",
151.12 +conf_meta.cpp META_ERROR("option '%s' invalid format '%s'", setp->name,
151.13 +conf_meta.cpp META_ERROR("option '%s' invalid format '%s'", setp->name,
151.14 +conf_meta.cpp META_ERROR("unable to open config file '%s': %s", loadfile,
151.15 +conf_meta.cpp META_ERROR("unrecognized config type '%d'", setp->type);
151.16 +dllapi.cpp META_ERROR("GetEntityAPI called with null pFunctionTable");
151.17 +dllapi.cpp META_ERROR("GetEntityAPI version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION);
151.18 +dllapi.cpp META_ERROR("GetEntityAPI2 called with null pFunctionTable");
151.19 +dllapi.cpp META_ERROR("GetEntityAPI2 version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION);
151.20 +dllapi.cpp META_ERROR("GetNewDLLFunctions called with null pNewFunctionTable");
151.21 +dllapi.cpp META_ERROR("GetNewDLLFunctions version mismatch; requested=%d ours=%d", *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION);
151.22 +engine_api.cpp META_ERROR("malloc failed for logmsg to thread queue");
151.23 +engine_api.cpp META_ERROR("user message id reused: msgid=%d, oldname=%s, newname=%s", imsgid, nmsg->name, pszName);
151.24 +game_support.cpp META_ERROR("File '%s' is no longer supported; instead, specify override gamedll in %s or with '+localinfo mm_gamedll <dllfile>'", OLD_GAMEDLL_TXT, CONFIG_INI);
151.25 +linkent.cpp META_ERROR("Couldn't find game entity '%s' in game DLL '%s': %s", entStr, GameDLL.name, DLERROR());
151.26 +linkent.h META_ERROR("Can't link entity '%s' for plugin '%s'; loadable != startup: %s", entStr, pluginName, findp->str_loadable()); \
151.27 +linkent.h META_ERROR("Couldn't find loaded plugin '%s' for plugin entity '%s'", pluginName, entStr); \
151.28 +linkent.h META_ERROR("Couldn't find plugin entity '%s' in plugin DLL '%s'", entStr, findp->file); \
151.29 +log_meta.cpp void META_ERROR(char *fmt, ...) {
151.30 +log_meta.h void META_ERROR(char *fmt, ...);
151.31 +metamod.cpp META_ERROR("Cannot exec absolute pathnames: %s", mmfile);
151.32 +metamod.cpp META_ERROR("Empty/missing config.ini file: %s; falling back to %s",
151.33 +metamod.cpp META_ERROR("Failure to init game DLL; exiting...");
151.34 +metamod.cpp META_ERROR("Failure to load game DLL; exiting...");
151.35 +metamod.cpp META_ERROR("Failure to load plugins...");
151.36 +metamod.cpp META_ERROR("Plugins file is empty/missing: %s; falling back to %s",
151.37 +metamod.cpp META_ERROR("dll: Couldn't find GiveFnptrsToDll() in game DLL '%s': %s",
151.38 +metamod.cpp META_ERROR("dll: Couldn't find either GetEntityAPI nor GetEntityAPI2 in game DLL '%s'", GameDLL.name);
151.39 +metamod.cpp META_ERROR("dll: Couldn't get cwd; %s", strerror(errno));
151.40 +metamod.cpp META_ERROR("dll: Couldn't load game DLL %s: %s", GameDLL.pathname,
151.41 +metamod.cpp META_ERROR("dll: Failure calling %s in game '%s'", STR_GetFuncs, gamedll.name); \
151.42 +metamod.cpp META_ERROR("dll: Interface version didn't match; we wanted %d, they had %d", vers_want, vers_int); \
151.43 +metamod.cpp META_ERROR("dll: Unrecognized game: %s", GameDLL.name);
151.44 +metamod.cpp META_ERROR("malloc failed for gamedll struct_field: %s", STR_GetFuncs); \
151.45 +metamod.h META_ERROR("Couldn't find api call: %s:%s", GameDLL.file, pfn_string); \
151.46 +metamod.h META_ERROR("Couldn't find api call: %s:%s", GameDLL.file, pfn_string); \
151.47 +metamod.h META_ERROR("Couldn't find api call: engine:%s", pfn_string); \
151.48 +metamod.h META_ERROR("Couldn't find api call: engine:%s", pfn_string); \
151.49 +metamod.h META_ERROR("MRES_SUPERCEDE not valid in Post functions: %s:%s%s()", iplug->file, pfn_string, (post?"_Post":"")); \
151.50 +metamod.h META_ERROR("MRES_SUPERCEDE not valid in Post functions: %s:%s%s()", iplug->file, pfn_string, (post?"_Post":"")); \
151.51 +metamod.h META_ERROR("Plugin didn't set meta_result: %s:%s%s()", iplug->file, pfn_string, (post?"_Post":"")); \
151.52 +metamod.h META_ERROR("Plugin didn't set meta_result: %s:%s%s()", iplug->file, pfn_string, (post?"_Post":"")); \
151.53 +mhook.cpp META_ERROR("Couldn't add game event hook for plugin '%s'; malloc failed: %s", plinfo->name, strerror(errno));
151.54 +mhook.cpp META_ERROR("Couldn't add game event hook for plugin '%s'; malloc failed: %s", plinfo->name, strerror(errno));
151.55 +mhook.cpp META_ERROR("Couldn't add game event hook for plugin '%s'; reached max hooks (%d)", plinfo->name, size);
151.56 +mhook.cpp META_ERROR("Couldn't add log hook '%s' for plugin '%s'; reached max hooks (%d)", match, plinfo->name, size);
151.57 +mhook.cpp META_ERROR("Couldn't find plugin index '%d' for hook", pl_index);
151.58 +mhook.cpp META_ERROR("Invalid hook type (%d) encountered", ihook->type);
151.59 +mhook.cpp META_ERROR("Unrecognized hook type (%d) from plugin '%s'",
151.60 +mhook.cpp META_ERROR("malloc failed for func_item_t");
151.61 +mlist.cpp META_ERROR("Couldn't add plugin '%s' to list; reached max plugins (%d)",
151.62 +mlist.cpp META_ERROR("Problem loading plugins.ini: %s", inifile);
151.63 +mlist.cpp META_ERROR("dll: Failed to load plugin '%s'", plist[i].file);
151.64 +mlist.cpp META_ERROR("dll: Problem reloading plugins.ini: %s", inifile);
151.65 +mlist.cpp META_ERROR("dll: Unexpected action for plugin '%s': '%s'", iplug->desc, iplug->str_action());
151.66 +mlist.cpp META_ERROR("dll: Unrecognized action for plugin '%s': '%s'", iplug->desc, iplug->str_action());
151.67 +mlist.cpp META_ERROR("ini: Metamod plugins file empty or missing: %s", inifile);
151.68 +mlist.cpp META_ERROR("ini: Plugin '%s' has newer file, but unexpected status (%s)",
151.69 +mlist.cpp META_ERROR("ini: Skipping duplicate plugin, line %d of %s: %s",
151.70 +mlist.cpp META_ERROR("ini: Skipping malformed line %d of %s",
151.71 +mlist.cpp META_ERROR("ini: Skipping malformed line %d of %s", ln,
151.72 +mlist.cpp META_ERROR("ini: Skipping plugin, couldn't stat file '%s': %s",
151.73 +mlist.cpp META_ERROR("ini: Unable to open plugins file '%s': %s", inifile,
151.74 +mlist.cpp META_ERROR("ini: Unable to open plugins file '%s': %s", inifile,
151.75 +mlist.cpp META_ERROR("ini: Warning; no plugins found to load?");
151.76 +mlist.cpp META_ERROR("ini: Warning; no plugins found to load?");
151.77 +mplugin.cpp // META_ERROR("dll: Couldn't find GiveFnptrsToDll() in plugin '%s': %s", desc, DLERROR());
151.78 +mplugin.cpp META_ERROR("Cannot clear plugin '%s'; not marked as failed, empty, or open (status=%s)", desc, str_status());
151.79 +mplugin.cpp META_ERROR("Cannot pause plugin '%s'; not allowed by plugin (allowed=%s)", desc, str_unloadable());
151.80 +mplugin.cpp META_ERROR("Cannot pause plugin '%s'; not currently running (status=%s)", desc, str_status());
151.81 +mplugin.cpp META_ERROR("Cannot unpause plugin '%s'; not currently paused (status=%s)", desc, str_status());
151.82 +mplugin.cpp META_ERROR("No pending action to retry for plugin '%s'; (status=%s, action=%s)", desc, str_status(), str_action());
151.83 +mplugin.cpp META_ERROR("Not pausing plugin '%s'; already paused", desc);
151.84 +mplugin.cpp META_ERROR("dll: Couldn't close plugin file '%s': %s",
151.85 +mplugin.cpp META_ERROR("dll: Couldn't close plugin file '%s': %s", file, DLERROR());
151.86 +mplugin.cpp META_ERROR("dll: Couldn't close plugin file '%s': %s", file, DLERROR());
151.87 +mplugin.cpp META_ERROR("dll: Error detach plugin '%s': Couldn't find Meta_detach(): %s", desc, DLERROR());
151.88 +mplugin.cpp META_ERROR("dll: Failed attach plugin '%s': Couldn't find Meta_Attach(): %s", desc, DLERROR());
151.89 +mplugin.cpp META_ERROR("dll: Failed attach plugin '%s': Error from Meta_Attach(): %d", desc, ret);
151.90 +mplugin.cpp META_ERROR("dll: Failed attach plugin '%s': Failed malloc() for dllapi_table");
151.91 +mplugin.cpp META_ERROR("dll: Failed attach plugin '%s': Failed malloc() for newapi_table");
151.92 +mplugin.cpp META_ERROR("dll: Failed detach plugin '%s': Error from Meta_Detach(): %d", desc, ret);
151.93 +mplugin.cpp META_ERROR("dll: Failed query plugin '%s'; Couldn't find GiveFnptrsToDll(): %s", desc, DLERROR());
151.94 +mplugin.cpp META_ERROR("dll: Failed query plugin '%s'; Couldn't find Meta_Query(): %s", desc, DLERROR());
151.95 +mplugin.cpp META_ERROR("dll: Failed query plugin '%s'; Couldn't open file '%s': %s",
151.96 +mplugin.cpp META_ERROR("dll: Failed query plugin '%s'; Empty info structure", desc);
151.97 +mplugin.cpp META_ERROR("dll: Failed query plugin '%s'; Meta_Query returned error",
151.98 +mplugin.cpp META_ERROR("dll: Failed to attach plugin '%s'", desc);
151.99 +mplugin.cpp META_ERROR("dll: Failed to detach plugin '%s'; ", desc);
151.100 +mplugin.cpp META_ERROR("dll: Failed to reload plugin '%s' after unloading", desc);
151.101 +mplugin.cpp META_ERROR("dll: Failed to unload plugin '%s' for reloading", desc);
151.102 +mplugin.cpp META_ERROR("dll: Failure calling %s in plugin '%s'", STR_GetFuncs, desc); \
151.103 +mplugin.cpp META_ERROR("dll: Interface version didn't match; expected %d, found %d", vers_want, vers_int); \
151.104 +mplugin.cpp META_ERROR("dll: Not loading plugin '%s'; already loaded (status=%s)",
151.105 +mplugin.cpp META_ERROR("dll: Not loading plugin '%s'; not marked for load (action=%s)", desc, str_action());
151.106 +mplugin.cpp META_ERROR("dll: Not unloading plugin '%s'; already unloaded (status=%s)", desc, str_status());
151.107 +mplugin.cpp META_ERROR("dll: Not unloading plugin '%s'; not marked for unload (action=%s)", desc, str_action());
151.108 +mplugin.cpp META_ERROR("dll: Plugin '%s' is out of date and incompatible with this version of Metamod; please find a newer version of the plugin (plugin needs at least interface %s not the current %s)", desc, META_INTERFACE_VERSION, info->ifvers);
151.109 +mplugin.cpp META_ERROR("dll: Plugin '%s' requires a newer version of Metamod (Metamod needs at least interface %s not the current %s)", desc, info->ifvers, META_INTERFACE_VERSION);
151.110 +mplugin.cpp META_ERROR("dll: Rejected plugin '%s' due to interface version incompatibility (mm=%s, pl=%s)", desc, META_INTERFACE_VERSION, info->ifvers);
151.111 +mplugin.cpp META_ERROR("dll: Skipping plugin '%s'; couldn't query", desc);
151.112 +mplugin.cpp META_ERROR("dll: Tried to operate on plugin[%d] with a non-valid status (%d)", index, str_status());
151.113 +mplugin.cpp META_ERROR("dll: Tried to operate on plugin[%d] with an empty file",
151.114 +mplugin.cpp META_ERROR("dll: Tried to operate on plugin[%d] with an empty filename",
151.115 +mplugin.cpp META_ERROR("dll: Tried to operate on plugin[%d] with an empty pathname",
151.116 +mreg.cpp META_ERROR("Couldn't add registered msg '%s' to list; reached max msgs (%d)",
151.117 +mreg.cpp META_ERROR("Couldn't grow registered command list to %d for '%s': %s", newsize, addname, strerror(errno));
151.118 +mreg.cpp META_ERROR("Couldn't grow registered cvar list to %d for '%s'; %s", newsize, addname, strerror(errno));
151.119 +mreg.cpp META_ERROR("Couldn't malloc cvar for adding reg cvar name '%s': %s",
151.120 +mreg.cpp META_ERROR("Couldn't strdup for adding reg cmd name '%s': %s",
151.121 +mreg.cpp META_ERROR("Couldn't strdup for adding reg cvar name '%s': %s",
151.122 +mreg.cpp META_ERROR("Tried to set cvar with mismatched name; src=%s dst=%s",
151.123 +mutil.cpp META_ERROR("Couldn't find game entity '%s' in game DLL '%s' for plugin '%s'", entStr, GameDLL.name, plinfo->name);
151.124 +mutil.cpp META_ERROR("GetGameInfo: invalid request '%d' from plugin '%s'",
151.125 +mutil.cpp META_ERROR("GetPluginPath: couldn't find plugin '%s'",
151.126 +osdep.h META_ERROR("Failure detaching thread: %s", strerror(ret));
151.127 +osdep.h META_ERROR("Failure starting thread: %s", str_GetLastError());
151.128 +osdep.h META_ERROR("Failure starting thread: %s", strerror(ret));
151.129 +osdep.h META_ERROR("cond_init failed: %s", str_GetLastError());
151.130 +osdep.h META_ERROR("cond_init failed: %s", strerror(ret));
151.131 +osdep.h META_ERROR("cond_signal failed: %s", str_GetLastError());
151.132 +osdep.h META_ERROR("cond_signal failed: %s", strerror(ret));
151.133 +osdep.h META_ERROR("cond_wait failed: %s", str_GetLastError());
151.134 +osdep.h META_ERROR("cond_wait failed: %s", strerror(ret));
151.135 +osdep.h META_ERROR("mutex_init failed: %s", strerror(ret));
151.136 +osdep.h META_ERROR("mutex_lock failed: %s", strerror(ret));
151.137 +osdep.h META_ERROR("mutex_unlock failed: %s", strerror(ret));
151.138 +reg_support.cpp META_ERROR("Couldn't find registered plugin command: %s", cmd);
151.139 +reg_support.cpp META_ERROR("Failed to find memloc for regcmd '%s'", cmd_name);
151.140 +reg_support.cpp META_ERROR("Null command name in meta_command_handler() ??");
151.141 +thread_logparse.cpp META_ERROR("Couldn't start thread for log parsing! Exiting...");
152.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
152.2 +++ b/metamod/msgs/log Tue Apr 06 07:36:14 2004 +0000
152.3 @@ -0,0 +1,36 @@
152.4 +commands_meta.cpp META_LOG("ClientCommand 'meta %s' from player '%s'",
152.5 +commands_meta.cpp META_LOG("Refresh failed.");
152.6 +commands_meta.cpp META_LOG("Refreshing the plugins on demand...");
152.7 +game_support.cpp META_LOG("Overriding game '%s' with dllfile '%s'", gamedll->name,
152.8 +game_support.cpp META_LOG("Recognized game '%s'; using dllfile '%s'", gamedll->name,
152.9 +log_meta.cpp void META_LOG(char *fmt, ...) {
152.10 +log_meta.h void META_LOG(char *fmt, ...);
152.11 +metamod.cpp META_LOG(" %s", VURL);
152.12 +metamod.cpp META_LOG("%s v%s %s", VNAME, VVERSION, VDATE);
152.13 +metamod.cpp META_LOG("Configfile specified via localinfo: %s", cp);
152.14 +metamod.cpp META_LOG("Debuglevel specified via localinfo: %s", cp);
152.15 +metamod.cpp META_LOG("Exec'ing metamod exec.cfg: %s...", mmfile);
152.16 +metamod.cpp META_LOG("Execcfg specified via localinfo: %s", cp);
152.17 +metamod.cpp META_LOG("Game DLL for '%s' loaded successfully", GameDLL.desc);
152.18 +metamod.cpp META_LOG("Gamedll specified via localinfo: %s", cp);
152.19 +metamod.cpp META_LOG("Pluginsfile specified via localinfo: %s", cp);
152.20 +metamod.cpp META_LOG("by %s", VAUTHOR);
152.21 +metamod.cpp META_LOG("compiled: %s Eastern (%s)", COMPILE_TIME, OPT_TYPE);
152.22 +mhook.cpp META_LOG("Not currently handling REGEX hooks...");
152.23 +mlist.cpp META_LOG("dll: Finished loading %d plugins", n);
152.24 +mlist.cpp META_LOG("dll: Finished updating %d plugins; kept %d, loaded %d, unloaded %d, reloaded %d, delayed %d",
152.25 +mlist.cpp META_LOG("dll: Loading plugins...");
152.26 +mlist.cpp META_LOG("dll: Updating plugins...");
152.27 +mlist.cpp META_LOG("ini: Begin re-reading plugins list: %s", inifile);
152.28 +mlist.cpp META_LOG("ini: Begin reading plugins list: %s", inifile);
152.29 +mlist.cpp META_LOG("ini: Finished reading plugins list: %s; Found %d plugins to load",
152.30 +mlist.cpp META_LOG("ini: Finished reading plugins list: %s; Found %d plugins", inifile, n);
152.31 +mlist.cpp META_LOG("ini: Read plugin config for: %s", plist[n].desc);
152.32 +mlist.cpp META_LOG("ini: Read plugin config for: %s", plist[n].desc);
152.33 +mplugin.cpp META_LOG("Paused plugin '%s'", desc);
152.34 +mplugin.cpp META_LOG("Unpaused plugin '%s'", desc);
152.35 +mplugin.cpp META_LOG("dll: Loaded plugin '%s': %s v%s %s, %s", desc, info->name,
152.36 +mplugin.cpp META_LOG("dll: Note: plugin '%s' is using an older interface version (%s), not the latest interface version (%s); there might be an updated version of the plugin", desc, info->ifvers, META_INTERFACE_VERSION);
152.37 +mplugin.cpp META_LOG("dll: Plugin '%s' isn't catching _any_ functions ??", desc);
152.38 +mplugin.cpp META_LOG("dll: Plugin '%s': unexpected version comparision; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d",
152.39 +mplugin.cpp META_LOG("dll: Unloaded plugin '%s' for reason '%s'", desc, str_reason(reason));
153.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
153.2 +++ b/metamod/msvc/metamod.def Tue Apr 06 07:36:14 2004 +0000
153.3 @@ -0,0 +1,5 @@
153.4 +LIBRARY metamod
153.5 +EXPORTS
153.6 + GiveFnptrsToDll @1
153.7 +SECTIONS
153.8 + .data READ WRITE
154.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
154.2 +++ b/metamod/msvc/metamod.dsp Tue Apr 06 07:36:14 2004 +0000
154.3 @@ -0,0 +1,328 @@
154.4 +# Microsoft Developer Studio Project File - Name="metamod" - Package Owner=<4>
154.5 +# Microsoft Developer Studio Generated Build File, Format Version 6.00
154.6 +# ** DO NOT EDIT **
154.7 +
154.8 +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
154.9 +
154.10 +CFG=metamod - Win32 Debug
154.11 +!MESSAGE This is not a valid makefile. To build this project using NMAKE,
154.12 +!MESSAGE use the Export Makefile command and run
154.13 +!MESSAGE
154.14 +!MESSAGE NMAKE /f "metamod.mak".
154.15 +!MESSAGE
154.16 +!MESSAGE You can specify a configuration when running NMAKE
154.17 +!MESSAGE by defining the macro CFG on the command line. For example:
154.18 +!MESSAGE
154.19 +!MESSAGE NMAKE /f "metamod.mak" CFG="metamod - Win32 Debug"
154.20 +!MESSAGE
154.21 +!MESSAGE Possible choices for configuration are:
154.22 +!MESSAGE
154.23 +!MESSAGE "metamod - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
154.24 +!MESSAGE "metamod - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
154.25 +!MESSAGE
154.26 +
154.27 +# Begin Project
154.28 +# PROP AllowPerConfigDependencies 0
154.29 +# PROP Scc_ProjName ""
154.30 +# PROP Scc_LocalPath ""
154.31 +CPP=cl.exe
154.32 +MTL=midl.exe
154.33 +RSC=rc.exe
154.34 +
154.35 +!IF "$(CFG)" == "metamod - Win32 Release"
154.36 +
154.37 +# PROP BASE Use_MFC 0
154.38 +# PROP BASE Use_Debug_Libraries 0
154.39 +# PROP BASE Output_Dir "Release"
154.40 +# PROP BASE Intermediate_Dir "Release"
154.41 +# PROP BASE Target_Dir ""
154.42 +# PROP Use_MFC 0
154.43 +# PROP Use_Debug_Libraries 0
154.44 +# PROP Output_Dir "release"
154.45 +# PROP Intermediate_Dir "release"
154.46 +# PROP Ignore_Export_Lib 0
154.47 +# PROP Target_Dir ""
154.48 +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "METAMOD_EXPORTS" /YX /FD /c
154.49 +# ADD CPP /nologo /MT /W3 /GX /O2 /I ".." /I "\hl\hlsdk\multiplayer source\common" /I "\hl\hlsdk\multiplayer source\engine" /I "\hl\hlsdk\multiplayer source\dlls" /I "\hl\hlsdk\multiplayer source\pm_shared" /I "\hl\hlsdk\multiplayer source\common" /I "\hl\hlsdk\multiplayer source\engine" /I "\hl\hlsdk\multiplayer source\dlls" /I "\hl\hlsdk\multiplayer source\pm_shared" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "METAMOD_EXPORTS" /YX /FD /c
154.50 +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
154.51 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
154.52 +# ADD BASE RSC /l 0x409 /d "NDEBUG"
154.53 +# ADD RSC /l 0x409 /d "NDEBUG"
154.54 +BSC32=bscmake.exe
154.55 +# ADD BASE BSC32 /nologo
154.56 +# ADD BSC32 /nologo
154.57 +LINK32=link.exe
154.58 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
154.59 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /def:".\metamod.def"
154.60 +# SUBTRACT LINK32 /verbose
154.61 +
154.62 +!ELSEIF "$(CFG)" == "metamod - Win32 Debug"
154.63 +
154.64 +# PROP BASE Use_MFC 0
154.65 +# PROP BASE Use_Debug_Libraries 1
154.66 +# PROP BASE Output_Dir "Debug"
154.67 +# PROP BASE Intermediate_Dir "Debug"
154.68 +# PROP BASE Target_Dir ""
154.69 +# PROP Use_MFC 0
154.70 +# PROP Use_Debug_Libraries 1
154.71 +# PROP Output_Dir "debug"
154.72 +# PROP Intermediate_Dir "debug"
154.73 +# PROP Ignore_Export_Lib 0
154.74 +# PROP Target_Dir ""
154.75 +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "METAMOD_EXPORTS" /YX /FD /c
154.76 +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I ".." /I "\hl\hlsdk\multiplayer source\common" /I "\hl\hlsdk\multiplayer source\engine" /I "\hl\hlsdk\multiplayer source\dlls" /I "\hl\hlsdk\multiplayer source\pm_shared" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "METAMOD_EXPORTS" /YX /FD /c
154.77 +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
154.78 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
154.79 +# ADD BASE RSC /l 0x409 /d "_DEBUG"
154.80 +# ADD RSC /l 0x409 /d "_DEBUG"
154.81 +BSC32=bscmake.exe
154.82 +# ADD BASE BSC32 /nologo
154.83 +# ADD BSC32 /nologo
154.84 +LINK32=link.exe
154.85 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
154.86 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /def:".\metamod.def" /pdbtype:sept
154.87 +
154.88 +!ENDIF
154.89 +
154.90 +# Begin Target
154.91 +
154.92 +# Name "metamod - Win32 Release"
154.93 +# Name "metamod - Win32 Debug"
154.94 +# Begin Group "Source Files"
154.95 +
154.96 +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
154.97 +# Begin Source File
154.98 +
154.99 +SOURCE=..\api_info.cpp
154.100 +# End Source File
154.101 +# Begin Source File
154.102 +
154.103 +SOURCE=..\commands_meta.cpp
154.104 +# End Source File
154.105 +# Begin Source File
154.106 +
154.107 +SOURCE=..\conf_meta.cpp
154.108 +# End Source File
154.109 +# Begin Source File
154.110 +
154.111 +SOURCE=..\dllapi.cpp
154.112 +# End Source File
154.113 +# Begin Source File
154.114 +
154.115 +SOURCE=..\engine_api.cpp
154.116 +# End Source File
154.117 +# Begin Source File
154.118 +
154.119 +SOURCE=..\game_support.cpp
154.120 +# End Source File
154.121 +# Begin Source File
154.122 +
154.123 +SOURCE=..\h_export.cpp
154.124 +# End Source File
154.125 +# Begin Source File
154.126 +
154.127 +SOURCE=..\linkent.cpp
154.128 +# End Source File
154.129 +# Begin Source File
154.130 +
154.131 +SOURCE=..\linkgame.cpp
154.132 +# End Source File
154.133 +# Begin Source File
154.134 +
154.135 +SOURCE=..\linkplug.cpp
154.136 +# End Source File
154.137 +# Begin Source File
154.138 +
154.139 +SOURCE=..\log_meta.cpp
154.140 +# End Source File
154.141 +# Begin Source File
154.142 +
154.143 +SOURCE=..\metamod.cpp
154.144 +# End Source File
154.145 +# Begin Source File
154.146 +
154.147 +SOURCE=..\mhook.cpp
154.148 +# End Source File
154.149 +# Begin Source File
154.150 +
154.151 +SOURCE=..\mlist.cpp
154.152 +# End Source File
154.153 +# Begin Source File
154.154 +
154.155 +SOURCE=..\mplugin.cpp
154.156 +# End Source File
154.157 +# Begin Source File
154.158 +
154.159 +SOURCE=..\mqueue.cpp
154.160 +# End Source File
154.161 +# Begin Source File
154.162 +
154.163 +SOURCE=..\mreg.cpp
154.164 +# End Source File
154.165 +# Begin Source File
154.166 +
154.167 +SOURCE=..\mutil.cpp
154.168 +# End Source File
154.169 +# Begin Source File
154.170 +
154.171 +SOURCE=..\osdep.cpp
154.172 +# End Source File
154.173 +# Begin Source File
154.174 +
154.175 +SOURCE=..\reg_support.cpp
154.176 +# End Source File
154.177 +# Begin Source File
154.178 +
154.179 +SOURCE=..\sdk_util.cpp
154.180 +# End Source File
154.181 +# Begin Source File
154.182 +
154.183 +SOURCE=..\studioapi.cpp
154.184 +# End Source File
154.185 +# Begin Source File
154.186 +
154.187 +SOURCE=..\support_meta.cpp
154.188 +# End Source File
154.189 +# Begin Source File
154.190 +
154.191 +SOURCE=..\thread_logparse.cpp
154.192 +# End Source File
154.193 +# Begin Source File
154.194 +
154.195 +SOURCE=..\vdate.cpp
154.196 +# End Source File
154.197 +# End Group
154.198 +# Begin Group "Header Files"
154.199 +
154.200 +# PROP Default_Filter "h;hpp;hxx;hm;inl"
154.201 +# Begin Source File
154.202 +
154.203 +SOURCE=..\api_info.h
154.204 +# End Source File
154.205 +# Begin Source File
154.206 +
154.207 +SOURCE=..\commands_meta.h
154.208 +# End Source File
154.209 +# Begin Source File
154.210 +
154.211 +SOURCE=..\conf_meta.h
154.212 +# End Source File
154.213 +# Begin Source File
154.214 +
154.215 +SOURCE=..\dllapi.h
154.216 +# End Source File
154.217 +# Begin Source File
154.218 +
154.219 +SOURCE=..\engine_api.h
154.220 +# End Source File
154.221 +# Begin Source File
154.222 +
154.223 +SOURCE=..\game_support.h
154.224 +# End Source File
154.225 +# Begin Source File
154.226 +
154.227 +SOURCE=..\games.h
154.228 +# End Source File
154.229 +# Begin Source File
154.230 +
154.231 +SOURCE=..\info_name.h
154.232 +# End Source File
154.233 +# Begin Source File
154.234 +
154.235 +SOURCE=..\h_export.h
154.236 +# End Source File
154.237 +# Begin Source File
154.238 +
154.239 +SOURCE=..\linkent.h
154.240 +# End Source File
154.241 +# Begin Source File
154.242 +
154.243 +SOURCE=..\log_meta.h
154.244 +# End Source File
154.245 +# Begin Source File
154.246 +
154.247 +SOURCE=..\meta_api.h
154.248 +# End Source File
154.249 +# Begin Source File
154.250 +
154.251 +SOURCE=..\metamod.h
154.252 +# End Source File
154.253 +# Begin Source File
154.254 +
154.255 +SOURCE=..\mhook.h
154.256 +# End Source File
154.257 +# Begin Source File
154.258 +
154.259 +SOURCE=..\mlist.h
154.260 +# End Source File
154.261 +# Begin Source File
154.262 +
154.263 +SOURCE=..\mplugin.h
154.264 +# End Source File
154.265 +# Begin Source File
154.266 +
154.267 +SOURCE=..\mqueue.h
154.268 +# End Source File
154.269 +# Begin Source File
154.270 +
154.271 +SOURCE=..\mreg.h
154.272 +# End Source File
154.273 +# Begin Source File
154.274 +
154.275 +SOURCE=..\mutil.h
154.276 +# End Source File
154.277 +# Begin Source File
154.278 +
154.279 +SOURCE=..\osdep.h
154.280 +# End Source File
154.281 +# Begin Source File
154.282 +
154.283 +SOURCE=..\plinfo.h
154.284 +# End Source File
154.285 +# Begin Source File
154.286 +
154.287 +SOURCE=..\reg_support.h
154.288 +# End Source File
154.289 +# Begin Source File
154.290 +
154.291 +SOURCE=..\sdk_util.h
154.292 +# End Source File
154.293 +# Begin Source File
154.294 +
154.295 +SOURCE=..\studioapi.h
154.296 +# End Source File
154.297 +# Begin Source File
154.298 +
154.299 +SOURCE=..\support_meta.h
154.300 +# End Source File
154.301 +# Begin Source File
154.302 +
154.303 +SOURCE=..\thread_logparse.h
154.304 +# End Source File
154.305 +# Begin Source File
154.306 +
154.307 +SOURCE=..\tqueue.h
154.308 +# End Source File
154.309 +# Begin Source File
154.310 +
154.311 +SOURCE=..\types_meta.h
154.312 +# End Source File
154.313 +# Begin Source File
154.314 +
154.315 +SOURCE=..\vdate.h
154.316 +# End Source File
154.317 +# Begin Source File
154.318 +
154.319 +SOURCE=..\vers_meta.h
154.320 +# End Source File
154.321 +# End Group
154.322 +# Begin Group "Resource Files"
154.323 +
154.324 +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
154.325 +# Begin Source File
154.326 +
154.327 +SOURCE=..\res_meta.rc
154.328 +# End Source File
154.329 +# End Group
154.330 +# End Target
154.331 +# End Project
155.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
155.2 +++ b/metamod/msvc/metamod.dsw Tue Apr 06 07:36:14 2004 +0000
155.3 @@ -0,0 +1,29 @@
155.4 +Microsoft Developer Studio Workspace File, Format Version 6.00
155.5 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
155.6 +
155.7 +###############################################################################
155.8 +
155.9 +Project: "metamod"=.\metamod.dsp - Package Owner=<4>
155.10 +
155.11 +Package=<5>
155.12 +{{{
155.13 +}}}
155.14 +
155.15 +Package=<4>
155.16 +{{{
155.17 +}}}
155.18 +
155.19 +###############################################################################
155.20 +
155.21 +Global:
155.22 +
155.23 +Package=<5>
155.24 +{{{
155.25 +}}}
155.26 +
155.27 +Package=<3>
155.28 +{{{
155.29 +}}}
155.30 +
155.31 +###############################################################################
155.32 +
156.1 Binary file metamod/msvc/metamod.opt has changed
157.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
157.2 +++ b/metamod/mutil.cpp Tue Apr 06 07:36:14 2004 +0000
157.3 @@ -0,0 +1,351 @@
157.4 +// vi: set ts=4 sw=4 :
157.5 +// vim: set tw=75 :
157.6 +
157.7 +// mutil.cpp - utility functions to provide to plugins
157.8 +
157.9 +/*
157.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
157.11 + *
157.12 + * This file is part of Metamod.
157.13 + *
157.14 + * Metamod is free software; you can redistribute it and/or modify it
157.15 + * under the terms of the GNU General Public License as published by the
157.16 + * Free Software Foundation; either version 2 of the License, or (at
157.17 + * your option) any later version.
157.18 + *
157.19 + * Metamod is distributed in the hope that it will be useful, but
157.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
157.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
157.22 + * General Public License for more details.
157.23 + *
157.24 + * You should have received a copy of the GNU General Public License
157.25 + * along with Metamod; if not, write to the Free Software Foundation,
157.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
157.27 + *
157.28 + * In addition, as a special exception, the author gives permission to
157.29 + * link the code of this program with the Half-Life Game Engine ("HL
157.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
157.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
157.32 + * respects for all of the code used other than the HL Engine and MODs
157.33 + * from Valve. If you modify this file, you may extend this exception
157.34 + * to your version of the file, but you are not obligated to do so. If
157.35 + * you do not wish to do so, delete this exception statement from your
157.36 + * version.
157.37 + *
157.38 + */
157.39 +
157.40 +#include <stdio.h> // vsnprintf(), etc
157.41 +#include <stdarg.h> // vs_start(), etc
157.42 +
157.43 +#include <extdll.h> // always
157.44 +
157.45 +#include "mutil.h" // me
157.46 +#include "mhook.h" // class MHookList, etc
157.47 +#include "linkent.h" // ENTITY_FN, etc
157.48 +#include "metamod.h" // Hooks, etc
157.49 +#include "meta_api.h" //
157.50 +#include "types_meta.h" // mBOOL
157.51 +#include "osdep.h" // win32 vsnprintf, etc
157.52 +#include "sdk_util.h" // ALERT, etc
157.53 +
157.54 +hudtextparms_t default_csay_tparms = {
157.55 + -1, 0.25, // x, y
157.56 + 2, // effect
157.57 + 0, 255, 0, 0, // r, g, b, a1
157.58 + 0, 0, 0, 0, // r2, g2, b2, a2
157.59 + 0, 0, 10, 10, // fadein, fadeout, hold, fxtime
157.60 + 1 // channel
157.61 +};
157.62 +
157.63 +// Log to console; newline added.
157.64 +void mutil_LogConsole(plid_t /* plid */, const char *fmt, ...) {
157.65 + va_list ap;
157.66 + char buf[MAX_LOGMSG_LEN];
157.67 + unsigned int len;
157.68 +
157.69 + va_start(ap, fmt);
157.70 + vsnprintf(buf, sizeof(buf), fmt, ap);
157.71 + va_end(ap);
157.72 + // end msg with newline
157.73 + len=strlen(buf);
157.74 + if(len < sizeof(buf)-2) // -1 null, -1 for newline
157.75 + strcat(buf, "\n");
157.76 + else
157.77 + buf[len-1] = '\n';
157.78 +
157.79 + SERVER_PRINT(buf);
157.80 +}
157.81 +
157.82 +// Log regular message to logs; newline added.
157.83 +void mutil_LogMessage(plid_t plid, const char *fmt, ...) {
157.84 + va_list ap;
157.85 + char buf[MAX_LOGMSG_LEN];
157.86 + plugin_info_t *plinfo;
157.87 +
157.88 + plinfo=(plugin_info_t *)plid;
157.89 + va_start(ap, fmt);
157.90 + vsnprintf(buf, sizeof(buf), fmt, ap);
157.91 + va_end(ap);
157.92 + ALERT(at_logged, "[%s] %s\n", plinfo->logtag, buf);
157.93 +}
157.94 +
157.95 +// Log an error message to logs; newline added.
157.96 +void mutil_LogError(plid_t plid, const char *fmt, ...) {
157.97 + va_list ap;
157.98 + char buf[MAX_LOGMSG_LEN];
157.99 + plugin_info_t *plinfo;
157.100 +
157.101 + plinfo=(plugin_info_t *)plid;
157.102 + va_start(ap, fmt);
157.103 + vsnprintf(buf, sizeof(buf), fmt, ap);
157.104 + va_end(ap);
157.105 + ALERT(at_logged, "[%s] ERROR: %s\n", plinfo->logtag, buf);
157.106 +}
157.107 +
157.108 +// Log a message only if cvar "developer" set; newline added.
157.109 +void mutil_LogDeveloper(plid_t plid, const char *fmt, ...) {
157.110 + va_list ap;
157.111 + char buf[MAX_LOGMSG_LEN];
157.112 + plugin_info_t *plinfo;
157.113 +
157.114 + if((int) CVAR_GET_FLOAT("developer") == 0)
157.115 + return;
157.116 +
157.117 + plinfo=(plugin_info_t *)plid;
157.118 + va_start(ap, fmt);
157.119 + vsnprintf(buf, sizeof(buf), fmt, ap);
157.120 + va_end(ap);
157.121 + ALERT(at_logged, "[%s] dev: %s\n", plinfo->logtag, buf);
157.122 +}
157.123 +
157.124 +// Print message on center of all player's screens. Uses default text
157.125 +// parameters (color green, 10 second fade-in).
157.126 +void mutil_CenterSay(plid_t plid, const char *fmt, ...) {
157.127 + va_list ap;
157.128 + va_start(ap, fmt);
157.129 + mutil_CenterSayVarargs(plid, default_csay_tparms, fmt, ap);
157.130 + va_end(ap);
157.131 +}
157.132 +
157.133 +// Print a center-message, with given text parameters.
157.134 +void mutil_CenterSayParms(plid_t plid, hudtextparms_t tparms, const char *fmt, ...) {
157.135 + va_list ap;
157.136 + va_start(ap, fmt);
157.137 + mutil_CenterSayVarargs(plid, tparms, fmt, ap);
157.138 + va_end(ap);
157.139 +}
157.140 +
157.141 +// Print a center-message, with text parameters and varargs. Provides
157.142 +// functionality to the above center_say interfaces.
157.143 +void mutil_CenterSayVarargs(plid_t plid, hudtextparms_t tparms,
157.144 + const char *fmt, va_list ap)
157.145 +{
157.146 + char buf[MAX_LOGMSG_LEN];
157.147 + int n;
157.148 + edict_t *pEntity;
157.149 + CBaseEntity *pPlayer;
157.150 +
157.151 + vsnprintf(buf, sizeof(buf), fmt, ap);
157.152 +
157.153 + mutil_LogMessage(plid, "(centersay) %s", buf);
157.154 + for(n=1; n <= gpGlobals->maxClients; n++) {
157.155 + pEntity=INDEXENT(n);
157.156 + if(FNullEnt(pEntity) || pEntity->free)
157.157 + continue;
157.158 + pPlayer=(CBaseEntity*)GET_PRIVATE(pEntity);
157.159 + UTIL_HudMessage(pPlayer, tparms, buf);
157.160 + }
157.161 +}
157.162 +
157.163 +// Allow plugins to call the entity functions in the GameDLL. In
157.164 +// particular, calling "player()" as needed by most Bots. Suggested by
157.165 +// Jussi Kivilinna.
157.166 +qboolean mutil_CallGameEntity(plid_t plid, const char *entStr, entvars_t *pev) {
157.167 + plugin_info_t *plinfo;
157.168 + ENTITY_FN pfnEntity;
157.169 +
157.170 + plinfo=(plugin_info_t *)plid;
157.171 + META_DEBUG(8, ("Looking up game entity '%s' for plugin '%s'", entStr,
157.172 + plinfo->name));
157.173 + pfnEntity = (ENTITY_FN) DLSYM(GameDLL.handle, entStr);
157.174 + if(!pfnEntity) {
157.175 + META_ERROR("Couldn't find game entity '%s' in game DLL '%s' for plugin '%s'", entStr, GameDLL.name, plinfo->name);
157.176 + return(false);
157.177 + }
157.178 + META_DEBUG(7, ("Calling game entity '%s' for plugin '%s'", entStr,
157.179 + plinfo->name));
157.180 + (*pfnEntity)(pev);
157.181 + return(true);
157.182 +}
157.183 +
157.184 +// Find a usermsg, registered by the gamedll, with the corresponding
157.185 +// msgname, and return remaining info about it (msgid, size).
157.186 +int mutil_GetUserMsgID(plid_t plid, const char *msgname, int *size) {
157.187 + plugin_info_t *plinfo;
157.188 + MRegMsg *umsg;
157.189 +
157.190 + plinfo=(plugin_info_t *)plid;
157.191 + META_DEBUG(8, ("Looking up usermsg name '%s' for plugin '%s'", msgname,
157.192 + plinfo->name));
157.193 + umsg=RegMsgs->find(msgname);
157.194 + if(umsg) {
157.195 + if(size)
157.196 + *size=umsg->size;
157.197 + return(umsg->msgid);
157.198 + }
157.199 + else
157.200 + return(0);
157.201 +}
157.202 +
157.203 +// Find a usermsg, registered by the gamedll, with the corresponding
157.204 +// msgid, and return remaining info about it (msgname, size).
157.205 +const char *mutil_GetUserMsgName(plid_t plid, int msgid, int *size) {
157.206 + plugin_info_t *plinfo;
157.207 + MRegMsg *umsg;
157.208 +
157.209 + plinfo=(plugin_info_t *)plid;
157.210 + META_DEBUG(8, ("Looking up usermsg id '%d' for plugin '%s'", msgid,
157.211 + plinfo->name));
157.212 + // Guess names for any built-in Engine messages mentioned in the SDK;
157.213 + // from dlls/util.h.
157.214 + if(msgid < 64) {
157.215 + switch(msgid) {
157.216 + case SVC_TEMPENTITY:
157.217 + if(size) *size=-1;
157.218 + return("tempentity?");
157.219 + case SVC_INTERMISSION:
157.220 + if(size) *size=-1;
157.221 + return("intermission?");
157.222 + case SVC_CDTRACK:
157.223 + if(size) *size=-1;
157.224 + return("cdtrack?");
157.225 + case SVC_WEAPONANIM:
157.226 + if(size) *size=-1;
157.227 + return("weaponanim?");
157.228 + case SVC_ROOMTYPE:
157.229 + if(size) *size=-1;
157.230 + return("roomtype?");
157.231 + case SVC_DIRECTOR:
157.232 + if(size) *size=-1;
157.233 + return("director?");
157.234 + }
157.235 + }
157.236 + umsg=RegMsgs->find(msgid);
157.237 + if(umsg) {
157.238 + if(size)
157.239 + *size=umsg->size;
157.240 + // 'name' is assumed to be a constant string, allocated in the
157.241 + // gamedll.
157.242 + return(umsg->name);
157.243 + }
157.244 + else
157.245 + return(NULL);
157.246 +}
157.247 +
157.248 +// Return the full path of the plugin's loaded dll/so file.
157.249 +const char *mutil_GetPluginPath(plid_t plid) {
157.250 + static char buf[PATH_MAX];
157.251 + MPlugin *plug;
157.252 +
157.253 + plug=Plugins->find(plid);
157.254 + if(!plug) {
157.255 + META_ERROR("GetPluginPath: couldn't find plugin '%s'",
157.256 + plid->name);
157.257 + return(NULL);
157.258 + }
157.259 + STRNCPY(buf, plug->pathname, sizeof(buf));
157.260 + return(buf);
157.261 +}
157.262 +
157.263 +// Return various string-based info about the game/MOD/gamedll.
157.264 +const char *mutil_GetGameInfo(plid_t plid, ginfo_t type) {
157.265 + static char buf[MAX_STRBUF_LEN];
157.266 + const char *cp;
157.267 + switch(type) {
157.268 + case GINFO_NAME:
157.269 + cp=GameDLL.name;
157.270 + break;
157.271 + case GINFO_DESC:
157.272 + cp=GameDLL.desc;
157.273 + break;
157.274 + case GINFO_GAMEDIR:
157.275 + cp=GameDLL.gamedir;
157.276 + break;
157.277 + case GINFO_DLL_FULLPATH:
157.278 + cp=GameDLL.pathname;
157.279 + break;
157.280 + case GINFO_DLL_FILENAME:
157.281 + cp=GameDLL.file;
157.282 + break;
157.283 + case GINFO_REALDLL_FULLPATH:
157.284 + cp=GameDLL.real_pathname;
157.285 + break;
157.286 + default:
157.287 + META_ERROR("GetGameInfo: invalid request '%d' from plugin '%s'",
157.288 + type, plid->name);
157.289 + return(NULL);
157.290 + }
157.291 + STRNCPY(buf, cp, sizeof(buf));
157.292 + return(buf);
157.293 +}
157.294 +
157.295 +#ifdef UNFINISHED
157.296 +int mutil_HookGameEvent(plid_t plid, game_event_t event,
157.297 + event_func_t pfnHandle)
157.298 +{
157.299 + return(Hooks->add(plid, event, pfnHandle));
157.300 +}
157.301 +
157.302 +int mutil_HookLogTrigger(plid_t plid, const char *trigger,
157.303 + logmatch_func_t pfnHandle)
157.304 +{
157.305 + return(Hooks->add(plid, H_TRIGGER, trigger, pfnHandle));
157.306 +}
157.307 +
157.308 +int mutil_HookLogString(plid_t plid, const char *string,
157.309 + logmatch_func_t pfnHandle)
157.310 +{
157.311 + return(Hooks->add(plid, H_STRING, string, pfnHandle));
157.312 +}
157.313 +
157.314 +int mutil_HookLogRegex(plid_t plid, const char *pattern,
157.315 + logmatch_func_t pfnHandle)
157.316 +{
157.317 + return(Hooks->add(plid, H_STRING, pattern, pfnHandle));
157.318 +}
157.319 +
157.320 +qboolean mutil_RemoveHookID(plid_t plid, int hookid) {
157.321 + mBOOL ret;
157.322 + ret=Hooks->remove(plid, hookid);
157.323 + if(ret==mTRUE) return(true);
157.324 + else return(false);
157.325 +}
157.326 +
157.327 +int mutil_RemoveHookAll(plid_t plid) {
157.328 + return(Hooks->remove_all(plid));
157.329 +}
157.330 +#endif /* UNFINISHED */
157.331 +
157.332 +// Meta Utility Function table.
157.333 +mutil_funcs_t MetaUtilFunctions = {
157.334 + mutil_LogConsole, // pfnLogConsole
157.335 + mutil_LogMessage, // pfnLogMessage
157.336 + mutil_LogError, // pfnLogError
157.337 + mutil_LogDeveloper, // pfnLogDeveloper
157.338 + mutil_CenterSay, // pfnCenterSay
157.339 + mutil_CenterSayParms, // pfnCenterSayParms
157.340 + mutil_CenterSayVarargs, // pfnCenterSayVarargs
157.341 + mutil_CallGameEntity, // pfnCallGameEntity
157.342 + mutil_GetUserMsgID, // pfnGetUserMsgID
157.343 + mutil_GetUserMsgName, // pfnGetUserMsgName
157.344 + mutil_GetPluginPath, // pfnGetPluginPath
157.345 + mutil_GetGameInfo, // pfnGetGameInfo
157.346 +#ifdef UNFINISHED
157.347 + mutil_HookGameEvent, // pfnGameEvent
157.348 + mutil_HookLogTrigger, // pfnLogTrigger
157.349 + mutil_HookLogString, // pfnLogString
157.350 + mutil_HookLogRegex, // pfnLogRegex
157.351 + mutil_RemoveHookID, // pfnRemoveHookID
157.352 + mutil_RemoveHookAll, // pfnRemoveHookAll
157.353 +#endif /* UNFINISHED */
157.354 +};
158.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
158.2 +++ b/metamod/mutil.h Tue Apr 06 07:36:14 2004 +0000
158.3 @@ -0,0 +1,145 @@
158.4 +// vi: set ts=4 sw=4 :
158.5 +// vim: set tw=75 :
158.6 +
158.7 +// mutil.h - prototypes for utility functions to provide to plugins
158.8 +
158.9 +/*
158.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
158.11 + *
158.12 + * This file is part of Metamod.
158.13 + *
158.14 + * Metamod is free software; you can redistribute it and/or modify it
158.15 + * under the terms of the GNU General Public License as published by the
158.16 + * Free Software Foundation; either version 2 of the License, or (at
158.17 + * your option) any later version.
158.18 + *
158.19 + * Metamod is distributed in the hope that it will be useful, but
158.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
158.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
158.22 + * General Public License for more details.
158.23 + *
158.24 + * You should have received a copy of the GNU General Public License
158.25 + * along with Metamod; if not, write to the Free Software Foundation,
158.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
158.27 + *
158.28 + * In addition, as a special exception, the author gives permission to
158.29 + * link the code of this program with the Half-Life Game Engine ("HL
158.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
158.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
158.32 + * respects for all of the code used other than the HL Engine and MODs
158.33 + * from Valve. If you modify this file, you may extend this exception
158.34 + * to your version of the file, but you are not obligated to do so. If
158.35 + * you do not wish to do so, delete this exception statement from your
158.36 + * version.
158.37 + *
158.38 + */
158.39 +
158.40 +#ifndef MUTIL_H
158.41 +#define MUTIL_H
158.42 +
158.43 +#include "plinfo.h" // plugin_info_t, etc
158.44 +#include "mhook.h" // game_event_t, etc
158.45 +#include "sdk_util.h" // hudtextparms_t, etc
158.46 +
158.47 +// max buffer size for printed messages
158.48 +#define MAX_LOGMSG_LEN 1024
158.49 +
158.50 +// For GetGameInfo:
158.51 +typedef enum {
158.52 + GINFO_NAME = 0,
158.53 + GINFO_DESC,
158.54 + GINFO_GAMEDIR,
158.55 + GINFO_DLL_FULLPATH,
158.56 + GINFO_DLL_FILENAME,
158.57 + GINFO_REALDLL_FULLPATH,
158.58 +} ginfo_t;
158.59 +
158.60 +// Meta Utility Function table type.
158.61 +typedef struct meta_util_funcs_s {
158.62 + void (*pfnLogConsole) (plid_t plid, const char *fmt, ...);
158.63 + void (*pfnLogMessage) (plid_t plid, const char *fmt, ...);
158.64 + void (*pfnLogError) (plid_t plid, const char *fmt, ...);
158.65 + void (*pfnLogDeveloper) (plid_t plid, const char *fmt, ...);
158.66 + void (*pfnCenterSay) (plid_t plid, const char *fmt, ...);
158.67 + void (*pfnCenterSayParms) (plid_t plid, hudtextparms_t tparms,
158.68 + const char *fmt, ...);
158.69 + void (*pfnCenterSayVarargs) (plid_t plid, hudtextparms_t tparms,
158.70 + const char *fmt, va_list ap);
158.71 + qboolean (*pfnCallGameEntity) (plid_t plid, const char *entStr,
158.72 + entvars_t *pev);
158.73 + int (*pfnGetUserMsgID) (plid_t plid, const char *msgname, int *size);
158.74 + const char *(*pfnGetUserMsgName) (plid_t plid, int msgid, int *size);
158.75 + const char *(*pfnGetPluginPath) (plid_t plid);
158.76 + const char *(*pfnGetGameInfo) (plid_t plid, ginfo_t tag);
158.77 +#ifdef UNFINISHED
158.78 + int (*pfnHookGameEvent) (plid_t plid, game_event_t event,
158.79 + event_func_t pfnHandle);
158.80 + int (*pfnHookLogTrigger) (plid_t plid, const char *trigger,
158.81 + logmatch_func_t pfnHandle);
158.82 + int (*pfnHookLogString) (plid_t plid, const char *string,
158.83 + logmatch_func_t pfnHandle);
158.84 + int (*pfnHookLogRegex) (plid_t plid, const char *pattern,
158.85 + logmatch_func_t pfnHandle);
158.86 + qboolean (*pfnRemoveHookID) (plid_t plid, int hookid);
158.87 + int (*pfnRemoveHookAll) (plid_t plid);
158.88 +#endif /* UNFINISHED */
158.89 +} mutil_funcs_t;
158.90 +extern mutil_funcs_t MetaUtilFunctions;
158.91 +
158.92 +// Meta Utility Functions
158.93 +void mutil_LogConsole(plid_t plid, const char *fmt, ...);
158.94 +void mutil_LogMessage(plid_t plid, const char *fmt, ...);
158.95 +void mutil_LogError(plid_t plid, const char *fmt, ...);
158.96 +void mutil_LogDeveloper(plid_t plid, const char *fmt, ...);
158.97 +
158.98 +void mutil_CenterSay(plid_t plid, const char *fmt, ...);
158.99 +void mutil_CenterSayParms(plid_t plid, hudtextparms_t tparms,
158.100 + const char *fmt, ...);
158.101 +void mutil_CenterSayVarargs(plid_t plid, hudtextparms_t tparms,
158.102 + const char *fmt, va_list ap);
158.103 +
158.104 +qboolean mutil_CallGameEntity(plid_t plid, const char *entStr, entvars_t *pev);
158.105 +
158.106 +int mutil_GetUserMsgID(plid_t plid, const char *name, int *size);
158.107 +const char *mutil_GetUserMsgName(plid_t plid, int msgid, int *size);
158.108 +const char *mutil_GetPluginPath(plid_t plid);
158.109 +const char *mutil_GetGameInfo(plid_t plid, ginfo_t tag);
158.110 +
158.111 +#ifdef UNFINISHED
158.112 +int mutil_HookGameEvent(plid_t plid, game_event_t event,
158.113 + event_func_t pfnHandle);
158.114 +int mutil_HookLogTrigger(plid_t plid, const char *trigger,
158.115 + logmatch_func_t pfnHandle);
158.116 +int mutil_HookLogString(plid_t plid, const char *string,
158.117 + logmatch_func_t pfnHandle);
158.118 +int mutil_HookLogRegex(plid_t plid, const char *pattern,
158.119 + logmatch_func_t pfnHandle);
158.120 +
158.121 +qboolean mutil_RemoveHookID(plid_t plid, int hookid);
158.122 +int mutil_RemoveHookAll(plid_t plid);
158.123 +#endif /* UNFINISHED */
158.124 +
158.125 +// Convenience macros for MetaUtil functions
158.126 +#define LOG_CONSOLE (*gpMetaUtilFuncs->pfnLogConsole)
158.127 +#define LOG_MESSAGE (*gpMetaUtilFuncs->pfnLogMessage)
158.128 +#define LOG_ERROR (*gpMetaUtilFuncs->pfnLogError)
158.129 +#define LOG_DEVELOPER (*gpMetaUtilFuncs->pfnLogDeveloper)
158.130 +#define CENTER_SAY (*gpMetaUtilFuncs->pfnCenterSay)
158.131 +#define CENTER_SAY_PARMS (*gpMetaUtilFuncs->pfnCenterSayParms)
158.132 +#define CENTER_SAY_VARARGS (*gpMetaUtilFuncs->pfnCenterSayVarargs)
158.133 +#define CALL_GAME_ENTITY (*gpMetaUtilFuncs->pfnCallGameEntity)
158.134 +#define GET_USER_MSG_ID (*gpMetaUtilFuncs->pfnGetUserMsgID)
158.135 +#define GET_USER_MSG_NAME (*gpMetaUtilFuncs->pfnGetUserMsgName)
158.136 +#define GET_PLUGIN_PATH (*gpMetaUtilFuncs->pfnGetPluginPath)
158.137 +#define GET_GAME_INFO (*gpMetaUtilFuncs->pfnGetGameInfo)
158.138 +
158.139 +#ifdef UNFINISHED
158.140 +#define HOOK_GAME_EVENT (*gpMetaUtilFuncs->pfnHookGameEvent)
158.141 +#define HOOK_LOG_TRIGGER (*gpMetaUtilFuncs->pfnHookLogTrigger)
158.142 +#define HOOK_LOG_STRING (*gpMetaUtilFuncs->pfnHookLogString)
158.143 +#define HOOK_LOG_REGEX (*gpMetaUtilFuncs->pfnHookLogRegex)
158.144 +#define REMOVE_HOOK_ID (*gpMetaUtilFuncs->pfnRemoveHookID)
158.145 +#define REMOVE_HOOK_ALL (*gpMetaUtilFuncs->pfnRemoveHookAll)
158.146 +#endif /* UNFINISHED */
158.147 +
158.148 +#endif /* MUTIL_H */
159.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
159.2 +++ b/metamod/osdep.cpp Tue Apr 06 07:36:14 2004 +0000
159.3 @@ -0,0 +1,219 @@
159.4 +// vi: set ts=4 sw=4 :
159.5 +// vim: set tw=75 :
159.6 +
159.7 +// osdep.cpp - routines for operating system differences
159.8 +
159.9 +/*
159.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
159.11 + *
159.12 + * This file is part of Metamod.
159.13 + *
159.14 + * Metamod is free software; you can redistribute it and/or modify it
159.15 + * under the terms of the GNU General Public License as published by the
159.16 + * Free Software Foundation; either version 2 of the License, or (at
159.17 + * your option) any later version.
159.18 + *
159.19 + * Metamod is distributed in the hope that it will be useful, but
159.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
159.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
159.22 + * General Public License for more details.
159.23 + *
159.24 + * You should have received a copy of the GNU General Public License
159.25 + * along with Metamod; if not, write to the Free Software Foundation,
159.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
159.27 + *
159.28 + * In addition, as a special exception, the author gives permission to
159.29 + * link the code of this program with the Half-Life Game Engine ("HL
159.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
159.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
159.32 + * respects for all of the code used other than the HL Engine and MODs
159.33 + * from Valve. If you modify this file, you may extend this exception
159.34 + * to your version of the file, but you are not obligated to do so. If
159.35 + * you do not wish to do so, delete this exception statement from your
159.36 + * version.
159.37 + *
159.38 + */
159.39 +
159.40 +#ifdef linux
159.41 +// enable extra routines in system header files, like dladdr
159.42 +#define _GNU_SOURCE
159.43 +#include <dlfcn.h> // dlopen, dladdr, etc
159.44 +#include <signal.h> // sigaction, etc
159.45 +#include <setjmp.h> // sigsetjmp, longjmp, etc
159.46 +#endif /* linux */
159.47 +
159.48 +#include <string.h> // strpbrk, etc
159.49 +
159.50 +#include <extdll.h> // always
159.51 +
159.52 +#include "osdep.h" // me
159.53 +#include "mreg.h" // RG_VALID, etc
159.54 +#include "log_meta.h" // META_ERROR, etc
159.55 +#include "types_meta.h" // mBOOL
159.56 +#include "support_meta.h" // MAX_STRBUF_LEN
159.57 +
159.58 +
159.59 +#ifdef _WIN32
159.60 +// Since windows doesn't provide a verison of strtok_r(), we include one
159.61 +// here. This may or may not operate exactly like strtok_r(), but does
159.62 +// what we need it it do.
159.63 +char *my_strtok_r(char *s, const char *delim, char **ptrptr) {
159.64 + char *begin=NULL;
159.65 + char *end=NULL;
159.66 + char *rest=NULL;
159.67 + if(s)
159.68 + begin=s;
159.69 + else
159.70 + begin=*ptrptr;
159.71 + if(!begin)
159.72 + return(NULL);
159.73 + end=strpbrk(begin, delim);
159.74 + if(end) {
159.75 + *end='\0';
159.76 + rest=end+1;
159.77 + *ptrptr=rest+strspn(rest, delim);
159.78 + }
159.79 + else
159.80 + *ptrptr=NULL;
159.81 + return(begin);
159.82 +}
159.83 +#endif /* _WIN32 */
159.84 +
159.85 +
159.86 +#ifdef _WIN32
159.87 +// Windows doesn't provide a functon analagous to dlerr() that returns a
159.88 +// string describing the error, so we include one here, as exampled at:
159.89 +// http://msdn.microsoft.com/library/en-us/debug/errors_0sdh.asp
159.90 +// except without FORMAT_MESSAGE_ALLOCATE_BUFFER, since we use a local
159.91 +// static buffer.
159.92 +char *str_GetLastError(void) {
159.93 + static char buf[MAX_STRBUF_LEN];
159.94 + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
159.95 + NULL, GetLastError(),
159.96 + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), //! Default language
159.97 + (LPTSTR) &buf, 0, NULL);
159.98 + return(buf);
159.99 +}
159.100 +#endif /* _WIN32 */
159.101 +
159.102 +
159.103 +// Find the filename of the DLL/shared-lib where the given memory location
159.104 +// exists.
159.105 +#ifdef linux
159.106 +// Errno values:
159.107 +// - ME_NOTFOUND couldn't find a sharedlib that contains memory location
159.108 +const char *DLFNAME(void *memptr) {
159.109 + Dl_info dli;
159.110 + memset(&dli, 0, sizeof(dli));
159.111 + if(dladdr(memptr, &dli))
159.112 + return(dli.dli_fname);
159.113 + else
159.114 + RETURN_ERRNO(NULL, ME_NOTFOUND);
159.115 +}
159.116 +#elif defined(_WIN32)
159.117 +// Implementation for win32 provided by Jussi Kivilinna <[email protected]>:
159.118 +//
159.119 +// 1. Get memory location info on memptr with VirtualQuery.
159.120 +// 2. Check if memory location info is valid and use MBI.AllocationBase
159.121 +// as module start point.
159.122 +// 3. Get module file name with GetModuleFileName.
159.123 +//
159.124 +// Simple and should work pretty much same way as 'dladdr' in linux.
159.125 +// VirtualQuery and GetModuleFileName work even with win32s.
159.126 +//
159.127 +// Note that GetModuleFileName returns longfilenames rather than 8.3.
159.128 +//
159.129 +// Note also, the returned filename is local static storage, and should be
159.130 +// copied by caller if it needs to keep it around.
159.131 +//
159.132 +// Also note, normalize_pathname() should really be done by the caller, but
159.133 +// is done here to preserve "const char *" return consistent with linux
159.134 +// version.
159.135 +//
159.136 +// Errno values:
159.137 +// - ME_NOTFOUND couldn't find a DLL that contains memory location
159.138 +const char *DLFNAME(void *memptr) {
159.139 + MEMORY_BASIC_INFORMATION MBI;
159.140 + static char fname[PATH_MAX];
159.141 +
159.142 + memset(fname, 0, sizeof(fname));
159.143 +
159.144 + if (!VirtualQuery(memptr, &MBI, sizeof(MBI)))
159.145 + RETURN_ERRNO(NULL, ME_NOTFOUND);
159.146 + if (MBI.State != MEM_COMMIT)
159.147 + RETURN_ERRNO(NULL, ME_NOTFOUND);
159.148 + if(!MBI.AllocationBase)
159.149 + RETURN_ERRNO(NULL, ME_NOTFOUND);
159.150 +
159.151 + // MSDN indicates that GetModuleFileName will leave string
159.152 + // null-terminated, even if it's truncated because buffer is too small.
159.153 + if(!GetModuleFileName((HMODULE)MBI.AllocationBase, fname,
159.154 + sizeof(fname)-1))
159.155 + RETURN_ERRNO(NULL, ME_NOTFOUND);
159.156 + if(!fname[0])
159.157 + RETURN_ERRNO(NULL, ME_NOTFOUND);
159.158 +
159.159 + normalize_pathname(fname);
159.160 + return(fname);
159.161 +}
159.162 +#endif /* _WIN32 */
159.163 +
159.164 +
159.165 +// Determine whether the given memory location is valid (ie whether we
159.166 +// should expect to be able to reference strings or functions at this
159.167 +// location without segfaulting).
159.168 +#ifdef linux
159.169 +// Simulate this with dladdr. I'm not convinced this will be as generally
159.170 +// applicable as the native windows routine below, but it should do what
159.171 +// we need it for in this particular situation.
159.172 +// meta_errno values:
159.173 +// - ME_NOTFOUND couldn't find a matching sharedlib for this ptr
159.174 +mBOOL IS_VALID_PTR(void *memptr) {
159.175 + Dl_info dli;
159.176 + memset(&dli, 0, sizeof(dli));
159.177 + if(dladdr(memptr, &dli))
159.178 + return(mTRUE);
159.179 + else
159.180 + RETURN_ERRNO(mFALSE, ME_NOTFOUND);
159.181 +}
159.182 +#elif defined(_WIN32)
159.183 +// Use the native windows routine IsBadCodePtr.
159.184 +// meta_errno values:
159.185 +// - ME_BADMEMPTR not a valid memory pointer
159.186 +mBOOL IS_VALID_PTR(void *memptr) {
159.187 + if(IsBadCodePtr((FARPROC) memptr))
159.188 + RETURN_ERRNO(mFALSE, ME_BADMEMPTR);
159.189 + else
159.190 + return(mTRUE);
159.191 +}
159.192 +#endif /* _WIN32 */
159.193 +
159.194 +// This used to be OS-dependent, as it used a SEGV signal handler under
159.195 +// linux, but that was removed because (a) it masked legitimate segfaults
159.196 +// in plugin commands and produced confusing output ("plugin has been
159.197 +// unloaded", when really it segfaultd), and (b) wasn't necessary since
159.198 +// IS_VALID_PTR() should cover the situation.
159.199 +mBOOL os_safe_call(REG_CMD_FN pfn) {
159.200 + // try and see if this is a valid memory location
159.201 + if(!IS_VALID_PTR((void *) pfn))
159.202 + // meta_errno should be already set in is_valid_ptr()
159.203 + return(mFALSE);
159.204 +
159.205 + pfn();
159.206 + return(mTRUE);
159.207 +}
159.208 +
159.209 +// See comments in osdep.h.
159.210 +#ifdef __GNUC__
159.211 +void meta_new_handler(void) {
159.212 + // This merely because we don't want the program to exit if new()
159.213 + // fails..
159.214 + return;
159.215 +}
159.216 +#elif defined(_MSC_VER)
159.217 +int meta_new_handler(size_t size) {
159.218 + // This merely because we don't want the program to exit if new()
159.219 + // fails..
159.220 + return(0);
159.221 +}
159.222 +#endif /* _MSC_VER */
160.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
160.2 +++ b/metamod/osdep.h Tue Apr 06 07:36:14 2004 +0000
160.3 @@ -0,0 +1,450 @@
160.4 +// vi: set ts=4 sw=4 :
160.5 +// vim: set tw=75 :
160.6 +
160.7 +// osdep.h - operating system dependencies
160.8 +
160.9 +/*
160.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
160.11 + *
160.12 + * This file is part of Metamod.
160.13 + *
160.14 + * Metamod is free software; you can redistribute it and/or modify it
160.15 + * under the terms of the GNU General Public License as published by the
160.16 + * Free Software Foundation; either version 2 of the License, or (at
160.17 + * your option) any later version.
160.18 + *
160.19 + * Metamod is distributed in the hope that it will be useful, but
160.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
160.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
160.22 + * General Public License for more details.
160.23 + *
160.24 + * You should have received a copy of the GNU General Public License
160.25 + * along with Metamod; if not, write to the Free Software Foundation,
160.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
160.27 + *
160.28 + * In addition, as a special exception, the author gives permission to
160.29 + * link the code of this program with the Half-Life Game Engine ("HL
160.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
160.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
160.32 + * respects for all of the code used other than the HL Engine and MODs
160.33 + * from Valve. If you modify this file, you may extend this exception
160.34 + * to your version of the file, but you are not obligated to do so. If
160.35 + * you do not wish to do so, delete this exception statement from your
160.36 + * version.
160.37 + *
160.38 + */
160.39 +
160.40 +#ifndef OSDEP_H
160.41 +#define OSDEP_H
160.42 +
160.43 +#include <string.h> // strerror()
160.44 +#include <ctype.h> // isupper, tolower
160.45 +#include <errno.h> // errno
160.46 +
160.47 +// Various differences between WIN32 and Linux.
160.48 +
160.49 +#include "types_meta.h" // mBOOL
160.50 +#include "mreg.h" // REG_CMD_FN, etc
160.51 +#include "log_meta.h" // LOG_ERROR, etc
160.52 +
160.53 +// String describing platform/DLL-type, for matching lines in plugins.ini.
160.54 +#ifdef linux
160.55 + #define PLATFORM "linux"
160.56 +#elif defined(_WIN32)
160.57 + #define PLATFORM "win32"
160.58 +#else /* unknown */
160.59 + #error "OS unrecognized"
160.60 +#endif /* unknown */
160.61 +
160.62 +
160.63 +// Macro for function-exporting from DLL..
160.64 +// from SDK dlls/cbase.h:
160.65 +//! C functions for external declarations that call the appropriate C++ methods
160.66 +
160.67 +// Windows uses "__declspec(dllexport)" to mark functions in the DLL that
160.68 +// should be visible/callable externally.
160.69 +//
160.70 +// It also apparently requires WINAPI for GiveFnptrsToDll().
160.71 +//
160.72 +// See doc/notes_windows_coding for more information..
160.73 +
160.74 +// Attributes to specify an "exported" function, visible from outside the
160.75 +// DLL.
160.76 +#undef DLLEXPORT
160.77 +#ifdef _WIN32
160.78 + #define DLLEXPORT __declspec(dllexport)
160.79 + // WINAPI should be provided in the windows compiler headers.
160.80 + // It's usually defined to something like "__stdcall".
160.81 +#elif defined(linux)
160.82 + #define DLLEXPORT /* */
160.83 + #define WINAPI /* */
160.84 +#endif /* linux */
160.85 +
160.86 +// Simplified macro for declaring/defining exported DLL functions. They
160.87 +// need to be 'extern "C"' so that the C++ compiler enforces parameter
160.88 +// type-matching, rather than considering routines with mis-matched
160.89 +// arguments/types to be overloaded functions...
160.90 +//
160.91 +// AFAIK, this is os-independent, but it's included here in osdep.h where
160.92 +// DLLEXPORT is defined, for convenience.
160.93 +#define C_DLLEXPORT extern "C" DLLEXPORT
160.94 +
160.95 +
160.96 +#ifdef _MSC_VER
160.97 + // Disable MSVC warning:
160.98 + // 4390 : empty controlled statement found; is this what was intended?
160.99 + // generated by the RETURN macros.
160.100 + #pragma warning(disable: 4390)
160.101 +#endif /* _MSC_VER */
160.102 +
160.103 +
160.104 +// Functions & types for DLL open/close/etc operations.
160.105 +#ifdef linux
160.106 + #include <dlfcn.h>
160.107 + typedef void* DLHANDLE;
160.108 + typedef void* DLFUNC;
160.109 + inline DLHANDLE DLOPEN(const char *filename) {
160.110 + return(dlopen(filename, RTLD_NOW));
160.111 + }
160.112 + inline DLFUNC DLSYM(DLHANDLE handle, const char *string) {
160.113 + return(dlsym(handle, string));
160.114 + }
160.115 + inline int DLCLOSE(DLHANDLE handle) {
160.116 + return(dlclose(handle));
160.117 + }
160.118 + inline char* DLERROR(void) {
160.119 + return(dlerror());
160.120 + }
160.121 +#elif defined(_WIN32)
160.122 + typedef HINSTANCE DLHANDLE;
160.123 + typedef FARPROC DLFUNC;
160.124 + inline DLHANDLE DLOPEN(const char *filename) {
160.125 + return(LoadLibrary(filename));
160.126 + }
160.127 + inline DLFUNC DLSYM(DLHANDLE handle, const char *string) {
160.128 + return(GetProcAddress(handle, string));
160.129 + }
160.130 + inline int DLCLOSE(DLHANDLE handle) {
160.131 + // NOTE: Windows FreeLibrary returns success=nonzero, fail=zero,
160.132 + // which is the opposite of the unix convention, thus the '!'.
160.133 + return(!FreeLibrary(handle));
160.134 + }
160.135 + // Windows doesn't provide a function corresponding to dlerror(), so
160.136 + // we make our own.
160.137 + char *str_GetLastError(void);
160.138 + inline char* DLERROR(void) {
160.139 + return(str_GetLastError());
160.140 + }
160.141 +#endif /* _WIN32 */
160.142 +const char *DLFNAME(void *memptr);
160.143 +mBOOL IS_VALID_PTR(void *memptr);
160.144 +
160.145 +
160.146 +// Attempt to call the given function pointer, without segfaulting.
160.147 +mBOOL os_safe_call(REG_CMD_FN pfn);
160.148 +
160.149 +
160.150 +// Windows doesn't have an strtok_r() routine, so we write our own.
160.151 +#ifdef _WIN32
160.152 + #define strtok_r(s, delim, ptrptr) my_strtok_r(s, delim, ptrptr)
160.153 + char *my_strtok_r(char *s, const char *delim, char **ptrptr);
160.154 +#endif /* _WIN32 */
160.155 +
160.156 +
160.157 +// Set filename and pathname maximum lengths. Note some windows compilers
160.158 +// provide a <limits.h> which is incomplete and/or causes problems; see
160.159 +// doc/windows_notes.txt for more information.
160.160 +//
160.161 +// Note that both OS's include room for null-termination:
160.162 +// linux: "# chars in a path name including nul"
160.163 +// win32: "note that the sizes include space for 0-terminator"
160.164 +#ifdef linux
160.165 + #include <limits.h>
160.166 +#elif defined(_WIN32)
160.167 + #include <stdlib.h>
160.168 + #define NAME_MAX _MAX_FNAME
160.169 + #define PATH_MAX _MAX_PATH
160.170 +#endif /* _WIN32 */
160.171 +
160.172 +
160.173 +// Various other windows routine differences.
160.174 +#ifdef linux
160.175 + #include <unistd.h> // sleep
160.176 +#elif defined(_WIN32)
160.177 + #define snprintf _snprintf
160.178 + #define vsnprintf _vsnprintf
160.179 + #define sleep(x) Sleep(x*1000)
160.180 + #define strcasecmp stricmp
160.181 + #define strncasecmp _strnicmp
160.182 +#endif /* _WIN32 */
160.183 +
160.184 +#ifdef __GNUC__
160.185 + #include <unistd.h> // getcwd
160.186 +#elif defined(_MSC_VER)
160.187 + #include <direct.h> // getcwd
160.188 +#endif /* _MSC_VER */
160.189 +
160.190 +#include <sys/stat.h>
160.191 +#ifndef S_ISREG
160.192 + // Linux gcc defines this; earlier mingw didn't, later mingw does;
160.193 + // MSVC doesn't seem to.
160.194 + #define S_ISREG(m) ((m) & S_IFREG)
160.195 +#endif /* not S_ISREG */
160.196 +
160.197 +
160.198 +// Our handler for new().
160.199 +//
160.200 +// Thanks to notes from:
160.201 +// http://dragon.klte.hu/~kollarl/C++/node45.html
160.202 +//
160.203 +// At one point it appeared MSVC++ was no longer different from gcc, according
160.204 +// to:
160.205 +// http://msdn.microsoft.com/library/en-us/vclang98/stdlib/info/NEW.asp
160.206 +//
160.207 +// However, this page is apparently no longer available from MSDN. The
160.208 +// only thing now is:
160.209 +// http://msdn.microsoft.com/library/en-us/vccore98/HTML/_crt_malloc.asp
160.210 +//
160.211 +// According to Fritz Elfert <[email protected]>:
160.212 +// set_new_handler() is just a stub which (according to comments in the
160.213 +// MSVCRT debugging sources) should never be used. It is just an ugly
160.214 +// hack to make STL compile. It does _not_ set the new handler but
160.215 +// always calls _set_new_handler(0) instead. _set_new_handler is the
160.216 +// "real" function and uses the "old" semantic; handler-type is:
160.217 +// int newhandler(size_t)
160.218 +//
160.219 +#ifdef __GNUC__
160.220 + void meta_new_handler(void);
160.221 +#elif defined(_MSC_VER)
160.222 + int meta_new_handler(size_t size);
160.223 + #define set_new_handler _set_new_handler
160.224 +#endif /* _MSC_VER */
160.225 +
160.226 +
160.227 +// Thread handling...
160.228 +#ifdef linux
160.229 + #include <pthread.h>
160.230 + typedef pthread_t THREAD_T;
160.231 + // returns 0==success, non-zero==failure
160.232 + inline int THREAD_CREATE(THREAD_T *tid, void (*func)(void)) {
160.233 + int ret;
160.234 + ret=pthread_create(tid, NULL, (void *(*)(void*)) func, NULL);
160.235 + if(ret != 0) {
160.236 + META_ERROR("Failure starting thread: %s", strerror(ret));
160.237 + return(ret);
160.238 + }
160.239 + ret=pthread_detach(*tid);
160.240 + if(ret != 0)
160.241 + META_ERROR("Failure detaching thread: %s", strerror(ret));
160.242 + return(ret);
160.243 + }
160.244 +#elif defined(_WIN32)
160.245 + // See:
160.246 + // http://msdn.microsoft.com/library/en-us/dllproc/prothred_4084.asp
160.247 + typedef DWORD THREAD_T;
160.248 + // returns 0==success, non-zero==failure
160.249 + inline int THREAD_CREATE(THREAD_T *tid, void (*func)(void)) {
160.250 + HANDLE ret;
160.251 + // win32 returns NULL==failure, non-NULL==success
160.252 + ret=CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) func, NULL, 0, tid);
160.253 + if(ret==NULL)
160.254 + META_ERROR("Failure starting thread: %s", str_GetLastError());
160.255 + return(ret==NULL);
160.256 + }
160.257 +#endif /* _WIN32 */
160.258 +#define THREAD_OK 0
160.259 +
160.260 +
160.261 +// Mutex handling...
160.262 +#ifdef linux
160.263 + typedef pthread_mutex_t MUTEX_T;
160.264 + inline int MUTEX_INIT(MUTEX_T *mutex) {
160.265 + int ret;
160.266 + ret=pthread_mutex_init(mutex, NULL);
160.267 + if(ret!=THREAD_OK)
160.268 + META_ERROR("mutex_init failed: %s", strerror(ret));
160.269 + return(ret);
160.270 + }
160.271 + inline int MUTEX_LOCK(MUTEX_T *mutex) {
160.272 + int ret;
160.273 + ret=pthread_mutex_lock(mutex);
160.274 + if(ret!=THREAD_OK)
160.275 + META_ERROR("mutex_lock failed: %s", strerror(ret));
160.276 + return(ret);
160.277 + }
160.278 + inline int MUTEX_UNLOCK(MUTEX_T *mutex) {
160.279 + int ret;
160.280 + ret=pthread_mutex_unlock(mutex);
160.281 + if(ret!=THREAD_OK)
160.282 + META_ERROR("mutex_unlock failed: %s", strerror(ret));
160.283 + return(ret);
160.284 + }
160.285 +#elif defined(_WIN32)
160.286 + // Win32 has "mutexes" as well, but CS's are simpler.
160.287 + // See:
160.288 + // http://msdn.microsoft.com/library/en-us/dllproc/synchro_2a2b.asp
160.289 + typedef CRITICAL_SECTION MUTEX_T;
160.290 + // Note win32 routines don't return any error (return void).
160.291 + inline int MUTEX_INIT(MUTEX_T *mutex) {
160.292 + InitializeCriticalSection(mutex);
160.293 + return(THREAD_OK);
160.294 + }
160.295 + inline int MUTEX_LOCK(MUTEX_T *mutex) {
160.296 + EnterCriticalSection(mutex);
160.297 + return(THREAD_OK);
160.298 + }
160.299 + inline int MUTEX_UNLOCK(MUTEX_T *mutex) {
160.300 + LeaveCriticalSection(mutex);
160.301 + return(THREAD_OK);
160.302 + }
160.303 +#endif /* _WIN32 (mutex) */
160.304 +
160.305 +
160.306 +// Condition variables...
160.307 +#ifdef linux
160.308 + typedef pthread_cond_t COND_T;
160.309 + inline int COND_INIT(COND_T *cond) {
160.310 + int ret;
160.311 + ret=pthread_cond_init(cond, NULL);
160.312 + if(ret!=THREAD_OK)
160.313 + META_ERROR("cond_init failed: %s", strerror(ret));
160.314 + return(ret);
160.315 + }
160.316 + inline int COND_WAIT(COND_T *cond, MUTEX_T *mutex) {
160.317 + int ret;
160.318 + ret=pthread_cond_wait(cond, mutex);
160.319 + if(ret!=THREAD_OK)
160.320 + META_ERROR("cond_wait failed: %s", strerror(ret));
160.321 + return(ret);
160.322 + }
160.323 + inline int COND_SIGNAL(COND_T *cond) {
160.324 + int ret;
160.325 + ret=pthread_cond_signal(cond);
160.326 + if(ret!=THREAD_OK)
160.327 + META_ERROR("cond_signal failed: %s", strerror(ret));
160.328 + return(ret);
160.329 + }
160.330 +#elif defined(_WIN32)
160.331 + // Since win32 doesn't provide condition-variables, we have to model
160.332 + // them with mutex/critical-sections and win32 events. This uses the
160.333 + // second (SetEvent) solution from:
160.334 + //
160.335 + // http://www.cs.wustl.edu/~schmidt/win32-cv-1.html
160.336 + //
160.337 + // but without the waiters_count overhead, since we don't need
160.338 + // broadcast functionality anyway. Or actually, I guess it's more like
160.339 + // the first (PulseEvent) solution, but with SetEven rather than
160.340 + // PulseEvent. :)
160.341 + //
160.342 + // See also:
160.343 + // http://msdn.microsoft.com/library/en-us/dllproc/synchro_8ann.asp
160.344 + typedef HANDLE COND_T;
160.345 + inline int COND_INIT(COND_T *cond) {
160.346 + *cond = CreateEvent(NULL, // security attributes (none)
160.347 + FALSE, // manual-reset type (false==auto-reset)
160.348 + FALSE, // initial state (unsignaled)
160.349 + NULL); // object name (unnamed)
160.350 + // returns NULL on error
160.351 + if(*cond==NULL) {
160.352 + META_ERROR("cond_init failed: %s", str_GetLastError());
160.353 + return(-1);
160.354 + }
160.355 + else
160.356 + return(0);
160.357 + }
160.358 + inline int COND_WAIT(COND_T *cond, MUTEX_T *mutex) {
160.359 + DWORD ret;
160.360 + LeaveCriticalSection(mutex);
160.361 + ret=WaitForSingleObject(*cond, INFINITE);
160.362 + EnterCriticalSection(mutex);
160.363 + // returns WAIT_OBJECT_0 if object was signaled; other return
160.364 + // values indicate errors.
160.365 + if(ret == WAIT_OBJECT_0)
160.366 + return(0);
160.367 + else {
160.368 + META_ERROR("cond_wait failed: %s", str_GetLastError());
160.369 + return(-1);
160.370 + }
160.371 + }
160.372 + inline int COND_SIGNAL(COND_T *cond) {
160.373 + BOOL ret;
160.374 + ret=SetEvent(*cond);
160.375 + // returns zero on failure
160.376 + if(ret==0) {
160.377 + META_ERROR("cond_signal failed: %s", str_GetLastError());
160.378 + return(-1);
160.379 + }
160.380 + else
160.381 + return(0);
160.382 + }
160.383 +#endif /* _WIN32 (condition variable) */
160.384 +
160.385 +// Normalize/standardize a pathname.
160.386 +// - For win32, this involves:
160.387 +// - Turning backslashes (\) into slashes (/), so that config files and
160.388 +// Metamod internal code can be simpler and just use slashes (/).
160.389 +// - Turning upper/mixed case into lowercase, since windows is
160.390 +// non-case-sensitive.
160.391 +// - For linux, this requires no work, as paths uses slashes (/) natively,
160.392 +// and pathnames are case-sensitive.
160.393 +#ifdef linux
160.394 +#define normalize_pathname(a)
160.395 +#elif defined(_WIN32)
160.396 +inline void normalize_pathname(char *path) {
160.397 + char *cp;
160.398 +
160.399 + META_DEBUG(8, ("normalize: %s", path));
160.400 + for(cp=path; *cp; cp++) {
160.401 + if(isupper(*cp)) *cp=tolower(*cp);
160.402 + if(*cp=='\\') *cp='/';
160.403 + }
160.404 + META_DEBUG(8, ("normalized: %s", path));
160.405 +}
160.406 +#endif /* _WIN32 */
160.407 +
160.408 +// Indicate if pathname appears to be an absolute-path. Under linux this
160.409 +// is a leading slash (/). Under win32, this can be:
160.410 +// - a drive-letter path (ie "D:blah" or "C:\blah")
160.411 +// - a toplevel path (ie "\blah")
160.412 +// - a UNC network address (ie "\\srv1\blah").
160.413 +// Also, handle both native and normalized pathnames.
160.414 +inline int is_absolute_path(const char *path) {
160.415 + if(path[0]=='/') return(TRUE);
160.416 +#ifdef _WIN32
160.417 + if(path[1]==':') return(TRUE);
160.418 + if(path[0]=='\\') return(TRUE);
160.419 +#endif /* _WIN32 */
160.420 + return(FALSE);
160.421 +}
160.422 +
160.423 +#ifdef _WIN32
160.424 +// Buffer pointed to by resolved_name is assumed to be able to store a
160.425 +// string of PATH_MAX length.
160.426 +inline char *realpath(const char *file_name, char *resolved_name) {
160.427 + int ret;
160.428 + ret=GetFullPathName(file_name, PATH_MAX, resolved_name, NULL);
160.429 + if(ret > PATH_MAX) {
160.430 + errno=ENAMETOOLONG;
160.431 + return(NULL);
160.432 + }
160.433 + else if(ret > 0) {
160.434 + normalize_pathname(resolved_name);
160.435 + return(resolved_name);
160.436 + }
160.437 + else
160.438 + return(NULL);
160.439 +}
160.440 +#endif /* _WIN32 */
160.441 +
160.442 +// Generic "error string" from a recent OS call. For linux, this is based
160.443 +// on errno. For win32, it's based on GetLastError.
160.444 +inline const char *str_os_error(void) {
160.445 +#ifdef linux
160.446 + return(strerror(errno));
160.447 +#elif defined(_WIN32)
160.448 + return(str_GetLastError());
160.449 +#endif /* _WIN32 */
160.450 +}
160.451 +
160.452 +
160.453 +#endif /* OSDEP_H */
161.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
161.2 +++ b/metamod/plinfo.h Tue Apr 06 07:36:14 2004 +0000
161.3 @@ -0,0 +1,68 @@
161.4 +// vi: set ts=4 sw=4 :
161.5 +// vim: set tw=75 :
161.6 +
161.7 +// plinfo.h - typedefs for plugin info structure
161.8 +
161.9 +/*
161.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
161.11 + *
161.12 + * This file is part of Metamod.
161.13 + *
161.14 + * Metamod is free software; you can redistribute it and/or modify it
161.15 + * under the terms of the GNU General Public License as published by the
161.16 + * Free Software Foundation; either version 2 of the License, or (at
161.17 + * your option) any later version.
161.18 + *
161.19 + * Metamod is distributed in the hope that it will be useful, but
161.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
161.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
161.22 + * General Public License for more details.
161.23 + *
161.24 + * You should have received a copy of the GNU General Public License
161.25 + * along with Metamod; if not, write to the Free Software Foundation,
161.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
161.27 + *
161.28 + * In addition, as a special exception, the author gives permission to
161.29 + * link the code of this program with the Half-Life Game Engine ("HL
161.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
161.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
161.32 + * respects for all of the code used other than the HL Engine and MODs
161.33 + * from Valve. If you modify this file, you may extend this exception
161.34 + * to your version of the file, but you are not obligated to do so. If
161.35 + * you do not wish to do so, delete this exception statement from your
161.36 + * version.
161.37 + *
161.38 + */
161.39 +
161.40 +#ifndef PLINFO_H
161.41 +#define PLINFO_H
161.42 +
161.43 +// Flags for plugin to indicate when it can be be loaded/unloaded.
161.44 +// NOTE: order is crucial, as greater/less comparisons are made.
161.45 +typedef enum {
161.46 + PT_NEVER = 0,
161.47 + PT_STARTUP, // should only be loaded/unloaded at initial hlds execution
161.48 + PT_CHANGELEVEL, // can be loaded/unloaded between maps
161.49 + PT_ANYTIME, // can be loaded/unloaded at any time
161.50 + PT_ANYPAUSE, // can be loaded/unloaded at any time, and can be "paused" during a map
161.51 +} PLUG_LOADTIME;
161.52 +
161.53 +// Information plugin provides about itself.
161.54 +typedef struct {
161.55 + char *ifvers; // meta_interface version
161.56 + char *name; // full name of plugin
161.57 + char *version; // version
161.58 + char *date; // date
161.59 + char *author; // author name/email
161.60 + char *url; // URL
161.61 + char *logtag; // log message prefix (unused right now)
161.62 + PLUG_LOADTIME loadable; // when loadable
161.63 + PLUG_LOADTIME unloadable; // when unloadable
161.64 +} plugin_info_t;
161.65 +extern plugin_info_t Plugin_info;
161.66 +
161.67 +// Plugin identifier, passed to all Meta Utility Functions.
161.68 +typedef plugin_info_t* plid_t;
161.69 +#define PLID &Plugin_info
161.70 +
161.71 +#endif /* PLINFO_H */
162.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
162.2 +++ b/metamod/reg_support.cpp Tue Apr 06 07:36:14 2004 +0000
162.3 @@ -0,0 +1,237 @@
162.4 +// vi: set ts=4 sw=4 :
162.5 +// vim: set tw=75 :
162.6 +
162.7 +// reg_support.cpp - support for things "registered" by plugins (console
162.8 +// cmds, cvars, msgs, etc)
162.9 +
162.10 +/*
162.11 + * Copyright (c) 2001-2003 Will Day <[email protected]>
162.12 + *
162.13 + * This file is part of Metamod.
162.14 + *
162.15 + * Metamod is free software; you can redistribute it and/or modify it
162.16 + * under the terms of the GNU General Public License as published by the
162.17 + * Free Software Foundation; either version 2 of the License, or (at
162.18 + * your option) any later version.
162.19 + *
162.20 + * Metamod is distributed in the hope that it will be useful, but
162.21 + * WITHOUT ANY WARRANTY; without even the implied warranty of
162.22 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
162.23 + * General Public License for more details.
162.24 + *
162.25 + * You should have received a copy of the GNU General Public License
162.26 + * along with Metamod; if not, write to the Free Software Foundation,
162.27 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
162.28 + *
162.29 + * In addition, as a special exception, the author gives permission to
162.30 + * link the code of this program with the Half-Life Game Engine ("HL
162.31 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
162.32 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
162.33 + * respects for all of the code used other than the HL Engine and MODs
162.34 + * from Valve. If you modify this file, you may extend this exception
162.35 + * to your version of the file, but you are not obligated to do so. If
162.36 + * you do not wish to do so, delete this exception statement from your
162.37 + * version.
162.38 + *
162.39 + */
162.40 +
162.41 +#ifdef linux
162.42 +// enable extra routines in system header files, like strsignal
162.43 +#define _GNU_SOURCE
162.44 +#endif /* linux */
162.45 +
162.46 +#include <string.h> // strsignal, etc
162.47 +
162.48 +#include <extdll.h> // always
162.49 +#include "sdk_util.h" // REG_SVR_COMMAND, etc
162.50 +
162.51 +#include "reg_support.h" // me
162.52 +#include "metamod.h" // RegCmds, etc
162.53 +#include "log_meta.h" // META_ERROR, etc
162.54 +
162.55 +// "Register" support.
162.56 +//
162.57 +// This code is necessary to support the different "register" engine
162.58 +// functions that can be called by plugins, so that the plugins can be
162.59 +// safely unloaded without incurring segmentation faults.
162.60 +//
162.61 +// The problem was that, when a plugin called, say:
162.62 +// REG_SVR_COMMAND("stub_version", svr_stub_version);
162.63 +//
162.64 +// the engine stored the address to the "stub_version" string, as well as,
162.65 +// of course, the svr_stub_version() function pointer. If the plugin was
162.66 +// unloaded, and dlclose()'d, the memory locations for both the string and
162.67 +// function became invalid and unavailable. If the engine tried to
162.68 +// strcmp() against the string, or tried to call the function pointer, it
162.69 +// generated a segfault and killed the process.
162.70 +//
162.71 +// The solution used here is to create strings and functions allocated
162.72 +// locally, in metamod.dll, which won't become unavailable or invalid due
162.73 +// to a dlclose(). These local copies are passed to the engine instead of
162.74 +// those allocated in the plugin DLLs. Thus, when a plugin is later
162.75 +// unloaded and dlclose'd, the engine can still reference the memory
162.76 +// locations of registered strings and functions, without segfaulting.
162.77 +//
162.78 +// Now, what happens with a registered string or function after a plugin is
162.79 +// unloaded not quite as nice as I'd like.
162.80 +//
162.81 +// Console commands will print a message along the lines of:
162.82 +// [metamod: command '%s' unavailable; plugin unloaded]
162.83 +//
162.84 +// Cvars though, have their value unaffected. This can be convenient when
162.85 +// reloading a plugin, as the cvars keep their old values. However it can
162.86 +// also be confusing, as there is no indication when viewing/setting cvars
162.87 +// from the console that they no longer have an effect.
162.88 +//
162.89 +// Also note, the console commands for listing registered cmds and cvars
162.90 +// will try to show the name of the associated plugin. However, this only
162.91 +// works under linux; under windows it will say "(unknown)". Linux
162.92 +// provides a routine "dladdr()" which can indicate (during Reg request)
162.93 +// which plugin it's coming from, and this is stored with the cvar entry.
162.94 +// Windows didn't seem to have a similar routine, and I couldn't find
162.95 +// another way to get the information..
162.96 +
162.97 +
162.98 +// Generic command handler, passed to the engine for any AddServerCommand
162.99 +// calls made by the plugin. It finds the appropriate plugin function
162.100 +// pointer to call based on CMD_ARGV(0).
162.101 +void meta_command_handler(void) {
162.102 + MRegCmd *icmd;
162.103 + const char *cmd;
162.104 +
162.105 + META_DEBUG(5, ("called: meta_command_handler; arg0=%s args='%s'", CMD_ARGV(0), CMD_ARGS()));
162.106 + cmd=CMD_ARGV(0);
162.107 + if(!cmd) {
162.108 + META_ERROR("Null command name in meta_command_handler() ??");
162.109 + return;
162.110 + }
162.111 +
162.112 + icmd=RegCmds->find(cmd);
162.113 + if(!icmd) {
162.114 + META_ERROR("Couldn't find registered plugin command: %s", cmd);
162.115 + return;
162.116 + }
162.117 + if(icmd->call() != mTRUE)
162.118 + META_CONS("[metamod: command '%s' unavailable; plugin unloaded]", cmd);
162.119 +}
162.120 +
162.121 +
162.122 +// Replacement for engine routine AddServerCommand; called by plugins.
162.123 +// Rather then handing the engine the plugin's command string and function
162.124 +// pointer (both of which are allocated in the plugin DLL), this hands the
162.125 +// engine a command string and function pointer allocated locally (in the
162.126 +// metamod DLL).
162.127 +//
162.128 +// The string handed to the engine is just a strdup() of the plugin's
162.129 +// string. The function pointer handed to the engine is actually a pointer
162.130 +// to a generic command-handler function (see above).
162.131 +void meta_AddServerCommand(char *cmd_name, void (*function) (void)) {
162.132 + MPlugin *iplug=NULL; MRegCmd *icmd=NULL;
162.133 +
162.134 + META_DEBUG(4, ("called: meta_AddServerCommand; cmd_name=%s, function=%d", cmd_name, function));
162.135 +
162.136 + // try to find which plugin is registering this command
162.137 + if(!(iplug=Plugins->find_memloc((void *)function))) {
162.138 + // if this isn't supported on this OS, don't log an error
162.139 + if(meta_errno != ME_OSNOTSUP)
162.140 + META_ERROR("Failed to find memloc for regcmd '%s'", cmd_name);
162.141 + }
162.142 +
162.143 + // See if this command was previously registered, ie a "reloaded" plugin.
162.144 + icmd=RegCmds->find(cmd_name);
162.145 + if(!icmd) {
162.146 + // If not found, add.
162.147 + icmd=RegCmds->add(cmd_name);
162.148 + if(!icmd) {
162.149 + // error details logged in add()
162.150 + return;
162.151 + }
162.152 + // Only register if not previously registered..
162.153 + REG_SVR_COMMAND(icmd->name, meta_command_handler);
162.154 + }
162.155 +
162.156 + icmd->pfnCmd=function;
162.157 + icmd->status=RG_VALID;
162.158 + // Store which plugin this is for, if we know. We can use '0' for
162.159 + // unknown plugin, since plugin index starts at 1.
162.160 + if(iplug)
162.161 + icmd->plugid = iplug->index;
162.162 + else
162.163 + icmd->plugid = 0;
162.164 +}
162.165 +
162.166 +
162.167 +// Replacement for engine routine CVarRegister; called by plugins. Rather
162.168 +// then handing the engine the plugin's cvar structure (which is allocated
162.169 +// in the plugin DLL), this hands the engine a cvar structure allocated
162.170 +// locally (in the metamod DLL).
162.171 +//
162.172 +// The cvar handed to the engine is globally allocated in the metamod.dll;
162.173 +// the "name" and "string" fields are strdup()'s of the plugin's strings.
162.174 +// Note that, once this is done, the cvar_t allocated in the plugin is no
162.175 +// longer used for _anything_. As long as everything sets/gets the cvar
162.176 +// values via the engine functions, this will work fine. If the plugin
162.177 +// code tries to _directly_ read/set the fields of its own cvar structures,
162.178 +// it will fail to work properly.
162.179 +void meta_CVarRegister(cvar_t *pCvar) {
162.180 + MPlugin *iplug=NULL;
162.181 + MRegCvar *icvar=NULL;
162.182 +
162.183 + META_DEBUG(4, ("called: meta_CVarRegister; name=%s", pCvar->name));
162.184 +
162.185 + // try to find which plugin is registering this cvar
162.186 + if(!(iplug=Plugins->find_memloc((void *)pCvar))) {
162.187 + // if this isn't supported on this OS, don't log an error
162.188 + if(meta_errno != ME_OSNOTSUP)
162.189 + // Note: if cvar_t was malloc'd by the plugin, we can't
162.190 + // determine the calling plugin. Thus, this becomes a Debug
162.191 + // rather than Error message.
162.192 + META_DEBUG(1, ("Failed to find memloc for regcvar '%s'",
162.193 + pCvar->name));
162.194 + }
162.195 +
162.196 + // See if this cvar was previously registered, ie a "reloaded" plugin.
162.197 + icvar=RegCvars->find(pCvar->name);
162.198 + if(!icvar) {
162.199 + // If not found, add.
162.200 + icvar=RegCvars->add(pCvar->name);
162.201 + if(!icvar) {
162.202 + // error details logged in add()
162.203 + return;
162.204 + }
162.205 + // Reset to given value
162.206 + icvar->set(pCvar);
162.207 + CVAR_REGISTER(icvar->data);
162.208 + }
162.209 + // Note: if not a new cvar, then we don't set the values, and just keep
162.210 + // the pre-existing value.
162.211 +
162.212 + icvar->status=RG_VALID;
162.213 + // Store which plugin this is for, if we know. Use '0' for unknown
162.214 + // plugin, as plugin index starts at 1.
162.215 + if(iplug)
162.216 + icvar->plugid = iplug->index;
162.217 + else
162.218 + icvar->plugid = 0;
162.219 +}
162.220 +
162.221 +
162.222 +// Replacement for engine routine RegUserMsg; called by plugins. Rather
162.223 +// than handing the engine the plugin's string (which is allocated in the
162.224 +// plugin DLL), this hands the engine a string allocated from the stack.
162.225 +//
162.226 +// Note that while the above two functions maintain a list of registered
162.227 +// strings/funcs/cvars from the plugins, this is not done here as I
162.228 +// couldn't identify a need for it. Since the engine function merely maps
162.229 +// a string to an int (msgid) for subsequent use in MessageBegin/etc,
162.230 +// there's no function that needs to be provided and caught (like the
162.231 +// commands) nor any useful actions to perform upon plugin unload (like the
162.232 +// commands and cvars). This merely provides differently located storage
162.233 +// for the string.
162.234 +
162.235 +int meta_RegUserMsg(const char *pszName, int iSize) {
162.236 + char *cp;
162.237 +
162.238 + cp=strdup(pszName);
162.239 + return(REG_USER_MSG(cp, iSize));
162.240 +}
163.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
163.2 +++ b/metamod/reg_support.h Tue Apr 06 07:36:14 2004 +0000
163.3 @@ -0,0 +1,47 @@
163.4 +// vi: set ts=4 sw=4 :
163.5 +// vim: set tw=75 :
163.6 +
163.7 +// reg_support.h - functions for "registered" cmd/cvar/msg support
163.8 +
163.9 +/*
163.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
163.11 + *
163.12 + * This file is part of Metamod.
163.13 + *
163.14 + * Metamod is free software; you can redistribute it and/or modify it
163.15 + * under the terms of the GNU General Public License as published by the
163.16 + * Free Software Foundation; either version 2 of the License, or (at
163.17 + * your option) any later version.
163.18 + *
163.19 + * Metamod is distributed in the hope that it will be useful, but
163.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
163.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
163.22 + * General Public License for more details.
163.23 + *
163.24 + * You should have received a copy of the GNU General Public License
163.25 + * along with Metamod; if not, write to the Free Software Foundation,
163.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
163.27 + *
163.28 + * In addition, as a special exception, the author gives permission to
163.29 + * link the code of this program with the Half-Life Game Engine ("HL
163.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
163.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
163.32 + * respects for all of the code used other than the HL Engine and MODs
163.33 + * from Valve. If you modify this file, you may extend this exception
163.34 + * to your version of the file, but you are not obligated to do so. If
163.35 + * you do not wish to do so, delete this exception statement from your
163.36 + * version.
163.37 + *
163.38 + */
163.39 +
163.40 +#ifndef REG_SUPPORT_H
163.41 +#define REG_SUPPORT_H
163.42 +
163.43 +#include "mreg.h" // REG_CMD_FN, etc
163.44 +
163.45 +void meta_command_handler(void);
163.46 +void meta_AddServerCommand(char *cmd_name, REG_CMD_FN function);
163.47 +void meta_CVarRegister(cvar_t *pCvar);
163.48 +int meta_RegUserMsg(const char *pszName, int iSize);
163.49 +
163.50 +#endif /* REG_SUPPORT_H */
164.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
164.2 +++ b/metamod/res_meta.rc Tue Apr 06 07:36:14 2004 +0000
164.3 @@ -0,0 +1,76 @@
164.4 +// vi: set ts=4 sw=4 ft=c :
164.5 +// vim: set tw=75 :
164.6 +
164.7 +/*
164.8 + * Copyright (c) 2001-2003 Will Day <[email protected]>
164.9 + *
164.10 + * This file is part of Metamod.
164.11 + *
164.12 + * Metamod is free software; you can redistribute it and/or modify it
164.13 + * under the terms of the GNU General Public License as published by the
164.14 + * Free Software Foundation; either version 2 of the License, or (at
164.15 + * your option) any later version.
164.16 + *
164.17 + * Metamod is distributed in the hope that it will be useful, but
164.18 + * WITHOUT ANY WARRANTY; without even the implied warranty of
164.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
164.20 + * General Public License for more details.
164.21 + *
164.22 + * You should have received a copy of the GNU General Public License
164.23 + * along with Metamod; if not, write to the Free Software Foundation,
164.24 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
164.25 + *
164.26 + * In addition, as a special exception, the author gives permission to
164.27 + * link the code of this program with the Half-Life Game Engine ("HL
164.28 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
164.29 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
164.30 + * respects for all of the code used other than the HL Engine and MODs
164.31 + * from Valve. If you modify this file, you may extend this exception
164.32 + * to your version of the file, but you are not obligated to do so. If
164.33 + * you do not wish to do so, delete this exception statement from your
164.34 + * version.
164.35 + *
164.36 + */
164.37 +
164.38 +// see:
164.39 +// http://msdn.microsoft.com/library/psdk/winui/rc_7x2d.htm
164.40 +
164.41 +#include <winver.h>
164.42 +#include "info_name.h"
164.43 +
164.44 +VS_VERSION_INFO VERSIONINFO
164.45 + FILEVERSION RC_VERS_DWORD
164.46 + PRODUCTVERSION RC_VERS_DWORD
164.47 + FILEFLAGSMASK 0x3fL
164.48 +#ifdef _DEBUG
164.49 + FILEFLAGS VS_FF_DEBUG
164.50 +#else
164.51 + FILEFLAGS 0x0L
164.52 +#endif
164.53 + FILEOS VOS__WINDOWS32
164.54 + FILETYPE VFT_DLL
164.55 + FILESUBTYPE VFT2_UNKNOWN
164.56 +BEGIN
164.57 + BLOCK "StringFileInfo"
164.58 + BEGIN
164.59 + BLOCK "040904b0"
164.60 + BEGIN
164.61 + VALUE "Comments", RC_COMMENTS "\0"
164.62 + VALUE "CompanyName", VAUTHOR "\0"
164.63 + VALUE "FileDescription", RC_DESC "\0"
164.64 + VALUE "FileVersion", VVERSION "\0"
164.65 + VALUE "InternalName", RC_INTERNAL "\0"
164.66 + VALUE "LegalCopyright", RC_COPYRIGHT "\0"
164.67 + VALUE "LegalTrademarks", "\0"
164.68 + VALUE "OriginalFilename", RC_FILENAME "\0"
164.69 + VALUE "PrivateBuild", "\0"
164.70 + VALUE "ProductName", VNAME "\0"
164.71 + VALUE "ProductVersion", VVERSION "\0"
164.72 + VALUE "SpecialBuild", OPT_TYPE "\0"
164.73 + END
164.74 + END
164.75 + BLOCK "VarFileInfo"
164.76 + BEGIN
164.77 + VALUE "Translation", 0x409, 1200
164.78 + END
164.79 +END
165.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
165.2 +++ b/metamod/sdk_util.cpp Tue Apr 06 07:36:14 2004 +0000
165.3 @@ -0,0 +1,143 @@
165.4 +// vi: set ts=4 sw=4 :
165.5 +// vim: set tw=75 :
165.6 +
165.7 +// sdk_util.cpp - utility routines from HL SDK util.cpp
165.8 +
165.9 +// Selected portions of dlls/util.cpp from SDK 2.1.
165.10 +// Functions copied from there as needed...
165.11 +// And modified to avoid buffer overflows (argh).
165.12 +
165.13 +/***
165.14 +*
165.15 +* Copyright (c) 1999, 2000 Valve LLC. All rights reserved.
165.16 +*
165.17 +* This product contains software technology licensed from Id
165.18 +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
165.19 +* All Rights Reserved.
165.20 +*
165.21 +* Use, distribution, and modification of this source code and/or resulting
165.22 +* object code is restricted to non-commercial enhancements to products from
165.23 +* Valve LLC. All other use, distribution, or modification is prohibited
165.24 +* without written permission from Valve LLC.
165.25 +*
165.26 +****/
165.27 +/*
165.28 +
165.29 +===== util.cpp ========================================================
165.30 +
165.31 + Utility code. Really not optional after all.
165.32 +
165.33 +*/
165.34 +
165.35 +#include <extdll.h>
165.36 +#include "sdk_util.h"
165.37 +#include <cbase.h>
165.38 +
165.39 +#include <string.h> // for strncpy(), etc
165.40 +
165.41 +#include "osdep.h" // win32 vsnprintf, etc
165.42 +
165.43 +char* UTIL_VarArgs( char *format, ... )
165.44 +{
165.45 + va_list argptr;
165.46 + static char string[1024];
165.47 +
165.48 + va_start (argptr, format);
165.49 + vsnprintf (string, sizeof(string), format, argptr);
165.50 + va_end (argptr);
165.51 +
165.52 + return string;
165.53 +}
165.54 +
165.55 +
165.56 +//=========================================================
165.57 +// UTIL_LogPrintf - Prints a logged message to console.
165.58 +// Preceded by LOG: ( timestamp ) < message >
165.59 +//=========================================================
165.60 +void UTIL_LogPrintf( char *fmt, ... )
165.61 +{
165.62 + va_list argptr;
165.63 + static char string[1024];
165.64 +
165.65 + va_start ( argptr, fmt );
165.66 + vsnprintf ( string, sizeof(string), fmt, argptr );
165.67 + va_end ( argptr );
165.68 +
165.69 + // Print to server console
165.70 + ALERT( at_logged, "%s", string );
165.71 +}
165.72 +
165.73 +
165.74 +void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms,
165.75 + const char *pMessage)
165.76 +{
165.77 + if ( !pEntity )
165.78 + return;
165.79 +
165.80 + MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, ENT(pEntity->pev) );
165.81 + WRITE_BYTE( TE_TEXTMESSAGE );
165.82 + WRITE_BYTE( textparms.channel & 0xFF );
165.83 +
165.84 + WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) );
165.85 + WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) );
165.86 + WRITE_BYTE( textparms.effect );
165.87 +
165.88 + WRITE_BYTE( textparms.r1 );
165.89 + WRITE_BYTE( textparms.g1 );
165.90 + WRITE_BYTE( textparms.b1 );
165.91 + WRITE_BYTE( textparms.a1 );
165.92 +
165.93 + WRITE_BYTE( textparms.r2 );
165.94 + WRITE_BYTE( textparms.g2 );
165.95 + WRITE_BYTE( textparms.b2 );
165.96 + WRITE_BYTE( textparms.a2 );
165.97 +
165.98 + WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) );
165.99 + WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) );
165.100 + WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) );
165.101 +
165.102 + if ( textparms.effect == 2 )
165.103 + WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) );
165.104 +
165.105 + if ( strlen( pMessage ) < 512 )
165.106 + {
165.107 + WRITE_STRING( pMessage );
165.108 + }
165.109 + else
165.110 + {
165.111 + char tmp[512];
165.112 + strncpy( tmp, pMessage, 511 );
165.113 + tmp[511] = 0;
165.114 + WRITE_STRING( tmp );
165.115 + }
165.116 + MESSAGE_END();
165.117 +}
165.118 +
165.119 +short FixedSigned16( float value, float scale )
165.120 +{
165.121 + int output;
165.122 +
165.123 + output = (int) (value * scale);
165.124 +
165.125 + if ( output > 32767 )
165.126 + output = 32767;
165.127 +
165.128 + if ( output < -32768 )
165.129 + output = -32768;
165.130 +
165.131 + return (short)output;
165.132 +}
165.133 +
165.134 +unsigned short FixedUnsigned16( float value, float scale )
165.135 +{
165.136 + int output;
165.137 +
165.138 + output = (int) (value * scale);
165.139 + if ( output < 0 )
165.140 + output = 0;
165.141 + if ( output > 0xFFFF )
165.142 + output = 0xFFFF;
165.143 +
165.144 + return (unsigned short)output;
165.145 +}
165.146 +
166.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
166.2 +++ b/metamod/sdk_util.h Tue Apr 06 07:36:14 2004 +0000
166.3 @@ -0,0 +1,106 @@
166.4 +// vi: set ts=4 sw=4 :
166.5 +// vim: set tw=75 :
166.6 +
166.7 +// sdk_util.h - wrapper & extension of util.h from HL SDK
166.8 +
166.9 +/*
166.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
166.11 + *
166.12 + * This file is part of Metamod.
166.13 + *
166.14 + * Metamod is free software; you can redistribute it and/or modify it
166.15 + * under the terms of the GNU General Public License as published by the
166.16 + * Free Software Foundation; either version 2 of the License, or (at
166.17 + * your option) any later version.
166.18 + *
166.19 + * Metamod is distributed in the hope that it will be useful, but
166.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
166.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
166.22 + * General Public License for more details.
166.23 + *
166.24 + * You should have received a copy of the GNU General Public License
166.25 + * along with Metamod; if not, write to the Free Software Foundation,
166.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
166.27 + *
166.28 + * In addition, as a special exception, the author gives permission to
166.29 + * link the code of this program with the Half-Life Game Engine ("HL
166.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
166.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
166.32 + * respects for all of the code used other than the HL Engine and MODs
166.33 + * from Valve. If you modify this file, you may extend this exception
166.34 + * to your version of the file, but you are not obligated to do so. If
166.35 + * you do not wish to do so, delete this exception statement from your
166.36 + * version.
166.37 + *
166.38 + */
166.39 +
166.40 +// Wrap util.h from SDK with ifndef/endif, to avoid problems from multiple
166.41 +// inclusions. Dunno why Valve didn't do that in util.h themselves..
166.42 +
166.43 +#ifndef SDK_UTIL_H
166.44 +#define SDK_UTIL_H
166.45 +
166.46 +// We're not including the DBG_EntOfVars and DBG_AssertFunction routines
166.47 +// mentioned in the SDK util.h, so we're going to unset DEBUG here so that
166.48 +// we don't get "unresolved symbol" errors.
166.49 +#ifdef DEBUG
166.50 +#undef DEBUG
166.51 +#endif /* DEBUG */
166.52 +
166.53 +#include <util.h>
166.54 +
166.55 +
166.56 +// Also, create some additional macros for engine callback functions, which
166.57 +// weren't in SDK dlls/enginecallbacks.h but probably should have been.
166.58 +
166.59 +#define GET_INFOKEYBUFFER (*g_engfuncs.pfnGetInfoKeyBuffer)
166.60 +#define INFOKEY_VALUE (*g_engfuncs.pfnInfoKeyValue)
166.61 +#define SET_CLIENT_KEYVALUE (*g_engfuncs.pfnSetClientKeyValue)
166.62 +#define REG_SVR_COMMAND (*g_engfuncs.pfnAddServerCommand)
166.63 +#define SERVER_PRINT (*g_engfuncs.pfnServerPrint)
166.64 +#define SET_SERVER_KEYVALUE (*g_engfuncs.pfnSetKeyValue)
166.65 +
166.66 +// Also, create some nice inlines for engine callback combos.
166.67 +
166.68 +// Get a setinfo value from a player entity.
166.69 +inline char *ENTITY_KEYVALUE(edict_t *entity, char *key) {
166.70 + char *ifbuf=GET_INFOKEYBUFFER(entity);
166.71 + return(INFOKEY_VALUE(ifbuf, key));
166.72 +}
166.73 +
166.74 +// Set a setinfo value for a player entity.
166.75 +inline void ENTITY_SET_KEYVALUE(edict_t *entity, char *key, char *value) {
166.76 + char *ifbuf=GET_INFOKEYBUFFER(entity);
166.77 + SET_CLIENT_KEYVALUE(ENTINDEX(entity), ifbuf, key, value);
166.78 +}
166.79 +
166.80 +// Get a "serverinfo" value.
166.81 +inline char *SERVERINFO(char *key) {
166.82 + edict_t *server=INDEXENT(0);
166.83 + return(ENTITY_KEYVALUE(server, key));
166.84 +}
166.85 +
166.86 +// Set a "serverinfo" value.
166.87 +inline void SET_SERVERINFO(char *key, char *value) {
166.88 + edict_t *server=INDEXENT(0);
166.89 + char *ifbuf=GET_INFOKEYBUFFER(server);
166.90 + SET_SERVER_KEYVALUE(ifbuf, key, value);
166.91 +}
166.92 +
166.93 +// Get a "localinfo" value.
166.94 +inline char *LOCALINFO(char *key) {
166.95 + edict_t *server=NULL;
166.96 + return(ENTITY_KEYVALUE(server, key));
166.97 +}
166.98 +
166.99 +// Set a "localinfo" value.
166.100 +inline void SET_LOCALINFO(char *key, char *value) {
166.101 + edict_t *server=NULL;
166.102 + char *ifbuf=GET_INFOKEYBUFFER(server);
166.103 + SET_SERVER_KEYVALUE(ifbuf, key, value);
166.104 +}
166.105 +
166.106 +short FixedSigned16(float value, float scale);
166.107 +unsigned short FixedUnsigned16(float value, float scale);
166.108 +
166.109 +#endif /* SDK_UTIL_H */
167.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
167.2 +++ b/metamod/studioapi.cpp Tue Apr 06 07:36:14 2004 +0000
167.3 @@ -0,0 +1,98 @@
167.4 +// vi: set ts=4 sw=4 :
167.5 +// vim: set tw=75 :
167.6 +
167.7 +// studio.cpp - player model blending interfaces
167.8 +
167.9 +/*
167.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
167.11 + *
167.12 + * This file is part of Metamod.
167.13 + *
167.14 + * Metamod is free software; you can redistribute it and/or modify it
167.15 + * under the terms of the GNU General Public License as published by the
167.16 + * Free Software Foundation; either version 2 of the License, or (at
167.17 + * your option) any later version.
167.18 + *
167.19 + * Metamod is distributed in the hope that it will be useful, but
167.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
167.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
167.22 + * General Public License for more details.
167.23 + *
167.24 + * You should have received a copy of the GNU General Public License
167.25 + * along with Metamod; if not, write to the Free Software Foundation,
167.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
167.27 + *
167.28 + * In addition, as a special exception, the author gives permission to
167.29 + * link the code of this program with the Half-Life Game Engine ("HL
167.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
167.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
167.32 + * respects for all of the code used other than the HL Engine and MODs
167.33 + * from Valve. If you modify this file, you may extend this exception
167.34 + * to your version of the file, but you are not obligated to do so. If
167.35 + * you do not wish to do so, delete this exception statement from your
167.36 + * version.
167.37 + *
167.38 + */
167.39 +
167.40 +#include <extdll.h> // always
167.41 +// #include <r_studioint.h> //
167.42 +
167.43 +#include "studioapi.h" // me
167.44 +#include "metamod.h" // GameDLL
167.45 +#include "osdep.h" // C_DLLEXPORT, DLSYM
167.46 +#include "log_meta.h" // META_DEBUG
167.47 +
167.48 +// Another GET-API routine, another interface version.
167.49 +//
167.50 +// Added 5/2003 based on information from Leon Hartwig and Alfred Reynolds,
167.51 +// in order to address observed problems with hitboxes not matching between
167.52 +// client and server, in CS and DOD.
167.53 +//
167.54 +// Based around code apparently added to the Engine around 1/2002,
167.55 +// seemingly to address "the old CS hitbox problem", where "the client was
167.56 +// doing custom player model blending and the server had no idea what was
167.57 +// going on".
167.58 +//
167.59 +// http://www.mail-archive.com/[email protected]/msg01224.html
167.60 +// http://www.mail-archive.com/[email protected]/msg02724.html
167.61 +
167.62 +C_DLLEXPORT int Server_GetBlendingInterface(int version,
167.63 + struct sv_blending_interface_s **ppinterface,
167.64 + struct engine_studio_api_s *pstudio,
167.65 + float (*rotationmatrix)[3][4],
167.66 + float (*bonetransform)[MAXSTUDIOBONES][3][4])
167.67 +{
167.68 + static GETBLENDAPI_FN getblend=NULL;
167.69 + static int missing=0;
167.70 +
167.71 + // Note that we're not checking if
167.72 + // (version==SV_BLENDING_INTERFACE_VERSION) because at this point, we
167.73 + // don't really care, as we're not looking at or using the contents of
167.74 + // the function tables; we're only passing them through to the gamedll,
167.75 + // which presumably will check for version match, since it's the one
167.76 + // that cares and actually uses the function tables.
167.77 + //
167.78 + // Return(0) if the gamedll does not provide this routine, and the
167.79 + // Engine will use its own builtin blending. The Engine will report
167.80 + // "Couldn't get server .dll studio model blending interface. Version
167.81 + // mismatch?", but this will only show in "developer" (-dev) mode.
167.82 +
167.83 + META_DEBUG(6, ("called: Server_GetBlendingInterface; version=%d", version));
167.84 + if(missing) {
167.85 + META_DEBUG(6, ("Skipping Server_GetBlendingInterface; was previously found missing"));
167.86 + return(0);
167.87 + }
167.88 + if(!getblend) {
167.89 + META_DEBUG(6, ("Looking up Server_GetBlendingInterface"));
167.90 + getblend = (GETBLENDAPI_FN) DLSYM(GameDLL.handle,
167.91 + "Server_GetBlendingInterface");
167.92 + }
167.93 + if(!getblend) {
167.94 + META_DEBUG(6, ("Couldn't find Server_GetBlendingInterface in game DLL '%s': %s", GameDLL.name, DLERROR()));
167.95 + missing=1;
167.96 + return(0);
167.97 + }
167.98 + META_DEBUG(6, ("Calling Server_GetBlendingInterface"));
167.99 + return((getblend)(version, ppinterface, pstudio, rotationmatrix,
167.100 + bonetransform));
167.101 +}
168.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
168.2 +++ b/metamod/studioapi.h Tue Apr 06 07:36:14 2004 +0000
168.3 @@ -0,0 +1,56 @@
168.4 +// vi: set ts=4 sw=4 :
168.5 +// vim: set tw=75 :
168.6 +
168.7 +// studio.cpp - player model blending interfaces
168.8 +
168.9 +/*
168.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
168.11 + *
168.12 + * This file is part of Metamod.
168.13 + *
168.14 + * Metamod is free software; you can redistribute it and/or modify it
168.15 + * under the terms of the GNU General Public License as published by the
168.16 + * Free Software Foundation; either version 2 of the License, or (at
168.17 + * your option) any later version.
168.18 + *
168.19 + * Metamod is distributed in the hope that it will be useful, but
168.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
168.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
168.22 + * General Public License for more details.
168.23 + *
168.24 + * You should have received a copy of the GNU General Public License
168.25 + * along with Metamod; if not, write to the Free Software Foundation,
168.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
168.27 + *
168.28 + * In addition, as a special exception, the author gives permission to
168.29 + * link the code of this program with the Half-Life Game Engine ("HL
168.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
168.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
168.32 + * respects for all of the code used other than the HL Engine and MODs
168.33 + * from Valve. If you modify this file, you may extend this exception
168.34 + * to your version of the file, but you are not obligated to do so. If
168.35 + * you do not wish to do so, delete this exception statement from your
168.36 + * version.
168.37 + *
168.38 + */
168.39 +
168.40 +#ifndef STUDIOAPI_H
168.41 +#define STUDIOAPI_H
168.42 +
168.43 +#include <studio.h> // MAXSTUDIOBONES
168.44 +
168.45 +// Typedef for Server_GetBlendingInterface() from Eric Smith on the hlcoders
168.46 +// mailing list.
168.47 +typedef int (*GETBLENDAPI_FN) (int version,
168.48 + struct sv_blending_interface_s **ppinterface,
168.49 + struct engine_studio_api_s *pstudio,
168.50 + float (*rotationmatrix)[3][4],
168.51 + float (*bonetransform)[MAXSTUDIOBONES][3][4]);
168.52 +
168.53 +extern int mm_Server_GetBlendingInterface(int version,
168.54 + struct sv_blending_interface_s **ppinterface,
168.55 + struct engine_studio_api_s *pstudio,
168.56 + float (*rotationmatrix)[3][4],
168.57 + float (*bonetransform)[MAXSTUDIOBONES][3][4]);
168.58 +
168.59 +#endif /* STUDIOAPI_H */
169.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
169.2 +++ b/metamod/support_meta.cpp Tue Apr 06 07:36:14 2004 +0000
169.3 @@ -0,0 +1,121 @@
169.4 +// vi: set ts=4 sw=4 :
169.5 +// vim: set tw=75 :
169.6 +
169.7 +// support_meta.cpp - generic support routines
169.8 +
169.9 +/*
169.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
169.11 + *
169.12 + * This file is part of Metamod.
169.13 + *
169.14 + * Metamod is free software; you can redistribute it and/or modify it
169.15 + * under the terms of the GNU General Public License as published by the
169.16 + * Free Software Foundation; either version 2 of the License, or (at
169.17 + * your option) any later version.
169.18 + *
169.19 + * Metamod is distributed in the hope that it will be useful, but
169.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
169.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
169.22 + * General Public License for more details.
169.23 + *
169.24 + * You should have received a copy of the GNU General Public License
169.25 + * along with Metamod; if not, write to the Free Software Foundation,
169.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
169.27 + *
169.28 + * In addition, as a special exception, the author gives permission to
169.29 + * link the code of this program with the Half-Life Game Engine ("HL
169.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
169.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
169.32 + * respects for all of the code used other than the HL Engine and MODs
169.33 + * from Valve. If you modify this file, you may extend this exception
169.34 + * to your version of the file, but you are not obligated to do so. If
169.35 + * you do not wish to do so, delete this exception statement from your
169.36 + * version.
169.37 + *
169.38 + */
169.39 +
169.40 +#include <extdll.h> // always
169.41 +
169.42 +#include <metamod.h> // GameDLL
169.43 +#include "support_meta.h" // me
169.44 +#include "osdep.h" // sleep, etc
169.45 +
169.46 +META_ERRNO meta_errno;
169.47 +
169.48 +void do_exit(int exitval) {
169.49 + sleep(3);
169.50 + exit(exitval);
169.51 +}
169.52 +
169.53 +// Checks for a non-empty file, relative to the gamedir if necessary.
169.54 +// Formerly used LOAD_FILE_FOR_ME, which provided a simple way to check for
169.55 +// a file under the gamedir, but which would _also_ look in the sibling
169.56 +// "valve" directory, thus sometimes finding files that weren't desired.
169.57 +// Also, formerly named just "valid_file".
169.58 +//
169.59 +// Special-case-recognize "/dev/null" as a valid file.
169.60 +int valid_gamedir_file(char *path) {
169.61 + char buf[PATH_MAX];
169.62 + struct stat st;
169.63 + int ret, reg, size;
169.64 +
169.65 + if(!path)
169.66 + return(FALSE);
169.67 +
169.68 + if(strmatch(path, "/dev/null"))
169.69 + return(TRUE);
169.70 +
169.71 + if(is_absolute_path(path))
169.72 + STRNCPY(buf, path, sizeof(buf));
169.73 + else
169.74 + snprintf(buf, sizeof(buf), "%s/%s", GameDLL.gamedir, path);
169.75 +
169.76 + ret=stat(buf, &st);
169.77 + if(ret != 0) {
169.78 + META_DEBUG(5, ("Unable to stat '%s': %s", buf, strerror(errno)));
169.79 + return(FALSE);
169.80 + }
169.81 +
169.82 + reg=S_ISREG(st.st_mode);
169.83 + if(!reg) {
169.84 + META_DEBUG(5, ("Not a regular file: %s", buf));
169.85 + return(FALSE);
169.86 + }
169.87 +
169.88 + size=st.st_size;
169.89 + if(!size) {
169.90 + META_DEBUG(5, ("Empty file: %s", buf));
169.91 + return(FALSE);
169.92 + }
169.93 +
169.94 + if(ret==0 && reg && size)
169.95 + return(TRUE);
169.96 + else
169.97 + return(FALSE);
169.98 +}
169.99 +
169.100 +// Turns path into a full path:
169.101 +// - if not absolute, prepends gamedir
169.102 +// - calls realpath() to collapse ".." and such
169.103 +// - calls normalize_pathname() to fix backslashes, etc
169.104 +//
169.105 +// Much like realpath, buffer pointed to by fullpath is assumed to be
169.106 +// able to store a string of PATH_MAX length.
169.107 +char *full_gamedir_path(const char *path, char *fullpath) {
169.108 + char buf[PATH_MAX];
169.109 +
169.110 + // Build pathname from filename, plus gamedir if relative path.
169.111 + if(is_absolute_path(path))
169.112 + STRNCPY(buf, path, sizeof(buf));
169.113 + else
169.114 + snprintf(buf, sizeof(buf), "%s/%s", GameDLL.gamedir, path);
169.115 + // Remove relative path components, if possible.
169.116 + if(!realpath(buf, fullpath)) {
169.117 + META_DEBUG(4, ("Unable to get realpath for '%s': %s", buf,
169.118 + str_os_error()));
169.119 + STRNCPY(fullpath, path, PATH_MAX);
169.120 + }
169.121 + // Replace backslashes, etc.
169.122 + normalize_pathname(fullpath);
169.123 + return(fullpath);
169.124 +}
170.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
170.2 +++ b/metamod/support_meta.h Tue Apr 06 07:36:14 2004 +0000
170.3 @@ -0,0 +1,148 @@
170.4 +// vi: set ts=4 sw=4 :
170.5 +// vim: set tw=75 :
170.6 +
170.7 +// support_meta.h - generic support macros
170.8 +
170.9 +/*
170.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
170.11 + *
170.12 + * This file is part of Metamod.
170.13 + *
170.14 + * Metamod is free software; you can redistribute it and/or modify it
170.15 + * under the terms of the GNU General Public License as published by the
170.16 + * Free Software Foundation; either version 2 of the License, or (at
170.17 + * your option) any later version.
170.18 + *
170.19 + * Metamod is distributed in the hope that it will be useful, but
170.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
170.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
170.22 + * General Public License for more details.
170.23 + *
170.24 + * You should have received a copy of the GNU General Public License
170.25 + * along with Metamod; if not, write to the Free Software Foundation,
170.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
170.27 + *
170.28 + * In addition, as a special exception, the author gives permission to
170.29 + * link the code of this program with the Half-Life Game Engine ("HL
170.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
170.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
170.32 + * respects for all of the code used other than the HL Engine and MODs
170.33 + * from Valve. If you modify this file, you may extend this exception
170.34 + * to your version of the file, but you are not obligated to do so. If
170.35 + * you do not wish to do so, delete this exception statement from your
170.36 + * version.
170.37 + *
170.38 + */
170.39 +
170.40 +#ifndef SUPPORT_META_H
170.41 +#define SUPPORT_META_H
170.42 +
170.43 +#include <string.h> // strcpy(), strncat()
170.44 +#include <sys/types.h> // stat
170.45 +#include <sys/stat.h> // stat
170.46 +
170.47 +#include "osdep.h" // strcasecmp, S_ISREG,
170.48 +
170.49 +void do_exit(int exitval);
170.50 +
170.51 +// Unlike snprintf(), strncpy() doesn't necessarily null-terminate the
170.52 +// target. It appears the former function reasonably considers the given
170.53 +// size to be "max size of target string" (including the null-terminator),
170.54 +// whereas strncpy() strangely considers the given size to be "total number
170.55 +// of bytes to copy". Note strncpy() _always_ writes n bytes, whereas
170.56 +// snprintf() writes a _max_ of n bytes (incl the NULL). If strncpy()
170.57 +// needs to write extra bytes to reach n, it uses NULLs, so the target
170.58 +// _can_ be null-terminated, but only if the source string would have fit
170.59 +// anyway - in which case why not just use strcpy() instead?
170.60 +//
170.61 +// Thus, it appears strncpy() is not only unsafe, it's also inefficient,
170.62 +// and seemingly no better than plain strcpy() anyway.
170.63 +//
170.64 +// With this logic, strncpy() doesn't appear to be much of a "str" function
170.65 +// at all, IMHO.
170.66 +//
170.67 +// Strncat works better, although it considers the given size to be "number
170.68 +// of bytes to append", and doesn't include the null-terminator in that
170.69 +// count. Thus, we can use it for what we want to do, by setting the
170.70 +// target to zero-length (NULL in first byte), and copying n-1 bytes
170.71 +// (leaving room for the null-termiator).
170.72 +//
170.73 +// Why does it have to be soo haaard...
170.74 +
170.75 +// Also note, some kind of wrapper is necessary to group the two
170.76 +// statements into one, for use in situations like non-braced else
170.77 +// statements.
170.78 +
170.79 +// Technique 1: use "do..while":
170.80 +#if 0
170.81 +#define STRNCPY(dst, src, size) \
170.82 + do { strcpy(dst, "\0"); strncat(dst, src, size-1); } while(0)
170.83 +#endif
170.84 +
170.85 +// Technique 2: use parens and commas:
170.86 +#if 0
170.87 +#define STRNCPY(dst, src, size) \
170.88 + (strcpy(dst, "\0"), strncat(dst, src, size-1))
170.89 +#endif
170.90 +
170.91 +// Technique 3: use inline
170.92 +inline char *STRNCPY(char *dst, const char *src, int size) {
170.93 + strcpy(dst, "\0");
170.94 + return(strncat(dst, src, size-1));
170.95 +}
170.96 +
170.97 +// Renamed string functions to be clearer.
170.98 +inline int strmatch(const char *s1, const char *s2) {
170.99 + if(!s1 || !s2)
170.100 + return(0);
170.101 + else
170.102 + return(!strcmp(s1, s2));
170.103 +}
170.104 +inline int strnmatch(const char *s1, const char *s2, size_t n) {
170.105 + if(!s1 || !s2)
170.106 + return(0);
170.107 + else
170.108 + return(!strncmp(s1, s2, n));
170.109 +}
170.110 +inline int strcasematch(const char *s1, const char *s2) {
170.111 + if(!s1 || !s2)
170.112 + return(0);
170.113 + else
170.114 + return(!strcasecmp(s1, s2));
170.115 +}
170.116 +inline int strncasematch(const char *s1, const char *s2, size_t n) {
170.117 + if(!s1 || !s2)
170.118 + return(0);
170.119 + else
170.120 + return(!strncasecmp(s1, s2, n));
170.121 +}
170.122 +
170.123 +inline int old_valid_file(char *path) {
170.124 + char *cp;
170.125 + int len, ret;
170.126 + cp = (char *) LOAD_FILE_FOR_ME(path, &len);
170.127 + if(cp && len)
170.128 + ret=1;
170.129 + else
170.130 + ret=0;
170.131 + FREE_FILE(cp);
170.132 + return(ret);
170.133 +}
170.134 +int valid_gamedir_file(char *path);
170.135 +char *full_gamedir_path(const char *path, char *fullpath);
170.136 +
170.137 +// Turn a variable/function name into the corresponding string, optionally
170.138 +// stripping off the leading "len" characters. Useful for things like
170.139 +// turning 'pfnClientCommand' into "ClientCommand" so we don't have to
170.140 +// specify strings used for all the debugging/log messages.
170.141 +#define STRINGIZE(name, len) #name+len
170.142 +
170.143 +
170.144 +// Max description length for plugins.ini and other places.
170.145 +#define MAX_DESC_LEN 256
170.146 +
170.147 +
170.148 +// For various character string buffers.
170.149 +#define MAX_STRBUF_LEN 1024
170.150 +
170.151 +#endif /* SUPPORT_META_H */
171.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
171.2 +++ b/metamod/thread_logparse.cpp Tue Apr 06 07:36:14 2004 +0000
171.3 @@ -0,0 +1,377 @@
171.4 +// vi: set ts=4 sw=4 :
171.5 +// vim: set tw=75 :
171.6 +
171.7 +#ifdef UNFINISHED
171.8 +
171.9 +// thread_logparse.cpp - thread to handle log parsing
171.10 +
171.11 +/*
171.12 + * Copyright (c) 2001-2003 Will Day <[email protected]>
171.13 + *
171.14 + * This file is part of Metamod.
171.15 + *
171.16 + * Metamod is free software; you can redistribute it and/or modify it
171.17 + * under the terms of the GNU General Public License as published by the
171.18 + * Free Software Foundation; either version 2 of the License, or (at
171.19 + * your option) any later version.
171.20 + *
171.21 + * Metamod is distributed in the hope that it will be useful, but
171.22 + * WITHOUT ANY WARRANTY; without even the implied warranty of
171.23 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
171.24 + * General Public License for more details.
171.25 + *
171.26 + * You should have received a copy of the GNU General Public License
171.27 + * along with Metamod; if not, write to the Free Software Foundation,
171.28 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
171.29 + *
171.30 + * In addition, as a special exception, the author gives permission to
171.31 + * link the code of this program with the Half-Life Game Engine ("HL
171.32 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
171.33 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
171.34 + * respects for all of the code used other than the HL Engine and MODs
171.35 + * from Valve. If you modify this file, you may extend this exception
171.36 + * to your version of the file, but you are not obligated to do so. If
171.37 + * you do not wish to do so, delete this exception statement from your
171.38 + * version.
171.39 + *
171.40 + */
171.41 +
171.42 +#include <extdll.h> // always
171.43 +
171.44 +#include "thread_logparse.h" // me
171.45 +#include "mqueue.h" // Queue template
171.46 +#include "metamod.h" // Hooks, etc
171.47 +#include "support_meta.h" // do_exit, etc
171.48 +#include "log_meta.h" // META_LOG, etc
171.49 +#include "osdep.h" // THREAD_T, etc
171.50 +
171.51 +
171.52 +// Global queues
171.53 +MLogmsgQueue *LogQueue;
171.54 +MFuncQueue *HookQueue;
171.55 +
171.56 +// thread id; not actually used at present
171.57 +THREAD_T logparse_thread_id;
171.58 +
171.59 +
171.60 +// Start the log parsing thread.
171.61 +void startup_logparse_thread(void) {
171.62 + int ret;
171.63 +
171.64 + LogQueue = new MLogmsgQueue(MAX_QUEUE_SIZE);
171.65 + HookQueue = new MFuncQueue(MAX_QUEUE_SIZE);
171.66 +
171.67 + ret=THREAD_CREATE(&logparse_thread_id, logparse_handler);
171.68 + if(ret != THREAD_OK) {
171.69 + // For now, we just exit if this fails.
171.70 + META_ERROR("Couldn't start thread for log parsing! Exiting...");
171.71 + do_exit(1);
171.72 + }
171.73 +}
171.74 +
171.75 +// The main() routine for the log parsing thread.
171.76 +void WINAPI logparse_handler(void) {
171.77 + const char *msg;
171.78 + event_args_t *evargs;
171.79 + while(1) {
171.80 + // Pull a logmsg from the queue; note that this blocks until a
171.81 + // message is available.
171.82 + msg=LogQueue->pop();
171.83 +
171.84 + // Pre-parse logmsg line for args and to determine some possible
171.85 + // type of event from the logmsg.
171.86 + evargs=parse_event_args(msg);
171.87 +
171.88 + // Match any direct event hooks, as these are fastest.
171.89 + if(evargs && evargs->evtype != EV_NONE)
171.90 + Hooks->enqueue(HookQueue, H_EVENT, evargs, msg);
171.91 +
171.92 + // Match any trigger hooks, as these are less fast.
171.93 + if(evargs && evargs->action)
171.94 + Hooks->enqueue(HookQueue, H_TRIGGER, evargs, msg);
171.95 +
171.96 + // Match any substring hooks, as these are slower.
171.97 + Hooks->enqueue(HookQueue, H_STRING, evargs, msg);
171.98 +
171.99 +#if 0
171.100 + // Match any regex hooks last, as these are slowest.
171.101 + Hooks->enqueue(HookQueue, H_REGEX, evargs, msg);
171.102 +#endif
171.103 + }
171.104 +}
171.105 +
171.106 +// Pre-parse logmsg line for args and to determine some possible type of
171.107 +// event.
171.108 +//
171.109 +// Returns an allocated event_args_t struct, which should be freed by the
171.110 +// main thread after it's no longer needed. Note that this struct gets
171.111 +// passed to (possibly) multiple hooks.
171.112 +event_args_t *parse_event_args(const char *logline) {
171.113 + event_args_t *args;
171.114 + char *cp, *begin, *end;
171.115 + int len;
171.116 +
171.117 + // Create and init the event_args struct.
171.118 + args=(event_args_t *) malloc(sizeof(event_args_t));
171.119 + if(!args)
171.120 + return(NULL);
171.121 + memset(args, 0, sizeof(*args));
171.122 +
171.123 + // Make a copy of the logline, as we're going to be setting NULLs in
171.124 + // the string to mark ends of various substrings.
171.125 + args->buf=strdup(logline);
171.126 + if(!args->buf)
171.127 + return(NULL);
171.128 + cp=args->buf;
171.129 +
171.130 + // Grab the player name and attributes, or "world" or "team" name, ie:
171.131 + // Joe<15><785><CT>
171.132 + // World
171.133 + // Team "CT"
171.134 + args->player=parse_player(cp, &len);
171.135 + cp+=len;
171.136 +
171.137 + // Look for one of several pre-determined actions that we recognize.
171.138 +
171.139 + // ... triggered "some action" ...
171.140 + // ie: "Joe<15><785><CT>" triggered "Killed_A_Hostage"
171.141 + if(strnmatch(cp, "triggered ", 10)) {
171.142 + cp+=10;
171.143 + args->action=parse_quoted(cp, &len);
171.144 + cp+=len;
171.145 + }
171.146 + // ... killed Joe<15><785><CT> ...
171.147 + // ie: "Joe<15><785><CT>" killed "Sam<17><197><TERRORIST>" with "sg552"
171.148 + else if(strnmatch(cp, "killed ", 7)) {
171.149 + cp+=7;
171.150 + args->target=parse_player(cp, &len);
171.151 + if(strmatch(args->player->team, args->target->team)) {
171.152 + args->action="team_kill";
171.153 + args->evtype=EV_TEAM_KILL;
171.154 + }
171.155 + else {
171.156 + args->action="kill";
171.157 + }
171.158 + cp+=len;
171.159 + }
171.160 + // ... committed suicide ...
171.161 + // ie: "Joe<15><785><CT>" committed suicide with "worldspawn"
171.162 + else if(strnmatch(cp, "committed suicide", 17)) {
171.163 + cp+=17;
171.164 + args->action="suicide";
171.165 + cp+=strspn(cp, " ");
171.166 + args->evtype=EV_PLAYER_SUICIDE;
171.167 + }
171.168 + // ... joined team "someteam" ...
171.169 + // ie: "Joe<15><785><>" joined team "CT"
171.170 + else if(strnmatch(cp, "joined team ", 12)) {
171.171 + cp+=12;
171.172 + args->action="join_team";
171.173 + args->target=(event_player_t *) malloc(sizeof(event_player_t));
171.174 + // Note:
171.175 + // old team is in: args->player->team
171.176 + // new team is in: args->target->team
171.177 + if(args->target) {
171.178 + memset(args->target, 0, sizeof(event_player_t));
171.179 + args->target->team=parse_quoted(cp, &len);
171.180 + cp+=len;
171.181 + }
171.182 + args->evtype=EV_PLAYER_JOIN_TEAM;
171.183 + }
171.184 + // ... changed role to "something" ...
171.185 + // from TFC, ie: "Joe<15><785><Red>" changed role to "Pyro"
171.186 + else if(strnmatch(cp, "changed role to ", 16)) {
171.187 + cp+=16;
171.188 + args->action="change_role";
171.189 + // Note:
171.190 + // new role is in: args->with
171.191 + args->with=parse_quoted(cp, &len);
171.192 + cp+=len;
171.193 + args->evtype=EV_PLAYER_CHANGE_ROLE;
171.194 + }
171.195 + // ... scored ...
171.196 + // ie: Team "CT" scored "7" with "2" players
171.197 + else if(strnmatch(cp, "scored ", 7)) {
171.198 + cp+=7;
171.199 + if(args->player && args->player->team && !args->player->name) {
171.200 + args->action="team_score";
171.201 + args->evtype=EV_TEAM_SCORE;
171.202 + }
171.203 + else {
171.204 + args->action="score";
171.205 + }
171.206 + cp+=strspn(cp, " ");
171.207 + }
171.208 + // anything else...
171.209 + // Consider any words up to a quote (") to be the 'action'.
171.210 + else {
171.211 + begin=cp;
171.212 + end=strchr(begin, '"')-1;
171.213 + len=end-begin;
171.214 + if(len > 0) {
171.215 + *end='\0';
171.216 + args->action=begin;
171.217 + cp=end+1;
171.218 + cp+=strspn(cp, " ");
171.219 + }
171.220 + }
171.221 +
171.222 + // Look for associated phrases...
171.223 +
171.224 + // ... against ...
171.225 + // ie: "Joe<15><785><Red>" triggered "Medic_Heal" against "Bob<27><954><Red>"
171.226 + if(strnmatch(cp, "against ", 8)) {
171.227 + cp+=8;
171.228 + args->target=parse_player(cp, &len);
171.229 + cp+=len;
171.230 + }
171.231 +
171.232 + // ... with ...
171.233 + // ie: "Joe<15><785><CT>" killed "Sam<17><197><TERRORIST>" with "sg552"
171.234 + // or: "Joe<15><785><Blue>" triggered "Sentry_Destroyed" against "Sam<17><197><Red>" with "mirvgrenade"
171.235 + if(strnmatch(cp, "with ", 5)) {
171.236 + cp+=5;
171.237 + args->with=parse_quoted(cp, &len);
171.238 + if(strmatch(args->action, "kill")) {
171.239 + args->action="weapon_kill";
171.240 + args->evtype=EV_WEAPON_KILL;
171.241 + }
171.242 + cp+=len;
171.243 + }
171.244 +
171.245 + return(args);
171.246 +}
171.247 +
171.248 +// Parse a player name, userid, wonid, and team,
171.249 +// or a Team name,
171.250 +// or "World".
171.251 +//
171.252 +// Returns an allocated event_player_t struct, which should be freed by the
171.253 +// main thread after it's no longer needed. But note that the strings
171.254 +// contained in the struct refer to the "buf" in the parent event_args_t
171.255 +// and should _not_ be freed directly; instead, the buf itself should be
171.256 +// freed when the event_args_t struct is freed by the main thread.
171.257 +event_player_t *parse_player(char *start, int *retlen) {
171.258 + char *cp, *begin, *end;
171.259 + int len;
171.260 + event_player_t *pl;
171.261 +
171.262 + // Create and init the event_player struct
171.263 + pl=(event_player_t *) malloc(sizeof(event_player_t));
171.264 + if(!pl)
171.265 + return(NULL);
171.266 + memset(pl, 0, sizeof(event_player_t));
171.267 +
171.268 + cp=start;
171.269 + *retlen=0;
171.270 + cp+=strspn(cp, " ");
171.271 +
171.272 + // ... World ...
171.273 + if(strnmatch(cp, "World", 5)) {
171.274 + // store team "World"
171.275 + begin=cp;
171.276 + end=begin+5;
171.277 + len=end-begin;
171.278 +
171.279 + *end='\0';
171.280 + pl->team=begin;
171.281 + *retlen=end-start+strspn(end, " ");
171.282 + return(pl);
171.283 + }
171.284 + // ... Team "TERRORIST" ...
171.285 + else if(strnmatch(cp, "Team ", 5)) {
171.286 + // find team
171.287 + begin=strchr(cp+5, '"')+1;
171.288 + end=strchr(begin, '"');
171.289 + len=end-begin;
171.290 + if(len <= 0)
171.291 + return(pl);
171.292 +
171.293 + // store team
171.294 + *end='\0';
171.295 + pl->team=begin;
171.296 + *retlen=end-start+strspn(end, " ");
171.297 + return(pl);
171.298 + }
171.299 + // ... "Joe<15><785><TERRORIST>" ...
171.300 + else if(cp[0] == '"') {
171.301 + // find player name
171.302 + begin=cp+1;
171.303 + end=strchr(begin, '<');
171.304 + len=end-begin;
171.305 + if(len <= 0) {
171.306 + *retlen=begin-1-start;
171.307 + return(pl);
171.308 + }
171.309 + // store player name
171.310 + *end='\0';
171.311 + pl->name=begin;
171.312 +
171.313 + // find userid
171.314 + begin=end+1;
171.315 + end=strchr(begin, '>');
171.316 + len=end-begin;
171.317 + if(len <= 0) {
171.318 + *retlen=begin-1-start;
171.319 + return(pl);
171.320 + }
171.321 + // store userid
171.322 + *end='\0';
171.323 + pl->userid=atoi(begin);
171.324 +
171.325 + // find wonid
171.326 + begin=strchr(end+1, '<')+1;
171.327 + end=strchr(begin, '>');
171.328 + len=end-begin;
171.329 + if(len <= 0) {
171.330 + *retlen=begin-1-start;
171.331 + return(pl);
171.332 + }
171.333 + // store wonid
171.334 + *end='\0';
171.335 + pl->wonid=atoi(begin);
171.336 +
171.337 + // find team
171.338 + begin=strchr(end+1, '<')+1;
171.339 + end=strchr(begin, '>');
171.340 + len=end-begin;
171.341 + if(len <= 0) {
171.342 + *retlen=begin-1-start;
171.343 + return(pl);
171.344 + }
171.345 + // store team
171.346 + *end='\0';
171.347 + pl->team=begin;
171.348 +
171.349 + *retlen=end-start+strspn(end, " ");
171.350 + return(pl);
171.351 + }
171.352 + else {
171.353 + // No player strings found, so we go ahead and free the struct we
171.354 + // malloc'd at the beginning.
171.355 + free(pl);
171.356 + return(NULL);
171.357 + }
171.358 +}
171.359 +
171.360 +// Parse a quoted string.
171.361 +char *parse_quoted(char *start, int *retlen) {
171.362 + char *cp, *begin, *end;
171.363 + int len;
171.364 +
171.365 + // ... "something" ...
171.366 + cp=start;
171.367 + *retlen=0;
171.368 + cp+=strspn(cp, " ");
171.369 +
171.370 + begin=strchr(cp, '"')+1;
171.371 + end=strchr(begin, '"');
171.372 + len=end-begin;
171.373 + if(len <= 0)
171.374 + return(NULL);
171.375 + *end='\0';
171.376 + *retlen=end-start+strspn(end, " ");
171.377 + return(begin);
171.378 +}
171.379 +
171.380 +#endif /* UNFINISHED */
172.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
172.2 +++ b/metamod/thread_logparse.h Tue Apr 06 07:36:14 2004 +0000
172.3 @@ -0,0 +1,59 @@
172.4 +// vi: set ts=4 sw=4 :
172.5 +// vim: set tw=75 :
172.6 +
172.7 +#ifdef UNFINISHED
172.8 +
172.9 +// thread_logparse.h - prototypes for thread_logparse functions
172.10 +
172.11 +/*
172.12 + * Copyright (c) 2001-2003 Will Day <[email protected]>
172.13 + *
172.14 + * This file is part of Metamod.
172.15 + *
172.16 + * Metamod is free software; you can redistribute it and/or modify it
172.17 + * under the terms of the GNU General Public License as published by the
172.18 + * Free Software Foundation; either version 2 of the License, or (at
172.19 + * your option) any later version.
172.20 + *
172.21 + * Metamod is distributed in the hope that it will be useful, but
172.22 + * WITHOUT ANY WARRANTY; without even the implied warranty of
172.23 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
172.24 + * General Public License for more details.
172.25 + *
172.26 + * You should have received a copy of the GNU General Public License
172.27 + * along with Metamod; if not, write to the Free Software Foundation,
172.28 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
172.29 + *
172.30 + * In addition, as a special exception, the author gives permission to
172.31 + * link the code of this program with the Half-Life Game Engine ("HL
172.32 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
172.33 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
172.34 + * respects for all of the code used other than the HL Engine and MODs
172.35 + * from Valve. If you modify this file, you may extend this exception
172.36 + * to your version of the file, but you are not obligated to do so. If
172.37 + * you do not wish to do so, delete this exception statement from your
172.38 + * version.
172.39 + *
172.40 + */
172.41 +
172.42 +#ifndef THREAD_LOGPARSE_H
172.43 +#define THREAD_LOGPARSE_H
172.44 +
172.45 +#include "mqueue.h" // Queue template
172.46 +#include <osdep.h> // THREAD_T, etc
172.47 +
172.48 +extern MLogmsgQueue *LogQueue;
172.49 +extern MFuncQueue *HookQueue;
172.50 +
172.51 +extern THREAD_T logparse_thread_id;
172.52 +
172.53 +void startup_logparse_thread(void);
172.54 +void WINAPI logparse_handler(void);
172.55 +
172.56 +event_args_t *parse_event_args(const char *logline);
172.57 +event_player_t *parse_player(char *start, int *retlen);
172.58 +char *parse_quoted(char *start, int *retlen);
172.59 +
172.60 +#endif /* THREAD_LOGPARSE_H */
172.61 +
172.62 +#endif /* UNFINISHED */
173.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
173.2 +++ b/metamod/tqueue.h Tue Apr 06 07:36:14 2004 +0000
173.3 @@ -0,0 +1,144 @@
173.4 +// vi: set ts=4 sw=4 :
173.5 +// vim: set tw=75 :
173.6 +
173.7 +#ifdef UNFINISHED
173.8 +
173.9 +// tqueue.h - template classes for Queue and QItem
173.10 +
173.11 +/*
173.12 + * Copyright (c) 2001-2003 Will Day <[email protected]>
173.13 + *
173.14 + * This file is part of Metamod.
173.15 + *
173.16 + * Metamod is free software; you can redistribute it and/or modify it
173.17 + * under the terms of the GNU General Public License as published by the
173.18 + * Free Software Foundation; either version 2 of the License, or (at
173.19 + * your option) any later version.
173.20 + *
173.21 + * Metamod is distributed in the hope that it will be useful, but
173.22 + * WITHOUT ANY WARRANTY; without even the implied warranty of
173.23 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
173.24 + * General Public License for more details.
173.25 + *
173.26 + * You should have received a copy of the GNU General Public License
173.27 + * along with Metamod; if not, write to the Free Software Foundation,
173.28 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
173.29 + *
173.30 + * In addition, as a special exception, the author gives permission to
173.31 + * link the code of this program with the Half-Life Game Engine ("HL
173.32 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
173.33 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
173.34 + * respects for all of the code used other than the HL Engine and MODs
173.35 + * from Valve. If you modify this file, you may extend this exception
173.36 + * to your version of the file, but you are not obligated to do so. If
173.37 + * you do not wish to do so, delete this exception statement from your
173.38 + * version.
173.39 + *
173.40 + */
173.41 +
173.42 +#ifndef TQUEUE_H
173.43 +#define TQUEUE_H
173.44 +
173.45 +#define MAX_QUEUE_SIZE 50
173.46 +
173.47 +#include "osdep.h" // MUTEX_T, etc
173.48 +
173.49 +// Forward declarations.
173.50 +template<class qdata_t> class Queue;
173.51 +
173.52 +// Template for Queue.
173.53 +template<class qdata_t>
173.54 +class Queue {
173.55 + private:
173.56 + // private copy/assign constructors:
173.57 + Queue(const Queue &src);
173.58 + void operator=(const Queue &src);
173.59 + protected:
173.60 + // structs:
173.61 + class QItem {
173.62 + private:
173.63 + // private copy/assign constructors:
173.64 + QItem(const QItem &src);
173.65 + void operator=(const QItem &src);
173.66 + public:
173.67 + qdata_t *data;
173.68 + QItem *next;
173.69 + QItem(void) :data(NULL), next(NULL) { };
173.70 + QItem(qdata_t *dnew) :data(dnew), next(NULL) { };
173.71 + };
173.72 + // data:
173.73 + int size;
173.74 + int max_size;
173.75 + QItem *front;
173.76 + QItem *end;
173.77 + MUTEX_T mx_queue;
173.78 + COND_T cv_push;
173.79 + COND_T cv_pop;
173.80 + //functions
173.81 + int MXlock(void) { return(MUTEX_LOCK(&mx_queue)); };
173.82 + int MXunlock(void) { return(MUTEX_UNLOCK(&mx_queue)); };
173.83 + public:
173.84 + // constructor:
173.85 + Queue(void);
173.86 + Queue(int qmaxsize);
173.87 + // functions:
173.88 + void push(qdata_t *qadd);
173.89 + qdata_t* pop(void);
173.90 +};
173.91 +
173.92 +
173.93 +///// Template Queue:
173.94 +
173.95 +// Queue constructor (default).
173.96 +template<class qdata_t> Queue<qdata_t>::Queue(void)
173.97 + : size(0), max_size(MAX_QUEUE_SIZE), front(NULL), end(NULL), mx_queue(),
173.98 + cv_push(), cv_pop()
173.99 +{
173.100 + MUTEX_INIT(&mx_queue);
173.101 + COND_INIT(&cv_push);
173.102 + COND_INIT(&cv_pop);
173.103 +}
173.104 +
173.105 +// Queue constructor.
173.106 +template<class qdata_t> Queue<qdata_t>::Queue(int qmaxsize)
173.107 + : size(0), max_size(qmaxsize), front(NULL), end(NULL), mx_queue(),
173.108 + cv_push(), cv_pop()
173.109 +{
173.110 + MUTEX_INIT(&mx_queue);
173.111 + COND_INIT(&cv_push);
173.112 + COND_INIT(&cv_pop);
173.113 +}
173.114 +
173.115 +// Push onto the queue (at end).
173.116 +template<class qdata_t> void Queue<qdata_t>::push(qdata_t *qadd) {
173.117 + QItem *qnew;
173.118 + MXlock();
173.119 + while(size >= max_size)
173.120 + COND_WAIT(&cv_push, &mx_queue);
173.121 + qnew = new QItem(qadd);
173.122 + end->next = qnew;
173.123 + end=qnew;
173.124 + size++;
173.125 + MXunlock();
173.126 +}
173.127 +
173.128 +// Pop from queue (from front). Wait for an item to actually be available
173.129 +// on the queue (block until there's something there).
173.130 +template<class qdata_t> qdata_t* Queue<qdata_t>::pop(void) {
173.131 + QItem *qtmp;
173.132 + qdata_t *ret;
173.133 + MXlock();
173.134 + while(!size)
173.135 + COND_WAIT(&cv_pop, &mx_queue);
173.136 + qtmp=front;
173.137 + front=qtmp->next;
173.138 + size--;
173.139 + ret=qtmp->data;
173.140 + delete qtmp;
173.141 + MXunlock();
173.142 + return(ret);
173.143 +}
173.144 +
173.145 +#endif /* TQUEUE_H */
173.146 +
173.147 +#endif /* UNFINISHED */
174.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
174.2 +++ b/metamod/types_meta.h Tue Apr 06 07:36:14 2004 +0000
174.3 @@ -0,0 +1,79 @@
174.4 +// vi: set ts=4 sw=4 :
174.5 +// vim: set tw=75 :
174.6 +
174.7 +// types_meta.h - common internal type, etc definitions
174.8 +
174.9 +/*
174.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
174.11 + *
174.12 + * This file is part of Metamod.
174.13 + *
174.14 + * Metamod is free software; you can redistribute it and/or modify it
174.15 + * under the terms of the GNU General Public License as published by the
174.16 + * Free Software Foundation; either version 2 of the License, or (at
174.17 + * your option) any later version.
174.18 + *
174.19 + * Metamod is distributed in the hope that it will be useful, but
174.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
174.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
174.22 + * General Public License for more details.
174.23 + *
174.24 + * You should have received a copy of the GNU General Public License
174.25 + * along with Metamod; if not, write to the Free Software Foundation,
174.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
174.27 + *
174.28 + * In addition, as a special exception, the author gives permission to
174.29 + * link the code of this program with the Half-Life Game Engine ("HL
174.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
174.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
174.32 + * respects for all of the code used other than the HL Engine and MODs
174.33 + * from Valve. If you modify this file, you may extend this exception
174.34 + * to your version of the file, but you are not obligated to do so. If
174.35 + * you do not wish to do so, delete this exception statement from your
174.36 + * version.
174.37 + *
174.38 + */
174.39 +
174.40 +#ifndef TYPES_META_H
174.41 +#define TYPES_META_H
174.42 +
174.43 +// Our own boolean type, for stricter type matching.
174.44 +typedef enum mBOOL {
174.45 + mFALSE = 0,
174.46 + mTRUE,
174.47 +} mBOOL;
174.48 +
174.49 +// Like C's errno, for our various functions; describes causes of failure
174.50 +// or mFALSE returns.
174.51 +typedef enum {
174.52 + ME_NOERROR = 0,
174.53 + ME_FORMAT, // invalid format
174.54 + ME_COMMENT, // ignored comment
174.55 + ME_ALREADY, // request had already been done
174.56 + ME_DELAYED, // request is delayed
174.57 + ME_NOTALLOWED, // request not allowed
174.58 + ME_SKIPPED, // request is being skipped for whatever reason
174.59 + ME_BADREQ, // invalid request for this <whatever>
174.60 + ME_ARGUMENT, // invalid arguments
174.61 + ME_NULLRESULT, // resulting data was empty or null
174.62 + ME_MAXREACHED, // reached max/limit
174.63 + ME_NOTUNIQ, // not unique (ambigious match)
174.64 + ME_NOTFOUND, // in find operation, match not found
174.65 + ME_NOFILE, // file empty or missing
174.66 + ME_NOMEM, // malloc failed
174.67 + ME_BADMEMPTR, // invalid memory address
174.68 + ME_OSNOTSUP, // OS doesn't support this operation
174.69 + ME_DLOPEN, // failed to open shared lib/dll
174.70 + ME_DLMISSING, // symbol missing in lib/dll
174.71 + ME_DLERROR, // some other error encountered calling functions from dll
174.72 + ME_IFVERSION, // incompatible interface version
174.73 +} META_ERRNO;
174.74 +extern META_ERRNO meta_errno;
174.75 +
174.76 +#define RETURN_ERRNO(retval, errval) \
174.77 + do { meta_errno=errval; return(retval); } while(0)
174.78 +
174.79 +#define RETURN_LOGERR_ERRNO(errargs, retval, errval) \
174.80 + do { META_ERROR errargs ; meta_errno=errval; return(retval); } while(0)
174.81 +
174.82 +#endif /* TYPES_META_H */
175.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
175.2 +++ b/metamod/vdate.cpp Tue Apr 06 07:36:14 2004 +0000
175.3 @@ -0,0 +1,51 @@
175.4 +// vi: set ts=4 sw=4 :
175.5 +// vim: set tw=75 :
175.6 +
175.7 +// vdate.cpp - compile-time version date
175.8 +
175.9 +/*
175.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
175.11 + *
175.12 + * This file is part of Metamod.
175.13 + *
175.14 + * Metamod is free software; you can redistribute it and/or modify it
175.15 + * under the terms of the GNU General Public License as published by the
175.16 + * Free Software Foundation; either version 2 of the License, or (at
175.17 + * your option) any later version.
175.18 + *
175.19 + * Metamod is distributed in the hope that it will be useful, but
175.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
175.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
175.22 + * General Public License for more details.
175.23 + *
175.24 + * You should have received a copy of the GNU General Public License
175.25 + * along with Metamod; if not, write to the Free Software Foundation,
175.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
175.27 + *
175.28 + * In addition, as a special exception, the author gives permission to
175.29 + * link the code of this program with the Half-Life Game Engine ("HL
175.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
175.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
175.32 + * respects for all of the code used other than the HL Engine and MODs
175.33 + * from Valve. If you modify this file, you may extend this exception
175.34 + * to your version of the file, but you are not obligated to do so. If
175.35 + * you do not wish to do so, delete this exception statement from your
175.36 + * version.
175.37 + *
175.38 + */
175.39 +
175.40 +#include "info_name.h" // for VNAME, VVERSION, etc
175.41 +
175.42 +
175.43 +// Grab date/time of compile. The Makefile is set up to recompile this
175.44 +// module before each link, so that this will always indicate the time the
175.45 +// library was compiled and linked.
175.46 +
175.47 +// This is in a separate file from vers_*, so it can be generically used by
175.48 +// multiple projects.
175.49 +
175.50 +char const *COMPILE_TIME=__DATE__ ", " __TIME__;
175.51 +
175.52 +// Include a string for /usr/bin/ident.
175.53 +
175.54 +char const *vstring="$Pg: " VNAME " -- " VVERSION " | " __DATE__ " - " __TIME__ " $";
176.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
176.2 +++ b/metamod/vdate.h Tue Apr 06 07:36:14 2004 +0000
176.3 @@ -0,0 +1,42 @@
176.4 +// vi: set ts=4 sw=4 :
176.5 +// vim: set tw=75 :
176.6 +
176.7 +// vdate.h - compile-time version date
176.8 +
176.9 +/*
176.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
176.11 + *
176.12 + * This file is part of Metamod.
176.13 + *
176.14 + * Metamod is free software; you can redistribute it and/or modify it
176.15 + * under the terms of the GNU General Public License as published by the
176.16 + * Free Software Foundation; either version 2 of the License, or (at
176.17 + * your option) any later version.
176.18 + *
176.19 + * Metamod is distributed in the hope that it will be useful, but
176.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
176.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
176.22 + * General Public License for more details.
176.23 + *
176.24 + * You should have received a copy of the GNU General Public License
176.25 + * along with Metamod; if not, write to the Free Software Foundation,
176.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
176.27 + *
176.28 + * In addition, as a special exception, the author gives permission to
176.29 + * link the code of this program with the Half-Life Game Engine ("HL
176.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
176.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
176.32 + * respects for all of the code used other than the HL Engine and MODs
176.33 + * from Valve. If you modify this file, you may extend this exception
176.34 + * to your version of the file, but you are not obligated to do so. If
176.35 + * you do not wish to do so, delete this exception statement from your
176.36 + * version.
176.37 + *
176.38 + */
176.39 +
176.40 +#ifndef VDATE_H
176.41 +#define VDATE_H
176.42 +
176.43 +extern char const *COMPILE_TIME;
176.44 +
176.45 +#endif /* VDATE_H */
177.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
177.2 +++ b/metamod/vers_meta.h Tue Apr 06 07:36:14 2004 +0000
177.3 @@ -0,0 +1,55 @@
177.4 +// vi: set ts=4 sw=4 :
177.5 +// vim: set tw=75 :
177.6 +
177.7 +// vers_meta.h - version info, intended to be common among DLLs distributed
177.8 +// with metamod.
177.9 +
177.10 +/*
177.11 + * Copyright (c) 2001-2003 Will Day <[email protected]>
177.12 + *
177.13 + * This file is part of Metamod.
177.14 + *
177.15 + * Metamod is free software; you can redistribute it and/or modify it
177.16 + * under the terms of the GNU General Public License as published by the
177.17 + * Free Software Foundation; either version 2 of the License, or (at
177.18 + * your option) any later version.
177.19 + *
177.20 + * Metamod is distributed in the hope that it will be useful, but
177.21 + * WITHOUT ANY WARRANTY; without even the implied warranty of
177.22 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
177.23 + * General Public License for more details.
177.24 + *
177.25 + * You should have received a copy of the GNU General Public License
177.26 + * along with Metamod; if not, write to the Free Software Foundation,
177.27 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
177.28 + *
177.29 + * In addition, as a special exception, the author gives permission to
177.30 + * link the code of this program with the Half-Life Game Engine ("HL
177.31 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
177.32 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
177.33 + * respects for all of the code used other than the HL Engine and MODs
177.34 + * from Valve. If you modify this file, you may extend this exception
177.35 + * to your version of the file, but you are not obligated to do so. If
177.36 + * you do not wish to do so, delete this exception statement from your
177.37 + * version.
177.38 + *
177.39 + */
177.40 +
177.41 +#ifndef VERS_META_H
177.42 +#define VERS_META_H
177.43 +
177.44 +#ifndef OPT_TYPE
177.45 +# if defined(_MSC_VER) && defined(_DEBUG)
177.46 +# define OPT_TYPE "msc debugging"
177.47 +# elif defined(_MSC_VER) && defined(NDEBUG)
177.48 +# define OPT_TYPE "msc optimized"
177.49 +# else
177.50 +# define OPT_TYPE "default"
177.51 +# endif /* _MSC_VER */
177.52 +#endif /* not OPT_TYPE */
177.53 +
177.54 +#define VDATE "2003/11/15"
177.55 +#define VVERSION "1.17"
177.56 +#define RC_VERS_DWORD 1,17,0,0 // Version Windows DLL Resources in res_meta.rc
177.57 +
177.58 +#endif /* VERS_META_H */
178.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
178.2 +++ b/stub_plugin/Config.mak Tue Apr 06 07:36:14 2004 +0000
178.3 @@ -0,0 +1,5 @@
178.4 +MODNAME = stub_mm
178.5 +
178.6 +EXTRA_CFLAGS =
178.7 +
178.8 +SRCFILES = dllapi.cpp engine_api.cpp h_export.cpp meta_api.cpp sdk_util.cpp
179.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
179.2 +++ b/stub_plugin/INFOcvs Tue Apr 06 07:36:14 2004 +0000
179.3 @@ -0,0 +1,6 @@
179.4 +The following files are ususally linked from the ../metamod
179.5 +directory. Since CVS does not allow symbolic links, these
179.6 +files have been copied here. It is to be considered to create
179.7 +links via a makefile or similar mechanism in the future.
179.8 +
179.9 +Makefile
180.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
180.2 +++ b/stub_plugin/Makefile Tue Apr 06 07:36:14 2004 +0000
180.3 @@ -0,0 +1,380 @@
180.4 +# vi: set ts=4 sw=4 :
180.5 +# vim: set tw=75 :
180.6 +
180.7 +# MetaMod makefile
180.8 +# Copyright (c) 2001-2003 Will Day <[email protected]>
180.9 +#
180.10 +# based on the Valve SDK 2.1 Makefile as well as the Makefile
180.11 +# in adminmod by Alfred Reynolds.
180.12 +#
180.13 +# From SDK 2.1 dlls/Makefile:
180.14 +#! Half-Life StandardSDK 2.0 mp_i386.so Makefile for i386 Linux
180.15 +#! April 2000 by Leon Hartwig ([email protected])
180.16 +
180.17 +
180.18 +# NOTE: This is a generic Makefile for metamod and the bundled plugins, and
180.19 +# is symlinked into each subdir. Per-module config statements are in
180.20 +# Config.mak in each subdir.
180.21 +
180.22 +ifdef COMSPEC
180.23 + OS=windows
180.24 +else
180.25 + OS=linux
180.26 +endif
180.27 +
180.28 +#############################################################################
180.29 +# CONFIGURATION
180.30 +#############################################################################
180.31 +
180.32 +# set paths for your environment
180.33 +ifeq "$(OS)" "linux"
180.34 + PATH_WIN=/usr/local/cross-tools/i586-mingw32msvc/bin
180.35 + SDKTOP=$(HOME)/src/hl/hlsdk-2.3
180.36 + INST_DIR=$(HOME)/half-life/cstrike/dlls
180.37 + TEST_DIR=$(HOME)/test/tfc/dlls
180.38 + TST_DIR=$(HOME)/tmp
180.39 +else ## windows
180.40 + PATH_WIN=/gcc-2.95.2-msvcrt/bin
180.41 + SDKTOP=/hlsdk2.3
180.42 + INST_DIR=/hlserver/tfc/dlls
180.43 + TEST_DIR=/hlserver/tfc/dlls
180.44 +endif
180.45 +
180.46 +DLLS_DIR=../dlls
180.47 +SDKSRC=$(SDKTOP)/multiplayer
180.48 +METADIR=../metamod
180.49 +
180.50 +
180.51 +#############################################################################
180.52 +# OS DEPENDENCIES
180.53 +#############################################################################
180.54 +
180.55 +ifeq "$(OS)" "linux"
180.56 + INSTALL=install -m 644
180.57 + LD_WINDLL= PATH=$(PATH_WIN) $(PATH_WIN)/dllwrap
180.58 + TARGET=linux
180.59 + LIBFILE=$(LIBFILE_LINUX)
180.60 + TARGET_FILE=$(TARGET_LINUX)
180.61 +else ## windows
180.62 + INSTALL=cp
180.63 + LD_WINDLL= $(PATH_WIN)/dllwrap
180.64 + TARGET=win32
180.65 + LIBFILE=$(LIBFILE_WIN)
180.66 + TARGET_FILE=$(TARGET_WIN)
180.67 +endif
180.68 +
180.69 +CC_WIN=$(PATH_WIN)/gcc
180.70 +RES_WIN=$(PATH_WIN)/windres
180.71 +OBJDIR_LINUX_OPT=opt.linux
180.72 +OBJDIR_WIN_OPT=opt.win32
180.73 +OBJDIR_LINUX_DBG=debug.linux
180.74 +OBJDIR_WIN_DBG=debug.win32
180.75 +
180.76 +
180.77 +#############################################################################
180.78 +# COMPILE OPTIONS
180.79 +#############################################################################
180.80 +
180.81 +# original safe optimization, from valve Makefile
180.82 +#CCOPT = -O2 -ffast-math -funroll-loops \
180.83 +# -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
180.84 +# -malign-jumps=2 -malign-functions=2
180.85 +
180.86 +# safe optimization, adapted from adminmod Makefile
180.87 +#CCOPT = -m486 -O6 -ffast-math -funroll-loops \
180.88 +# -fexpensive-optimizations -malign-loops=2 -malign-jumps=2 \
180.89 +# -malign-functions=2 -Wall
180.90 +
180.91 +# full optimization, adapted from adminmod Makefile
180.92 +# "WONT WORK WITH omit-frame-pointer"?
180.93 +# - disable (unneeded) C++ exceptions and rtti code to save some space ?
180.94 +CCOPT = -march=i586 $(CCO) -ffast-math -funroll-loops \
180.95 + -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
180.96 + -malign-jumps=2 -malign-functions=2 -fno-exceptions -fno-rtti -s
180.97 +
180.98 +# optimization level; overridden for certain problematic files
180.99 +CCO = -O6
180.100 +
180.101 +# debugging; halt on warnings
180.102 +CCDEBUG+= -ggdb3
180.103 +
180.104 +
180.105 +#############################################################################
180.106 +# COMPILE SETUP
180.107 +#############################################################################
180.108 +
180.109 +CC=gcc-2.95
180.110 +
180.111 +SRCDIR=.
180.112 +INCLUDEDIRS=-I$(SRCDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/pm_shared -I$(SDKSRC)/dlls -I$(SDKSRC)
180.113 +FILES_ALL = *.cpp *.h [A-Z]* *.rc
180.114 +
180.115 +CFLAGS=-Wall -Wno-unknown-pragmas
180.116 +#CFLAGS += -DTEST
180.117 +
180.118 +ifeq "$(USER)" "willday"
180.119 + # extra warnings
180.120 + CFLAGS+=-W -Wundef \
180.121 + -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align \
180.122 + -Wconversion -Wsign-compare \
180.123 + -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \
180.124 + -Wmissing-noreturn -Wnested-externs -Winline \
180.125 + -Wlong-long
180.126 + # extra C++ warnings
180.127 + CFLAGS+=-Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder \
180.128 + -Woverloaded-virtual -Wsign-promo -Wsynth -Weffc++
180.129 + # undesired warnings
180.130 + #CFLAGS+=-pedantic -Waggregate-return -Wredundant-decls -Wtraditional
180.131 + # to help debugging; requires edited SDK
180.132 + CCDEBUG+=-Werror
180.133 + # link against older libc for compatibility
180.134 + EXTRA_LINK = -L../priv/libc -lc
180.135 +endif
180.136 +
180.137 +ifeq "$(OPT)" "opt"
180.138 + ODEF = -DOPT_TYPE=\"optimized\"
180.139 + CFLAGS := $(CCOPT) $(CFLAGS) $(ODEF)
180.140 + OBJDIR_LINUX = $(OBJDIR_LINUX_OPT)
180.141 + OBJDIR_WIN = $(OBJDIR_WIN_OPT)
180.142 +else # debug
180.143 + ODEF = -DOPT_TYPE=\"debugging\"
180.144 + CFLAGS := $(CCDEBUG) $(CFLAGS) $(ODEF)
180.145 + OBJDIR_LINUX = $(OBJDIR_LINUX_DBG)
180.146 + OBJDIR_WIN = $(OBJDIR_WIN_DBG)
180.147 + DLLS_DIR := $(DLLS_DIR)/debug
180.148 +endif
180.149 +
180.150 +include Config.mak
180.151 +# any local CFLAGS from Config.mak
180.152 +CFLAGS += $(EXTRA_CFLAGS)
180.153 +
180.154 +# ignore complaints from SDK files like cbase.h
180.155 +$(OBJDIR_LINUX)/sdk_util.o $(OBJDIR_WIN)/sdk_util.o: CFLAGS += -Wno-unused
180.156 +
180.157 +# ignore complaints from STL headers
180.158 +STLOBJ = $(STLFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
180.159 +STLOBJ += $(STLFILES:%.cpp=$(OBJDIR_WIN)/%.o)
180.160 +#$(OBJDIR_LINUX)/mreg.o $(OBJDIR_WIN)/mreg.o: CFLAGS += -Wno-effc++
180.161 +$(STLOBJ): FILTER= 2>&1 | ../tools/stlfilter
180.162 +$(STLOBJ): CFLAGS += -Wno-error
180.163 +
180.164 +# these files seem to create "Internal compiler error" errors under mingw
180.165 +# when using -O6
180.166 +#$(OBJDIR_WIN)/engine_api.o: CCO = -O5
180.167 +#$(OBJDIR_WIN)/dllapi_api.o: CCO = -O5
180.168 +
180.169 +#############################################################################
180.170 +# BUILDING LINUX SO
180.171 +#############################################################################
180.172 +
180.173 +# linux .so compile commands
180.174 +DO_CC_LINUX=$(CC) $(CFLAGS) -fPIC $(INCLUDEDIRS) -o $@ -c $< $(FILTER)
180.175 +LINK_LINUX=$(CC) $(CFLAGS) -shared -ldl -lm $(EXTRA_LINK) $(OBJ_LINUX) -o $@
180.176 +
180.177 +# sort by date
180.178 +ifeq "$(OS)" "linux"
180.179 +SRCFILES := $(shell ls -t $(SRCFILES))
180.180 +endif
180.181 +# linux object files
180.182 +OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
180.183 +
180.184 +# compiling linux object files
180.185 +$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.cpp
180.186 + $(DO_CC_LINUX)
180.187 +
180.188 +# linux .so target file
180.189 +LIBFILE_LINUX = $(MODNAME)_i386.so
180.190 +TARGET_LINUX = $(OBJDIR_LINUX)/$(LIBFILE_LINUX)
180.191 +
180.192 +
180.193 +#############################################################################
180.194 +# BUILDING WINDOWS DLL
180.195 +#############################################################################
180.196 +
180.197 +# windows .dll compile commands
180.198 +DO_CC_WIN=$(CC_WIN) $(CFLAGS) $(INCLUDEDIRS) -o $@ -c $<
180.199 +DO_RES_WIN=$(RES_WIN) '$(ODEF)' --include-dir . --include-dir ../metamod -i $< -O coff -o $@
180.200 +#LINK_WIN=$(LD_WINDLL) -k -mwindows --add-stdcall-alias --def metamod.def -o $@ $(OBJ_WIN)
180.201 +#LINK_WIN=$(LD_WINDLL) -A -k -mwindows --export-all-symbols -o $@ $(OBJ_WIN)
180.202 +LINK_WIN=$(LD_WINDLL) -mwindows --add-stdcall-alias $(OBJ_WIN) $(RES_OBJ_WIN) -o $@
180.203 +
180.204 +# windows object files
180.205 +OBJ_WIN := $(SRCFILES:%.cpp=$(OBJDIR_WIN)/%.o)
180.206 +RES_OBJ_WIN := $(RESFILE:%.rc=$(OBJDIR_WIN)/%.o)
180.207 +
180.208 +# compiling windows object files
180.209 +$(OBJDIR_WIN)/%.o: $(SRCDIR)/%.cpp
180.210 + $(DO_CC_WIN)
180.211 +
180.212 +# compiling windows resource file
180.213 +$(OBJDIR_WIN)/%.o: $(SRCDIR)/%.rc $(INFOFILES)
180.214 + $(DO_RES_WIN)
180.215 +
180.216 +# windows .dll target file
180.217 +LIBFILE_WIN = $(MODNAME).dll
180.218 +TARGET_WIN = $(OBJDIR_WIN)/$(LIBFILE_WIN)
180.219 +
180.220 +
180.221 +#############################################################################
180.222 +# OVERRIDES
180.223 +#############################################################################
180.224 +
180.225 +ifeq "$(PLATFORM)" "linux-only"
180.226 + LIBFILE_WIN =
180.227 + TARGET_WIN =
180.228 +endif
180.229 +ifeq "$(PLATFORM)" "win32-only"
180.230 + LIBFILE_LINUX =
180.231 + TARGET_LINUX =
180.232 + TARGET=win32
180.233 + LIBFILE=$(LIBFILE_WIN)
180.234 + TARGET_FILE=$(TARGET_WIN)
180.235 +endif
180.236 +
180.237 +
180.238 +#############################################################################
180.239 +# BUILD RULES
180.240 +#############################################################################
180.241 +
180.242 +default: $(TARGET_FILE)
180.243 +
180.244 +ifeq "$(USER)" "willday"
180.245 +include ../priv/metamod.mak
180.246 +endif
180.247 +
180.248 +all: do_dll_linux do_dll_win32
180.249 +
180.250 +opt:
180.251 + $(MAKE) default OPT=opt
180.252 +
180.253 +linux: do_dll_linux
180.254 +win32: do_dll_win32
180.255 +
180.256 +linux_opt:
180.257 + $(MAKE) linux OPT=opt
180.258 +win32_opt:
180.259 + $(MAKE) win32 OPT=opt
180.260 +
180.261 +$(TARGET_LINUX): msgs/debug msgs/log msgs/error $(OBJDIR_LINUX) $(OBJ_LINUX)
180.262 + $(LINK_LINUX)
180.263 +
180.264 +# for plugins, recompile meta_api.cpp if info_name.h changed
180.265 +$(OBJDIR_LINUX)/meta_api.o $(OBJDIR_WIN)/meta_api.o: info_name.h
180.266 +
180.267 +ifeq "$(USER)" "willday"
180.268 +$(TARGET_LINUX): .tags .htags
180.269 +endif
180.270 +
180.271 +$(TARGET_WIN): $(OBJDIR_WIN) $(OBJ_WIN) $(RES_OBJ_WIN)
180.272 + $(LINK_WIN)
180.273 +
180.274 +$(OBJDIR_LINUX) $(OBJDIR_WIN) msgs:
180.275 + mkdir $@
180.276 +
180.277 +# make sure to recompile vdate.c for each link
180.278 +$(OBJDIR_LINUX)/vdate.o $(OBJDIR_WIN)/vdate.o : $(SRCFILES) *.h
180.279 +
180.280 +domsgs: msgs/debug msgs/log msgs/error
180.281 +
180.282 +msgs/debug: $(SRCFILES) *.h msgs
180.283 + egrep "DEBUG\([0-9]" $(SRCFILES) *.h | sed "s/:[ ]*/ /" | sort -k2,2 > $@
180.284 +
180.285 +msgs/log: $(SRCFILES) *.h msgs
180.286 + egrep "META_LOG\(" $(SRCFILES) *.h | sed "s/:[ ]*/ /" | sort > $@
180.287 +
180.288 +msgs/error: $(SRCFILES) *.h msgs
180.289 + egrep "META_ERROR\(" $(SRCFILES) *.h | sed "s/:[ ]*/ /" | sort > $@
180.290 +
180.291 +tags: .tags .htags
180.292 +ctags: .tags
180.293 +htags: .htags
180.294 +
180.295 +.tags: $(SRCFILES) *.h
180.296 + -ctags -a $?
180.297 +
180.298 +.htags: *.h
180.299 + -htags $?
180.300 +
180.301 +retags:
180.302 + -rm -f .tags .htags
180.303 + ctags -f .tags `find $(SDKSRC) -name '*.h'`
180.304 + ctags -f .tags -a `find $(METADIR) -name old -prune -o -name '*.h' -print`
180.305 + ctags -f .tags -a $(SRCFILES)
180.306 + htags -R $(SDKSRC)
180.307 + htags `find $(METADIR) -name old -prune -o -name '*.h' -print`
180.308 + htags *.h
180.309 +
180.310 +clean: clean_$(TARGET)
180.311 +
180.312 +clean_linux:
180.313 + test -n "$(OBJDIR_LINUX)"
180.314 + -rm -f $(OBJDIR_LINUX)/*
180.315 +
180.316 +clean_win32:
180.317 + test -n "$(OBJDIR_WIN)"
180.318 + -rm -f $(OBJDIR_WIN)/*
180.319 +
180.320 +cleanall_linux:
180.321 + $(MAKE) clean_linux
180.322 + $(MAKE) clean_linux OPT=opt
180.323 +
180.324 +cleanall_win32:
180.325 + $(MAKE) clean_win32
180.326 + $(MAKE) clean_win32 OPT=opt
180.327 +
180.328 +cleanall: cleanall_linux cleanall_win32
180.329 +
180.330 +dll_linux dll_win32:
180.331 + $(MAKE) do_$@
180.332 + $(MAKE) do_$@ OPT=opt
180.333 +
180.334 +do_dll_linux: $(DLLS_DIR) $(DLLS_DIR)/$(LIBFILE_LINUX)
180.335 +do_dll_win32: $(DLLS_DIR) $(DLLS_DIR)/$(LIBFILE_WIN)
180.336 +
180.337 +$(DLLS_DIR):
180.338 + mkdir $(DLLS_DIR)
180.339 +
180.340 +$(DLLS_DIR)/$(LIBFILE_LINUX): $(TARGET_LINUX)
180.341 + $(INSTALL) $+ $@
180.342 +
180.343 +$(DLLS_DIR)/$(LIBFILE_WIN): $(TARGET_WIN)
180.344 + $(INSTALL) $+ $@
180.345 +
180.346 +dlls: dll_linux dll_win32
180.347 +rmdlls:
180.348 + -rm -f ../dlls/*.* ../dlls/debug/*.*
180.349 +
180.350 +spotless: cleanall
180.351 + -rmdir $(OBJDIR_LINUX) $(OBJDIR_WIN)
180.352 + -rm -f .snap $(GENERATED)
180.353 +
180.354 +distclean: spotless
180.355 +
180.356 +install: $(INST_DIR)/$(LIBFILE)
180.357 +test: $(TEST_DIR)/$(LIBFILE)
180.358 +test_opt:
180.359 + $(MAKE) test OPT=opt
180.360 +
180.361 +$(INST_DIR)/$(LIBFILE) $(TEST_DIR)/$(LIBFILE): $(TARGET_FILE)
180.362 + $(INSTALL) $< $@
180.363 +
180.364 +tst: $(TST_DIR)/$(LIBFILE_WIN)
180.365 +
180.366 +$(TST_DIR)/$(LIBFILE_WIN): $(TARGET_WIN)
180.367 + cp $< $@
180.368 +
180.369 +snap: .snap
180.370 +
180.371 +.snap: $(FILES_ALL)
180.372 + mkdir -p snapshots
180.373 + tar zcvf snapshots/`date '+%m%d-%H%M'`.tgz $(FILES_ALL)
180.374 + touch .snap
180.375 +
180.376 +depend: Rules.depend
180.377 +
180.378 +ifeq "$(OS)" "linux"
180.379 +Rules.depend: $(SRCFILES)
180.380 + $(CC) -MM $(INCLUDEDIRS) $(SRCFILES) | sed "s;\(^[^ ]*\):\(.*\);$(OBJDIR_LINUX)/\1 $(OBJDIR_WIN)/\1: \2;" > $@
180.381 +endif
180.382 +
180.383 +include Rules.depend
181.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
181.2 +++ b/stub_plugin/Rules.depend Tue Apr 06 07:36:14 2004 +0000
181.3 @@ -0,0 +1,6 @@
181.4 +debug.linux/engine_api.o debug.win32/engine_api.o: engine_api.cpp
181.5 +debug.linux/meta_api.o debug.win32/meta_api.o: meta_api.cpp
181.6 +debug.linux/sdk_util.o debug.win32/sdk_util.o: sdk_util.cpp ../metamod/osdep.h ../metamod/types_meta.h \
181.7 + ../metamod/mreg.h ../metamod/log_meta.h ../metamod/sdk_util.h
181.8 +debug.linux/dllapi.o debug.win32/dllapi.o: dllapi.cpp
181.9 +debug.linux/h_export.o debug.win32/h_export.o: h_export.cpp
182.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
182.2 +++ b/stub_plugin/dllapi.cpp Tue Apr 06 07:36:14 2004 +0000
182.3 @@ -0,0 +1,119 @@
182.4 +// vi: set ts=4 sw=4 :
182.5 +// vim: set tw=75 :
182.6 +
182.7 +/*
182.8 + * Copyright (c) 2001-2003 Will Day <[email protected]>
182.9 + *
182.10 + * This file is part of Metamod.
182.11 + *
182.12 + * Metamod is free software; you can redistribute it and/or modify it
182.13 + * under the terms of the GNU General Public License as published by the
182.14 + * Free Software Foundation; either version 2 of the License, or (at
182.15 + * your option) any later version.
182.16 + *
182.17 + * Metamod is distributed in the hope that it will be useful, but
182.18 + * WITHOUT ANY WARRANTY; without even the implied warranty of
182.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
182.20 + * General Public License for more details.
182.21 + *
182.22 + * You should have received a copy of the GNU General Public License
182.23 + * along with Metamod; if not, write to the Free Software Foundation,
182.24 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
182.25 + *
182.26 + * In addition, as a special exception, the author gives permission to
182.27 + * link the code of this program with the Half-Life Game Engine ("HL
182.28 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
182.29 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
182.30 + * respects for all of the code used other than the HL Engine and MODs
182.31 + * from Valve. If you modify this file, you may extend this exception
182.32 + * to your version of the file, but you are not obligated to do so. If
182.33 + * you do not wish to do so, delete this exception statement from your
182.34 + * version.
182.35 + *
182.36 + */
182.37 +
182.38 +#include <extdll.h>
182.39 +
182.40 +#include <dllapi.h>
182.41 +#include <meta_api.h>
182.42 +
182.43 +static DLL_FUNCTIONS gFunctionTable =
182.44 +{
182.45 + NULL, // pfnGameInit
182.46 + NULL, // pfnSpawn
182.47 + NULL, // pfnThink
182.48 + NULL, // pfnUse
182.49 + NULL, // pfnTouch
182.50 + NULL, // pfnBlocked
182.51 + NULL, // pfnKeyValue
182.52 + NULL, // pfnSave
182.53 + NULL, // pfnRestore
182.54 + NULL, // pfnSetAbsBox
182.55 +
182.56 + NULL, // pfnSaveWriteFields
182.57 + NULL, // pfnSaveReadFields
182.58 +
182.59 + NULL, // pfnSaveGlobalState
182.60 + NULL, // pfnRestoreGlobalState
182.61 + NULL, // pfnResetGlobalState
182.62 +
182.63 + NULL, // pfnClientConnect
182.64 + NULL, // pfnClientDisconnect
182.65 + NULL, // pfnClientKill
182.66 + NULL, // pfnClientPutInServer
182.67 + NULL, // pfnClientCommand
182.68 + NULL, // pfnClientUserInfoChanged
182.69 + NULL, // pfnServerActivate
182.70 + NULL, // pfnServerDeactivate
182.71 +
182.72 + NULL, // pfnPlayerPreThink
182.73 + NULL, // pfnPlayerPostThink
182.74 +
182.75 + NULL, // pfnStartFrame
182.76 + NULL, // pfnParmsNewLevel
182.77 + NULL, // pfnParmsChangeLevel
182.78 +
182.79 + NULL, // pfnGetGameDescription
182.80 + NULL, // pfnPlayerCustomization
182.81 +
182.82 + NULL, // pfnSpectatorConnect
182.83 + NULL, // pfnSpectatorDisconnect
182.84 + NULL, // pfnSpectatorThink
182.85 +
182.86 + NULL, // pfnSys_Error
182.87 +
182.88 + NULL, // pfnPM_Move
182.89 + NULL, // pfnPM_Init
182.90 + NULL, // pfnPM_FindTextureType
182.91 +
182.92 + NULL, // pfnSetupVisibility
182.93 + NULL, // pfnUpdateClientData
182.94 + NULL, // pfnAddToFullPack
182.95 + NULL, // pfnCreateBaseline
182.96 + NULL, // pfnRegisterEncoders
182.97 + NULL, // pfnGetWeaponData
182.98 + NULL, // pfnCmdStart
182.99 + NULL, // pfnCmdEnd
182.100 + NULL, // pfnConnectionlessPacket
182.101 + NULL, // pfnGetHullBounds
182.102 + NULL, // pfnCreateInstancedBaselines
182.103 + NULL, // pfnInconsistentFile
182.104 + NULL, // pfnAllowLagCompensation
182.105 +};
182.106 +
182.107 +C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable,
182.108 + int *interfaceVersion)
182.109 +{
182.110 + if(!pFunctionTable) {
182.111 + UTIL_LogPrintf("GetEntityAPI2 called with null pFunctionTable");
182.112 + return(FALSE);
182.113 + }
182.114 + else if(*interfaceVersion != INTERFACE_VERSION) {
182.115 + UTIL_LogPrintf("GetEntityAPI2 version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION);
182.116 + //! Tell metamod what version we had, so it can figure out who is out of date.
182.117 + *interfaceVersion = INTERFACE_VERSION;
182.118 + return(FALSE);
182.119 + }
182.120 + memcpy(pFunctionTable, &gFunctionTable, sizeof(DLL_FUNCTIONS));
182.121 + return(TRUE);
182.122 +}
185.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
185.2 +++ b/stub_plugin/engine_api.cpp Tue Apr 06 07:36:14 2004 +0000
185.3 @@ -0,0 +1,259 @@
185.4 +// vi: set ts=4 sw=4 :
185.5 +// vim: set tw=75 :
185.6 +
185.7 +/*
185.8 + * Copyright (c) 2001-2003 Will Day <[email protected]>
185.9 + *
185.10 + * This file is part of Metamod.
185.11 + *
185.12 + * Metamod is free software; you can redistribute it and/or modify it
185.13 + * under the terms of the GNU General Public License as published by the
185.14 + * Free Software Foundation; either version 2 of the License, or (at
185.15 + * your option) any later version.
185.16 + *
185.17 + * Metamod is distributed in the hope that it will be useful, but
185.18 + * WITHOUT ANY WARRANTY; without even the implied warranty of
185.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
185.20 + * General Public License for more details.
185.21 + *
185.22 + * You should have received a copy of the GNU General Public License
185.23 + * along with Metamod; if not, write to the Free Software Foundation,
185.24 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
185.25 + *
185.26 + * In addition, as a special exception, the author gives permission to
185.27 + * link the code of this program with the Half-Life Game Engine ("HL
185.28 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
185.29 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
185.30 + * respects for all of the code used other than the HL Engine and MODs
185.31 + * from Valve. If you modify this file, you may extend this exception
185.32 + * to your version of the file, but you are not obligated to do so. If
185.33 + * you do not wish to do so, delete this exception statement from your
185.34 + * version.
185.35 + *
185.36 + */
185.37 +
185.38 +#include <extdll.h>
185.39 +
185.40 +#include <meta_api.h>
185.41 +
185.42 +enginefuncs_t meta_engfuncs =
185.43 +{
185.44 + NULL, // pfnPrecacheModel()
185.45 + NULL, // pfnPrecacheSound()
185.46 + NULL, // pfnSetModel()
185.47 + NULL, // pfnModelIndex()
185.48 + NULL, // pfnModelFrames()
185.49 +
185.50 + NULL, // pfnSetSize()
185.51 + NULL, // pfnChangeLevel()
185.52 + NULL, // pfnGetSpawnParms()
185.53 + NULL, // pfnSaveSpawnParms()
185.54 +
185.55 + NULL, // pfnVecToYaw()
185.56 + NULL, // pfnVecToAngles()
185.57 + NULL, // pfnMoveToOrigin()
185.58 + NULL, // pfnChangeYaw()
185.59 + NULL, // pfnChangePitch()
185.60 +
185.61 + NULL, // pfnFindEntityByString()
185.62 + NULL, // pfnGetEntityIllum()
185.63 + NULL, // pfnFindEntityInSphere()
185.64 + NULL, // pfnFindClientInPVS()
185.65 + NULL, // pfnEntitiesInPVS()
185.66 +
185.67 + NULL, // pfnMakeVectors()
185.68 + NULL, // pfnAngleVectors()
185.69 +
185.70 + NULL, // pfnCreateEntity()
185.71 + NULL, // pfnRemoveEntity()
185.72 + NULL, // pfnCreateNamedEntity()
185.73 +
185.74 + NULL, // pfnMakeStatic()
185.75 + NULL, // pfnEntIsOnFloor()
185.76 + NULL, // pfnDropToFloor()
185.77 +
185.78 + NULL, // pfnWalkMove()
185.79 + NULL, // pfnSetOrigin()
185.80 +
185.81 + NULL, // pfnEmitSound()
185.82 + NULL, // pfnEmitAmbientSound()
185.83 +
185.84 + NULL, // pfnTraceLine()
185.85 + NULL, // pfnTraceToss()
185.86 + NULL, // pfnTraceMonsterHull()
185.87 + NULL, // pfnTraceHull()
185.88 + NULL, // pfnTraceModel()
185.89 + NULL, // pfnTraceTexture()
185.90 + NULL, // pfnTraceSphere()
185.91 + NULL, // pfnGetAimVector()
185.92 +
185.93 + NULL, // pfnServerCommand()
185.94 + NULL, // pfnServerExecute()
185.95 + NULL, // pfnClientCommand()
185.96 +
185.97 + NULL, // pfnParticleEffect()
185.98 + NULL, // pfnLightStyle()
185.99 + NULL, // pfnDecalIndex()
185.100 + NULL, // pfnPointContents()
185.101 +
185.102 + NULL, // pfnMessageBegin()
185.103 + NULL, // pfnMessageEnd()
185.104 +
185.105 + NULL, // pfnWriteByte()
185.106 + NULL, // pfnWriteChar()
185.107 + NULL, // pfnWriteShort()
185.108 + NULL, // pfnWriteLong()
185.109 + NULL, // pfnWriteAngle()
185.110 + NULL, // pfnWriteCoord()
185.111 + NULL, // pfnWriteString()
185.112 + NULL, // pfnWriteEntity()
185.113 +
185.114 + NULL, // pfnCVarRegister()
185.115 + NULL, // pfnCVarGetFloat()
185.116 + NULL, // pfnCVarGetString()
185.117 + NULL, // pfnCVarSetFloat()
185.118 + NULL, // pfnCVarSetString()
185.119 +
185.120 + NULL, // pfnAlertMessage()
185.121 + NULL, // pfnEngineFprintf()
185.122 +
185.123 + NULL, // pfnPvAllocEntPrivateData()
185.124 + NULL, // pfnPvEntPrivateData()
185.125 + NULL, // pfnFreeEntPrivateData()
185.126 +
185.127 + NULL, // pfnSzFromIndex()
185.128 + NULL, // pfnAllocString()
185.129 +
185.130 + NULL, // pfnGetVarsOfEnt()
185.131 + NULL, // pfnPEntityOfEntOffset()
185.132 + NULL, // pfnEntOffsetOfPEntity()
185.133 + NULL, // pfnIndexOfEdict()
185.134 + NULL, // pfnPEntityOfEntIndex()
185.135 + NULL, // pfnFindEntityByVars()
185.136 + NULL, // pfnGetModelPtr()
185.137 +
185.138 + NULL, // pfnRegUserMsg()
185.139 +
185.140 + NULL, // pfnAnimationAutomove()
185.141 + NULL, // pfnGetBonePosition()
185.142 +
185.143 + NULL, // pfnFunctionFromName()
185.144 + NULL, // pfnNameForFunction()
185.145 +
185.146 + NULL, // pfnClientPrintf()
185.147 + NULL, // pfnServerPrint()
185.148 +
185.149 + NULL, // pfnCmd_Args()
185.150 + NULL, // pfnCmd_Argv()
185.151 + NULL, // pfnCmd_Argc()
185.152 +
185.153 + NULL, // pfnGetAttachment()
185.154 +
185.155 + NULL, // pfnCRC32_Init()
185.156 + NULL, // pfnCRC32_ProcessBuffer()
185.157 + NULL, // pfnCRC32_ProcessByte()
185.158 + NULL, // pfnCRC32_Final()
185.159 +
185.160 + NULL, // pfnRandomLong()
185.161 + NULL, // pfnRandomFloat()
185.162 +
185.163 + NULL, // pfnSetView()
185.164 + NULL, // pfnTime()
185.165 + NULL, // pfnCrosshairAngle()
185.166 +
185.167 + NULL, // pfnLoadFileForMe()
185.168 + NULL, // pfnFreeFile()
185.169 +
185.170 + NULL, // pfnEndSection()
185.171 + NULL, // pfnCompareFileTime()
185.172 + NULL, // pfnGetGameDir()
185.173 + NULL, // pfnCvar_RegisterVariable()
185.174 + NULL, // pfnFadeClientVolume()
185.175 + NULL, // pfnSetClientMaxspeed()
185.176 + NULL, // pfnCreateFakeClient()
185.177 + NULL, // pfnRunPlayerMove()
185.178 + NULL, // pfnNumberOfEntities()
185.179 +
185.180 + NULL, // pfnGetInfoKeyBuffer()
185.181 + NULL, // pfnInfoKeyValue()
185.182 + NULL, // pfnSetKeyValue()
185.183 + NULL, // pfnSetClientKeyValue()
185.184 +
185.185 + NULL, // pfnIsMapValid()
185.186 + NULL, // pfnStaticDecal()
185.187 + NULL, // pfnPrecacheGeneric()
185.188 + NULL, // pfnGetPlayerUserId()
185.189 + NULL, // pfnBuildSoundMsg()
185.190 + NULL, // pfnIsDedicatedServer()
185.191 + NULL, // pfnCVarGetPointer()
185.192 + NULL, // pfnGetPlayerWONId()
185.193 +
185.194 + NULL, // pfnInfo_RemoveKey()
185.195 + NULL, // pfnGetPhysicsKeyValue()
185.196 + NULL, // pfnSetPhysicsKeyValue()
185.197 + NULL, // pfnGetPhysicsInfoString()
185.198 + NULL, // pfnPrecacheEvent()
185.199 + NULL, // pfnPlaybackEvent()
185.200 +
185.201 + NULL, // pfnSetFatPVS()
185.202 + NULL, // pfnSetFatPAS()
185.203 +
185.204 + NULL, // pfnCheckVisibility()
185.205 +
185.206 + NULL, // pfnDeltaSetField()
185.207 + NULL, // pfnDeltaUnsetField()
185.208 + NULL, // pfnDeltaAddEncoder()
185.209 + NULL, // pfnGetCurrentPlayer()
185.210 + NULL, // pfnCanSkipPlayer()
185.211 + NULL, // pfnDeltaFindField()
185.212 + NULL, // pfnDeltaSetFieldByIndex()
185.213 + NULL, // pfnDeltaUnsetFieldByIndex()
185.214 +
185.215 + NULL, // pfnSetGroupMask()
185.216 +
185.217 + NULL, // pfnCreateInstancedBaseline()
185.218 + NULL, // pfnCvar_DirectSet()
185.219 +
185.220 + NULL, // pfnForceUnmodified()
185.221 +
185.222 + NULL, // pfnGetPlayerStats()
185.223 +
185.224 + NULL, // pfnAddServerCommand()
185.225 +
185.226 + // Added in SDK 2.2:
185.227 + NULL, // pfnVoice_GetClientListening()
185.228 + NULL, // pfnVoice_SetClientListening()
185.229 +
185.230 + // Added for HL 1109 (no SDK update):
185.231 + NULL, // pfnGetPlayerAuthId()
185.232 +
185.233 + // Added 2003/11/10 (no SDK update):
185.234 + NULL, // pfnSequenceGet()
185.235 + NULL, // pfnSequencePickSentence()
185.236 + NULL, // pfnGetFileSize()
185.237 + NULL, // pfnGetApproxWavePlayLen()
185.238 + NULL, // pfnIsCareerMatch()
185.239 + NULL, // pfnGetLocalizedStringLength()
185.240 + NULL, // pfnRegisterTutorMessageShown()
185.241 + NULL, // pfnGetTimesTutorMessageShown()
185.242 + NULL, // pfnProcessTutorMessageDecayBuffer()
185.243 + NULL, // pfnConstructTutorMessageDecayBuffer()
185.244 + NULL, // pfnResetTutorMessageDecayData()
185.245 +};
185.246 +
185.247 +C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine,
185.248 + int *interfaceVersion)
185.249 +{
185.250 + if(!pengfuncsFromEngine) {
185.251 + UTIL_LogPrintf("GetEngineFunctions called with null pengfuncsFromEngine");
185.252 + return(FALSE);
185.253 + }
185.254 + else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) {
185.255 + UTIL_LogPrintf("GetEngineFunctions version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION);
185.256 + // Tell metamod what version we had, so it can figure out who is out of date.
185.257 + *interfaceVersion = ENGINE_INTERFACE_VERSION;
185.258 + return(FALSE);
185.259 + }
185.260 + memcpy(pengfuncsFromEngine, &meta_engfuncs, sizeof(enginefuncs_t));
185.261 + return(TRUE);
185.262 +}
186.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
186.2 +++ b/stub_plugin/h_export.cpp Tue Apr 06 07:36:14 2004 +0000
186.3 @@ -0,0 +1,45 @@
186.4 +// vi: set ts=4 sw=4 :
186.5 +// vim: set tw=75 :
186.6 +
186.7 +// From SDK dlls/h_export.cpp:
186.8 +
186.9 +/***
186.10 +*
186.11 +* Copyright (c) 1999, 2000 Valve LLC. All rights reserved.
186.12 +*
186.13 +* This product contains software technology licensed from Id
186.14 +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
186.15 +* All Rights Reserved.
186.16 +*
186.17 +* Use, distribution, and modification of this source code and/or resulting
186.18 +* object code is restricted to non-commercial enhancements to products from
186.19 +* Valve LLC. All other use, distribution, or modification is prohibited
186.20 +* without written permission from Valve LLC.
186.21 +*
186.22 +****/
186.23 +/*
186.24 +
186.25 +===== h_export.cpp ========================================================
186.26 +
186.27 + Entity classes exported by Halflife.
186.28 +
186.29 +*/
186.30 +
186.31 +#include <extdll.h>
186.32 +
186.33 +#include <h_export.h>
186.34 +
186.35 +// From SDK dlls/h_export.cpp:
186.36 +
186.37 +//! Holds engine functionality callbacks
186.38 +enginefuncs_t g_engfuncs;
186.39 +globalvars_t *gpGlobals;
186.40 +
186.41 +// Receive engine function table from engine.
186.42 +// This appears to be the _first_ DLL routine called by the engine, so we
186.43 +// do some setup operations here.
186.44 +void WINAPI GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals )
186.45 +{
186.46 + memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t));
186.47 + gpGlobals = pGlobals;
186.48 +}
188.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
188.2 +++ b/stub_plugin/meta_api.cpp Tue Apr 06 07:36:14 2004 +0000
188.3 @@ -0,0 +1,121 @@
188.4 +// vi: set ts=4 sw=4 :
188.5 +// vim: set tw=75 :
188.6 +
188.7 +// meta_api.cpp - minimal implementation of metamod's plugin interface
188.8 +
188.9 +// This is intended to illustrate the (more or less) bare minimum code
188.10 +// required for a valid metamod plugin, and is targeted at those who want
188.11 +// to port existing HL/SDK DLL code to run as a metamod plugin.
188.12 +
188.13 +/*
188.14 + * Copyright (c) 2001-2003 Will Day <[email protected]>
188.15 + *
188.16 + * This file is part of Metamod.
188.17 + *
188.18 + * Metamod is free software; you can redistribute it and/or modify it
188.19 + * under the terms of the GNU General Public License as published by the
188.20 + * Free Software Foundation; either version 2 of the License, or (at
188.21 + * your option) any later version.
188.22 + *
188.23 + * Metamod is distributed in the hope that it will be useful, but
188.24 + * WITHOUT ANY WARRANTY; without even the implied warranty of
188.25 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
188.26 + * General Public License for more details.
188.27 + *
188.28 + * You should have received a copy of the GNU General Public License
188.29 + * along with Metamod; if not, write to the Free Software Foundation,
188.30 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
188.31 + *
188.32 + * In addition, as a special exception, the author gives permission to
188.33 + * link the code of this program with the Half-Life Game Engine ("HL
188.34 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
188.35 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
188.36 + * respects for all of the code used other than the HL Engine and MODs
188.37 + * from Valve. If you modify this file, you may extend this exception
188.38 + * to your version of the file, but you are not obligated to do so. If
188.39 + * you do not wish to do so, delete this exception statement from your
188.40 + * version.
188.41 + *
188.42 + */
188.43 +
188.44 +#include <extdll.h> // always
188.45 +
188.46 +#include <meta_api.h> // of course
188.47 +
188.48 +#include "sdk_util.h" // UTIL_LogPrintf, etc
188.49 +
188.50 +// Must provide at least one of these..
188.51 +static META_FUNCTIONS gMetaFunctionTable = {
188.52 + NULL, // pfnGetEntityAPI HL SDK; called before game DLL
188.53 + NULL, // pfnGetEntityAPI_Post META; called after game DLL
188.54 + GetEntityAPI2, // pfnGetEntityAPI2 HL SDK2; called before game DLL
188.55 + NULL, // pfnGetEntityAPI2_Post META; called after game DLL
188.56 + NULL, // pfnGetNewDLLFunctions HL SDK2; called before game DLL
188.57 + NULL, // pfnGetNewDLLFunctions_Post META; called after game DLL
188.58 + GetEngineFunctions, // pfnGetEngineFunctions META; called before HL engine
188.59 + NULL, // pfnGetEngineFunctions_Post META; called after HL engine
188.60 +};
188.61 +
188.62 +// Description of plugin
188.63 +plugin_info_t Plugin_info = {
188.64 + META_INTERFACE_VERSION, // ifvers
188.65 + "minimal stub", // name
188.66 + "1.17", // version
188.67 + "2003/11/15", // date
188.68 + "Will Day <[email protected]>", // author
188.69 + "http://www.metamod.org/", // url
188.70 + "STUB", // logtag, all caps please
188.71 + PT_ANYTIME, // (when) loadable
188.72 + PT_ANYPAUSE, // (when) unloadable
188.73 +};
188.74 +
188.75 +// Global vars from metamod:
188.76 +meta_globals_t *gpMetaGlobals; // metamod globals
188.77 +gamedll_funcs_t *gpGamedllFuncs; // gameDLL function tables
188.78 +mutil_funcs_t *gpMetaUtilFuncs; // metamod utility functions
188.79 +
188.80 +// Metamod requesting info about this plugin:
188.81 +// ifvers (given) interface_version metamod is using
188.82 +// pPlugInfo (requested) struct with info about plugin
188.83 +// pMetaUtilFuncs (given) table of utility functions provided by metamod
188.84 +C_DLLEXPORT int Meta_Query(char * /*ifvers */, plugin_info_t **pPlugInfo,
188.85 + mutil_funcs_t *pMetaUtilFuncs)
188.86 +{
188.87 + // Give metamod our plugin_info struct
188.88 + *pPlugInfo=&Plugin_info;
188.89 + // Get metamod utility function table.
188.90 + gpMetaUtilFuncs=pMetaUtilFuncs;
188.91 + return(TRUE);
188.92 +}
188.93 +
188.94 +// Metamod attaching plugin to the server.
188.95 +// now (given) current phase, ie during map, during changelevel, or at startup
188.96 +// pFunctionTable (requested) table of function tables this plugin catches
188.97 +// pMGlobals (given) global vars from metamod
188.98 +// pGamedllFuncs (given) copy of function tables from game dll
188.99 +C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME /* now */,
188.100 + META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals,
188.101 + gamedll_funcs_t *pGamedllFuncs)
188.102 +{
188.103 + if(!pMGlobals) {
188.104 + LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals");
188.105 + return(FALSE);
188.106 + }
188.107 + gpMetaGlobals=pMGlobals;
188.108 + if(!pFunctionTable) {
188.109 + LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable");
188.110 + return(FALSE);
188.111 + }
188.112 + memcpy(pFunctionTable, &gMetaFunctionTable, sizeof(META_FUNCTIONS));
188.113 + gpGamedllFuncs=pGamedllFuncs;
188.114 + return(TRUE);
188.115 +}
188.116 +
188.117 +// Metamod detaching plugin from the server.
188.118 +// now (given) current phase, ie during map, etc
188.119 +// reason (given) why detaching (refresh, console unload, forced unload, etc)
188.120 +C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME /* now */,
188.121 + PL_UNLOAD_REASON /* reason */)
188.122 +{
188.123 + return(TRUE);
188.124 +}
192.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
192.2 +++ b/stub_plugin/msvc/stub_mm.def Tue Apr 06 07:36:14 2004 +0000
192.3 @@ -0,0 +1,5 @@
192.4 +LIBRARY stub_mm
192.5 +EXPORTS
192.6 + GiveFnptrsToDll @1
192.7 +SECTIONS
192.8 + .data READ WRITE
193.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
193.2 +++ b/stub_plugin/msvc/stub_mm.dsp Tue Apr 06 07:36:14 2004 +0000
193.3 @@ -0,0 +1,123 @@
193.4 +# Microsoft Developer Studio Project File - Name="stub_mm" - Package Owner=<4>
193.5 +# Microsoft Developer Studio Generated Build File, Format Version 6.00
193.6 +# ** DO NOT EDIT **
193.7 +
193.8 +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
193.9 +
193.10 +CFG=stub_mm - Win32 Debug
193.11 +!MESSAGE This is not a valid makefile. To build this project using NMAKE,
193.12 +!MESSAGE use the Export Makefile command and run
193.13 +!MESSAGE
193.14 +!MESSAGE NMAKE /f "stub_mm.mak".
193.15 +!MESSAGE
193.16 +!MESSAGE You can specify a configuration when running NMAKE
193.17 +!MESSAGE by defining the macro CFG on the command line. For example:
193.18 +!MESSAGE
193.19 +!MESSAGE NMAKE /f "stub_mm.mak" CFG="stub_mm - Win32 Debug"
193.20 +!MESSAGE
193.21 +!MESSAGE Possible choices for configuration are:
193.22 +!MESSAGE
193.23 +!MESSAGE "stub_mm - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
193.24 +!MESSAGE "stub_mm - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
193.25 +!MESSAGE
193.26 +
193.27 +# Begin Project
193.28 +# PROP AllowPerConfigDependencies 0
193.29 +# PROP Scc_ProjName ""
193.30 +# PROP Scc_LocalPath ""
193.31 +CPP=cl.exe
193.32 +MTL=midl.exe
193.33 +RSC=rc.exe
193.34 +
193.35 +!IF "$(CFG)" == "stub_mm - Win32 Release"
193.36 +
193.37 +# PROP BASE Use_MFC 0
193.38 +# PROP BASE Use_Debug_Libraries 0
193.39 +# PROP BASE Output_Dir "Release"
193.40 +# PROP BASE Intermediate_Dir "Release"
193.41 +# PROP BASE Target_Dir ""
193.42 +# PROP Use_MFC 0
193.43 +# PROP Use_Debug_Libraries 0
193.44 +# PROP Output_Dir "release"
193.45 +# PROP Intermediate_Dir "release"
193.46 +# PROP Ignore_Export_Lib 0
193.47 +# PROP Target_Dir ""
193.48 +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "STUB_MM_EXPORTS" /YX /FD /c
193.49 +# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\metamod" /I "\hl\hlsdk\multiplayer source\common" /I "\hl\hlsdk\multiplayer source\engine" /I "\hl\hlsdk\multiplayer source\dlls" /I "\hl\hlsdk\multiplayer source\pm_shared" /I "..\..\metamod" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "STUB_MM_EXPORTS" /YX /FD /c
193.50 +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
193.51 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
193.52 +# ADD BASE RSC /l 0x409 /d "NDEBUG"
193.53 +# ADD RSC /l 0x409 /d "NDEBUG"
193.54 +BSC32=bscmake.exe
193.55 +# ADD BASE BSC32 /nologo
193.56 +# ADD BSC32 /nologo
193.57 +LINK32=link.exe
193.58 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
193.59 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /def:".\stub_mm.def" /out:"release/stub_mm.dll"
193.60 +
193.61 +!ELSEIF "$(CFG)" == "stub_mm - Win32 Debug"
193.62 +
193.63 +# PROP BASE Use_MFC 0
193.64 +# PROP BASE Use_Debug_Libraries 1
193.65 +# PROP BASE Output_Dir "Debug"
193.66 +# PROP BASE Intermediate_Dir "Debug"
193.67 +# PROP BASE Target_Dir ""
193.68 +# PROP Use_MFC 0
193.69 +# PROP Use_Debug_Libraries 1
193.70 +# PROP Output_Dir "debug"
193.71 +# PROP Intermediate_Dir "debug"
193.72 +# PROP Ignore_Export_Lib 0
193.73 +# PROP Target_Dir ""
193.74 +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "STUB_MM_EXPORTS" /YX /FD /GZ /c
193.75 +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\metamod" /I "\hl\hlsdk\multiplayer source\common" /I "\hl\hlsdk\multiplayer source\engine" /I "\hl\hlsdk\multiplayer source\dlls" /I "\hl\hlsdk\multiplayer source\pm_shared" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "STUB_MM_EXPORTS" /YX /FD /GZ /c
193.76 +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
193.77 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
193.78 +# ADD BASE RSC /l 0x409 /d "_DEBUG"
193.79 +# ADD RSC /l 0x409 /d "_DEBUG"
193.80 +BSC32=bscmake.exe
193.81 +# ADD BASE BSC32 /nologo
193.82 +# ADD BSC32 /nologo
193.83 +LINK32=link.exe
193.84 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
193.85 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /def:".\stub_mm.def" /out:"debug/stub_mm.dll" /pdbtype:sept
193.86 +
193.87 +!ENDIF
193.88 +
193.89 +# Begin Target
193.90 +
193.91 +# Name "stub_mm - Win32 Release"
193.92 +# Name "stub_mm - Win32 Debug"
193.93 +# Begin Group "Source Files"
193.94 +
193.95 +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
193.96 +# Begin Source File
193.97 +
193.98 +SOURCE=..\dllapi.cpp
193.99 +# End Source File
193.100 +# Begin Source File
193.101 +
193.102 +SOURCE=..\engine_api.cpp
193.103 +# End Source File
193.104 +# Begin Source File
193.105 +
193.106 +SOURCE=..\h_export.cpp
193.107 +# End Source File
193.108 +# Begin Source File
193.109 +
193.110 +SOURCE=..\meta_api.cpp
193.111 +# End Source File
193.112 +# Begin Source File
193.113 +
193.114 +SOURCE=..\sdk_util.cpp
193.115 +# End Source File
193.116 +# End Group
193.117 +# Begin Group "Header Files"
193.118 +
193.119 +# PROP Default_Filter "h;hpp;hxx;hm;inl"
193.120 +# End Group
193.121 +# Begin Group "Resource Files"
193.122 +
193.123 +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
193.124 +# End Group
193.125 +# End Target
193.126 +# End Project
194.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
194.2 +++ b/stub_plugin/msvc/stub_mm.dsw Tue Apr 06 07:36:14 2004 +0000
194.3 @@ -0,0 +1,29 @@
194.4 +Microsoft Developer Studio Workspace File, Format Version 6.00
194.5 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
194.6 +
194.7 +###############################################################################
194.8 +
194.9 +Project: "stub_mm"=.\stub_mm.dsp - Package Owner=<4>
194.10 +
194.11 +Package=<5>
194.12 +{{{
194.13 +}}}
194.14 +
194.15 +Package=<4>
194.16 +{{{
194.17 +}}}
194.18 +
194.19 +###############################################################################
194.20 +
194.21 +Global:
194.22 +
194.23 +Package=<5>
194.24 +{{{
194.25 +}}}
194.26 +
194.27 +Package=<3>
194.28 +{{{
194.29 +}}}
194.30 +
194.31 +###############################################################################
194.32 +
195.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
195.2 +++ b/stub_plugin/sdk_util.cpp Tue Apr 06 07:36:14 2004 +0000
195.3 @@ -0,0 +1,50 @@
195.4 +// vi: set ts=4 sw=4 :
195.5 +// vim: set tw=75 :
195.6 +
195.7 +// Selected portions of dlls/util.cpp from SDK 2.1.
195.8 +// Functions copied from there as needed...
195.9 +// And modified to avoid buffer overflows (argh).
195.10 +
195.11 +/***
195.12 +*
195.13 +* Copyright (c) 1999, 2000 Valve LLC. All rights reserved.
195.14 +*
195.15 +* This product contains software technology licensed from Id
195.16 +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
195.17 +* All Rights Reserved.
195.18 +*
195.19 +* Use, distribution, and modification of this source code and/or resulting
195.20 +* object code is restricted to non-commercial enhancements to products from
195.21 +* Valve LLC. All other use, distribution, or modification is prohibited
195.22 +* without written permission from Valve LLC.
195.23 +*
195.24 +****/
195.25 +/*
195.26 +
195.27 +===== util.cpp ========================================================
195.28 +
195.29 + Utility code. Really not optional after all.
195.30 +
195.31 +*/
195.32 +
195.33 +#include <extdll.h>
195.34 +#include <enginecallback.h> // ALERT()
195.35 +
195.36 +#include "osdep.h" // win32 vsnprintf, etc
195.37 +
195.38 +//=========================================================
195.39 +// UTIL_LogPrintf - Prints a logged message to console.
195.40 +// Preceded by LOG: ( timestamp ) < message >
195.41 +//=========================================================
195.42 +void UTIL_LogPrintf( char *fmt, ... )
195.43 +{
195.44 + va_list argptr;
195.45 + static char string[1024];
195.46 +
195.47 + va_start ( argptr, fmt );
195.48 + vsnprintf ( string, sizeof(string), fmt, argptr );
195.49 + va_end ( argptr );
195.50 +
195.51 + // Print to server console
195.52 + ALERT( at_logged, "%s", string );
195.53 +}
196.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
196.2 +++ b/tools/getents.sh Tue Apr 06 07:36:14 2004 +0000
196.3 @@ -0,0 +1,4 @@
196.4 +#!/bin/sh
196.5 +PATH=/bin:/usr/bin:/sbin:/usr/sbin
196.6 +
196.7 +nm -CDg $1 | egrep " T " | egrep -v "::|\(| T [A-Z]| _|type_info|anglemod" | cut -d' ' -f 3,3
197.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
197.2 +++ b/tools/stlfilter Tue Apr 06 07:36:14 2004 +0000
197.3 @@ -0,0 +1,27 @@
197.4 +#!/bin/ksh
197.5 +# vi: set ts=4 sw=4 :
197.6 +# vim: set ft=awk :
197.7 +
197.8 +nawk '
197.9 + BEGIN {ret=0}
197.10 + $0 ~ "iostream.h:.*[io]stream" {next}
197.11 + $0 ~ "iostream.h:.*operator=" {next}
197.12 + $0 ~ "stl_iterator.h:.*::operator" {next}
197.13 + $0 ~ "stl_bvector.h:.*Bit_(reference|iterator|const_iterator)" {next}
197.14 + $0 ~ "stl_bvector.h:.*operator=" {next}
197.15 + $0 ~ "stl_vector.h:.*_Vector" {next}
197.16 + $0 ~ "instantiated from .(_Vector|vector<)" {next}
197.17 + $0 ~ "instantiation of .vector<" {next}
197.18 + $0 ~ "^(In file included| *) from /usr/lib/gcc-lib/i386-linux/.*/include/g\+\+-3/(stl_iterator.h|stl_algobase.h|vector|stl_bvector.h|stl_vector.h):" {next}
197.19 + $0 ~ "/usr/lib/gcc-lib/i386-linux/.*/include/g\+\+-3/.*: At top level" {next}
197.20 + $0 ~ " *instantiated from here$" {next}
197.21 + $0 ~ " from.*:$" {next}
197.22 + $0 ~ "cc1plus: warnings being treated as errors" {print; next}
197.23 + $0 ~ "warning:" {ret=1}
197.24 + $0 ~ "error" {ret=1}
197.25 + {print}
197.26 + END {exit(ret)}
197.27 +'
197.28 +ret=$?
197.29 +echo "stlfilter exiting with $ret"
197.30 +exit $ret
198.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
198.2 +++ b/trace_plugin/Config.mak Tue Apr 06 07:36:14 2004 +0000
198.3 @@ -0,0 +1,10 @@
198.4 +MODNAME = trace_mm
198.5 +
198.6 +EXTRA_CFLAGS = -Wno-unused -fno-rtti
198.7 +
198.8 +SRCFILES = api_info.cpp dllapi.cpp dllapi_post.cpp engine_api.cpp \
198.9 + engine_api_post.cpp h_export.cpp log_plugin.cpp meta_api.cpp \
198.10 + plugin.cpp sdk_util.cpp trace_api.cpp vdate.cpp
198.11 +
198.12 +INFOFILES = info_name.h ../metamod/vers_meta.h
198.13 +RESFILE = res_meta.rc
199.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
199.2 +++ b/trace_plugin/INFOcvs Tue Apr 06 07:36:14 2004 +0000
199.3 @@ -0,0 +1,9 @@
199.4 +The following files are ususally linked from the ../metamod
199.5 +directory. Since CVS does not allow symbolic links, these
199.6 +files have been copied here. It is to be considered to create
199.7 +links via a makefile or similar mechanism in the future.
199.8 +
199.9 +Makefile
199.10 +api_info.cpp
199.11 +res_meta.rc
199.12 +sdk_util.cpp
200.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
200.2 +++ b/trace_plugin/Makefile Tue Apr 06 07:36:14 2004 +0000
200.3 @@ -0,0 +1,380 @@
200.4 +# vi: set ts=4 sw=4 :
200.5 +# vim: set tw=75 :
200.6 +
200.7 +# MetaMod makefile
200.8 +# Copyright (c) 2001-2003 Will Day <[email protected]>
200.9 +#
200.10 +# based on the Valve SDK 2.1 Makefile as well as the Makefile
200.11 +# in adminmod by Alfred Reynolds.
200.12 +#
200.13 +# From SDK 2.1 dlls/Makefile:
200.14 +#! Half-Life StandardSDK 2.0 mp_i386.so Makefile for i386 Linux
200.15 +#! April 2000 by Leon Hartwig ([email protected])
200.16 +
200.17 +
200.18 +# NOTE: This is a generic Makefile for metamod and the bundled plugins, and
200.19 +# is symlinked into each subdir. Per-module config statements are in
200.20 +# Config.mak in each subdir.
200.21 +
200.22 +ifdef COMSPEC
200.23 + OS=windows
200.24 +else
200.25 + OS=linux
200.26 +endif
200.27 +
200.28 +#############################################################################
200.29 +# CONFIGURATION
200.30 +#############################################################################
200.31 +
200.32 +# set paths for your environment
200.33 +ifeq "$(OS)" "linux"
200.34 + PATH_WIN=/usr/local/cross-tools/i586-mingw32msvc/bin
200.35 + SDKTOP=$(HOME)/src/hl/hlsdk-2.3
200.36 + INST_DIR=$(HOME)/half-life/cstrike/dlls
200.37 + TEST_DIR=$(HOME)/test/tfc/dlls
200.38 + TST_DIR=$(HOME)/tmp
200.39 +else ## windows
200.40 + PATH_WIN=/gcc-2.95.2-msvcrt/bin
200.41 + SDKTOP=/hlsdk2.3
200.42 + INST_DIR=/hlserver/tfc/dlls
200.43 + TEST_DIR=/hlserver/tfc/dlls
200.44 +endif
200.45 +
200.46 +DLLS_DIR=../dlls
200.47 +SDKSRC=$(SDKTOP)/multiplayer
200.48 +METADIR=../metamod
200.49 +
200.50 +
200.51 +#############################################################################
200.52 +# OS DEPENDENCIES
200.53 +#############################################################################
200.54 +
200.55 +ifeq "$(OS)" "linux"
200.56 + INSTALL=install -m 644
200.57 + LD_WINDLL= PATH=$(PATH_WIN) $(PATH_WIN)/dllwrap
200.58 + TARGET=linux
200.59 + LIBFILE=$(LIBFILE_LINUX)
200.60 + TARGET_FILE=$(TARGET_LINUX)
200.61 +else ## windows
200.62 + INSTALL=cp
200.63 + LD_WINDLL= $(PATH_WIN)/dllwrap
200.64 + TARGET=win32
200.65 + LIBFILE=$(LIBFILE_WIN)
200.66 + TARGET_FILE=$(TARGET_WIN)
200.67 +endif
200.68 +
200.69 +CC_WIN=$(PATH_WIN)/gcc
200.70 +RES_WIN=$(PATH_WIN)/windres
200.71 +OBJDIR_LINUX_OPT=opt.linux
200.72 +OBJDIR_WIN_OPT=opt.win32
200.73 +OBJDIR_LINUX_DBG=debug.linux
200.74 +OBJDIR_WIN_DBG=debug.win32
200.75 +
200.76 +
200.77 +#############################################################################
200.78 +# COMPILE OPTIONS
200.79 +#############################################################################
200.80 +
200.81 +# original safe optimization, from valve Makefile
200.82 +#CCOPT = -O2 -ffast-math -funroll-loops \
200.83 +# -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
200.84 +# -malign-jumps=2 -malign-functions=2
200.85 +
200.86 +# safe optimization, adapted from adminmod Makefile
200.87 +#CCOPT = -m486 -O6 -ffast-math -funroll-loops \
200.88 +# -fexpensive-optimizations -malign-loops=2 -malign-jumps=2 \
200.89 +# -malign-functions=2 -Wall
200.90 +
200.91 +# full optimization, adapted from adminmod Makefile
200.92 +# "WONT WORK WITH omit-frame-pointer"?
200.93 +# - disable (unneeded) C++ exceptions and rtti code to save some space ?
200.94 +CCOPT = -march=i586 $(CCO) -ffast-math -funroll-loops \
200.95 + -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
200.96 + -malign-jumps=2 -malign-functions=2 -fno-exceptions -fno-rtti -s
200.97 +
200.98 +# optimization level; overridden for certain problematic files
200.99 +CCO = -O6
200.100 +
200.101 +# debugging; halt on warnings
200.102 +CCDEBUG+= -ggdb3
200.103 +
200.104 +
200.105 +#############################################################################
200.106 +# COMPILE SETUP
200.107 +#############################################################################
200.108 +
200.109 +CC=gcc-2.95
200.110 +
200.111 +SRCDIR=.
200.112 +INCLUDEDIRS=-I$(SRCDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/pm_shared -I$(SDKSRC)/dlls -I$(SDKSRC)
200.113 +FILES_ALL = *.cpp *.h [A-Z]* *.rc
200.114 +
200.115 +CFLAGS=-Wall -Wno-unknown-pragmas
200.116 +#CFLAGS += -DTEST
200.117 +
200.118 +ifeq "$(USER)" "willday"
200.119 + # extra warnings
200.120 + CFLAGS+=-W -Wundef \
200.121 + -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align \
200.122 + -Wconversion -Wsign-compare \
200.123 + -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \
200.124 + -Wmissing-noreturn -Wnested-externs -Winline \
200.125 + -Wlong-long
200.126 + # extra C++ warnings
200.127 + CFLAGS+=-Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder \
200.128 + -Woverloaded-virtual -Wsign-promo -Wsynth -Weffc++
200.129 + # undesired warnings
200.130 + #CFLAGS+=-pedantic -Waggregate-return -Wredundant-decls -Wtraditional
200.131 + # to help debugging; requires edited SDK
200.132 + CCDEBUG+=-Werror
200.133 + # link against older libc for compatibility
200.134 + EXTRA_LINK = -L../priv/libc -lc
200.135 +endif
200.136 +
200.137 +ifeq "$(OPT)" "opt"
200.138 + ODEF = -DOPT_TYPE=\"optimized\"
200.139 + CFLAGS := $(CCOPT) $(CFLAGS) $(ODEF)
200.140 + OBJDIR_LINUX = $(OBJDIR_LINUX_OPT)
200.141 + OBJDIR_WIN = $(OBJDIR_WIN_OPT)
200.142 +else # debug
200.143 + ODEF = -DOPT_TYPE=\"debugging\"
200.144 + CFLAGS := $(CCDEBUG) $(CFLAGS) $(ODEF)
200.145 + OBJDIR_LINUX = $(OBJDIR_LINUX_DBG)
200.146 + OBJDIR_WIN = $(OBJDIR_WIN_DBG)
200.147 + DLLS_DIR := $(DLLS_DIR)/debug
200.148 +endif
200.149 +
200.150 +include Config.mak
200.151 +# any local CFLAGS from Config.mak
200.152 +CFLAGS += $(EXTRA_CFLAGS)
200.153 +
200.154 +# ignore complaints from SDK files like cbase.h
200.155 +$(OBJDIR_LINUX)/sdk_util.o $(OBJDIR_WIN)/sdk_util.o: CFLAGS += -Wno-unused
200.156 +
200.157 +# ignore complaints from STL headers
200.158 +STLOBJ = $(STLFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
200.159 +STLOBJ += $(STLFILES:%.cpp=$(OBJDIR_WIN)/%.o)
200.160 +#$(OBJDIR_LINUX)/mreg.o $(OBJDIR_WIN)/mreg.o: CFLAGS += -Wno-effc++
200.161 +$(STLOBJ): FILTER= 2>&1 | ../tools/stlfilter
200.162 +$(STLOBJ): CFLAGS += -Wno-error
200.163 +
200.164 +# these files seem to create "Internal compiler error" errors under mingw
200.165 +# when using -O6
200.166 +#$(OBJDIR_WIN)/engine_api.o: CCO = -O5
200.167 +#$(OBJDIR_WIN)/dllapi_api.o: CCO = -O5
200.168 +
200.169 +#############################################################################
200.170 +# BUILDING LINUX SO
200.171 +#############################################################################
200.172 +
200.173 +# linux .so compile commands
200.174 +DO_CC_LINUX=$(CC) $(CFLAGS) -fPIC $(INCLUDEDIRS) -o $@ -c $< $(FILTER)
200.175 +LINK_LINUX=$(CC) $(CFLAGS) -shared -ldl -lm $(EXTRA_LINK) $(OBJ_LINUX) -o $@
200.176 +
200.177 +# sort by date
200.178 +ifeq "$(OS)" "linux"
200.179 +SRCFILES := $(shell ls -t $(SRCFILES))
200.180 +endif
200.181 +# linux object files
200.182 +OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
200.183 +
200.184 +# compiling linux object files
200.185 +$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.cpp
200.186 + $(DO_CC_LINUX)
200.187 +
200.188 +# linux .so target file
200.189 +LIBFILE_LINUX = $(MODNAME)_i386.so
200.190 +TARGET_LINUX = $(OBJDIR_LINUX)/$(LIBFILE_LINUX)
200.191 +
200.192 +
200.193 +#############################################################################
200.194 +# BUILDING WINDOWS DLL
200.195 +#############################################################################
200.196 +
200.197 +# windows .dll compile commands
200.198 +DO_CC_WIN=$(CC_WIN) $(CFLAGS) $(INCLUDEDIRS) -o $@ -c $<
200.199 +DO_RES_WIN=$(RES_WIN) '$(ODEF)' --include-dir . --include-dir ../metamod -i $< -O coff -o $@
200.200 +#LINK_WIN=$(LD_WINDLL) -k -mwindows --add-stdcall-alias --def metamod.def -o $@ $(OBJ_WIN)
200.201 +#LINK_WIN=$(LD_WINDLL) -A -k -mwindows --export-all-symbols -o $@ $(OBJ_WIN)
200.202 +LINK_WIN=$(LD_WINDLL) -mwindows --add-stdcall-alias $(OBJ_WIN) $(RES_OBJ_WIN) -o $@
200.203 +
200.204 +# windows object files
200.205 +OBJ_WIN := $(SRCFILES:%.cpp=$(OBJDIR_WIN)/%.o)
200.206 +RES_OBJ_WIN := $(RESFILE:%.rc=$(OBJDIR_WIN)/%.o)
200.207 +
200.208 +# compiling windows object files
200.209 +$(OBJDIR_WIN)/%.o: $(SRCDIR)/%.cpp
200.210 + $(DO_CC_WIN)
200.211 +
200.212 +# compiling windows resource file
200.213 +$(OBJDIR_WIN)/%.o: $(SRCDIR)/%.rc $(INFOFILES)
200.214 + $(DO_RES_WIN)
200.215 +
200.216 +# windows .dll target file
200.217 +LIBFILE_WIN = $(MODNAME).dll
200.218 +TARGET_WIN = $(OBJDIR_WIN)/$(LIBFILE_WIN)
200.219 +
200.220 +
200.221 +#############################################################################
200.222 +# OVERRIDES
200.223 +#############################################################################
200.224 +
200.225 +ifeq "$(PLATFORM)" "linux-only"
200.226 + LIBFILE_WIN =
200.227 + TARGET_WIN =
200.228 +endif
200.229 +ifeq "$(PLATFORM)" "win32-only"
200.230 + LIBFILE_LINUX =
200.231 + TARGET_LINUX =
200.232 + TARGET=win32
200.233 + LIBFILE=$(LIBFILE_WIN)
200.234 + TARGET_FILE=$(TARGET_WIN)
200.235 +endif
200.236 +
200.237 +
200.238 +#############################################################################
200.239 +# BUILD RULES
200.240 +#############################################################################
200.241 +
200.242 +default: $(TARGET_FILE)
200.243 +
200.244 +ifeq "$(USER)" "willday"
200.245 +include ../priv/metamod.mak
200.246 +endif
200.247 +
200.248 +all: do_dll_linux do_dll_win32
200.249 +
200.250 +opt:
200.251 + $(MAKE) default OPT=opt
200.252 +
200.253 +linux: do_dll_linux
200.254 +win32: do_dll_win32
200.255 +
200.256 +linux_opt:
200.257 + $(MAKE) linux OPT=opt
200.258 +win32_opt:
200.259 + $(MAKE) win32 OPT=opt
200.260 +
200.261 +$(TARGET_LINUX): msgs/debug msgs/log msgs/error $(OBJDIR_LINUX) $(OBJ_LINUX)
200.262 + $(LINK_LINUX)
200.263 +
200.264 +# for plugins, recompile meta_api.cpp if info_name.h changed
200.265 +$(OBJDIR_LINUX)/meta_api.o $(OBJDIR_WIN)/meta_api.o: info_name.h
200.266 +
200.267 +ifeq "$(USER)" "willday"
200.268 +$(TARGET_LINUX): .tags .htags
200.269 +endif
200.270 +
200.271 +$(TARGET_WIN): $(OBJDIR_WIN) $(OBJ_WIN) $(RES_OBJ_WIN)
200.272 + $(LINK_WIN)
200.273 +
200.274 +$(OBJDIR_LINUX) $(OBJDIR_WIN) msgs:
200.275 + mkdir $@
200.276 +
200.277 +# make sure to recompile vdate.c for each link
200.278 +$(OBJDIR_LINUX)/vdate.o $(OBJDIR_WIN)/vdate.o : $(SRCFILES) *.h
200.279 +
200.280 +domsgs: msgs/debug msgs/log msgs/error
200.281 +
200.282 +msgs/debug: $(SRCFILES) *.h msgs
200.283 + egrep "DEBUG\([0-9]" $(SRCFILES) *.h | sed "s/:[ ]*/ /" | sort -k2,2 > $@
200.284 +
200.285 +msgs/log: $(SRCFILES) *.h msgs
200.286 + egrep "META_LOG\(" $(SRCFILES) *.h | sed "s/:[ ]*/ /" | sort > $@
200.287 +
200.288 +msgs/error: $(SRCFILES) *.h msgs
200.289 + egrep "META_ERROR\(" $(SRCFILES) *.h | sed "s/:[ ]*/ /" | sort > $@
200.290 +
200.291 +tags: .tags .htags
200.292 +ctags: .tags
200.293 +htags: .htags
200.294 +
200.295 +.tags: $(SRCFILES) *.h
200.296 + -ctags -a $?
200.297 +
200.298 +.htags: *.h
200.299 + -htags $?
200.300 +
200.301 +retags:
200.302 + -rm -f .tags .htags
200.303 + ctags -f .tags `find $(SDKSRC) -name '*.h'`
200.304 + ctags -f .tags -a `find $(METADIR) -name old -prune -o -name '*.h' -print`
200.305 + ctags -f .tags -a $(SRCFILES)
200.306 + htags -R $(SDKSRC)
200.307 + htags `find $(METADIR) -name old -prune -o -name '*.h' -print`
200.308 + htags *.h
200.309 +
200.310 +clean: clean_$(TARGET)
200.311 +
200.312 +clean_linux:
200.313 + test -n "$(OBJDIR_LINUX)"
200.314 + -rm -f $(OBJDIR_LINUX)/*
200.315 +
200.316 +clean_win32:
200.317 + test -n "$(OBJDIR_WIN)"
200.318 + -rm -f $(OBJDIR_WIN)/*
200.319 +
200.320 +cleanall_linux:
200.321 + $(MAKE) clean_linux
200.322 + $(MAKE) clean_linux OPT=opt
200.323 +
200.324 +cleanall_win32:
200.325 + $(MAKE) clean_win32
200.326 + $(MAKE) clean_win32 OPT=opt
200.327 +
200.328 +cleanall: cleanall_linux cleanall_win32
200.329 +
200.330 +dll_linux dll_win32:
200.331 + $(MAKE) do_$@
200.332 + $(MAKE) do_$@ OPT=opt
200.333 +
200.334 +do_dll_linux: $(DLLS_DIR) $(DLLS_DIR)/$(LIBFILE_LINUX)
200.335 +do_dll_win32: $(DLLS_DIR) $(DLLS_DIR)/$(LIBFILE_WIN)
200.336 +
200.337 +$(DLLS_DIR):
200.338 + mkdir $(DLLS_DIR)
200.339 +
200.340 +$(DLLS_DIR)/$(LIBFILE_LINUX): $(TARGET_LINUX)
200.341 + $(INSTALL) $+ $@
200.342 +
200.343 +$(DLLS_DIR)/$(LIBFILE_WIN): $(TARGET_WIN)
200.344 + $(INSTALL) $+ $@
200.345 +
200.346 +dlls: dll_linux dll_win32
200.347 +rmdlls:
200.348 + -rm -f ../dlls/*.* ../dlls/debug/*.*
200.349 +
200.350 +spotless: cleanall
200.351 + -rmdir $(OBJDIR_LINUX) $(OBJDIR_WIN)
200.352 + -rm -f .snap $(GENERATED)
200.353 +
200.354 +distclean: spotless
200.355 +
200.356 +install: $(INST_DIR)/$(LIBFILE)
200.357 +test: $(TEST_DIR)/$(LIBFILE)
200.358 +test_opt:
200.359 + $(MAKE) test OPT=opt
200.360 +
200.361 +$(INST_DIR)/$(LIBFILE) $(TEST_DIR)/$(LIBFILE): $(TARGET_FILE)
200.362 + $(INSTALL) $< $@
200.363 +
200.364 +tst: $(TST_DIR)/$(LIBFILE_WIN)
200.365 +
200.366 +$(TST_DIR)/$(LIBFILE_WIN): $(TARGET_WIN)
200.367 + cp $< $@
200.368 +
200.369 +snap: .snap
200.370 +
200.371 +.snap: $(FILES_ALL)
200.372 + mkdir -p snapshots
200.373 + tar zcvf snapshots/`date '+%m%d-%H%M'`.tgz $(FILES_ALL)
200.374 + touch .snap
200.375 +
200.376 +depend: Rules.depend
200.377 +
200.378 +ifeq "$(OS)" "linux"
200.379 +Rules.depend: $(SRCFILES)
200.380 + $(CC) -MM $(INCLUDEDIRS) $(SRCFILES) | sed "s;\(^[^ ]*\):\(.*\);$(OBJDIR_LINUX)/\1 $(OBJDIR_WIN)/\1: \2;" > $@
200.381 +endif
200.382 +
200.383 +include Rules.depend
201.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
201.2 +++ b/trace_plugin/Rules.depend Tue Apr 06 07:36:14 2004 +0000
201.3 @@ -0,0 +1,27 @@
201.4 +debug.linux/engine_api_post.o debug.win32/engine_api_post.o: engine_api_post.cpp ../metamod/engine_api.h \
201.5 + ../metamod/meta_api.h ../metamod/dllapi.h ../metamod/sdk_util.h \
201.6 + ../metamod/osdep.h ../metamod/types_meta.h ../metamod/mreg.h \
201.7 + ../metamod/log_meta.h ../metamod/plinfo.h ../metamod/mutil.h \
201.8 + ../metamod/mhook.h trace_api.h ../metamod/api_info.h log_plugin.h \
201.9 + plugin.h
201.10 +debug.linux/engine_api.o debug.win32/engine_api.o: engine_api.cpp ../metamod/engine_api.h \
201.11 + ../metamod/meta_api.h ../metamod/dllapi.h ../metamod/sdk_util.h \
201.12 + ../metamod/osdep.h ../metamod/types_meta.h ../metamod/mreg.h \
201.13 + ../metamod/log_meta.h ../metamod/plinfo.h ../metamod/mutil.h \
201.14 + ../metamod/mhook.h trace_api.h ../metamod/api_info.h \
201.15 + ../metamod/support_meta.h log_plugin.h plugin.h
201.16 +debug.linux/meta_api.o debug.win32/meta_api.o: meta_api.cpp plugin.h info_name.h ../metamod/vers_meta.h \
201.17 + log_plugin.h
201.18 +debug.linux/trace_api.o debug.win32/trace_api.o: trace_api.cpp trace_api.h log_plugin.h plugin.h \
201.19 + ../metamod/vers_meta.h ../metamod/vdate.h
201.20 +debug.linux/dllapi_post.o debug.win32/dllapi_post.o: dllapi_post.cpp dllapi_post.h trace_api.h \
201.21 + ../metamod/api_info.h log_plugin.h plugin.h
201.22 +debug.linux/dllapi.o debug.win32/dllapi.o: dllapi.cpp trace_api.h ../metamod/api_info.h log_plugin.h \
201.23 + plugin.h
201.24 +debug.linux/vdate.o debug.win32/vdate.o: vdate.cpp info_name.h ../metamod/vers_meta.h
201.25 +debug.linux/plugin.o debug.win32/plugin.o: plugin.cpp plugin.h log_plugin.h trace_api.h
201.26 +debug.linux/log_plugin.o debug.win32/log_plugin.o: log_plugin.cpp log_plugin.h plugin.h
201.27 +debug.linux/h_export.o debug.win32/h_export.o: h_export.cpp
201.28 +debug.linux/api_info.o debug.win32/api_info.o: api_info.cpp ../metamod/api_info.h ../metamod/types_meta.h
201.29 +debug.linux/sdk_util.o debug.win32/sdk_util.o: sdk_util.cpp ../metamod/sdk_util.h ../metamod/osdep.h \
201.30 + ../metamod/types_meta.h ../metamod/mreg.h ../metamod/log_meta.h
202.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
202.2 +++ b/trace_plugin/api_info.cpp Tue Apr 06 07:36:14 2004 +0000
202.3 @@ -0,0 +1,264 @@
202.4 +// vi: set ts=4 sw=4 :
202.5 +// vim: set tw=75 :
202.6 +
202.7 +// api_info.cpp - info for api routines
202.8 +
202.9 +/*
202.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
202.11 + *
202.12 + * This file is part of Metamod.
202.13 + *
202.14 + * Metamod is free software; you can redistribute it and/or modify it
202.15 + * under the terms of the GNU General Public License as published by the
202.16 + * Free Software Foundation; either version 2 of the License, or (at
202.17 + * your option) any later version.
202.18 + *
202.19 + * Metamod is distributed in the hope that it will be useful, but
202.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
202.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
202.22 + * General Public License for more details.
202.23 + *
202.24 + * You should have received a copy of the GNU General Public License
202.25 + * along with Metamod; if not, write to the Free Software Foundation,
202.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
202.27 + *
202.28 + * In addition, as a special exception, the author gives permission to
202.29 + * link the code of this program with the Half-Life Game Engine ("HL
202.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
202.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
202.32 + * respects for all of the code used other than the HL Engine and MODs
202.33 + * from Valve. If you modify this file, you may extend this exception
202.34 + * to your version of the file, but you are not obligated to do so. If
202.35 + * you do not wish to do so, delete this exception statement from your
202.36 + * version.
202.37 + *
202.38 + */
202.39 +
202.40 +#include <extdll.h> // always
202.41 +
202.42 +#include "api_info.h" // me
202.43 +
202.44 +// trace flag, loglevel, name
202.45 +dllapi_info_t dllapi_info = {
202.46 + { mFALSE, 3, "GameDLLInit" }, // pfnGameInit
202.47 + { mFALSE, 10, "DispatchSpawn" }, // pfnSpawn
202.48 + { mFALSE, 16, "DispatchThink" }, // pfnThink
202.49 + { mFALSE, 9, "DispatchUse" }, // pfnUse
202.50 + { mFALSE, 11, "DispatchTouch" }, // pfnTouch
202.51 + { mFALSE, 9, "DispatchBlocked" }, // pfnBlocked
202.52 + { mFALSE, 10, "DispatchKeyValue" }, // pfnKeyValue
202.53 + { mFALSE, 9, "DispatchSave" }, // pfnSave
202.54 + { mFALSE, 9, "DispatchRestore" }, // pfnRestore
202.55 + { mFALSE, 20, "DispatchObjectCollsionBox" }, // pfnSetAbsBox
202.56 + { mFALSE, 9, "SaveWriteFields" }, // pfnSaveWriteFields
202.57 + { mFALSE, 9, "SaveReadFields" }, // pfnSaveReadFields
202.58 + { mFALSE, 9, "SaveGlobalState" }, // pfnSaveGlobalState
202.59 + { mFALSE, 9, "RestoreGlobalState" }, // pfnRestoreGlobalState
202.60 + { mFALSE, 9, "ResetGlobalState" }, // pfnResetGlobalState
202.61 + { mFALSE, 3, "ClientConnect" }, // pfnClientConnect
202.62 + { mFALSE, 3, "ClientDisconnect" }, // pfnClientDisconnect
202.63 + { mFALSE, 3, "ClientKill" }, // pfnClientKill
202.64 + { mFALSE, 3, "ClientPutInServer" }, // pfnClientPutInServer
202.65 + { mFALSE, 9, "ClientCommand" }, // pfnClientCommand
202.66 + { mFALSE, 11, "ClientUserInfoChanged" }, // pfnClientUserInfoChanged
202.67 + { mFALSE, 3, "ServerActivate" }, // pfnServerActivate
202.68 + { mFALSE, 3, "ServerDeactivate" }, // pfnServerDeactivate
202.69 + { mFALSE, 14, "PlayerPreThink" }, // pfnPlayerPreThink
202.70 + { mFALSE, 14, "PlayerPostThink" }, // pfnPlayerPostThink
202.71 + { mFALSE, 18, "StartFrame" }, // pfnStartFrame
202.72 + { mFALSE, 9, "ParmsNewLevel" }, // pfnParmsNewLevel
202.73 + { mFALSE, 9, "ParmsChangeLevel" }, // pfnParmsChangeLevel
202.74 + { mFALSE, 9, "GetGameDescription" }, // pfnGetGameDescription
202.75 + { mFALSE, 9, "PlayerCustomization" }, // pfnPlayerCustomization
202.76 + { mFALSE, 9, "SpectatorConnect" }, // pfnSpectatorConnect
202.77 + { mFALSE, 9, "SpectatorDisconnect" }, // pfnSpectatorDisconnect
202.78 + { mFALSE, 9, "SpectatorThink" }, // pfnSpectatorThink
202.79 + { mFALSE, 3, "Sys_Error" }, // pfnSys_Error
202.80 + { mFALSE, 13, "PM_Move" }, // pfnPM_Move
202.81 + { mFALSE, 9, "PM_Init" }, // pfnPM_Init
202.82 + { mFALSE, 9, "PM_FindTextureType" }, // pfnPM_FindTextureType
202.83 + { mFALSE, 12, "SetupVisibility" }, // pfnSetupVisibility
202.84 + { mFALSE, 12, "UpdateClientData" }, // pfnUpdateClientData
202.85 + { mFALSE, 16, "AddToFullPack" }, // pfnAddToFullPack
202.86 + { mFALSE, 9, "CreateBaseline" }, // pfnCreateBaseline
202.87 + { mFALSE, 9, "RegisterEncoders" }, // pfnRegisterEncoders
202.88 + { mFALSE, 9, "GetWeaponData" }, // pfnGetWeaponData
202.89 + { mFALSE, 15, "CmdStart" }, // pfnCmdStart
202.90 + { mFALSE, 15, "CmdEnd" }, // pfnCmdEnd
202.91 + { mFALSE, 9, "ConnectionlessPacket" }, // pfnConnectionlessPacket
202.92 + { mFALSE, 9, "GetHullBounds" }, // pfnGetHullBounds
202.93 + { mFALSE, 9, "CreateInstancedBaselines" }, // pfnCreateInstancedBaselines
202.94 + { mFALSE, 3, "InconsistentFile" }, // pfnInconsistentFile
202.95 + { mFALSE, 20, "AllowLagCompensation" }, // pfnAllowLagCompensation
202.96 + { mFALSE, 0, NULL },
202.97 +};
202.98 +
202.99 +newapi_info_t newapi_info = {
202.100 + { mFALSE, 16, "OnFreeEntPrivateData" }, // pfnOnFreeEntPrivateData
202.101 + { mFALSE, 3, "GameShutdown" }, // pfnGameShutdown
202.102 + { mFALSE, 14, "ShouldCollide" }, // pfnShouldCollide
202.103 + { mFALSE, 0, NULL },
202.104 +};
202.105 +
202.106 +engine_info_t engine_info = {
202.107 + { mFALSE, 13, "PrecacheModel" }, // pfnPrecacheModel
202.108 + { mFALSE, 13, "PrecacheSound" }, // pfnPrecacheSound
202.109 + { mFALSE, 18, "SetModel" }, // pfnSetModel
202.110 + { mFALSE, 34, "ModelIndex" }, // pfnModelIndex
202.111 + { mFALSE, 10, "ModelFrames" }, // pfnModelFrames
202.112 + { mFALSE, 14, "SetSize" }, // pfnSetSize
202.113 + { mFALSE, 9, "ChangeLevel" }, // pfnChangeLevel
202.114 + { mFALSE, 9, "GetSpawnParms" }, // pfnGetSpawnParms
202.115 + { mFALSE, 9, "SaveSpawnParms" }, // pfnSaveSpawnParms
202.116 + { mFALSE, 9, "VecToYaw" }, // pfnVecToYaw
202.117 + { mFALSE, 14, "VecToAngles" }, // pfnVecToAngles
202.118 + { mFALSE, 9, "MoveToOrigin" }, // pfnMoveToOrigin
202.119 + { mFALSE, 9, "ChangeYaw" }, // pfnChangeYaw
202.120 + { mFALSE, 9, "ChangePitch" }, // pfnChangePitch
202.121 + { mFALSE, 32, "FindEntityByString" }, // pfnFindEntityByString
202.122 + { mFALSE, 9, "GetEntityIllum" }, // pfnGetEntityIllum
202.123 + { mFALSE, 9, "FindEntityInSphere" }, // pfnFindEntityInSphere
202.124 + { mFALSE, 19, "FindClientInPVS" }, // pfnFindClientInPVS
202.125 + { mFALSE, 9, "EntitiesInPVS" }, // pfnEntitiesInPVS
202.126 + { mFALSE, 40, "MakeVectors" }, // pfnMakeVectors
202.127 + { mFALSE, 9, "AngleVectors" }, // pfnAngleVectors
202.128 + { mFALSE, 13, "CreateEntity" }, // pfnCreateEntity
202.129 + { mFALSE, 13, "RemoveEntity" }, // pfnRemoveEntity
202.130 + { mFALSE, 13, "CreateNamedEntity" }, // pfnCreateNamedEntity
202.131 + { mFALSE, 9, "MakeStatic" }, // pfnMakeStatic
202.132 + { mFALSE, 9, "EntIsOnFloor" }, // pfnEntIsOnFloor
202.133 + { mFALSE, 9, "DropToFloor" }, // pfnDropToFloor
202.134 + { mFALSE, 9, "WalkMove" }, // pfnWalkMove
202.135 + { mFALSE, 14, "SetOrigin" }, // pfnSetOrigin
202.136 + { mFALSE, 12, "EmitSound" }, // pfnEmitSound
202.137 + { mFALSE, 12, "EmitAmbientSound" }, // pfnEmitAmbientSound
202.138 + { mFALSE, 20, "TraceLine" }, // pfnTraceLine
202.139 + { mFALSE, 9, "TraceToss" }, // pfnTraceToss
202.140 + { mFALSE, 9, "TraceMonsterHull" }, // pfnTraceMonsterHull
202.141 + { mFALSE, 9, "TraceHull" }, // pfnTraceHull
202.142 + { mFALSE, 9, "TraceModel" }, // pfnTraceModel
202.143 + { mFALSE, 15, "TraceTexture" }, // pfnTraceTexture // CS: when moving
202.144 + { mFALSE, 9, "TraceSphere" }, // pfnTraceSphere
202.145 + { mFALSE, 9, "GetAimVector" }, // pfnGetAimVector
202.146 + { mFALSE, 9, "ServerCommand" }, // pfnServerCommand
202.147 + { mFALSE, 9, "ServerExecute" }, // pfnServerExecute
202.148 + { mFALSE, 11, "engClientCommand" }, // pfnClientCommand // d'oh, ClientCommand in dllapi too
202.149 + { mFALSE, 9, "ParticleEffect" }, // pfnParticleEffect
202.150 + { mFALSE, 9, "LightStyle" }, // pfnLightStyle
202.151 + { mFALSE, 9, "DecalIndex" }, // pfnDecalIndex
202.152 + { mFALSE, 15, "PointContents" }, // pfnPointContents // CS: when moving
202.153 + { mFALSE, 22, "MessageBegin" }, // pfnMessageBegin
202.154 + { mFALSE, 22, "MessageEnd" }, // pfnMessageEnd
202.155 + { mFALSE, 30, "WriteByte" }, // pfnWriteByte
202.156 + { mFALSE, 23, "WriteChar" }, // pfnWriteChar
202.157 + { mFALSE, 24, "WriteShort" }, // pfnWriteShort
202.158 + { mFALSE, 23, "WriteLong" }, // pfnWriteLong
202.159 + { mFALSE, 23, "WriteAngle" }, // pfnWriteAngle
202.160 + { mFALSE, 23, "WriteCoord" }, // pfnWriteCoord
202.161 + { mFALSE, 25, "WriteString" }, // pfnWriteString
202.162 + { mFALSE, 23, "WriteEntity" }, // pfnWriteEntity
202.163 + { mFALSE, 9, "CVarRegister" }, // pfnCVarRegister
202.164 + { mFALSE, 21, "CVarGetFloat" }, // pfnCVarGetFloat
202.165 + { mFALSE, 9, "CVarGetString" }, // pfnCVarGetString
202.166 + { mFALSE, 10, "CVarSetFloat" }, // pfnCVarSetFloat
202.167 + { mFALSE, 9, "CVarSetString" }, // pfnCVarSetString
202.168 + { mFALSE, 15, "AlertMessage" }, // pfnAlertMessage
202.169 + { mFALSE, 17, "EngineFprintf" }, // pfnEngineFprintf
202.170 + { mFALSE, 14, "PvAllocEntPrivateData" }, // pfnPvAllocEntPrivateData
202.171 + { mFALSE, 9, "PvEntPrivateData" }, // pfnPvEntPrivateData
202.172 + { mFALSE, 9, "FreeEntPrivateData" }, // pfnFreeEntPrivateData
202.173 + { mFALSE, 9, "SzFromIndex" }, // pfnSzFromIndex
202.174 + { mFALSE, 10, "AllocString" }, // pfnAllocString
202.175 + { mFALSE, 9, "GetVarsOfEnt" }, // pfnGetVarsOfEnt
202.176 + { mFALSE, 14, "PEntityOfEntOffset" }, // pfnPEntityOfEntOffset
202.177 + { mFALSE, 19, "EntOffsetOfPEntity" }, // pfnEntOffsetOfPEntity
202.178 + { mFALSE, 14, "IndexOfEdict" }, // pfnIndexOfEdict
202.179 + { mFALSE, 17, "PEntityOfEntIndex" }, // pfnPEntityOfEntIndex
202.180 + { mFALSE, 9, "FindEntityByVars" }, // pfnFindEntityByVars
202.181 + { mFALSE, 14, "GetModelPtr" }, // pfnGetModelPtr
202.182 + { mFALSE, 9, "RegUserMsg" }, // pfnRegUserMsg
202.183 + { mFALSE, 9, "AnimationAutomove" }, // pfnAnimationAutomove
202.184 + { mFALSE, 9, "GetBonePosition" }, // pfnGetBonePosition
202.185 + { mFALSE, 9, "FunctionFromName" }, // pfnFunctionFromName
202.186 + { mFALSE, 9, "NameForFunction" }, // pfnNameForFunction
202.187 + { mFALSE, 9, "ClientPrintf" }, // pfnClientPrintf
202.188 + { mFALSE, 9, "ServerPrint" }, // pfnServerPrint
202.189 + { mFALSE, 13, "Cmd_Args" }, // pfnCmd_Args
202.190 + { mFALSE, 13, "Cmd_Argv" }, // pfnCmd_Argv
202.191 + { mFALSE, 13, "Cmd_Argc" }, // pfnCmd_Argc
202.192 + { mFALSE, 9, "GetAttachment" }, // pfnGetAttachment
202.193 + { mFALSE, 9, "CRC32_Init" }, // pfnCRC32_Init
202.194 + { mFALSE, 9, "CRC32_ProcessBuffer" }, // pfnCRC32_ProcessBuffer
202.195 + { mFALSE, 9, "CRC32_ProcessByte" }, // pfnCRC32_ProcessByte
202.196 + { mFALSE, 9, "CRC32_Final" }, // pfnCRC32_Final
202.197 + { mFALSE, 16, "RandomLong" }, // pfnRandomLong
202.198 + { mFALSE, 14, "RandomFloat" }, // pfnRandomFloat // CS: when firing
202.199 + { mFALSE, 14, "SetView" }, // pfnSetView
202.200 + { mFALSE, 9, "Time" }, // pfnTime
202.201 + { mFALSE, 9, "CrosshairAngle" }, // pfnCrosshairAngle
202.202 + { mFALSE, 10, "LoadFileForMe" }, // pfnLoadFileForMe
202.203 + { mFALSE, 10, "FreeFile" }, // pfnFreeFile
202.204 + { mFALSE, 9, "EndSection" }, // pfnEndSection
202.205 + { mFALSE, 9, "CompareFileTime" }, // pfnCompareFileTime
202.206 + { mFALSE, 9, "GetGameDir" }, // pfnGetGameDir
202.207 + { mFALSE, 9, "Cvar_RegisterVariable" }, // pfnCvar_RegisterVariable
202.208 + { mFALSE, 9, "FadeClientVolume" }, // pfnFadeClientVolume
202.209 + { mFALSE, 14, "SetClientMaxspeed" }, // pfnSetClientMaxspeed
202.210 + { mFALSE, 9, "CreateFakeClient" }, // pfnCreateFakeClient
202.211 + { mFALSE, 9, "RunPlayerMove" }, // pfnRunPlayerMove
202.212 + { mFALSE, 9, "NumberOfEntities" }, // pfnNumberOfEntities
202.213 + { mFALSE, 17, "GetInfoKeyBuffer" }, // pfnGetInfoKeyBuffer
202.214 + { mFALSE, 13, "InfoKeyValue" }, // pfnInfoKeyValue
202.215 + { mFALSE, 9, "SetKeyValue" }, // pfnSetKeyValue
202.216 + { mFALSE, 12, "SetClientKeyValue" }, // pfnSetClientKeyValue
202.217 + { mFALSE, 9, "IsMapValid" }, // pfnIsMapValid
202.218 + { mFALSE, 9, "StaticDecal" }, // pfnStaticDecal
202.219 + { mFALSE, 9, "PrecacheGeneric" }, // pfnPrecacheGeneric
202.220 + { mFALSE, 10, "GetPlayerUserId" }, // pfnGetPlayerUserId
202.221 + { mFALSE, 9, "BuildSoundMsg" }, // pfnBuildSoundMsg
202.222 + { mFALSE, 9, "IsDedicatedServer" }, // pfnIsDedicatedServer
202.223 + { mFALSE, 9, "CVarGetPointer" }, // pfnCVarGetPointer
202.224 + { mFALSE, 9, "GetPlayerWONId" }, // pfnGetPlayerWONId
202.225 + { mFALSE, 9, "Info_RemoveKey" }, // pfnInfo_RemoveKey
202.226 + { mFALSE, 15, "GetPhysicsKeyValue" }, // pfnGetPhysicsKeyValue
202.227 + { mFALSE, 14, "SetPhysicsKeyValue" }, // pfnSetPhysicsKeyValue
202.228 + { mFALSE, 15, "GetPhysicsInfoString" }, // pfnGetPhysicsInfoString
202.229 + { mFALSE, 13, "PrecacheEvent" }, // pfnPrecacheEvent
202.230 + { mFALSE, 9, "PlaybackEvent" }, // pfnPlaybackEvent
202.231 + { mFALSE, 31, "SetFatPVS" }, // pfnSetFatPVS
202.232 + { mFALSE, 31, "SetFatPAS" }, // pfnSetFatPAS
202.233 + { mFALSE, 50, "CheckVisibility" }, // pfnCheckVisibility
202.234 + { mFALSE, 37, "DeltaSetField" }, // pfnDeltaSetField
202.235 + { mFALSE, 38, "DeltaUnsetField" }, // pfnDeltaUnsetField
202.236 + { mFALSE, 9, "DeltaAddEncoder" }, // pfnDeltaAddEncoder
202.237 + { mFALSE, 45, "GetCurrentPlayer" }, // pfnGetCurrentPlayer
202.238 + { mFALSE, 14, "CanSkipPlayer" }, // pfnCanSkipPlayer
202.239 + { mFALSE, 9, "DeltaFindField" }, // pfnDeltaFindField
202.240 + { mFALSE, 37, "DeltaSetFieldByIndex" }, // pfnDeltaSetFieldByIndex
202.241 + { mFALSE, 38, "DeltaUnsetFieldByIndex" }, // pfnDeltaUnsetFieldByIndex
202.242 + { mFALSE, 9, "SetGroupMask" }, // pfnSetGroupMask
202.243 + { mFALSE, 9, "engCreateInstancedBaseline" }, // pfnCreateInstancedBaseline // d'oh, CreateInstancedBaseline in dllapi too
202.244 + { mFALSE, 9, "Cvar_DirectSet" }, // pfnCvar_DirectSet
202.245 + { mFALSE, 9, "ForceUnmodified" }, // pfnForceUnmodified
202.246 + { mFALSE, 9, "GetPlayerStats" }, // pfnGetPlayerStats
202.247 + { mFALSE, 3, "AddServerCommand" }, // pfnAddServerCommand
202.248 + // Added in SDK 2.2:
202.249 + { mFALSE, 9, "Voice_GetClientListening" }, // Voice_GetClientListening
202.250 + { mFALSE, 9, "Voice_SetClientListening" }, // Voice_SetClientListening
202.251 + // Added for HL 1109 (no SDK update):
202.252 + { mFALSE, 9, "GetPlayerAuthId" }, // pfnGetPlayerAuthId
202.253 + // Added 2003/11/10 (no SDK update):
202.254 + { mFALSE, 30, "SequenceGet" }, // pfnSequenceGet
202.255 + { mFALSE, 30, "SequencePickSentence" }, // pfnSequencePickSentence
202.256 + { mFALSE, 30, "GetFileSize" }, // pfnGetFileSize
202.257 + { mFALSE, 30, "GetApproxWavePlayLen" }, // pfnGetApproxWavePlayLen
202.258 + { mFALSE, 30, "IsCareerMatch" }, // pfnIsCareerMatch
202.259 + { mFALSE, 30, "GetLocalizedStringLength" }, // pfnGetLocalizedStringLength
202.260 + { mFALSE, 30, "RegisterTutorMessageShown" }, // pfnRegisterTutorMessageShown
202.261 + { mFALSE, 30, "GetTimesTutorMessageShown" }, // pfnGetTimesTutorMessageShown
202.262 + { mFALSE, 30, "ProcessTutorMessageDecayBuffer" }, // pfnProcessTutorMessageDecayBuffer
202.263 + { mFALSE, 30, "ConstructTutorMessageDecayBuffer" }, // pfnConstructTutorMessageDecayBuffer
202.264 + { mFALSE, 9, "ResetTutorMessageDecayData" }, // pfnResetTutorMessageDecayData
202.265 + // end
202.266 + { mFALSE, 0, NULL },
202.267 +};
203.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
203.2 +++ b/trace_plugin/dllapi.cpp Tue Apr 06 07:36:14 2004 +0000
203.3 @@ -0,0 +1,432 @@
203.4 +// vi: set ts=4 sw=4 :
203.5 +// vim: set tw=75 :
203.6 +
203.7 +// dllapi.cpp - implementation of Half-Life DLL routines
203.8 +
203.9 +/*
203.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
203.11 + *
203.12 + * This file is part of Metamod.
203.13 + *
203.14 + * Metamod is free software; you can redistribute it and/or modify it
203.15 + * under the terms of the GNU General Public License as published by the
203.16 + * Free Software Foundation; either version 2 of the License, or (at
203.17 + * your option) any later version.
203.18 + *
203.19 + * Metamod is distributed in the hope that it will be useful, but
203.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
203.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
203.22 + * General Public License for more details.
203.23 + *
203.24 + * You should have received a copy of the GNU General Public License
203.25 + * along with Metamod; if not, write to the Free Software Foundation,
203.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
203.27 + *
203.28 + * In addition, as a special exception, the author gives permission to
203.29 + * link the code of this program with the Half-Life Game Engine ("HL
203.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
203.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
203.32 + * respects for all of the code used other than the HL Engine and MODs
203.33 + * from Valve. If you modify this file, you may extend this exception
203.34 + * to your version of the file, but you are not obligated to do so. If
203.35 + * you do not wish to do so, delete this exception statement from your
203.36 + * version.
203.37 + *
203.38 + */
203.39 +
203.40 +#include <extdll.h>
203.41 +#include <sdk_util.h>
203.42 +#include <cbase.h>
203.43 +#include <player.h>
203.44 +
203.45 +#include <dllapi.h>
203.46 +#include <meta_api.h>
203.47 +#include <sdk_util.h>
203.48 +
203.49 +#include "trace_api.h"
203.50 +#include "log_plugin.h"
203.51 +
203.52 +// from SDK dlls/game.cpp:
203.53 +void GameDLLInit( void ) {
203.54 + DLL_TRACE(pfnGameInit, P_PRE, (""));
203.55 + RETURN_META(MRES_IGNORED);
203.56 +}
203.57 +
203.58 +// from SDK dlls/cbase.cpp:
203.59 +int DispatchSpawn( edict_t *pent ) {
203.60 + edict_t *ed=pent;
203.61 + DLL_TRACE(pfnSpawn, P_PRE, ("classname=%s",
203.62 + ed ? STRING(ed->v.classname) : "nil"));
203.63 + // 0==Success, -1==Failure ?
203.64 + RETURN_META_VALUE(MRES_IGNORED, 0);
203.65 +}
203.66 +void DispatchThink( edict_t *pent ) {
203.67 + DLL_TRACE(pfnThink, P_PRE, (""));
203.68 + RETURN_META(MRES_IGNORED);
203.69 +}
203.70 +void DispatchUse( edict_t *pentUsed, edict_t *pentOther ) {
203.71 + DLL_TRACE(pfnUse, P_PRE, (""));
203.72 + RETURN_META(MRES_IGNORED);
203.73 +}
203.74 +void DispatchTouch( edict_t *pentTouched, edict_t *pentOther ) {
203.75 + DLL_TRACE(pfnTouch, P_PRE, (""));
203.76 + RETURN_META(MRES_IGNORED);
203.77 +}
203.78 +void DispatchBlocked( edict_t *pentBlocked, edict_t *pentOther ) {
203.79 + DLL_TRACE(pfnBlocked, P_PRE, (""));
203.80 + RETURN_META(MRES_IGNORED);
203.81 +}
203.82 +void DispatchKeyValue( edict_t *pentKeyvalue, KeyValueData *pkvd ) {
203.83 + DLL_TRACE(pfnKeyValue, P_PRE, ("classname=%s keyname=%s value=%s", P_PRE,
203.84 + pkvd->szClassName, pkvd->szKeyName, pkvd->szValue));
203.85 + RETURN_META(MRES_IGNORED);
203.86 +}
203.87 +void DispatchSave( edict_t *pent, SAVERESTOREDATA *pSaveData ) {
203.88 + DLL_TRACE(pfnSave, P_PRE, (""));
203.89 + RETURN_META(MRES_IGNORED);
203.90 +}
203.91 +int DispatchRestore( edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity ) {
203.92 + DLL_TRACE(pfnRestore, P_PRE, (""));
203.93 + // 0==Success, -1==Failure ?
203.94 + RETURN_META_VALUE(MRES_IGNORED, 0);
203.95 +}
203.96 +void DispatchObjectCollsionBox( edict_t *pent ) {
203.97 + edict_t *ed=pent;
203.98 + DLL_TRACE(pfnSetAbsBox, P_PRE, ("classname=%s netname=%s",
203.99 + ed ? STRING(ed->v.classname) : "nil",
203.100 + ed ? STRING(ed->v.netname) : "nil"));
203.101 + RETURN_META(MRES_IGNORED);
203.102 +}
203.103 +void SaveWriteFields( SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount ) {
203.104 + DLL_TRACE(pfnSaveWriteFields, P_PRE, (""));
203.105 + RETURN_META(MRES_IGNORED);
203.106 +}
203.107 +void SaveReadFields( SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount ) {
203.108 + DLL_TRACE(pfnSaveReadFields, P_PRE, (""));
203.109 + RETURN_META(MRES_IGNORED);
203.110 +}
203.111 +
203.112 +// from SDK dlls/world.cpp:
203.113 +void SaveGlobalState( SAVERESTOREDATA *pSaveData ) {
203.114 + DLL_TRACE(pfnSaveGlobalState, P_PRE, (""));
203.115 + RETURN_META(MRES_IGNORED);
203.116 +}
203.117 +void RestoreGlobalState( SAVERESTOREDATA *pSaveData ) {
203.118 + DLL_TRACE(pfnRestoreGlobalState, P_PRE, (""));
203.119 + RETURN_META(MRES_IGNORED);
203.120 +}
203.121 +void ResetGlobalState( void ) {
203.122 + DLL_TRACE(pfnResetGlobalState, P_PRE, (""));
203.123 + RETURN_META(MRES_IGNORED);
203.124 +}
203.125 +
203.126 +//! from SDK dlls/client.cpp:
203.127 +BOOL ClientConnect( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] ) {
203.128 + DLL_TRACE(pfnClientConnect, P_PRE, ("name=%s, addr=%s", pszName, pszAddress));
203.129 + RETURN_META_VALUE(MRES_IGNORED, FALSE);
203.130 +}
203.131 +void ClientDisconnect( edict_t *pEntity ) {
203.132 + // DLL_TRACE(pfnClientDisconnect, P_PRE, ("name=%s", ENTITY_KEYVALUE(pEntity, "name")));
203.133 + DLL_TRACE(pfnClientDisconnect, P_PRE, ("name=%s", STRING(pEntity->v.netname)));
203.134 + RETURN_META(MRES_IGNORED);
203.135 +}
203.136 +void ClientKill( edict_t *pEntity ) {
203.137 + DLL_TRACE(pfnClientKill, P_PRE, ("name=%s", STRING(pEntity->v.netname)));
203.138 + RETURN_META(MRES_IGNORED);
203.139 +}
203.140 +void ClientPutInServer( edict_t *pEntity ) {
203.141 + CBaseEntity *pPlayer=NULL;
203.142 + pPlayer=(CBasePlayer*)GET_PRIVATE(pEntity);
203.143 + DLL_TRACE(pfnClientPutInServer, P_PRE, ("name=%s", STRING(pEntity->v.netname)));
203.144 + RETURN_META(MRES_IGNORED);
203.145 +}
203.146 +void ClientCommand( edict_t *pEntity ) {
203.147 + DLL_TRACE(pfnClientCommand, P_PRE, ("name=%s, cmd='%s %s'", STRING(pEntity->v.netname), CMD_ARGV(0),
203.148 + CMD_ARGC() >= 1 ? CMD_ARGS() : ""));
203.149 + RETURN_META(MRES_IGNORED);
203.150 +}
203.151 +void ClientUserInfoChanged( edict_t *pEntity, char *infobuffer ) {
203.152 + DLL_TRACE(pfnClientUserInfoChanged, P_PRE, ("name=%s", STRING(pEntity->v.netname)));
203.153 + RETURN_META(MRES_IGNORED);
203.154 +}
203.155 +void ServerActivate( edict_t *pEdictList, int edictCount, int clientMax ) {
203.156 + DLL_TRACE(pfnServerActivate, P_PRE, ("count=%d, max=%d", edictCount, clientMax));
203.157 + RETURN_META(MRES_IGNORED);
203.158 +}
203.159 +void ServerDeactivate( void ) {
203.160 + DLL_TRACE(pfnServerDeactivate, P_PRE, (""));
203.161 + RETURN_META(MRES_IGNORED);
203.162 +}
203.163 +void PlayerPreThink( edict_t *pEntity ) {
203.164 + DLL_TRACE(pfnPlayerPreThink, P_PRE, ("name=%s", STRING(pEntity->v.netname)));
203.165 + RETURN_META(MRES_IGNORED);
203.166 +}
203.167 +void PlayerPostThink( edict_t *pEntity ) {
203.168 + DLL_TRACE(pfnPlayerPostThink, P_PRE, ("name=%s", STRING(pEntity->v.netname)));
203.169 + RETURN_META(MRES_IGNORED);
203.170 +}
203.171 +void StartFrame( void ) {
203.172 + DLL_TRACE(pfnStartFrame, P_PRE, (""));
203.173 + RETURN_META(MRES_IGNORED);
203.174 +}
203.175 +void ParmsNewLevel( void ) {
203.176 + DLL_TRACE(pfnParmsNewLevel, P_PRE, (""));
203.177 + RETURN_META(MRES_IGNORED);
203.178 +}
203.179 +void ParmsChangeLevel( void ) {
203.180 + DLL_TRACE(pfnParmsChangeLevel, P_PRE, (""));
203.181 + RETURN_META(MRES_IGNORED);
203.182 +}
203.183 +const char *GetGameDescription( void ) {
203.184 + DLL_TRACE(pfnGetGameDescription, P_PRE, (""));
203.185 + RETURN_META_VALUE(MRES_IGNORED, "");
203.186 +}
203.187 +void PlayerCustomization( edict_t *pEntity, customization_t *pCust ) {
203.188 + DLL_TRACE(pfnPlayerCustomization, P_PRE, ("name=%s", STRING(pEntity->v.netname)));
203.189 + RETURN_META(MRES_IGNORED);
203.190 +}
203.191 +void SpectatorConnect( edict_t *pEntity ) {
203.192 + DLL_TRACE(pfnSpectatorConnect, P_PRE, (""));
203.193 + RETURN_META(MRES_IGNORED);
203.194 +}
203.195 +void SpectatorDisconnect( edict_t *pEntity ) {
203.196 + DLL_TRACE(pfnSpectatorDisconnect, P_PRE, (""));
203.197 + RETURN_META(MRES_IGNORED);
203.198 +}
203.199 +void SpectatorThink( edict_t *pEntity ) {
203.200 + DLL_TRACE(pfnSpectatorThink, P_PRE, (""));
203.201 + RETURN_META(MRES_IGNORED);
203.202 +}
203.203 +void Sys_Error( const char *error_string ) {
203.204 + DLL_TRACE(pfnSys_Error, P_PRE, ("string=%s", error_string));
203.205 + RETURN_META(MRES_IGNORED);
203.206 +}
203.207 +
203.208 +// from SDK pm_shared/pm_shared.c:
203.209 +void PM_Move ( struct playermove_s *ppmove, int server ) {
203.210 + DLL_TRACE(pfnPM_Move, P_PRE, (""));
203.211 + RETURN_META(MRES_IGNORED);
203.212 +}
203.213 +void PM_Init( struct playermove_s *ppmove ) {
203.214 + DLL_TRACE(pfnPM_Init, P_PRE, (""));
203.215 + RETURN_META(MRES_IGNORED);
203.216 +}
203.217 +char PM_FindTextureType( char *name ) {
203.218 + DLL_TRACE(pfnPM_FindTextureType, P_PRE, ("name=%s", name));
203.219 + RETURN_META_VALUE(MRES_IGNORED, '\0');
203.220 +}
203.221 +
203.222 +// from SDK dlls/client.cpp:
203.223 +void SetupVisibility( edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas ) {
203.224 + DLL_TRACE(pfnSetupVisibility, P_PRE, (""));
203.225 + RETURN_META(MRES_IGNORED);
203.226 +}
203.227 +void UpdateClientData ( const struct edict_s *ent, int sendweapons, struct clientdata_s *cd ) {
203.228 + DLL_TRACE(pfnUpdateClientData, P_PRE, (""));
203.229 + RETURN_META(MRES_IGNORED);
203.230 +}
203.231 +int AddToFullPack( struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet ) {
203.232 + DLL_TRACE(pfnAddToFullPack, P_PRE, (""));
203.233 + RETURN_META_VALUE(MRES_IGNORED, 0);
203.234 +}
203.235 +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 ) {
203.236 + DLL_TRACE(pfnCreateBaseline, P_PRE, (""));
203.237 + RETURN_META(MRES_IGNORED);
203.238 +}
203.239 +void RegisterEncoders( void ) {
203.240 + DLL_TRACE(pfnRegisterEncoders, P_PRE, (""));
203.241 + RETURN_META(MRES_IGNORED);
203.242 +}
203.243 +int GetWeaponData( struct edict_s *player, struct weapon_data_s *info ) {
203.244 + DLL_TRACE(pfnGetWeaponData, P_PRE, (""));
203.245 + RETURN_META_VALUE(MRES_IGNORED, 1);
203.246 +}
203.247 +void CmdStart( const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed ) {
203.248 + DLL_TRACE(pfnCmdStart, P_PRE, ("name=%s, rand=%d", STRING(player->v.netname), random_seed));
203.249 + RETURN_META(MRES_IGNORED);
203.250 +}
203.251 +void CmdEnd ( const edict_t *player ) {
203.252 + DLL_TRACE(pfnCmdEnd, P_PRE, ("name=%s", STRING(player->v.netname)));
203.253 + RETURN_META(MRES_IGNORED);
203.254 +}
203.255 +int ConnectionlessPacket( const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size ) {
203.256 + DLL_TRACE(pfnConnectionlessPacket, P_PRE, (""));
203.257 + RETURN_META_VALUE(MRES_IGNORED, 0);
203.258 +}
203.259 +int GetHullBounds( int hullnumber, float *mins, float *maxs ) {
203.260 + DLL_TRACE(pfnGetHullBounds, P_PRE, (""));
203.261 + RETURN_META_VALUE(MRES_IGNORED, 0);
203.262 +}
203.263 +void CreateInstancedBaselines ( void ) {
203.264 + DLL_TRACE(pfnCreateInstancedBaselines, P_PRE, (""));
203.265 + RETURN_META(MRES_IGNORED);
203.266 +}
203.267 +int InconsistentFile( const edict_t *player, const char *filename, char *disconnect_message ) {
203.268 + DLL_TRACE(pfnInconsistentFile, P_PRE, ("name=%s, file=%s", STRING(player->v.netname), filename));
203.269 + RETURN_META_VALUE(MRES_IGNORED, 0);
203.270 +}
203.271 +int AllowLagCompensation( void ) {
203.272 + DLL_TRACE(pfnAllowLagCompensation, P_PRE, (""));
203.273 + RETURN_META_VALUE(MRES_IGNORED, 1);
203.274 +}
203.275 +
203.276 +
203.277 +// from SDK ?
203.278 +void OnFreeEntPrivateData(edict_t *pEnt) {
203.279 + NEWDLL_TRACE(pfnOnFreeEntPrivateData, P_PRE, (""));
203.280 + RETURN_META(MRES_IGNORED);
203.281 +}
203.282 +void GameShutdown(void) {
203.283 + NEWDLL_TRACE(pfnGameShutdown, P_PRE, (""));
203.284 + RETURN_META(MRES_IGNORED);
203.285 +}
203.286 +int ShouldCollide(edict_t *pentTouched, edict_t *pentOther) {
203.287 + NEWDLL_TRACE(pfnShouldCollide, P_PRE, (""));
203.288 + RETURN_META_VALUE(MRES_IGNORED, 1);
203.289 +}
203.290 +
203.291 +
203.292 +// from SDK dlls/cbase.cpp:
203.293 +// (wd) indicates my comments on the functions
203.294 +static DLL_FUNCTIONS gFunctionTable =
203.295 +{
203.296 + GameDLLInit, //! pfnGameInit() Initialize the game (one-time call after loading of game .dll)
203.297 + DispatchSpawn, //! pfnSpawn()
203.298 + DispatchThink, //! pfnThink()
203.299 + DispatchUse, //! pfnUse()
203.300 + DispatchTouch, //! pfnTouch()
203.301 + DispatchBlocked, //! pfnBlocked()
203.302 + DispatchKeyValue, //! pfnKeyValue()
203.303 + DispatchSave, //! pfnSave()
203.304 + DispatchRestore, //! pfnRestore()
203.305 + DispatchObjectCollsionBox, //! pfnSetAbsBox()
203.306 +
203.307 + SaveWriteFields, //! pfnSaveWriteFields()
203.308 + SaveReadFields, //! pfnSaveReadFields()
203.309 +
203.310 + SaveGlobalState, //! pfnSaveGlobalState()
203.311 + RestoreGlobalState, //! pfnRestoreGlobalState()
203.312 + ResetGlobalState, //! pfnResetGlobalState()
203.313 +
203.314 + ClientConnect, //! pfnClientConnect() (wd) Client has connected
203.315 + ClientDisconnect, //! pfnClientDisconnect() (wd) Player has left the game
203.316 + ClientKill, //! pfnClientKill() (wd) Player has typed "kill"
203.317 + ClientPutInServer, //! pfnClientPutInServer() (wd) Client is entering the game
203.318 + ClientCommand, //! pfnClientCommand() (wd) Player has sent a command (typed, or from a bind)
203.319 + ClientUserInfoChanged, //! pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure
203.320 + ServerActivate, //! pfnServerActivate() (wd) Server is starting a new map
203.321 + ServerDeactivate, //! pfnServerDeactivate() (wd) Server is leaving the map (shutdown, or changelevel); SDK2
203.322 +
203.323 + PlayerPreThink, //! pfnPlayerPreThink()
203.324 + PlayerPostThink, //! pfnPlayerPostThink()
203.325 +
203.326 + StartFrame, //! pfnStartFrame()
203.327 + ParmsNewLevel, //! pfnParmsNewLevel()
203.328 + ParmsChangeLevel, //! pfnParmsChangeLevel()
203.329 +
203.330 + GetGameDescription, //! pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2", "Half-Life"
203.331 + PlayerCustomization, //! pfnPlayerCustomization() Notifies .dll of new customization for player.
203.332 +
203.333 + SpectatorConnect, //! pfnSpectatorConnect() Called when spectator joins server
203.334 + SpectatorDisconnect, //! pfnSpectatorDisconnect() Called when spectator leaves the server
203.335 + SpectatorThink, //! pfnSpectatorThink() Called when spectator sends a command packet (usercmd_t)
203.336 +
203.337 + Sys_Error, //! pfnSys_Error() Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint. SDK2
203.338 +
203.339 + PM_Move, //! pfnPM_Move() (wd) SDK2
203.340 + PM_Init, //! pfnPM_Init() Server version of player movement initialization; (wd) SDK2
203.341 + PM_FindTextureType, //! pfnPM_FindTextureType() (wd) SDK2
203.342 +
203.343 + SetupVisibility, //! pfnSetupVisibility() Set up PVS and PAS for networking for this client; (wd) SDK2
203.344 + UpdateClientData, //! pfnUpdateClientData() Set up data sent only to specific client; (wd) SDK2
203.345 + AddToFullPack, //! pfnAddToFullPack() (wd) SDK2
203.346 + CreateBaseline, //! pfnCreateBaseline() Tweak entity baseline for network encoding, allows setup of player baselines, too.; (wd) SDK2
203.347 + RegisterEncoders, //! pfnRegisterEncoders() Callbacks for network encoding; (wd) SDK2
203.348 + GetWeaponData, //! pfnGetWeaponData() (wd) SDK2
203.349 + CmdStart, //! pfnCmdStart() (wd) SDK2
203.350 + CmdEnd, //! pfnCmdEnd() (wd) SDK2
203.351 + ConnectionlessPacket, //! pfnConnectionlessPacket() (wd) SDK2
203.352 + GetHullBounds, //! pfnGetHullBounds() (wd) SDK2
203.353 + CreateInstancedBaselines, //! pfnCreateInstancedBaselines() (wd) SDK2
203.354 + InconsistentFile, //! pfnInconsistentFile() (wd) SDK2
203.355 + AllowLagCompensation, //! pfnAllowLagCompensation() (wd) SDK2
203.356 +};
203.357 +
203.358 +// It's not clear what the difference is between GetAPI and GetAPI2; they
203.359 +// both appear to return the exact same function table.
203.360 +//
203.361 +// Only one of them appears to be ever called, though. If the DLL provides
203.362 +// GetAPI2, the engine/hlds will call that, and will not call GetAPI. If
203.363 +// the engine couldn't find GetAPI2 in the DLL, it appears to fall back to
203.364 +// GetAPI.
203.365 +//
203.366 +// So, GetAPI2 appears to replace GetAPI, and appears to have been added
203.367 +// with SDK 2.0. My best guess is that, with the new SDK, interface
203.368 +// version checking became important, and without the int ptr used in
203.369 +// GetAPI2, the engine can't find out the version of the DLL via GetAPI.
203.370 +//
203.371 +// It's unclear whether a DLL coded under SDK2 needs to provide the older
203.372 +// GetAPI or not..
203.373 +
203.374 +C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable,
203.375 + int *interfaceVersion )
203.376 +{
203.377 + LOG_DEVELOPER(PLID, "called: GetEntityAPI2; version=%d", *interfaceVersion);
203.378 + if(!pFunctionTable) {
203.379 + LOG_ERROR(PLID, "GetEntityAPI2 called with null pFunctionTable");
203.380 + return(FALSE);
203.381 + }
203.382 + else if(*interfaceVersion != INTERFACE_VERSION) {
203.383 + LOG_ERROR(PLID,
203.384 + "GetEntityAPI2 version mismatch; requested=%d ours=%d",
203.385 + *interfaceVersion, INTERFACE_VERSION);
203.386 + //! Tell engine what version we had, so it can figure out who is
203.387 + //! out of date.
203.388 + *interfaceVersion = INTERFACE_VERSION;
203.389 + return(FALSE);
203.390 + }
203.391 + memcpy(pFunctionTable, &gFunctionTable, sizeof(DLL_FUNCTIONS));
203.392 + return(TRUE);
203.393 +}
203.394 +
203.395 +
203.396 +// I could find _no_ documentation or examples for the intended use of
203.397 +// NEW_DLL_FUNCTIONS. I wouldn't have even _known_ about the
203.398 +// GetNewDLLFunctions() function except for the reference in Adminmod.. It
203.399 +// appears to be new with SDK 2.0.
203.400 +//
203.401 +// Obviously, it seems to provide additional functions to the engine, but
203.402 +// it's unclear why a new table and interface were added, rather than
203.403 +// appending new functions to the GetAPI table/interface.
203.404 +//
203.405 +// Interestingly, it appears to be called by the engine _before_ GetAPI.
203.406 +
203.407 +static NEW_DLL_FUNCTIONS gNewFunctionTable =
203.408 +{
203.409 + OnFreeEntPrivateData, //! pfnOnFreeEntPrivateData() Called right before the object's memory is freed. Calls its destructor.
203.410 + GameShutdown, //! pfnGameShutdown()
203.411 + ShouldCollide, //! pfnShouldCollide()
203.412 +};
203.413 +
203.414 +C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable,
203.415 + int *interfaceVersion)
203.416 +{
203.417 + LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions; version=%d",
203.418 + *interfaceVersion);
203.419 + if(!pNewFunctionTable) {
203.420 + LOG_ERROR(PLID,
203.421 + "GetNewDLLFunctions called with null pNewFunctionTable");
203.422 + return(FALSE);
203.423 + }
203.424 + else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) {
203.425 + LOG_ERROR(PLID,
203.426 + "GetNewDLLFunctions version mismatch; requested=%d ours=%d",
203.427 + *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION);
203.428 + //! Tell engine what version we had, so it can figure out who is
203.429 + //! out of date.
203.430 + *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION;
203.431 + return(FALSE);
203.432 + }
203.433 + memcpy(pNewFunctionTable, &gNewFunctionTable, sizeof(NEW_DLL_FUNCTIONS));
203.434 + return TRUE;
203.435 +}
204.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
204.2 +++ b/trace_plugin/dllapi_post.cpp Tue Apr 06 07:36:14 2004 +0000
204.3 @@ -0,0 +1,402 @@
204.4 +// vi: set ts=4 sw=4 :
204.5 +// vim: set tw=75 :
204.6 +
204.7 +// dllapi_post.cpp - implementation of "post" versions of Half-Life DLL routines
204.8 +
204.9 +/*
204.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
204.11 + *
204.12 + * This file is part of Metamod.
204.13 + *
204.14 + * Metamod is free software; you can redistribute it and/or modify it
204.15 + * under the terms of the GNU General Public License as published by the
204.16 + * Free Software Foundation; either version 2 of the License, or (at
204.17 + * your option) any later version.
204.18 + *
204.19 + * Metamod is distributed in the hope that it will be useful, but
204.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
204.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
204.22 + * General Public License for more details.
204.23 + *
204.24 + * You should have received a copy of the GNU General Public License
204.25 + * along with Metamod; if not, write to the Free Software Foundation,
204.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
204.27 + *
204.28 + * In addition, as a special exception, the author gives permission to
204.29 + * link the code of this program with the Half-Life Game Engine ("HL
204.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
204.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
204.32 + * respects for all of the code used other than the HL Engine and MODs
204.33 + * from Valve. If you modify this file, you may extend this exception
204.34 + * to your version of the file, but you are not obligated to do so. If
204.35 + * you do not wish to do so, delete this exception statement from your
204.36 + * version.
204.37 + *
204.38 + */
204.39 +
204.40 +#include <extdll.h>
204.41 +
204.42 +#include <meta_api.h>
204.43 +
204.44 +#include "dllapi_post.h"
204.45 +#include "trace_api.h"
204.46 +#include "log_plugin.h"
204.47 +
204.48 +// from SDK dlls/game.cpp:
204.49 +void GameDLLInit_Post( void ) {
204.50 + DLL_TRACE(pfnGameInit, P_POST, (""));
204.51 + RETURN_META(MRES_IGNORED);
204.52 +}
204.53 +
204.54 +// from SDK dlls/cbase.cpp:
204.55 +int DispatchSpawn_Post( edict_t *pent ) {
204.56 + edict_t *ed=pent;
204.57 + DLL_TRACE(pfnSpawn, P_POST, ("classname=%s, returning %d",
204.58 + ed ? STRING(ed->v.classname) : "nil",
204.59 + META_RESULT_ORIG_RET(int)));
204.60 + // 0==Success, -1==Failure ?
204.61 + RETURN_META_VALUE(MRES_IGNORED, 0);
204.62 +}
204.63 +void DispatchThink_Post( edict_t *pent ) {
204.64 + DLL_TRACE(pfnThink, P_POST, (""));
204.65 + RETURN_META(MRES_IGNORED);
204.66 +}
204.67 +void DispatchUse_Post( edict_t *pentUsed, edict_t *pentOther ) {
204.68 + DLL_TRACE(pfnUse, P_POST, (""));
204.69 + RETURN_META(MRES_IGNORED);
204.70 +}
204.71 +void DispatchTouch_Post( edict_t *pentTouched, edict_t *pentOther ) {
204.72 + DLL_TRACE(pfnTouch, P_POST, (""));
204.73 + RETURN_META(MRES_IGNORED);
204.74 +}
204.75 +void DispatchBlocked_Post( edict_t *pentBlocked, edict_t *pentOther ) {
204.76 + DLL_TRACE(pfnBlocked, P_POST, (""));
204.77 + RETURN_META(MRES_IGNORED);
204.78 +}
204.79 +void DispatchKeyValue_Post( edict_t *pentKeyvalue, KeyValueData *pkvd ) {
204.80 + DLL_TRACE(pfnKeyValue, P_POST, ("classname=%s keyname=%s value=%s",
204.81 + pkvd->szClassName, pkvd->szKeyName, pkvd->szValue));
204.82 + RETURN_META(MRES_IGNORED);
204.83 +}
204.84 +void DispatchSave_Post( edict_t *pent, SAVERESTOREDATA *pSaveData ) {
204.85 + DLL_TRACE(pfnSave, P_POST, (""));
204.86 + RETURN_META(MRES_IGNORED);
204.87 +}
204.88 +int DispatchRestore_Post( edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity ) {
204.89 + DLL_TRACE(pfnRestore, P_POST, ("returning %d", META_RESULT_ORIG_RET(int)));
204.90 + // 0==Success, -1==Failure ?
204.91 + RETURN_META_VALUE(MRES_IGNORED, 0);
204.92 +}
204.93 +void DispatchObjectCollsionBox_Post( edict_t *pent ) {
204.94 + DLL_TRACE(pfnSetAbsBox, P_POST, (""));
204.95 + RETURN_META(MRES_IGNORED);
204.96 +}
204.97 +void SaveWriteFields_Post( SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount ) {
204.98 + DLL_TRACE(pfnSaveWriteFields, P_POST, (""));
204.99 + RETURN_META(MRES_IGNORED);
204.100 +}
204.101 +void SaveReadFields_Post( SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount ) {
204.102 + DLL_TRACE(pfnSaveReadFields, P_POST, (""));
204.103 + RETURN_META(MRES_IGNORED);
204.104 +}
204.105 +
204.106 +// from SDK dlls/world.cpp:
204.107 +void SaveGlobalState_Post( SAVERESTOREDATA *pSaveData ) {
204.108 + DLL_TRACE(pfnSaveGlobalState, P_POST, (""));
204.109 + RETURN_META(MRES_IGNORED);
204.110 +}
204.111 +void RestoreGlobalState_Post( SAVERESTOREDATA *pSaveData ) {
204.112 + DLL_TRACE(pfnRestoreGlobalState, P_POST, (""));
204.113 + RETURN_META(MRES_IGNORED);
204.114 +}
204.115 +void ResetGlobalState_Post( void ) {
204.116 + DLL_TRACE(pfnResetGlobalState, P_POST, (""));
204.117 + RETURN_META(MRES_IGNORED);
204.118 +}
204.119 +
204.120 +//! from SDK dlls/client.cpp:
204.121 +BOOL ClientConnect_Post( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] ) {
204.122 + BOOL ret=META_RESULT_ORIG_RET(BOOL);
204.123 + if(ret) DLL_TRACE(pfnClientConnect, P_POST, ("returning %d", ret));
204.124 + else DLL_TRACE(pfnClientConnect, P_POST, ("returning %d, reason=%s", ret, szRejectReason));
204.125 + RETURN_META_VALUE(MRES_IGNORED, TRUE);
204.126 +}
204.127 +void ClientDisconnect_Post( edict_t *pEntity ) {
204.128 + DLL_TRACE(pfnClientDisconnect, P_POST, (""));
204.129 + RETURN_META(MRES_IGNORED);
204.130 +}
204.131 +void ClientKill_Post( edict_t *pEntity ) {
204.132 + DLL_TRACE(pfnClientKill, P_POST, (""));
204.133 + RETURN_META(MRES_IGNORED);
204.134 +}
204.135 +void ClientPutInServer_Post( edict_t *pEntity ) {
204.136 + DLL_TRACE(pfnClientPutInServer, P_POST, (""));
204.137 + RETURN_META(MRES_IGNORED);
204.138 +}
204.139 +void ClientCommand_Post( edict_t *pEntity ) {
204.140 + DLL_TRACE(pfnClientCommand, P_POST, (""));
204.141 + RETURN_META(MRES_IGNORED);
204.142 +}
204.143 +void ClientUserInfoChanged_Post( edict_t *pEntity, char *infobuffer ) {
204.144 + DLL_TRACE(pfnClientUserInfoChanged, P_POST, (""));
204.145 + RETURN_META(MRES_IGNORED);
204.146 +}
204.147 +void ServerActivate_Post( edict_t *pEdictList, int edictCount, int clientMax ) {
204.148 + DLL_TRACE(pfnServerActivate, P_POST, (""));
204.149 + RETURN_META(MRES_IGNORED);
204.150 +}
204.151 +void ServerDeactivate_Post( void ) {
204.152 + DLL_TRACE(pfnServerDeactivate, P_POST, (""));
204.153 + RETURN_META(MRES_IGNORED);
204.154 +}
204.155 +void PlayerPreThink_Post( edict_t *pEntity ) {
204.156 + DLL_TRACE(pfnPlayerPreThink, P_POST, (""));
204.157 + RETURN_META(MRES_IGNORED);
204.158 +}
204.159 +void PlayerPostThink_Post( edict_t *pEntity ) {
204.160 + DLL_TRACE(pfnPlayerPostThink, P_POST, (""));
204.161 + RETURN_META(MRES_IGNORED);
204.162 +}
204.163 +void StartFrame_Post( void ) {
204.164 + DLL_TRACE(pfnStartFrame, P_POST, (""));
204.165 + RETURN_META(MRES_IGNORED);
204.166 +}
204.167 +void ParmsNewLevel_Post( void ) {
204.168 + DLL_TRACE(pfnParmsNewLevel, P_POST, (""));
204.169 + RETURN_META(MRES_IGNORED);
204.170 +}
204.171 +void ParmsChangeLevel_Post( void ) {
204.172 + DLL_TRACE(pfnParmsChangeLevel, P_POST, (""));
204.173 + RETURN_META(MRES_IGNORED);
204.174 +}
204.175 +const char *GetGameDescription_Post( void ) {
204.176 + DLL_TRACE(pfnGetGameDescription, P_POST, ("returning %s", META_RESULT_ORIG_RET(char *)));
204.177 + RETURN_META_VALUE(MRES_IGNORED, "");
204.178 +}
204.179 +void PlayerCustomization_Post( edict_t *pEntity, customization_t *pCust ) {
204.180 + DLL_TRACE(pfnPlayerCustomization, P_POST, (""));
204.181 + RETURN_META(MRES_IGNORED);
204.182 +}
204.183 +void SpectatorConnect_Post( edict_t *pEntity ) {
204.184 + DLL_TRACE(pfnSpectatorConnect, P_POST, (""));
204.185 + RETURN_META(MRES_IGNORED);
204.186 +}
204.187 +void SpectatorDisconnect_Post( edict_t *pEntity ) {
204.188 + DLL_TRACE(pfnSpectatorDisconnect, P_POST, (""));
204.189 + RETURN_META(MRES_IGNORED);
204.190 +}
204.191 +void SpectatorThink_Post( edict_t *pEntity ) {
204.192 + DLL_TRACE(pfnSpectatorThink, P_POST, (""));
204.193 + RETURN_META(MRES_IGNORED);
204.194 +}
204.195 +void Sys_Error_Post( const char *error_string ) {
204.196 + DLL_TRACE(pfnSys_Error, P_POST, (""));
204.197 + RETURN_META(MRES_IGNORED);
204.198 +}
204.199 +
204.200 +// from SDK pm_shared/pm_shared.c:
204.201 +void PM_Move_Post( struct playermove_s *ppmove, int server ) {
204.202 + DLL_TRACE(pfnPM_Move, P_POST, (""));
204.203 + RETURN_META(MRES_IGNORED);
204.204 +}
204.205 +void PM_Init_Post( struct playermove_s *ppmove ) {
204.206 + DLL_TRACE(pfnPM_Init, P_POST, (""));
204.207 + RETURN_META(MRES_IGNORED);
204.208 +}
204.209 +char PM_FindTextureType_Post( char *name ) {
204.210 + DLL_TRACE(pfnPM_FindTextureType, P_POST, (""));
204.211 + RETURN_META_VALUE(MRES_IGNORED, '\0');
204.212 +}
204.213 +
204.214 +// from SDK dlls/client.cpp:
204.215 +void SetupVisibility_Post( edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas ) {
204.216 + DLL_TRACE(pfnSetupVisibility, P_POST, (""));
204.217 + RETURN_META(MRES_IGNORED);
204.218 +}
204.219 +void UpdateClientData_Post ( const struct edict_s *ent, int sendweapons, struct clientdata_s *cd ) {
204.220 + DLL_TRACE(pfnUpdateClientData, P_POST, (""));
204.221 + RETURN_META(MRES_IGNORED);
204.222 +}
204.223 +int AddToFullPack_Post( struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet ) {
204.224 + DLL_TRACE(pfnAddToFullPack, P_POST, ("returning %d", META_RESULT_ORIG_RET(int)));
204.225 + RETURN_META_VALUE(MRES_IGNORED, 0);
204.226 +}
204.227 +void CreateBaseline_Post( int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs ) {
204.228 + DLL_TRACE(pfnCreateBaseline, P_POST, (""));
204.229 + RETURN_META(MRES_IGNORED);
204.230 +}
204.231 +void RegisterEncoders_Post( void ) {
204.232 + DLL_TRACE(pfnRegisterEncoders, P_POST, (""));
204.233 + RETURN_META(MRES_IGNORED);
204.234 +}
204.235 +int GetWeaponData_Post( struct edict_s *player, struct weapon_data_s *info ) {
204.236 + DLL_TRACE(pfnGetWeaponData, P_POST, ("returning %d", META_RESULT_ORIG_RET(int)));
204.237 + RETURN_META_VALUE(MRES_IGNORED, 1);
204.238 +}
204.239 +void CmdStart_Post( const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed ) {
204.240 + DLL_TRACE(pfnCmdStart, P_POST, (""));
204.241 + RETURN_META(MRES_IGNORED);
204.242 +}
204.243 +void CmdEnd_Post ( const edict_t *player ) {
204.244 + DLL_TRACE(pfnCmdEnd, P_POST, (""));
204.245 + RETURN_META(MRES_IGNORED);
204.246 +}
204.247 +int ConnectionlessPacket_Post( const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size ) {
204.248 + DLL_TRACE(pfnConnectionlessPacket, P_POST, ("returning %d", META_RESULT_ORIG_RET(int)));
204.249 + RETURN_META_VALUE(MRES_IGNORED, 0);
204.250 +}
204.251 +int GetHullBounds_Post( int hullnumber, float *mins, float *maxs ) {
204.252 + DLL_TRACE(pfnGetHullBounds, P_POST, ("returning %d", META_RESULT_ORIG_RET(int)));
204.253 + RETURN_META_VALUE(MRES_IGNORED, 0);
204.254 +}
204.255 +void CreateInstancedBaselines_Post ( void ) {
204.256 + DLL_TRACE(pfnCreateInstancedBaselines, P_POST, (""));
204.257 + RETURN_META(MRES_IGNORED);
204.258 +}
204.259 +int InconsistentFile_Post( const edict_t *player, const char *filename, char *disconnect_message ) {
204.260 + DLL_TRACE(pfnInconsistentFile, P_POST, ("returning %d, message=%s", META_RESULT_ORIG_RET(int), disconnect_message));
204.261 + RETURN_META_VALUE(MRES_IGNORED, 0);
204.262 +}
204.263 +int AllowLagCompensation_Post( void ) {
204.264 + DLL_TRACE(pfnAllowLagCompensation, P_POST, ("returning %d", META_RESULT_ORIG_RET(int)));
204.265 + RETURN_META_VALUE(MRES_IGNORED, 1);
204.266 +}
204.267 +
204.268 +
204.269 +// from SDK ?
204.270 +void OnFreeEntPrivateData_Post(edict_t *pEnt) {
204.271 + NEWDLL_TRACE(pfnOnFreeEntPrivateData, P_POST, (""));
204.272 + RETURN_META(MRES_IGNORED);
204.273 +}
204.274 +void GameShutdown_Post(void) {
204.275 + NEWDLL_TRACE(pfnGameShutdown, P_POST, (""));
204.276 + RETURN_META(MRES_IGNORED);
204.277 +}
204.278 +int ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther) {
204.279 + NEWDLL_TRACE(pfnShouldCollide, P_POST, ("returning %d", META_RESULT_ORIG_RET(int)));
204.280 + RETURN_META_VALUE(MRES_IGNORED, 1);
204.281 +}
204.282 +
204.283 +
204.284 +// from SDK dlls/cbase.cpp:
204.285 +// (wd) indicates my comments on the functions
204.286 +static DLL_FUNCTIONS gFunctionTable_Post =
204.287 +{
204.288 + GameDLLInit_Post, //! pfnGameInit() Initialize the game (one-time call after loading of game .dll)
204.289 + DispatchSpawn_Post, //! pfnSpawn()
204.290 + DispatchThink_Post, //! pfnThink()
204.291 + DispatchUse_Post, //! pfnUse()
204.292 + DispatchTouch_Post, //! pfnTouch()
204.293 + DispatchBlocked_Post, //! pfnBlocked()
204.294 + DispatchKeyValue_Post, //! pfnKeyValue()
204.295 + DispatchSave_Post, //! pfnSave()
204.296 + DispatchRestore_Post, //! pfnRestore()
204.297 + DispatchObjectCollsionBox_Post, //! pfnSetAbsBox()
204.298 +
204.299 + SaveWriteFields_Post, //! pfnSaveWriteFields()
204.300 + SaveReadFields_Post, //! pfnSaveReadFields()
204.301 +
204.302 + SaveGlobalState_Post, //! pfnSaveGlobalState()
204.303 + RestoreGlobalState_Post, //! pfnRestoreGlobalState()
204.304 + ResetGlobalState_Post, //! pfnResetGlobalState()
204.305 +
204.306 + ClientConnect_Post, //! pfnClientConnect() (wd) Client has connected
204.307 + ClientDisconnect_Post, //! pfnClientDisconnect() (wd) Player has left the game
204.308 + ClientKill_Post, //! pfnClientKill() (wd) Player has typed "kill"
204.309 + ClientPutInServer_Post, //! pfnClientPutInServer() (wd) Client is entering the game
204.310 + ClientCommand_Post, //! pfnClientCommand() (wd) Player has sent a command (typed, or from a bind)
204.311 + ClientUserInfoChanged_Post, //! pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure
204.312 + ServerActivate_Post, //! pfnServerActivate() (wd) Server is starting a new map
204.313 + ServerDeactivate_Post, //! pfnServerDeactivate() (wd) Server is leaving the map (shutdown, or changelevel); SDK2
204.314 +
204.315 + PlayerPreThink_Post, //! pfnPlayerPreThink()
204.316 + PlayerPostThink_Post, //! pfnPlayerPostThink()
204.317 +
204.318 + StartFrame_Post, //! pfnStartFrame()
204.319 + ParmsNewLevel_Post, //! pfnParmsNewLevel()
204.320 + ParmsChangeLevel_Post, //! pfnParmsChangeLevel()
204.321 +
204.322 + GetGameDescription_Post, //! pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2", "Half-Life"
204.323 + PlayerCustomization_Post, //! pfnPlayerCustomization() Notifies .dll of new customization for player.
204.324 +
204.325 + SpectatorConnect_Post, //! pfnSpectatorConnect() Called when spectator joins server
204.326 + SpectatorDisconnect_Post, //! pfnSpectatorDisconnect() Called when spectator leaves the server
204.327 + SpectatorThink_Post, //! pfnSpectatorThink() Called when spectator sends a command packet (usercmd_t)
204.328 +
204.329 + Sys_Error_Post, //! pfnSys_Error() Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint. SDK2
204.330 +
204.331 + PM_Move_Post, //! pfnPM_Move() (wd) SDK2
204.332 + PM_Init_Post, //! pfnPM_Init() Server version of player movement initialization; (wd) SDK2
204.333 + PM_FindTextureType_Post, //! pfnPM_FindTextureType() (wd) SDK2
204.334 +
204.335 + SetupVisibility_Post, //! pfnSetupVisibility() Set up PVS and PAS for networking for this client; (wd) SDK2
204.336 + UpdateClientData_Post, //! pfnUpdateClientData() Set up data sent only to specific client; (wd) SDK2
204.337 + AddToFullPack_Post, //! pfnAddToFullPack() (wd) SDK2
204.338 + CreateBaseline_Post, //! pfnCreateBaseline() Tweak entity baseline for network encoding, allows setup of player baselines, too.; (wd) SDK2
204.339 + RegisterEncoders_Post, //! pfnRegisterEncoders() Callbacks for network encoding; (wd) SDK2
204.340 + GetWeaponData_Post, //! pfnGetWeaponData() (wd) SDK2
204.341 + CmdStart_Post, //! pfnCmdStart() (wd) SDK2
204.342 + CmdEnd_Post, //! pfnCmdEnd() (wd) SDK2
204.343 + ConnectionlessPacket_Post, //! pfnConnectionlessPacket() (wd) SDK2
204.344 + GetHullBounds_Post, //! pfnGetHullBounds() (wd) SDK2
204.345 + CreateInstancedBaselines_Post, //! pfnCreateInstancedBaselines() (wd) SDK2
204.346 + InconsistentFile_Post, //! pfnInconsistentFile() (wd) SDK2
204.347 + AllowLagCompensation_Post, //! pfnAllowLagCompensation() (wd) SDK2
204.348 +};
204.349 +
204.350 +C_DLLEXPORT int GetEntityAPI_Post( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion )
204.351 +{
204.352 + LOG_DEVELOPER(PLID, "called: GetEntityAPI_Post; version=%d", interfaceVersion);
204.353 + if(!pFunctionTable) {
204.354 + LOG_ERROR(PLID, "GetEntityAPI_Post called with null pFunctionTable");
204.355 + return(FALSE);
204.356 + }
204.357 + else if(interfaceVersion != INTERFACE_VERSION) {
204.358 + LOG_ERROR(PLID, "GetEntityAPI_Post version mismatch; requested=%d ours=%d", interfaceVersion, INTERFACE_VERSION);
204.359 + return(FALSE);
204.360 + }
204.361 + memcpy(pFunctionTable, &gFunctionTable_Post, sizeof( DLL_FUNCTIONS ) );
204.362 + return(TRUE);
204.363 +}
204.364 +
204.365 +C_DLLEXPORT int GetEntityAPI2_Post( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion )
204.366 +{
204.367 + LOG_DEVELOPER(PLID, "called: GetEntityAPI2_Post; version=%d", *interfaceVersion);
204.368 + if(!pFunctionTable) {
204.369 + LOG_ERROR(PLID, "GetEntityAPI2_Post called with null pFunctionTable");
204.370 + return(FALSE);
204.371 + }
204.372 + else if(*interfaceVersion != INTERFACE_VERSION) {
204.373 + LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION);
204.374 + //! Tell engine what version we had, so it can figure out who is out of date.
204.375 + *interfaceVersion = INTERFACE_VERSION;
204.376 + return(FALSE);
204.377 + }
204.378 + memcpy( pFunctionTable, &gFunctionTable_Post, sizeof( DLL_FUNCTIONS ) );
204.379 + return(TRUE);
204.380 +}
204.381 +
204.382 +
204.383 +static NEW_DLL_FUNCTIONS gNewFunctionTable_Post =
204.384 +{
204.385 + OnFreeEntPrivateData_Post, //! pfnOnFreeEntPrivateData() Called right before the object's memory is freed. Calls its destructor.
204.386 + GameShutdown_Post, //! pfnGameShutdown()
204.387 + ShouldCollide_Post, //! pfnShouldCollide()
204.388 +};
204.389 +
204.390 +C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion )
204.391 +{
204.392 + LOG_DEVELOPER(PLID, "called: GetNewDLLFunctions_Post; version=%d", *interfaceVersion);
204.393 + if(!pNewFunctionTable) {
204.394 + LOG_ERROR(PLID, "GetNewDLLFunctions_Post called with null pNewFunctionTable");
204.395 + return(FALSE);
204.396 + }
204.397 + else if(*interfaceVersion != NEW_DLL_FUNCTIONS_VERSION) {
204.398 + LOG_ERROR(PLID, "GetNewDLLFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, NEW_DLL_FUNCTIONS_VERSION);
204.399 + //! Tell engine what version we had, so it can figure out who is out of date.
204.400 + *interfaceVersion = NEW_DLL_FUNCTIONS_VERSION;
204.401 + return(FALSE);
204.402 + }
204.403 + memcpy(pNewFunctionTable, &gNewFunctionTable_Post, sizeof(NEW_DLL_FUNCTIONS));
204.404 + return TRUE;
204.405 +}
205.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
205.2 +++ b/trace_plugin/dllapi_post.h Tue Apr 06 07:36:14 2004 +0000
205.3 @@ -0,0 +1,106 @@
205.4 +// vi: set ts=4 sw=4 :
205.5 +// vim: set tw=75 :
205.6 +
205.7 +// dllapi_post.h - prototypes and typedefs for "post" versions of HL DLL
205.8 +// routines
205.9 +
205.10 +/*
205.11 + * Copyright (c) 2001-2003 Will Day <[email protected]>
205.12 + *
205.13 + * This file is part of Metamod.
205.14 + *
205.15 + * Metamod is free software; you can redistribute it and/or modify it
205.16 + * under the terms of the GNU General Public License as published by the
205.17 + * Free Software Foundation; either version 2 of the License, or (at
205.18 + * your option) any later version.
205.19 + *
205.20 + * Metamod is distributed in the hope that it will be useful, but
205.21 + * WITHOUT ANY WARRANTY; without even the implied warranty of
205.22 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
205.23 + * General Public License for more details.
205.24 + *
205.25 + * You should have received a copy of the GNU General Public License
205.26 + * along with Metamod; if not, write to the Free Software Foundation,
205.27 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
205.28 + *
205.29 + * In addition, as a special exception, the author gives permission to
205.30 + * link the code of this program with the Half-Life Game Engine ("HL
205.31 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
205.32 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
205.33 + * respects for all of the code used other than the HL Engine and MODs
205.34 + * from Valve. If you modify this file, you may extend this exception
205.35 + * to your version of the file, but you are not obligated to do so. If
205.36 + * you do not wish to do so, delete this exception statement from your
205.37 + * version.
205.38 + *
205.39 + */
205.40 +
205.41 +#ifndef DLLAPI_POST_H
205.42 +#define DLLAPI_POST_H
205.43 +
205.44 +#include <sdk_util.h> // BOOL
205.45 +#include <osdep.h>
205.46 +
205.47 +// from SDK dlls/cbase.h:
205.48 +extern int DispatchSpawn_Post( edict_t *pent );
205.49 +extern void DispatchThink_Post( edict_t *pent );
205.50 +extern void DispatchUse_Post( edict_t *pentUsed, edict_t *pentOther );
205.51 +extern void DispatchTouch_Post( edict_t *pentTouched, edict_t *pentOther );
205.52 +extern void DispatchBlocked_Post( edict_t *pentBlocked, edict_t *pentOther );
205.53 +extern void DispatchKeyValue_Post( edict_t *pentKeyvalue, KeyValueData *pkvd );
205.54 +extern void DispatchSave_Post( edict_t *pent, SAVERESTOREDATA *pSaveData );
205.55 +extern int DispatchRestore_Post( edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity );
205.56 +extern void DispatchObjectCollsionBox_Post( edict_t *pent );
205.57 +extern void SaveWriteFields_Post( SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount );
205.58 +extern void SaveReadFields_Post( SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount );
205.59 +extern void SaveGlobalState_Post( SAVERESTOREDATA *pSaveData );
205.60 +extern void RestoreGlobalState_Post( SAVERESTOREDATA *pSaveData );
205.61 +extern void ResetGlobalState_Post( void );
205.62 +
205.63 +// from SDK dlls/client.h:
205.64 +extern BOOL ClientConnect_Post( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] );
205.65 +extern void ClientDisconnect_Post( edict_t *pEntity );
205.66 +extern void ClientKill_Post( edict_t *pEntity );
205.67 +extern void ClientPutInServer_Post( edict_t *pEntity );
205.68 +extern void ClientCommand_Post( edict_t *pEntity );
205.69 +extern void ClientUserInfoChanged_Post( edict_t *pEntity, char *infobuffer );
205.70 +extern void ServerActivate_Post( edict_t *pEdictList, int edictCount, int clientMax );
205.71 +extern void ServerDeactivate_Post( void );
205.72 +extern void PlayerPreThink_Post( edict_t *pEntity );
205.73 +extern void PlayerPostThink_Post( edict_t *pEntity );
205.74 +extern void StartFrame_Post( void );
205.75 +extern void ParmsNewLevel_Post( void );
205.76 +extern void ParmsChangeLevel_Post( void );
205.77 +extern const char *GetGameDescription_Post( void );
205.78 +extern void PlayerCustomization_Post( edict_t *pEntity, customization_t *pCust );
205.79 +extern void SpectatorConnect_Post( edict_t *pEntity );
205.80 +extern void SpectatorDisconnect_Post( edict_t *pEntity );
205.81 +extern void SpectatorThink_Post( edict_t *pEntity );
205.82 +extern void Sys_Error_Post( const char *error_string );
205.83 +
205.84 +// from SDK pm_shared/pm_shared.h:
205.85 +extern void PM_Move_Post( struct playermove_s *ppmove, int server );
205.86 +extern void PM_Init_Post( struct playermove_s *ppmove );
205.87 +extern char PM_FindTextureType_Post( char *name );
205.88 +
205.89 +// from SDK dlls/client.h:
205.90 +extern void SetupVisibility_Post( edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas );
205.91 +extern void UpdateClientData_Post( const struct edict_s *ent, int sendweapons, struct clientdata_s *cd );
205.92 +extern int AddToFullPack_Post( struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet );
205.93 +extern void CreateBaseline_Post( int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs );
205.94 +extern void RegisterEncoders_Post( void );
205.95 +extern int GetWeaponData_Post( struct edict_s *player, struct weapon_data_s *info );
205.96 +extern void CmdStart_Post( const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed );
205.97 +extern void CmdEnd_Post( const edict_t *player );
205.98 +extern int ConnectionlessPacket_Post( const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size );
205.99 +extern int GetHullBounds_Post( int hullnumber, float *mins, float *maxs );
205.100 +extern void CreateInstancedBaselines_Post( void );
205.101 +extern int InconsistentFile_Post( const edict_t *player, const char *filename, char *disconnect_message );
205.102 +extern int AllowLagCompensation_Post( void );
205.103 +
205.104 +// no example from SDK...
205.105 +extern void OnFreeEntPrivateData_Post(edict_t pEnt);
205.106 +extern void GameShutdown_Post(void);
205.107 +extern int ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther);
205.108 +
205.109 +#endif /* DLLAPI_H */
206.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
206.2 +++ b/trace_plugin/engine_api.cpp Tue Apr 06 07:36:14 2004 +0000
206.3 @@ -0,0 +1,1053 @@
206.4 +// vi: set ts=4 sw=4 :
206.5 +// vim: set tw=75 :
206.6 +
206.7 +// engine_api.cpp - implementation of Half-Life engine functions
206.8 +
206.9 +/*
206.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
206.11 + *
206.12 + * This file is part of Metamod.
206.13 + *
206.14 + * Metamod is free software; you can redistribute it and/or modify it
206.15 + * under the terms of the GNU General Public License as published by the
206.16 + * Free Software Foundation; either version 2 of the License, or (at
206.17 + * your option) any later version.
206.18 + *
206.19 + * Metamod is distributed in the hope that it will be useful, but
206.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
206.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
206.22 + * General Public License for more details.
206.23 + *
206.24 + * You should have received a copy of the GNU General Public License
206.25 + * along with Metamod; if not, write to the Free Software Foundation,
206.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
206.27 + *
206.28 + * In addition, as a special exception, the author gives permission to
206.29 + * link the code of this program with the Half-Life Game Engine ("HL
206.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
206.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
206.32 + * respects for all of the code used other than the HL Engine and MODs
206.33 + * from Valve. If you modify this file, you may extend this exception
206.34 + * to your version of the file, but you are not obligated to do so. If
206.35 + * you do not wish to do so, delete this exception statement from your
206.36 + * version.
206.37 + *
206.38 + */
206.39 +
206.40 +#include <stdio.h>
206.41 +#include <stdarg.h>
206.42 +
206.43 +#include <extdll.h>
206.44 +
206.45 +#include "engine_api.h"
206.46 +#include "meta_api.h"
206.47 +#include "trace_api.h"
206.48 +#include "support_meta.h" // MAX_STRBUF_LEN
206.49 +#include "log_plugin.h"
206.50 +
206.51 +int PrecacheModel(char *s) {
206.52 + ENGINE_TRACE(pfnPrecacheModel, P_PRE, ("model=%s", s));
206.53 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.54 +}
206.55 +int PrecacheSound(char *s) {
206.56 + ENGINE_TRACE(pfnPrecacheSound, P_PRE, ("sound=%s", s));
206.57 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.58 +}
206.59 +void SetModel(edict_t *e, const char *m) {
206.60 + edict_t *ed = e;
206.61 + ENGINE_TRACE(pfnSetModel, P_PRE, ("classname=%s netname=%s model=%s",
206.62 + ed ? STRING(ed->v.classname) : "nil",
206.63 + ed ? STRING(ed->v.netname) : "nil",
206.64 + m));
206.65 + RETURN_META(MRES_IGNORED);
206.66 +}
206.67 +int ModelIndex(const char *m) {
206.68 + ENGINE_TRACE(pfnModelIndex, P_PRE, ("model=%s", m));
206.69 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.70 +}
206.71 +int ModelFrames(int modelIndex) {
206.72 + ENGINE_TRACE(pfnModelFrames, P_PRE, ("index=%d", modelIndex));
206.73 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.74 +}
206.75 +
206.76 +void SetSize(edict_t *e, const float *rgflMin, const float *rgflMax) {
206.77 + ENGINE_TRACE(pfnSetSize, P_PRE, (""));
206.78 + RETURN_META(MRES_IGNORED);
206.79 +}
206.80 +void ChangeLevel(char *s1, char *s2) {
206.81 + ENGINE_TRACE(pfnChangeLevel, P_PRE, ("s1=%s, s2=%s", s1, s2));
206.82 + RETURN_META(MRES_IGNORED);
206.83 +}
206.84 +void GetSpawnParms(edict_t *ent) {
206.85 + ENGINE_TRACE(pfnGetSpawnParms, P_PRE, (""));
206.86 + RETURN_META(MRES_IGNORED);
206.87 +}
206.88 +void SaveSpawnParms(edict_t *ent) {
206.89 + ENGINE_TRACE(pfnSaveSpawnParms, P_PRE, (""));
206.90 + RETURN_META(MRES_IGNORED);
206.91 +}
206.92 +
206.93 +float VecToYaw(const float *rgflVector) {
206.94 + ENGINE_TRACE(pfnVecToYaw, P_PRE, (""));
206.95 + RETURN_META_VALUE(MRES_IGNORED, 0.0);
206.96 +}
206.97 +void VecToAngles(const float *rgflVectorIn, float *rgflVectorOut) {
206.98 + ENGINE_TRACE(pfnVecToAngles, P_PRE, (""));
206.99 + RETURN_META(MRES_IGNORED);
206.100 +}
206.101 +void MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType) {
206.102 + ENGINE_TRACE(pfnMoveToOrigin, P_PRE, (""));
206.103 + RETURN_META(MRES_IGNORED);
206.104 +}
206.105 +void ChangeYaw(edict_t *ent) {
206.106 + ENGINE_TRACE(pfnChangeYaw, P_PRE, (""));
206.107 + RETURN_META(MRES_IGNORED);
206.108 +}
206.109 +void ChangePitch(edict_t *ent) {
206.110 + ENGINE_TRACE(pfnChangePitch, P_PRE, (""));
206.111 + RETURN_META(MRES_IGNORED);
206.112 +}
206.113 +
206.114 +edict_t *FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue) {
206.115 + edict_t *ed=pEdictStartSearchAfter;
206.116 + ENGINE_TRACE(pfnFindEntityByString, P_PRE, ("start=%s field=%s value=%s",
206.117 + ed ? STRING(ed->v.classname) : "nil", pszField, pszValue));
206.118 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.119 +}
206.120 +int GetEntityIllum(edict_t *pEnt) {
206.121 + ENGINE_TRACE(pfnGetEntityIllum, P_PRE, (""));
206.122 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.123 +}
206.124 +edict_t *FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad) {
206.125 + ENGINE_TRACE(pfnFindEntityInSphere, P_PRE, (""));
206.126 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.127 +}
206.128 +edict_t *FindClientInPVS(edict_t *pEdict) {
206.129 + ENGINE_TRACE(pfnFindClientInPVS, P_PRE, (""));
206.130 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.131 +}
206.132 +edict_t *EntitiesInPVS(edict_t *pplayer) {
206.133 + ENGINE_TRACE(pfnEntitiesInPVS, P_PRE, (""));
206.134 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.135 +}
206.136 +
206.137 +void MakeVectors(const float *rgflVector) {
206.138 + ENGINE_TRACE(pfnMakeVectors, P_PRE, (""));
206.139 + RETURN_META(MRES_IGNORED);
206.140 +}
206.141 +void AngleVectors(const float *rgflVector, float *forward, float *right, float *up) {
206.142 + ENGINE_TRACE(pfnAngleVectors, P_PRE, (""));
206.143 + RETURN_META(MRES_IGNORED);
206.144 +}
206.145 +
206.146 +edict_t *CreateEntity(void) {
206.147 + ENGINE_TRACE(pfnCreateEntity, P_PRE, (""));
206.148 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.149 +}
206.150 +void RemoveEntity(edict_t *e) {
206.151 + ENGINE_TRACE(pfnRemoveEntity, P_PRE, ("name=%s", STRING(e->v.classname)));
206.152 + RETURN_META(MRES_IGNORED);
206.153 +}
206.154 +edict_t *CreateNamedEntity(int className) {
206.155 + ENGINE_TRACE(pfnCreateNamedEntity, P_PRE, ("name=%s", STRING(className)));
206.156 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.157 +}
206.158 +
206.159 +void MakeStatic(edict_t *ent) {
206.160 + ENGINE_TRACE(pfnMakeStatic, P_PRE, (""));
206.161 + RETURN_META(MRES_IGNORED);
206.162 +}
206.163 +int EntIsOnFloor(edict_t *e) {
206.164 + ENGINE_TRACE(pfnEntIsOnFloor, P_PRE, (""));
206.165 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.166 +}
206.167 +int DropToFloor(edict_t *e) {
206.168 + ENGINE_TRACE(pfnDropToFloor, P_PRE, (""));
206.169 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.170 +}
206.171 +
206.172 +int WalkMove(edict_t *ent, float yaw, float dist, int iMode) {
206.173 + ENGINE_TRACE(pfnWalkMove, P_PRE, (""));
206.174 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.175 +}
206.176 +void SetOrigin(edict_t *e, const float *rgflOrigin) {
206.177 + edict_t *ed = e;
206.178 + ENGINE_TRACE(pfnSetOrigin, P_PRE, ("classname=%s netname=%s",
206.179 + ed ? STRING(ed->v.classname) : "nil",
206.180 + ed ? STRING(ed->v.netname) : "nil"));
206.181 + RETURN_META(MRES_IGNORED);
206.182 +}
206.183 +
206.184 +void EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch) {
206.185 + ENGINE_TRACE(pfnEmitSound, P_PRE, ("sample=%s", sample));
206.186 + RETURN_META(MRES_IGNORED);
206.187 +}
206.188 +void EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch) {
206.189 + ENGINE_TRACE(pfnEmitAmbientSound, P_PRE, ("sample=%s", samp));
206.190 + RETURN_META(MRES_IGNORED);
206.191 +}
206.192 +
206.193 +void TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr) {
206.194 + ENGINE_TRACE(pfnTraceLine, P_PRE, (""));
206.195 + RETURN_META(MRES_IGNORED);
206.196 +}
206.197 +void TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr) {
206.198 + ENGINE_TRACE(pfnTraceToss, P_PRE, (""));
206.199 + RETURN_META(MRES_IGNORED);
206.200 +}
206.201 +int TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr) {
206.202 + ENGINE_TRACE(pfnTraceMonsterHull, P_PRE, (""));
206.203 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.204 +}
206.205 +void TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr) {
206.206 + ENGINE_TRACE(pfnTraceHull, P_PRE, (""));
206.207 + RETURN_META(MRES_IGNORED);
206.208 +}
206.209 +void TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr) {
206.210 + ENGINE_TRACE(pfnTraceModel, P_PRE, (""));
206.211 + RETURN_META(MRES_IGNORED);
206.212 +}
206.213 +const char *TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 ) {
206.214 + ENGINE_TRACE(pfnTraceTexture, P_PRE, (""));
206.215 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.216 +}
206.217 +void TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr) {
206.218 + ENGINE_TRACE(pfnTraceSphere, P_PRE, (""));
206.219 + RETURN_META(MRES_IGNORED);
206.220 +}
206.221 +void GetAimVector(edict_t *ent, float speed, float *rgflReturn) {
206.222 + ENGINE_TRACE(pfnGetAimVector, P_PRE, (""));
206.223 + RETURN_META(MRES_IGNORED);
206.224 +}
206.225 +
206.226 +void ServerCommand(char *str) {
206.227 + ENGINE_TRACE(pfnServerCommand, P_PRE, ("cmd=%s", str));
206.228 + RETURN_META(MRES_IGNORED);
206.229 +}
206.230 +void ServerExecute(void) {
206.231 + ENGINE_TRACE(pfnServerExecute, P_PRE, (""));
206.232 + RETURN_META(MRES_IGNORED);
206.233 +}
206.234 +void engClientCommand(edict_t *pEdict, char *szFmt, ...) {
206.235 + va_list ap;
206.236 + char buf[1024];
206.237 + char *cp;
206.238 + va_start(ap, szFmt);
206.239 + vsnprintf(buf, sizeof(buf), szFmt, ap);
206.240 + va_end(ap);
206.241 + cp=buf+strlen(buf)-1;
206.242 + if(*cp=='\n') *cp='\0';
206.243 + ENGINE_TRACE(pfnClientCommand, P_PRE, ("cmd='%s'", buf));
206.244 + RETURN_META(MRES_IGNORED);
206.245 +}
206.246 +
206.247 +void ParticleEffect(const float *org, const float *dir, float color, float count) {
206.248 + ENGINE_TRACE(pfnParticleEffect, P_PRE, (""));
206.249 + RETURN_META(MRES_IGNORED);
206.250 +}
206.251 +void LightStyle(int style, char *val) {
206.252 + ENGINE_TRACE(pfnLightStyle, P_PRE, (""));
206.253 + RETURN_META(MRES_IGNORED);
206.254 +}
206.255 +int DecalIndex(const char *name) {
206.256 + ENGINE_TRACE(pfnDecalIndex, P_PRE, (""));
206.257 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.258 +}
206.259 +int PointContents(const float *rgflVector) {
206.260 + ENGINE_TRACE(pfnPointContents, P_PRE, (""));
206.261 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.262 +}
206.263 +
206.264 +void MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed) {
206.265 + const char *name, *dest;
206.266 + name=GET_USER_MSG_NAME(PLID, msg_type, NULL);
206.267 + if(!name) name="unknown";
206.268 + dest=msg_dest_types[msg_dest];
206.269 + if(!dest) dest="unknown";
206.270 + ENGINE_TRACE(pfnMessageBegin, P_PRE, ("type=%s(%d), dest=%s(%d), classname=%s netname=%s", name, msg_type, dest, msg_dest,
206.271 + ed ? STRING(ed->v.classname) : "nil",
206.272 + ed ? STRING(ed->v.netname) : "nil"));
206.273 + RETURN_META(MRES_IGNORED);
206.274 +}
206.275 +void MessageEnd(void) {
206.276 + ENGINE_TRACE(pfnMessageEnd, P_PRE, (""));
206.277 + RETURN_META(MRES_IGNORED);
206.278 +}
206.279 +
206.280 +void WriteByte(int iValue) {
206.281 + ENGINE_TRACE(pfnWriteByte, P_PRE, (""));
206.282 + RETURN_META(MRES_IGNORED);
206.283 +}
206.284 +void WriteChar(int iValue) {
206.285 + ENGINE_TRACE(pfnWriteChar, P_PRE, (""));
206.286 + RETURN_META(MRES_IGNORED);
206.287 +}
206.288 +void WriteShort(int iValue) {
206.289 + ENGINE_TRACE(pfnWriteShort, P_PRE, (""));
206.290 + RETURN_META(MRES_IGNORED);
206.291 +}
206.292 +void WriteLong(int iValue) {
206.293 + ENGINE_TRACE(pfnWriteLong, P_PRE, (""));
206.294 + RETURN_META(MRES_IGNORED);
206.295 +}
206.296 +void WriteAngle(float flValue) {
206.297 + ENGINE_TRACE(pfnWriteAngle, P_PRE, (""));
206.298 + RETURN_META(MRES_IGNORED);
206.299 +}
206.300 +void WriteCoord(float flValue) {
206.301 + ENGINE_TRACE(pfnWriteCoord, P_PRE, (""));
206.302 + RETURN_META(MRES_IGNORED);
206.303 +}
206.304 +void WriteString(const char *sz) {
206.305 + ENGINE_TRACE(pfnWriteString, P_PRE, ("string=%s", sz));
206.306 + RETURN_META(MRES_IGNORED);
206.307 +}
206.308 +void WriteEntity(int iValue) {
206.309 + ENGINE_TRACE(pfnWriteEntity, P_PRE, (""));
206.310 + RETURN_META(MRES_IGNORED);
206.311 +}
206.312 +
206.313 +void CVarRegister(cvar_t *pCvar) {
206.314 + ENGINE_TRACE(pfnCVarRegister, P_PRE, ("cvar=%s", pCvar->name));
206.315 + RETURN_META(MRES_IGNORED);
206.316 +}
206.317 +float CVarGetFloat(const char *szVarName) {
206.318 + // more trace output in Post
206.319 + ENGINE_TRACE(pfnCVarGetFloat, P_PRE, ("cvar=%s", szVarName));
206.320 + RETURN_META_VALUE(MRES_IGNORED, 0.0);
206.321 +}
206.322 +const char *CVarGetString(const char *szVarName) {
206.323 + // more trace output in Post
206.324 + ENGINE_TRACE(pfnCVarGetString, P_PRE, ("cvar=%s", szVarName));
206.325 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.326 +}
206.327 +void CVarSetFloat(const char *szVarName, float flValue) {
206.328 + ENGINE_TRACE(pfnCVarSetFloat, P_PRE, ("cvar=%s, val=%f", szVarName, flValue));
206.329 + RETURN_META(MRES_IGNORED);
206.330 +}
206.331 +void CVarSetString(const char *szVarName, const char *szValue) {
206.332 + ENGINE_TRACE(pfnCVarSetString, P_PRE, ("cvar=%s, val=%s", szVarName, szValue));
206.333 + RETURN_META(MRES_IGNORED);
206.334 +}
206.335 +
206.336 +void AlertMessage(ALERT_TYPE atype, char *szFmt, ...) {
206.337 + char *astr;
206.338 + va_list ap;
206.339 + char buf[MAX_STRBUF_LEN];
206.340 + switch(atype) {
206.341 + case at_notice:
206.342 + astr="at_notice";
206.343 + break;
206.344 + case at_console:
206.345 + astr="at_console";
206.346 + break;
206.347 + case at_aiconsole:
206.348 + astr="at_aiconsole";
206.349 + break;
206.350 + case at_warning:
206.351 + astr="at_warning";
206.352 + break;
206.353 + case at_error:
206.354 + astr="at_error";
206.355 + break;
206.356 + case at_logged:
206.357 + astr="at_logged";
206.358 + break;
206.359 + default:
206.360 + astr="unknown";
206.361 + break;
206.362 + }
206.363 + va_start(ap, szFmt);
206.364 + vsnprintf(buf, sizeof(buf), szFmt, ap);
206.365 + va_end(ap);
206.366 + ENGINE_TRACE(pfnAlertMessage, P_PRE, ("atype=%s(%d) msg=%s", astr,
206.367 + atype, buf));
206.368 + RETURN_META(MRES_IGNORED);
206.369 +}
206.370 +void EngineFprintf(FILE *pfile, char *szFmt, ...) {
206.371 + va_list ap;
206.372 + char buf[1024];
206.373 + va_start(ap, szFmt);
206.374 + vsnprintf(buf, sizeof(buf), szFmt, ap);
206.375 + va_end(ap);
206.376 + ENGINE_TRACE(pfnEngineFprintf, P_PRE, ("line=%s", buf));
206.377 + RETURN_META(MRES_IGNORED);
206.378 +}
206.379 +
206.380 +void *PvAllocEntPrivateData(edict_t *pEdict, long cb) {
206.381 + ENGINE_TRACE(pfnPvAllocEntPrivateData, P_PRE, (""));
206.382 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.383 +}
206.384 +void *PvEntPrivateData(edict_t *pEdict) {
206.385 + ENGINE_TRACE(pfnPvEntPrivateData, P_PRE, (""));
206.386 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.387 +}
206.388 +void FreeEntPrivateData(edict_t *pEdict) {
206.389 + ENGINE_TRACE(pfnFreeEntPrivateData, P_PRE, (""));
206.390 + RETURN_META(MRES_IGNORED);
206.391 +}
206.392 +
206.393 +const char *SzFromIndex(int iString) {
206.394 + ENGINE_TRACE(pfnSzFromIndex, P_PRE, (""));
206.395 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.396 +}
206.397 +int AllocString(const char *szValue) {
206.398 + // more trace output in Post
206.399 + ENGINE_TRACE(pfnAllocString, P_PRE, ("str=%s", szValue));
206.400 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.401 +}
206.402 +
206.403 +struct entvars_s *GetVarsOfEnt(edict_t *pEdict) {
206.404 + ENGINE_TRACE(pfnGetVarsOfEnt, P_PRE, (""));
206.405 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.406 +}
206.407 +edict_t *PEntityOfEntOffset(int iEntOffset) {
206.408 + ENGINE_TRACE(pfnPEntityOfEntOffset, P_PRE, (""));
206.409 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.410 +}
206.411 +int EntOffsetOfPEntity(const edict_t *pEdict) {
206.412 + const edict_t *ed=pEdict;
206.413 + ENGINE_TRACE(pfnEntOffsetOfPEntity, P_PRE, ("classname=%s netname=%s",
206.414 + ed ? STRING(ed->v.classname) : "nil",
206.415 + ed ? STRING(ed->v.netname) : "nil"));
206.416 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.417 +}
206.418 +int IndexOfEdict(const edict_t *pEdict) {
206.419 + ENGINE_TRACE(pfnIndexOfEdict, P_PRE, (""));
206.420 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.421 +}
206.422 +edict_t *PEntityOfEntIndex(int iEntIndex) {
206.423 + ENGINE_TRACE(pfnPEntityOfEntIndex, P_PRE, ("index=%d", iEntIndex));
206.424 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.425 +}
206.426 +edict_t *FindEntityByVars(struct entvars_s *pvars) {
206.427 + ENGINE_TRACE(pfnFindEntityByVars, P_PRE, (""));
206.428 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.429 +}
206.430 +void *GetModelPtr(edict_t *pEdict) {
206.431 + ENGINE_TRACE(pfnGetModelPtr, P_PRE, (""));
206.432 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.433 +}
206.434 +
206.435 +int RegUserMsg(const char *pszName, int iSize) {
206.436 + // more trace output in Post
206.437 + ENGINE_TRACE(pfnRegUserMsg, P_PRE, ("msg=%s size=%d", pszName, iSize));
206.438 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.439 +}
206.440 +
206.441 +void AnimationAutomove(const edict_t *pEdict, float flTime) {
206.442 + ENGINE_TRACE(pfnAnimationAutomove, P_PRE, (""));
206.443 + RETURN_META(MRES_IGNORED);
206.444 +}
206.445 +void GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles ) {
206.446 + ENGINE_TRACE(pfnGetBonePosition, P_PRE, (""));
206.447 + RETURN_META(MRES_IGNORED);
206.448 +}
206.449 +
206.450 +unsigned long FunctionFromName( const char *pName ) {
206.451 + ENGINE_TRACE(pfnFunctionFromName, P_PRE, ("name=%s", pName));
206.452 + RETURN_META_VALUE(MRES_IGNORED, 0UL);
206.453 +}
206.454 +const char *NameForFunction( unsigned long function ) {
206.455 + ENGINE_TRACE(pfnNameForFunction, P_PRE, (""));
206.456 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.457 +}
206.458 +
206.459 +//! JOHN: engine callbacks so game DLL can print messages to individual clients
206.460 +void ClientPrintf( edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg ) {
206.461 + ENGINE_TRACE(pfnClientPrintf, P_PRE, ("msg=%s", szMsg));
206.462 + RETURN_META(MRES_IGNORED);
206.463 +}
206.464 +void ServerPrint( const char *szMsg ) {
206.465 + ENGINE_TRACE(pfnServerPrint, P_PRE, ("msg=%s", szMsg));
206.466 + RETURN_META(MRES_IGNORED);
206.467 +}
206.468 +
206.469 +//! these 3 added so game DLL can easily access client 'cmd' strings
206.470 +const char *Cmd_Args( void ) {
206.471 + // trace output in Post
206.472 + ENGINE_TRACE(pfnCmd_Args, P_PRE, (""));
206.473 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.474 +}
206.475 +const char *Cmd_Argv( int argc ) {
206.476 + // more trace output in Post
206.477 + ENGINE_TRACE(pfnCmd_Argv, P_PRE, ("argc=%d", argc));
206.478 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.479 +}
206.480 +int Cmd_Argc( void ) {
206.481 + // trace output in Post
206.482 + ENGINE_TRACE(pfnCmd_Argc, P_PRE, (""));
206.483 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.484 +}
206.485 +
206.486 +void GetAttachment(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ) {
206.487 + ENGINE_TRACE(pfnGetAttachment, P_PRE, (""));
206.488 + RETURN_META(MRES_IGNORED);
206.489 +}
206.490 +
206.491 +void CRC32_Init(CRC32_t *pulCRC) {
206.492 + ENGINE_TRACE(pfnCRC32_Init, P_PRE, (""));
206.493 + RETURN_META(MRES_IGNORED);
206.494 +}
206.495 +void CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len) {
206.496 + ENGINE_TRACE(pfnCRC32_ProcessBuffer, P_PRE, (""));
206.497 + RETURN_META(MRES_IGNORED);
206.498 +}
206.499 +void CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch) {
206.500 + ENGINE_TRACE(pfnCRC32_ProcessByte, P_PRE, (""));
206.501 + RETURN_META(MRES_IGNORED);
206.502 +}
206.503 +CRC32_t CRC32_Final(CRC32_t pulCRC) {
206.504 + ENGINE_TRACE(pfnCRC32_Final, P_PRE, (""));
206.505 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.506 +}
206.507 +
206.508 +long RandomLong(long lLow, long lHigh) {
206.509 + // more output in Post
206.510 + ENGINE_TRACE(pfnRandomLong, P_PRE, ("low=%ld, high=%ld", lLow, lHigh));
206.511 + RETURN_META_VALUE(MRES_IGNORED, 0L);
206.512 +}
206.513 +float RandomFloat(float flLow, float flHigh) {
206.514 + // more output in Post
206.515 + ENGINE_TRACE(pfnRandomFloat, P_PRE, ("low=%f, high=%f", flLow, flHigh));
206.516 + RETURN_META_VALUE(MRES_IGNORED, 0.0);
206.517 +}
206.518 +
206.519 +void SetView(const edict_t *pClient, const edict_t *pViewent ) {
206.520 + ENGINE_TRACE(pfnSetView, P_PRE, (""));
206.521 + RETURN_META(MRES_IGNORED);
206.522 +}
206.523 +float Time( void ) {
206.524 + // trace output in Post
206.525 + ENGINE_TRACE(pfnTime, P_PRE, (""));
206.526 + RETURN_META_VALUE(MRES_IGNORED, 0.0);
206.527 +}
206.528 +void CrosshairAngle(const edict_t *pClient, float pitch, float yaw) {
206.529 + ENGINE_TRACE(pfnCrosshairAngle, P_PRE, (""));
206.530 + RETURN_META(MRES_IGNORED);
206.531 +}
206.532 +
206.533 +byte *LoadFileForMe(char *filename, int *pLength) {
206.534 + ENGINE_TRACE(pfnLoadFileForMe, P_PRE, ("file=%s", filename));
206.535 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.536 +}
206.537 +void FreeFile(void *buffer) {
206.538 + ENGINE_TRACE(pfnFreeFile, P_PRE, (""));
206.539 + RETURN_META(MRES_IGNORED);
206.540 +}
206.541 +
206.542 +//! trigger_endsection
206.543 +void EndSection(const char *pszSectionName) {
206.544 + ENGINE_TRACE(pfnEndSection, P_PRE, ("section=%s", pszSectionName));
206.545 + RETURN_META(MRES_IGNORED);
206.546 +}
206.547 +int CompareFileTime(char *filename1, char *filename2, int *iCompare) {
206.548 + ENGINE_TRACE(pfnCompareFileTime, P_PRE, ("file1=%s, file2=%s", filename1, filename2));
206.549 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.550 +}
206.551 +void GetGameDir(char *szGetGameDir) {
206.552 + // trace output in Post
206.553 + ENGINE_TRACE(pfnGetGameDir, P_PRE, (""));
206.554 + RETURN_META(MRES_IGNORED);
206.555 +}
206.556 +void Cvar_RegisterVariable(cvar_t *variable) {
206.557 + ENGINE_TRACE(pfnCvar_RegisterVariable, P_PRE, ("cvar=%s", variable->name));
206.558 + RETURN_META(MRES_IGNORED);
206.559 +}
206.560 +void FadeClientVolume(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds) {
206.561 + ENGINE_TRACE(pfnFadeClientVolume, P_PRE, (""));
206.562 + RETURN_META(MRES_IGNORED);
206.563 +}
206.564 +void SetClientMaxspeed(const edict_t *pEdict, float fNewMaxspeed) {
206.565 + ENGINE_TRACE(pfnSetClientMaxspeed, P_PRE, (""));
206.566 + RETURN_META(MRES_IGNORED);
206.567 +}
206.568 +//! returns NULL if fake client can't be created
206.569 +edict_t * CreateFakeClient(const char *netname) {
206.570 + ENGINE_TRACE(pfnCreateFakeClient, P_PRE, ("name=%s", netname));
206.571 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.572 +}
206.573 +void RunPlayerMove(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec ) {
206.574 + ENGINE_TRACE(pfnRunPlayerMove, P_PRE, (""));
206.575 + RETURN_META(MRES_IGNORED);
206.576 +}
206.577 +int NumberOfEntities(void) {
206.578 + // trace output in Post
206.579 + ENGINE_TRACE(pfnNumberOfEntities, P_PRE, (""));
206.580 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.581 +}
206.582 +
206.583 +//! passing in NULL gets the serverinfo
206.584 +char *GetInfoKeyBuffer(edict_t *e) {
206.585 + ENGINE_TRACE(pfnGetInfoKeyBuffer, P_PRE, (""));
206.586 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.587 +}
206.588 +char *InfoKeyValue(char *infobuffer, char *key) {
206.589 + ENGINE_TRACE(pfnInfoKeyValue, P_PRE, ("key=%s", key));
206.590 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.591 +}
206.592 +void SetKeyValue(char *infobuffer, char *key, char *value) {
206.593 + ENGINE_TRACE(pfnSetKeyValue, P_PRE, ("key=%s, value=%s", key, value));
206.594 + RETURN_META(MRES_IGNORED);
206.595 +}
206.596 +void SetClientKeyValue(int clientIndex, char *infobuffer, char *key, char *value) {
206.597 + ENGINE_TRACE(pfnSetClientKeyValue, P_PRE, ("index=%d, key=%s, value=%s", clientIndex, key, value));
206.598 + RETURN_META(MRES_IGNORED);
206.599 +}
206.600 +
206.601 +int IsMapValid(char *filename) {
206.602 + // more trace output in Post
206.603 + ENGINE_TRACE(pfnIsMapValid, P_PRE, ("filename=%s", filename));
206.604 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.605 +}
206.606 +void StaticDecal( const float *origin, int decalIndex, int entityIndex, int modelIndex ) {
206.607 + ENGINE_TRACE(pfnStaticDecal, P_PRE, (""));
206.608 + RETURN_META(MRES_IGNORED);
206.609 +}
206.610 +int PrecacheGeneric(char *s) {
206.611 + ENGINE_TRACE(pfnPrecacheGeneric, P_PRE, ("name=%s", s));
206.612 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.613 +}
206.614 +//! returns the server assigned userid for this player. useful for logging frags, etc. returns -1 if the edict couldn't be found in the list of clients
206.615 +int GetPlayerUserId(edict_t *e ) {
206.616 + // more trace output in Post
206.617 + edict_t *ed = e;
206.618 + ENGINE_TRACE(pfnGetPlayerUserId, P_PRE, ("netname=%s",
206.619 + ed ? STRING(ed->v.netname) : "nil"));
206.620 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.621 +}
206.622 +void BuildSoundMsg(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed)
206.623 +{
206.624 + ENGINE_TRACE(pfnBuildSoundMsg, P_PRE, ("sample=%s", sample));
206.625 + RETURN_META(MRES_IGNORED);
206.626 +}
206.627 +//! is this a dedicated server?
206.628 +int IsDedicatedServer(void) {
206.629 + ENGINE_TRACE(pfnIsDedicatedServer, P_PRE, (""));
206.630 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.631 +}
206.632 +cvar_t *CVarGetPointer(const char *szVarName) {
206.633 + ENGINE_TRACE(pfnCVarGetPointer, P_PRE, ("cvar=%s", szVarName));
206.634 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.635 +}
206.636 +//! returns the server assigned WONid for this player. useful for logging frags, etc. returns -1 if the edict couldn't be found in the list of clients
206.637 +unsigned int GetPlayerWONId(edict_t *e) {
206.638 + // more output in Post
206.639 + edict_t *ed = e;
206.640 + ENGINE_TRACE(pfnGetPlayerWONId, P_PRE, ("netname=%s",
206.641 + ed ? STRING(ed->v.netname) : "nil"));
206.642 + RETURN_META_VALUE(MRES_IGNORED, 0U);
206.643 +}
206.644 +
206.645 +//! YWB 8/1/99 TFF Physics additions
206.646 +void Info_RemoveKey( char *s, const char *key ) {
206.647 + ENGINE_TRACE(pfnInfo_RemoveKey, P_PRE, ("key=%s", key));
206.648 + RETURN_META(MRES_IGNORED);
206.649 +}
206.650 +const char *GetPhysicsKeyValue( const edict_t *pClient, const char *key ) {
206.651 + ENGINE_TRACE(pfnGetPhysicsKeyValue, P_PRE, ("key=%s", key));
206.652 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.653 +}
206.654 +void SetPhysicsKeyValue( const edict_t *pClient, const char *key, const char *value ) {
206.655 + ENGINE_TRACE(pfnSetPhysicsKeyValue, P_PRE, ("key=%s, value=%s", key, value));
206.656 + RETURN_META(MRES_IGNORED);
206.657 +}
206.658 +const char *GetPhysicsInfoString( const edict_t *pClient ) {
206.659 + ENGINE_TRACE(pfnGetPhysicsInfoString, P_PRE, (""));
206.660 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.661 +}
206.662 +unsigned short PrecacheEvent( int type, const char *psz ) {
206.663 + ENGINE_TRACE(pfnPrecacheEvent, P_PRE, ("event=%s", psz));
206.664 + RETURN_META_VALUE(MRES_IGNORED, 0U);
206.665 +}
206.666 +void PlaybackEvent( int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 )
206.667 +{
206.668 + ENGINE_TRACE(pfnPlaybackEvent, P_PRE, (""));
206.669 + RETURN_META(MRES_IGNORED);
206.670 +}
206.671 +
206.672 +unsigned char *SetFatPVS( float *org ) {
206.673 + ENGINE_TRACE(pfnSetFatPVS, P_PRE, (""));
206.674 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.675 +}
206.676 +unsigned char *SetFatPAS( float *org ) {
206.677 + ENGINE_TRACE(pfnSetFatPAS, P_PRE, (""));
206.678 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.679 +}
206.680 +
206.681 +int CheckVisibility( const edict_t *entity, unsigned char *pset ) {
206.682 + ENGINE_TRACE(pfnCheckVisibility, P_PRE, (""));
206.683 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.684 +}
206.685 +
206.686 +void DeltaSetField( struct delta_s *pFields, const char *fieldname ) {
206.687 + ENGINE_TRACE(pfnDeltaSetField, P_PRE, ("field=%s", fieldname));
206.688 + RETURN_META(MRES_IGNORED);
206.689 +}
206.690 +void DeltaUnsetField( struct delta_s *pFields, const char *fieldname ) {
206.691 + ENGINE_TRACE(pfnDeltaUnsetField, P_PRE, ("field=%s", fieldname));
206.692 + RETURN_META(MRES_IGNORED);
206.693 +}
206.694 +void DeltaAddEncoder( char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ) {
206.695 + ENGINE_TRACE(pfnDeltaAddEncoder, P_PRE, (""));
206.696 + RETURN_META(MRES_IGNORED);
206.697 +}
206.698 +int GetCurrentPlayer( void ) {
206.699 + // trace output in Post
206.700 + ENGINE_TRACE(pfnGetCurrentPlayer, P_PRE, (""));
206.701 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.702 +}
206.703 +int CanSkipPlayer( const edict_t *player ) {
206.704 + ENGINE_TRACE(pfnCanSkipPlayer, P_PRE, (""));
206.705 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.706 +}
206.707 +int DeltaFindField( struct delta_s *pFields, const char *fieldname ) {
206.708 + ENGINE_TRACE(pfnDeltaFindField, P_PRE, (""));
206.709 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.710 +}
206.711 +void DeltaSetFieldByIndex( struct delta_s *pFields, int fieldNumber ) {
206.712 + ENGINE_TRACE(pfnDeltaSetFieldByIndex, P_PRE, (""));
206.713 + RETURN_META(MRES_IGNORED);
206.714 +}
206.715 +void DeltaUnsetFieldByIndex( struct delta_s *pFields, int fieldNumber ) {
206.716 + ENGINE_TRACE(pfnDeltaUnsetFieldByIndex, P_PRE, (""));
206.717 + RETURN_META(MRES_IGNORED);
206.718 +}
206.719 +
206.720 +void SetGroupMask( int mask, int op ) {
206.721 + ENGINE_TRACE(pfnSetGroupMask, P_PRE, (""));
206.722 + RETURN_META(MRES_IGNORED);
206.723 +}
206.724 +
206.725 +int engCreateInstancedBaseline( int classname, struct entity_state_s *baseline ) {
206.726 + ENGINE_TRACE(pfnCreateInstancedBaseline, P_PRE, (""));
206.727 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.728 +}
206.729 +void Cvar_DirectSet( struct cvar_s *var, char *value ) {
206.730 + ENGINE_TRACE(pfnCvar_DirectSet, P_PRE, ("cvar=%s", var->name));
206.731 + RETURN_META(MRES_IGNORED);
206.732 +}
206.733 +
206.734 +//! Forces the client and server to be running with the same version of the specified file
206.735 +//!( e.g., a player model ).
206.736 +//! Calling this has no effect in single player
206.737 +void ForceUnmodified( FORCE_TYPE type, float *mins, float *maxs, const char *filename ) {
206.738 + ENGINE_TRACE(pfnForceUnmodified, P_PRE, ("file=%s", filename));
206.739 + RETURN_META(MRES_IGNORED);
206.740 +}
206.741 +
206.742 +void GetPlayerStats( const edict_t *pClient, int *ping, int *packet_loss ) {
206.743 + ENGINE_TRACE(pfnGetPlayerStats, P_PRE, ("name=%s", STRING(pClient->v.netname)));
206.744 + RETURN_META(MRES_IGNORED);
206.745 +}
206.746 +
206.747 +void AddServerCommand( char *cmd_name, void (*function) (void) ) {
206.748 + ENGINE_TRACE(pfnAddServerCommand, P_PRE, ("cmd=%s", cmd_name));
206.749 + RETURN_META(MRES_IGNORED);
206.750 +}
206.751 +
206.752 +// Added in SDK 2.2:
206.753 +
206.754 +//! For voice communications, set which clients hear eachother.
206.755 +//! NOTE: these functions take player entity indices (starting at 1).
206.756 +qboolean Voice_GetClientListening(int iReceiver, int iSender) {
206.757 + ENGINE_TRACE(pfnVoice_GetClientListening, P_PRE, (""));
206.758 + RETURN_META_VALUE(MRES_IGNORED, false);
206.759 +}
206.760 +qboolean Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen) {
206.761 + ENGINE_TRACE(pfnVoice_SetClientListening, P_PRE, (""));
206.762 + RETURN_META_VALUE(MRES_IGNORED, false);
206.763 +}
206.764 +
206.765 +// Added for HL 1109 (no SDK update):
206.766 +
206.767 +const char *GetPlayerAuthId(edict_t *e) {
206.768 + // trace output in Post
206.769 + ENGINE_TRACE(pfnGetPlayerAuthId, P_PRE, (""));
206.770 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.771 +}
206.772 +
206.773 +// Added 2003/11/10 (no SDK update):
206.774 +
206.775 +void *SequenceGet(const char* fileName, const char* entryName) {
206.776 + ENGINE_TRACE(pfnSequenceGet, P_PRE, (""));
206.777 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.778 +}
206.779 +
206.780 +void *SequencePickSentence(const char* groupName, int pickMethod, int *picked) {
206.781 + ENGINE_TRACE(pfnSequencePickSentence, P_PRE, (""));
206.782 + RETURN_META_VALUE(MRES_IGNORED, NULL);
206.783 +}
206.784 +
206.785 +int GetFileSize(char *filename) {
206.786 + ENGINE_TRACE(pfnGetFileSize, P_PRE, (""));
206.787 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.788 +}
206.789 +
206.790 +unsigned int GetApproxWavePlayLen(const char *filepath) {
206.791 + ENGINE_TRACE(pfnGetApproxWavePlayLen, P_PRE, (""));
206.792 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.793 +}
206.794 +
206.795 +int IsCareerMatch(void) {
206.796 + ENGINE_TRACE(pfnIsCareerMatch, P_PRE, (""));
206.797 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.798 +}
206.799 +
206.800 +int GetLocalizedStringLength(const char *label) {
206.801 + ENGINE_TRACE(pfnGetLocalizedStringLength, P_PRE, (""));
206.802 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.803 +}
206.804 +
206.805 +void RegisterTutorMessageShown(int mid) {
206.806 + ENGINE_TRACE(pfnRegisterTutorMessageShown, P_PRE, (""));
206.807 + RETURN_META(MRES_IGNORED);
206.808 +}
206.809 +
206.810 +int GetTimesTutorMessageShown(int mid) {
206.811 + ENGINE_TRACE(pfnGetTimesTutorMessageShown, P_PRE, (""));
206.812 + RETURN_META_VALUE(MRES_IGNORED, 0);
206.813 +}
206.814 +
206.815 +void ProcessTutorMessageDecayBuffer(int *buffer, int bufferLength) {
206.816 + ENGINE_TRACE(pfnProcessTutorMessageDecayBuffer, P_PRE, (""));
206.817 + RETURN_META(MRES_IGNORED);
206.818 +}
206.819 +
206.820 +void ConstructTutorMessageDecayBuffer(int *buffer, int bufferLength) {
206.821 + ENGINE_TRACE(pfnConstructTutorMessageDecayBuffer, P_PRE, (""));
206.822 + RETURN_META(MRES_IGNORED);
206.823 +}
206.824 +
206.825 +void ResetTutorMessageDecayData(void) {
206.826 + ENGINE_TRACE(pfnResetTutorMessageDecayData, P_PRE, (""));
206.827 + RETURN_META(MRES_IGNORED);
206.828 +}
206.829 +
206.830 +enginefuncs_t meta_engfuncs = {
206.831 + PrecacheModel, // pfnPrecacheModel()
206.832 + PrecacheSound, // pfnPrecacheSound()
206.833 + SetModel, // pfnSetModel()
206.834 + ModelIndex, // pfnModelIndex()
206.835 + ModelFrames, // pfnModelFrames()
206.836 +
206.837 + SetSize, // pfnSetSize()
206.838 + ChangeLevel, // pfnChangeLevel()
206.839 + GetSpawnParms, // pfnGetSpawnParms()
206.840 + SaveSpawnParms, // pfnSaveSpawnParms()
206.841 +
206.842 + VecToYaw, // pfnVecToYaw()
206.843 + VecToAngles, // pfnVecToAngles()
206.844 + MoveToOrigin, // pfnMoveToOrigin()
206.845 + ChangeYaw, // pfnChangeYaw()
206.846 + ChangePitch, // pfnChangePitch()
206.847 +
206.848 + FindEntityByString, // pfnFindEntityByString()
206.849 + GetEntityIllum, // pfnGetEntityIllum()
206.850 + FindEntityInSphere, // pfnFindEntityInSphere()
206.851 + FindClientInPVS, // pfnFindClientInPVS()
206.852 + EntitiesInPVS, // pfnEntitiesInPVS()
206.853 +
206.854 + MakeVectors, // pfnMakeVectors()
206.855 + AngleVectors, // pfnAngleVectors()
206.856 +
206.857 + CreateEntity, // pfnCreateEntity()
206.858 + RemoveEntity, // pfnRemoveEntity()
206.859 + CreateNamedEntity, // pfnCreateNamedEntity()
206.860 +
206.861 + MakeStatic, // pfnMakeStatic()
206.862 + EntIsOnFloor, // pfnEntIsOnFloor()
206.863 + DropToFloor, // pfnDropToFloor()
206.864 +
206.865 + WalkMove, // pfnWalkMove()
206.866 + SetOrigin, // pfnSetOrigin()
206.867 +
206.868 + EmitSound, // pfnEmitSound()
206.869 + EmitAmbientSound, // pfnEmitAmbientSound()
206.870 +
206.871 + TraceLine, // pfnTraceLine()
206.872 + TraceToss, // pfnTraceToss()
206.873 + TraceMonsterHull, // pfnTraceMonsterHull()
206.874 + TraceHull, // pfnTraceHull()
206.875 + TraceModel, // pfnTraceModel()
206.876 + TraceTexture, // pfnTraceTexture()
206.877 + TraceSphere, // pfnTraceSphere()
206.878 + GetAimVector, // pfnGetAimVector()
206.879 +
206.880 + ServerCommand, // pfnServerCommand()
206.881 + ServerExecute, // pfnServerExecute()
206.882 + engClientCommand, // pfnClientCommand() // d'oh, ClientCommand in dllapi too
206.883 +
206.884 + ParticleEffect, // pfnParticleEffect()
206.885 + LightStyle, // pfnLightStyle()
206.886 + DecalIndex, // pfnDecalIndex()
206.887 + PointContents, // pfnPointContents()
206.888 +
206.889 + MessageBegin, // pfnMessageBegin()
206.890 + MessageEnd, // pfnMessageEnd()
206.891 +
206.892 + WriteByte, // pfnWriteByte()
206.893 + WriteChar, // pfnWriteChar()
206.894 + WriteShort, // pfnWriteShort()
206.895 + WriteLong, // pfnWriteLong()
206.896 + WriteAngle, // pfnWriteAngle()
206.897 + WriteCoord, // pfnWriteCoord()
206.898 + WriteString, // pfnWriteString()
206.899 + WriteEntity, // pfnWriteEntity()
206.900 +
206.901 + CVarRegister, // pfnCVarRegister()
206.902 + CVarGetFloat, // pfnCVarGetFloat()
206.903 + CVarGetString, // pfnCVarGetString()
206.904 + CVarSetFloat, // pfnCVarSetFloat()
206.905 + CVarSetString, // pfnCVarSetString()
206.906 +
206.907 + AlertMessage, // pfnAlertMessage()
206.908 + EngineFprintf, // pfnEngineFprintf()
206.909 +
206.910 + PvAllocEntPrivateData, // pfnPvAllocEntPrivateData()
206.911 + PvEntPrivateData, // pfnPvEntPrivateData()
206.912 + FreeEntPrivateData, // pfnFreeEntPrivateData()
206.913 +
206.914 + SzFromIndex, // pfnSzFromIndex()
206.915 + AllocString, // pfnAllocString()
206.916 +
206.917 + GetVarsOfEnt, // pfnGetVarsOfEnt()
206.918 + PEntityOfEntOffset, // pfnPEntityOfEntOffset()
206.919 + EntOffsetOfPEntity, // pfnEntOffsetOfPEntity()
206.920 + IndexOfEdict, // pfnIndexOfEdict()
206.921 + PEntityOfEntIndex, // pfnPEntityOfEntIndex()
206.922 + FindEntityByVars, // pfnFindEntityByVars()
206.923 + GetModelPtr, // pfnGetModelPtr()
206.924 +
206.925 + RegUserMsg, // pfnRegUserMsg()
206.926 +
206.927 + AnimationAutomove, // pfnAnimationAutomove()
206.928 + GetBonePosition, // pfnGetBonePosition()
206.929 +
206.930 + FunctionFromName, // pfnFunctionFromName()
206.931 + NameForFunction, // pfnNameForFunction()
206.932 +
206.933 + ClientPrintf, // pfnClientPrintf() //! JOHN: engine callbacks so game DLL can print messages to individual clients
206.934 + ServerPrint, // pfnServerPrint()
206.935 +
206.936 + Cmd_Args, // pfnCmd_Args() //! these 3 added
206.937 + Cmd_Argv, // pfnCmd_Argv() //! so game DLL can easily
206.938 + Cmd_Argc, // pfnCmd_Argc() //! access client 'cmd' strings
206.939 +
206.940 + GetAttachment, // pfnGetAttachment()
206.941 +
206.942 + CRC32_Init, // pfnCRC32_Init()
206.943 + CRC32_ProcessBuffer, // pfnCRC32_ProcessBuffer()
206.944 + CRC32_ProcessByte, // pfnCRC32_ProcessByte()
206.945 + CRC32_Final, // pfnCRC32_Final()
206.946 +
206.947 + RandomLong, // pfnRandomLong()
206.948 + RandomFloat, // pfnRandomFloat()
206.949 +
206.950 + SetView, // pfnSetView()
206.951 + Time, // pfnTime()
206.952 + CrosshairAngle, // pfnCrosshairAngle()
206.953 +
206.954 + LoadFileForMe, // pfnLoadFileForMe()
206.955 + FreeFile, // pfnFreeFile()
206.956 +
206.957 + EndSection, // pfnEndSection() //! trigger_endsection
206.958 + CompareFileTime, // pfnCompareFileTime()
206.959 + GetGameDir, // pfnGetGameDir()
206.960 + Cvar_RegisterVariable, // pfnCvar_RegisterVariable()
206.961 + FadeClientVolume, // pfnFadeClientVolume()
206.962 + SetClientMaxspeed, // pfnSetClientMaxspeed()
206.963 + CreateFakeClient, // pfnCreateFakeClient() //! returns NULL if fake client can't be created
206.964 + RunPlayerMove, // pfnRunPlayerMove()
206.965 + NumberOfEntities, // pfnNumberOfEntities()
206.966 +
206.967 + GetInfoKeyBuffer, // pfnGetInfoKeyBuffer() //! passing in NULL gets the serverinfo
206.968 + InfoKeyValue, // pfnInfoKeyValue()
206.969 + SetKeyValue, // pfnSetKeyValue()
206.970 + SetClientKeyValue, // pfnSetClientKeyValue()
206.971 +
206.972 + IsMapValid, // pfnIsMapValid()
206.973 + StaticDecal, // pfnStaticDecal()
206.974 + PrecacheGeneric, // pfnPrecacheGeneric()
206.975 + GetPlayerUserId, // pfnGetPlayerUserId() //! returns the server assigned userid for this player.
206.976 + BuildSoundMsg, // pfnBuildSoundMsg()
206.977 + IsDedicatedServer, // pfnIsDedicatedServer() //! is this a dedicated server?
206.978 + CVarGetPointer, // pfnCVarGetPointer()
206.979 + GetPlayerWONId, // pfnGetPlayerWONId() //! returns the server assigned WONid for this player.
206.980 +
206.981 + //! YWB 8/1/99 TFF Physics additions
206.982 + Info_RemoveKey, // pfnInfo_RemoveKey()
206.983 + GetPhysicsKeyValue, // pfnGetPhysicsKeyValue()
206.984 + SetPhysicsKeyValue, // pfnSetPhysicsKeyValue()
206.985 + GetPhysicsInfoString, // pfnGetPhysicsInfoString()
206.986 + PrecacheEvent, // pfnPrecacheEvent()
206.987 + PlaybackEvent, // pfnPlaybackEvent()
206.988 +
206.989 + SetFatPVS, // pfnSetFatPVS()
206.990 + SetFatPAS, // pfnSetFatPAS()
206.991 +
206.992 + CheckVisibility, // pfnCheckVisibility()
206.993 +
206.994 + DeltaSetField, // pfnDeltaSetField()
206.995 + DeltaUnsetField, // pfnDeltaUnsetField()
206.996 + DeltaAddEncoder, // pfnDeltaAddEncoder()
206.997 + GetCurrentPlayer, // pfnGetCurrentPlayer()
206.998 + CanSkipPlayer, // pfnCanSkipPlayer()
206.999 + DeltaFindField, // pfnDeltaFindField()
206.1000 + DeltaSetFieldByIndex, // pfnDeltaSetFieldByIndex()
206.1001 + DeltaUnsetFieldByIndex, // pfnDeltaUnsetFieldByIndex()
206.1002 +
206.1003 + SetGroupMask, // pfnSetGroupMask()
206.1004 +
206.1005 + engCreateInstancedBaseline, // pfnCreateInstancedBaseline() // d'oh, CreateInstancedBaseline in dllapi too
206.1006 + Cvar_DirectSet, // pfnCvar_DirectSet()
206.1007 +
206.1008 + ForceUnmodified, // pfnForceUnmodified()
206.1009 +
206.1010 + GetPlayerStats, // pfnGetPlayerStats()
206.1011 +
206.1012 + AddServerCommand, // pfnAddServerCommand()
206.1013 +
206.1014 + // Added in SDK 2.2:
206.1015 + Voice_GetClientListening, // pfnVoice_GetClientListening()
206.1016 + Voice_SetClientListening, // pfnVoice_SetClientListening()
206.1017 +
206.1018 + // Added for HL 1109 (no SDK update):
206.1019 + GetPlayerAuthId, // pfnGetPlayerAuthId()
206.1020 +
206.1021 + // Added 2003/11/10 (no SDK update):
206.1022 + SequenceGet, // pfnSequenceGet()
206.1023 + SequencePickSentence, // pfnSequencePickSentence()
206.1024 + GetFileSize, // pfnGetFileSize()
206.1025 + GetApproxWavePlayLen, // pfnGetApproxWavePlayLen()
206.1026 + IsCareerMatch, // pfnIsCareerMatch()
206.1027 + GetLocalizedStringLength, // pfnGetLocalizedStringLength()
206.1028 + RegisterTutorMessageShown, // pfnRegisterTutorMessageShown()
206.1029 + GetTimesTutorMessageShown, // pfnGetTimesTutorMessageShown()
206.1030 + ProcessTutorMessageDecayBuffer, // pfnProcessTutorMessageDecayBuffer()
206.1031 + ConstructTutorMessageDecayBuffer, // pfnConstructTutorMessageDecayBuffer()
206.1032 + ResetTutorMessageDecayData, // pfnResetTutorMessageDecayData()
206.1033 +};
206.1034 +
206.1035 +C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine,
206.1036 + int *interfaceVersion)
206.1037 +{
206.1038 + LOG_DEVELOPER(PLID, "called: GetEngineFunctions; version=%d",
206.1039 + *interfaceVersion);
206.1040 + if(!pengfuncsFromEngine) {
206.1041 + LOG_ERROR(PLID,
206.1042 + "GetEngineFunctions called with null pengfuncsFromEngine");
206.1043 + return(FALSE);
206.1044 + }
206.1045 + else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) {
206.1046 + LOG_ERROR(PLID,
206.1047 + "GetEngineFunctions version mismatch; requested=%d ours=%d",
206.1048 + *interfaceVersion, ENGINE_INTERFACE_VERSION);
206.1049 + // Tell metamod what version we had, so it can figure out who is
206.1050 + // out of date.
206.1051 + *interfaceVersion = ENGINE_INTERFACE_VERSION;
206.1052 + return(FALSE);
206.1053 + }
206.1054 + memcpy(pengfuncsFromEngine, &meta_engfuncs, sizeof(enginefuncs_t));
206.1055 + return TRUE;
206.1056 +}
207.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
207.2 +++ b/trace_plugin/engine_api_post.cpp Tue Apr 06 07:36:14 2004 +0000
207.3 @@ -0,0 +1,1041 @@
207.4 +// vi: set ts=4 sw=4 :
207.5 +// vim: set tw=75 :
207.6 +
207.7 +// engine_api_post.cpp - implementation of "post" versions of Half-Life engine
207.8 +// functions
207.9 +
207.10 +/*
207.11 + * Copyright (c) 2001-2003 Will Day <[email protected]>
207.12 + *
207.13 + * This file is part of Metamod.
207.14 + *
207.15 + * Metamod is free software; you can redistribute it and/or modify it
207.16 + * under the terms of the GNU General Public License as published by the
207.17 + * Free Software Foundation; either version 2 of the License, or (at
207.18 + * your option) any later version.
207.19 + *
207.20 + * Metamod is distributed in the hope that it will be useful, but
207.21 + * WITHOUT ANY WARRANTY; without even the implied warranty of
207.22 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
207.23 + * General Public License for more details.
207.24 + *
207.25 + * You should have received a copy of the GNU General Public License
207.26 + * along with Metamod; if not, write to the Free Software Foundation,
207.27 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
207.28 + *
207.29 + * In addition, as a special exception, the author gives permission to
207.30 + * link the code of this program with the Half-Life Game Engine ("HL
207.31 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
207.32 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
207.33 + * respects for all of the code used other than the HL Engine and MODs
207.34 + * from Valve. If you modify this file, you may extend this exception
207.35 + * to your version of the file, but you are not obligated to do so. If
207.36 + * you do not wish to do so, delete this exception statement from your
207.37 + * version.
207.38 + *
207.39 + */
207.40 +
207.41 +#include <stdio.h>
207.42 +#include <stdarg.h>
207.43 +
207.44 +#include <extdll.h>
207.45 +
207.46 +#include "engine_api.h"
207.47 +#include "meta_api.h"
207.48 +#include "trace_api.h"
207.49 +#include "log_plugin.h"
207.50 +
207.51 +
207.52 +int PrecacheModel_Post(char *s) {
207.53 + ENGINE_TRACE(pfnPrecacheModel, P_POST, (""));
207.54 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.55 +}
207.56 +int PrecacheSound_Post(char *s) {
207.57 + ENGINE_TRACE(pfnPrecacheSound, P_POST, (""));
207.58 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.59 +}
207.60 +void SetModel_Post(edict_t *e, const char *m) {
207.61 + ENGINE_TRACE(pfnSetModel, P_POST, (""));
207.62 + RETURN_META(MRES_IGNORED);
207.63 +}
207.64 +int ModelIndex_Post(const char *m) {
207.65 + ENGINE_TRACE(pfnModelIndex, P_POST, (""));
207.66 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.67 +}
207.68 +int ModelFrames_Post(int modelIndex) {
207.69 + ENGINE_TRACE(pfnModelFrames, P_POST, (""));
207.70 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.71 +}
207.72 +
207.73 +void SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax) {
207.74 + ENGINE_TRACE(pfnSetSize, P_POST, (""));
207.75 + RETURN_META(MRES_IGNORED);
207.76 +}
207.77 +void ChangeLevel_Post(char *s1, char *s2) {
207.78 + // trace output in Pre
207.79 + ENGINE_TRACE(pfnChangeLevel, P_POST, (""));
207.80 + RETURN_META(MRES_IGNORED);
207.81 +}
207.82 +void GetSpawnParms_Post(edict_t *ent) {
207.83 + ENGINE_TRACE(pfnGetSpawnParms, P_POST, (""));
207.84 + RETURN_META(MRES_IGNORED);
207.85 +}
207.86 +void SaveSpawnParms_Post(edict_t *ent) {
207.87 + ENGINE_TRACE(pfnSaveSpawnParms, P_POST, (""));
207.88 + RETURN_META(MRES_IGNORED);
207.89 +}
207.90 +
207.91 +float VecToYaw_Post(const float *rgflVector) {
207.92 + ENGINE_TRACE(pfnVecToYaw, P_POST, (""));
207.93 + RETURN_META_VALUE(MRES_IGNORED, 0.0);
207.94 +}
207.95 +void VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut) {
207.96 + ENGINE_TRACE(pfnVecToAngles, P_POST, (""));
207.97 + RETURN_META(MRES_IGNORED);
207.98 +}
207.99 +void MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType) {
207.100 + ENGINE_TRACE(pfnMoveToOrigin, P_POST, (""));
207.101 + RETURN_META(MRES_IGNORED);
207.102 +}
207.103 +void ChangeYaw_Post(edict_t *ent) {
207.104 + ENGINE_TRACE(pfnChangeYaw, P_POST, (""));
207.105 + RETURN_META(MRES_IGNORED);
207.106 +}
207.107 +void ChangePitch_Post(edict_t *ent) {
207.108 + ENGINE_TRACE(pfnChangePitch, P_POST, (""));
207.109 + RETURN_META(MRES_IGNORED);
207.110 +}
207.111 +
207.112 +edict_t *FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue) {
207.113 + edict_t *ed=META_RESULT_ORIG_RET(edict_t *);
207.114 + ENGINE_TRACE(pfnFindEntityByString, P_POST, ("classname=%s netname=%s",
207.115 + ed ? STRING(ed->v.classname) : "nil",
207.116 + ed ? STRING(ed->v.netname) : "nil"));
207.117 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.118 +}
207.119 +int GetEntityIllum_Post(edict_t *pEnt) {
207.120 + ENGINE_TRACE(pfnGetEntityIllum, P_POST, (""));
207.121 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.122 +}
207.123 +edict_t *FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad) {
207.124 + edict_t *ret;
207.125 + ret=META_RESULT_ORIG_RET(edict_t *);
207.126 + ENGINE_TRACE(pfnFindEntityInSphere, P_POST, ("previous=%s current=%s",
207.127 + pEdictStartSearchAfter ? STRING(pEdictStartSearchAfter->v.classname) : "nil",
207.128 + ret ? STRING(ret->v.classname) : "nil"));
207.129 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.130 +}
207.131 +edict_t *FindClientInPVS_Post(edict_t *pEdict) {
207.132 + ENGINE_TRACE(pfnFindClientInPVS, P_POST, (""));
207.133 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.134 +}
207.135 +edict_t *EntitiesInPVS_Post(edict_t *pplayer) {
207.136 + ENGINE_TRACE(pfnEntitiesInPVS, P_POST, (""));
207.137 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.138 +}
207.139 +
207.140 +void MakeVectors_Post(const float *rgflVector) {
207.141 + ENGINE_TRACE(pfnMakeVectors, P_POST, (""));
207.142 + RETURN_META(MRES_IGNORED);
207.143 +}
207.144 +void AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up) {
207.145 + ENGINE_TRACE(pfnAngleVectors, P_POST, (""));
207.146 + RETURN_META(MRES_IGNORED);
207.147 +}
207.148 +
207.149 +edict_t *CreateEntity_Post(void) {
207.150 + ENGINE_TRACE(pfnCreateEntity, P_POST, (""));
207.151 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.152 +}
207.153 +void RemoveEntity_Post(edict_t *e) {
207.154 + ENGINE_TRACE(pfnRemoveEntity, P_POST, (""));
207.155 + RETURN_META(MRES_IGNORED);
207.156 +}
207.157 +edict_t *CreateNamedEntity_Post(int className) {
207.158 + edict_t *ret;
207.159 + ret=META_RESULT_ORIG_RET(edict_t *);
207.160 + ENGINE_TRACE(pfnCreateNamedEntity, P_POST, ("created=%s",
207.161 + ret ? STRING(ret->v.classname) : "nil"));
207.162 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.163 +}
207.164 +
207.165 +void MakeStatic_Post(edict_t *ent) {
207.166 + ENGINE_TRACE(pfnMakeStatic, P_POST, (""));
207.167 + RETURN_META(MRES_IGNORED);
207.168 +}
207.169 +int EntIsOnFloor_Post(edict_t *e) {
207.170 + ENGINE_TRACE(pfnEntIsOnFloor, P_POST, (""));
207.171 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.172 +}
207.173 +int DropToFloor_Post(edict_t *e) {
207.174 + ENGINE_TRACE(pfnDropToFloor, P_POST, (""));
207.175 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.176 +}
207.177 +
207.178 +int WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode) {
207.179 + ENGINE_TRACE(pfnWalkMove, P_POST, (""));
207.180 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.181 +}
207.182 +void SetOrigin_Post(edict_t *e, const float *rgflOrigin) {
207.183 + ENGINE_TRACE(pfnSetOrigin, P_POST, (""));
207.184 + RETURN_META(MRES_IGNORED);
207.185 +}
207.186 +
207.187 +void EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch) {
207.188 + ENGINE_TRACE(pfnEmitSound, P_POST, (""));
207.189 + RETURN_META(MRES_IGNORED);
207.190 +}
207.191 +void EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch) {
207.192 + ENGINE_TRACE(pfnEmitAmbientSound, P_POST, (""));
207.193 + RETURN_META(MRES_IGNORED);
207.194 +}
207.195 +
207.196 +void TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr) {
207.197 + ENGINE_TRACE(pfnTraceLine, P_POST, (""));
207.198 + RETURN_META(MRES_IGNORED);
207.199 +}
207.200 +void TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr) {
207.201 + ENGINE_TRACE(pfnTraceToss, P_POST, (""));
207.202 + RETURN_META(MRES_IGNORED);
207.203 +}
207.204 +int TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr) {
207.205 + ENGINE_TRACE(pfnTraceMonsterHull, P_POST, (""));
207.206 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.207 +}
207.208 +void TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr) {
207.209 + ENGINE_TRACE(pfnTraceHull, P_POST, (""));
207.210 + RETURN_META(MRES_IGNORED);
207.211 +}
207.212 +void TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr) {
207.213 + ENGINE_TRACE(pfnTraceModel, P_POST, (""));
207.214 + RETURN_META(MRES_IGNORED);
207.215 +}
207.216 +const char *TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 ) {
207.217 + ENGINE_TRACE(pfnTraceTexture, P_POST, (""));
207.218 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.219 +}
207.220 +void TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr) {
207.221 + ENGINE_TRACE(pfnTraceSphere, P_POST, (""));
207.222 + RETURN_META(MRES_IGNORED);
207.223 +}
207.224 +void GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn) {
207.225 + ENGINE_TRACE(pfnGetAimVector, P_POST, (""));
207.226 + RETURN_META(MRES_IGNORED);
207.227 +}
207.228 +
207.229 +void ServerCommand_Post(char *str) {
207.230 + // trace output in Pre
207.231 + ENGINE_TRACE(pfnServerCommand, P_POST, (""));
207.232 + RETURN_META(MRES_IGNORED);
207.233 +}
207.234 +void ServerExecute_Post(void) {
207.235 + ENGINE_TRACE(pfnServerExecute, P_POST, (""));
207.236 + RETURN_META(MRES_IGNORED);
207.237 +}
207.238 +void engClientCommand_Post(edict_t *pEdict, char *szFmt, ...) {
207.239 + // trace output in Pre
207.240 + ENGINE_TRACE(pfnClientCommand, P_POST, (""));
207.241 + RETURN_META(MRES_IGNORED);
207.242 +}
207.243 +
207.244 +void ParticleEffect_Post(const float *org, const float *dir, float color, float count) {
207.245 + ENGINE_TRACE(pfnParticleEffect, P_POST, (""));
207.246 + RETURN_META(MRES_IGNORED);
207.247 +}
207.248 +void LightStyle_Post(int style, char *val) {
207.249 + ENGINE_TRACE(pfnLightStyle, P_POST, (""));
207.250 + RETURN_META(MRES_IGNORED);
207.251 +}
207.252 +int DecalIndex_Post(const char *name) {
207.253 + ENGINE_TRACE(pfnDecalIndex, P_POST, (""));
207.254 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.255 +}
207.256 +int PointContents_Post(const float *rgflVector) {
207.257 + ENGINE_TRACE(pfnPointContents, P_POST, (""));
207.258 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.259 +}
207.260 +
207.261 +void MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed) {
207.262 + if(msg_type > 64)
207.263 + ENGINE_TRACE(pfnMessageBegin, P_POST, (""));
207.264 + RETURN_META(MRES_IGNORED);
207.265 +}
207.266 +void MessageEnd_Post(void) {
207.267 + ENGINE_TRACE(pfnMessageEnd, P_POST, (""));
207.268 + RETURN_META(MRES_IGNORED);
207.269 +}
207.270 +
207.271 +void WriteByte_Post(int iValue) {
207.272 + ENGINE_TRACE(pfnWriteByte, P_POST, (""));
207.273 + RETURN_META(MRES_IGNORED);
207.274 +}
207.275 +void WriteChar_Post(int iValue) {
207.276 + ENGINE_TRACE(pfnWriteChar, P_POST, (""));
207.277 + RETURN_META(MRES_IGNORED);
207.278 +}
207.279 +void WriteShort_Post(int iValue) {
207.280 + ENGINE_TRACE(pfnWriteShort, P_POST, (""));
207.281 + RETURN_META(MRES_IGNORED);
207.282 +}
207.283 +void WriteLong_Post(int iValue) {
207.284 + ENGINE_TRACE(pfnWriteLong, P_POST, (""));
207.285 + RETURN_META(MRES_IGNORED);
207.286 +}
207.287 +void WriteAngle_Post(float flValue) {
207.288 + ENGINE_TRACE(pfnWriteAngle, P_POST, (""));
207.289 + RETURN_META(MRES_IGNORED);
207.290 +}
207.291 +void WriteCoord_Post(float flValue) {
207.292 + ENGINE_TRACE(pfnWriteCoord, P_POST, (""));
207.293 + RETURN_META(MRES_IGNORED);
207.294 +}
207.295 +void WriteString_Post(const char *sz) {
207.296 + // trace output in Pre
207.297 + ENGINE_TRACE(pfnWriteString, P_POST, (""));
207.298 + RETURN_META(MRES_IGNORED);
207.299 +}
207.300 +void WriteEntity_Post(int iValue) {
207.301 + ENGINE_TRACE(pfnWriteEntity, P_POST, (""));
207.302 + RETURN_META(MRES_IGNORED);
207.303 +}
207.304 +
207.305 +void CVarRegister_Post(cvar_t *pCvar) {
207.306 + // trace output in Pre
207.307 + ENGINE_TRACE(pfnCVarRegister, P_POST, (""));
207.308 + RETURN_META(MRES_IGNORED);
207.309 +}
207.310 +float CVarGetFloat_Post(const char *szVarName) {
207.311 + ENGINE_TRACE(pfnCVarGetFloat, P_POST, ("cvar=%s val=%f",
207.312 + szVarName, META_RESULT_ORIG_RET(float)));
207.313 + RETURN_META_VALUE(MRES_IGNORED, 0.0);
207.314 +}
207.315 +const char *CVarGetString_Post(const char *szVarName) {
207.316 + const char *val=META_RESULT_ORIG_RET(const char *);
207.317 + ENGINE_TRACE(pfnCVarGetString, P_POST, ("cvar=%s val=%s",
207.318 + szVarName,
207.319 + val ? val : "nil"));
207.320 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.321 +}
207.322 +void CVarSetFloat_Post(const char *szVarName, float flValue) {
207.323 + // trace output in Pre
207.324 + ENGINE_TRACE(pfnCVarSetFloat, P_POST, (""));
207.325 + RETURN_META(MRES_IGNORED);
207.326 +}
207.327 +void CVarSetString_Post(const char *szVarName, const char *szValue) {
207.328 + // trace output in Pre
207.329 + ENGINE_TRACE(pfnCVarSetString, P_POST, (""));
207.330 + RETURN_META(MRES_IGNORED);
207.331 +}
207.332 +
207.333 +void AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...) {
207.334 + // trace output in Pre
207.335 + ENGINE_TRACE(pfnAlertMessage, P_POST, (""));
207.336 + RETURN_META(MRES_IGNORED);
207.337 +}
207.338 +void EngineFprintf_Post(FILE *pfile, char *szFmt, ...) {
207.339 + // trace output in Pre
207.340 + ENGINE_TRACE(pfnEngineFprintf, P_POST, (""));
207.341 + RETURN_META(MRES_IGNORED);
207.342 +}
207.343 +
207.344 +void *PvAllocEntPrivateData_Post(edict_t *pEdict, long cb) {
207.345 + ENGINE_TRACE(pfnPvAllocEntPrivateData, P_POST, (""));
207.346 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.347 +}
207.348 +void *PvEntPrivateData_Post(edict_t *pEdict) {
207.349 + ENGINE_TRACE(pfnPvEntPrivateData, P_POST, (""));
207.350 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.351 +}
207.352 +void FreeEntPrivateData_Post(edict_t *pEdict) {
207.353 + ENGINE_TRACE(pfnFreeEntPrivateData, P_POST, (""));
207.354 + RETURN_META(MRES_IGNORED);
207.355 +}
207.356 +
207.357 +const char *SzFromIndex_Post(int iString) {
207.358 + ENGINE_TRACE(pfnSzFromIndex, P_POST, (""));
207.359 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.360 +}
207.361 +int AllocString_Post(const char *szValue) {
207.362 + ENGINE_TRACE(pfnAllocString, P_POST, ("str=%s alloc=%d",
207.363 + szValue, META_RESULT_ORIG_RET(int)));
207.364 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.365 +}
207.366 +
207.367 +struct entvars_s *GetVarsOfEnt_Post(edict_t *pEdict) {
207.368 + ENGINE_TRACE(pfnGetVarsOfEnt, P_POST, (""));
207.369 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.370 +}
207.371 +edict_t *PEntityOfEntOffset_Post(int iEntOffset) {
207.372 + ENGINE_TRACE(pfnPEntityOfEntOffset, P_POST, (""));
207.373 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.374 +}
207.375 +int EntOffsetOfPEntity_Post(const edict_t *pEdict) {
207.376 + ENGINE_TRACE(pfnEntOffsetOfPEntity, P_POST, ("offset=%d",
207.377 + META_RESULT_ORIG_RET(int)));
207.378 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.379 +}
207.380 +int IndexOfEdict_Post(const edict_t *pEdict) {
207.381 + ENGINE_TRACE(pfnIndexOfEdict, P_POST, (""));
207.382 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.383 +}
207.384 +edict_t *PEntityOfEntIndex_Post(int iEntIndex) {
207.385 + edict_t *ed=META_RESULT_ORIG_RET(edict_t *);
207.386 + ENGINE_TRACE(pfnPEntityOfEntIndex, P_POST, ("classname=%s netname=%s",
207.387 + ed ? STRING(ed->v.classname) : "nil",
207.388 + ed ? STRING(ed->v.netname) : "nil"));
207.389 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.390 +}
207.391 +edict_t *FindEntityByVars_Post(struct entvars_s *pvars) {
207.392 + ENGINE_TRACE(pfnFindEntityByVars, P_POST, (""));
207.393 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.394 +}
207.395 +void *GetModelPtr_Post(edict_t *pEdict) {
207.396 + ENGINE_TRACE(pfnGetModelPtr, P_POST, (""));
207.397 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.398 +}
207.399 +
207.400 +int RegUserMsg_Post(const char *pszName, int iSize) {
207.401 + int ret;
207.402 + ENGINE_TRACE(pfnRegUserMsg, P_POST, ("msg=%s, id=%d, size=%d",
207.403 + pszName, META_RESULT_ORIG_RET(int), iSize));
207.404 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.405 +}
207.406 +
207.407 +void AnimationAutomove_Post(const edict_t *pEdict, float flTime) {
207.408 + ENGINE_TRACE(pfnAnimationAutomove, P_POST, (""));
207.409 + RETURN_META(MRES_IGNORED);
207.410 +}
207.411 +void GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles ) {
207.412 + ENGINE_TRACE(pfnGetBonePosition, P_POST, (""));
207.413 + RETURN_META(MRES_IGNORED);
207.414 +}
207.415 +
207.416 +unsigned long FunctionFromName_Post( const char *pName ) {
207.417 + ENGINE_TRACE(pfnFunctionFromName, P_POST, (""));
207.418 + RETURN_META_VALUE(MRES_IGNORED, 0UL);
207.419 +}
207.420 +const char *NameForFunction_Post( unsigned long function ) {
207.421 + ENGINE_TRACE(pfnNameForFunction, P_POST, (""));
207.422 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.423 +}
207.424 +
207.425 +//! JOHN: engine callbacks so game DLL can print messages to individual clients
207.426 +void ClientPrintf_Post( edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg ) {
207.427 + // trace output in Pre
207.428 + ENGINE_TRACE(pfnClientPrintf, P_POST, (""));
207.429 + RETURN_META(MRES_IGNORED);
207.430 +}
207.431 +void ServerPrint_Post( const char *szMsg ) {
207.432 + // trace output in Pre
207.433 + ENGINE_TRACE(pfnServerPrint, P_POST, (""));
207.434 + RETURN_META(MRES_IGNORED);
207.435 +}
207.436 +
207.437 +//! these 3 added so game DLL can easily access client 'cmd' strings
207.438 +const char *Cmd_Args_Post( void ) {
207.439 + ENGINE_TRACE(pfnCmd_Args, P_POST, ("args=%s",
207.440 + META_RESULT_ORIG_RET(char *)));
207.441 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.442 +}
207.443 +const char *Cmd_Argv_Post( int argc ) {
207.444 + ENGINE_TRACE(pfnCmd_Argv, P_POST, ("arg=%s",
207.445 + META_RESULT_ORIG_RET(char *)));
207.446 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.447 +}
207.448 +int Cmd_Argc_Post( void ) {
207.449 + ENGINE_TRACE(pfnCmd_Argc, P_POST, ("argc=%d",
207.450 + META_RESULT_ORIG_RET(int)));
207.451 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.452 +}
207.453 +
207.454 +void GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ) {
207.455 + ENGINE_TRACE(pfnGetAttachment, P_POST, (""));
207.456 + RETURN_META(MRES_IGNORED);
207.457 +}
207.458 +
207.459 +void CRC32_Init_Post(CRC32_t *pulCRC) {
207.460 + ENGINE_TRACE(pfnCRC32_Init, P_POST, (""));
207.461 + RETURN_META(MRES_IGNORED);
207.462 +}
207.463 +void CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len) {
207.464 + ENGINE_TRACE(pfnCRC32_ProcessBuffer, P_POST, (""));
207.465 + RETURN_META(MRES_IGNORED);
207.466 +}
207.467 +void CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch) {
207.468 + ENGINE_TRACE(pfnCRC32_ProcessByte, P_POST, (""));
207.469 + RETURN_META(MRES_IGNORED);
207.470 +}
207.471 +CRC32_t CRC32_Final_Post(CRC32_t pulCRC) {
207.472 + ENGINE_TRACE(pfnCRC32_Final, P_POST, (""));
207.473 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.474 +}
207.475 +
207.476 +long RandomLong_Post(long lLow, long lHigh) {
207.477 + ENGINE_TRACE(pfnRandomLong, P_POST, ("random=%ld",
207.478 + META_RESULT_ORIG_RET(long)));
207.479 + RETURN_META_VALUE(MRES_IGNORED, 0L);
207.480 +}
207.481 +float RandomFloat_Post(float flLow, float flHigh) {
207.482 + ENGINE_TRACE(pfnRandomFloat, P_POST, ("random=%f",
207.483 + META_RESULT_ORIG_RET(float)));
207.484 + RETURN_META_VALUE(MRES_IGNORED, 0.0);
207.485 +}
207.486 +
207.487 +void SetView_Post(const edict_t *pClient, const edict_t *pViewent ) {
207.488 + ENGINE_TRACE(pfnSetView, P_POST, (""));
207.489 + RETURN_META(MRES_IGNORED);
207.490 +}
207.491 +float Time_Post( void ) {
207.492 + ENGINE_TRACE(pfnTime, P_POST, ("time=%f",
207.493 + META_RESULT_ORIG_RET(float)));
207.494 + RETURN_META_VALUE(MRES_IGNORED, 0.0);
207.495 +}
207.496 +void CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw) {
207.497 + ENGINE_TRACE(pfnCrosshairAngle, P_POST, (""));
207.498 + RETURN_META(MRES_IGNORED);
207.499 +}
207.500 +
207.501 +byte *LoadFileForMe_Post(char *filename, int *pLength) {
207.502 + ENGINE_TRACE(pfnLoadFileForMe, P_POST, (""));
207.503 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.504 +}
207.505 +void FreeFile_Post(void *buffer) {
207.506 + ENGINE_TRACE(pfnFreeFile, P_POST, (""));
207.507 + RETURN_META(MRES_IGNORED);
207.508 +}
207.509 +
207.510 +//! trigger_endsection
207.511 +void EndSection_Post(const char *pszSectionName) {
207.512 + ENGINE_TRACE(pfnEndSection, P_POST, (""));
207.513 + RETURN_META(MRES_IGNORED);
207.514 +}
207.515 +int CompareFileTime_Post(char *filename1, char *filename2, int *iCompare) {
207.516 + ENGINE_TRACE(pfnCompareFileTime, P_POST, (""));
207.517 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.518 +}
207.519 +void GetGameDir_Post(char *szGetGameDir) {
207.520 + ENGINE_TRACE(pfnGetGameDir, P_POST, ("gamedir=%s", szGetGameDir));
207.521 + RETURN_META(MRES_IGNORED);
207.522 +}
207.523 +void Cvar_RegisterVariable_Post(cvar_t *variable) {
207.524 + // trace output in Pre
207.525 + ENGINE_TRACE(pfnCvar_RegisterVariable, P_POST, (""));
207.526 + RETURN_META(MRES_IGNORED);
207.527 +}
207.528 +void FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds) {
207.529 + ENGINE_TRACE(pfnFadeClientVolume, P_POST, (""));
207.530 + RETURN_META(MRES_IGNORED);
207.531 +}
207.532 +void SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed) {
207.533 + ENGINE_TRACE(pfnSetClientMaxspeed, P_POST, (""));
207.534 + RETURN_META(MRES_IGNORED);
207.535 +}
207.536 +//! returns NULL if fake client can't be created
207.537 +edict_t * CreateFakeClient_Post(const char *netname) {
207.538 + ENGINE_TRACE(pfnCreateFakeClient, P_POST, (""));
207.539 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.540 +}
207.541 +void RunPlayerMove_Post(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec ) {
207.542 + ENGINE_TRACE(pfnRunPlayerMove, P_POST, (""));
207.543 + RETURN_META(MRES_IGNORED);
207.544 +}
207.545 +int NumberOfEntities_Post(void) {
207.546 + ENGINE_TRACE(pfnNumberOfEntities, P_POST, ("num=%d",
207.547 + META_RESULT_ORIG_RET(int)));
207.548 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.549 +}
207.550 +
207.551 +//! passing in NULL gets the serverinfo
207.552 +char *GetInfoKeyBuffer_Post(edict_t *e) {
207.553 + ENGINE_TRACE(pfnGetInfoKeyBuffer, P_POST, (""));
207.554 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.555 +}
207.556 +char *InfoKeyValue_Post(char *infobuffer, char *key) {
207.557 + ENGINE_TRACE(pfnInfoKeyValue, P_POST, ("value=%s",
207.558 + META_RESULT_ORIG_RET(char *)));
207.559 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.560 +}
207.561 +void SetKeyValue_Post(char *infobuffer, char *key, char *value) {
207.562 + ENGINE_TRACE(pfnSetKeyValue, P_POST, (""));
207.563 + RETURN_META(MRES_IGNORED);
207.564 +}
207.565 +void SetClientKeyValue_Post(int clientIndex, char *infobuffer, char *key, char *value) {
207.566 + ENGINE_TRACE(pfnSetClientKeyValue, P_POST, (""));
207.567 + RETURN_META(MRES_IGNORED);
207.568 +}
207.569 +
207.570 +int IsMapValid_Post(char *filename) {
207.571 + ENGINE_TRACE(pfnIsMapValid, P_POST, ("file=%s, val=%d",
207.572 + filename, META_RESULT_ORIG_RET(int)));
207.573 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.574 +}
207.575 +void StaticDecal_Post( const float *origin, int decalIndex, int entityIndex, int modelIndex ) {
207.576 + ENGINE_TRACE(pfnStaticDecal, P_POST, (""));
207.577 + RETURN_META(MRES_IGNORED);
207.578 +}
207.579 +int PrecacheGeneric_Post(char *s) {
207.580 + ENGINE_TRACE(pfnPrecacheGeneric, P_POST, (""));
207.581 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.582 +}
207.583 +//! returns the server assigned userid for this player. useful for logging frags, etc. returns -1 if the edict couldn't be found in the list of clients
207.584 +int GetPlayerUserId_Post(edict_t *e ) {
207.585 + edict_t *ed = e;
207.586 + int userid=META_RESULT_ORIG_RET(int);
207.587 + ENGINE_TRACE(pfnGetPlayerUserId, P_POST, ("netname=%s userid=%d",
207.588 + ed ? STRING(ed->v.netname) : "nil",
207.589 + userid));
207.590 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.591 +}
207.592 +void BuildSoundMsg_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed)
207.593 +{
207.594 + ENGINE_TRACE(pfnBuildSoundMsg, P_POST, ("sample=%s", sample));
207.595 + RETURN_META(MRES_IGNORED);
207.596 +}
207.597 +//! is this a dedicated server?
207.598 +int IsDedicatedServer_Post(void) {
207.599 + ENGINE_TRACE(pfnIsDedicatedServer, P_POST, ("val=%d",
207.600 + META_RESULT_ORIG_RET(int)));
207.601 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.602 +}
207.603 +cvar_t *CVarGetPointer_Post(const char *szVarName) {
207.604 + // output in Pre
207.605 + ENGINE_TRACE(pfnCVarGetPointer, P_POST, (""));
207.606 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.607 +}
207.608 +//! returns the server assigned WONid for this player. useful for logging frags, etc. returns -1 if the edict couldn't be found in the list of clients
207.609 +unsigned int GetPlayerWONId_Post(edict_t *e) {
207.610 + edict_t *ed = e;
207.611 + unsigned int wonid=META_RESULT_ORIG_RET(unsigned int);
207.612 + ENGINE_TRACE(pfnGetPlayerWONId, P_POST, ("netname=%s wonid=%u",
207.613 + ed ? STRING(ed->v.netname) : "nil",
207.614 + wonid));
207.615 + RETURN_META_VALUE(MRES_IGNORED, 0U);
207.616 +}
207.617 +
207.618 +//! YWB 8/1/99 TFF Physics additions
207.619 +void Info_RemoveKey_Post( char *s, const char *key ) {
207.620 + ENGINE_TRACE(pfnInfo_RemoveKey, P_POST, (""));
207.621 + RETURN_META(MRES_IGNORED);
207.622 +}
207.623 +const char *GetPhysicsKeyValue_Post( const edict_t *pClient, const char *key ) {
207.624 + ENGINE_TRACE(pfnGetPhysicsKeyValue, P_POST, (""));
207.625 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.626 +}
207.627 +void SetPhysicsKeyValue_Post( const edict_t *pClient, const char *key, const char *value ) {
207.628 + ENGINE_TRACE(pfnSetPhysicsKeyValue, P_POST, (""));
207.629 + RETURN_META(MRES_IGNORED);
207.630 +}
207.631 +const char *GetPhysicsInfoString_Post( const edict_t *pClient ) {
207.632 + ENGINE_TRACE(pfnGetPhysicsInfoString, P_POST, (""));
207.633 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.634 +}
207.635 +unsigned short PrecacheEvent_Post( int type, const char *psz ) {
207.636 + ENGINE_TRACE(pfnPrecacheEvent, P_POST, (""));
207.637 + RETURN_META_VALUE(MRES_IGNORED, 0U);
207.638 +}
207.639 +void PlaybackEvent_Post( int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 )
207.640 +{
207.641 + ENGINE_TRACE(pfnPlaybackEvent, P_POST, (""));
207.642 + RETURN_META(MRES_IGNORED);
207.643 +}
207.644 +
207.645 +unsigned char *SetFatPVS_Post( float *org ) {
207.646 + ENGINE_TRACE(pfnSetFatPVS, P_POST, (""));
207.647 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.648 +}
207.649 +unsigned char *SetFatPAS_Post( float *org ) {
207.650 + ENGINE_TRACE(pfnSetFatPAS, P_POST, (""));
207.651 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.652 +}
207.653 +
207.654 +int CheckVisibility_Post( const edict_t *entity, unsigned char *pset ) {
207.655 + ENGINE_TRACE(pfnCheckVisibility, P_POST, (""));
207.656 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.657 +}
207.658 +
207.659 +void DeltaSetField_Post( struct delta_s *pFields, const char *fieldname ) {
207.660 + ENGINE_TRACE(pfnDeltaSetField, P_POST, (""));
207.661 + RETURN_META(MRES_IGNORED);
207.662 +}
207.663 +void DeltaUnsetField_Post( struct delta_s *pFields, const char *fieldname ) {
207.664 + ENGINE_TRACE(pfnDeltaUnsetField, P_POST, (""));
207.665 + RETURN_META(MRES_IGNORED);
207.666 +}
207.667 +void DeltaAddEncoder_Post( char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ) {
207.668 + ENGINE_TRACE(pfnDeltaAddEncoder, P_POST, (""));
207.669 + RETURN_META(MRES_IGNORED);
207.670 +}
207.671 +int GetCurrentPlayer_Post( void ) {
207.672 + ENGINE_TRACE(pfnGetCurrentPlayer, P_POST, ("val=%d",
207.673 + META_RESULT_ORIG_RET(int)));
207.674 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.675 +}
207.676 +int CanSkipPlayer_Post( const edict_t *player ) {
207.677 + ENGINE_TRACE(pfnCanSkipPlayer, P_POST, (""));
207.678 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.679 +}
207.680 +int DeltaFindField_Post( struct delta_s *pFields, const char *fieldname ) {
207.681 + ENGINE_TRACE(pfnDeltaFindField, P_POST, (""));
207.682 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.683 +}
207.684 +void DeltaSetFieldByIndex_Post( struct delta_s *pFields, int fieldNumber ) {
207.685 + ENGINE_TRACE(pfnDeltaSetFieldByIndex, P_POST, (""));
207.686 + RETURN_META(MRES_IGNORED);
207.687 +}
207.688 +void DeltaUnsetFieldByIndex_Post( struct delta_s *pFields, int fieldNumber ) {
207.689 + ENGINE_TRACE(pfnDeltaUnsetFieldByIndex, P_POST, (""));
207.690 + RETURN_META(MRES_IGNORED);
207.691 +}
207.692 +
207.693 +void SetGroupMask_Post( int mask, int op ) {
207.694 + ENGINE_TRACE(pfnSetGroupMask, P_POST, (""));
207.695 + RETURN_META(MRES_IGNORED);
207.696 +}
207.697 +
207.698 +int engCreateInstancedBaseline_Post( int classname, struct entity_state_s *baseline ) {
207.699 + ENGINE_TRACE(pfnCreateInstancedBaseline, P_POST, (""));
207.700 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.701 +}
207.702 +void Cvar_DirectSet_Post( struct cvar_s *var, char *value ) {
207.703 + ENGINE_TRACE(pfnCvar_DirectSet, P_POST, (""));
207.704 + RETURN_META(MRES_IGNORED);
207.705 +}
207.706 +
207.707 +//! Forces the client and server to be running with the same version of the specified file
207.708 +//!( e.g., a player model ).
207.709 +//! Calling this has no effect in single player
207.710 +void ForceUnmodified_Post( FORCE_TYPE type, float *mins, float *maxs, const char *filename ) {
207.711 + // trace output in Pre
207.712 + ENGINE_TRACE(pfnForceUnmodified, P_POST, (""));
207.713 + RETURN_META(MRES_IGNORED);
207.714 +}
207.715 +
207.716 +void GetPlayerStats_Post( const edict_t *pClient, int *ping, int *packet_loss ) {
207.717 + const edict_t *ed=pClient;
207.718 + ENGINE_TRACE(pfnGetPlayerStats, P_POST,
207.719 + ("netname=%s ping=%d packet_loss=%d",
207.720 + ed ? STRING(ed->v.netname) : "nil",
207.721 + *ping,
207.722 + *packet_loss));
207.723 + RETURN_META(MRES_IGNORED);
207.724 +}
207.725 +
207.726 +void AddServerCommand_Post( char *cmd_name, void (*function) (void) ) {
207.727 + // trace output in Pre
207.728 + ENGINE_TRACE(pfnAddServerCommand, P_POST, (""));
207.729 + RETURN_META(MRES_IGNORED);
207.730 +}
207.731 +
207.732 +// Added in SDK 2.2:
207.733 +
207.734 +//! For voice communications, set which clients hear eachother.
207.735 +//! NOTE: these functions take player entity indices (starting at 1).
207.736 +qboolean Voice_GetClientListening_Post(int iReceiver, int iSender) {
207.737 + ENGINE_TRACE(pfnVoice_GetClientListening, P_POST, (""));
207.738 + RETURN_META_VALUE(MRES_IGNORED, false);
207.739 +}
207.740 +qboolean Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen) {
207.741 + ENGINE_TRACE(pfnVoice_SetClientListening, P_POST, (""));
207.742 + RETURN_META_VALUE(MRES_IGNORED, false);
207.743 +}
207.744 +
207.745 +// Added for HL 1109 (no SDK update):
207.746 +
207.747 +const char *GetPlayerAuthId_Post(edict_t *e) {
207.748 + edict_t *ed = e;
207.749 + const char *authid=META_RESULT_ORIG_RET(const char *);
207.750 + ENGINE_TRACE(pfnGetPlayerAuthId, P_POST, ("netname=%s authid=%s",
207.751 + ed ? STRING(ed->v.netname) : "nil",
207.752 + authid ? authid : "nil"));
207.753 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.754 +}
207.755 +
207.756 +// Added 2003/11/10 (no SDK update):
207.757 +
207.758 +void *SequenceGet_Post(const char* fileName, const char* entryName) {
207.759 + // trace output in Post
207.760 + ENGINE_TRACE(pfnSequenceGet, P_PRE, (""));
207.761 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.762 +}
207.763 +
207.764 +void *SequencePickSentence_Post(const char* groupName, int pickMethod, int *picked) {
207.765 + // trace output in Post
207.766 + ENGINE_TRACE(pfnSequencePickSentence, P_PRE, (""));
207.767 + RETURN_META_VALUE(MRES_IGNORED, NULL);
207.768 +}
207.769 +
207.770 +int GetFileSize_Post(char *filename) {
207.771 + // trace output in Post
207.772 + ENGINE_TRACE(pfnGetFileSize, P_PRE, (""));
207.773 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.774 +}
207.775 +
207.776 +unsigned int GetApproxWavePlayLen_Post(const char *filepath) {
207.777 + // trace output in Post
207.778 + ENGINE_TRACE(pfnGetApproxWavePlayLen, P_PRE, (""));
207.779 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.780 +}
207.781 +
207.782 +int IsCareerMatch_Post(void) {
207.783 + // trace output in Post
207.784 + ENGINE_TRACE(pfnIsCareerMatch, P_PRE, (""));
207.785 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.786 +}
207.787 +
207.788 +int GetLocalizedStringLength_Post(const char *label) {
207.789 + // trace output in Post
207.790 + ENGINE_TRACE(pfnGetLocalizedStringLength, P_PRE, (""));
207.791 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.792 +}
207.793 +
207.794 +void RegisterTutorMessageShown_Post(int mid) {
207.795 + // trace output in Post
207.796 + ENGINE_TRACE(pfnRegisterTutorMessageShown, P_PRE, (""));
207.797 + RETURN_META(MRES_IGNORED);
207.798 +}
207.799 +
207.800 +int GetTimesTutorMessageShown_Post(int mid) {
207.801 + // trace output in Post
207.802 + ENGINE_TRACE(pfnGetTimesTutorMessageShown, P_PRE, (""));
207.803 + RETURN_META_VALUE(MRES_IGNORED, 0);
207.804 +}
207.805 +
207.806 +void ProcessTutorMessageDecayBuffer_Post(int *buffer, int bufferLength) {
207.807 + // trace output in Post
207.808 + ENGINE_TRACE(pfnProcessTutorMessageDecayBuffer, P_PRE, (""));
207.809 + RETURN_META(MRES_IGNORED);
207.810 +}
207.811 +
207.812 +void ConstructTutorMessageDecayBuffer_Post(int *buffer, int bufferLength) {
207.813 + // trace output in Post
207.814 + ENGINE_TRACE(pfnConstructTutorMessageDecayBuffer, P_PRE, (""));
207.815 + RETURN_META(MRES_IGNORED);
207.816 +}
207.817 +
207.818 +void ResetTutorMessageDecayData_Post(void) {
207.819 + // trace output in Post
207.820 + ENGINE_TRACE(pfnResetTutorMessageDecayData, P_PRE, (""));
207.821 + RETURN_META(MRES_IGNORED);
207.822 +}
207.823 +
207.824 +enginefuncs_t meta_engfuncs_post = {
207.825 + PrecacheModel_Post, // pfnPrecacheModel()
207.826 + PrecacheSound_Post, // pfnPrecacheSound()
207.827 + SetModel_Post, // pfnSetModel()
207.828 + ModelIndex_Post, // pfnModelIndex()
207.829 + ModelFrames_Post, // pfnModelFrames()
207.830 +
207.831 + SetSize_Post, // pfnSetSize()
207.832 + ChangeLevel_Post, // pfnChangeLevel()
207.833 + GetSpawnParms_Post, // pfnGetSpawnParms()
207.834 + SaveSpawnParms_Post, // pfnSaveSpawnParms()
207.835 +
207.836 + VecToYaw_Post, // pfnVecToYaw()
207.837 + VecToAngles_Post, // pfnVecToAngles()
207.838 + MoveToOrigin_Post, // pfnMoveToOrigin()
207.839 + ChangeYaw_Post, // pfnChangeYaw()
207.840 + ChangePitch_Post, // pfnChangePitch()
207.841 +
207.842 + FindEntityByString_Post, // pfnFindEntityByString()
207.843 + GetEntityIllum_Post, // pfnGetEntityIllum()
207.844 + FindEntityInSphere_Post, // pfnFindEntityInSphere()
207.845 + FindClientInPVS_Post, // pfnFindClientInPVS()
207.846 + EntitiesInPVS_Post, // pfnEntitiesInPVS()
207.847 +
207.848 + MakeVectors_Post, // pfnMakeVectors()
207.849 + AngleVectors_Post, // pfnAngleVectors()
207.850 +
207.851 + CreateEntity_Post, // pfnCreateEntity()
207.852 + RemoveEntity_Post, // pfnRemoveEntity()
207.853 + CreateNamedEntity_Post, // pfnCreateNamedEntity()
207.854 +
207.855 + MakeStatic_Post, // pfnMakeStatic()
207.856 + EntIsOnFloor_Post, // pfnEntIsOnFloor()
207.857 + DropToFloor_Post, // pfnDropToFloor()
207.858 +
207.859 + WalkMove_Post, // pfnWalkMove()
207.860 + SetOrigin_Post, // pfnSetOrigin()
207.861 +
207.862 + EmitSound_Post, // pfnEmitSound()
207.863 + EmitAmbientSound_Post, // pfnEmitAmbientSound()
207.864 +
207.865 + TraceLine_Post, // pfnTraceLine()
207.866 + TraceToss_Post, // pfnTraceToss()
207.867 + TraceMonsterHull_Post, // pfnTraceMonsterHull()
207.868 + TraceHull_Post, // pfnTraceHull()
207.869 + TraceModel_Post, // pfnTraceModel()
207.870 + TraceTexture_Post, // pfnTraceTexture()
207.871 + TraceSphere_Post, // pfnTraceSphere()
207.872 + GetAimVector_Post, // pfnGetAimVector()
207.873 +
207.874 + ServerCommand_Post, // pfnServerCommand()
207.875 + ServerExecute_Post, // pfnServerExecute()
207.876 + engClientCommand_Post, // pfnClientCommand() // d'oh, ClientCommand in dllapi too
207.877 +
207.878 + ParticleEffect_Post, // pfnParticleEffect()
207.879 + LightStyle_Post, // pfnLightStyle()
207.880 + DecalIndex_Post, // pfnDecalIndex()
207.881 + PointContents_Post, // pfnPointContents()
207.882 +
207.883 + MessageBegin_Post, // pfnMessageBegin()
207.884 + MessageEnd_Post, // pfnMessageEnd()
207.885 +
207.886 + WriteByte_Post, // pfnWriteByte()
207.887 + WriteChar_Post, // pfnWriteChar()
207.888 + WriteShort_Post, // pfnWriteShort()
207.889 + WriteLong_Post, // pfnWriteLong()
207.890 + WriteAngle_Post, // pfnWriteAngle()
207.891 + WriteCoord_Post, // pfnWriteCoord()
207.892 + WriteString_Post, // pfnWriteString()
207.893 + WriteEntity_Post, // pfnWriteEntity()
207.894 +
207.895 + CVarRegister_Post, // pfnCVarRegister()
207.896 + CVarGetFloat_Post, // pfnCVarGetFloat()
207.897 + CVarGetString_Post, // pfnCVarGetString()
207.898 + CVarSetFloat_Post, // pfnCVarSetFloat()
207.899 + CVarSetString_Post, // pfnCVarSetString()
207.900 +
207.901 + AlertMessage_Post, // pfnAlertMessage()
207.902 + EngineFprintf_Post, // pfnEngineFprintf()
207.903 +
207.904 + PvAllocEntPrivateData_Post, // pfnPvAllocEntPrivateData()
207.905 + PvEntPrivateData_Post, // pfnPvEntPrivateData()
207.906 + FreeEntPrivateData_Post, // pfnFreeEntPrivateData()
207.907 +
207.908 + SzFromIndex_Post, // pfnSzFromIndex()
207.909 + AllocString_Post, // pfnAllocString()
207.910 +
207.911 + GetVarsOfEnt_Post, // pfnGetVarsOfEnt()
207.912 + PEntityOfEntOffset_Post, // pfnPEntityOfEntOffset()
207.913 + EntOffsetOfPEntity_Post, // pfnEntOffsetOfPEntity()
207.914 + IndexOfEdict_Post, // pfnIndexOfEdict()
207.915 + PEntityOfEntIndex_Post, // pfnPEntityOfEntIndex()
207.916 + FindEntityByVars_Post, // pfnFindEntityByVars()
207.917 + GetModelPtr_Post, // pfnGetModelPtr()
207.918 +
207.919 + RegUserMsg_Post, // pfnRegUserMsg()
207.920 +
207.921 + AnimationAutomove_Post, // pfnAnimationAutomove()
207.922 + GetBonePosition_Post, // pfnGetBonePosition()
207.923 +
207.924 + FunctionFromName_Post, // pfnFunctionFromName()
207.925 + NameForFunction_Post, // pfnNameForFunction()
207.926 +
207.927 + ClientPrintf_Post, // pfnClientPrintf() //! JOHN: engine callbacks so game DLL can print messages to individual clients
207.928 + ServerPrint_Post, // pfnServerPrint()
207.929 +
207.930 + Cmd_Args_Post, // pfnCmd_Args() //! these 3 added
207.931 + Cmd_Argv_Post, // pfnCmd_Argv() //! so game DLL can easily
207.932 + Cmd_Argc_Post, // pfnCmd_Argc() //! access client 'cmd' strings
207.933 +
207.934 + GetAttachment_Post, // pfnGetAttachment()
207.935 +
207.936 + CRC32_Init_Post, // pfnCRC32_Init()
207.937 + CRC32_ProcessBuffer_Post, // pfnCRC32_ProcessBuffer()
207.938 + CRC32_ProcessByte_Post, // pfnCRC32_ProcessByte()
207.939 + CRC32_Final_Post, // pfnCRC32_Final()
207.940 +
207.941 + RandomLong_Post, // pfnRandomLong()
207.942 + RandomFloat_Post, // pfnRandomFloat()
207.943 +
207.944 + SetView_Post, // pfnSetView()
207.945 + Time_Post, // pfnTime()
207.946 + CrosshairAngle_Post, // pfnCrosshairAngle()
207.947 +
207.948 + LoadFileForMe_Post, // pfnLoadFileForMe()
207.949 + FreeFile_Post, // pfnFreeFile()
207.950 +
207.951 + EndSection_Post, // pfnEndSection() //! trigger_endsection
207.952 + CompareFileTime_Post, // pfnCompareFileTime()
207.953 + GetGameDir_Post, // pfnGetGameDir()
207.954 + Cvar_RegisterVariable_Post, // pfnCvar_RegisterVariable()
207.955 + FadeClientVolume_Post, // pfnFadeClientVolume()
207.956 + SetClientMaxspeed_Post, // pfnSetClientMaxspeed()
207.957 + CreateFakeClient_Post, // pfnCreateFakeClient() //! returns NULL if fake client can't be created
207.958 + RunPlayerMove_Post, // pfnRunPlayerMove()
207.959 + NumberOfEntities_Post, // pfnNumberOfEntities()
207.960 +
207.961 + GetInfoKeyBuffer_Post, // pfnGetInfoKeyBuffer() //! passing in NULL gets the serverinfo
207.962 + InfoKeyValue_Post, // pfnInfoKeyValue()
207.963 + SetKeyValue_Post, // pfnSetKeyValue()
207.964 + SetClientKeyValue_Post, // pfnSetClientKeyValue()
207.965 +
207.966 + IsMapValid_Post, // pfnIsMapValid()
207.967 + StaticDecal_Post, // pfnStaticDecal()
207.968 + PrecacheGeneric_Post, // pfnPrecacheGeneric()
207.969 + GetPlayerUserId_Post, // pfnGetPlayerUserId() //! returns the server assigned userid for this player.
207.970 + BuildSoundMsg_Post, // pfnBuildSoundMsg()
207.971 + IsDedicatedServer_Post, // pfnIsDedicatedServer() //! is this a dedicated server?
207.972 + CVarGetPointer_Post, // pfnCVarGetPointer()
207.973 + GetPlayerWONId_Post, // pfnGetPlayerWONId() //! returns the server assigned WONid for this player.
207.974 +
207.975 + //! YWB 8/1/99 TFF Physics additions
207.976 + Info_RemoveKey_Post, // pfnInfo_RemoveKey()
207.977 + GetPhysicsKeyValue_Post, // pfnGetPhysicsKeyValue()
207.978 + SetPhysicsKeyValue_Post, // pfnSetPhysicsKeyValue()
207.979 + GetPhysicsInfoString_Post, // pfnGetPhysicsInfoString()
207.980 + PrecacheEvent_Post, // pfnPrecacheEvent()
207.981 + PlaybackEvent_Post, // pfnPlaybackEvent()
207.982 +
207.983 + SetFatPVS_Post, // pfnSetFatPVS()
207.984 + SetFatPAS_Post, // pfnSetFatPAS()
207.985 +
207.986 + CheckVisibility_Post, // pfnCheckVisibility()
207.987 +
207.988 + DeltaSetField_Post, // pfnDeltaSetField()
207.989 + DeltaUnsetField_Post, // pfnDeltaUnsetField()
207.990 + DeltaAddEncoder_Post, // pfnDeltaAddEncoder()
207.991 + GetCurrentPlayer_Post, // pfnGetCurrentPlayer()
207.992 + CanSkipPlayer_Post, // pfnCanSkipPlayer()
207.993 + DeltaFindField_Post, // pfnDeltaFindField()
207.994 + DeltaSetFieldByIndex_Post, // pfnDeltaSetFieldByIndex()
207.995 + DeltaUnsetFieldByIndex_Post,// pfnDeltaUnsetFieldByIndex()
207.996 +
207.997 + SetGroupMask_Post, // pfnSetGroupMask()
207.998 +
207.999 + engCreateInstancedBaseline_Post, // pfnCreateInstancedBaseline() // d'oh, CreateInstancedBaseline in dllapi too
207.1000 + Cvar_DirectSet_Post, // pfnCvar_DirectSet()
207.1001 +
207.1002 + ForceUnmodified_Post, // pfnForceUnmodified()
207.1003 +
207.1004 + GetPlayerStats_Post, // pfnGetPlayerStats()
207.1005 +
207.1006 + AddServerCommand_Post, // pfnAddServerCommand()
207.1007 +
207.1008 + // Added in SDK 2.2:
207.1009 + Voice_GetClientListening_Post, // pfnVoice_GetClientListening()
207.1010 + Voice_SetClientListening_Post, // pfnVoice_SetClientListening()
207.1011 +
207.1012 + // Added for HL 1109 (no SDK update):
207.1013 + GetPlayerAuthId_Post, // pfnGetPlayerAuthId()
207.1014 +
207.1015 + // Added 2003/11/10 (no SDK update):
207.1016 + SequenceGet_Post, // pfnSequenceGet()
207.1017 + SequencePickSentence_Post, // pfnSequencePickSentence()
207.1018 + GetFileSize_Post, // pfnGetFileSize()
207.1019 + GetApproxWavePlayLen_Post, // pfnGetApproxWavePlayLen()
207.1020 + IsCareerMatch_Post, // pfnIsCareerMatch()
207.1021 + GetLocalizedStringLength_Post, // pfnGetLocalizedStringLength()
207.1022 + RegisterTutorMessageShown_Post, // pfnRegisterTutorMessageShown()
207.1023 + GetTimesTutorMessageShown_Post, // pfnGetTimesTutorMessageShown()
207.1024 + ProcessTutorMessageDecayBuffer_Post, // pfnProcessTutorMessageDecayBuffer()
207.1025 + ConstructTutorMessageDecayBuffer_Post, // pfnConstructTutorMessageDecayBuffer()
207.1026 + ResetTutorMessageDecayData_Post, // pfnResetTutorMessageDecayData()
207.1027 +};
207.1028 +
207.1029 +C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion )
207.1030 +{
207.1031 + LOG_DEVELOPER(PLID, "called: GetEngineFunctions_Post; version=%d", *interfaceVersion);
207.1032 + if(!pengfuncsFromEngine) {
207.1033 + LOG_ERROR(PLID, "GetEngineFunctions_Post called with null pengfuncsFromEngine");
207.1034 + return(FALSE);
207.1035 + }
207.1036 + else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) {
207.1037 + LOG_ERROR(PLID, "GetEngineFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION);
207.1038 + // Tell metamod what version we had, so it can figure out who is out of date.
207.1039 + *interfaceVersion = ENGINE_INTERFACE_VERSION;
207.1040 + return(FALSE);
207.1041 + }
207.1042 + memcpy(pengfuncsFromEngine, &meta_engfuncs_post, sizeof(enginefuncs_t));
207.1043 + return TRUE;
207.1044 +}
208.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
208.2 +++ b/trace_plugin/engine_api_post.h Tue Apr 06 07:36:14 2004 +0000
208.3 @@ -0,0 +1,249 @@
208.4 +// vi: set ts=4 sw=4 :
208.5 +// vim: set tw=75 :
208.6 +
208.7 +// engine_post.h - prototypes and typedefs for "post" versions of HL engine
208.8 +// functions
208.9 +
208.10 +/*
208.11 + * Copyright (c) 2001-2003 Will Day <[email protected]>
208.12 + *
208.13 + * This file is part of Metamod.
208.14 + *
208.15 + * Metamod is free software; you can redistribute it and/or modify it
208.16 + * under the terms of the GNU General Public License as published by the
208.17 + * Free Software Foundation; either version 2 of the License, or (at
208.18 + * your option) any later version.
208.19 + *
208.20 + * Metamod is distributed in the hope that it will be useful, but
208.21 + * WITHOUT ANY WARRANTY; without even the implied warranty of
208.22 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
208.23 + * General Public License for more details.
208.24 + *
208.25 + * You should have received a copy of the GNU General Public License
208.26 + * along with Metamod; if not, write to the Free Software Foundation,
208.27 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
208.28 + *
208.29 + * In addition, as a special exception, the author gives permission to
208.30 + * link the code of this program with the Half-Life Game Engine ("HL
208.31 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
208.32 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
208.33 + * respects for all of the code used other than the HL Engine and MODs
208.34 + * from Valve. If you modify this file, you may extend this exception
208.35 + * to your version of the file, but you are not obligated to do so. If
208.36 + * you do not wish to do so, delete this exception statement from your
208.37 + * version.
208.38 + *
208.39 + */
208.40 +
208.41 +#ifndef ENGINE_API_POST_H
208.42 +#define ENGINE_API_POST_H
208.43 +
208.44 +extern enginefuncs_t meta_engfuncs_post;
208.45 +
208.46 +// from SDK engine/eiface.h:
208.47 +extern int PrecacheModel_Post(char *s);
208.48 +extern int PrecacheSound_Post(char *s);
208.49 +extern void SetModel_Post(edict_t *e, const char *m);
208.50 +extern int ModelIndex_Post(const char *m);
208.51 +extern int ModelFrames_Post(int modelIndex);
208.52 +
208.53 +extern void SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax);
208.54 +extern void ChangeLevel_Post(char *s1, char *s2);
208.55 +extern void GetSpawnParms_Post(edict_t *ent);
208.56 +extern void SaveSpawnParms_Post(edict_t *ent);
208.57 +
208.58 +extern float VecToYaw_Post(const float *rgflVector);
208.59 +extern void VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut);
208.60 +extern void MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType);
208.61 +extern void ChangeYaw_Post(edict_t *ent);
208.62 +extern void ChangePitch_Post(edict_t *ent);
208.63 +
208.64 +extern edict_t *FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue);
208.65 +extern int GetEntityIllum_Post(edict_t *pEnt);
208.66 +extern edict_t *FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad);
208.67 +extern edict_t *FindClientInPVS_Post(edict_t *pEdict);
208.68 +extern edict_t *EntitiesInPVS_Post(edict_t *pplayer);
208.69 +
208.70 +extern void MakeVectors_Post(const float *rgflVector);
208.71 +extern void AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up);
208.72 +
208.73 +extern edict_t *CreateEntity_Post(void);
208.74 +extern void RemoveEntity_Post(edict_t *e);
208.75 +extern edict_t *CreateNamedEntity_Post(int className);
208.76 +
208.77 +extern void MakeStatic_Post(edict_t *ent);
208.78 +extern int EntIsOnFloor_Post(edict_t *e);
208.79 +extern int DropToFloor_Post(edict_t *e);
208.80 +
208.81 +extern int WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode);
208.82 +extern void SetOrigin_Post(edict_t *e, const float *rgflOrigin);
208.83 +
208.84 +extern void EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch);
208.85 +extern void EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch);
208.86 +
208.87 +extern void TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr);
208.88 +extern void TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr);
208.89 +extern int TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr);
208.90 +extern void TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr);
208.91 +extern void TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr);
208.92 +extern const char *TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 );
208.93 +extern void TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr);
208.94 +extern void GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn);
208.95 +
208.96 +extern void ServerCommand_Post(char *str);
208.97 +extern void ServerExecute_Post(void);
208.98 +extern void ClientCommand_Post(edict_t *pEdict, char *szFmt, ...);
208.99 +
208.100 +extern void ParticleEffect_Post(const float *org, const float *dir, float color, float count);
208.101 +extern void LightStyle_Post(int style, char *val);
208.102 +extern int DecalIndex_Post(const char *name);
208.103 +extern int PointContents_Post(const float *rgflVector);
208.104 +
208.105 +extern void MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed);
208.106 +extern void MessageEnd_Post(void);
208.107 +
208.108 +extern void WriteByte_Post(int iValue);
208.109 +extern void WriteChar_Post(int iValue);
208.110 +extern void WriteShort_Post(int iValue);
208.111 +extern void WriteLong_Post(int iValue);
208.112 +extern void WriteAngle_Post(float flValue);
208.113 +extern void WriteCoord_Post(float flValue);
208.114 +extern void WriteString_Post(const char *sz);
208.115 +extern void WriteEntity_Post(int iValue);
208.116 +
208.117 +extern void CVarRegister_Post(cvar_t *pCvar);
208.118 +extern float CVarGetFloat_Post(const char *szVarName);
208.119 +extern const char* CVarGetString_Post(const char *szVarName);
208.120 +extern void CVarSetFloat_Post(const char *szVarName, float flValue);
208.121 +extern void CVarSetString_Post(const char *szVarName, const char *szValue);
208.122 +
208.123 +extern void AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...);
208.124 +extern void EngineFprintf_Post(FILE *pfile, char *szFmt, ...);
208.125 +
208.126 +extern void *PvAllocEntPrivateData_Post(edict_t *pEdict, long cb);
208.127 +extern void *PvEntPrivateData_Post(edict_t *pEdict);
208.128 +extern void FreeEntPrivateData_Post(edict_t *pEdict);
208.129 +
208.130 +extern const char *SzFromIndex_Post(int iString);
208.131 +extern int AllocString_Post(const char *szValue);
208.132 +
208.133 +extern struct entvars_s *GetVarsOfEnt_Post(edict_t *pEdict);
208.134 +extern edict_t *PEntityOfEntOffset_Post(int iEntOffset);
208.135 +extern int EntOffsetOfPEntity_Post(const edict_t *pEdict);
208.136 +extern int IndexOfEdict_Post(const edict_t *pEdict);
208.137 +extern edict_t *PEntityOfEntIndex_Post(int iEntIndex);
208.138 +extern edict_t *FindEntityByVars_Post(struct entvars_s *pvars);
208.139 +extern void *GetModelPtr_Post(edict_t *pEdict);
208.140 +
208.141 +extern int RegUserMsg_Post(const char *pszName, int iSize);
208.142 +
208.143 +extern void AnimationAutomove_Post(const edict_t *pEdict, float flTime);
208.144 +extern void GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles );
208.145 +
208.146 +extern unsigned long FunctionFromName_Post( const char *pName );
208.147 +extern const char *NameForFunction_Post( unsigned long function );
208.148 +
208.149 +extern void ClientPrintf_Post( edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg ); //! JOHN: engine callbacks so game DLL can print messages to individual clients
208.150 +extern void ServerPrint_Post( const char *szMsg );
208.151 +
208.152 +extern const char *Cmd_Args_Post( void ); //! these 3 added
208.153 +extern const char *Cmd_Argv_Post( int argc ); //! so game DLL can easily
208.154 +extern int Cmd_Argc_Post( void ); //! access client 'cmd' strings
208.155 +
208.156 +extern void GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles );
208.157 +
208.158 +extern void CRC32_Init_Post(CRC32_t *pulCRC);
208.159 +extern void CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len);
208.160 +extern void CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch);
208.161 +extern CRC32_t CRC32_Final_Post(CRC32_t pulCRC);
208.162 +
208.163 +extern long RandomLong_Post(long lLow, long lHigh);
208.164 +extern float RandomFloat_Post(float flLow, float flHigh);
208.165 +
208.166 +extern void SetView_Post(const edict_t *pClient, const edict_t *pViewent );
208.167 +extern float Time_Post( void );
208.168 +extern void CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw);
208.169 +
208.170 +extern byte * LoadFileForMe_Post(char *filename, int *pLength);
208.171 +extern void FreeFile_Post(void *buffer);
208.172 +
208.173 +extern void EndSection_Post(const char *pszSectionName); //! trigger_endsection
208.174 +extern int CompareFileTime_Post(char *filename1, char *filename2, int *iCompare);
208.175 +extern void GetGameDir_Post(char *szGetGameDir);
208.176 +extern void Cvar_RegisterVariable_Post(cvar_t *variable);
208.177 +extern void FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds);
208.178 +extern void SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed);
208.179 +extern edict_t * CreateFakeClient_Post(const char *netname); //! returns NULL if fake client can't be created
208.180 +extern void RunPlayerMove_Post(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec );
208.181 +extern int NumberOfEntities_Post(void);
208.182 +
208.183 +extern char *GetInfoKeyBuffer_Post(edict_t *e); //! passing in NULL gets the serverinfo
208.184 +extern char *InfoKeyValue_Post(char *infobuffer, char *key);
208.185 +extern void SetKeyValue_Post(char *infobuffer, char *key, char *value);
208.186 +extern void SetClientKeyValue_Post(int clientIndex, char *infobuffer, char *key, char *value);
208.187 +
208.188 +extern int IsMapValid_Post(char *filename);
208.189 +extern void StaticDecal_Post( const float *origin, int decalIndex, int entityIndex, int modelIndex );
208.190 +extern int PrecacheGeneric_Post(char *s);
208.191 +extern int GetPlayerUserId_Post(edict_t *e ); //! returns the server assigned userid for this player. useful for logging frags, etc. returns -1 if the edict couldn't be found in the list of clients
208.192 +extern void BuildSoundMsg_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed);
208.193 +extern int IsDedicatedServer_Post(void);//! is this a dedicated server?
208.194 +extern cvar_t *CVarGetPointer_Post(const char *szVarName);
208.195 +extern unsigned int GetPlayerWONId_Post(edict_t *e); //! returns the server assigned WONid for this player. useful for logging frags, etc. returns -1 if the edict couldn't be found in the list of clients
208.196 +
208.197 +//! YWB 8/1/99 TFF Physics additions
208.198 +extern void Info_RemoveKey_Post( char *s, const char *key );
208.199 +extern const char *GetPhysicsKeyValue_Post( const edict_t *pClient, const char *key );
208.200 +extern void SetPhysicsKeyValue_Post( const edict_t *pClient, const char *key, const char *value );
208.201 +extern const char *GetPhysicsInfoString_Post( const edict_t *pClient );
208.202 +extern unsigned short PrecacheEvent_Post( int type, const char *psz );
208.203 +extern void PlaybackEvent_Post( int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 );
208.204 +
208.205 +extern unsigned char *SetFatPVS_Post( float *org );
208.206 +extern unsigned char *SetFatPAS_Post( float *org );
208.207 +
208.208 +extern int CheckVisibility_Post( const edict_t *entity, unsigned char *pset );
208.209 +
208.210 +extern void DeltaSetField_Post( struct delta_s *pFields, const char *fieldname );
208.211 +extern void DeltaUnsetField_Post( struct delta_s *pFields, const char *fieldname );
208.212 +extern void DeltaAddEncoder_Post( char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) );
208.213 +extern int GetCurrentPlayer_Post( void );
208.214 +extern int CanSkipPlayer_Post( const edict_t *player );
208.215 +extern int DeltaFindField_Post( struct delta_s *pFields, const char *fieldname );
208.216 +extern void DeltaSetFieldByIndex_Post( struct delta_s *pFields, int fieldNumber );
208.217 +extern void DeltaUnsetFieldByIndex_Post( struct delta_s *pFields, int fieldNumber );
208.218 +
208.219 +extern void SetGroupMask_Post( int mask, int op );
208.220 +
208.221 +extern int CreateInstancedBaseline_Post( int classname, struct entity_state_s *baseline );
208.222 +extern void Cvar_DirectSet_Post( struct cvar_s *var, char *value );
208.223 +
208.224 +//! Forces the client and server to be running with the same version of the specified file
208.225 +//!_Post( e.g., a player model ).
208.226 +//! Calling this has no effect in single player
208.227 +extern void ForceUnmodified_Post( FORCE_TYPE type, float *mins, float *maxs, const char *filename );
208.228 +
208.229 +extern void GetPlayerStats_Post( const edict_t *pClient, int *ping, int *packet_loss );
208.230 +
208.231 +extern void AddServerCommand_Post( char *cmd_name, void (*function) (void) );
208.232 +// Added in SDK 2.2:
208.233 +extern qboolean Voice_GetClientListening_Post(int iReceiver, int iSender);
208.234 +extern qboolean Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen);
208.235 +
208.236 +// Added for HL 1109 (no SDK update):
208.237 +extern const char *GetPlayerAuthId(edict_t *e);
208.238 +
208.239 +// Added 2003/11/10 (no SDK update):
208.240 +extern void *SequenceGet(const char* fileName, const char* entryName);
208.241 +extern void *SequencePickSentence(const char* groupName, int pickMethod, int *picked);
208.242 +extern int GetFileSize(char *filename);
208.243 +extern unsigned int GetApproxWavePlayLen(const char *filepath);
208.244 +extern int IsCareerMatch(void);
208.245 +extern int GetLocalizedStringLength(const char *label);
208.246 +extern void RegisterTutorMessageShown(int mid);
208.247 +extern int GetTimesTutorMessageShown(int mid);
208.248 +extern void ProcessTutorMessageDecayBuffer(int *buffer, int bufferLength);
208.249 +extern void ConstructTutorMessageDecayBuffer(int *buffer, int bufferLength);
208.250 +extern void ResetTutorMessageDecayData(void);
208.251 +
208.252 +#endif /* ENGINE_API_POST_H */
209.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
209.2 +++ b/trace_plugin/h_export.cpp Tue Apr 06 07:36:14 2004 +0000
209.3 @@ -0,0 +1,49 @@
209.4 +// vi: set ts=4 sw=4 :
209.5 +// vim: set tw=75 :
209.6 +
209.7 +// h_export.cpp - main exported DLL functionality
209.8 +
209.9 +// From SDK dlls/h_export.cpp:
209.10 +
209.11 +/***
209.12 +*
209.13 +* Copyright (c) 1999, 2000 Valve LLC. All rights reserved.
209.14 +*
209.15 +* This product contains software technology licensed from Id
209.16 +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
209.17 +* All Rights Reserved.
209.18 +*
209.19 +* Use, distribution, and modification of this source code and/or resulting
209.20 +* object code is restricted to non-commercial enhancements to products from
209.21 +* Valve LLC. All other use, distribution, or modification is prohibited
209.22 +* without written permission from Valve LLC.
209.23 +*
209.24 +****/
209.25 +/*
209.26 +
209.27 +===== h_export.cpp ========================================================
209.28 +
209.29 + Entity classes exported by Halflife.
209.30 +
209.31 +*/
209.32 +
209.33 +#include <extdll.h>
209.34 +
209.35 +#include <h_export.h>
209.36 +#include <meta_api.h>
209.37 +
209.38 +//! Holds engine functionality callbacks
209.39 +enginefuncs_t g_engfuncs;
209.40 +globalvars_t *gpGlobals;
209.41 +
209.42 +// Receive engine function table from engine.
209.43 +// This appears to be the _first_ DLL routine called by the engine, so we
209.44 +// do some setup operations here.
209.45 +void WINAPI GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals )
209.46 +{
209.47 + memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t));
209.48 + gpGlobals = pGlobals;
209.49 + // NOTE! Have to call logging function _after_ copying into g_engfuncs, so
209.50 + // that g_engfuncs.pfnAlertMessage() can be resolved properly, heh. :)
209.51 + UTIL_LogPrintf("[%s] dev: called: GiveFnptrsToDll\n", Plugin_info.logtag);
209.52 +}
210.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
210.2 +++ b/trace_plugin/info_name.h Tue Apr 06 07:36:14 2004 +0000
210.3 @@ -0,0 +1,54 @@
210.4 +// vi: set ts=4 sw=4 :
210.5 +// vim: set tw=75 :
210.6 +
210.7 +// info_name.h - name, desc, author, etc
210.8 +
210.9 +/*
210.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
210.11 + *
210.12 + * This file is part of Metamod.
210.13 + *
210.14 + * Metamod is free software; you can redistribute it and/or modify it
210.15 + * under the terms of the GNU General Public License as published by the
210.16 + * Free Software Foundation; either version 2 of the License, or (at
210.17 + * your option) any later version.
210.18 + *
210.19 + * Metamod is distributed in the hope that it will be useful, but
210.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
210.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
210.22 + * General Public License for more details.
210.23 + *
210.24 + * You should have received a copy of the GNU General Public License
210.25 + * along with Metamod; if not, write to the Free Software Foundation,
210.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
210.27 + *
210.28 + * In addition, as a special exception, the author gives permission to
210.29 + * link the code of this program with the Half-Life Game Engine ("HL
210.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
210.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
210.32 + * respects for all of the code used other than the HL Engine and MODs
210.33 + * from Valve. If you modify this file, you may extend this exception
210.34 + * to your version of the file, but you are not obligated to do so. If
210.35 + * you do not wish to do so, delete this exception statement from your
210.36 + * version.
210.37 + *
210.38 + */
210.39 +
210.40 +#ifndef INFO_NAME_H
210.41 +#define INFO_NAME_H
210.42 +
210.43 +#include "vers_meta.h" // VDATE, VVERSION, etc
210.44 +
210.45 +#define VNAME "Trace HLSDK API"
210.46 +#define VAUTHOR "Will Day <[email protected]>"
210.47 +#define VURL "http://www.metamod.org/"
210.48 +#define VLOGTAG "TRACEAPI"
210.49 +
210.50 +// Various strings for the Windows DLL Resources in res_plugin.rc
210.51 +#define RC_COMMENTS "Allows tracing of the Half-Life SDK API. Requires Metamod; see " VURL
210.52 +#define RC_DESC "HLSDK API Trace Metamod Plugin DLL"
210.53 +#define RC_FILENAME "TRACE_MM.DLL"
210.54 +#define RC_INTERNAL "TRACE_MM"
210.55 +#define RC_COPYRIGHT "Copyright� 2001-2003 Will Day; licensed under the GPL"
210.56 +
210.57 +#endif /* INFO_NAME_H */
211.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
211.2 +++ b/trace_plugin/log_plugin.cpp Tue Apr 06 07:36:14 2004 +0000
211.3 @@ -0,0 +1,64 @@
211.4 +// vi: set ts=4 sw=4 :
211.5 +// vim: set tw=75 :
211.6 +
211.7 +// log_plugin.cpp - generic/common logging routines for plugin codebases
211.8 +
211.9 +/*
211.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
211.11 + *
211.12 + * This file is part of Metamod.
211.13 + *
211.14 + * Metamod is free software; you can redistribute it and/or modify it
211.15 + * under the terms of the GNU General Public License as published by the
211.16 + * Free Software Foundation; either version 2 of the License, or (at
211.17 + * your option) any later version.
211.18 + *
211.19 + * Metamod is distributed in the hope that it will be useful, but
211.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
211.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
211.22 + * General Public License for more details.
211.23 + *
211.24 + * You should have received a copy of the GNU General Public License
211.25 + * along with Metamod; if not, write to the Free Software Foundation,
211.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
211.27 + *
211.28 + * In addition, as a special exception, the author gives permission to
211.29 + * link the code of this program with the Half-Life Game Engine ("HL
211.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
211.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
211.32 + * respects for all of the code used other than the HL Engine and MODs
211.33 + * from Valve. If you modify this file, you may extend this exception
211.34 + * to your version of the file, but you are not obligated to do so. If
211.35 + * you do not wish to do so, delete this exception statement from your
211.36 + * version.
211.37 + *
211.38 + */
211.39 +
211.40 +#include <stdio.h> // vsnprintf(), etc
211.41 +#include <stdarg.h> // va_start(), etc
211.42 +
211.43 +#include <extdll.h>
211.44 +#include <enginecallback.h> // ALERT()
211.45 +
211.46 +#include <meta_api.h>
211.47 +#include <support_meta.h>
211.48 +
211.49 +#include "log_plugin.h"
211.50 +#include "plugin.h"
211.51 +
211.52 +cvar_t *plugin_debug;
211.53 +
211.54 +// Setup for logging. We pass the name of the debug cvar so that this
211.55 +// code can be used by multiple different plugins.
211.56 +void log_init(const char *cvarname) {
211.57 + CVAR_REGISTER(&init_plugin_debug);
211.58 + // Since metamod replaces our cvar_t structure with a structure local
211.59 + // to metamod when we call CVAR_REGISTER, we have to get the address of
211.60 + // the new struct if we expect to be able to read/write directly to
211.61 + // the cvar struct.
211.62 + plugin_debug=CVAR_GET_POINTER(cvarname);
211.63 + // Since we haven't read server.cfg yet, allow debug logging (level 3)
211.64 + // to be enabled with the "+developer" cmdline option.
211.65 + if((int) CVAR_GET_FLOAT("developer") != 0)
211.66 + CVAR_SET_FLOAT(cvarname, 3);
211.67 +}
212.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
212.2 +++ b/trace_plugin/log_plugin.h Tue Apr 06 07:36:14 2004 +0000
212.3 @@ -0,0 +1,59 @@
212.4 +// vi: set ts=4 sw=4 :
212.5 +// vim: set tw=75 :
212.6 +
212.7 +// log_plugin.h - generic/common logging routines/macros for plugin codebases
212.8 +
212.9 +/*
212.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
212.11 + *
212.12 + * This file is part of Metamod.
212.13 + *
212.14 + * Metamod is free software; you can redistribute it and/or modify it
212.15 + * under the terms of the GNU General Public License as published by the
212.16 + * Free Software Foundation; either version 2 of the License, or (at
212.17 + * your option) any later version.
212.18 + *
212.19 + * Metamod is distributed in the hope that it will be useful, but
212.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
212.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
212.22 + * General Public License for more details.
212.23 + *
212.24 + * You should have received a copy of the GNU General Public License
212.25 + * along with Metamod; if not, write to the Free Software Foundation,
212.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
212.27 + *
212.28 + * In addition, as a special exception, the author gives permission to
212.29 + * link the code of this program with the Half-Life Game Engine ("HL
212.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
212.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
212.32 + * respects for all of the code used other than the HL Engine and MODs
212.33 + * from Valve. If you modify this file, you may extend this exception
212.34 + * to your version of the file, but you are not obligated to do so. If
212.35 + * you do not wish to do so, delete this exception statement from your
212.36 + * version.
212.37 + *
212.38 + */
212.39 +
212.40 +#ifndef LOG_PLUGIN_H
212.41 +#define LOG_PLUGIN_H
212.42 +
212.43 +#include <enginecallback.h> // ALERT()
212.44 +#include <sdk_util.h> // UTIL_VarArgs()
212.45 +
212.46 +#include <api_info.h>
212.47 +#include "plugin.h"
212.48 +
212.49 +// called as:
212.50 +// LOG_DEBUG(3, ("return code: %d", ret));
212.51 +#define LOG_DEBUG(level, args) \
212.52 + do { if(plugin_debug->value >= level) ALERT(at_logged, "[%s] debug(%d): %s\n", Plugin_info.logtag, level, UTIL_VarArgs args ); } while(0)
212.53 +
212.54 +// max buffer size for printed messages
212.55 +#define MAX_LOGMSG_LEN 1024
212.56 +
212.57 +extern cvar_t init_plugin_debug;
212.58 +extern cvar_t *plugin_debug;
212.59 +
212.60 +void log_init(const char *cvarname);
212.61 +
212.62 +#endif /* LOG_PLUGIN_H */
213.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
213.2 +++ b/trace_plugin/meta_api.cpp Tue Apr 06 07:36:14 2004 +0000
213.3 @@ -0,0 +1,169 @@
213.4 +// vi: set ts=4 sw=4 :
213.5 +// vim: set tw=75 :
213.6 +
213.7 +// meta_api.cpp - common implementation of Metamod's plugin interface
213.8 +
213.9 +// This file is intended to provide a decent common codebase for the
213.10 +// Metamod plugins that I maintain, so everything is set up to be very
213.11 +// generalized, with the things specific for each plugin handled in
213.12 +// plugin.{h,cpp} and elsewhere.
213.13 +
213.14 +/*
213.15 + * Copyright (c) 2001-2003 Will Day <[email protected]>
213.16 + *
213.17 + * This file is part of Metamod.
213.18 + *
213.19 + * Metamod is free software; you can redistribute it and/or modify it
213.20 + * under the terms of the GNU General Public License as published by the
213.21 + * Free Software Foundation; either version 2 of the License, or (at
213.22 + * your option) any later version.
213.23 + *
213.24 + * Metamod is distributed in the hope that it will be useful, but
213.25 + * WITHOUT ANY WARRANTY; without even the implied warranty of
213.26 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
213.27 + * General Public License for more details.
213.28 + *
213.29 + * You should have received a copy of the GNU General Public License
213.30 + * along with Metamod; if not, write to the Free Software Foundation,
213.31 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
213.32 + *
213.33 + * In addition, as a special exception, the author gives permission to
213.34 + * link the code of this program with the Half-Life Game Engine ("HL
213.35 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
213.36 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
213.37 + * respects for all of the code used other than the HL Engine and MODs
213.38 + * from Valve. If you modify this file, you may extend this exception
213.39 + * to your version of the file, but you are not obligated to do so. If
213.40 + * you do not wish to do so, delete this exception statement from your
213.41 + * version.
213.42 + *
213.43 + */
213.44 +
213.45 +#include <extdll.h>
213.46 +
213.47 +#include <dllapi.h>
213.48 +#include <meta_api.h>
213.49 +#include <vdate.h>
213.50 +
213.51 +#include "plugin.h"
213.52 +#include "info_name.h"
213.53 +#include "log_plugin.h"
213.54 +
213.55 +extern META_FUNCTIONS gMetaFunctionTable;
213.56 +
213.57 +// Description of plugin.
213.58 +// (V* info from info_name.h)
213.59 +plugin_info_t Plugin_info = {
213.60 + META_INTERFACE_VERSION, // ifvers
213.61 + VNAME, // name
213.62 + VVERSION, // version
213.63 + VDATE, // date
213.64 + VAUTHOR, // author
213.65 + VURL, // url
213.66 + VLOGTAG, // logtag
213.67 + PT_ANYTIME, // loadable
213.68 + PT_ANYPAUSE, // unloadable
213.69 +};
213.70 +
213.71 +// Global variables from metamod. These variable names are referenced by
213.72 +// various macros.
213.73 +meta_globals_t *gpMetaGlobals; // metamod globals
213.74 +gamedll_funcs_t *gpGamedllFuncs; // gameDLL function tables
213.75 +mutil_funcs_t *gpMetaUtilFuncs; // metamod utility functions
213.76 +
213.77 +// Metamod requesting info about this plugin
213.78 +// ifvers (given) interface_version metamod is using
213.79 +// pPlugInfo (requested) struct with info about plugin
213.80 +// pMetaUtilFuncs (given) table of utility functions provided by metamod
213.81 +C_DLLEXPORT int Meta_Query(char *ifvers, plugin_info_t **pPlugInfo,
213.82 + mutil_funcs_t *pMetaUtilFuncs)
213.83 +{
213.84 + if ((int) CVAR_GET_FLOAT("developer") != 0)
213.85 + UTIL_LogPrintf("[%s] dev: called: Meta_Query; version=%s, ours=%s\n",
213.86 + Plugin_info.logtag, ifvers, Plugin_info.ifvers);
213.87 +
213.88 + // Check for valid pMetaUtilFuncs before we continue.
213.89 + if(!pMetaUtilFuncs) {
213.90 + UTIL_LogPrintf("[%s] ERROR: Meta_Query called with null pMetaUtilFuncs\n", Plugin_info.logtag);
213.91 + return(FALSE);
213.92 + }
213.93 + gpMetaUtilFuncs=pMetaUtilFuncs;
213.94 +
213.95 + // Give metamod our plugin_info struct.
213.96 + *pPlugInfo=&Plugin_info;
213.97 +
213.98 + // Check for interface version compatibility.
213.99 + if(!FStrEq(ifvers, Plugin_info.ifvers)) {
213.100 + int mmajor=0, mminor=0, pmajor=0, pminor=0;
213.101 + LOG_MESSAGE(PLID, "WARNING: meta-interface version mismatch; requested=%s ours=%s",
213.102 + Plugin_info.logtag, ifvers);
213.103 + // If plugin has later interface version, it's incompatible (update
213.104 + // metamod).
213.105 + sscanf(ifvers, "%d:%d", &mmajor, &mminor);
213.106 + sscanf(META_INTERFACE_VERSION, "%d:%d", &pmajor, &pminor);
213.107 + if(pmajor > mmajor || (pmajor==mmajor && pminor > mminor)) {
213.108 + LOG_ERROR(PLID, "metamod version is too old for this plugin; update metamod");
213.109 + return(FALSE);
213.110 + }
213.111 + // If plugin has older major interface version, it's incompatible
213.112 + // (update plugin).
213.113 + else if(pmajor < mmajor) {
213.114 + LOG_ERROR(PLID, "metamod version is incompatible with this plugin; please find a newer version of this plugin");
213.115 + return(FALSE);
213.116 + }
213.117 + // Minor interface is older, but this is guaranteed to be backwards
213.118 + // compatible, so we warn, but we still accept it.
213.119 + else if(pmajor==mmajor && pminor < mminor)
213.120 + LOG_MESSAGE(PLID, "WARNING: metamod version is newer than expected; consider finding a newer version of this plugin");
213.121 + else
213.122 + LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor);
213.123 + }
213.124 +
213.125 + return (plugin_query());
213.126 +}
213.127 +
213.128 +// Metamod attaching plugin to the server.
213.129 +// now (given) current phase, ie during map, during changelevel, or at startup
213.130 +// pFunctionTable (requested) table of function tables this plugin catches
213.131 +// pMGlobals (given) global vars from metamod
213.132 +// pGamedllFuncs (given) copy of function tables from game dll
213.133 +C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable,
213.134 + meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs)
213.135 +{
213.136 + if(now > Plugin_info.loadable) {
213.137 + LOG_ERROR(PLID, "Can't load plugin right now");
213.138 + return(FALSE);
213.139 + }
213.140 + if(!pMGlobals) {
213.141 + LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals");
213.142 + return(FALSE);
213.143 + }
213.144 + gpMetaGlobals=pMGlobals;
213.145 + if(!pFunctionTable) {
213.146 + LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable");
213.147 + return(FALSE);
213.148 + }
213.149 + memcpy(pFunctionTable, &gMetaFunctionTable, sizeof(META_FUNCTIONS));
213.150 + gpGamedllFuncs=pGamedllFuncs;
213.151 +
213.152 + LOG_MESSAGE(PLID, "%s v%s %s", Plugin_info.name, Plugin_info.version,
213.153 + Plugin_info.date);
213.154 + LOG_MESSAGE(PLID, "by %s", Plugin_info.author);
213.155 + LOG_MESSAGE(PLID, " %s", Plugin_info.url);
213.156 + LOG_MESSAGE(PLID, "compiled: %s Eastern (%s)", COMPILE_TIME, OPT_TYPE);
213.157 +
213.158 + // Let's go.
213.159 + return(plugin_attach());
213.160 +}
213.161 +
213.162 +// Metamod detaching plugin from the server.
213.163 +// now (given) current phase, ie during map, etc
213.164 +// reason (given) why detaching (refresh, console unload, forced unload, etc)
213.165 +C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) {
213.166 + if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) {
213.167 + LOG_ERROR(PLID, "Can't unload plugin right now");
213.168 + return(FALSE);
213.169 + }
213.170 + // Done!
213.171 + return(plugin_detach());
213.172 +}
214.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
214.2 +++ b/trace_plugin/msgs/debug Tue Apr 06 07:36:14 2004 +0000
214.3 @@ -0,0 +1,1 @@
214.4 +log_plugin.h // LOG_DEBUG(3, ("return code: %d", ret));
217.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
217.2 +++ b/trace_plugin/plugin.cpp Tue Apr 06 07:36:14 2004 +0000
217.3 @@ -0,0 +1,75 @@
217.4 +// vi: set ts=4 sw=4 :
217.5 +// vim: set tw=75 :
217.6 +
217.7 +// plugin.cpp - generic plugin operation
217.8 +
217.9 +/*
217.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
217.11 + *
217.12 + * This file is part of Metamod.
217.13 + *
217.14 + * Metamod is free software; you can redistribute it and/or modify it
217.15 + * under the terms of the GNU General Public License as published by the
217.16 + * Free Software Foundation; either version 2 of the License, or (at
217.17 + * your option) any later version.
217.18 + *
217.19 + * Metamod is distributed in the hope that it will be useful, but
217.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
217.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
217.22 + * General Public License for more details.
217.23 + *
217.24 + * You should have received a copy of the GNU General Public License
217.25 + * along with Metamod; if not, write to the Free Software Foundation,
217.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
217.27 + *
217.28 + * In addition, as a special exception, the author gives permission to
217.29 + * link the code of this program with the Half-Life Game Engine ("HL
217.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
217.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
217.32 + * respects for all of the code used other than the HL Engine and MODs
217.33 + * from Valve. If you modify this file, you may extend this exception
217.34 + * to your version of the file, but you are not obligated to do so. If
217.35 + * you do not wish to do so, delete this exception statement from your
217.36 + * version.
217.37 + *
217.38 + */
217.39 +
217.40 +#include <extdll.h>
217.41 +
217.42 +#include <meta_api.h>
217.43 +
217.44 +#include "plugin.h"
217.45 +#include "log_plugin.h"
217.46 +#include "trace_api.h"
217.47 +
217.48 +// Must provide at least one of these..
217.49 +META_FUNCTIONS gMetaFunctionTable = {
217.50 + NULL, // pfnGetEntityAPI HL SDK; called before game DLL
217.51 + NULL, // pfnGetEntityAPI_Post META; called after game DLL
217.52 + GetEntityAPI2, // pfnGetEntityAPI2 HL SDK2; called before game DLL
217.53 + GetEntityAPI2_Post, // pfnGetEntityAPI2_Post META; called after game DLL
217.54 + GetNewDLLFunctions, // pfnGetNewDLLFunctions HL SDK2; called before game DLL
217.55 + GetNewDLLFunctions_Post, // pfnGetNewDLLFunctions_Post META; called after game DLL
217.56 + GetEngineFunctions, // pfnGetEngineFunctions META; called before HL engine
217.57 + GetEngineFunctions_Post, // pfnGetEngineFunctions_Post META; called after HL engine
217.58 +};
217.59 +
217.60 +cvar_t init_plugin_debug = {"trace_debug", "0", FCVAR_EXTDLL, 0, NULL};
217.61 +
217.62 +
217.63 +// Meta_Query, any desired checks for valid use.
217.64 +int plugin_query(void) {
217.65 + return(TRUE);
217.66 +}
217.67 +
217.68 +// Meta_Attach. Plugin startup. Register commands and cvars.
217.69 +int plugin_attach(void) {
217.70 + log_init("trace_debug");
217.71 + trace_init();
217.72 + return(TRUE);
217.73 +}
217.74 +
217.75 +// Meta_Detach. Cleaning up.
217.76 +int plugin_detach(void) {
217.77 + return(TRUE);
217.78 +}
218.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
218.2 +++ b/trace_plugin/plugin.h Tue Apr 06 07:36:14 2004 +0000
218.3 @@ -0,0 +1,44 @@
218.4 +// vi: set ts=4 sw=4 :
218.5 +// vim: set tw=75 :
218.6 +
218.7 +// plugin.h - generic plugin framework
218.8 +
218.9 +/*
218.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
218.11 + *
218.12 + * This file is part of Metamod.
218.13 + *
218.14 + * Metamod is free software; you can redistribute it and/or modify it
218.15 + * under the terms of the GNU General Public License as published by the
218.16 + * Free Software Foundation; either version 2 of the License, or (at
218.17 + * your option) any later version.
218.18 + *
218.19 + * Metamod is distributed in the hope that it will be useful, but
218.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
218.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
218.22 + * General Public License for more details.
218.23 + *
218.24 + * You should have received a copy of the GNU General Public License
218.25 + * along with Metamod; if not, write to the Free Software Foundation,
218.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
218.27 + *
218.28 + * In addition, as a special exception, the author gives permission to
218.29 + * link the code of this program with the Half-Life Game Engine ("HL
218.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
218.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
218.32 + * respects for all of the code used other than the HL Engine and MODs
218.33 + * from Valve. If you modify this file, you may extend this exception
218.34 + * to your version of the file, but you are not obligated to do so. If
218.35 + * you do not wish to do so, delete this exception statement from your
218.36 + * version.
218.37 + *
218.38 + */
218.39 +
218.40 +#ifndef PLUGIN_H
218.41 +#define PLUGIN_H
218.42 +
218.43 +int plugin_query(void);
218.44 +int plugin_attach(void);
218.45 +int plugin_detach(void);
218.46 +
218.47 +#endif /* PLUGIN_H */
219.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
219.2 +++ b/trace_plugin/res_meta.rc Tue Apr 06 07:36:14 2004 +0000
219.3 @@ -0,0 +1,76 @@
219.4 +// vi: set ts=4 sw=4 ft=c :
219.5 +// vim: set tw=75 :
219.6 +
219.7 +/*
219.8 + * Copyright (c) 2001-2003 Will Day <[email protected]>
219.9 + *
219.10 + * This file is part of Metamod.
219.11 + *
219.12 + * Metamod is free software; you can redistribute it and/or modify it
219.13 + * under the terms of the GNU General Public License as published by the
219.14 + * Free Software Foundation; either version 2 of the License, or (at
219.15 + * your option) any later version.
219.16 + *
219.17 + * Metamod is distributed in the hope that it will be useful, but
219.18 + * WITHOUT ANY WARRANTY; without even the implied warranty of
219.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
219.20 + * General Public License for more details.
219.21 + *
219.22 + * You should have received a copy of the GNU General Public License
219.23 + * along with Metamod; if not, write to the Free Software Foundation,
219.24 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
219.25 + *
219.26 + * In addition, as a special exception, the author gives permission to
219.27 + * link the code of this program with the Half-Life Game Engine ("HL
219.28 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
219.29 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
219.30 + * respects for all of the code used other than the HL Engine and MODs
219.31 + * from Valve. If you modify this file, you may extend this exception
219.32 + * to your version of the file, but you are not obligated to do so. If
219.33 + * you do not wish to do so, delete this exception statement from your
219.34 + * version.
219.35 + *
219.36 + */
219.37 +
219.38 +// see:
219.39 +// http://msdn.microsoft.com/library/psdk/winui/rc_7x2d.htm
219.40 +
219.41 +#include <winver.h>
219.42 +#include "info_name.h"
219.43 +
219.44 +VS_VERSION_INFO VERSIONINFO
219.45 + FILEVERSION RC_VERS_DWORD
219.46 + PRODUCTVERSION RC_VERS_DWORD
219.47 + FILEFLAGSMASK 0x3fL
219.48 +#ifdef _DEBUG
219.49 + FILEFLAGS VS_FF_DEBUG
219.50 +#else
219.51 + FILEFLAGS 0x0L
219.52 +#endif
219.53 + FILEOS VOS__WINDOWS32
219.54 + FILETYPE VFT_DLL
219.55 + FILESUBTYPE VFT2_UNKNOWN
219.56 +BEGIN
219.57 + BLOCK "StringFileInfo"
219.58 + BEGIN
219.59 + BLOCK "040904b0"
219.60 + BEGIN
219.61 + VALUE "Comments", RC_COMMENTS "\0"
219.62 + VALUE "CompanyName", VAUTHOR "\0"
219.63 + VALUE "FileDescription", RC_DESC "\0"
219.64 + VALUE "FileVersion", VVERSION "\0"
219.65 + VALUE "InternalName", RC_INTERNAL "\0"
219.66 + VALUE "LegalCopyright", RC_COPYRIGHT "\0"
219.67 + VALUE "LegalTrademarks", "\0"
219.68 + VALUE "OriginalFilename", RC_FILENAME "\0"
219.69 + VALUE "PrivateBuild", "\0"
219.70 + VALUE "ProductName", VNAME "\0"
219.71 + VALUE "ProductVersion", VVERSION "\0"
219.72 + VALUE "SpecialBuild", OPT_TYPE "\0"
219.73 + END
219.74 + END
219.75 + BLOCK "VarFileInfo"
219.76 + BEGIN
219.77 + VALUE "Translation", 0x409, 1200
219.78 + END
219.79 +END
220.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
220.2 +++ b/trace_plugin/sdk_util.cpp Tue Apr 06 07:36:14 2004 +0000
220.3 @@ -0,0 +1,143 @@
220.4 +// vi: set ts=4 sw=4 :
220.5 +// vim: set tw=75 :
220.6 +
220.7 +// sdk_util.cpp - utility routines from HL SDK util.cpp
220.8 +
220.9 +// Selected portions of dlls/util.cpp from SDK 2.1.
220.10 +// Functions copied from there as needed...
220.11 +// And modified to avoid buffer overflows (argh).
220.12 +
220.13 +/***
220.14 +*
220.15 +* Copyright (c) 1999, 2000 Valve LLC. All rights reserved.
220.16 +*
220.17 +* This product contains software technology licensed from Id
220.18 +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
220.19 +* All Rights Reserved.
220.20 +*
220.21 +* Use, distribution, and modification of this source code and/or resulting
220.22 +* object code is restricted to non-commercial enhancements to products from
220.23 +* Valve LLC. All other use, distribution, or modification is prohibited
220.24 +* without written permission from Valve LLC.
220.25 +*
220.26 +****/
220.27 +/*
220.28 +
220.29 +===== util.cpp ========================================================
220.30 +
220.31 + Utility code. Really not optional after all.
220.32 +
220.33 +*/
220.34 +
220.35 +#include <extdll.h>
220.36 +#include "sdk_util.h"
220.37 +#include <cbase.h>
220.38 +
220.39 +#include <string.h> // for strncpy(), etc
220.40 +
220.41 +#include "osdep.h" // win32 vsnprintf, etc
220.42 +
220.43 +char* UTIL_VarArgs( char *format, ... )
220.44 +{
220.45 + va_list argptr;
220.46 + static char string[1024];
220.47 +
220.48 + va_start (argptr, format);
220.49 + vsnprintf (string, sizeof(string), format, argptr);
220.50 + va_end (argptr);
220.51 +
220.52 + return string;
220.53 +}
220.54 +
220.55 +
220.56 +//=========================================================
220.57 +// UTIL_LogPrintf - Prints a logged message to console.
220.58 +// Preceded by LOG: ( timestamp ) < message >
220.59 +//=========================================================
220.60 +void UTIL_LogPrintf( char *fmt, ... )
220.61 +{
220.62 + va_list argptr;
220.63 + static char string[1024];
220.64 +
220.65 + va_start ( argptr, fmt );
220.66 + vsnprintf ( string, sizeof(string), fmt, argptr );
220.67 + va_end ( argptr );
220.68 +
220.69 + // Print to server console
220.70 + ALERT( at_logged, "%s", string );
220.71 +}
220.72 +
220.73 +
220.74 +void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms,
220.75 + const char *pMessage)
220.76 +{
220.77 + if ( !pEntity )
220.78 + return;
220.79 +
220.80 + MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, ENT(pEntity->pev) );
220.81 + WRITE_BYTE( TE_TEXTMESSAGE );
220.82 + WRITE_BYTE( textparms.channel & 0xFF );
220.83 +
220.84 + WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) );
220.85 + WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) );
220.86 + WRITE_BYTE( textparms.effect );
220.87 +
220.88 + WRITE_BYTE( textparms.r1 );
220.89 + WRITE_BYTE( textparms.g1 );
220.90 + WRITE_BYTE( textparms.b1 );
220.91 + WRITE_BYTE( textparms.a1 );
220.92 +
220.93 + WRITE_BYTE( textparms.r2 );
220.94 + WRITE_BYTE( textparms.g2 );
220.95 + WRITE_BYTE( textparms.b2 );
220.96 + WRITE_BYTE( textparms.a2 );
220.97 +
220.98 + WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) );
220.99 + WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) );
220.100 + WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) );
220.101 +
220.102 + if ( textparms.effect == 2 )
220.103 + WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) );
220.104 +
220.105 + if ( strlen( pMessage ) < 512 )
220.106 + {
220.107 + WRITE_STRING( pMessage );
220.108 + }
220.109 + else
220.110 + {
220.111 + char tmp[512];
220.112 + strncpy( tmp, pMessage, 511 );
220.113 + tmp[511] = 0;
220.114 + WRITE_STRING( tmp );
220.115 + }
220.116 + MESSAGE_END();
220.117 +}
220.118 +
220.119 +short FixedSigned16( float value, float scale )
220.120 +{
220.121 + int output;
220.122 +
220.123 + output = (int) (value * scale);
220.124 +
220.125 + if ( output > 32767 )
220.126 + output = 32767;
220.127 +
220.128 + if ( output < -32768 )
220.129 + output = -32768;
220.130 +
220.131 + return (short)output;
220.132 +}
220.133 +
220.134 +unsigned short FixedUnsigned16( float value, float scale )
220.135 +{
220.136 + int output;
220.137 +
220.138 + output = (int) (value * scale);
220.139 + if ( output < 0 )
220.140 + output = 0;
220.141 + if ( output > 0xFFFF )
220.142 + output = 0xFFFF;
220.143 +
220.144 + return (unsigned short)output;
220.145 +}
220.146 +
221.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
221.2 +++ b/trace_plugin/trace_api.cpp Tue Apr 06 07:36:14 2004 +0000
221.3 @@ -0,0 +1,300 @@
221.4 +// vi: set ts=4 sw=4 :
221.5 +// vim: set tw=75 :
221.6 +
221.7 +// trace_api.cpp - (main) implementation of HL API tracing operations
221.8 +
221.9 +/*
221.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
221.11 + *
221.12 + * This file is part of Metamod.
221.13 + *
221.14 + * Metamod is free software; you can redistribute it and/or modify it
221.15 + * under the terms of the GNU General Public License as published by the
221.16 + * Free Software Foundation; either version 2 of the License, or (at
221.17 + * your option) any later version.
221.18 + *
221.19 + * Metamod is distributed in the hope that it will be useful, but
221.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
221.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
221.22 + * General Public License for more details.
221.23 + *
221.24 + * You should have received a copy of the GNU General Public License
221.25 + * along with Metamod; if not, write to the Free Software Foundation,
221.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
221.27 + *
221.28 + * In addition, as a special exception, the author gives permission to
221.29 + * link the code of this program with the Half-Life Game Engine ("HL
221.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
221.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
221.32 + * respects for all of the code used other than the HL Engine and MODs
221.33 + * from Valve. If you modify this file, you may extend this exception
221.34 + * to your version of the file, but you are not obligated to do so. If
221.35 + * you do not wish to do so, delete this exception statement from your
221.36 + * version.
221.37 + *
221.38 + */
221.39 +
221.40 +#include <extdll.h> // always
221.41 +
221.42 +#include <api_info.h> // api_info_t, etc
221.43 +#include <sdk_util.h> // REG_SVR_COMMAND, etc
221.44 +#include <meta_api.h> // Plugin_info, etc
221.45 +
221.46 +#include "trace_api.h" // me
221.47 +#include "log_plugin.h" // LOG_MSG, etc
221.48 +#include "vers_meta.h" // OPT_TYPE
221.49 +#include "vdate.h" // COMPILE_TIME
221.50 +
221.51 +cvar_t init_dllapi_trace = {"trace_dllapi", "0", FCVAR_EXTDLL, 0, NULL};
221.52 +cvar_t init_newapi_trace = {"trace_newapi", "0", FCVAR_EXTDLL, 0, NULL};
221.53 +cvar_t init_engine_trace = {"trace_engine", "0", FCVAR_EXTDLL, 0, NULL};
221.54 +cvar_t init_unlimit_trace = {"trace_unlimit", "0", FCVAR_EXTDLL, 0, NULL};
221.55 +
221.56 +cvar_t *dllapi_trace = NULL;
221.57 +cvar_t *newapi_trace = NULL;
221.58 +cvar_t *engine_trace = NULL;
221.59 +cvar_t *unlimit_trace = NULL;
221.60 +
221.61 +const char *msg_dest_types[32];
221.62 +
221.63 +time_t last_trace_log = 0;
221.64 +
221.65 +// Plugin startup. Register commands and cvars.
221.66 +void trace_init(void) {
221.67 + CVAR_REGISTER(&init_dllapi_trace);
221.68 + CVAR_REGISTER(&init_newapi_trace);
221.69 + CVAR_REGISTER(&init_engine_trace);
221.70 + CVAR_REGISTER(&init_unlimit_trace);
221.71 +
221.72 + dllapi_trace=CVAR_GET_POINTER("trace_dllapi");
221.73 + newapi_trace=CVAR_GET_POINTER("trace_newapi");
221.74 + engine_trace=CVAR_GET_POINTER("trace_engine");
221.75 + unlimit_trace=CVAR_GET_POINTER("trace_unlimit");
221.76 +
221.77 + REG_SVR_COMMAND("trace", svr_trace);
221.78 +
221.79 + memset(msg_dest_types, 0, sizeof(msg_dest_types));
221.80 +
221.81 + msg_dest_types[MSG_BROADCAST]="all_unreliable";
221.82 + msg_dest_types[MSG_ONE]="one_reliable";
221.83 + msg_dest_types[MSG_ALL]="all_reliable";
221.84 + msg_dest_types[MSG_INIT]="init";
221.85 + msg_dest_types[MSG_PVS]="pvs_unreliable";
221.86 + msg_dest_types[MSG_PAS]="pas_unreliable";
221.87 + msg_dest_types[MSG_PVS_R]="pvs_reliable";
221.88 + msg_dest_types[MSG_PAS_R]="pas_reliable";
221.89 + msg_dest_types[MSG_ONE_UNRELIABLE]="one_unreliable";
221.90 +}
221.91 +
221.92 +// Parse "trace" console command.
221.93 +void svr_trace(void) {
221.94 + const char *cmd;
221.95 + cmd=CMD_ARGV(1);
221.96 + if(!strcasecmp(cmd, "version"))
221.97 + cmd_trace_version();
221.98 + else if(!strcasecmp(cmd, "show"))
221.99 + cmd_trace_show();
221.100 + else if(!strcasecmp(cmd, "set"))
221.101 + cmd_trace_set();
221.102 + else if(!strcasecmp(cmd, "unset"))
221.103 + cmd_trace_unset();
221.104 + else if(!strcasecmp(cmd, "list"))
221.105 + cmd_trace_list();
221.106 + else {
221.107 + LOG_CONSOLE(PLID, "Unrecognized trace command: %s", cmd);
221.108 + cmd_trace_usage();
221.109 + return;
221.110 + }
221.111 +}
221.112 +
221.113 +// Print usage for "trace" console command.
221.114 +void cmd_trace_usage(void) {
221.115 + LOG_CONSOLE(PLID, "usage: trace <command> [<arguments>]");
221.116 + LOG_CONSOLE(PLID, "valid commands are:");
221.117 + LOG_CONSOLE(PLID, " version - display plugin version info");
221.118 + LOG_CONSOLE(PLID, " show - show currently traced api routines");
221.119 + LOG_CONSOLE(PLID, " set <routine> - set tracing for given routine");
221.120 + LOG_CONSOLE(PLID, " unset <routine> - unset tracing for given routine");
221.121 + LOG_CONSOLE(PLID, " list dllapi - list all dllapi routines available for tracing");
221.122 + LOG_CONSOLE(PLID, " list newapi - list all newapi routines available for tracing");
221.123 + LOG_CONSOLE(PLID, " list engine - list all engine routines available for tracing");
221.124 + LOG_CONSOLE(PLID, " list all - list dllapi, neapi, and engine");
221.125 +}
221.126 +
221.127 +// "trace version" console command.
221.128 +void cmd_trace_version(void) {
221.129 + LOG_CONSOLE(PLID, "%s v%s, %s", Plugin_info.name, Plugin_info.version, Plugin_info.date);
221.130 + LOG_CONSOLE(PLID, "by %s", Plugin_info.author);
221.131 + LOG_CONSOLE(PLID, " %s", Plugin_info.url);
221.132 + LOG_CONSOLE(PLID, "compiled: %s Eastern (%s)", COMPILE_TIME, OPT_TYPE);
221.133 +}
221.134 +
221.135 +// "trace set" console command.
221.136 +void cmd_trace_set(void) {
221.137 + int i, argc;
221.138 + const char *arg;
221.139 + const char *api;
221.140 + TRACE_RESULT ret;
221.141 + argc=CMD_ARGC();
221.142 + if(argc < 3) {
221.143 + LOG_CONSOLE(PLID, "usage: trace set <routine> [<routine> ...]");
221.144 + return;
221.145 + }
221.146 + for(i=2; i < argc; i++) {
221.147 + arg=CMD_ARGV(i);
221.148 + ret=trace_setflag(&arg, mTRUE, &api);
221.149 + if(ret==TR_SUCCESS)
221.150 + LOG_MESSAGE(PLID, "Tracing %s routine '%s'", api, arg);
221.151 + else if(ret==TR_ALREADY)
221.152 + LOG_CONSOLE(PLID, "Already tracing %s routine '%s'", api, arg);
221.153 + else
221.154 + LOG_CONSOLE(PLID, "Unrecognized API routine '%s'", arg);
221.155 + }
221.156 +}
221.157 +
221.158 +// "trace unset" console command.
221.159 +void cmd_trace_unset(void) {
221.160 + int i, argc;
221.161 + const char *arg;
221.162 + const char *api;
221.163 + TRACE_RESULT ret;
221.164 + argc=CMD_ARGC();
221.165 + if(argc < 3) {
221.166 + LOG_CONSOLE(PLID, "usage: trace unset <routine>");
221.167 + return;
221.168 + }
221.169 + for(i=1; i < argc; i++) {
221.170 + arg=CMD_ARGV(i);
221.171 + ret=trace_setflag(&arg, mFALSE, &api);
221.172 + if(ret==TR_SUCCESS)
221.173 + LOG_MESSAGE(PLID, "Un-Tracing %s routine '%s'", api, arg);
221.174 + else if(ret==TR_ALREADY)
221.175 + LOG_CONSOLE(PLID, "Already not tracing %s routine '%s'", api, arg);
221.176 + else
221.177 + LOG_CONSOLE(PLID, "Unrecognized API routine '%s'", arg);
221.178 + }
221.179 +}
221.180 +
221.181 +// "trace show" console command.
221.182 +void cmd_trace_show(void) {
221.183 + api_info_t *routine;
221.184 + int n=0;
221.185 + LOG_CONSOLE(PLID, "Tracing routines:");
221.186 + for(routine=(api_info_t *) &dllapi_info; routine->name; routine++) {
221.187 + if(routine->trace==mTRUE) {
221.188 + LOG_CONSOLE(PLID, " %s (dllapi)", routine->name);
221.189 + n++;
221.190 + }
221.191 + }
221.192 + for(routine=(api_info_t *) &newapi_info; routine->name; routine++) {
221.193 + if(routine->trace==mTRUE) {
221.194 + LOG_CONSOLE(PLID, " %s (newapi)", routine->name);
221.195 + n++;
221.196 + }
221.197 + }
221.198 + for(routine=(api_info_t *) &engine_info; routine->name; routine++) {
221.199 + if(routine->trace==mTRUE) {
221.200 + LOG_CONSOLE(PLID, " %s (engine)", routine->name);
221.201 + n++;
221.202 + }
221.203 + }
221.204 + LOG_CONSOLE(PLID, "%d routines", n);
221.205 +}
221.206 +
221.207 +// "trace list" console command.
221.208 +void cmd_trace_list(void) {
221.209 + api_info_t *routine;
221.210 + mBOOL valid=mFALSE;
221.211 + int n, t;
221.212 + const char *arg;
221.213 + arg=CMD_ARGV(2);
221.214 + if(!strcasecmp(arg, "all") || !strcasecmp(arg, "dllapi")) {
221.215 + valid=mTRUE;
221.216 + n=0; t=0;
221.217 + LOG_CONSOLE(PLID, "DLLAPI routines:");
221.218 + for(routine=(api_info_t *) &dllapi_info; routine->name; routine++) {
221.219 + LOG_CONSOLE(PLID, " %c %s",
221.220 + routine->trace ? '+' : ' ',
221.221 + routine->name);
221.222 + n++;
221.223 + if(routine->trace) t++;
221.224 + }
221.225 + LOG_CONSOLE(PLID, "%d DLLAPI routines, %d traced", n, t);
221.226 + }
221.227 + if(!strcasecmp(arg, "all") || !strcasecmp(arg, "newapi")) {
221.228 + valid=mTRUE;
221.229 + n=0; t=0;
221.230 + LOG_CONSOLE(PLID, "NEWAPI routines:");
221.231 + for(routine=(api_info_t *) &newapi_info; routine->name; routine++) {
221.232 + LOG_CONSOLE(PLID, " %c %s",
221.233 + routine->trace ? '+' : ' ',
221.234 + routine->name);
221.235 + n++;
221.236 + if(routine->trace) t++;
221.237 + }
221.238 + LOG_CONSOLE(PLID, "%d NEWAPI routines, %d traced", n, t);
221.239 + }
221.240 + if(!strcasecmp(arg, "all") || !strcasecmp(arg, "engine")) {
221.241 + valid=mTRUE;
221.242 + n=0; t=0;
221.243 + LOG_CONSOLE(PLID, "Engine routines:");
221.244 + for(routine=(api_info_t *) &engine_info; routine->name; routine++) {
221.245 + LOG_CONSOLE(PLID, " %c %s",
221.246 + routine->trace ? '+' : ' ',
221.247 + routine->name);
221.248 + n++;
221.249 + if(routine->trace) t++;
221.250 + }
221.251 + LOG_CONSOLE(PLID, "%d Engine routines, %d traced", n, t);
221.252 + }
221.253 + if(!valid) {
221.254 + LOG_CONSOLE(PLID, "usage: trace list <type>");
221.255 + LOG_CONSOLE(PLID, "where <type> is one of:");
221.256 + LOG_CONSOLE(PLID, " dllapi - list all dllapi routines available for tracing");
221.257 + LOG_CONSOLE(PLID, " newapi - list all newapi routines available for tracing");
221.258 + LOG_CONSOLE(PLID, " engine - list all engine routines available for tracing");
221.259 + LOG_CONSOLE(PLID, " all - list dllapi, newapi, engine");
221.260 + }
221.261 +}
221.262 +
221.263 +// Set or unset tracing of a given api routine string. Searches all three
221.264 +// API lists, in the order:
221.265 +// dllapi
221.266 +// newapi
221.267 +// engine
221.268 +// Returns API list in which the routine was found, as well as the
221.269 +// "canonicalized" routine name/string.
221.270 +TRACE_RESULT trace_setflag(const char **pfn_string, mBOOL flagval, const char **api) {
221.271 + api_info_t *routine;
221.272 + for(routine=(api_info_t *) &dllapi_info; routine->name; routine++) {
221.273 + if(!strcasecmp(routine->name, *pfn_string)) {
221.274 + *pfn_string=routine->name;
221.275 + *api="DLLAPI";
221.276 + if(routine->trace==flagval)
221.277 + return(TR_ALREADY);
221.278 + routine->trace=flagval;
221.279 + return(TR_SUCCESS);
221.280 + }
221.281 + }
221.282 + for(routine=(api_info_t *) &newapi_info; routine->name; routine++) {
221.283 + if(!strcasecmp(routine->name, *pfn_string)) {
221.284 + *pfn_string=routine->name;
221.285 + *api="NEWAPI";
221.286 + if(routine->trace==flagval)
221.287 + return(TR_ALREADY);
221.288 + routine->trace=flagval;
221.289 + return(TR_SUCCESS);
221.290 + }
221.291 + }
221.292 + for(routine=(api_info_t *) &engine_info; routine->name; routine++) {
221.293 + if(!strcasecmp(routine->name, *pfn_string)) {
221.294 + *pfn_string=routine->name;
221.295 + *api="Engine";
221.296 + if(routine->trace==flagval)
221.297 + return(TR_ALREADY);
221.298 + routine->trace=flagval;
221.299 + return(TR_SUCCESS);
221.300 + }
221.301 + }
221.302 + return(TR_FAILURE);
221.303 +}
222.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
222.2 +++ b/trace_plugin/trace_api.h Tue Apr 06 07:36:14 2004 +0000
222.3 @@ -0,0 +1,102 @@
222.4 +// vi: set ts=4 sw=4 :
222.5 +// vim: set tw=75 :
222.6 +
222.7 +// trace_api.h - (main) description of HL API tracing operations
222.8 +
222.9 +/*
222.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
222.11 + *
222.12 + * This file is part of Metamod.
222.13 + *
222.14 + * Metamod is free software; you can redistribute it and/or modify it
222.15 + * under the terms of the GNU General Public License as published by the
222.16 + * Free Software Foundation; either version 2 of the License, or (at
222.17 + * your option) any later version.
222.18 + *
222.19 + * Metamod is distributed in the hope that it will be useful, but
222.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
222.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
222.22 + * General Public License for more details.
222.23 + *
222.24 + * You should have received a copy of the GNU General Public License
222.25 + * along with Metamod; if not, write to the Free Software Foundation,
222.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
222.27 + *
222.28 + * In addition, as a special exception, the author gives permission to
222.29 + * link the code of this program with the Half-Life Game Engine ("HL
222.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
222.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
222.32 + * respects for all of the code used other than the HL Engine and MODs
222.33 + * from Valve. If you modify this file, you may extend this exception
222.34 + * to your version of the file, but you are not obligated to do so. If
222.35 + * you do not wish to do so, delete this exception statement from your
222.36 + * version.
222.37 + *
222.38 + */
222.39 +
222.40 +#ifndef TRACE_API_H
222.41 +#define TRACE_API_H
222.42 +
222.43 +#include <time.h> // time()
222.44 +
222.45 +#include <enginecallback.h> // ALERT()
222.46 +#include <sdk_util.h> // UTIL_VarArgs()
222.47 +
222.48 +#include "api_info.h"
222.49 +
222.50 +#define API_TRACE(api_info_table, cvar_trace, api_str, pfnName, post, args) \
222.51 + do { if((cvar_trace->value >= api_info_table.pfnName.loglevel || api_info_table.pfnName.trace) && (unlimit_trace->value || (last_trace_log != time(NULL)))) { \
222.52 + ALERT(at_logged, "[%s] %s(%d): called: %s%s; %s\n", \
222.53 + Plugin_info.logtag, api_str, \
222.54 + api_info_table.pfnName.loglevel, \
222.55 + api_info_table.pfnName.name, \
222.56 + (post ? "_Post" : ""), \
222.57 + UTIL_VarArgs args ); \
222.58 + last_trace_log=time(NULL); \
222.59 + } \
222.60 + } while(0)
222.61 +
222.62 +#define DLL_TRACE(pfnName, post, args) \
222.63 + API_TRACE(dllapi_info, dllapi_trace, "dllapi", pfnName, post, args)
222.64 +
222.65 +#define NEWDLL_TRACE(pfnName, post, args) \
222.66 + API_TRACE(newapi_info, newapi_trace, "newapi", pfnName, post, args)
222.67 +
222.68 +#define ENGINE_TRACE(pfnName, post, args) \
222.69 + API_TRACE(engine_info, engine_trace, "engine", pfnName, post, args)
222.70 +
222.71 +typedef enum {
222.72 + TR_FAILURE = 0,
222.73 + TR_SUCCESS,
222.74 + TR_ALREADY,
222.75 +} TRACE_RESULT;
222.76 +
222.77 +#define MAX_REG_MESSAGES 256
222.78 +
222.79 +extern time_t last_trace_log;
222.80 +
222.81 +extern const char *msg_dest_types[32];
222.82 +
222.83 +extern cvar_t init_dllapi_trace;
222.84 +extern cvar_t init_newapi_trace;
222.85 +extern cvar_t init_engine_trace;
222.86 +extern cvar_t init_unlimit_trace;
222.87 +
222.88 +extern cvar_t *dllapi_trace;
222.89 +extern cvar_t *newapi_trace;
222.90 +extern cvar_t *engine_trace;
222.91 +extern cvar_t *unlimit_trace;
222.92 +
222.93 +void trace_init(void);
222.94 +
222.95 +void svr_trace(void);
222.96 +void cmd_trace_usage(void);
222.97 +void cmd_trace_version(void);
222.98 +void cmd_trace_set(void);
222.99 +void cmd_trace_unset(void);
222.100 +void cmd_trace_show(void);
222.101 +void cmd_trace_list(void);
222.102 +
222.103 +TRACE_RESULT trace_setflag(const char **pfn_string, mBOOL flagval, const char **api);
222.104 +
222.105 +#endif /* TRACE_API_H */
223.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
223.2 +++ b/trace_plugin/vdate.cpp Tue Apr 06 07:36:14 2004 +0000
223.3 @@ -0,0 +1,51 @@
223.4 +// vi: set ts=4 sw=4 :
223.5 +// vim: set tw=75 :
223.6 +
223.7 +// vdate.cpp - compile-time version date
223.8 +
223.9 +/*
223.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
223.11 + *
223.12 + * This file is part of Metamod.
223.13 + *
223.14 + * Metamod is free software; you can redistribute it and/or modify it
223.15 + * under the terms of the GNU General Public License as published by the
223.16 + * Free Software Foundation; either version 2 of the License, or (at
223.17 + * your option) any later version.
223.18 + *
223.19 + * Metamod is distributed in the hope that it will be useful, but
223.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
223.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
223.22 + * General Public License for more details.
223.23 + *
223.24 + * You should have received a copy of the GNU General Public License
223.25 + * along with Metamod; if not, write to the Free Software Foundation,
223.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
223.27 + *
223.28 + * In addition, as a special exception, the author gives permission to
223.29 + * link the code of this program with the Half-Life Game Engine ("HL
223.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
223.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
223.32 + * respects for all of the code used other than the HL Engine and MODs
223.33 + * from Valve. If you modify this file, you may extend this exception
223.34 + * to your version of the file, but you are not obligated to do so. If
223.35 + * you do not wish to do so, delete this exception statement from your
223.36 + * version.
223.37 + *
223.38 + */
223.39 +
223.40 +#include "info_name.h" // for VNAME, VVERSION, etc
223.41 +
223.42 +
223.43 +// Grab data/time of compile. The Makefile is set up to recompile this
223.44 +// module before each link, so that this will always indicate the time the
223.45 +// library was compiled and linked.
223.46 +
223.47 +// This is in a separate file from vers_*, so it can be generically used by
223.48 +// multiple projects.
223.49 +
223.50 +char const *COMPILE_TIME=__DATE__ ", " __TIME__;
223.51 +
223.52 +// Include a string for /usr/bin/ident.
223.53 +
223.54 +char const *vstring="$Pg: " VNAME " -- " VVERSION " | " __DATE__ " - " __TIME__ " $";
224.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
224.2 +++ b/wdmisc_plugin/Config.mak Tue Apr 06 07:36:14 2004 +0000
224.3 @@ -0,0 +1,10 @@
224.4 +MODNAME = wdmisc_mm
224.5 +
224.6 +EXTRA_CFLAGS =
224.7 +
224.8 +SRCFILES = dll_plugin.cpp engine_api.cpp h_export.cpp log_plugin.cpp \
224.9 + meta_api.cpp sdk_util.cpp vdate.cpp \
224.10 + wdmisc.cpp
224.11 +
224.12 +INFOFILES = info_name.h ../metamod/vers_meta.h
224.13 +RESFILE = res_meta.rc
225.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
225.2 +++ b/wdmisc_plugin/INFOcvs Tue Apr 06 07:36:14 2004 +0000
225.3 @@ -0,0 +1,8 @@
225.4 +The following files are ususally linked from the ../metamod
225.5 +directory. Since CVS does not allow symbolic links, these
225.6 +files have been copied here. It is to be considered to create
225.7 +links via a makefile or similar mechanism in the future.
225.8 +
225.9 +Makefile
225.10 +res_meta.rc
225.11 +sdk_util.cpp
226.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
226.2 +++ b/wdmisc_plugin/Makefile Tue Apr 06 07:36:14 2004 +0000
226.3 @@ -0,0 +1,380 @@
226.4 +# vi: set ts=4 sw=4 :
226.5 +# vim: set tw=75 :
226.6 +
226.7 +# MetaMod makefile
226.8 +# Copyright (c) 2001-2003 Will Day <[email protected]>
226.9 +#
226.10 +# based on the Valve SDK 2.1 Makefile as well as the Makefile
226.11 +# in adminmod by Alfred Reynolds.
226.12 +#
226.13 +# From SDK 2.1 dlls/Makefile:
226.14 +#! Half-Life StandardSDK 2.0 mp_i386.so Makefile for i386 Linux
226.15 +#! April 2000 by Leon Hartwig ([email protected])
226.16 +
226.17 +
226.18 +# NOTE: This is a generic Makefile for metamod and the bundled plugins, and
226.19 +# is symlinked into each subdir. Per-module config statements are in
226.20 +# Config.mak in each subdir.
226.21 +
226.22 +ifdef COMSPEC
226.23 + OS=windows
226.24 +else
226.25 + OS=linux
226.26 +endif
226.27 +
226.28 +#############################################################################
226.29 +# CONFIGURATION
226.30 +#############################################################################
226.31 +
226.32 +# set paths for your environment
226.33 +ifeq "$(OS)" "linux"
226.34 + PATH_WIN=/usr/local/cross-tools/i586-mingw32msvc/bin
226.35 + SDKTOP=$(HOME)/src/hl/hlsdk-2.3
226.36 + INST_DIR=$(HOME)/half-life/cstrike/dlls
226.37 + TEST_DIR=$(HOME)/test/tfc/dlls
226.38 + TST_DIR=$(HOME)/tmp
226.39 +else ## windows
226.40 + PATH_WIN=/gcc-2.95.2-msvcrt/bin
226.41 + SDKTOP=/hlsdk2.3
226.42 + INST_DIR=/hlserver/tfc/dlls
226.43 + TEST_DIR=/hlserver/tfc/dlls
226.44 +endif
226.45 +
226.46 +DLLS_DIR=../dlls
226.47 +SDKSRC=$(SDKTOP)/multiplayer
226.48 +METADIR=../metamod
226.49 +
226.50 +
226.51 +#############################################################################
226.52 +# OS DEPENDENCIES
226.53 +#############################################################################
226.54 +
226.55 +ifeq "$(OS)" "linux"
226.56 + INSTALL=install -m 644
226.57 + LD_WINDLL= PATH=$(PATH_WIN) $(PATH_WIN)/dllwrap
226.58 + TARGET=linux
226.59 + LIBFILE=$(LIBFILE_LINUX)
226.60 + TARGET_FILE=$(TARGET_LINUX)
226.61 +else ## windows
226.62 + INSTALL=cp
226.63 + LD_WINDLL= $(PATH_WIN)/dllwrap
226.64 + TARGET=win32
226.65 + LIBFILE=$(LIBFILE_WIN)
226.66 + TARGET_FILE=$(TARGET_WIN)
226.67 +endif
226.68 +
226.69 +CC_WIN=$(PATH_WIN)/gcc
226.70 +RES_WIN=$(PATH_WIN)/windres
226.71 +OBJDIR_LINUX_OPT=opt.linux
226.72 +OBJDIR_WIN_OPT=opt.win32
226.73 +OBJDIR_LINUX_DBG=debug.linux
226.74 +OBJDIR_WIN_DBG=debug.win32
226.75 +
226.76 +
226.77 +#############################################################################
226.78 +# COMPILE OPTIONS
226.79 +#############################################################################
226.80 +
226.81 +# original safe optimization, from valve Makefile
226.82 +#CCOPT = -O2 -ffast-math -funroll-loops \
226.83 +# -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
226.84 +# -malign-jumps=2 -malign-functions=2
226.85 +
226.86 +# safe optimization, adapted from adminmod Makefile
226.87 +#CCOPT = -m486 -O6 -ffast-math -funroll-loops \
226.88 +# -fexpensive-optimizations -malign-loops=2 -malign-jumps=2 \
226.89 +# -malign-functions=2 -Wall
226.90 +
226.91 +# full optimization, adapted from adminmod Makefile
226.92 +# "WONT WORK WITH omit-frame-pointer"?
226.93 +# - disable (unneeded) C++ exceptions and rtti code to save some space ?
226.94 +CCOPT = -march=i586 $(CCO) -ffast-math -funroll-loops \
226.95 + -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
226.96 + -malign-jumps=2 -malign-functions=2 -fno-exceptions -fno-rtti -s
226.97 +
226.98 +# optimization level; overridden for certain problematic files
226.99 +CCO = -O6
226.100 +
226.101 +# debugging; halt on warnings
226.102 +CCDEBUG+= -ggdb3
226.103 +
226.104 +
226.105 +#############################################################################
226.106 +# COMPILE SETUP
226.107 +#############################################################################
226.108 +
226.109 +CC=gcc-2.95
226.110 +
226.111 +SRCDIR=.
226.112 +INCLUDEDIRS=-I$(SRCDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/pm_shared -I$(SDKSRC)/dlls -I$(SDKSRC)
226.113 +FILES_ALL = *.cpp *.h [A-Z]* *.rc
226.114 +
226.115 +CFLAGS=-Wall -Wno-unknown-pragmas
226.116 +#CFLAGS += -DTEST
226.117 +
226.118 +ifeq "$(USER)" "willday"
226.119 + # extra warnings
226.120 + CFLAGS+=-W -Wundef \
226.121 + -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align \
226.122 + -Wconversion -Wsign-compare \
226.123 + -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \
226.124 + -Wmissing-noreturn -Wnested-externs -Winline \
226.125 + -Wlong-long
226.126 + # extra C++ warnings
226.127 + CFLAGS+=-Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder \
226.128 + -Woverloaded-virtual -Wsign-promo -Wsynth -Weffc++
226.129 + # undesired warnings
226.130 + #CFLAGS+=-pedantic -Waggregate-return -Wredundant-decls -Wtraditional
226.131 + # to help debugging; requires edited SDK
226.132 + CCDEBUG+=-Werror
226.133 + # link against older libc for compatibility
226.134 + EXTRA_LINK = -L../priv/libc -lc
226.135 +endif
226.136 +
226.137 +ifeq "$(OPT)" "opt"
226.138 + ODEF = -DOPT_TYPE=\"optimized\"
226.139 + CFLAGS := $(CCOPT) $(CFLAGS) $(ODEF)
226.140 + OBJDIR_LINUX = $(OBJDIR_LINUX_OPT)
226.141 + OBJDIR_WIN = $(OBJDIR_WIN_OPT)
226.142 +else # debug
226.143 + ODEF = -DOPT_TYPE=\"debugging\"
226.144 + CFLAGS := $(CCDEBUG) $(CFLAGS) $(ODEF)
226.145 + OBJDIR_LINUX = $(OBJDIR_LINUX_DBG)
226.146 + OBJDIR_WIN = $(OBJDIR_WIN_DBG)
226.147 + DLLS_DIR := $(DLLS_DIR)/debug
226.148 +endif
226.149 +
226.150 +include Config.mak
226.151 +# any local CFLAGS from Config.mak
226.152 +CFLAGS += $(EXTRA_CFLAGS)
226.153 +
226.154 +# ignore complaints from SDK files like cbase.h
226.155 +$(OBJDIR_LINUX)/sdk_util.o $(OBJDIR_WIN)/sdk_util.o: CFLAGS += -Wno-unused
226.156 +
226.157 +# ignore complaints from STL headers
226.158 +STLOBJ = $(STLFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
226.159 +STLOBJ += $(STLFILES:%.cpp=$(OBJDIR_WIN)/%.o)
226.160 +#$(OBJDIR_LINUX)/mreg.o $(OBJDIR_WIN)/mreg.o: CFLAGS += -Wno-effc++
226.161 +$(STLOBJ): FILTER= 2>&1 | ../tools/stlfilter
226.162 +$(STLOBJ): CFLAGS += -Wno-error
226.163 +
226.164 +# these files seem to create "Internal compiler error" errors under mingw
226.165 +# when using -O6
226.166 +#$(OBJDIR_WIN)/engine_api.o: CCO = -O5
226.167 +#$(OBJDIR_WIN)/dllapi_api.o: CCO = -O5
226.168 +
226.169 +#############################################################################
226.170 +# BUILDING LINUX SO
226.171 +#############################################################################
226.172 +
226.173 +# linux .so compile commands
226.174 +DO_CC_LINUX=$(CC) $(CFLAGS) -fPIC $(INCLUDEDIRS) -o $@ -c $< $(FILTER)
226.175 +LINK_LINUX=$(CC) $(CFLAGS) -shared -ldl -lm $(EXTRA_LINK) $(OBJ_LINUX) -o $@
226.176 +
226.177 +# sort by date
226.178 +ifeq "$(OS)" "linux"
226.179 +SRCFILES := $(shell ls -t $(SRCFILES))
226.180 +endif
226.181 +# linux object files
226.182 +OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
226.183 +
226.184 +# compiling linux object files
226.185 +$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.cpp
226.186 + $(DO_CC_LINUX)
226.187 +
226.188 +# linux .so target file
226.189 +LIBFILE_LINUX = $(MODNAME)_i386.so
226.190 +TARGET_LINUX = $(OBJDIR_LINUX)/$(LIBFILE_LINUX)
226.191 +
226.192 +
226.193 +#############################################################################
226.194 +# BUILDING WINDOWS DLL
226.195 +#############################################################################
226.196 +
226.197 +# windows .dll compile commands
226.198 +DO_CC_WIN=$(CC_WIN) $(CFLAGS) $(INCLUDEDIRS) -o $@ -c $<
226.199 +DO_RES_WIN=$(RES_WIN) '$(ODEF)' --include-dir . --include-dir ../metamod -i $< -O coff -o $@
226.200 +#LINK_WIN=$(LD_WINDLL) -k -mwindows --add-stdcall-alias --def metamod.def -o $@ $(OBJ_WIN)
226.201 +#LINK_WIN=$(LD_WINDLL) -A -k -mwindows --export-all-symbols -o $@ $(OBJ_WIN)
226.202 +LINK_WIN=$(LD_WINDLL) -mwindows --add-stdcall-alias $(OBJ_WIN) $(RES_OBJ_WIN) -o $@
226.203 +
226.204 +# windows object files
226.205 +OBJ_WIN := $(SRCFILES:%.cpp=$(OBJDIR_WIN)/%.o)
226.206 +RES_OBJ_WIN := $(RESFILE:%.rc=$(OBJDIR_WIN)/%.o)
226.207 +
226.208 +# compiling windows object files
226.209 +$(OBJDIR_WIN)/%.o: $(SRCDIR)/%.cpp
226.210 + $(DO_CC_WIN)
226.211 +
226.212 +# compiling windows resource file
226.213 +$(OBJDIR_WIN)/%.o: $(SRCDIR)/%.rc $(INFOFILES)
226.214 + $(DO_RES_WIN)
226.215 +
226.216 +# windows .dll target file
226.217 +LIBFILE_WIN = $(MODNAME).dll
226.218 +TARGET_WIN = $(OBJDIR_WIN)/$(LIBFILE_WIN)
226.219 +
226.220 +
226.221 +#############################################################################
226.222 +# OVERRIDES
226.223 +#############################################################################
226.224 +
226.225 +ifeq "$(PLATFORM)" "linux-only"
226.226 + LIBFILE_WIN =
226.227 + TARGET_WIN =
226.228 +endif
226.229 +ifeq "$(PLATFORM)" "win32-only"
226.230 + LIBFILE_LINUX =
226.231 + TARGET_LINUX =
226.232 + TARGET=win32
226.233 + LIBFILE=$(LIBFILE_WIN)
226.234 + TARGET_FILE=$(TARGET_WIN)
226.235 +endif
226.236 +
226.237 +
226.238 +#############################################################################
226.239 +# BUILD RULES
226.240 +#############################################################################
226.241 +
226.242 +default: $(TARGET_FILE)
226.243 +
226.244 +ifeq "$(USER)" "willday"
226.245 +include ../priv/metamod.mak
226.246 +endif
226.247 +
226.248 +all: do_dll_linux do_dll_win32
226.249 +
226.250 +opt:
226.251 + $(MAKE) default OPT=opt
226.252 +
226.253 +linux: do_dll_linux
226.254 +win32: do_dll_win32
226.255 +
226.256 +linux_opt:
226.257 + $(MAKE) linux OPT=opt
226.258 +win32_opt:
226.259 + $(MAKE) win32 OPT=opt
226.260 +
226.261 +$(TARGET_LINUX): msgs/debug msgs/log msgs/error $(OBJDIR_LINUX) $(OBJ_LINUX)
226.262 + $(LINK_LINUX)
226.263 +
226.264 +# for plugins, recompile meta_api.cpp if info_name.h changed
226.265 +$(OBJDIR_LINUX)/meta_api.o $(OBJDIR_WIN)/meta_api.o: info_name.h
226.266 +
226.267 +ifeq "$(USER)" "willday"
226.268 +$(TARGET_LINUX): .tags .htags
226.269 +endif
226.270 +
226.271 +$(TARGET_WIN): $(OBJDIR_WIN) $(OBJ_WIN) $(RES_OBJ_WIN)
226.272 + $(LINK_WIN)
226.273 +
226.274 +$(OBJDIR_LINUX) $(OBJDIR_WIN) msgs:
226.275 + mkdir $@
226.276 +
226.277 +# make sure to recompile vdate.c for each link
226.278 +$(OBJDIR_LINUX)/vdate.o $(OBJDIR_WIN)/vdate.o : $(SRCFILES) *.h
226.279 +
226.280 +domsgs: msgs/debug msgs/log msgs/error
226.281 +
226.282 +msgs/debug: $(SRCFILES) *.h msgs
226.283 + egrep "DEBUG\([0-9]" $(SRCFILES) *.h | sed "s/:[ ]*/ /" | sort -k2,2 > $@
226.284 +
226.285 +msgs/log: $(SRCFILES) *.h msgs
226.286 + egrep "META_LOG\(" $(SRCFILES) *.h | sed "s/:[ ]*/ /" | sort > $@
226.287 +
226.288 +msgs/error: $(SRCFILES) *.h msgs
226.289 + egrep "META_ERROR\(" $(SRCFILES) *.h | sed "s/:[ ]*/ /" | sort > $@
226.290 +
226.291 +tags: .tags .htags
226.292 +ctags: .tags
226.293 +htags: .htags
226.294 +
226.295 +.tags: $(SRCFILES) *.h
226.296 + -ctags -a $?
226.297 +
226.298 +.htags: *.h
226.299 + -htags $?
226.300 +
226.301 +retags:
226.302 + -rm -f .tags .htags
226.303 + ctags -f .tags `find $(SDKSRC) -name '*.h'`
226.304 + ctags -f .tags -a `find $(METADIR) -name old -prune -o -name '*.h' -print`
226.305 + ctags -f .tags -a $(SRCFILES)
226.306 + htags -R $(SDKSRC)
226.307 + htags `find $(METADIR) -name old -prune -o -name '*.h' -print`
226.308 + htags *.h
226.309 +
226.310 +clean: clean_$(TARGET)
226.311 +
226.312 +clean_linux:
226.313 + test -n "$(OBJDIR_LINUX)"
226.314 + -rm -f $(OBJDIR_LINUX)/*
226.315 +
226.316 +clean_win32:
226.317 + test -n "$(OBJDIR_WIN)"
226.318 + -rm -f $(OBJDIR_WIN)/*
226.319 +
226.320 +cleanall_linux:
226.321 + $(MAKE) clean_linux
226.322 + $(MAKE) clean_linux OPT=opt
226.323 +
226.324 +cleanall_win32:
226.325 + $(MAKE) clean_win32
226.326 + $(MAKE) clean_win32 OPT=opt
226.327 +
226.328 +cleanall: cleanall_linux cleanall_win32
226.329 +
226.330 +dll_linux dll_win32:
226.331 + $(MAKE) do_$@
226.332 + $(MAKE) do_$@ OPT=opt
226.333 +
226.334 +do_dll_linux: $(DLLS_DIR) $(DLLS_DIR)/$(LIBFILE_LINUX)
226.335 +do_dll_win32: $(DLLS_DIR) $(DLLS_DIR)/$(LIBFILE_WIN)
226.336 +
226.337 +$(DLLS_DIR):
226.338 + mkdir $(DLLS_DIR)
226.339 +
226.340 +$(DLLS_DIR)/$(LIBFILE_LINUX): $(TARGET_LINUX)
226.341 + $(INSTALL) $+ $@
226.342 +
226.343 +$(DLLS_DIR)/$(LIBFILE_WIN): $(TARGET_WIN)
226.344 + $(INSTALL) $+ $@
226.345 +
226.346 +dlls: dll_linux dll_win32
226.347 +rmdlls:
226.348 + -rm -f ../dlls/*.* ../dlls/debug/*.*
226.349 +
226.350 +spotless: cleanall
226.351 + -rmdir $(OBJDIR_LINUX) $(OBJDIR_WIN)
226.352 + -rm -f .snap $(GENERATED)
226.353 +
226.354 +distclean: spotless
226.355 +
226.356 +install: $(INST_DIR)/$(LIBFILE)
226.357 +test: $(TEST_DIR)/$(LIBFILE)
226.358 +test_opt:
226.359 + $(MAKE) test OPT=opt
226.360 +
226.361 +$(INST_DIR)/$(LIBFILE) $(TEST_DIR)/$(LIBFILE): $(TARGET_FILE)
226.362 + $(INSTALL) $< $@
226.363 +
226.364 +tst: $(TST_DIR)/$(LIBFILE_WIN)
226.365 +
226.366 +$(TST_DIR)/$(LIBFILE_WIN): $(TARGET_WIN)
226.367 + cp $< $@
226.368 +
226.369 +snap: .snap
226.370 +
226.371 +.snap: $(FILES_ALL)
226.372 + mkdir -p snapshots
226.373 + tar zcvf snapshots/`date '+%m%d-%H%M'`.tgz $(FILES_ALL)
226.374 + touch .snap
226.375 +
226.376 +depend: Rules.depend
226.377 +
226.378 +ifeq "$(OS)" "linux"
226.379 +Rules.depend: $(SRCFILES)
226.380 + $(CC) -MM $(INCLUDEDIRS) $(SRCFILES) | sed "s;\(^[^ ]*\):\(.*\);$(OBJDIR_LINUX)/\1 $(OBJDIR_WIN)/\1: \2;" > $@
226.381 +endif
226.382 +
226.383 +include Rules.depend
227.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
227.2 +++ b/wdmisc_plugin/Rules.depend Tue Apr 06 07:36:14 2004 +0000
227.3 @@ -0,0 +1,15 @@
227.4 +debug.linux/meta_api.o debug.win32/meta_api.o: meta_api.cpp plugin.h info_name.h ../metamod/vers_meta.h \
227.5 + log_plugin.h
227.6 +debug.linux/vdate.o debug.win32/vdate.o: vdate.cpp info_name.h ../metamod/vers_meta.h
227.7 +debug.linux/wdmisc.o debug.win32/wdmisc.o: wdmisc.cpp wdmisc.h plugin.h log_plugin.h
227.8 +debug.linux/log_plugin.o debug.win32/log_plugin.o: log_plugin.cpp log_plugin.h plugin.h
227.9 +debug.linux/dll_plugin.o debug.win32/dll_plugin.o: dll_plugin.cpp wdmisc.h dll_plugin.h log_plugin.h \
227.10 + plugin.h
227.11 +debug.linux/engine_api.o debug.win32/engine_api.o: engine_api.cpp ../metamod/engine_api.h \
227.12 + ../metamod/meta_api.h ../metamod/dllapi.h ../metamod/sdk_util.h \
227.13 + ../metamod/osdep.h ../metamod/types_meta.h ../metamod/mreg.h \
227.14 + ../metamod/log_meta.h ../metamod/plinfo.h ../metamod/mutil.h \
227.15 + ../metamod/mhook.h log_plugin.h plugin.h
227.16 +debug.linux/sdk_util.o debug.win32/sdk_util.o: sdk_util.cpp ../metamod/sdk_util.h ../metamod/osdep.h \
227.17 + ../metamod/types_meta.h ../metamod/mreg.h ../metamod/log_meta.h
227.18 +debug.linux/h_export.o debug.win32/h_export.o: h_export.cpp
228.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
228.2 +++ b/wdmisc_plugin/dll_plugin.cpp Tue Apr 06 07:36:14 2004 +0000
228.3 @@ -0,0 +1,134 @@
228.4 +// vi: set ts=4 sw=4 :
228.5 +// vim: set tw=75 :
228.6 +
228.7 +// dll_plugin.cpp - implementation of plugin's HL DLL routines
228.8 +
228.9 +/*
228.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
228.11 + *
228.12 + * This file is part of Metamod.
228.13 + *
228.14 + * Metamod is free software; you can redistribute it and/or modify it
228.15 + * under the terms of the GNU General Public License as published by the
228.16 + * Free Software Foundation; either version 2 of the License, or (at
228.17 + * your option) any later version.
228.18 + *
228.19 + * Metamod is distributed in the hope that it will be useful, but
228.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
228.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
228.22 + * General Public License for more details.
228.23 + *
228.24 + * You should have received a copy of the GNU General Public License
228.25 + * along with Metamod; if not, write to the Free Software Foundation,
228.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
228.27 + *
228.28 + * In addition, as a special exception, the author gives permission to
228.29 + * link the code of this program with the Half-Life Game Engine ("HL
228.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
228.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
228.32 + * respects for all of the code used other than the HL Engine and MODs
228.33 + * from Valve. If you modify this file, you may extend this exception
228.34 + * to your version of the file, but you are not obligated to do so. If
228.35 + * you do not wish to do so, delete this exception statement from your
228.36 + * version.
228.37 + *
228.38 + */
228.39 +
228.40 +#include <extdll.h>
228.41 +#include <sdk_util.h>
228.42 +
228.43 +#include <meta_api.h>
228.44 +#include <sdk_util.h>
228.45 +
228.46 +#include "wdmisc.h"
228.47 +#include "dll_plugin.h"
228.48 +#include "log_plugin.h"
228.49 +
228.50 +void wd_ServerDeactivate( void ) {
228.51 + bounce_check();
228.52 + RETURN_META(MRES_HANDLED);
228.53 +}
228.54 +
228.55 +static DLL_FUNCTIONS gFunctionTable =
228.56 +{
228.57 + NULL, //! pfnGameInit()
228.58 + NULL, //! pfnSpawn()
228.59 + NULL, //! pfnThink()
228.60 + NULL, //! pfnUse()
228.61 + NULL, //! pfnTouch()
228.62 + NULL, //! pfnBlocked()
228.63 + NULL, //! pfnKeyValue()
228.64 + NULL, //! pfnSave()
228.65 + NULL, //! pfnRestore()
228.66 + NULL, //! pfnSetAbsBox()
228.67 +
228.68 + NULL, //! pfnSaveWriteFields()
228.69 + NULL, //! pfnSaveReadFields()
228.70 +
228.71 + NULL, //! pfnSaveGlobalState()
228.72 + NULL, //! pfnRestoreGlobalState()
228.73 + NULL, //! pfnResetGlobalState()
228.74 +
228.75 + NULL, //! pfnClientConnect()
228.76 + NULL, //! pfnClientDisconnect()
228.77 + NULL, //! pfnClientKill()
228.78 + NULL, //! pfnClientPutInServer()
228.79 + NULL, //! pfnClientCommand()
228.80 + NULL, //! pfnClientUserInfoChanged()
228.81 + NULL, //! pfnServerActivate()
228.82 + wd_ServerDeactivate, //! pfnServerDeactivate()
228.83 +
228.84 + NULL, //! pfnPlayerPreThink()
228.85 + NULL, //! pfnPlayerPostThink()
228.86 +
228.87 + NULL, //! pfnStartFrame()
228.88 + NULL, //! pfnParmsNewLevel()
228.89 + NULL, //! pfnParmsChangeLevel()
228.90 +
228.91 + NULL, //! pfnGetGameDescription()
228.92 + NULL, //! pfnPlayerCustomization()
228.93 +
228.94 + NULL, //! pfnSpectatorConnect()
228.95 + NULL, //! pfnSpectatorDisconnect()
228.96 + NULL, //! pfnSpectatorThink()
228.97 +
228.98 + NULL, //! pfnSys_Error()
228.99 +
228.100 + NULL, //! pfnPM_Move()
228.101 + NULL, //! pfnPM_Init()
228.102 + NULL, //! pfnPM_FindTextureType()
228.103 +
228.104 + NULL, //! pfnSetupVisibility()
228.105 + NULL, //! pfnUpdateClientData()
228.106 + NULL, //! pfnAddToFullPack()
228.107 + NULL, //! pfnCreateBaseline()
228.108 + NULL, //! pfnRegisterEncoders()
228.109 + NULL, //! pfnGetWeaponData()
228.110 + NULL, //! pfnCmdStart()
228.111 + NULL, //! pfnCmdEnd()
228.112 + NULL, //! pfnConnectionlessPacket()
228.113 + NULL, //! pfnGetHullBounds()
228.114 + NULL, //! pfnCreateInstancedBaselines()
228.115 + NULL, //! pfnInconsistentFile()
228.116 + NULL, //! pfnAllowLagCompensation()
228.117 +};
228.118 +
228.119 +C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable,
228.120 + int *interfaceVersion)
228.121 +{
228.122 + LOG_DEVELOPER(PLID, "called: GetEntityAPI2; version=%d", *interfaceVersion);
228.123 + if(!pFunctionTable) {
228.124 + LOG_ERROR(PLID, "GetEntityAPI2 called with null pFunctionTable");
228.125 + return(FALSE);
228.126 + }
228.127 + else if(*interfaceVersion != INTERFACE_VERSION) {
228.128 + LOG_ERROR(PLID, "GetEntityAPI2 version mismatch; requested=%d ours=%d",
228.129 + *interfaceVersion, INTERFACE_VERSION);
228.130 + //! Tell engine what version we had, so it can figure out who is
228.131 + //! out of date.
228.132 + *interfaceVersion = INTERFACE_VERSION;
228.133 + return(FALSE);
228.134 + }
228.135 + memcpy(pFunctionTable, &gFunctionTable, sizeof(DLL_FUNCTIONS));
228.136 + return(TRUE);
228.137 +}
229.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
229.2 +++ b/wdmisc_plugin/dll_plugin.h Tue Apr 06 07:36:14 2004 +0000
229.3 @@ -0,0 +1,45 @@
229.4 +// vi: set ts=4 sw=4 :
229.5 +// vim: set tw=75 :
229.6 +
229.7 +// dll_plugin.h - prototypes and typedefs plugin's HL DLL routines
229.8 +
229.9 +/*
229.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
229.11 + *
229.12 + * This file is part of Metamod.
229.13 + *
229.14 + * Metamod is free software; you can redistribute it and/or modify it
229.15 + * under the terms of the GNU General Public License as published by the
229.16 + * Free Software Foundation; either version 2 of the License, or (at
229.17 + * your option) any later version.
229.18 + *
229.19 + * Metamod is distributed in the hope that it will be useful, but
229.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
229.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
229.22 + * General Public License for more details.
229.23 + *
229.24 + * You should have received a copy of the GNU General Public License
229.25 + * along with Metamod; if not, write to the Free Software Foundation,
229.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
229.27 + *
229.28 + * In addition, as a special exception, the author gives permission to
229.29 + * link the code of this program with the Half-Life Game Engine ("HL
229.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
229.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
229.32 + * respects for all of the code used other than the HL Engine and MODs
229.33 + * from Valve. If you modify this file, you may extend this exception
229.34 + * to your version of the file, but you are not obligated to do so. If
229.35 + * you do not wish to do so, delete this exception statement from your
229.36 + * version.
229.37 + *
229.38 + */
229.39 +
229.40 +#ifndef DLL_PLUGIN_H
229.41 +#define DLL_PLUGIN_H
229.42 +
229.43 +#include <sdk_util.h> // BOOL
229.44 +#include <dllapi.h> // FN_*
229.45 +
229.46 +void wd_ServerDeactivate(void);
229.47 +
229.48 +#endif /* DLL_PLUGIN_H */
230.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
230.2 +++ b/wdmisc_plugin/engine_api.cpp Tue Apr 06 07:36:14 2004 +0000
230.3 @@ -0,0 +1,69 @@
230.4 +// vi: set ts=4 sw=4 :
230.5 +// vim: set tw=75 :
230.6 +
230.7 +// engine_api.cpp - implementation of Half-Life engine functions
230.8 +
230.9 +/*
230.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
230.11 + *
230.12 + * This file is part of Metamod.
230.13 + *
230.14 + * Metamod is free software; you can redistribute it and/or modify it
230.15 + * under the terms of the GNU General Public License as published by the
230.16 + * Free Software Foundation; either version 2 of the License, or (at
230.17 + * your option) any later version.
230.18 + *
230.19 + * Metamod is distributed in the hope that it will be useful, but
230.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
230.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
230.22 + * General Public License for more details.
230.23 + *
230.24 + * You should have received a copy of the GNU General Public License
230.25 + * along with Metamod; if not, write to the Free Software Foundation,
230.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
230.27 + *
230.28 + * In addition, as a special exception, the author gives permission to
230.29 + * link the code of this program with the Half-Life Game Engine ("HL
230.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
230.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
230.32 + * respects for all of the code used other than the HL Engine and MODs
230.33 + * from Valve. If you modify this file, you may extend this exception
230.34 + * to your version of the file, but you are not obligated to do so. If
230.35 + * you do not wish to do so, delete this exception statement from your
230.36 + * version.
230.37 + *
230.38 + */
230.39 +
230.40 +#include <stdio.h>
230.41 +#include <stdarg.h>
230.42 +
230.43 +#include <extdll.h>
230.44 +
230.45 +#include "engine_api.h"
230.46 +#include "meta_api.h"
230.47 +#include "log_plugin.h"
230.48 +
230.49 +enginefuncs_t meta_engfuncs;
230.50 +
230.51 +C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine,
230.52 + int *interfaceVersion)
230.53 +{
230.54 + LOG_DEVELOPER(PLID, "called: GetEngineFunctions; version=%d",
230.55 + *interfaceVersion);
230.56 + if(!pengfuncsFromEngine) {
230.57 + LOG_ERROR(PLID,
230.58 + "GetEngineFunctions called with null pengfuncsFromEngine");
230.59 + return(FALSE);
230.60 + }
230.61 + else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) {
230.62 + LOG_ERROR(PLID,
230.63 + "GetEngineFunctions version mismatch; requested=%d ours=%d",
230.64 + *interfaceVersion, ENGINE_INTERFACE_VERSION);
230.65 + // Tell metamod what version we had, so it can figure out who is
230.66 + // out of date.
230.67 + *interfaceVersion = ENGINE_INTERFACE_VERSION;
230.68 + return(FALSE);
230.69 + }
230.70 + memcpy(pengfuncsFromEngine, &meta_engfuncs, sizeof(enginefuncs_t));
230.71 + return TRUE;
230.72 +}
231.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
231.2 +++ b/wdmisc_plugin/h_export.cpp Tue Apr 06 07:36:14 2004 +0000
231.3 @@ -0,0 +1,49 @@
231.4 +// vi: set ts=4 sw=4 :
231.5 +// vim: set tw=75 :
231.6 +
231.7 +// h_export.cpp - main exported DLL functionality
231.8 +
231.9 +// From SDK dlls/h_export.cpp:
231.10 +
231.11 +/***
231.12 +*
231.13 +* Copyright (c) 1999, 2000 Valve LLC. All rights reserved.
231.14 +*
231.15 +* This product contains software technology licensed from Id
231.16 +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
231.17 +* All Rights Reserved.
231.18 +*
231.19 +* Use, distribution, and modification of this source code and/or resulting
231.20 +* object code is restricted to non-commercial enhancements to products from
231.21 +* Valve LLC. All other use, distribution, or modification is prohibited
231.22 +* without written permission from Valve LLC.
231.23 +*
231.24 +****/
231.25 +/*
231.26 +
231.27 +===== h_export.cpp ========================================================
231.28 +
231.29 + Entity classes exported by Halflife.
231.30 +
231.31 +*/
231.32 +
231.33 +#include <extdll.h>
231.34 +
231.35 +#include <h_export.h>
231.36 +#include <meta_api.h>
231.37 +
231.38 +//! Holds engine functionality callbacks
231.39 +enginefuncs_t g_engfuncs;
231.40 +globalvars_t *gpGlobals;
231.41 +
231.42 +// Receive engine function table from engine.
231.43 +// This appears to be the _first_ DLL routine called by the engine, so we
231.44 +// do some setup operations here.
231.45 +void WINAPI GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals )
231.46 +{
231.47 + memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t));
231.48 + gpGlobals = pGlobals;
231.49 + // NOTE! Have to call logging function _after_ copying into g_engfuncs, so
231.50 + // that g_engfuncs.pfnAlertMessage() can be resolved properly, heh. :)
231.51 + UTIL_LogPrintf("[%s] dev: called: GiveFnptrsToDll\n", Plugin_info.logtag);
231.52 +}
232.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
232.2 +++ b/wdmisc_plugin/info_name.h Tue Apr 06 07:36:14 2004 +0000
232.3 @@ -0,0 +1,54 @@
232.4 +// vi: set ts=4 sw=4 :
232.5 +// vim: set tw=75 :
232.6 +
232.7 +// info_name.h - name, desc, author, etc
232.8 +
232.9 +/*
232.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
232.11 + *
232.12 + * This file is part of Metamod.
232.13 + *
232.14 + * Metamod is free software; you can redistribute it and/or modify it
232.15 + * under the terms of the GNU General Public License as published by the
232.16 + * Free Software Foundation; either version 2 of the License, or (at
232.17 + * your option) any later version.
232.18 + *
232.19 + * Metamod is distributed in the hope that it will be useful, but
232.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
232.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
232.22 + * General Public License for more details.
232.23 + *
232.24 + * You should have received a copy of the GNU General Public License
232.25 + * along with Metamod; if not, write to the Free Software Foundation,
232.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
232.27 + *
232.28 + * In addition, as a special exception, the author gives permission to
232.29 + * link the code of this program with the Half-Life Game Engine ("HL
232.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
232.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
232.32 + * respects for all of the code used other than the HL Engine and MODs
232.33 + * from Valve. If you modify this file, you may extend this exception
232.34 + * to your version of the file, but you are not obligated to do so. If
232.35 + * you do not wish to do so, delete this exception statement from your
232.36 + * version.
232.37 + *
232.38 + */
232.39 +
232.40 +#ifndef INFO_NAME_H
232.41 +#define INFO_NAME_H
232.42 +
232.43 +#include "vers_meta.h" // VDATE, VVERSION, etc
232.44 +
232.45 +#define VNAME "WD Misc Functions"
232.46 +#define VAUTHOR "Will Day <[email protected]>"
232.47 +#define VURL "http://www.metamod.org/"
232.48 +#define VLOGTAG "WDMISC"
232.49 +
232.50 +// Various strings for the Windows DLL Resources in res_plugin.rc
232.51 +#define RC_COMMENTS "Adds various server functions. Requires Metamod; see " VURL
232.52 +#define RC_DESC "WDMisc Metamod Plugin DLL"
232.53 +#define RC_FILENAME "WDMISC_MM.DLL"
232.54 +#define RC_INTERNAL "WDMISC_MM"
232.55 +#define RC_COPYRIGHT "Copyright� 2001-2003 Will Day; licensed under the GPL"
232.56 +
232.57 +#endif /* INFO_NAME_H */
233.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
233.2 +++ b/wdmisc_plugin/log_plugin.cpp Tue Apr 06 07:36:14 2004 +0000
233.3 @@ -0,0 +1,64 @@
233.4 +// vi: set ts=4 sw=4 :
233.5 +// vim: set tw=75 :
233.6 +
233.7 +// log_plugin.cpp - generic/common logging routines for plugin codebases
233.8 +
233.9 +/*
233.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
233.11 + *
233.12 + * This file is part of Metamod.
233.13 + *
233.14 + * Metamod is free software; you can redistribute it and/or modify it
233.15 + * under the terms of the GNU General Public License as published by the
233.16 + * Free Software Foundation; either version 2 of the License, or (at
233.17 + * your option) any later version.
233.18 + *
233.19 + * Metamod is distributed in the hope that it will be useful, but
233.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
233.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
233.22 + * General Public License for more details.
233.23 + *
233.24 + * You should have received a copy of the GNU General Public License
233.25 + * along with Metamod; if not, write to the Free Software Foundation,
233.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
233.27 + *
233.28 + * In addition, as a special exception, the author gives permission to
233.29 + * link the code of this program with the Half-Life Game Engine ("HL
233.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
233.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
233.32 + * respects for all of the code used other than the HL Engine and MODs
233.33 + * from Valve. If you modify this file, you may extend this exception
233.34 + * to your version of the file, but you are not obligated to do so. If
233.35 + * you do not wish to do so, delete this exception statement from your
233.36 + * version.
233.37 + *
233.38 + */
233.39 +
233.40 +#include <stdio.h> // vsnprintf(), etc
233.41 +#include <stdarg.h> // va_start(), etc
233.42 +
233.43 +#include <extdll.h>
233.44 +#include <enginecallback.h> // ALERT()
233.45 +
233.46 +#include <meta_api.h>
233.47 +#include <support_meta.h>
233.48 +
233.49 +#include "log_plugin.h"
233.50 +#include "plugin.h"
233.51 +
233.52 +cvar_t *plugin_debug;
233.53 +
233.54 +// Setup for logging. We pass the name of the debug cvar so that this
233.55 +// code can be used by multiple different plugins.
233.56 +void log_init(const char *cvarname) {
233.57 + CVAR_REGISTER(&init_plugin_debug);
233.58 + // Since metamod replaces our cvar_t structure with a structure local
233.59 + // to metamod when we call CVAR_REGISTER, we have to get the address of
233.60 + // the new struct if we expect to be able to read/write directly to
233.61 + // the cvar struct.
233.62 + plugin_debug=CVAR_GET_POINTER(cvarname);
233.63 + // Since we haven't read server.cfg yet, allow debug logging (level 3)
233.64 + // to be enabled with the "+developer" cmdline option.
233.65 + if((int) CVAR_GET_FLOAT("developer") != 0)
233.66 + CVAR_SET_FLOAT(cvarname, 3);
233.67 +}
234.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
234.2 +++ b/wdmisc_plugin/log_plugin.h Tue Apr 06 07:36:14 2004 +0000
234.3 @@ -0,0 +1,59 @@
234.4 +// vi: set ts=4 sw=4 :
234.5 +// vim: set tw=75 :
234.6 +
234.7 +// log_plugin.h - generic/common logging routines/macros for plugin codebases
234.8 +
234.9 +/*
234.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
234.11 + *
234.12 + * This file is part of Metamod.
234.13 + *
234.14 + * Metamod is free software; you can redistribute it and/or modify it
234.15 + * under the terms of the GNU General Public License as published by the
234.16 + * Free Software Foundation; either version 2 of the License, or (at
234.17 + * your option) any later version.
234.18 + *
234.19 + * Metamod is distributed in the hope that it will be useful, but
234.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
234.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
234.22 + * General Public License for more details.
234.23 + *
234.24 + * You should have received a copy of the GNU General Public License
234.25 + * along with Metamod; if not, write to the Free Software Foundation,
234.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
234.27 + *
234.28 + * In addition, as a special exception, the author gives permission to
234.29 + * link the code of this program with the Half-Life Game Engine ("HL
234.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
234.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
234.32 + * respects for all of the code used other than the HL Engine and MODs
234.33 + * from Valve. If you modify this file, you may extend this exception
234.34 + * to your version of the file, but you are not obligated to do so. If
234.35 + * you do not wish to do so, delete this exception statement from your
234.36 + * version.
234.37 + *
234.38 + */
234.39 +
234.40 +#ifndef LOG_PLUGIN_H
234.41 +#define LOG_PLUGIN_H
234.42 +
234.43 +#include <enginecallback.h> // ALERT()
234.44 +#include <sdk_util.h> // UTIL_VarArgs()
234.45 +
234.46 +#include <api_info.h>
234.47 +#include "plugin.h"
234.48 +
234.49 +// called as:
234.50 +// LOG_DEBUG(3, ("return code: %d", ret));
234.51 +#define LOG_DEBUG(level, args) \
234.52 + do { if(plugin_debug->value >= level) ALERT(at_logged, "[%s] debug(%d): %s\n", Plugin_info.logtag, level, UTIL_VarArgs args ); } while(0)
234.53 +
234.54 +// max buffer size for printed messages
234.55 +#define MAX_LOGMSG_LEN 1024
234.56 +
234.57 +extern cvar_t init_plugin_debug;
234.58 +extern cvar_t *plugin_debug;
234.59 +
234.60 +void log_init(const char *cvarname);
234.61 +
234.62 +#endif /* LOG_PLUGIN_H */
235.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
235.2 +++ b/wdmisc_plugin/meta_api.cpp Tue Apr 06 07:36:14 2004 +0000
235.3 @@ -0,0 +1,169 @@
235.4 +// vi: set ts=4 sw=4 :
235.5 +// vim: set tw=75 :
235.6 +
235.7 +// meta_api.cpp - common implementation of Metamod's plugin interface
235.8 +
235.9 +// This file is intended to provide a decent common codebase for the
235.10 +// Metamod plugins that I maintain, so everything is set up to be very
235.11 +// generalized, with the things specific for each plugin handled in
235.12 +// plugin.{h,cpp} and elsewhere.
235.13 +
235.14 +/*
235.15 + * Copyright (c) 2001-2003 Will Day <[email protected]>
235.16 + *
235.17 + * This file is part of Metamod.
235.18 + *
235.19 + * Metamod is free software; you can redistribute it and/or modify it
235.20 + * under the terms of the GNU General Public License as published by the
235.21 + * Free Software Foundation; either version 2 of the License, or (at
235.22 + * your option) any later version.
235.23 + *
235.24 + * Metamod is distributed in the hope that it will be useful, but
235.25 + * WITHOUT ANY WARRANTY; without even the implied warranty of
235.26 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
235.27 + * General Public License for more details.
235.28 + *
235.29 + * You should have received a copy of the GNU General Public License
235.30 + * along with Metamod; if not, write to the Free Software Foundation,
235.31 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
235.32 + *
235.33 + * In addition, as a special exception, the author gives permission to
235.34 + * link the code of this program with the Half-Life Game Engine ("HL
235.35 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
235.36 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
235.37 + * respects for all of the code used other than the HL Engine and MODs
235.38 + * from Valve. If you modify this file, you may extend this exception
235.39 + * to your version of the file, but you are not obligated to do so. If
235.40 + * you do not wish to do so, delete this exception statement from your
235.41 + * version.
235.42 + *
235.43 + */
235.44 +
235.45 +#include <extdll.h>
235.46 +
235.47 +#include <dllapi.h>
235.48 +#include <meta_api.h>
235.49 +#include <vdate.h>
235.50 +
235.51 +#include "plugin.h"
235.52 +#include "info_name.h"
235.53 +#include "log_plugin.h"
235.54 +
235.55 +extern META_FUNCTIONS gMetaFunctionTable;
235.56 +
235.57 +// Description of plugin.
235.58 +// (V* info from info_name.h)
235.59 +plugin_info_t Plugin_info = {
235.60 + META_INTERFACE_VERSION, // ifvers
235.61 + VNAME, // name
235.62 + VVERSION, // version
235.63 + VDATE, // date
235.64 + VAUTHOR, // author
235.65 + VURL, // url
235.66 + VLOGTAG, // logtag
235.67 + PT_ANYTIME, // loadable
235.68 + PT_ANYPAUSE, // unloadable
235.69 +};
235.70 +
235.71 +// Global variables from metamod. These variable names are referenced by
235.72 +// various macros.
235.73 +meta_globals_t *gpMetaGlobals; // metamod globals
235.74 +gamedll_funcs_t *gpGamedllFuncs; // gameDLL function tables
235.75 +mutil_funcs_t *gpMetaUtilFuncs; // metamod utility functions
235.76 +
235.77 +// Metamod requesting info about this plugin
235.78 +// ifvers (given) interface_version metamod is using
235.79 +// pPlugInfo (requested) struct with info about plugin
235.80 +// pMetaUtilFuncs (given) table of utility functions provided by metamod
235.81 +C_DLLEXPORT int Meta_Query(char *ifvers, plugin_info_t **pPlugInfo,
235.82 + mutil_funcs_t *pMetaUtilFuncs)
235.83 +{
235.84 + if ((int) CVAR_GET_FLOAT("developer") != 0)
235.85 + UTIL_LogPrintf("[%s] dev: called: Meta_Query; version=%s, ours=%s\n",
235.86 + Plugin_info.logtag, ifvers, Plugin_info.ifvers);
235.87 +
235.88 + // Check for valid pMetaUtilFuncs before we continue.
235.89 + if(!pMetaUtilFuncs) {
235.90 + UTIL_LogPrintf("[%s] ERROR: Meta_Query called with null pMetaUtilFuncs\n", Plugin_info.logtag);
235.91 + return(FALSE);
235.92 + }
235.93 + gpMetaUtilFuncs=pMetaUtilFuncs;
235.94 +
235.95 + // Give metamod our plugin_info struct.
235.96 + *pPlugInfo=&Plugin_info;
235.97 +
235.98 + // Check for interface version compatibility.
235.99 + if(!FStrEq(ifvers, Plugin_info.ifvers)) {
235.100 + int mmajor=0, mminor=0, pmajor=0, pminor=0;
235.101 + LOG_MESSAGE(PLID, "WARNING: meta-interface version mismatch; requested=%s ours=%s",
235.102 + Plugin_info.logtag, ifvers);
235.103 + // If plugin has later interface version, it's incompatible (update
235.104 + // metamod).
235.105 + sscanf(ifvers, "%d:%d", &mmajor, &mminor);
235.106 + sscanf(META_INTERFACE_VERSION, "%d:%d", &pmajor, &pminor);
235.107 + if(pmajor > mmajor || (pmajor==mmajor && pminor > mminor)) {
235.108 + LOG_ERROR(PLID, "metamod version is too old for this plugin; update metamod");
235.109 + return(FALSE);
235.110 + }
235.111 + // If plugin has older major interface version, it's incompatible
235.112 + // (update plugin).
235.113 + else if(pmajor < mmajor) {
235.114 + LOG_ERROR(PLID, "metamod version is incompatible with this plugin; please find a newer version of this plugin");
235.115 + return(FALSE);
235.116 + }
235.117 + // Minor interface is older, but this is guaranteed to be backwards
235.118 + // compatible, so we warn, but we still accept it.
235.119 + else if(pmajor==mmajor && pminor < mminor)
235.120 + LOG_MESSAGE(PLID, "WARNING: metamod version is newer than expected; consider finding a newer version of this plugin");
235.121 + else
235.122 + LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor);
235.123 + }
235.124 +
235.125 + return (plugin_query());
235.126 +}
235.127 +
235.128 +// Metamod attaching plugin to the server.
235.129 +// now (given) current phase, ie during map, during changelevel, or at startup
235.130 +// pFunctionTable (requested) table of function tables this plugin catches
235.131 +// pMGlobals (given) global vars from metamod
235.132 +// pGamedllFuncs (given) copy of function tables from game dll
235.133 +C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable,
235.134 + meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs)
235.135 +{
235.136 + if(now > Plugin_info.loadable) {
235.137 + LOG_ERROR(PLID, "Can't load plugin right now");
235.138 + return(FALSE);
235.139 + }
235.140 + if(!pMGlobals) {
235.141 + LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals");
235.142 + return(FALSE);
235.143 + }
235.144 + gpMetaGlobals=pMGlobals;
235.145 + if(!pFunctionTable) {
235.146 + LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable");
235.147 + return(FALSE);
235.148 + }
235.149 + memcpy(pFunctionTable, &gMetaFunctionTable, sizeof(META_FUNCTIONS));
235.150 + gpGamedllFuncs=pGamedllFuncs;
235.151 +
235.152 + LOG_MESSAGE(PLID, "%s v%s %s", Plugin_info.name, Plugin_info.version,
235.153 + Plugin_info.date);
235.154 + LOG_MESSAGE(PLID, "by %s", Plugin_info.author);
235.155 + LOG_MESSAGE(PLID, " %s", Plugin_info.url);
235.156 + LOG_MESSAGE(PLID, "compiled: %s Eastern (%s)", COMPILE_TIME, OPT_TYPE);
235.157 +
235.158 + // Let's go.
235.159 + return(plugin_attach());
235.160 +}
235.161 +
235.162 +// Metamod detaching plugin from the server.
235.163 +// now (given) current phase, ie during map, etc
235.164 +// reason (given) why detaching (refresh, console unload, forced unload, etc)
235.165 +C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) {
235.166 + if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) {
235.167 + LOG_ERROR(PLID, "Can't unload plugin right now");
235.168 + return(FALSE);
235.169 + }
235.170 + // Done!
235.171 + return(plugin_detach());
235.172 +}
236.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
236.2 +++ b/wdmisc_plugin/msgs/debug Tue Apr 06 07:36:14 2004 +0000
236.3 @@ -0,0 +1,1 @@
236.4 +log_plugin.h // LOG_DEBUG(3, ("return code: %d", ret));
239.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
239.2 +++ b/wdmisc_plugin/plugin.h Tue Apr 06 07:36:14 2004 +0000
239.3 @@ -0,0 +1,44 @@
239.4 +// vi: set ts=4 sw=4 :
239.5 +// vim: set tw=75 :
239.6 +
239.7 +// plugin.h - generic plugin framework
239.8 +
239.9 +/*
239.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
239.11 + *
239.12 + * This file is part of Metamod.
239.13 + *
239.14 + * Metamod is free software; you can redistribute it and/or modify it
239.15 + * under the terms of the GNU General Public License as published by the
239.16 + * Free Software Foundation; either version 2 of the License, or (at
239.17 + * your option) any later version.
239.18 + *
239.19 + * Metamod is distributed in the hope that it will be useful, but
239.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
239.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
239.22 + * General Public License for more details.
239.23 + *
239.24 + * You should have received a copy of the GNU General Public License
239.25 + * along with Metamod; if not, write to the Free Software Foundation,
239.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
239.27 + *
239.28 + * In addition, as a special exception, the author gives permission to
239.29 + * link the code of this program with the Half-Life Game Engine ("HL
239.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
239.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
239.32 + * respects for all of the code used other than the HL Engine and MODs
239.33 + * from Valve. If you modify this file, you may extend this exception
239.34 + * to your version of the file, but you are not obligated to do so. If
239.35 + * you do not wish to do so, delete this exception statement from your
239.36 + * version.
239.37 + *
239.38 + */
239.39 +
239.40 +#ifndef PLUGIN_H
239.41 +#define PLUGIN_H
239.42 +
239.43 +int plugin_query(void);
239.44 +int plugin_attach(void);
239.45 +int plugin_detach(void);
239.46 +
239.47 +#endif /* PLUGIN_H */
240.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
240.2 +++ b/wdmisc_plugin/res_meta.rc Tue Apr 06 07:36:14 2004 +0000
240.3 @@ -0,0 +1,76 @@
240.4 +// vi: set ts=4 sw=4 ft=c :
240.5 +// vim: set tw=75 :
240.6 +
240.7 +/*
240.8 + * Copyright (c) 2001-2003 Will Day <[email protected]>
240.9 + *
240.10 + * This file is part of Metamod.
240.11 + *
240.12 + * Metamod is free software; you can redistribute it and/or modify it
240.13 + * under the terms of the GNU General Public License as published by the
240.14 + * Free Software Foundation; either version 2 of the License, or (at
240.15 + * your option) any later version.
240.16 + *
240.17 + * Metamod is distributed in the hope that it will be useful, but
240.18 + * WITHOUT ANY WARRANTY; without even the implied warranty of
240.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
240.20 + * General Public License for more details.
240.21 + *
240.22 + * You should have received a copy of the GNU General Public License
240.23 + * along with Metamod; if not, write to the Free Software Foundation,
240.24 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
240.25 + *
240.26 + * In addition, as a special exception, the author gives permission to
240.27 + * link the code of this program with the Half-Life Game Engine ("HL
240.28 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
240.29 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
240.30 + * respects for all of the code used other than the HL Engine and MODs
240.31 + * from Valve. If you modify this file, you may extend this exception
240.32 + * to your version of the file, but you are not obligated to do so. If
240.33 + * you do not wish to do so, delete this exception statement from your
240.34 + * version.
240.35 + *
240.36 + */
240.37 +
240.38 +// see:
240.39 +// http://msdn.microsoft.com/library/psdk/winui/rc_7x2d.htm
240.40 +
240.41 +#include <winver.h>
240.42 +#include "info_name.h"
240.43 +
240.44 +VS_VERSION_INFO VERSIONINFO
240.45 + FILEVERSION RC_VERS_DWORD
240.46 + PRODUCTVERSION RC_VERS_DWORD
240.47 + FILEFLAGSMASK 0x3fL
240.48 +#ifdef _DEBUG
240.49 + FILEFLAGS VS_FF_DEBUG
240.50 +#else
240.51 + FILEFLAGS 0x0L
240.52 +#endif
240.53 + FILEOS VOS__WINDOWS32
240.54 + FILETYPE VFT_DLL
240.55 + FILESUBTYPE VFT2_UNKNOWN
240.56 +BEGIN
240.57 + BLOCK "StringFileInfo"
240.58 + BEGIN
240.59 + BLOCK "040904b0"
240.60 + BEGIN
240.61 + VALUE "Comments", RC_COMMENTS "\0"
240.62 + VALUE "CompanyName", VAUTHOR "\0"
240.63 + VALUE "FileDescription", RC_DESC "\0"
240.64 + VALUE "FileVersion", VVERSION "\0"
240.65 + VALUE "InternalName", RC_INTERNAL "\0"
240.66 + VALUE "LegalCopyright", RC_COPYRIGHT "\0"
240.67 + VALUE "LegalTrademarks", "\0"
240.68 + VALUE "OriginalFilename", RC_FILENAME "\0"
240.69 + VALUE "PrivateBuild", "\0"
240.70 + VALUE "ProductName", VNAME "\0"
240.71 + VALUE "ProductVersion", VVERSION "\0"
240.72 + VALUE "SpecialBuild", OPT_TYPE "\0"
240.73 + END
240.74 + END
240.75 + BLOCK "VarFileInfo"
240.76 + BEGIN
240.77 + VALUE "Translation", 0x409, 1200
240.78 + END
240.79 +END
241.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
241.2 +++ b/wdmisc_plugin/sdk_util.cpp Tue Apr 06 07:36:14 2004 +0000
241.3 @@ -0,0 +1,143 @@
241.4 +// vi: set ts=4 sw=4 :
241.5 +// vim: set tw=75 :
241.6 +
241.7 +// sdk_util.cpp - utility routines from HL SDK util.cpp
241.8 +
241.9 +// Selected portions of dlls/util.cpp from SDK 2.1.
241.10 +// Functions copied from there as needed...
241.11 +// And modified to avoid buffer overflows (argh).
241.12 +
241.13 +/***
241.14 +*
241.15 +* Copyright (c) 1999, 2000 Valve LLC. All rights reserved.
241.16 +*
241.17 +* This product contains software technology licensed from Id
241.18 +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
241.19 +* All Rights Reserved.
241.20 +*
241.21 +* Use, distribution, and modification of this source code and/or resulting
241.22 +* object code is restricted to non-commercial enhancements to products from
241.23 +* Valve LLC. All other use, distribution, or modification is prohibited
241.24 +* without written permission from Valve LLC.
241.25 +*
241.26 +****/
241.27 +/*
241.28 +
241.29 +===== util.cpp ========================================================
241.30 +
241.31 + Utility code. Really not optional after all.
241.32 +
241.33 +*/
241.34 +
241.35 +#include <extdll.h>
241.36 +#include "sdk_util.h"
241.37 +#include <cbase.h>
241.38 +
241.39 +#include <string.h> // for strncpy(), etc
241.40 +
241.41 +#include "osdep.h" // win32 vsnprintf, etc
241.42 +
241.43 +char* UTIL_VarArgs( char *format, ... )
241.44 +{
241.45 + va_list argptr;
241.46 + static char string[1024];
241.47 +
241.48 + va_start (argptr, format);
241.49 + vsnprintf (string, sizeof(string), format, argptr);
241.50 + va_end (argptr);
241.51 +
241.52 + return string;
241.53 +}
241.54 +
241.55 +
241.56 +//=========================================================
241.57 +// UTIL_LogPrintf - Prints a logged message to console.
241.58 +// Preceded by LOG: ( timestamp ) < message >
241.59 +//=========================================================
241.60 +void UTIL_LogPrintf( char *fmt, ... )
241.61 +{
241.62 + va_list argptr;
241.63 + static char string[1024];
241.64 +
241.65 + va_start ( argptr, fmt );
241.66 + vsnprintf ( string, sizeof(string), fmt, argptr );
241.67 + va_end ( argptr );
241.68 +
241.69 + // Print to server console
241.70 + ALERT( at_logged, "%s", string );
241.71 +}
241.72 +
241.73 +
241.74 +void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms,
241.75 + const char *pMessage)
241.76 +{
241.77 + if ( !pEntity )
241.78 + return;
241.79 +
241.80 + MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, ENT(pEntity->pev) );
241.81 + WRITE_BYTE( TE_TEXTMESSAGE );
241.82 + WRITE_BYTE( textparms.channel & 0xFF );
241.83 +
241.84 + WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) );
241.85 + WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) );
241.86 + WRITE_BYTE( textparms.effect );
241.87 +
241.88 + WRITE_BYTE( textparms.r1 );
241.89 + WRITE_BYTE( textparms.g1 );
241.90 + WRITE_BYTE( textparms.b1 );
241.91 + WRITE_BYTE( textparms.a1 );
241.92 +
241.93 + WRITE_BYTE( textparms.r2 );
241.94 + WRITE_BYTE( textparms.g2 );
241.95 + WRITE_BYTE( textparms.b2 );
241.96 + WRITE_BYTE( textparms.a2 );
241.97 +
241.98 + WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) );
241.99 + WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) );
241.100 + WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) );
241.101 +
241.102 + if ( textparms.effect == 2 )
241.103 + WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) );
241.104 +
241.105 + if ( strlen( pMessage ) < 512 )
241.106 + {
241.107 + WRITE_STRING( pMessage );
241.108 + }
241.109 + else
241.110 + {
241.111 + char tmp[512];
241.112 + strncpy( tmp, pMessage, 511 );
241.113 + tmp[511] = 0;
241.114 + WRITE_STRING( tmp );
241.115 + }
241.116 + MESSAGE_END();
241.117 +}
241.118 +
241.119 +short FixedSigned16( float value, float scale )
241.120 +{
241.121 + int output;
241.122 +
241.123 + output = (int) (value * scale);
241.124 +
241.125 + if ( output > 32767 )
241.126 + output = 32767;
241.127 +
241.128 + if ( output < -32768 )
241.129 + output = -32768;
241.130 +
241.131 + return (short)output;
241.132 +}
241.133 +
241.134 +unsigned short FixedUnsigned16( float value, float scale )
241.135 +{
241.136 + int output;
241.137 +
241.138 + output = (int) (value * scale);
241.139 + if ( output < 0 )
241.140 + output = 0;
241.141 + if ( output > 0xFFFF )
241.142 + output = 0xFFFF;
241.143 +
241.144 + return (unsigned short)output;
241.145 +}
241.146 +
242.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
242.2 +++ b/wdmisc_plugin/vdate.cpp Tue Apr 06 07:36:14 2004 +0000
242.3 @@ -0,0 +1,51 @@
242.4 +// vi: set ts=4 sw=4 :
242.5 +// vim: set tw=75 :
242.6 +
242.7 +// vdate.cpp - compile-time version date
242.8 +
242.9 +/*
242.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
242.11 + *
242.12 + * This file is part of Metamod.
242.13 + *
242.14 + * Metamod is free software; you can redistribute it and/or modify it
242.15 + * under the terms of the GNU General Public License as published by the
242.16 + * Free Software Foundation; either version 2 of the License, or (at
242.17 + * your option) any later version.
242.18 + *
242.19 + * Metamod is distributed in the hope that it will be useful, but
242.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
242.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
242.22 + * General Public License for more details.
242.23 + *
242.24 + * You should have received a copy of the GNU General Public License
242.25 + * along with Metamod; if not, write to the Free Software Foundation,
242.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
242.27 + *
242.28 + * In addition, as a special exception, the author gives permission to
242.29 + * link the code of this program with the Half-Life Game Engine ("HL
242.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
242.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
242.32 + * respects for all of the code used other than the HL Engine and MODs
242.33 + * from Valve. If you modify this file, you may extend this exception
242.34 + * to your version of the file, but you are not obligated to do so. If
242.35 + * you do not wish to do so, delete this exception statement from your
242.36 + * version.
242.37 + *
242.38 + */
242.39 +
242.40 +#include "info_name.h" // for VNAME, VVERSION, etc
242.41 +
242.42 +
242.43 +// Grab data/time of compile. The Makefile is set up to recompile this
242.44 +// module before each link, so that this will always indicate the time the
242.45 +// library was compiled and linked.
242.46 +
242.47 +// This is in a separate file from vers_*, so it can be generically used by
242.48 +// multiple projects.
242.49 +
242.50 +char const *COMPILE_TIME=__DATE__ ", " __TIME__;
242.51 +
242.52 +// Include a string for /usr/bin/ident.
242.53 +
242.54 +char const *vstring="$Pg: " VNAME " -- " VVERSION " | " __DATE__ " - " __TIME__ " $";
243.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
243.2 +++ b/wdmisc_plugin/wdmisc.cpp Tue Apr 06 07:36:14 2004 +0000
243.3 @@ -0,0 +1,209 @@
243.4 +// vi: set ts=4 sw=4 :
243.5 +// vim: set tw=75 :
243.6 +
243.7 +// plugin.cpp - generic plugin operation
243.8 +
243.9 +/*
243.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
243.11 + *
243.12 + * This file is part of Metamod.
243.13 + *
243.14 + * Metamod is free software; you can redistribute it and/or modify it
243.15 + * under the terms of the GNU General Public License as published by the
243.16 + * Free Software Foundation; either version 2 of the License, or (at
243.17 + * your option) any later version.
243.18 + *
243.19 + * Metamod is distributed in the hope that it will be useful, but
243.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
243.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
243.22 + * General Public License for more details.
243.23 + *
243.24 + * You should have received a copy of the GNU General Public License
243.25 + * along with Metamod; if not, write to the Free Software Foundation,
243.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
243.27 + *
243.28 + * In addition, as a special exception, the author gives permission to
243.29 + * link the code of this program with the Half-Life Game Engine ("HL
243.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
243.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
243.32 + * respects for all of the code used other than the HL Engine and MODs
243.33 + * from Valve. If you modify this file, you may extend this exception
243.34 + * to your version of the file, but you are not obligated to do so. If
243.35 + * you do not wish to do so, delete this exception statement from your
243.36 + * version.
243.37 + *
243.38 + */
243.39 +
243.40 +#include <extdll.h> // always
243.41 +
243.42 +#include <meta_api.h> //
243.43 +#include <vdate.h> // COMPILE_TIME,
243.44 +#include <support_meta.h> // STRNCPY,
243.45 +
243.46 +#include "wdmisc.h" // me
243.47 +#include "plugin.h" // generic routines
243.48 +#include "log_plugin.h" // MAX_LOGMSG_LEN
243.49 +
243.50 +
243.51 +// Must provide at least one of these..
243.52 +META_FUNCTIONS gMetaFunctionTable = {
243.53 + NULL, // pfnGetEntityAPI HL SDK; called before game DLL
243.54 + NULL, // pfnGetEntityAPI_Post META; called after game DLL
243.55 + GetEntityAPI2, // pfnGetEntityAPI2 HL SDK2; called before game DLL
243.56 + NULL, // pfnGetEntityAPI2_Post META; called after game DLL
243.57 + NULL, // pfnGetNewDLLFunctions HL SDK2; called before game DLL
243.58 + NULL, // pfnGetNewDLLFunctions_Post META; called after game DLL
243.59 + GetEngineFunctions, // pfnGetEngineFunctions META; called before HL engine
243.60 + NULL, // pfnGetEngineFunctions_Post META; called after HL engine
243.61 +};
243.62 +
243.63 +
243.64 +cvar_t init_plugin_debug = {"wd_debug", "0", FCVAR_EXTDLL, 0, NULL};
243.65 +cvar_t bounce = {"bounce", "0", FCVAR_EXTDLL, 0, NULL};
243.66 +
243.67 +
243.68 +// Meta_Query, any desired checks for valid use.
243.69 +int plugin_query(void) {
243.70 + return(TRUE);
243.71 +}
243.72 +
243.73 +// Meta_Attach. Plugin startup. Register commands and cvars.
243.74 +int plugin_attach(void) {
243.75 + log_init("wd_debug");
243.76 +
243.77 + bounce_init();
243.78 + do_my_getengfuncs();
243.79 + REG_SVR_COMMAND("msglist", &wd_msglist);
243.80 + REG_SVR_COMMAND("msgid", &wd_msgid);
243.81 + REG_SVR_COMMAND("testit", &wd_testit);
243.82 +
243.83 + return(TRUE);
243.84 +}
243.85 +
243.86 +// Meta_Detach. Cleaning up.
243.87 +int plugin_detach(void) {
243.88 + return(TRUE);
243.89 +}
243.90 +
243.91 +
243.92 +void bounce_init(void) {
243.93 + CVAR_REGISTER(&bounce);
243.94 +}
243.95 +
243.96 +void bounce_check(void) {
243.97 + if((int)CVAR_GET_FLOAT("bounce")==1) {
243.98 + LOG_MESSAGE(PLID, "Exiting server at end of map (bounce==1)");
243.99 + SERVER_COMMAND("quit\n");
243.100 + }
243.101 +}
243.102 +
243.103 +void do_my_getengfuncs(void) {
243.104 + memset(&meta_engfuncs, 0, sizeof(meta_engfuncs));
243.105 + meta_engfuncs.pfnAlertMessage = wd_AlertMessage;
243.106 +}
243.107 +
243.108 +// The below was done basically as a proof-of-concept for catching certain
243.109 +// game-events that aren't otherwise triggered by the HL API. It works only
243.110 +// by examining every log message that the server generates, and checking
243.111 +// to see if it includes the string indicating the particular event in
243.112 +// question (in this case "Planted_The_Bomb").
243.113 +//
243.114 +// Although this works, it is really a rather poor solution to the problem,
243.115 +// as it assumes a lot of string-compares, which can seriously degrade the
243.116 +// performance of the server. I did try to take as many short-cuts as
243.117 +// reasonable in the code, to decrease the amount of string-comparing going
243.118 +// on, which makes the code a bit less readable than doing just a "strstr"
243.119 +// on the log line.
243.120 +
243.121 +void wd_AlertMessage(ALERT_TYPE atype, char *szFmt, ...) {
243.122 + va_list ap;
243.123 + static char buf[MAX_LOGMSG_LEN];
243.124 + char *cp, *ep;
243.125 + int found=0;
243.126 + size_t len=0;
243.127 +
243.128 + if(atype != at_logged)
243.129 + RETURN_META(MRES_IGNORED);
243.130 +
243.131 + va_start(ap, szFmt);
243.132 + vsnprintf(buf, sizeof(buf), szFmt, ap);
243.133 + va_end(ap);
243.134 +
243.135 + // Team "...." triggered ...
243.136 + if((cp=buf) && (cp[0]=='T')
243.137 + && (cp=strchr(cp+1, '"'))
243.138 + && (cp=strchr(cp+1, '"'))
243.139 + && !strncmp(cp+2, "triggered", 9))
243.140 + {
243.141 + cp+=2;
243.142 + found=1;
243.143 + }
243.144 + // World triggered ...
243.145 + else if((cp=buf) && (cp[0]=='W')
243.146 + && !strncmp(cp+6, "triggered", 9))
243.147 + {
243.148 + cp+=6;
243.149 + found=1;
243.150 + }
243.151 + // "player<444><44444><...>" triggered ...
243.152 + else if((cp=buf) && (cp[0]=='"')
243.153 + && (cp=strchr(cp+1, '"'))
243.154 + && !strncmp(cp+2, "triggered", 9))
243.155 + {
243.156 + cp+=2;
243.157 + found=1;
243.158 + }
243.159 +
243.160 + if(found) {
243.161 + // past 'triggered "'
243.162 + cp+=11;
243.163 + if((ep=strchr(cp, '"')))
243.164 + len=ep-cp-1;
243.165 + }
243.166 +
243.167 + if(len && !strncmp(cp, "Planted_The_Bomb", len)) {
243.168 + char name[128];
243.169 + char *beg, *end;
243.170 + beg=buf + 1;
243.171 + end=strchr(buf, '<') + 1;
243.172 + if(!beg || !end)
243.173 + RETURN_META(MRES_IGNORED);
243.174 + len=end-beg;
243.175 + if(len > sizeof(name))
243.176 + len=sizeof(name);
243.177 + STRNCPY(name, beg, len);
243.178 + CENTER_SAY(PLID, "%s set up us the bomb!", name);
243.179 + }
243.180 + RETURN_META(MRES_HANDLED);
243.181 +}
243.182 +
243.183 +void wd_msglist(void) {
243.184 + int i, size;
243.185 + const char *cp;
243.186 + LOG_CONSOLE(PLID, "registered user msgs:");
243.187 + for(i=0; i < MAX_REG_MSGS; i++) {
243.188 + cp=GET_USER_MSG_NAME(PLID, i, &size);
243.189 + if(cp)
243.190 + LOG_CONSOLE(PLID, "%d %s %d", i, cp, size);
243.191 + }
243.192 +}
243.193 +
243.194 +void wd_msgid(void) {
243.195 + const char *msgname;
243.196 + int id;
243.197 + msgname=CMD_ARGV(1);
243.198 + id=GET_USER_MSG_ID(PLID, msgname, NULL);
243.199 + if(id)
243.200 + LOG_CONSOLE(PLID, "%s = %d", msgname, id);
243.201 + else
243.202 + LOG_CONSOLE(PLID, "msg not found: %s", msgname);
243.203 +}
243.204 +
243.205 +void wd_testit(void) {
243.206 + cvar_t *cv;
243.207 + cv=CVAR_GET_POINTER("csguard_version");
243.208 + if(cv)
243.209 + LOG_CONSOLE(PLID, "csguard_version found!: %d", cv);
243.210 + else
243.211 + LOG_CONSOLE(PLID, "csguard_version not found!");
243.212 +}
244.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
244.2 +++ b/wdmisc_plugin/wdmisc.h Tue Apr 06 07:36:14 2004 +0000
244.3 @@ -0,0 +1,51 @@
244.4 +// vi: set ts=4 sw=4 :
244.5 +// vim: set tw=75 :
244.6 +
244.7 +// wdmisc.h - wdmisc routines
244.8 +
244.9 +/*
244.10 + * Copyright (c) 2001-2003 Will Day <[email protected]>
244.11 + *
244.12 + * This file is part of Metamod.
244.13 + *
244.14 + * Metamod is free software; you can redistribute it and/or modify it
244.15 + * under the terms of the GNU General Public License as published by the
244.16 + * Free Software Foundation; either version 2 of the License, or (at
244.17 + * your option) any later version.
244.18 + *
244.19 + * Metamod is distributed in the hope that it will be useful, but
244.20 + * WITHOUT ANY WARRANTY; without even the implied warranty of
244.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
244.22 + * General Public License for more details.
244.23 + *
244.24 + * You should have received a copy of the GNU General Public License
244.25 + * along with Metamod; if not, write to the Free Software Foundation,
244.26 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
244.27 + *
244.28 + * In addition, as a special exception, the author gives permission to
244.29 + * link the code of this program with the Half-Life Game Engine ("HL
244.30 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
244.31 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
244.32 + * respects for all of the code used other than the HL Engine and MODs
244.33 + * from Valve. If you modify this file, you may extend this exception
244.34 + * to your version of the file, but you are not obligated to do so. If
244.35 + * you do not wish to do so, delete this exception statement from your
244.36 + * version.
244.37 + *
244.38 + */
244.39 +
244.40 +#ifndef WDMISC_H
244.41 +#define WDMISC_H
244.42 +
244.43 +void do_my_getengfuncs(void);
244.44 +
244.45 +void bounce_init(void);
244.46 +void bounce_check(void);
244.47 +
244.48 +void wd_AlertMessage(ALERT_TYPE atype, char *szFmt, ...);
244.49 +
244.50 +void wd_msglist(void);
244.51 +void wd_msgid(void);
244.52 +void wd_testit(void);
244.53 +
244.54 +#endif /* WDMISC_H */