Compare commits

..
1 Commits
Author SHA1 Message Date
Google Code Exporter cbc470a111 Migrating wiki contents from Google Code 2015-09-07 13:20:34 -04:00
181 changed files with 512 additions and 88087 deletions

No files matched your search

-229
View File
@@ -1,229 +0,0 @@
Creative_Commons
Creative Commons Legal Code
Attribution-ShareAlike 2.5
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL
SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT
RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS.
CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND
DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
License
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE
BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS
CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
CONDITIONS.
1. Definitions
a. "Collective Work" means a work, such as a periodical issue, anthology or
encyclopedia, in which the Work in its entirety in unmodified form, along
with a number of other contributions, constituting separate and
independent works in themselves, are assembled into a collective whole. A
work that constitutes a Collective Work will not be considered a
Derivative Work (as defined below) for the purposes of this License.
b. "Derivative Work" means a work based upon the Work or upon the Work and
other pre-existing works, such as a translation, musical arrangement,
dramatization, fictionalization, motion picture version, sound recording,
art reproduction, abridgment, condensation, or any other form in which the
Work may be recast, transformed, or adapted, except that a work that
constitutes a Collective Work will not be considered a Derivative Work for
the purpose of this License. For the avoidance of doubt, where the Work is
a musical composition or sound recording, the synchronization of the Work
in timed-relation with a moving image ("synching") will be considered a
Derivative Work for the purpose of this License.
c. "Licensor" means the individual or entity that offers the Work under the
terms of this License.
d. "Original Author" means the individual or entity who created the Work.
e. "Work" means the copyrightable work of authorship offered under the terms
of this License.
f. "You" means an individual or entity exercising rights under this License
who has not previously violated the terms of this License with respect to
the Work, or who has received express permission from the Licensor to
exercise rights under this License despite a previous violation.
g. "License Elements" means the following high-level license attributes as
selected by Licensor and indicated in the title of this License:
Attribution, ShareAlike.
2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or
restrict any rights arising from fair use, first sale or other limitations on
the exclusive rights of the copyright owner under copyright law or other
applicable laws.
3. License Grant. Subject to the terms and conditions of this License, Licensor
hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the
duration of the applicable copyright) license to exercise the rights in the
Work as stated below:
a. to reproduce the Work, to incorporate the Work into one or more Collective
Works, and to reproduce the Work as incorporated in the Collective Works;
b. to create and reproduce Derivative Works;
c. to distribute copies or phonorecords of, display publicly, perform
publicly, and perform publicly by means of a digital audio transmission
the Work including as incorporated in Collective Works;
d. to distribute copies or phonorecords of, display publicly, perform
publicly, and perform publicly by means of a digital audio transmission
Derivative Works.
e. For the avoidance of doubt, where the work is a musical composition:
i. Performance Royalties Under Blanket Licenses. Licensor waives the
exclusive right to collect, whether individually or via a performance
rights society (e.g. ASCAP, BMI, SESAC), royalties for the public
performance or public digital performance (e.g. webcast) of the Work.
ii. Mechanical Rights and Statutory Royalties. Licensor waives the
exclusive right to collect, whether individually or via a music
rights society or designated agent (e.g. Harry Fox Agency), royalties
for any phonorecord You create from the Work ("cover version") and
distribute, subject to the compulsory license created by 17 USC
Section 115 of the US Copyright Act (or the equivalent in other
jurisdictions).
f. Webcasting Rights and Statutory Royalties. For the avoidance of doubt,
where the Work is a sound recording, Licensor waives the exclusive right
to collect, whether individually or via a performance-rights society (e.g.
SoundExchange), royalties for the public digital performance (e.g.
webcast) of the Work, subject to the compulsory license created by 17 USC
Section 114 of the US Copyright Act (or the equivalent in other
jurisdictions).
The above rights may be exercised in all media and formats whether now known or
hereafter devised. The above rights include the right to make such
modifications as are technically necessary to exercise the rights in other
media and formats. All rights not expressly granted by Licensor are hereby
reserved.
4. Restrictions.The license granted in Section 3 above is expressly made
subject to and limited by the following restrictions:
a. You may distribute, publicly display, publicly perform, or publicly
digitally perform the Work only under the terms of this License, and You
must include a copy of, or the Uniform Resource Identifier for, this
License with every copy or phonorecord of the Work You distribute,
publicly display, publicly perform, or publicly digitally perform. You may
not offer or impose any terms on the Work that alter or restrict the terms
of this License or the recipients' exercise of the rights granted
hereunder. You may not sublicense the Work. You must keep intact all
notices that refer to this License and to the disclaimer of warranties.
You may not distribute, publicly display, publicly perform, or publicly
digitally perform the Work with any technological measures that control
access or use of the Work in a manner inconsistent with the terms of this
License Agreement. The above applies to the Work as incorporated in a
Collective Work, but this does not require the Collective Work apart from
the Work itself to be made subject to the terms of this License. If You
create a Collective Work, upon notice from any Licensor You must, to the
extent practicable, remove from the Collective Work any credit as required
by clause 4(c), as requested. If You create a Derivative Work, upon notice
from any Licensor You must, to the extent practicable, remove from the
Derivative Work any credit as required by clause 4(c), as requested.
b. You may distribute, publicly display, publicly perform, or publicly
digitally perform a Derivative Work only under the terms of this License,
a later version of this License with the same License Elements as this
License, or a Creative Commons iCommons license that contains the same
License Elements as this License (e.g. Attribution-ShareAlike 2.5 Japan).
You must include a copy of, or the Uniform Resource Identifier for, this
License or other license specified in the previous sentence with every
copy or phonorecord of each Derivative Work You distribute, publicly
display, publicly perform, or publicly digitally perform. You may not
offer or impose any terms on the Derivative Works that alter or restrict
the terms of this License or the recipients' exercise of the rights
granted hereunder, and You must keep intact all notices that refer to this
License and to the disclaimer of warranties. You may not distribute,
publicly display, publicly perform, or publicly digitally perform the
Derivative Work with any technological measures that control access or use
of the Work in a manner inconsistent with the terms of this License
Agreement. The above applies to the Derivative Work as incorporated in a
Collective Work, but this does not require the Collective Work apart from
the Derivative Work itself to be made subject to the terms of this
License.
c. If you distribute, publicly display, publicly perform, or publicly
digitally perform the Work or any Derivative Works or Collective Works,
You must keep intact all copyright notices for the Work and provide,
reasonable to the medium or means You are utilizing: (i) the name of the
Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if
the Original Author and/or Licensor designate another party or parties
(e.g. a sponsor institute, publishing entity, journal) for attribution in
Licensor's copyright notice, terms of service or by other reasonable
means, the name of such party or parties; the title of the Work if
supplied; to the extent reasonably practicable, the Uniform Resource
Identifier, if any, that Licensor specifies to be associated with the
Work, unless such URI does not refer to the copyright notice or licensing
information for the Work; and in the case of a Derivative Work, a credit
identifying the use of the Work in the Derivative Work (e.g., "French
translation of the Work by Original Author," or "Screenplay based on
original Work by Original Author"). Such credit may be implemented in any
reasonable manner; provided, however, that in the case of a Derivative
Work or Collective Work, at a minimum such credit will appear where any
other comparable authorship credit appears and in a manner at least as
prominent as such other comparable authorship credit.
5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK
AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE
MATERIALS, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT
LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR
PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY,
OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME
JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH
EXCLUSION MAY NOT APPLY TO YOU.
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN
NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS
LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
7. Termination
a. This License and the rights granted hereunder will terminate automatically
upon any breach by You of the terms of this License. Individuals or
entities who have received Derivative Works or Collective Works from You
under this License, however, will not have their licenses terminated
provided such individuals or entities remain in full compliance with those
licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of
this License.
b. Subject to the above terms and conditions, the license granted here is
perpetual (for the duration of the applicable copyright in the Work).
Notwithstanding the above, Licensor reserves the right to release the Work
under different license terms or to stop distributing the Work at any
time; provided, however that any such election will not serve to withdraw
this License (or any other license that has been, or is required to be,
granted under the terms of this License), and this License will continue
in full force and effect unless terminated as stated above.
8. Miscellaneous
a. Each time You distribute or publicly digitally perform the Work or a
Collective Work, the Licensor offers to the recipient a license to the
Work on the same terms and conditions as the license granted to You under
this License.
b. Each time You distribute or publicly digitally perform a Derivative Work,
Licensor offers to the recipient a license to the original Work on the
same terms and conditions as the license granted to You under this
License.
c. If any provision of this License is invalid or unenforceable under
applicable law, it shall not affect the validity or enforceability of the
remainder of the terms of this License, and without further action by the
parties to this agreement, such provision shall be reformed to the minimum
extent necessary to make such provision valid and enforceable.
d. No term or provision of this License shall be deemed waived and no breach
consented to unless such waiver or consent shall be in writing and signed
by the party to be charged with such waiver or consent.
e. This License constitutes the entire agreement between the parties with
respect to the Work licensed here. There are no understandings, agreements
or representations with respect to the Work not specified here. Licensor
shall not be bound by any additional provisions that may appear in any
communication from You. This License may not be modified without the
mutual written agreement of the Licensor and You.
Creative Commons is not a party to this License, and makes no warranty
whatsoever in connection with the Work. Creative Commons will not be liable to
You or any party on any legal theory for any damages whatsoever, including
without limitation any general, special, incidental or consequential damages
arising in connection to this license. Notwithstanding the foregoing two (2)
sentences, if Creative Commons has expressly identified itself as the Licensor
hereunder, it shall have all rights and obligations of Licensor.
Except for the limited purpose of indicating to the public that the Work is
licensed under the CCPL, neither party will use the trademark "Creative
Commons" or any related trademark or logo of Creative Commons without the prior
written consent of Creative Commons. Any permitted use will be in compliance
with Creative Commons' then-current trademark usage guidelines, as may be
published on its website or otherwise made available upon request from time to
time.
Creative Commons may be contacted at http://creativecommons.org/.
-24
View File
@@ -1,24 +0,0 @@
---------------------------------------------------------- Tremulous License ---
Tremulous is licensed in two broadly separate sections: the code and the media.
The code is licensed under the GNU GENERAL PUBLIC LICENSE. This license is
contained in full in the file named GPL. Please be aware of the exceptions to
this license as listed below.
The media is licensed under the CREATIVE COMMONS ATTRIBUTION-SHAREALIKE 2.5
LICENSE. Please read http://creativecommons.org/licenses/by-sa/2.5/ to learn
more about this license. The full license text is contained in the file named
CC.
---------------------------------------------------- Code License Exceptions ---
The following files contain sections of code that are not licensed under the
GPL, but are nevertheless GPL compatible. The license text for these licenses
is contained within the files as listed.
src/qcommon/unzip.c zlib license
src/game/bg_lib.c BSD license
src/client/snd_adpcm.c Stichting Mathematisch Centrum license
src/jpeg-6/* JPEG license
-175
View File
@@ -1,175 +0,0 @@
1.1.0
-----
Feature/balance changes
-----------------------
* Quick fullscreen changes
* Fancy autocompletion
* Client now sleeps when inactive
* Persistent console history
* Increase boost time to 30 seconds from 20 seconds
* Lcannon now has a minimum charge value
* Flamer damage down to 20 from 31
* Zap repeat rate down to 1500ms from 2000ms
* Knockback from pouncing now 3 times as strong
* Demo state now displayed from cgame
* AVI video capture
* cl_autoRecordDemo
* Master server, based on dpmaster
* Changed defaults for r_picmip and r_textureMode
* Chat sounds differ depending on team
* New collision type, for improved light flares
* New pain blend effect
* Reduced Dragoon pounce range to 64 from 96
* Dragoon pounce now incurs 400ms wait before other weapons may be used
* Trapper cost down to 8 from 10
* Hovel is now free, but only one can be built
* Teslagen damage up to 9 from 7
* Non locational damage does not apply locational armour anymore; instead it
averages the armour regions together
* Added target_alien_win and target_human_win
* Added worldspawn keys to disable specific game elements
* 3D particles
* Brass ejections now done via particle system
* static_tranform particle move type
* thirdPersonOnly particle and trail system property
* Abstract attachment system
* Scriptable trails system
Bug fixes/development issues
----------------------------
* Fix to a server memory leak
* Fix to a server 100% CPU bug
* Delete key on *nix fixed
* Fixed lcannon charge storage exploit
* Fixed psaw/cgun inappropriate effects bug
* Maps on create server menu now sorted by name
* Fixed death by poison MOD s/antitox/medkit/
* Fixed Marauders momentarily disappearing when wall jumping
* Fixed a potential crash bug involving the use of generic1
* Fixed being able to build multiple coincident repeaters if there is no reactor
* Fixed incorrect message when invoking "buy ammo" with an energy weapon and no
reactor present
* Fixed invoking "reload" during a weapon reload causing an unnecessary reload
* Fixed aliens having the wrong blood colour when shot with a las gun
* Fixed hovel causing invisible builders
1.0.2
-----
Feature/balance changes
-----------------------
* Extended STATS report to include the times when stages change
* Increased Tesla damage frequency
* Marginally increased Tesla damage
* Teslas now produce exaggerated knockback effect
* Hives now buildable on walls
* Boosters no longer restore Dragoon spitballs
* Dragoon spitballs now affected by gravity
* Dragoon pounce attack damage reduced to 100 from 160
* Removed jump pad code (and associated media loading)
* Removed loading of some Q3 cruft
* Corpses timeout in 20 seconds instead of 60
Bug fixes/development issues
----------------------------
* Fixed a silly bug with using the reactor/repeater
* Spilled events attached to temporary entities are now reattached
to their original entities, fixing the missing flame bug
* Fixed "suicide god" bug
* Fixed bug where zap ignores armour
* Fixed missing particle systems when follow-spectating
* Fixed potential bug involving dodgy pointer arithmetic in
CG_LoadClientInfo
* Cleaned up logic in CG_AddPlayerWeapon
* MASK_SHOT traces no longer collide with corpses
* Improved robustness of spawn validation, fixing the bug on transit
* A crapload of whitespace fixes
1.0.1
-----
Feature/balance changes
-----------------------
* cg_debugParticles >= 1 now prints to the console when particle
systems are parsed and registered
* Reverted walk/run animation switching back to cmd.buttons instead
of basing it on speed
* Added option for changing whether or not the wallwalk control is a
toggle or not
* Weapon now drops momentarily when reloading
* The stage kill counters are now incremented for structure kills if
players did more then 50% of the total damage
* Removed the mp3 decoder from the source
* Marauder lightning now requires aim, does damage over time and
chains to other entities
* Implemented the Medkit -- a means for a human to restore health
and cure poison in the field
* "Disable Build Warnings" replaced with "Disable Warning
Dialogs" and improved
* Sped spectator move speed up
* Implemented "step down" physics for all characters; no more
jumping down stairs
* Increased frequency with which the Acid Tube deals damage
* Tyrant can no longer charge up forever and must pass a specific
minimum charge level
* Implemented command queueing for commands sent to clients in order
to prevent overflows even sv_floodProtect is off, but not by
dropping commands
* Added LOS check to creep slowing
* Overmind now only complains if there are 0 spawns
* Spawns can no longer be built when there is no Overmind/Reactor
* The spawn closest to the point of death is chosen preferably if
available
* Evolving no longer restores all health
* "give weapons" and "give ammo" cheats removed
* When selling the battery pack, max ammo is given
* Added stage information to the end of game stats
* Reduced Dragoon spitball damage from 120 to 110
* Reduced Tyrant claw damage from 120 to 100
* Reduced Tyrant charge damage from 160 to 110
* Increased Barricade regeneration rate from 12 to 14
* Increased Overmind health from 500 to 750
* Decreased Overmind regeneration rate from 10 to 6
* Doubled Blaster speed from 700 to 1400
* Reduced Painsaw damage from 18 to 15
* Reduced Painsaw range from 48.0 to 40.0
* Reduced Grenade price from 300 to 200
* Reduced Shotgun repeat rate from 1200 to 1000
* Increased Shotgun damage from 6 to 7
* Increased Mass driver damage from 35 to 38
* Increased Chaingun damage from 5 to 6
* Reduced Flamer repeat rate from 300 to 200
* Extended Flamer range
* Increased ammo on all human weapons
* Reduced splashdamage on MG Turrets
Bug fixes/development issues
----------------------------
* Hacked around trap_LinkEntity to allow missiles to have a bounding
box displayed
* Fixed "Server command overflow" bug for clients that should time
out
* Fixed a bug where only live clients would have their scores logged
at the end of the game
* Reworked how weapon changes are performed, fixing bugs in the
process
* Fixed the issue where the Mac qvm JIT compiler would not compile
Tremulous
* Reimplemented how buildables play damage sounds to not use the
event system
* Reworked the ammo/clips packing system to remove the confusion of
concepts
* Disabled client side ET_MISSILE collision
* G_RadiusSelectiveDamage no longer applies locational damage
* Moved some speed adjustment code into prediction; should prevent
some prediction misses
* Wrapped all calls to trap_SendServerCommand in order to circumvent
the q3amsgboom.cfg exploit
* Fixed restoration of energy weapons bug
* Fixed a bug where locational damage could sometimes scale damage
to 0
* Added G_ClosestEnt
* Moved build directory from tremulous to tremulous-dev
+140
View File
@@ -0,0 +1,140 @@
# 1.6x #
## 1.6.5 ##
* Damage done to self does not raise bleed counter. ([Issue 157](https://code.google.com/p/p-g-qvm/issues/detail?id=157))
* BleedingSpree goes down when damage is done to other team, but at 1/3 the damage done ([Issue 157](https://code.google.com/p/p-g-qvm/issues/detail?id=157))
* Admitdefeat votes cannot be spammed anymore by players, can't be called before `g_admitDefeatTime`, or by admin ([Issue 159](https://code.google.com/p/p-g-qvm/issues/detail?id=159))
* Fixed bug in listplayers and lockname ([Issue 161](https://code.google.com/p/p-g-qvm/issues/detail?id=161))
* Cleans up build near doors code ([Issue 163](https://code.google.com/p/p-g-qvm/issues/detail?id=163))
* Adds `/devolve` command for aliens. Does not give credits back, player must have full health, and is cvar controlled by `g_allowDevolve` ([Issue 166](https://code.google.com/p/p-g-qvm/issues/detail?id=166))
* Added silent specme, when `!specme s` is done by an admin (anyone with kick flag k), they are put to spec team, but it is not announced. ([Issue 168](https://code.google.com/p/p-g-qvm/issues/detail?id=168))
* Increase max registered players. ([Issue 177](https://code.google.com/p/p-g-qvm/issues/detail?id=177))
## 1.6.2 ##
* Teamstatus now flood limited, via cvar `g_teamStatusTime`, and updated quite a bit ([Issue 121](https://code.google.com/p/p-g-qvm/issues/detail?id=121))
* New Marauder obituary (toggled via cvar `g_maraObituary`) ([Issue 125](https://code.google.com/p/p-g-qvm/issues/detail?id=125) and seperate cvar)
* Added `!fireworks` command, flag `Y` ([Issue 126](https://code.google.com/p/p-g-qvm/issues/detail?id=126))
* Added nobuild series of commands, `!nobuild` and `!nobuildsave`, flag `L` ([Issue 128](https://code.google.com/p/p-g-qvm/issues/detail?id=128))
* Added /allstats command, cvar `g_allStats` controls who can see it (0=off, 1=teammates only, 2=serverwide) and `g_allstatsTime` controls the rate at which players can repeat command. ([Issue 123](https://code.google.com/p/p-g-qvm/issues/detail?id=123)) ([Issue 139](https://code.google.com/p/p-g-qvm/issues/detail?id=139))
* Cleaned up name sanitize to filter ALL non-visible ascii characters (boxes) ([Issue 131](https://code.google.com/p/p-g-qvm/issues/detail?id=131))
* Added `!grab` command ([Issue 135](https://code.google.com/p/p-g-qvm/issues/detail?id=135)) ([Issue 135](https://code.google.com/p/p-g-qvm/issues/detail?id=135)) ([Issue 138](https://code.google.com/p/p-g-qvm/issues/detail?id=138))
* Removed `!mix`, `!switch`, `!trade`, `!steal`, `!explode` ([Issue 138](https://code.google.com/p/p-g-qvm/issues/detail?id=138))
* Added `!bring` command, brings the admin who ran it as a spectator to another spectators point of view. ([Issue 138](https://code.google.com/p/p-g-qvm/issues/detail?id=138))
* Added cvar controlling many wallwalk hovel glitches, `g_wwNoHovelBuild` ([Issue 136](https://code.google.com/p/p-g-qvm/issues/detail?id=136))
* Hardcoded `!info credits` into qvm, now server operators dont have to upload 2 files. ([Issue 140](https://code.google.com/p/p-g-qvm/issues/detail?id=140))
## 1.6.1 ##
* Added Teamstatus command `/teamstatus`. Shows you the status of your base (nodes/eggs, om/reac, etc). Cvar `g_teamStatus` to toggle ([Issue 120](https://code.google.com/p/p-g-qvm/issues/detail?id=120))
* Added Welcome Messages feature. Sends welcome messages to connecting players. `g_welcomeMsg` is message sent to players (supports \n), `g_welcomeMsgTime` is the duration of display. ([Issue 118](https://code.google.com/p/p-g-qvm/issues/detail?id=118))
* Increased `!listmaps` display to 256. ([Issue 117](https://code.google.com/p/p-g-qvm/issues/detail?id=117))
* Fixed Medi-Radioactive Rets glitch ([Issue 116](https://code.google.com/p/p-g-qvm/issues/detail?id=116))
* Fixed vote math issues with 50%. ([Issue 115](https://code.google.com/p/p-g-qvm/issues/detail?id=115))
* Added instant build, `g_instantBuild`. ([Issue 112](https://code.google.com/p/p-g-qvm/issues/detail?id=112))
* Changed `qvm_version` appearance, removed website, added time.
## 1.6 ##
* Major cleanup to code
* Added semi mark fix and designate fix, now, on aliens reload works as protect when designated, and if not designated on either team reload is mark. ([Issue 84](https://code.google.com/p/p-g-qvm/issues/detail?id=84))
* Added medi-stat shove control, `g_healShove` 1=can be shoved, 0=cant ([Issue 85](https://code.google.com/p/p-g-qvm/issues/detail?id=85))
* `g_modHumanStamina` now affects jumps ([Issue 86](https://code.google.com/p/p-g-qvm/issues/detail?id=86))
* Added high turret angles, `g_modTurretAngles` ([Issue 87](https://code.google.com/p/p-g-qvm/issues/detail?id=87))
* Changed `!demo` flag to match adminchat flag ?
* Added patch to allow chat messages in messagemode, similar to /m ([Issue 92](https://code.google.com/p/p-g-qvm/issues/detail?id=92))
* Added patch to fix medi slow heals ([Issue 90](https://code.google.com/p/p-g-qvm/issues/detail?id=90))
* Reduced feeding spree near base ([Issue 89](https://code.google.com/p/p-g-qvm/issues/detail?id=89))
* Added `!practice` command, allows for temporary clan practice, based on tag. Flag [ ([Issue 94](https://code.google.com/p/p-g-qvm/issues/detail?id=94))
* Changed `/builder` flag to )
* Fixed class changes
* Added `!tklog` flag t
* Added `!outlaw` (flag O) commands, punishes bleeders and tkers, cvar `g_bleedingSpree` ([Issue 97](https://code.google.com/p/p-g-qvm/issues/detail?id=97)) ([Issue 99](https://code.google.com/p/p-g-qvm/issues/detail?id=99)) ([Issue 100](https://code.google.com/p/p-g-qvm/issues/detail?id=100))
* Added PTRC abuse prevention, complete with admin warning
* Added `qvm_version` cvar, this qvm is part of the `qvm_` cvar initiative
* Radioactive turrets off by default now
* People who are affected by `g_newbieNamePrefix` can have building disabled for them via `g_newbieNoBuild`. Message to players can be changed via `g_newbieNoBuild` ([Issue 107](https://code.google.com/p/p-g-qvm/issues/detail?id=107))
* Fixed feeding spree ([Issue 108](https://code.google.com/p/p-g-qvm/issues/detail?id=108))
* Fixed typo in !l0 print output ([Issue 109](https://code.google.com/p/p-g-qvm/issues/detail?id=109))
* Added sanitise name fix ([Issue 111](https://code.google.com/p/p-g-qvm/issues/detail?id=111))
* Added random maprotation slot ([Issue 106](https://code.google.com/p/p-g-qvm/issues/detail?id=106))
* Added fix for vote math, no more annoying (66 percent) needed 66 percent to pass ([Issue 110](https://code.google.com/p/p-g-qvm/issues/detail?id=110))
# 1.5x #
## 1.5.2x ##
### 1.5.2 ###
* Changed !demo flag to ~ (to match adminchat flag.)
* Fixed box characters that occasionally appear with line endings in !info
* Added Chat channels, see [[Chat](Chat.md)] for more information
* Added console check to !demo
* Added `g_deconTime` to prevent deconning at beginning of match
* Added !flag command, see [[flag](flag.md)] for more information
* Added Killing/Feeding spree. Kill a lot, and the price on your head goes up. Feed a lot, and you wait before spawning.
* `g_killingSpree` is amount of kills to be considered a spree. 0 disables
* `g_feedingSpree` is amount of feeds. 0 disables
## 1.5.1x ##
### 1.5.1 ###
* Added improved mark deconstruct, adds a second mode (2) to `g_markDeconstruct`, allowing use of regular decon as well as `/mark` command. ([Issue 61](https://code.google.com/p/p-g-qvm/issues/detail?id=61))
* Added `g_adminMaxBan`, when set, only allows admins to ban up to a certan number of days. If !ban is run without a duration, it matches `g_adminMaxBans`. Admins with flag `8` are immune. ([Issue 65](https://code.google.com/p/p-g-qvm/issues/detail?id=65))
* Added layout votes. Can be called with `/callvote layout layoutname`. Follows same restrictions as map votes ([Issue 66](https://code.google.com/p/p-g-qvm/issues/detail?id=66))
* `!listlayouts` flag changed to `j`, as with `!listmaps` ([Issue 66](https://code.google.com/p/p-g-qvm/issues/detail?id=66))
## 1.5.0x ##
### 1.5.0.4 ###
* Added bugfixes for builder, now much more useful command. (See [Issue 64](https://code.google.com/p/p-g-qvm/issues/detail?id=64))
* Added extreme mod
* `g_modBuildableHealth`: Buildable health **(Percent)**
* `g_modBuildableSpeed`: Buildable fire rate **(Percent)**
* `g_modHumanStamina`: Human stamina **(Percent)**
* `g_modHumanHealth`: Human health **(Percent)**
* `g_modAlienHealth`: Alien health **(Percent)**
* `g_modHumanRate`: Human fire rate **(Percent)**
* `g_modAlienRate`: Alien fire rate **(Percent)**
* `g_modWeaponAmmo`: Weapon ammo per clip **(Percent)**
* `g_modWeaponReload`: Adjust's Weapon reload time **(Percent)**
### 1.5.0.3 ###
* Added /builder command, flag +. Shows the builder of a building.
* Increased amount of flags and commands to 128
### 1.5.0.2 ###
* Added !demo command
### 1.5.0.1 ###
* Added fixes for !denyweapon
### 1.5 ###
* Prevented purchase of bsuit when crouched, prevents bsuit crouch glitch
* Added cvar `g_devmapVotes`, switches map votes to devmap votes
* Added proxemity mines (grenades), `g_proximityMines`
* Added !denyweapons/!alloweapons
* Added search to !listmaps
* Added maplog fixes, adds devmap info
* Improved black name filter
* Added timed messages, `g_msg` controls the message, `g_msgtime` controls the repeat rate
* Added feature to echo cp to player consoles
* Added newline support to !cp
* Added vote logging to !adminlog
* Added location data to say\_area, `g_sayAreaLocations`
* Added `g_specASpec`, allows spectators to follow other spectators
# 1.4x #
## 1.4.5 ##
* Long awaited `!credits` function finally here
* Indentation fixed for admin commands
## 1.4.4.2 ##
* Added Vote CP messages and percent notice on vote pass
## 1.4.4.1 ##
* Fixed ugly bug with prefix.
## 1.4.4 ##
* Added color to chat team prefixes
* Added Logfile decolor
* Removed normal property from customgrav, now !customgrav playername without any argument for gravity sets gravity to zero
* Removed console prevention of commands (!drug, !explode, !customgrav), now console can actually run them on other players.
* Added flood protect to share and donate
## 1.4.3.1 ##
* Fixed !drop, now supports spaces.
* Fixed !trade and !steal, players can no longer go above their own health max.
## 1.4.3 ##
* Poll votes now start with 0 yes and 0 no (and no divide by 0 error)
* Teamvotes now only pass if 50% of team votes, and of that 50%, majority wins
* Admitdefeat votes now have percentage `(g_admitDefeatVotePercent)`
* Map bounds spawn fix, now players cant mess up spawn cue by falling out of map (not in any stock maps, but in a few betas this is a problem)
* Enhanced register: Register can be set up to have a password that sets players to a specific level:
* New syntax for register: !register _[level](level.md) [password](password.md)_
* !register 0 sets you back to level 0
* `g_adminRegisterAdminLevel` new setting, sets how high a level can be set with password
* `g_adminRegisterAdminPass` new setting, password required to get up above _g\_adminRegisterAdminLevel_. Blank by default, disables
* `g_adminRegisterLevel` new setting, sets how high an unpassworded register can get.
* **WARNING: PASSWORDS CAN BE SEEN IN PUBLIC CHAT IF ADMIN MESSES UP, OR g\_adminSayFilter IS NOT ENABLED. ESCAPE COMMAND WITH /!register.
* Credit overflow is back, but in a much cleaner form.
* `g_creditOverflow`
***0**: Disabled
***1**: Overflow to every teammate, cycles in slot order.
***2
+31
View File
@@ -0,0 +1,31 @@
This feature allows for up to 10 seperate chat channels to be created in tremulous. These channels can be password protected, and can be registered by users.
## Join ##
To join/register a channel, simply type `/join` **<channel 0-9>** _(password)_
If a channel is registered, you will join it. If it isn't registered, you will register it.
Registration is different than you may think it is, be sure to read the notes on it later
## Part ##
To part a channel, simply type `/part` **<channel 0-9>**
If you are the only user in that channel, the registration will be dropped.
## Chatting ##
To chat to a channel, a user would type the following:
`/# message`
`#` is the number of the channel. A user must be in this channel to chat into it
If you run this command without a message, and are in the channel, it will tell you the password, as well as who is using that channel with the same password.
## !seen ##
!seen lets a user see when another user was last online in the server. This information is saved into `chat.dat`. A player must be registered on a server to appear in this listing. If you don't complete a name, it will show the first 10 names.
## Channel Registration and chat.dat files ##
Channel registration is complex, and information has to be stored into a seperate file. For ease of administration, chat channel information has been saved into a chat.dat file (the default, you can change it, see notes) if the user is registered. This file stores each user's registered channels and their passwords, as well as !seen information
## Notes ##
* `g_chat` defines the chat.dat file, defaults to chat.dat
* This feature is in early development, so may be buggy.
* User passwords are stored plain text, so inform your users of this.
* Channels must be rejoined on map change/restart
+115
View File
@@ -0,0 +1,115 @@
The p-g-qvm has the largest featureset of any qvm, and as such, can be quite exhausting to hunt down and find each feature. Here is a list of all the features.
# Admin Commands #
QVM uses lakitu7's patch, and therefore has all admin and Lakitu7 commands.
* **!flag and !unflag** (f): Adjust per-user flags on the fly. Very powerful command, see [[flag](flag.md)] for information
* **!seen** (D): Shows the last time a (registered) player was on the server. Prints out 10 name matches. (Saved in chat.dat)
* **!demo** (~): Allows admins to toggle sending of admin warnings to themselves. Designed for demo recording
* **!denyweapon** (d): Allows you to deny or allow a weapon for someone to use. If they are holding that weapon, it removes it from them, and repays them. Works with alien classes too
* **!adminlog:** (A): Shows a log of reciently run admin commands.
* !**forcespec/!unforcespec** (F): Disable the ability of a player to join any team. If the player is playing the game, they are removed and forced to spectator.
* **!pause/!unpause** (S): Freeze a player where they are currently positioned. The freezed player cannot take any damage, give any damage, die, or move. They may rotate their view though. Works on spectators. _Note: Pause whole game feature removed due to [Bug 1](http://code.google.com/p/p-g-qvm/issues/detail?id=1)_
* **!buildlog** (U): Displays a list of recent builds. Running the newest version, with advanced syntax.
* **!revert** (U): Reverts a build action. Latest action. Uses advanced syntax.
* **!slap** (x): Does damage to a player, and sends them flying.
* **!l0** (l): Removes the admin of a level 1 admin. Used shares !l1 flag.
* **!switch** (X): swaps places with any other player in the game, even spectators.
* **!mix** (X): Mixes any other player into yourself. If both players are members of a team, you will generally get a bastard creature that cannot move, but can damage each other. If run on a spectator, it will force a spectator to look at the player (not follow, but look)
* **!steal** (T): Lets you steal health from another player. Does health in increments of 5.
* **!trade** (t): Lets you trade health with another player. They get yours and you get theirs. You cannot exceed your maximum health. Health is by number, and not percent, so if a full hp human trades with a dretch, the dretch will remain the same, but the human will only have 25 hp.
* **!drug** (Q): Applies a poison effect to a player, like basilisk gas.
* **!drop** (o): Drops a player from the server, without any log, any temporary ban, or any reason. Client sees server disconnected. Useful for ejecting laggers from server. Specify a reason by adding reason after name.
* **!cp** (Z): Center prints a message to all players. This works exactly like the cp console command, except that this does not support \n newlines.
* **!customgrav** (Q): Sets the gravity for ONE player. Run without a gravity paramiter to match server gravity.
* **!explode** (Q): Causes a player to instantly explode, as if they blew up a grenade. Does same amount of damage as grenade, with same radius of splash. Affects structures or close players too.
* **!listmaps** (j): Displays a listing of ALL the maps on the server, by the name the server calls them.
* **!maplog** (j): Shows a list of the 5 most recently played maps.
* **!immunity** (I): Gives a player immunity from an IP ban. Player must have GUID and be registered with the server. Does nothing against GUID bans. Uses same flag as !ban.
* **!suspendban** (J): Suspends a ban in !showbans for up to 14 days.
* **!register** (R): Registers a player with the server. Supports advanced register features. !register 0 sets a player to level 0. !register [level](level.md) [pass](pass.md) sets a player to a level, if the proper password is given.
* _g\_adminRegisterLevel_: Level to which a normal register sets to. Default 1
* _g\_adminRegisterAdminPass_: Password required to get to levels set by `g_adminRegisterAdminLevel`. Blank is default, and disabled
* _g\_adminRegisterAdminLevel_: Level to which password registrations go. Default is 0.
* **WARNING: IF PASSWORDS ARE TYPED IN CHAT, AND `g_adminSayFilter` IS OFF, THEN PASSWORD WILL BE DISPLAYED IN CHAT. TO OVERCOME THIS, USE ESCAPED SYNTAX (/!register)
***!credits**(u): Add or remove credits from a player (good for paying back that poor sap who you just !explode'd). Anti-abuse prevents players from modifying their own credit amount.**
# Other Features #
* Chat channels: Multiple chat channels in tremulous! This is a huge feature, so see [[Channels](Chat.md)] for information.
* /mark: When `g_markDeconstruct` is set to `2`, allows use of `/mark` command, marking or unmarking a building for deconstruction.
* Layout votes: adds new vote type `layout`. Called by `/callvote layout LAYOUTNAME`. Subject to same restrictions as all other map votes.
* /builder (+): shows the builder of a structure and its buildlog number.
* Force mapvotes to be devmapvotes `g_devmapVotes`
* CP messages logged to console
* Repeating messages, `g_msg` and `g_msgTime`
* Players cant crouch as bsuit, or buy a bsuit while crouching
* NO BLACK IN NAMES, PERIOD
* !listmaps search
* Votes logged in !adminlog
* !Maplog shows devmap
* Decolor log files, controlled by `g_decolorLogfiles`
* Poll vote caller can vote no
* Players that fall out of map die instantly, and cannot mess up spawn cue
* Credit overflow
* Teamvotes much more fair now, and admitdefeat has percent control.
* FF percent retribution
* Newline for console cp. Use \n to insert line breaks in
* Extend votes, controlled by cvars beginning with `g_extend`
* Buy anything, allows you to buy buildings and alien classes. `g_buyAll`
* Multiple weapon slots allow players to hold more than one weapon. `g_multipleWeapons`
* Control over poll votes. `g_pollVotes`
* Faster, more powerful granger spit. Does same damage as blaster, at same repeat rate
* Reasons for Mute and Kick votes are required
* Search for !showbans, let you look for a name or IP
* Adminchat warnings. Know when a player tries to do something they shouldnt be able to, or a banned player tries to connect.
* Killer HP. When someone kills someone else, it tells you the killer's remaining HP. Cvar controlled, `g_killerHP`
* Radioactive turrets feature. Does damage to camping humans. Controlled by cvars beginning with `g\_radiation'
* Teamvotes accept normal yes/no if no other vote in progress
* Vote connect time prevents players from connecting and calling a vote within g\_voteMinTime, or call a map vote within g\_mapvoteMinTime
# Cvars #
* `g_killingSpree`: Amount of kills considered a spree. When a user gets a spree, the price on their head goes up, awarding the killer more. 0 disables. **(Integer)**
* `g_feedingSpree`: Amount of feeds before player is made to wait longer to spawn. 0 disables. **(Integer)**
* `g_chat`: Chat.dat file, controlling the chat user channel information **(String ending in .dat)**
* `g_deconTime`: Time in which a player must wait to decon reactor/overmind at start of map. -1 makes it so 2/3 of all players must be connected, otherwise it is amount of seconds. **(Seconds Integer or -1)**
* `g_markDeconstruct`: Added mode 2, allows use of `/mark` command. **(Bitmask)**
* `g_adminMaxBan`: Allows the maximum ban length of admins without `8` flag to be limited. Cvar is in days. **(Number)**
* `g_modBuildableHealth`: Buildable health **(Percent)**
* `g_modBuildableSpeed`: Buildable fire rate **(Percent)**
* `g_modHumanStamina`: Human stamina **(Percent)**
* `g_modHumanHealth`: Human health **(Percent)**
* `g_modAlienHealth`: Alien health **(Percent)**
* `g_modHumanRate`: Human fire rate **(Percent)**
* `g_modAlienRate`: Alien fire rate **(Percent)**
* `g_modWeaponAmmo`: Weapon ammo per clip **(Percent)**
* `g_modWeaponReload`: Adjust's Weapon reload time **(Percent)**
* `g_decolorLogfiles`: Enables/disables removal of color tags from log files. **(Boolean)**
* `g_devmapVotes`: Forces mapvotes to be devmapvotes **(Boolean)**
* `g_specASpec`: Allows speccing of other spectators **(Boolean)**
* `g_proximityMines`: Turns grenades into mines **(Boolean)**
* `g_msg`: Sets message to be repeated **(String)**
* `g_msgTime`: Sets message repeat rate in minutes **(Integer)**
* `g_sayAreaLocations`: Adds location data to say\_area **(Boolean)**
* `g_admitDefeatVotePercent`: Sets the percentage at which admitdefeat teamvotes must have to pass **(Integer)**
* `g_creditOverflow`: Overflows the credits of full players to others. 0 disables, 1 gives to teammates in slot order, 2 gives to highest scoring teammates. **(Bitmask)**
* `g_adminRegisterLevel`: Level to which a normal register sets to. Default 1 **(Integer)**
* `g_adminRegisterAdminPass`: Password required to get to levels set by `g_adminRegisterAdminLevel`. Blank is default, and disabled **(String)**
* `g_adminRegisterAdminLevel`: Level to which password registrations go. Default is 0. **(Integer)**
* `g_killerHP`: Shows a victim how much health their killer had. **(Boolean)**
* `g_pollVotes`: Control if poll votes are enabled or disabled. **(Boolean)**
* `g_extendVotePercent`: Percent for extend votes to pass. **(Float)**
* `g_extendVote`: Controls if extend votes are enabled. **(Boolean)**
* `g_extendVotesPercent`: Controls the percent extend votes must have to pass. **(Float)**
* `g_extendVotesTime`: Controls the amount of time extend votes push the time limit back by. **(Float)**
* `g_extendVotesCount`: Controls how many extend votes may be called and passed during a game. **(Float)**
* `g_buyAll`: Allows the purchase of any item while on the human team. **(Boolean)**
* `g_multipleWeapons`: Allows humans to carry more than one main weapon. **(Boolean)**
* `g_radiationDamage`: Amount of damage given by radiation. **(Float)**
* `g_radiationTime`: The amount of time spent camping near turrets to engage irradiation. **(Float)**
* `g_radiationCredits`: Amount of credits a player must have to be damaged. **(Float)**
* `g_radiationCreditsCount`: Way the game counts credits. 0 for only current equipment, 1 for players account, 2 for both account and current equipment. **(Bitmask)**
* `g_voteMinTime`: Amount of time a player must be connected to server to call a vote. **(Integer)**
* `g_mapvoteMinTime`: Amount of time a player must be connected to call a mapvote. **(Integer)**
There are many other features that i cant name off the top of my head, so feel free to update this page as you find them.
Thank you
-281
View File
@@ -1,281 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
-1399
View File
File diff suppressed because it is too large. Load diff
+5
View File
@@ -0,0 +1,5 @@
P-g-qvm is undergoing a major update.
We are starting from scratch, removing useless fodder, and adding useful features.
Expect version 2 SOON.
+60
View File
@@ -0,0 +1,60 @@
```
___ ___ ___
___ / /\ / /\ ___ / /\
/ /\ / /::\ / /::\ / /\ / /::|
/ /::\ / /:/\:\ /__/:/\:\ / /:/ / /:|:|
/ /:/\:\ / /:/ \:\ \ \:\ \:\ / /:/ / /:/|:|__
/ /::\ \:\ /__/:/_\_ \:\ \ \:\ \:\ /__/:/ ___ /__/:/_|::::\
/__/:/\:\_\:\ \ \:\__/\_\/ \ \:\/:/ | |:| / /\ \__\/ /~~/:/
\__\/ \:\/:/ \ \:\ \:\ \__\::/ | |:|/ /:/ / /:/
\ \::/ \ \:\/:/ / /:/ |__|:|__/:/ / /:/
\__\/ \ \::/ /__/:/ \__\::::/ /__/:/
\__\/ \__\/ ~~~~ \__\/
_
| |
_ __ ___ __ _ __| |_ __ ___ ___
| '__/ _ \/ _` |/ _` | '_ ` _ \ / _ \
| | | __/ (_| | (_| | | | | | | __/
|_| \___|\__,_|\__,_|_| |_| |_|\___|
=============================================================================
P-G-QVM is a qvm developed by Paradox, Google, and Rezyn, meant for the game tremulous.
It is completely opensource, and actively developed.
==============================
Website, SVN, News, and More
==============================
P-g-qvm is hosted on google code. We offer an Issue tracker, SVN repository, and download of the software from the project page.
http://p-g-qvm.googlecode.com
Paradox, the project owner, updates a tag on his blog with p-g-qvm info.
http://paradoxdgn.com/tag/p-g-qvm
==============================
Installation
==============================
Installing the qvm is quite simple. Extract the game.qvm file, and replace the game.qvm in your local base/vm folder.
As of version 1.6.2, there is no need to place a seperate info-credits.txt file anywhere, this is hardcoded into the qvm, and works automatically. Previous versions MUST have this file.
==============================
Credits
==============================
This qvm is a hodgepodge of many different features, and if you wish to see who all should get credit, please visit the wikipage for references at http://code.google.com/p/p-g-qvm/wiki/References
Majority of the credit goes to Google and Rezyn, however, without their help, this qvm would not exist. They preform most of the coding and porting of features.
Amanieu has helped us quite a bit, and we give him thanks.
Lakitu7 built the qvm which this is the foundation of this qvm, so without him, this would not be possible.
SST server is the main test bed for this qvm, and as such, will always be running an up to date version.
And a thanks to everyone in #tremulous and ##c on freenode, you helped me out with my stupid questions and whatnot.
```
**_THIS FILE MUST BE INCLUDED WITH EVERY DISTRIBUTION OF P-G-QVM._**
+39
View File
@@ -0,0 +1,39 @@
# Rezyn #
* [Subnet check](http://mysite.verizon.net/johne/patches/tremlak501_checkban_subnet_fix.patch)
* [Guid Verification](http://p-g-qvm.googlecode.com/files/tremlak501_GUID_verify.patch)
* [Ban Immunity](http://mysite.verizon.net/johne/patches/tremlak501_banimmunity_v2.patch)
* [List fix](http://mysite.verizon.net/johne/patches/tremlak501_banimmunity_listfix.patch)
* [Flexible admin votes](http://mysite.verizon.net/johne/patches/tremlak501_extend_vote.patch)
* [!l0 feature](http://mysite.verizon.net/johne/patches/tremlak501_l0_v2.patch)
* [!listmaps and !maplog](http://p-g-qvm.googlecode.com/files/tremlak501_listmaps_maplog.patch)
* [No newbie register](http://mysite.verizon.net/johne/patches/tremlak501_noregister_newbies.patch)
* [!pause](http://mysite.verizon.net/johne/patches/tremlak501_pause_v2.patch)
* [!showbans search](http://p-g-qvm.googlecode.com/files/tremlak501_showbans_search.patch)
* [!suspendban](http://mysite.verizon.net/johne/patches/tremlak501_suspendban.patch)
* [!maplog results](http://code.google.com/p/p-g-qvm/issues/detail?id=11)
* http://code.google.com/p/p-g-qvm/issues/detail?id=6 Decon protected warnings now show structure and are flood limited]
* [Duplicate ban warnings](http://code.google.com/p/p-g-qvm/issues/detail?id=9)
* [Banned player connect admin warning flood protected](http://code.google.com/p/p-g-qvm/issues/detail?id=12)
* [!denybuild granger fix](http://code.google.com/p/p-g-qvm/issues/detail?id=14)
* [Mute prevents taunts](http://code.google.com/p/p-g-qvm/issues/detail?id=15)
> (Note: Rezyn has since joined the project, and as such release quite a few features, so some of this will not be updated. A full list of all features can be found on the issue tracker)
# Benmachine #
* [!buildlog](http://www.bandstand.org.uk/~benm/coding/done.php#buildlog-revert)
* [console cp newlines](http://www.mercenariesguild.net/patches/?getfile=263)
# Amanieu d'Antras #
* [Admin warnings](http://www.mercenariesguild.net/patches/?getfile=363)
* [Radioactive turrets](http://www.mercenariesguild.net/patches/?getfile=282)
* !fireworks command (ported by Google)
> # Amine #
* [Grenade proximity thingy](http://tremulous.net/forum/index.php?topic=7377.0)
# Lakitu7 #
* [Lakitu7's 5.01 featureset](http://www.mercenariesguild.net/patches/?getfile=252)
* Team vote updates
* Vote times
* LogFile decolor
# Google #
* Large number of commands unique to this qvm, see issue tracker
* [Ban notice patch](http://code.google.com/p/p-g-qvm/issues/detail?id=13)
-6
View File
@@ -1,6 +0,0 @@
#!/bin/sh
export CC=i586-mingw32msvc-gcc
export WINDRES=i586-mingw32msvc-windres
export PLATFORM=mingw32
exec make $*
+33
View File
@@ -0,0 +1,33 @@
!flag is an incredibly flexible admin command. It allows you to change the various per-user flags, without having to open up admin.dat. This is very useful if you want to give someone perm designation, or some other command.
## Overview ##
* **Admin.dat Flag**: f
* Commands of !flag and !unflag
* Can't change own flags
* Can't change flags you don't have access to
* Can't change flags of higher level admins
* Rcon can use any flag
## Usage ##
### !flag ###
The basic usage of !flag is relatively simple. This command is very powerful. The syntax and usage is as follows:
`!flag` **<admin #>** _(modifier) {flag}_
Admin # is the number displayed in !listadmins
Modifiers are values that affect the of flag (-)
#### !flag # ####
Running !flag with only a # will display all the custom user flags for that user
#### !flag # $ ####
Running flag in the basic syntax, replacing `$` with the flag in choice and replacing `#` with the admin number, will add that flag to a users name.
#### !flag # -$ ####
Running flag with the deny syntax, this will deny flag `$` to admin `#`, regardless of other settings
### !unflag ###
Unflag removes a flag from an admins registered name, without adding a -
The syntax is:
`!unflag` **<admin #>** _(flag)_
Admin 3 is the number in !listadmins
## Notes ##
From any admin !flag #
+89
View File
@@ -0,0 +1,89 @@
**Remember:** New revision flags are shown in _italics_
| **Command/Feature** | **Flag** |
|:--------------------|:---------|
| no inactivity | 0 |
| Vote immunity | 1 |
| Flood immunity | 2 |
| Keeps Credits | 3 |
| Teamchat | 4 |
| Teamswitch | 5 |
| No reason for bans | 6 |
| Unlimited Votes | 7 |
| Ban duration | 8 |
| teamchat commands | 9 |
| command immune | ! |
| perm. Designation | # |
| sees listplayers | $ |
| immune from IP bans | & |
| /builder | ) |
| demo | ? |
| sees adminchat | ? |
| anonymous | @ |
| admintest | a |
| adminlog | A |
| ban |b |
| showbans | b |
| unban | b |
| adjustban | B |
| immunity | B |
| suspendban | B |
| cancelvote | c |
| time | C |
| allowbuild | d |
| allowweapon | d |
| denybuild | d |
| denyweapon | d |
| listadmins | D |
| seen | D |
| namelog | e |
| L0 | E |
| flag | f |
| unflag | f |
| forcespec | F |
| unforcespec | F |
| designate | g |
| undesignate | g |
| readconfig | G |
| help | h |
| specme | h |
| info | H |
| listplayers | i |
| listlayouts | j |
| listmaps | j |
| maplog | j |
| kick | k |
| lock | k |
| unlock | K |
| L1 | l |
| devmap | L |
| layoutsave | L |
| nobuild | L |
| nobuildsave | L |
| mute | m |
| unmute | m |
| map | M |
| nextmap | n |
| rename | N |
| drop | o |
| outlaw | O |
| putteam | p |
| spec999 | P |
| grab | Q |
| restart | r |
| register | R |
| setlevel | s |
| pause | S |
| unpause | S |
| tklog | t |
| credits | u |
| buildlog | U |
| revert | U |
| passvote | V |
| warn | w |
| slap | x |
| allready | y |
| fireworks | Y |
| cp | Z |
_**Note:** These are organised by flag, and not by command._
-252
View File
@@ -1,252 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#define CMD_BACKUP 64
#define CMD_MASK (CMD_BACKUP - 1)
// allow a lot of command backups for very fast systems
// multiple commands may be combined into a single packet, so this
// needs to be larger than PACKET_BACKUP
#define MAX_ENTITIES_IN_SNAPSHOT 256
// snapshots are a view of the server at a given time
// Snapshots are generated at regular time intervals by the server,
// but they may not be sent if a client's rate level is exceeded, or
// they may be dropped by the network.
typedef struct
{
int snapFlags; // SNAPFLAG_RATE_DELAYED, etc
int ping;
int serverTime; // server time the message is valid for (in msec)
byte areamask[ MAX_MAP_AREA_BYTES ]; // portalarea visibility bits
playerState_t ps; // complete information about the current player at this time
int numEntities; // all of the entities that need to be presented
entityState_t entities[ MAX_ENTITIES_IN_SNAPSHOT ]; // at the time of this snapshot
int numServerCommands; // text based server commands to execute when this
int serverCommandSequence; // snapshot becomes current
} snapshot_t;
enum
{
CGAME_EVENT_NONE,
CGAME_EVENT_TEAMMENU,
CGAME_EVENT_SCOREBOARD,
CGAME_EVENT_EDITHUD
};
/*
==================================================================
functions imported from the main executable
==================================================================
*/
#define CGAME_IMPORT_API_VERSION 4
typedef enum
{
CG_PRINT,
CG_ERROR,
CG_MILLISECONDS,
CG_CVAR_REGISTER,
CG_CVAR_UPDATE,
CG_CVAR_SET,
CG_CVAR_VARIABLESTRINGBUFFER,
CG_ARGC,
CG_ARGV,
CG_ARGS,
CG_FS_FOPENFILE,
CG_FS_READ,
CG_FS_WRITE,
CG_FS_FCLOSEFILE,
CG_SENDCONSOLECOMMAND,
CG_ADDCOMMAND,
CG_SENDCLIENTCOMMAND,
CG_UPDATESCREEN,
CG_CM_LOADMAP,
CG_CM_NUMINLINEMODELS,
CG_CM_INLINEMODEL,
CG_CM_LOADMODEL,
CG_CM_TEMPBOXMODEL,
CG_CM_POINTCONTENTS,
CG_CM_TRANSFORMEDPOINTCONTENTS,
CG_CM_BOXTRACE,
CG_CM_TRANSFORMEDBOXTRACE,
CG_CM_MARKFRAGMENTS,
CG_S_STARTSOUND,
CG_S_STARTLOCALSOUND,
CG_S_CLEARLOOPINGSOUNDS,
CG_S_ADDLOOPINGSOUND,
CG_S_UPDATEENTITYPOSITION,
CG_S_RESPATIALIZE,
CG_S_REGISTERSOUND,
CG_S_STARTBACKGROUNDTRACK,
CG_R_LOADWORLDMAP,
CG_R_REGISTERMODEL,
CG_R_REGISTERSKIN,
CG_R_REGISTERSHADER,
CG_R_CLEARSCENE,
CG_R_ADDREFENTITYTOSCENE,
CG_R_ADDPOLYTOSCENE,
CG_R_ADDLIGHTTOSCENE,
CG_R_RENDERSCENE,
CG_R_SETCOLOR,
CG_R_DRAWSTRETCHPIC,
CG_R_MODELBOUNDS,
CG_R_LERPTAG,
CG_GETGLCONFIG,
CG_GETGAMESTATE,
CG_GETCURRENTSNAPSHOTNUMBER,
CG_GETSNAPSHOT,
CG_GETSERVERCOMMAND,
CG_GETCURRENTCMDNUMBER,
CG_GETUSERCMD,
CG_SETUSERCMDVALUE,
CG_R_REGISTERSHADERNOMIP,
CG_MEMORY_REMAINING,
CG_R_REGISTERFONT,
CG_KEY_ISDOWN,
CG_KEY_GETCATCHER,
CG_KEY_SETCATCHER,
CG_KEY_GETKEY,
CG_S_STOPBACKGROUNDTRACK,
CG_REAL_TIME,
CG_SNAPVECTOR,
CG_REMOVECOMMAND,
CG_R_LIGHTFORPOINT,
CG_CIN_PLAYCINEMATIC,
CG_CIN_STOPCINEMATIC,
CG_CIN_RUNCINEMATIC,
CG_CIN_DRAWCINEMATIC,
CG_CIN_SETEXTENTS,
CG_R_REMAP_SHADER,
CG_S_ADDREALLOOPINGSOUND,
CG_S_STOPLOOPINGSOUND,
CG_CM_TEMPCAPSULEMODEL,
CG_CM_CAPSULETRACE,
CG_CM_TRANSFORMEDCAPSULETRACE,
CG_R_ADDADDITIVELIGHTTOSCENE,
CG_GET_ENTITY_TOKEN,
CG_R_ADDPOLYSTOSCENE,
CG_R_INPVS,
CG_FS_SEEK,
CG_FS_GETFILELIST,
CG_LITERAL_ARGS,
CG_CM_BISPHERETRACE,
CG_CM_TRANSFORMEDBISPHERETRACE,
CG_GETDEMOSTATE,
CG_GETDEMOPOS,
CG_GETDEMONAME,
CG_KEY_KEYNUMTOSTRINGBUF,
CG_KEY_GETBINDINGBUF,
CG_KEY_SETBINDING,
CG_PARSE_ADD_GLOBAL_DEFINE,
CG_PARSE_LOAD_SOURCE,
CG_PARSE_FREE_SOURCE,
CG_PARSE_READ_TOKEN,
CG_PARSE_SOURCE_FILE_AND_LINE,
CG_MEMSET = 200,
CG_MEMCPY,
CG_STRNCPY,
CG_SIN,
CG_COS,
CG_ATAN2,
CG_SQRT,
CG_FLOOR,
CG_CEIL,
CG_TESTPRINTINT,
CG_TESTPRINTFLOAT,
CG_ACOS
} cgameImport_t;
/*
==================================================================
functions exported to the main executable
==================================================================
*/
typedef enum
{
CG_INIT,
// void CG_Init( int serverMessageNum, int serverCommandSequence, int clientNum )
// called when the level loads or when the renderer is restarted
// all media should be registered at this time
// cgame will display loading status by calling SCR_Update, which
// will call CG_DrawInformation during the loading process
// reliableCommandSequence will be 0 on fresh loads, but higher for
// demos, tourney restarts, or vid_restarts
CG_SHUTDOWN,
// void (*CG_Shutdown)( void );
// oportunity to flush and close any open files
CG_CONSOLE_COMMAND,
// qboolean (*CG_ConsoleCommand)( void );
// a console command has been issued locally that is not recognized by the
// main game system.
// use Cmd_Argc() / Cmd_Argv() to read the command, return qfalse if the
// command is not known to the game
CG_DRAW_ACTIVE_FRAME,
// void (*CG_DrawActiveFrame)( int serverTime, stereoFrame_t stereoView, qboolean demoPlayback );
// Generates and draws a game scene and status information at the given time.
// If demoPlayback is set, local movement prediction will not be enabled
CG_CROSSHAIR_PLAYER,
// int (*CG_CrosshairPlayer)( void );
CG_LAST_ATTACKER,
// int (*CG_LastAttacker)( void );
CG_KEY_EVENT,
// void (*CG_KeyEvent)( int key, qboolean down );
CG_MOUSE_EVENT,
// void (*CG_MouseEvent)( int dx, int dy );
CG_EVENT_HANDLING,
// void (*CG_EventHandling)(int type);
CG_CONSOLE_TEXT
// void (*CG_ConsoleText)( void );
// pass text that has been printed to the console to cgame
// use Cmd_Argc() / Cmd_Argv() to read it
} cgameExport_t;
//----------------------------------------------
-2031
View File
File diff suppressed because it is too large. Load diff
-104
View File
@@ -1,104 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// bg_lib.h -- standard C library replacement routines used by code
// compiled for the virtual machine
// This file is NOT included on native builds
#ifndef BG_LIB_H
#define BG_LIB_H
#ifndef NULL
#define NULL ((void *)0)
#endif
typedef int size_t;
typedef char * va_list;
#define _INTSIZEOF(n) ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) )
#define va_start(ap,v) ( ap = (va_list)&v + _INTSIZEOF(v) )
#define va_arg(ap,t) ( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) )
#define va_end(ap) ( ap = (va_list)0 )
#define CHAR_BIT 8 /* number of bits in a char */
#define SCHAR_MIN (-128) /* minimum signed char value */
#define SCHAR_MAX 127 /* maximum signed char value */
#define UCHAR_MAX 0xff /* maximum unsigned char value */
#define SHRT_MIN (-32768) /* minimum (signed) short value */
#define SHRT_MAX 32767 /* maximum (signed) short value */
#define USHRT_MAX 0xffff /* maximum unsigned short value */
#define INT_MIN (-2147483647 - 1) /* minimum (signed) int value */
#define INT_MAX 2147483647 /* maximum (signed) int value */
#define UINT_MAX 0xffffffff /* maximum unsigned int value */
#define LONG_MIN (-2147483647L - 1) /* minimum (signed) long value */
#define LONG_MAX 2147483647L /* maximum (signed) long value */
#define ULONG_MAX 0xffffffffUL /* maximum unsigned long value */
// Misc functions
typedef int cmp_t( const void *, const void * );
void qsort( void *a, size_t n, size_t es, cmp_t *cmp );
void srand( unsigned seed );
int rand( void );
// String functions
size_t strlen( const char *string );
char *strcat( char *strDestination, const char *strSource );
char *strcpy( char *strDestination, const char *strSource );
int strcmp( const char *string1, const char *string2 );
char *strchr( const char *string, int c );
char *strrchr( const char *string, int c );
char *strstr( const char *string, const char *strCharSet );
char *strncpy( char *strDest, const char *strSource, size_t count );
int tolower( int c );
int toupper( int c );
double atof( const char *string );
double _atof( const char **stringPtr );
int atoi( const char *string );
int _atoi( const char **stringPtr );
int vsprintf( char *buffer, const char *fmt, va_list argptr );
int sscanf( const char *buffer, const char *fmt, ... );
// Memory functions
void *memmove( void *dest, const void *src, size_t count );
void *memset( void *dest, int c, size_t count );
void *memcpy( void *dest, const void *src, size_t count );
// Math functions
double ceil( double x );
double floor( double x );
double sqrt( double x );
double sin( double x );
double cos( double x );
double atan2( double y, double x );
double tan( double x );
int abs( int n );
double fabs( double x );
double acos( double x );
float pow( float x, float y );
double rint( double v );
#endif // BG_LIB_H
-88
View File
@@ -1,88 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// bg_local.h -- local definitions for the bg (both games) files
#define MIN_WALK_NORMAL 0.7f // can't walk on very steep slopes
#define STEPSIZE 18
#define TIMER_LAND 130
#define TIMER_GESTURE (34*66+50)
#define TIMER_ATTACK 500 //nonsegmented models
#define OVERCLIP 1.001f
#define FALLING_THRESHOLD -900.0f //what vertical speed to start falling sound at
// all of the locals will be zeroed before each
// pmove, just to make damn sure we don't have
// any differences when running on client or server
typedef struct
{
vec3_t forward, right, up;
float frametime;
int msec;
qboolean walking;
qboolean groundPlane;
qboolean ladder;
trace_t groundTrace;
float impactSpeed;
vec3_t previous_origin;
vec3_t previous_velocity;
int previous_waterlevel;
} pml_t;
extern pmove_t *pm;
extern pml_t pml;
// movement parameters
extern float pm_stopspeed;
extern float pm_duckScale;
extern float pm_swimScale;
extern float pm_wadeScale;
extern float pm_accelerate;
extern float pm_airaccelerate;
extern float pm_wateraccelerate;
extern float pm_flyaccelerate;
extern float pm_friction;
extern float pm_waterfriction;
extern float pm_flightfriction;
extern int c_pmove;
void PM_ClipVelocity( vec3_t in, vec3_t normal, vec3_t out, float overbounce );
void PM_AddTouchEnt( int entityNum );
void PM_AddEvent( int newEvent );
qboolean PM_SlideMove( qboolean gravity );
void PM_StepEvent( vec3_t from, vec3_t to, vec3_t normal );
qboolean PM_StepSlideMove( qboolean gravity, qboolean predictive );
qboolean PM_PredictStepMove( void );
-5904
View File
File diff suppressed because it is too large. Load diff
-3535
View File
File diff suppressed because it is too large. Load diff
-1357
View File
File diff suppressed because it is too large. Load diff
-416
View File
@@ -1,416 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// bg_slidemove.c -- part of bg_pmove functionality
#include "../qcommon/q_shared.h"
#include "bg_public.h"
#include "bg_local.h"
/*
input: origin, velocity, bounds, groundPlane, trace function
output: origin, velocity, impacts, stairup boolean
*/
/*
==================
PM_SlideMove
Returns qtrue if the velocity was clipped in some way
==================
*/
#define MAX_CLIP_PLANES 5
qboolean PM_SlideMove( qboolean gravity )
{
int bumpcount, numbumps;
vec3_t dir;
float d;
int numplanes;
vec3_t planes[MAX_CLIP_PLANES];
vec3_t primal_velocity;
vec3_t clipVelocity;
int i, j, k;
trace_t trace;
vec3_t end;
float time_left;
float into;
vec3_t endVelocity;
vec3_t endClipVelocity;
numbumps = 4;
VectorCopy( pm->ps->velocity, primal_velocity );
if( gravity )
{
VectorCopy( pm->ps->velocity, endVelocity );
endVelocity[ 2 ] -= pm->ps->gravity * pml.frametime;
pm->ps->velocity[ 2 ] = ( pm->ps->velocity[ 2 ] + endVelocity[ 2 ] ) * 0.5;
primal_velocity[ 2 ] = endVelocity[ 2 ];
if( pml.groundPlane )
{
// slide along the ground plane
PM_ClipVelocity( pm->ps->velocity, pml.groundTrace.plane.normal,
pm->ps->velocity, OVERCLIP );
}
}
time_left = pml.frametime;
// never turn against the ground plane
if( pml.groundPlane )
{
numplanes = 1;
VectorCopy( pml.groundTrace.plane.normal, planes[ 0 ] );
}
else
numplanes = 0;
// never turn against original velocity
VectorNormalize2( pm->ps->velocity, planes[ numplanes ] );
numplanes++;
for( bumpcount = 0; bumpcount < numbumps; bumpcount++ )
{
// calculate position we are trying to move to
VectorMA( pm->ps->origin, time_left, pm->ps->velocity, end );
// see if we can make it there
pm->trace( &trace, pm->ps->origin, pm->mins, pm->maxs, end, pm->ps->clientNum, pm->tracemask );
if( trace.allsolid )
{
// entity is completely trapped in another solid
pm->ps->velocity[ 2 ] = 0; // don't build up falling damage, but allow sideways acceleration
return qtrue;
}
if( trace.fraction > 0 )
{
// actually covered some distance
VectorCopy( trace.endpos, pm->ps->origin );
}
if( trace.fraction == 1 )
break; // moved the entire distance
// save entity for contact
PM_AddTouchEnt( trace.entityNum );
time_left -= time_left * trace.fraction;
if( numplanes >= MAX_CLIP_PLANES )
{
// this shouldn't really happen
VectorClear( pm->ps->velocity );
return qtrue;
}
//
// if this is the same plane we hit before, nudge velocity
// out along it, which fixes some epsilon issues with
// non-axial planes
//
for( i = 0 ; i < numplanes ; i++ )
{
if( DotProduct( trace.plane.normal, planes[i] ) > 0.99 )
{
VectorAdd( trace.plane.normal, pm->ps->velocity, pm->ps->velocity );
break;
}
}
if( i < numplanes )
continue;
VectorCopy( trace.plane.normal, planes[ numplanes ] );
numplanes++;
//
// modify velocity so it parallels all of the clip planes
//
// find a plane that it enters
for( i = 0; i < numplanes; i++ )
{
into = DotProduct( pm->ps->velocity, planes[ i ] );
if( into >= 0.1 )
continue; // move doesn't interact with the plane
// see how hard we are hitting things
if( -into > pml.impactSpeed )
pml.impactSpeed = -into;
// slide along the plane
PM_ClipVelocity( pm->ps->velocity, planes[ i ], clipVelocity, OVERCLIP );
// slide along the plane
PM_ClipVelocity( endVelocity, planes[ i ], endClipVelocity, OVERCLIP );
// see if there is a second plane that the new move enters
for( j = 0; j < numplanes; j++ )
{
if( j == i )
continue;
if( DotProduct( clipVelocity, planes[ j ] ) >= 0.1 )
continue; // move doesn't interact with the plane
// try clipping the move to the plane
PM_ClipVelocity( clipVelocity, planes[ j ], clipVelocity, OVERCLIP );
PM_ClipVelocity( endClipVelocity, planes[ j ], endClipVelocity, OVERCLIP );
// see if it goes back into the first clip plane
if( DotProduct( clipVelocity, planes[ i ] ) >= 0 )
continue;
// slide the original velocity along the crease
CrossProduct( planes[ i ], planes[ j ], dir );
VectorNormalize( dir );
d = DotProduct( dir, pm->ps->velocity );
VectorScale( dir, d, clipVelocity );
CrossProduct( planes[ i ], planes[ j ], dir);
VectorNormalize( dir );
d = DotProduct( dir, endVelocity );
VectorScale( dir, d, endClipVelocity );
// see if there is a third plane the the new move enters
for( k = 0; k < numplanes; k++ )
{
if( k == i || k == j )
continue;
if( DotProduct( clipVelocity, planes[ k ] ) >= 0.1 )
continue; // move doesn't interact with the plane
// stop dead at a tripple plane interaction
VectorClear( pm->ps->velocity );
return qtrue;
}
}
// if we have fixed all interactions, try another move
VectorCopy( clipVelocity, pm->ps->velocity );
VectorCopy( endClipVelocity, endVelocity );
break;
}
}
if( gravity )
VectorCopy( endVelocity, pm->ps->velocity );
// don't change velocity if in a timer (FIXME: is this correct?)
if( pm->ps->pm_time )
VectorCopy( primal_velocity, pm->ps->velocity );
return ( bumpcount != 0 );
}
/*
==================
PM_StepEvent
==================
*/
void PM_StepEvent( vec3_t from, vec3_t to, vec3_t normal )
{
float size;
vec3_t delta, dNormal;
VectorSubtract( from, to, delta );
VectorCopy( delta, dNormal );
VectorNormalize( dNormal );
size = DotProduct( normal, dNormal ) * VectorLength( delta );
if( size > 0.0f )
{
if( size > 2.0f )
{
if( size < 7.0f )
PM_AddEvent( EV_STEPDN_4 );
else if( size < 11.0f )
PM_AddEvent( EV_STEPDN_8 );
else if( size < 15.0f )
PM_AddEvent( EV_STEPDN_12 );
else
PM_AddEvent( EV_STEPDN_16 );
}
}
else
{
size = fabs( size );
if( size > 2.0f )
{
if( size < 7.0f )
PM_AddEvent( EV_STEP_4 );
else if( size < 11.0f )
PM_AddEvent( EV_STEP_8 );
else if( size < 15.0f )
PM_AddEvent( EV_STEP_12 );
else
PM_AddEvent( EV_STEP_16 );
}
}
if( pm->debugLevel )
Com_Printf( "%i:stepped\n", c_pmove );
}
/*
==================
PM_StepSlideMove
==================
*/
qboolean PM_StepSlideMove( qboolean gravity, qboolean predictive )
{
vec3_t start_o, start_v;
vec3_t down_o, down_v;
trace_t trace;
vec3_t normal;
vec3_t step_v, step_vNormal;
vec3_t up, down;
float stepSize;
qboolean stepped = qfalse;
if( pm->ps->stats[ STAT_STATE ] & SS_WALLCLIMBING )
{
if( pm->ps->stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING )
VectorSet( normal, 0.0f, 0.0f, -1.0f );
else
VectorCopy( pm->ps->grapplePoint, normal );
}
else
VectorSet( normal, 0.0f, 0.0f, 1.0f );
VectorCopy( pm->ps->origin, start_o );
VectorCopy( pm->ps->velocity, start_v );
if( PM_SlideMove( gravity ) == 0 )
{
VectorCopy( start_o, down );
VectorMA( down, -STEPSIZE, normal, down );
pm->trace( &trace, start_o, pm->mins, pm->maxs, down, pm->ps->clientNum, pm->tracemask );
//we can step down
if( trace.fraction > 0.01f && trace.fraction < 1.0f &&
!trace.allsolid && pml.groundPlane != qfalse )
{
if( pm->debugLevel )
Com_Printf( "%d: step down\n", c_pmove );
stepped = qtrue;
}
}
else
{
VectorCopy( start_o, down );
VectorMA( down, -STEPSIZE, normal, down );
pm->trace( &trace, start_o, pm->mins, pm->maxs, down, pm->ps->clientNum, pm->tracemask );
// never step up when you still have up velocity
if( DotProduct( trace.plane.normal, pm->ps->velocity ) > 0.0f &&
( trace.fraction == 1.0f || DotProduct( trace.plane.normal, normal ) < 0.7f ) )
{
return stepped;
}
VectorCopy( pm->ps->origin, down_o );
VectorCopy( pm->ps->velocity, down_v );
VectorCopy( start_o, up );
VectorMA( up, STEPSIZE, normal, up );
// test the player position if they were a stepheight higher
pm->trace( &trace, start_o, pm->mins, pm->maxs, up, pm->ps->clientNum, pm->tracemask );
if( trace.allsolid )
{
if( pm->debugLevel )
Com_Printf( "%i:bend can't step\n", c_pmove );
return stepped; // can't step up
}
VectorSubtract( trace.endpos, start_o, step_v );
VectorCopy( step_v, step_vNormal );
VectorNormalize( step_vNormal );
stepSize = DotProduct( normal, step_vNormal ) * VectorLength( step_v );
// try slidemove from this position
VectorCopy( trace.endpos, pm->ps->origin );
VectorCopy( start_v, pm->ps->velocity );
if( PM_SlideMove( gravity ) == 0 )
{
if( pm->debugLevel )
Com_Printf( "%d: step up\n", c_pmove );
stepped = qtrue;
}
// push down the final amount
VectorCopy( pm->ps->origin, down );
VectorMA( down, -stepSize, normal, down );
pm->trace( &trace, pm->ps->origin, pm->mins, pm->maxs, down, pm->ps->clientNum, pm->tracemask );
if( !trace.allsolid )
VectorCopy( trace.endpos, pm->ps->origin );
if( trace.fraction < 1.0f )
PM_ClipVelocity( pm->ps->velocity, trace.plane.normal, pm->ps->velocity, OVERCLIP );
}
if( !predictive && stepped )
PM_StepEvent( start_o, pm->ps->origin, normal );
return stepped;
}
/*
==================
PM_PredictStepMove
==================
*/
qboolean PM_PredictStepMove( void )
{
vec3_t velocity, origin;
float impactSpeed;
qboolean stepped = qfalse;
VectorCopy( pm->ps->velocity, velocity );
VectorCopy( pm->ps->origin, origin );
impactSpeed = pml.impactSpeed;
if( PM_StepSlideMove( qfalse, qtrue ) )
stepped = qtrue;
VectorCopy( velocity, pm->ps->velocity );
VectorCopy( origin, pm->ps->origin );
pml.impactSpeed = impactSpeed;
return stepped;
}
-2102
View File
File diff suppressed because it is too large. Load diff
-7530
View File
File diff suppressed because it is too large. Load diff
-280
View File
@@ -1,280 +0,0 @@
/*
===========================================================================
Copyright (C) 2004-2006 Tony J. White
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#ifndef _G_ADMIN_H
#define _G_ADMIN_H
#define AP(x) trap_SendServerCommand(-1, x)
#define CP(x) trap_SendServerCommand(ent-g_entities, x)
#define CPx(x, y) trap_SendServerCommand(x, y)
#define ADMP(x) G_admin_print(ent, x)
#define ADMBP(x) G_admin_buffer_print(ent, x)
#define ADMBP_begin() G_admin_buffer_begin()
#define ADMBP_end() G_admin_buffer_end(ent)
#define MAX_ADMIN_LEVELS 32
#define MAX_ADMIN_ADMINS 2048
#define MAX_ADMIN_BANS 1024
#define MAX_ADMIN_NAMELOGS 128
#define MAX_ADMIN_NAMELOG_NAMES 5
#define MAX_ADMIN_ADMINLOGS 128
#define MAX_ADMIN_ADMINLOG_ARGS 50
#define MAX_ADMIN_TKLOGS 64
#define MAX_ADMIN_FLAGS 128
#define MAX_ADMIN_COMMANDS 128
#define MAX_ADMIN_CMD_LEN 20
#define MAX_ADMIN_BAN_REASON 50
#define MAX_ADMIN_BANSUSPEND_DAYS 14
#define CHAT_MAXCHAN 10
#define CHAT_MAXPASS 12
/*
* 1 - cannot be vote kicked, vote muted
* 2 - cannot be censored or flood protected TODO
* 3 - never loses credits for changing teams
* 4 - can see team chat as a spectator
* 5 - can switch teams any time, regardless of balance
* 6 - does not need to specify a reason for a kick/ban
* 7 - can call a vote at any time (regardless of a vote being disabled or
* voting limitations)
* 8 - does not need to specify a duration for a ban
* 9 - can run commands from team chat
* 0 - inactivity rules do not apply to them
* ! - admin commands cannot be used on them
* @ - does not show up as an admin in !listplayers
* $ - sees all information in !listplayers
* # - permanent designated builder
* ? - sees and can use adminchat
*/
#define ADMF_IMMUNITY '1'
#define ADMF_NOCENSORFLOOD '2' /* TODO */
#define ADMF_TEAMCHANGEFREE '3'
#define ADMF_SPEC_ALLCHAT '4'
#define ADMF_FORCETEAMCHANGE '5'
#define ADMF_UNACCOUNTABLE '6'
#define ADMF_NO_VOTE_LIMIT '7'
#define ADMF_CAN_PERM_BAN '8'
#define ADMF_TEAMCHAT_CMD '9'
#define ADMF_ACTIVITY '0'
#define ADMF_IMMUTABLE '!'
#define ADMF_INCOGNITO '@'
#define ADMF_SEESFULLLISTPLAYERS '$'
#define ADMF_DBUILDER '#'
#define ADMF_ADMINCHAT '?'
#define ADMF_BUILDCHECK ')'
#define ADMF_BANIMMUNITY '&'
#define MAX_ADMIN_LISTITEMS 20
#define MAX_ADMIN_SHOWBANS 10
#define MAX_ADMIN_MAPLOG_LENGTH 5
// important note: QVM does not seem to allow a single char to be a
// member of a struct at init time. flag has been converted to char*
typedef struct
{
char *keyword;
qboolean ( * handler ) ( gentity_t *ent, int skiparg );
char *flag;
char *function; // used for !help
char *syntax; // used for !help
}
g_admin_cmd_t;
typedef struct g_admin_level
{
int level;
char name[ MAX_NAME_LENGTH ];
char flags[ MAX_ADMIN_FLAGS ];
}
g_admin_level_t;
typedef struct g_admin_admin
{
char guid[ 33 ];
char name[ MAX_NAME_LENGTH ];
int level;
char flags[ MAX_ADMIN_FLAGS ];
int seen;
char chat[ CHAT_MAXCHAN ][ CHAT_MAXPASS ];
}
g_admin_admin_t;
typedef struct g_admin_ban
{
char name[ MAX_NAME_LENGTH ];
char guid[ 33 ];
char ip[ 18 ];
char reason[ MAX_ADMIN_BAN_REASON ];
char made[ 18 ]; // big enough for strftime() %c
int expires;
int suspend;
char banner[ MAX_NAME_LENGTH ];
}
g_admin_ban_t;
typedef struct g_admin_command
{
char command[ MAX_ADMIN_CMD_LEN ];
char exec[ MAX_QPATH ];
char desc[ 50 ];
int levels[ MAX_ADMIN_LEVELS + 1 ];
}
g_admin_command_t;
typedef struct g_admin_namelog
{
char name[ MAX_ADMIN_NAMELOG_NAMES ][MAX_NAME_LENGTH ];
char ip[ 16 ];
char guid[ 33 ];
int slot;
qboolean banned;
}
g_admin_namelog_t;
typedef struct g_admin_adminlog
{
char name[ MAX_NAME_LENGTH ];
char command[ MAX_ADMIN_CMD_LEN ];
char args[ MAX_ADMIN_ADMINLOG_ARGS ];
int id;
int time;
int level;
qboolean success;
}
g_admin_adminlog_t;
typedef struct g_admin_tklog
{
char name[ MAX_NAME_LENGTH ];
char victim[ MAX_NAME_LENGTH ];
int id;
int time;
int damage;
int value;
int team;
int weapon;
}
g_admin_tklog_t;
qboolean G_admin_ban_check( char *userinfo, char *reason, int rlen );
qboolean G_admin_cmd_check( gentity_t *ent, qboolean say );
qboolean G_admin_readconfig( gentity_t *ent, int skiparg );
qboolean G_admin_permission( gentity_t *ent, char flag );
qboolean G_admin_name_check( gentity_t *ent, char *name, char *err, int len );
void G_admin_namelog_update( gclient_t *ent, qboolean disconnect );
int G_admin_level( gentity_t *ent );
// ! command functions
qboolean G_admin_time( gentity_t *ent, int skiparg );
qboolean G_admin_setlevel( gentity_t *ent, int skiparg );
qboolean G_admin_kick( gentity_t *ent, int skiparg );
qboolean G_admin_adjustban( gentity_t *ent, int skiparg );
qboolean G_admin_ban( gentity_t *ent, int skiparg );
qboolean G_admin_unban( gentity_t *ent, int skiparg );
qboolean G_admin_putteam( gentity_t *ent, int skiparg );
qboolean G_admin_listadmins( gentity_t *ent, int skiparg );
qboolean G_admin_listlayouts( gentity_t *ent, int skiparg );
qboolean G_admin_listplayers( gentity_t *ent, int skiparg );
qboolean G_admin_map( gentity_t *ent, int skiparg );
qboolean G_admin_devmap( gentity_t *ent, int skiparg );
qboolean G_admin_layoutsave( gentity_t *ent, int skiparg );
qboolean G_admin_mute( gentity_t *ent, int skiparg );
qboolean G_admin_denybuild( gentity_t *ent, int skiparg );
qboolean G_admin_denyweapon( gentity_t *ent, int skiparg );
qboolean G_admin_showbans( gentity_t *ent, int skiparg );
qboolean G_admin_help( gentity_t *ent, int skiparg );
qboolean G_admin_admintest( gentity_t *ent, int skiparg );
qboolean G_admin_allready( gentity_t *ent, int skiparg );
qboolean G_admin_cancelvote( gentity_t *ent, int skiparg );
qboolean G_admin_passvote( gentity_t *ent, int skiparg );
qboolean G_admin_spec999( gentity_t *ent, int skiparg );
qboolean G_admin_register( gentity_t *ent, int skiparg );
qboolean G_admin_rename( gentity_t *ent, int skiparg );
qboolean G_admin_restart( gentity_t *ent, int skiparg );
qboolean G_admin_nextmap( gentity_t *ent, int skiparg );
qboolean G_admin_namelog( gentity_t *ent, int skiparg );
qboolean G_admin_lock( gentity_t *ent, int skiparg );
qboolean G_admin_unlock( gentity_t *ent, int skiparg );
qboolean G_admin_L1( gentity_t *ent, int skiparg );
qboolean G_admin_info( gentity_t *ent, int skiparg );
void G_admin_info_parse( char *unparsed, char *dest, int maxlength );
qboolean G_admin_putmespec( gentity_t *ent, int skiparg );
qboolean G_admin_warn( gentity_t *ent, int skiparg );
qboolean G_admin_designate( gentity_t *ent, int skiparg );
//added
qboolean G_admin_forcespec( gentity_t *ent, int skiparg );
qboolean G_admin_unforcespec( gentity_t *ent, int skiparg );
qboolean G_admin_pause( gentity_t *ent, int skiparg );
qboolean G_admin_practice( gentity_t *ent, int skiparg );
qboolean G_admin_buildlog( gentity_t *ent, int skiparg );
qboolean G_admin_revert( gentity_t *ent, int skiparg );
qboolean G_admin_slap( gentity_t *ent, int skiparg );
qboolean G_admin_L0( gentity_t *ent, int skiparg );
qboolean G_admin_seen(gentity_t *ent, int skiparg );
void G_admin_seen_update( char *guid );
qboolean G_admin_listmaps( gentity_t *ent, int skiparg );
qboolean G_admin_flag( gentity_t *ent, int skiparg );
qboolean G_admin_immunity( gentity_t *ent, int skiparg );
qboolean G_admin_suspendban( gentity_t *ent, int skiparg );
qboolean G_admin_demo( gentity_t *ent, int skiparg );
qboolean G_admin_adminlog( gentity_t *ent, int skiparg );
void G_admin_adminlog_cleanup( void );
void G_admin_adminlog_log( gentity_t *ent, char *command, char *args, int skiparg, qboolean success );
qboolean G_admin_tklog( gentity_t *ent, int skiparg );
void G_admin_tklog_cleanup( void );
void G_admin_tklog_log( gentity_t *attacker, gentity_t *victim, int meansOfDeath );
qboolean G_admin_maplog( gentity_t *ent, int skiparg );
void G_admin_maplog_update( void );
void G_admin_maplog_result( char *flag );
void G_admin_chat_writeconfig( void );
qboolean G_admin_chat_readconfig( gentity_t *ent );
void G_admin_chat_sync( gentity_t *ent );
void G_admin_chat_update( gentity_t *ent, int chan );
qboolean G_admin_drop( gentity_t *ent, int skiparg );
qboolean G_admin_cp( gentity_t *ent, int skiparg );
qboolean G_admin_credits( gentity_t *ent, int skiparg );
qboolean G_admin_outlaw( gentity_t *ent, int skiparg );
qboolean G_admin_fireworks( gentity_t *ent, int skiparg );
qboolean G_admin_nobuild( gentity_t *ent, int skiparg );
qboolean G_admin_nobuildsave( gentity_t *ent, int skiparg );
qboolean G_admin_grab( gentity_t *ent, int skiparg );
qboolean G_admin_bring( gentity_t *ent, int skiparg );
qboolean G_admin_lockname( gentity_t *ent, int skiparg );
qboolean G_admin_bubble( gentity_t *ent, int skiparg );
void G_admin_print( gentity_t *ent, char *m );
void G_admin_buffer_print( gentity_t *ent, char *m );
void G_admin_buffer_begin( void );
void G_admin_buffer_end( gentity_t *ent );
void G_admin_duration( int secs, char *duration, int dursize );
void G_admin_cleanup( void );
void G_admin_namelog_cleanup( void );
#endif /* ifndef _G_ADMIN_H */
File diff suppressed because it is too large. Load diff
-1945
View File
File diff suppressed because it is too large. Load diff
-5650
View File
File diff suppressed because it is too large. Load diff
-1897
View File
File diff suppressed because it is too large. Load diff
-1521
View File
File diff suppressed because it is too large. Load diff
-2955
View File
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-216
View File
@@ -1,216 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#include "g_local.h"
#define POOLSIZE ( 1024 * 1024 )
#define FREEMEMCOOKIE ((int)0xDEADBE3F) // Any unlikely to be used value
#define ROUNDBITS 31 // Round to 32 bytes
struct freememnode
{
// Size of ROUNDBITS
int cookie, size; // Size includes node (obviously)
struct freememnode *prev, *next;
};
static char memoryPool[POOLSIZE];
static struct freememnode *freehead;
static int freemem;
void *G_Alloc( int size )
{
// Find a free block and allocate.
// Does two passes, attempts to fill same-sized free slot first.
struct freememnode *fmn, *prev, *next, *smallest;
int allocsize, smallestsize;
char *endptr;
int *ptr;
allocsize = ( size + sizeof(int) + ROUNDBITS ) & ~ROUNDBITS; // Round to 32-byte boundary
ptr = NULL;
smallest = NULL;
smallestsize = POOLSIZE + 1; // Guaranteed not to miss any slots :)
for( fmn = freehead; fmn; fmn = fmn->next )
{
if( fmn->cookie != FREEMEMCOOKIE )
G_Error( "G_Alloc: Memory corruption detected!\n" );
if( fmn->size >= allocsize )
{
// We've got a block
if( fmn->size == allocsize )
{
// Same size, just remove
prev = fmn->prev;
next = fmn->next;
if( prev )
prev->next = next; // Point previous node to next
if( next )
next->prev = prev; // Point next node to previous
if( fmn == freehead )
freehead = next; // Set head pointer to next
ptr = (int *) fmn;
break; // Stop the loop, this is fine
}
else
{
// Keep track of the smallest free slot
if( fmn->size < smallestsize )
{
smallest = fmn;
smallestsize = fmn->size;
}
}
}
}
if( !ptr && smallest )
{
// We found a slot big enough
smallest->size -= allocsize;
endptr = (char *) smallest + smallest->size;
ptr = (int *) endptr;
}
if( ptr )
{
freemem -= allocsize;
if( g_debugAlloc.integer )
G_Printf( "G_Alloc of %i bytes (%i left)\n", allocsize, freemem );
memset( ptr, 0, allocsize );
*ptr++ = allocsize; // Store a copy of size for deallocation
return( (void *) ptr );
}
G_Error( "G_Alloc: failed on allocation of %i bytes\n", size );
return( NULL );
}
void G_Free( void *ptr )
{
// Release allocated memory, add it to the free list.
struct freememnode *fmn;
char *freeend;
int *freeptr;
freeptr = ptr;
freeptr--;
freemem += *freeptr;
if( g_debugAlloc.integer )
G_Printf( "G_Free of %i bytes (%i left)\n", *freeptr, freemem );
for( fmn = freehead; fmn; fmn = fmn->next )
{
freeend = ((char *) fmn) + fmn->size;
if( freeend == (char *) freeptr )
{
// Released block can be merged to an existing node
fmn->size += *freeptr; // Add size of node.
return;
}
}
// No merging, add to head of list
fmn = (struct freememnode *) freeptr;
fmn->size = *freeptr; // Set this first to avoid corrupting *freeptr
fmn->cookie = FREEMEMCOOKIE;
fmn->prev = NULL;
fmn->next = freehead;
freehead->prev = fmn;
freehead = fmn;
}
void G_InitMemory( void )
{
// Set up the initial node
freehead = (struct freememnode *)memoryPool;
freehead->cookie = FREEMEMCOOKIE;
freehead->size = POOLSIZE;
freehead->next = NULL;
freehead->prev = NULL;
freemem = sizeof( memoryPool );
}
void G_DefragmentMemory( void )
{
// If there's a frenzy of deallocation and we want to
// allocate something big, this is useful. Otherwise...
// not much use.
struct freememnode *startfmn, *endfmn, *fmn;
for( startfmn = freehead; startfmn; )
{
endfmn = (struct freememnode *)(((char *) startfmn) + startfmn->size);
for( fmn = freehead; fmn; )
{
if( fmn->cookie != FREEMEMCOOKIE )
G_Error( "G_DefragmentMemory: Memory corruption detected!\n" );
if( fmn == endfmn )
{
// We can add fmn onto startfmn.
if( fmn->prev )
fmn->prev->next = fmn->next;
if( fmn->next )
{
if( !(fmn->next->prev = fmn->prev) )
freehead = fmn->next; // We're removing the head node
}
startfmn->size += fmn->size;
memset( fmn, 0, sizeof(struct freememnode) ); // A redundant call, really.
startfmn = freehead;
endfmn = fmn = NULL; // Break out of current loop
}
else
fmn = fmn->next;
}
if( endfmn )
startfmn = startfmn->next; // endfmn acts as a 'restart' flag here
}
}
void Svcmd_GameMem_f( void )
{
// Give a breakdown of memory
struct freememnode *fmn;
G_Printf( "Game memory status: %i out of %i bytes allocated\n", POOLSIZE - freemem, POOLSIZE );
for( fmn = freehead; fmn; fmn = fmn->next )
G_Printf( " %dd: %d bytes free.\n", fmn, fmn->size );
G_Printf( "Status complete.\n" );
}
-436
View File
@@ -1,436 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#include "g_local.h"
/*QUAKED func_group (0 0 0) ?
Used to group brushes together just for editor convenience. They are turned into normal brushes by the utilities.
*/
/*QUAKED info_null (0 0.5 0) (-4 -4 -4) (4 4 4)
Used as a positional target for calculations in the utilities (spotlights, etc), but removed during gameplay.
*/
void SP_info_null( gentity_t *self )
{
G_FreeEntity( self );
}
/*QUAKED info_notnull (0 0.5 0) (-4 -4 -4) (4 4 4)
Used as a positional target for in-game calculation, like jumppad targets.
target_position does the same thing
*/
void SP_info_notnull( gentity_t *self )
{
G_SetOrigin( self, self->s.origin );
}
/*QUAKED light (0 1 0) (-8 -8 -8) (8 8 8) linear
Non-displayed light.
"light" overrides the default 300 intensity.
Linear checbox gives linear falloff instead of inverse square
Lights pointed at a target will be spotlights.
"radius" overrides the default 64 unit radius of a spotlight at the target point.
*/
void SP_light( gentity_t *self )
{
G_FreeEntity( self );
}
/*
=================================================================================
TELEPORTERS
=================================================================================
*/
void TeleportPlayer( gentity_t *player, vec3_t origin, vec3_t angles )
{
// unlink to make sure it can't possibly interfere with G_KillBox
trap_UnlinkEntity( player );
VectorCopy( origin, player->client->ps.origin );
player->client->ps.origin[ 2 ] += 1;
// spit the player out
AngleVectors( angles, player->client->ps.velocity, NULL, NULL );
VectorScale( player->client->ps.velocity, 400, player->client->ps.velocity );
player->client->ps.pm_time = 160; // hold time
player->client->ps.pm_flags |= PMF_TIME_KNOCKBACK;
// toggle the teleport bit so the client knows to not lerp
player->client->ps.eFlags ^= EF_TELEPORT_BIT;
G_UnlaggedClear( player );
// set angles
SetClientViewAngle( player, angles );
// kill anything at the destination
if( player->client->sess.sessionTeam != TEAM_SPECTATOR )
G_KillBox( player );
// save results of pmove
BG_PlayerStateToEntityState( &player->client->ps, &player->s, qtrue );
// use the precise origin for linking
VectorCopy( player->client->ps.origin, player->r.currentOrigin );
if( player->client->sess.sessionTeam != TEAM_SPECTATOR )
trap_LinkEntity (player);
}
/*QUAKED misc_teleporter_dest (1 0 0) (-32 -32 -24) (32 32 -16)
Point teleporters at these.
Now that we don't have teleport destination pads, this is just
an info_notnull
*/
void SP_misc_teleporter_dest( gentity_t *ent )
{
}
//===========================================================
/*QUAKED misc_model (1 0 0) (-16 -16 -16) (16 16 16)
"model" arbitrary .md3 file to display
*/
void SP_misc_model( gentity_t *ent )
{
#if 0
ent->s.modelindex = G_ModelIndex( ent->model );
VectorSet (ent->mins, -16, -16, -16);
VectorSet (ent->maxs, 16, 16, 16);
trap_LinkEntity (ent);
G_SetOrigin( ent, ent->s.origin );
VectorCopy( ent->s.angles, ent->s.apos.trBase );
#else
G_FreeEntity( ent );
#endif
}
//===========================================================
void locateCamera( gentity_t *ent )
{
vec3_t dir;
gentity_t *target;
gentity_t *owner;
owner = G_PickTarget( ent->target );
if( !owner )
{
G_Printf( "Couldn't find target for misc_portal_surface\n" );
G_FreeEntity( ent );
return;
}
ent->r.ownerNum = owner->s.number;
// frame holds the rotate speed
if( owner->spawnflags & 1 )
ent->s.frame = 25;
else if( owner->spawnflags & 2 )
ent->s.frame = 75;
// swing camera ?
if( owner->spawnflags & 4 )
{
// set to 0 for no rotation at all
ent->s.powerups = 0;
}
else
ent->s.powerups = 1;
// clientNum holds the rotate offset
ent->s.clientNum = owner->s.clientNum;
VectorCopy( owner->s.origin, ent->s.origin2 );
// see if the portal_camera has a target
target = G_PickTarget( owner->target );
if( target )
{
VectorSubtract( target->s.origin, owner->s.origin, dir );
VectorNormalize( dir );
}
else
G_SetMovedir( owner->s.angles, dir );
ent->s.eventParm = DirToByte( dir );
}
/*QUAKED misc_portal_surface (0 0 1) (-8 -8 -8) (8 8 8)
The portal surface nearest this entity will show a view from the targeted misc_portal_camera, or a mirror view if untargeted.
This must be within 64 world units of the surface!
*/
void SP_misc_portal_surface( gentity_t *ent )
{
VectorClear( ent->r.mins );
VectorClear( ent->r.maxs );
trap_LinkEntity( ent );
ent->r.svFlags = SVF_PORTAL;
ent->s.eType = ET_PORTAL;
if( !ent->target )
{
VectorCopy( ent->s.origin, ent->s.origin2 );
}
else
{
ent->think = locateCamera;
ent->nextthink = level.time + 100;
}
}
/*QUAKED misc_portal_camera (0 0 1) (-8 -8 -8) (8 8 8) slowrotate fastrotate noswing
The target for a misc_portal_director. You can set either angles or target another entity to determine the direction of view.
"roll" an angle modifier to orient the camera around the target vector;
*/
void SP_misc_portal_camera( gentity_t *ent )
{
float roll;
VectorClear( ent->r.mins );
VectorClear( ent->r.maxs );
trap_LinkEntity( ent );
G_SpawnFloat( "roll", "0", &roll );
ent->s.clientNum = roll / 360.0f * 256;
}
/*
======================================================================
NEAT EFFECTS AND STUFF FOR TREMULOUS
======================================================================
*/
void SP_toggle_particle_system( gentity_t *self )
{
//toggle EF_NODRAW
self->s.eFlags ^= EF_NODRAW;
self->nextthink = 0;
}
/*
===============
SP_use_particle_system
Use function for particle_system
===============
*/
void SP_use_particle_system( gentity_t *self, gentity_t *other, gentity_t *activator )
{
SP_toggle_particle_system( self );
if( self->wait > 0.0f )
{
self->think = SP_toggle_particle_system;
self->nextthink = level.time + (int)( self->wait * 1000 );
}
}
/*
===============
SP_spawn_particle_system
Spawn function for particle system
===============
*/
void SP_misc_particle_system( gentity_t *self )
{
char *s;
G_SetOrigin( self, self->s.origin );
G_SpawnString( "psName", "", &s );
G_SpawnFloat( "wait", "0", &self->wait );
//add the particle system to the client precache list
self->s.modelindex = G_ParticleSystemIndex( s );
if( self->spawnflags & 1 )
self->s.eFlags |= EF_NODRAW;
self->use = SP_use_particle_system;
self->s.eType = ET_PARTICLE_SYSTEM;
trap_LinkEntity( self );
}
/*
===============
SP_use_anim_model
Use function for anim model
===============
*/
void SP_use_anim_model( gentity_t *self, gentity_t *other, gentity_t *activator )
{
if( self->spawnflags & 1 )
{
//if spawnflag 1 is set
//toggle EF_NODRAW
if( self->s.eFlags & EF_NODRAW )
self->s.eFlags &= ~EF_NODRAW;
else
self->s.eFlags |= EF_NODRAW;
}
else
{
//if the animation loops then toggle the animation
//toggle EF_MOVER_STOP
if( self->s.eFlags & EF_MOVER_STOP )
self->s.eFlags &= ~EF_MOVER_STOP;
else
self->s.eFlags |= EF_MOVER_STOP;
}
}
/*
===============
SP_misc_anim_model
Spawn function for anim model
===============
*/
void SP_misc_anim_model( gentity_t *self )
{
self->s.powerups = (int)self->animation[ 0 ];
self->s.weapon = (int)self->animation[ 1 ];
self->s.torsoAnim = (int)self->animation[ 2 ];
self->s.legsAnim = (int)self->animation[ 3 ];
self->s.angles2[ 0 ] = self->pos2[ 0 ];
//add the model to the client precache list
self->s.modelindex = G_ModelIndex( self->model );
self->use = SP_use_anim_model;
self->s.eType = ET_ANIMMAPOBJ;
// spawn with animation stopped
if( self->spawnflags & 2 )
self->s.eFlags |= EF_MOVER_STOP;
trap_LinkEntity( self );
}
/*
===============
SP_use_light_flare
Use function for light flare
===============
*/
void SP_use_light_flare( gentity_t *self, gentity_t *other, gentity_t *activator )
{
self->s.eFlags ^= EF_NODRAW;
}
/*
===============
findEmptySpot
Finds an empty spot radius units from origin
==============
*/
static void findEmptySpot( vec3_t origin, float radius, vec3_t spot )
{
int i, j, k;
vec3_t delta, test, total;
trace_t tr;
VectorClear( total );
//54(!) traces to test for empty spots
for( i = -1; i <= 1; i++ )
{
for( j = -1; j <= 1; j++ )
{
for( k = -1; k <= 1; k++ )
{
VectorSet( delta, ( i * radius ),
( j * radius ),
( k * radius ) );
VectorAdd( origin, delta, test );
trap_Trace( &tr, test, NULL, NULL, test, -1, MASK_SOLID );
if( !tr.allsolid )
{
trap_Trace( &tr, test, NULL, NULL, origin, -1, MASK_SOLID );
VectorScale( delta, tr.fraction, delta );
VectorAdd( total, delta, total );
}
}
}
}
VectorNormalize( total );
VectorScale( total, radius, total );
VectorAdd( origin, total, spot );
}
/*
===============
SP_misc_light_flare
Spawn function for light flare
===============
*/
void SP_misc_light_flare( gentity_t *self )
{
self->s.eType = ET_LIGHTFLARE;
self->s.modelindex = G_ShaderIndex( self->targetShaderName );
VectorCopy( self->pos2, self->s.origin2 );
//try to find a spot near to the flare which is empty. This
//is used to facilitate visibility testing
findEmptySpot( self->s.origin, 8.0f, self->s.angles2 );
self->use = SP_use_light_flare;
G_SpawnFloat( "speed", "200", &self->speed );
self->s.time = self->speed;
G_SpawnInt( "mindist", "0", &self->s.generic1 );
if( self->spawnflags & 1 )
self->s.eFlags |= EF_NODRAW;
trap_LinkEntity( self );
}
-878
View File
@@ -1,878 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#include "g_local.h"
#define MISSILE_PRESTEP_TIME 50
/*
================
G_BounceMissile
================
*/
void G_BounceMissile( gentity_t *ent, trace_t *trace )
{
vec3_t velocity;
float dot;
int hitTime;
// reflect the velocity on the trace plane
hitTime = level.previousTime + ( level.time - level.previousTime ) * trace->fraction;
BG_EvaluateTrajectoryDelta( &ent->s.pos, hitTime, velocity );
dot = DotProduct( velocity, trace->plane.normal );
VectorMA( velocity, -2 * dot, trace->plane.normal, ent->s.pos.trDelta );
if( ent->s.eFlags & EF_BOUNCE_HALF )
{
if(!strcmp(ent->classname,"grenade") && g_proximityMines.integer) {
VectorScale( ent->s.pos.trDelta, 0.00, ent->s.pos.trDelta );
} else {
VectorScale( ent->s.pos.trDelta, 0.65, ent->s.pos.trDelta );
}
// check for stop
if( trace->plane.normal[ 2 ] > 0.2 && VectorLength( ent->s.pos.trDelta ) < 40 )
{
G_SetOrigin( ent, trace->endpos );
return;
}
}
VectorAdd( ent->r.currentOrigin, trace->plane.normal, ent->r.currentOrigin );
VectorCopy( ent->r.currentOrigin, ent->s.pos.trBase );
ent->s.pos.trTime = level.time;
}
/*
================
G_ExplodeMissile
Explode a missile without an impact
================
*/
void G_ExplodeMissile( gentity_t *ent )
{
vec3_t dir;
vec3_t origin;
BG_EvaluateTrajectory( &ent->s.pos, level.time, origin );
SnapVector( origin );
G_SetOrigin( ent, origin );
// we don't have a valid direction, so just point straight up
dir[ 0 ] = dir[ 1 ] = 0;
dir[ 2 ] = 1;
ent->s.eType = ET_GENERAL;
//TA: tired... can't be fucked... hack
if( ent->s.weapon != WP_LOCKBLOB_LAUNCHER &&
ent->s.weapon != WP_FLAMER )
G_AddEvent( ent, EV_MISSILE_MISS, DirToByte( dir ) );
ent->freeAfterEvent = qtrue;
// splash damage
if( ent->splashDamage )
G_RadiusDamage( ent->r.currentOrigin, ent->parent, ent->splashDamage,
ent->splashRadius, ent, ent->splashMethodOfDeath );
trap_LinkEntity( ent );
}
/*
================
G_ProcessProximityMine
If an enemy is close to the entity, go boom!
================
*/
void G_ProcessProximityMine(gentity_t *ent) {
int i, total_entities, entityList[MAX_GENTITIES];
vec3_t range, mins, maxs;
gentity_t *target;
// Set the next time to run this check (can be overwritten below)
ent->nextthink = level.time + PROXIMITY_CHECK_FREQUENCY;
//To prevent nades that last forever(when they arnt meant to)
if( g_proximityMinesLiveTime.integer != -1 && g_proximityMinesLiveTime.integer <= 100 )
{
trap_Cvar_Set( "g_proximityMinesLiveTime", "100" );
ent->nextthink = level.time;
ent->think = G_ExplodeMissile;
return;
}
if( g_proximityMinesLiveTime.integer != -1 && ent->livetime == level.time )
{
ent->nextthink = level.time;
ent->think = G_ExplodeMissile;
return;
}
// Grab all entities around us
VectorSet(range, PROXIMITY_RANGE, PROXIMITY_RANGE, PROXIMITY_RANGE);
VectorAdd(ent->s.origin, range, maxs);
VectorSubtract(ent->s.origin, range, mins);
total_entities = trap_EntitiesInBox(mins, maxs, entityList, MAX_GENTITIES);
// Loop entities looking for an enemy body
for(i=0; i<total_entities; i++) {
target = &g_entities[entityList[i]];
if(target->client && target->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS) {
// Found an enemy, boom time!
ent->nextthink = level.time + PROXIMITY_BOOM_TIME;
ent->think = G_ExplodeMissile;
return;
}
}
}
void AHive_ReturnToHive( gentity_t *self );
/*
================
G_MissileImpact
================
*/
void G_MissileImpact( gentity_t *ent, trace_t *trace )
{
gentity_t *other, *attacker;
qboolean returnAfterDamage = qfalse;
vec3_t dir;
other = &g_entities[ trace->entityNum ];
attacker = &g_entities[ ent->r.ownerNum ];
// check for bounce
if( !other->takedamage &&
( ent->s.eFlags & ( EF_BOUNCE | EF_BOUNCE_HALF ) ) )
{
G_BounceMissile( ent, trace );
//only play a sound if requested
if( !( ent->s.eFlags & EF_NO_BOUNCE_SOUND ) )
G_AddEvent( ent, EV_GRENADE_BOUNCE, 0 );
return;
}
if( !strcmp( ent->classname, "grenade" ) )
{
//grenade doesn't explode on impact
G_BounceMissile( ent, trace );
//only play a sound if requested
if( !( ent->s.eFlags & EF_NO_BOUNCE_SOUND ) )
G_AddEvent( ent, EV_GRENADE_BOUNCE, 0 );
return;
}
else if( !strcmp( ent->classname, "lockblob" ) )
{
if( other->client && other->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS )
{
other->client->ps.stats[ STAT_STATE ] |= SS_BLOBLOCKED;
other->client->lastLockTime = level.time;
AngleVectors( other->client->ps.viewangles, dir, NULL, NULL );
other->client->ps.stats[ STAT_VIEWLOCK ] = DirToByte( dir );
}
}
else if( !strcmp( ent->classname, "slowblob" ) )
{
if( other->client && other->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS )
{
other->client->ps.stats[ STAT_STATE ] |= SS_SLOWLOCKED;
other->client->lastSlowTime = level.time;
AngleVectors( other->client->ps.viewangles, dir, NULL, NULL );
other->client->ps.stats[ STAT_VIEWLOCK ] = DirToByte( dir );
}
}
else if( !strcmp( ent->classname, "hive" ) )
{
if( other->s.eType == ET_BUILDABLE && other->s.modelindex == BA_A_HIVE )
{
if( !ent->parent )
G_Printf( S_COLOR_YELLOW "WARNING: hive entity has no parent in G_MissileImpact\n" );
else
ent->parent->active = qfalse;
G_FreeEntity( ent );
return;
}
else
{
//prevent collision with the client when returning
ent->r.ownerNum = other->s.number;
ent->think = AHive_ReturnToHive;
ent->nextthink = level.time + FRAMETIME;
//only damage humans
if( other->client && other->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS )
returnAfterDamage = qtrue;
else
return;
}
}
// impact damage
if( other->takedamage )
{
// FIXME: wrong damage direction?
if( ent->damage )
{
vec3_t velocity;
BG_EvaluateTrajectoryDelta( &ent->s.pos, level.time, velocity );
if( VectorLength( velocity ) == 0 )
velocity[ 2 ] = 1; // stepped on a grenade
G_Damage( other, ent, attacker, velocity, ent->s.origin, ent->damage,
0, ent->methodOfDeath );
}
}
if( returnAfterDamage )
return;
// is it cheaper in bandwidth to just remove this ent and create a new
// one, rather than changing the missile into the explosion?
if( other->takedamage && other->client )
{
G_AddEvent( ent, EV_MISSILE_HIT, DirToByte( trace->plane.normal ) );
ent->s.otherEntityNum = other->s.number;
}
else if( trace->surfaceFlags & SURF_METALSTEPS )
G_AddEvent( ent, EV_MISSILE_MISS_METAL, DirToByte( trace->plane.normal ) );
else
G_AddEvent( ent, EV_MISSILE_MISS, DirToByte( trace->plane.normal ) );
ent->freeAfterEvent = qtrue;
// change over to a normal entity right at the point of impact
ent->s.eType = ET_GENERAL;
SnapVectorTowards( trace->endpos, ent->s.pos.trBase ); // save net bandwidth
G_SetOrigin( ent, trace->endpos );
// splash damage (doesn't apply to person directly hit)
if( ent->splashDamage )
G_RadiusDamage( trace->endpos, ent->parent, ent->splashDamage, ent->splashRadius,
other, ent->splashMethodOfDeath );
trap_LinkEntity( ent );
}
/*
================
G_RunMissile
================
*/
void G_RunMissile( gentity_t *ent )
{
vec3_t origin;
trace_t tr;
int passent;
// get current position
BG_EvaluateTrajectory( &ent->s.pos, level.time, origin );
// ignore interactions with the missile owner
passent = ent->r.ownerNum;
// trace a line from the previous position to the current position
trap_Trace( &tr, ent->r.currentOrigin, ent->r.mins, ent->r.maxs, origin, passent, ent->clipmask );
if( tr.startsolid || tr.allsolid )
{
// make sure the tr.entityNum is set to the entity we're stuck in
trap_Trace( &tr, ent->r.currentOrigin, ent->r.mins, ent->r.maxs, ent->r.currentOrigin, passent, ent->clipmask );
tr.fraction = 0;
}
else
VectorCopy( tr.endpos, ent->r.currentOrigin );
ent->r.contents = CONTENTS_SOLID; //trick trap_LinkEntity into...
trap_LinkEntity( ent );
ent->r.contents = 0; //...encoding bbox information
if( tr.fraction != 1 )
{
// never explode or bounce on sky
if( tr.surfaceFlags & SURF_NOIMPACT )
{
// If grapple, reset owner
if( ent->parent && ent->parent->client && ent->parent->client->hook == ent )
ent->parent->client->hook = NULL;
G_FreeEntity( ent );
return;
}
G_MissileImpact( ent, &tr );
if( ent->s.eType != ET_MISSILE )
return; // exploded
}
// check think function after bouncing
G_RunThink( ent );
}
//=============================================================================
/*
=================
fire_flamer
=================
*/
gentity_t *fire_flamer( gentity_t *self, vec3_t start, vec3_t dir )
{
gentity_t *bolt;
vec3_t pvel;
VectorNormalize (dir);
bolt = G_Spawn();
bolt->classname = "flame";
bolt->nextthink = level.time + FLAMER_LIFETIME;
bolt->think = G_ExplodeMissile;
bolt->s.eType = ET_MISSILE;
bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_FLAMER;
bolt->s.generic1 = self->s.generic1; //weaponMode
bolt->r.ownerNum = self->s.number;
bolt->parent = self;
bolt->damage = FLAMER_DMG;
bolt->splashDamage = FLAMER_DMG;
bolt->splashRadius = FLAMER_RADIUS;
bolt->methodOfDeath = MOD_FLAMER;
bolt->splashMethodOfDeath = MOD_FLAMER_SPLASH;
bolt->clipmask = MASK_SHOT;
bolt->target_ent = NULL;
bolt->r.mins[ 0 ] = bolt->r.mins[ 1 ] = bolt->r.mins[ 2 ] = -15.0f;
bolt->r.maxs[ 0 ] = bolt->r.maxs[ 1 ] = bolt->r.maxs[ 2 ] = 15.0f;
bolt->s.pos.trType = TR_LINEAR;
bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame
VectorCopy( start, bolt->s.pos.trBase );
VectorScale( self->client->ps.velocity, FLAMER_LAG, pvel );
VectorMA( pvel, FLAMER_SPEED, dir, bolt->s.pos.trDelta );
SnapVector( bolt->s.pos.trDelta ); // save net bandwidth
VectorCopy( start, bolt->r.currentOrigin );
return bolt;
}
//=============================================================================
/*
=================
fire_blaster
=================
*/
gentity_t *fire_blaster( gentity_t *self, vec3_t start, vec3_t dir )
{
gentity_t *bolt;
VectorNormalize (dir);
bolt = G_Spawn();
bolt->classname = "blaster";
bolt->nextthink = level.time + 10000;
bolt->think = G_ExplodeMissile;
bolt->s.eType = ET_MISSILE;
bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_BLASTER;
bolt->s.generic1 = self->s.generic1; //weaponMode
bolt->r.ownerNum = self->s.number;
bolt->parent = self;
bolt->damage = BLASTER_DMG;
bolt->splashDamage = 0;
bolt->splashRadius = 0;
bolt->methodOfDeath = MOD_BLASTER;
bolt->splashMethodOfDeath = MOD_BLASTER;
bolt->clipmask = MASK_SHOT;
bolt->target_ent = NULL;
bolt->s.pos.trType = TR_LINEAR;
bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame
VectorCopy( start, bolt->s.pos.trBase );
VectorScale( dir, BLASTER_SPEED, bolt->s.pos.trDelta );
SnapVector( bolt->s.pos.trDelta ); // save net bandwidth
VectorCopy( start, bolt->r.currentOrigin );
return bolt;
}
//=============================================================================
/*
=================
fire_pulseRifle
=================
*/
gentity_t *fire_pulseRifle( gentity_t *self, vec3_t start, vec3_t dir )
{
gentity_t *bolt;
VectorNormalize (dir);
bolt = G_Spawn();
bolt->classname = "pulse";
bolt->nextthink = level.time + 10000;
bolt->think = G_ExplodeMissile;
bolt->s.eType = ET_MISSILE;
bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_PULSE_RIFLE;
bolt->s.generic1 = self->s.generic1; //weaponMode
bolt->r.ownerNum = self->s.number;
bolt->parent = self;
bolt->damage = PRIFLE_DMG;
bolt->splashDamage = 0;
bolt->splashRadius = 0;
bolt->methodOfDeath = MOD_PRIFLE;
bolt->splashMethodOfDeath = MOD_PRIFLE;
bolt->clipmask = MASK_SHOT;
bolt->target_ent = NULL;
bolt->s.pos.trType = TR_LINEAR;
bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame
VectorCopy( start, bolt->s.pos.trBase );
VectorScale( dir, PRIFLE_SPEED, bolt->s.pos.trDelta );
SnapVector( bolt->s.pos.trDelta ); // save net bandwidth
VectorCopy( start, bolt->r.currentOrigin );
return bolt;
}
//=============================================================================
/*
=================
fire_luciferCannon
=================
*/
gentity_t *fire_luciferCannon( gentity_t *self, vec3_t start, vec3_t dir, int damage, int radius )
{
gentity_t *bolt;
int localDamage = (int)( ceil( ( (float)damage /
(float)LCANNON_TOTAL_CHARGE ) * (float)LCANNON_DAMAGE ) );
VectorNormalize( dir );
bolt = G_Spawn( );
bolt->classname = "lcannon";
if( damage == LCANNON_TOTAL_CHARGE )
bolt->nextthink = level.time;
else
bolt->nextthink = level.time + 10000;
bolt->think = G_ExplodeMissile;
bolt->s.eType = ET_MISSILE;
bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_LUCIFER_CANNON;
bolt->s.generic1 = self->s.generic1; //weaponMode
bolt->r.ownerNum = self->s.number;
bolt->parent = self;
bolt->damage = localDamage;
bolt->splashDamage = localDamage / 2;
bolt->splashRadius = radius;
bolt->methodOfDeath = MOD_LCANNON;
bolt->splashMethodOfDeath = MOD_LCANNON_SPLASH;
bolt->clipmask = MASK_SHOT;
bolt->target_ent = NULL;
bolt->s.pos.trType = TR_LINEAR;
bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame
VectorCopy( start, bolt->s.pos.trBase );
VectorScale( dir, LCANNON_SPEED, bolt->s.pos.trDelta );
SnapVector( bolt->s.pos.trDelta ); // save net bandwidth
VectorCopy( start, bolt->r.currentOrigin );
return bolt;
}
/*
=================
launch_grenade
=================
*/
gentity_t *launch_grenade( gentity_t *self, vec3_t start, vec3_t dir )
{
gentity_t *bolt;
VectorNormalize( dir );
bolt = G_Spawn( );
bolt->classname = "grenade";
if(g_proximityMines.integer) {
bolt->nextthink = level.time + PROXIMITY_INIT_TIME;
bolt->think = G_ProcessProximityMine;
bolt->livetime = level.time + g_proximityMinesLiveTime.integer + PROXIMITY_INIT_TIME;
} else {
bolt->nextthink = level.time + 5000;
bolt->think = G_ExplodeMissile;
}
bolt->s.eType = ET_MISSILE;
bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_GRENADE;
bolt->s.eFlags = EF_BOUNCE_HALF;
bolt->s.generic1 = WPM_PRIMARY; //weaponMode
bolt->r.ownerNum = self->s.number;
bolt->parent = self;
bolt->damage = GRENADE_DAMAGE;
bolt->splashDamage = GRENADE_DAMAGE;
bolt->splashRadius = GRENADE_RANGE;
bolt->methodOfDeath = MOD_GRENADE;
bolt->splashMethodOfDeath = MOD_GRENADE;
bolt->clipmask = MASK_SHOT;
bolt->target_ent = NULL;
bolt->r.mins[ 0 ] = bolt->r.mins[ 1 ] = bolt->r.mins[ 2 ] = -3.0f;
bolt->r.maxs[ 0 ] = bolt->r.maxs[ 1 ] = bolt->r.maxs[ 2 ] = 3.0f;
bolt->s.time = level.time;
bolt->s.pos.trType = TR_GRAVITY;
bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame
VectorCopy( start, bolt->s.pos.trBase );
VectorScale( dir, GRENADE_SPEED, bolt->s.pos.trDelta );
SnapVector( bolt->s.pos.trDelta ); // save net bandwidth
VectorCopy( start, bolt->r.currentOrigin );
return bolt;
}
//=============================================================================
/*
================
AHive_ReturnToHive
Adjust the trajectory to point towards the hive
================
*/
void AHive_ReturnToHive( gentity_t *self )
{
vec3_t dir;
trace_t tr;
if( !self->parent )
{
G_Printf( S_COLOR_YELLOW "WARNING: AHive_ReturnToHive called with no self->parent\n" );
return;
}
trap_UnlinkEntity( self->parent );
trap_Trace( &tr, self->r.currentOrigin, self->r.mins, self->r.maxs,
self->parent->r.currentOrigin, self->r.ownerNum, self->clipmask );
trap_LinkEntity( self->parent );
if( tr.fraction < 1.0f )
{
//if can't see hive then disperse
VectorCopy( self->r.currentOrigin, self->s.pos.trBase );
self->s.pos.trType = TR_STATIONARY;
self->s.pos.trTime = level.time;
self->think = G_ExplodeMissile;
self->nextthink = level.time + 2000;
self->parent->active = qfalse; //allow the parent to start again
}
else
{
VectorSubtract( self->parent->r.currentOrigin, self->r.currentOrigin, dir );
VectorNormalize( dir );
//change direction towards the hive
VectorScale( dir, HIVE_SPEED, self->s.pos.trDelta );
SnapVector( self->s.pos.trDelta ); // save net bandwidth
VectorCopy( self->r.currentOrigin, self->s.pos.trBase );
self->s.pos.trTime = level.time;
self->think = G_ExplodeMissile;
self->nextthink = level.time + 15000;
}
}
/*
================
AHive_SearchAndDestroy
Adjust the trajectory to point towards the target
================
*/
void AHive_SearchAndDestroy( gentity_t *self )
{
vec3_t dir;
trace_t tr;
trap_Trace( &tr, self->r.currentOrigin, self->r.mins, self->r.maxs,
self->target_ent->r.currentOrigin, self->r.ownerNum, self->clipmask );
//if there is no LOS or the parent hive is too far away or the target is dead or notargeting, return
if( tr.entityNum == ENTITYNUM_WORLD ||
Distance( self->r.currentOrigin, self->parent->r.currentOrigin ) > ( HIVE_RANGE * 5 ) ||
self->target_ent->health <= 0 || self->target_ent->flags & FL_NOTARGET )
{
self->r.ownerNum = ENTITYNUM_WORLD;
self->think = AHive_ReturnToHive;
self->nextthink = level.time + FRAMETIME;
}
else
{
VectorSubtract( self->target_ent->r.currentOrigin, self->r.currentOrigin, dir );
VectorNormalize( dir );
//change direction towards the player
VectorScale( dir, HIVE_SPEED, self->s.pos.trDelta );
SnapVector( self->s.pos.trDelta ); // save net bandwidth
VectorCopy( self->r.currentOrigin, self->s.pos.trBase );
self->s.pos.trTime = level.time;
self->nextthink = level.time + HIVE_DIR_CHANGE_PERIOD;
}
}
/*
=================
fire_hive
=================
*/
gentity_t *fire_hive( gentity_t *self, vec3_t start, vec3_t dir )
{
gentity_t *bolt;
VectorNormalize ( dir );
bolt = G_Spawn( );
bolt->classname = "hive";
bolt->nextthink = level.time + HIVE_DIR_CHANGE_PERIOD;
bolt->think = AHive_SearchAndDestroy;
bolt->s.eType = ET_MISSILE;
bolt->s.eFlags |= EF_BOUNCE|EF_NO_BOUNCE_SOUND;
bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_HIVE;
bolt->s.generic1 = WPM_PRIMARY; //weaponMode
bolt->r.ownerNum = self->s.number;
bolt->parent = self;
bolt->damage = HIVE_DMG;
bolt->splashDamage = 0;
bolt->splashRadius = 0;
bolt->methodOfDeath = MOD_SWARM;
bolt->clipmask = MASK_SHOT;
bolt->target_ent = self->target_ent;
if( g_modBuildableSpeed.integer > 0)
{
bolt->nextthink = level.time + HIVE_DIR_CHANGE_PERIOD * 100 / g_modBuildableSpeed.integer;
bolt->damage = bolt->damage * g_modBuildableSpeed.integer / 100;
}
bolt->s.pos.trType = TR_LINEAR;
bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame
VectorCopy( start, bolt->s.pos.trBase );
VectorScale( dir, HIVE_SPEED, bolt->s.pos.trDelta );
SnapVector( bolt->s.pos.trDelta ); // save net bandwidth
VectorCopy( start, bolt->r.currentOrigin );
return bolt;
}
//=============================================================================
/*
=================
fire_lockblob
=================
*/
gentity_t *fire_lockblob( gentity_t *self, vec3_t start, vec3_t dir )
{
gentity_t *bolt;
VectorNormalize ( dir );
bolt = G_Spawn( );
bolt->classname = "lockblob";
bolt->nextthink = level.time + 15000;
bolt->think = G_ExplodeMissile;
bolt->s.eType = ET_MISSILE;
bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_LOCKBLOB_LAUNCHER;
bolt->s.generic1 = WPM_PRIMARY; //weaponMode
bolt->r.ownerNum = self->s.number;
bolt->parent = self;
bolt->damage = 0;
bolt->splashDamage = 0;
bolt->splashRadius = 0;
bolt->methodOfDeath = MOD_UNKNOWN; //doesn't do damage so will never kill
bolt->clipmask = MASK_SHOT;
bolt->target_ent = NULL;
bolt->s.pos.trType = TR_LINEAR;
bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame
VectorCopy( start, bolt->s.pos.trBase );
VectorScale( dir, 500, bolt->s.pos.trDelta );
SnapVector( bolt->s.pos.trDelta ); // save net bandwidth
VectorCopy( start, bolt->r.currentOrigin );
return bolt;
}
/*
=================
fire_slowBlob
=================
*/
gentity_t *fire_slowBlob( gentity_t *self, vec3_t start, vec3_t dir )
{
gentity_t *bolt;
VectorNormalize ( dir );
bolt = G_Spawn( );
bolt->classname = "slowblob";
bolt->nextthink = level.time + 15000;
bolt->think = G_ExplodeMissile;
bolt->s.eType = ET_MISSILE;
bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_ABUILD2;
bolt->s.generic1 = self->s.generic1; //weaponMode
bolt->r.ownerNum = self->s.number;
bolt->parent = self;
bolt->damage = ABUILDER_BLOB_DMG;
bolt->splashDamage = 0;
bolt->splashRadius = 0;
bolt->methodOfDeath = MOD_SLOWBLOB;
bolt->splashMethodOfDeath = MOD_SLOWBLOB;
bolt->clipmask = MASK_SHOT;
bolt->target_ent = NULL;
bolt->s.pos.trType = TR_GRAVITY;
bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame
VectorCopy( start, bolt->s.pos.trBase );
VectorScale( dir, ABUILDER_BLOB_SPEED, bolt->s.pos.trDelta );
SnapVector( bolt->s.pos.trDelta ); // save net bandwidth
VectorCopy( start, bolt->r.currentOrigin );
return bolt;
}
/*
=================
fire_paraLockBlob
=================
*/
gentity_t *fire_paraLockBlob( gentity_t *self, vec3_t start, vec3_t dir )
{
gentity_t *bolt;
VectorNormalize ( dir );
bolt = G_Spawn( );
bolt->classname = "lockblob";
bolt->nextthink = level.time + 15000;
bolt->think = G_ExplodeMissile;
bolt->s.eType = ET_MISSILE;
bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_LOCKBLOB_LAUNCHER;
bolt->s.generic1 = self->s.generic1; //weaponMode
bolt->r.ownerNum = self->s.number;
bolt->parent = self;
bolt->damage = 0;
bolt->splashDamage = 0;
bolt->splashRadius = 0;
bolt->clipmask = MASK_SHOT;
bolt->target_ent = NULL;
bolt->s.pos.trType = TR_GRAVITY;
bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame
VectorCopy( start, bolt->s.pos.trBase );
VectorScale( dir, LOCKBLOB_SPEED, bolt->s.pos.trDelta );
SnapVector( bolt->s.pos.trDelta ); // save net bandwidth
VectorCopy( start, bolt->r.currentOrigin );
return bolt;
}
/*
=================
fire_bounceBall
=================
*/
gentity_t *fire_bounceBall( gentity_t *self, vec3_t start, vec3_t dir )
{
gentity_t *bolt;
VectorNormalize ( dir );
bolt = G_Spawn( );
bolt->classname = "bounceball";
bolt->nextthink = level.time + 3000;
bolt->think = G_ExplodeMissile;
bolt->s.eType = ET_MISSILE;
bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_ALEVEL3_UPG;
bolt->s.generic1 = self->s.generic1; //weaponMode
bolt->r.ownerNum = self->s.number;
bolt->parent = self;
bolt->damage = LEVEL3_BOUNCEBALL_DMG;
bolt->splashDamage = 0;
bolt->splashRadius = 0;
bolt->methodOfDeath = MOD_LEVEL3_BOUNCEBALL;
bolt->splashMethodOfDeath = MOD_LEVEL3_BOUNCEBALL;
bolt->clipmask = MASK_SHOT;
bolt->target_ent = NULL;
bolt->s.pos.trType = TR_GRAVITY;
bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame
VectorCopy( start, bolt->s.pos.trBase );
VectorScale( dir, LEVEL3_BOUNCEBALL_SPEED, bolt->s.pos.trDelta );
SnapVector( bolt->s.pos.trDelta ); // save net bandwidth
VectorCopy( start, bolt->r.currentOrigin );
/*bolt->s.eFlags |= EF_BOUNCE;*/
if( g_modAlienRate.integer > 0 )
bolt->damage = bolt->damage * g_modAlienRate.integer / 100;
return bolt;
}
-2479
View File
File diff suppressed because it is too large. Load diff
-170
View File
@@ -1,170 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#include "g_local.h"
/*
================
G_Bounce
================
*/
static void G_Bounce( gentity_t *ent, trace_t *trace )
{
vec3_t velocity;
float dot;
int hitTime;
float minNormal;
qboolean invert = qfalse;
// reflect the velocity on the trace plane
hitTime = level.previousTime + ( level.time - level.previousTime ) * trace->fraction;
BG_EvaluateTrajectoryDelta( &ent->s.pos, hitTime, velocity );
dot = DotProduct( velocity, trace->plane.normal );
VectorMA( velocity, -2*dot, trace->plane.normal, ent->s.pos.trDelta );
if( ent->s.eType == ET_BUILDABLE )
{
minNormal = BG_FindMinNormalForBuildable( ent->s.modelindex );
invert = BG_FindInvertNormalForBuildable( ent->s.modelindex );
}
else
minNormal = 0.707f;
// cut the velocity to keep from bouncing forever
if( ( trace->plane.normal[ 2 ] >= minNormal ||
( invert && trace->plane.normal[ 2 ] <= -minNormal ) ) &&
trace->entityNum == ENTITYNUM_WORLD )
VectorScale( ent->s.pos.trDelta, ent->physicsBounce, ent->s.pos.trDelta );
else
VectorScale( ent->s.pos.trDelta, 0.3f, ent->s.pos.trDelta );
if( VectorLength( ent->s.pos.trDelta ) < 10 )
{
VectorMA( trace->endpos, 0.5f, trace->plane.normal, trace->endpos ); // make sure it is off ground
// Never allow origin to be snapped lower (buildables fall through map bug)
trace->endpos[2] = (float)ceil(trace->endpos[2]);
SnapVector( trace->endpos );
G_SetOrigin( ent, trace->endpos );
ent->s.groundEntityNum = trace->entityNum;
VectorCopy( trace->plane.normal, ent->s.origin2 );
VectorSet( ent->s.pos.trDelta, 0.0f, 0.0f, 0.0f );
return;
}
VectorCopy( ent->r.currentOrigin, ent->s.pos.trBase );
VectorAdd( ent->r.currentOrigin, trace->plane.normal, ent->r.currentOrigin);
ent->s.pos.trTime = level.time;
}
#define PHYSICS_TIME 200
/*
================
G_Physics
================
*/
void G_Physics( gentity_t *ent, int msec )
{
vec3_t origin;
trace_t tr;
int contents;
int mask;
// if groundentity has been set to -1, it may have been pushed off an edge
if( ent->s.groundEntityNum == -1 )
{
if( ent->s.eType == ET_BUILDABLE )
{
if( ent->s.pos.trType != BG_FindTrajectoryForBuildable( ent->s.modelindex ) )
{
ent->s.pos.trType = BG_FindTrajectoryForBuildable( ent->s.modelindex );
ent->s.pos.trTime = level.time;
}
}
else if( ent->s.pos.trType != TR_GRAVITY )
{
ent->s.pos.trType = TR_GRAVITY;
ent->s.pos.trTime = level.time;
}
}
// trace a line from the previous position to the current position
if( ent->clipmask )
mask = ent->clipmask;
else
mask = MASK_PLAYERSOLID & ~CONTENTS_BODY;//MASK_SOLID;
if( ent->s.pos.trType == TR_STATIONARY )
{
// check think function
G_RunThink( ent );
//check floor infrequently
if( ent->nextPhysicsTime < level.time )
{
VectorCopy( ent->r.currentOrigin, origin );
VectorMA( origin, -2.0f, ent->s.origin2, origin );
trap_Trace( &tr, ent->r.currentOrigin, ent->r.mins, ent->r.maxs, origin, ent->s.number, mask );
if( tr.fraction == 1.0f )
ent->s.groundEntityNum = -1;
ent->nextPhysicsTime = level.time + PHYSICS_TIME;
}
return;
}
// get current position
BG_EvaluateTrajectory( &ent->s.pos, level.time, origin );
trap_Trace( &tr, ent->r.currentOrigin, ent->r.mins, ent->r.maxs, origin, ent->s.number, mask );
VectorCopy( tr.endpos, ent->r.currentOrigin );
if( tr.startsolid )
tr.fraction = 0;
trap_LinkEntity( ent ); // FIXME: avoid this for stationary?
// check think function
G_RunThink( ent );
if( tr.fraction == 1.0f )
return;
// if it is in a nodrop volume, remove it
contents = trap_PointContents( ent->r.currentOrigin, -1 );
if( contents & CONTENTS_NODROP )
{
G_FreeEntity( ent );
return;
}
G_Bounce( ent, &tr );
}
-180
View File
@@ -1,180 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// g_ptr.c -- post timeout restoration handling
#include "g_local.h"
static connectionRecord_t connections[ MAX_CLIENTS ];
/*
===============
G_CheckForUniquePTRC
Callback to detect ptrc clashes
===============
*/
static qboolean G_CheckForUniquePTRC( int code )
{
int i;
if( code == 0 )
return qfalse;
for( i = 0; i < MAX_CLIENTS; i++ )
{
if( connections[ i ].ptrCode == code )
return qfalse;
}
return qtrue;
}
/*
===============
G_UpdatePTRConnection
Update the data in a connection record
===============
*/
void G_UpdatePTRConnection( gclient_t *client )
{
if( client && client->pers.connection )
{
client->pers.connection->clientTeam = client->pers.teamSelection;
if( client->pers.teamSelection == PTE_NONE )
client->pers.connection->clientCredit = client->pers.savedCredit;
else
client->pers.connection->clientCredit = client->ps.persistant[ PERS_CREDIT ];
}
}
/*
===============
G_GenerateNewConnection
Generates a new connection
===============
*/
connectionRecord_t *G_GenerateNewConnection( gclient_t *client )
{
int code = 0;
int i;
// this should be really random
srand( trap_Milliseconds( ) );
// there is a very very small possibility that this
// will loop infinitely
do
{
code = rand( );
} while( !G_CheckForUniquePTRC( code ) );
for( i = 0; i < MAX_CLIENTS; i++ )
{
//found an unused slot
if( !connections[ i ].ptrCode )
{
connections[ i ].ptrCode = code;
connections[ i ].clientNum = client->ps.clientNum;
client->pers.connection = &connections[ i ];
G_UpdatePTRConnection( client );
return &connections[ i ];
}
}
return NULL;
}
/*
===============
G_VerifyPTRC
Check a PTR code for validity
===============
*/
qboolean G_VerifyPTRC( int code )
{
int i;
if( code == 0 )
return qfalse;
for( i = 0; i < MAX_CLIENTS; i++ )
{
if( connections[ i ].ptrCode == code )
return qtrue;
}
return qfalse;
}
/*
===============
G_FindConnectionForCode
Finds a connection for a given code
===============
*/
connectionRecord_t *G_FindConnectionForCode( int code )
{
int i;
if( code == 0 )
return NULL;
for( i = 0; i < MAX_CLIENTS; i++ )
{
if( connections[ i ].ptrCode == code )
return &connections[ i ];
}
return NULL;
}
/*
===============
G_DeletePTRConnection
Finds a connection and deletes it
===============
*/
void G_DeletePTRConnection( connectionRecord_t *connection )
{
if( connection )
memset( connection, 0, sizeof( connectionRecord_t ) );
}
/*
===============
G_ResetPTRConnections
Invalidate any existing codes
===============
*/
void G_ResetPTRConnections( void )
{
memset( connections, 0, sizeof( connectionRecord_t ) * MAX_CLIENTS );
}
-262
View File
@@ -1,262 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// g_public.h -- game module information visible to server
#define GAME_API_VERSION 8
// entity->svFlags
// the server does not know how to interpret most of the values
// in entityStates (level eType), so the game must explicitly flag
// special server behaviors
#define SVF_NOCLIENT 0x00000001 // don't send entity to clients, even if it has effects
// TTimo
// https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=551
#define SVF_CLIENTMASK 0x00000002
#define SVF_BROADCAST 0x00000020 // send to all connected clients
#define SVF_PORTAL 0x00000040 // merge a second pvs at origin2 into snapshots
#define SVF_USE_CURRENT_ORIGIN 0x00000080 // entity->r.currentOrigin instead of entity->s.origin
// for link position (missiles and movers)
#define SVF_SINGLECLIENT 0x00000100 // only send to a single client (entityShared_t->singleClient)
#define SVF_NOSERVERINFO 0x00000200 // don't send CS_SERVERINFO updates to this client
// so that it can be updated for ping tools without
// lagging clients
#define SVF_CAPSULE 0x00000400 // use capsule for collision detection instead of bbox
#define SVF_NOTSINGLECLIENT 0x00000800 // send entity to everyone but one client
// (entityShared_t->singleClient)
//===============================================================
typedef struct {
entityState_t s; // communicated by server to clients
qboolean linked; // qfalse if not in any good cluster
int linkcount;
int svFlags; // SVF_NOCLIENT, SVF_BROADCAST, etc
int singleClient; // only send to this client when SVF_SINGLECLIENT is set
qboolean bmodel; // if false, assume an explicit mins / maxs bounding box
// only set by trap_SetBrushModel
vec3_t mins, maxs;
int contents; // CONTENTS_TRIGGER, CONTENTS_SOLID, CONTENTS_BODY, etc
// a non-solid entity should set to 0
vec3_t absmin, absmax; // derived from mins/maxs and origin + rotation
// currentOrigin will be used for all collision detection and world linking.
// it will not necessarily be the same as the trajectory evaluation for the current
// time, because each entity must be moved one at a time after time is advanced
// to avoid simultanious collision issues
vec3_t currentOrigin;
vec3_t currentAngles;
// when a trace call is made and passEntityNum != ENTITYNUM_NONE,
// an ent will be excluded from testing if:
// ent->s.number == passEntityNum (don't interact with self)
// ent->s.ownerNum = passEntityNum (don't interact with your own missiles)
// entity[ent->s.ownerNum].ownerNum = passEntityNum (don't interact with other missiles from owner)
int ownerNum;
} entityShared_t;
// the server looks at a sharedEntity, which is the start of the game's gentity_t structure
typedef struct {
entityState_t s; // communicated by server to clients
entityShared_t r; // shared by both the server system and game
} sharedEntity_t;
//===============================================================
//
// system traps provided by the main engine
//
typedef enum {
//============== general Quake services ==================
G_PRINT, // ( const char *string );
// print message on the local console
G_ERROR, // ( const char *string );
// abort the game
G_MILLISECONDS, // ( void );
// get current time for profiling reasons
// this should NOT be used for any game related tasks,
// because it is not journaled
// console variable interaction
G_CVAR_REGISTER, // ( vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags );
G_CVAR_UPDATE, // ( vmCvar_t *vmCvar );
G_CVAR_SET, // ( const char *var_name, const char *value );
G_CVAR_VARIABLE_INTEGER_VALUE, // ( const char *var_name );
G_CVAR_VARIABLE_STRING_BUFFER, // ( const char *var_name, char *buffer, int bufsize );
G_ARGC, // ( void );
// ClientCommand and ServerCommand parameter access
G_ARGV, // ( int n, char *buffer, int bufferLength );
G_FS_FOPEN_FILE, // ( const char *qpath, fileHandle_t *file, fsMode_t mode );
G_FS_READ, // ( void *buffer, int len, fileHandle_t f );
G_FS_WRITE, // ( const void *buffer, int len, fileHandle_t f );
G_FS_FCLOSE_FILE, // ( fileHandle_t f );
G_SEND_CONSOLE_COMMAND, // ( const char *text );
// add commands to the console as if they were typed in
// for map changing, etc
//=========== server specific functionality =============
G_LOCATE_GAME_DATA, // ( gentity_t *gEnts, int numGEntities, int sizeofGEntity_t,
// playerState_t *clients, int sizeofGameClient );
// the game needs to let the server system know where and how big the gentities
// are, so it can look at them directly without going through an interface
G_DROP_CLIENT, // ( int clientNum, const char *reason );
// kick a client off the server with a message
G_SEND_SERVER_COMMAND, // ( int clientNum, const char *fmt, ... );
// reliably sends a command string to be interpreted by the given
// client. If clientNum is -1, it will be sent to all clients
G_SET_CONFIGSTRING, // ( int num, const char *string );
// config strings hold all the index strings, and various other information
// that is reliably communicated to all clients
// All of the current configstrings are sent to clients when
// they connect, and changes are sent to all connected clients.
// All confgstrings are cleared at each level start.
G_GET_CONFIGSTRING, // ( int num, char *buffer, int bufferSize );
G_GET_USERINFO, // ( int num, char *buffer, int bufferSize );
// userinfo strings are maintained by the server system, so they
// are persistant across level loads, while all other game visible
// data is completely reset
G_SET_USERINFO, // ( int num, const char *buffer );
G_GET_SERVERINFO, // ( char *buffer, int bufferSize );
// the serverinfo info string has all the cvars visible to server browsers
G_SET_BRUSH_MODEL, // ( gentity_t *ent, const char *name );
// sets mins and maxs based on the brushmodel name
G_TRACE, // ( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask );
// collision detection against all linked entities
G_POINT_CONTENTS, // ( const vec3_t point, int passEntityNum );
// point contents against all linked entities
G_IN_PVS, // ( const vec3_t p1, const vec3_t p2 );
G_IN_PVS_IGNORE_PORTALS, // ( const vec3_t p1, const vec3_t p2 );
G_ADJUST_AREA_PORTAL_STATE, // ( gentity_t *ent, qboolean open );
G_AREAS_CONNECTED, // ( int area1, int area2 );
G_LINKENTITY, // ( gentity_t *ent );
// an entity will never be sent to a client or used for collision
// if it is not passed to linkentity. If the size, position, or
// solidity changes, it must be relinked.
G_UNLINKENTITY, // ( gentity_t *ent );
// call before removing an interactive entity
G_ENTITIES_IN_BOX, // ( const vec3_t mins, const vec3_t maxs, gentity_t **list, int maxcount );
// EntitiesInBox will return brush models based on their bounding box,
// so exact determination must still be done with EntityContact
G_ENTITY_CONTACT, // ( const vec3_t mins, const vec3_t maxs, const gentity_t *ent );
// perform an exact check against inline brush models of non-square shape
G_GET_USERCMD, // ( int clientNum, usercmd_t *cmd )
G_GET_ENTITY_TOKEN, // qboolean ( char *buffer, int bufferSize )
// Retrieves the next string token from the entity spawn text, returning
// false when all tokens have been parsed.
// This should only be done at GAME_INIT time.
G_FS_GETFILELIST,
G_REAL_TIME,
G_SNAPVECTOR,
G_TRACECAPSULE, // ( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask );
G_ENTITY_CONTACTCAPSULE, // ( const vec3_t mins, const vec3_t maxs, const gentity_t *ent );
// 1.32
G_FS_SEEK,
G_PARSE_ADD_GLOBAL_DEFINE,
G_PARSE_LOAD_SOURCE,
G_PARSE_FREE_SOURCE,
G_PARSE_READ_TOKEN,
G_PARSE_SOURCE_FILE_AND_LINE,
G_SEND_GAMESTAT
} gameImport_t;
//
// functions exported by the game subsystem
//
typedef enum {
GAME_INIT, // ( int levelTime, int randomSeed, int restart );
// init and shutdown will be called every single level
// The game should call G_GET_ENTITY_TOKEN to parse through all the
// entity configuration text and spawn gentities.
GAME_SHUTDOWN, // (void);
GAME_CLIENT_CONNECT, // ( int clientNum, qboolean firstTime );
// return NULL if the client is allowed to connect, otherwise return
// a text string with the reason for denial
GAME_CLIENT_BEGIN, // ( int clientNum );
GAME_CLIENT_USERINFO_CHANGED, // ( int clientNum );
GAME_CLIENT_DISCONNECT, // ( int clientNum );
GAME_CLIENT_COMMAND, // ( int clientNum );
GAME_CLIENT_THINK, // ( int clientNum );
GAME_RUN_FRAME, // ( int levelTime );
GAME_CONSOLE_COMMAND // ( void );
// ConsoleCommand will be called when a command has been issued
// that is not recognized as a builtin function.
// The game can issue trap_argc() / trap_argv() commands to get the command
// and parameters. Return qfalse if the game doesn't recognize it as a command.
} gameExport_t;
-167
View File
@@ -1,167 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#include "g_local.h"
/*
=======================================================================
SESSION DATA
Session data is the only data that stays persistant across level loads
and tournament restarts.
=======================================================================
*/
/*
================
G_WriteClientSessionData
Called on game shutdown
================
*/
void G_WriteClientSessionData( gclient_t *client )
{
const char *s;
const char *var;
s = va( "%i %i %i %i %i %i %i %i %s",
client->sess.sessionTeam,
client->sess.restartTeam,
client->sess.spectatorTime,
client->sess.spectatorState,
client->sess.spectatorClient,
client->sess.wins,
client->sess.losses,
client->sess.teamLeader,
BG_ClientListString( &client->sess.ignoreList )
);
var = va( "session%i", client - level.clients );
trap_Cvar_Set( var, s );
}
/*
================
G_ReadSessionData
Called on a reconnect
================
*/
void G_ReadSessionData( gclient_t *client )
{
char s[ MAX_STRING_CHARS ];
const char *var;
// bk001205 - format
int teamLeader;
int spectatorState;
int sessionTeam;
int restartTeam;
var = va( "session%i", client - level.clients );
trap_Cvar_VariableStringBuffer( var, s, sizeof(s) );
// FIXME: should be using BG_ClientListParse() for ignoreList, but
// bg_lib.c's sscanf() currently lacks %s
sscanf( s, "%i %i %i %i %i %i %i %i %x%x",
&sessionTeam,
&restartTeam,
&client->sess.spectatorTime,
&spectatorState,
&client->sess.spectatorClient,
&client->sess.wins,
&client->sess.losses,
&teamLeader,
&client->sess.ignoreList.hi,
&client->sess.ignoreList.lo
);
// bk001205 - format issues
client->sess.sessionTeam = (team_t)sessionTeam;
client->sess.restartTeam = (pTeam_t)restartTeam;
client->sess.spectatorState = (spectatorState_t)spectatorState;
client->sess.teamLeader = (qboolean)teamLeader;
}
/*
================
G_InitSessionData
Called on a first-time connect
================
*/
void G_InitSessionData( gclient_t *client, char *userinfo )
{
clientSession_t *sess;
const char *value;
sess = &client->sess;
// initial team determination
value = Info_ValueForKey( userinfo, "team" );
if( value[ 0 ] == 's' )
{
// a willing spectator, not a waiting-in-line
sess->sessionTeam = TEAM_SPECTATOR;
}
else
{
if( g_maxGameClients.integer > 0 &&
level.numNonSpectatorClients >= g_maxGameClients.integer )
sess->sessionTeam = TEAM_SPECTATOR;
else
sess->sessionTeam = TEAM_FREE;
}
sess->restartTeam = PTE_NONE;
sess->spectatorState = SPECTATOR_FREE;
sess->spectatorTime = level.time;
sess->spectatorClient = -1;
memset( &sess->ignoreList, 0, sizeof( sess->ignoreList ) );
G_WriteClientSessionData( client );
}
/*
==================
G_WriteSessionData
==================
*/
void G_WriteSessionData( void )
{
int i;
//TA: ?
trap_Cvar_Set( "session", va( "%i", 0 ) );
for( i = 0 ; i < level.maxclients ; i++ )
{
if( level.clients[ i ].pers.connected == CON_CONNECTED )
G_WriteClientSessionData( &level.clients[ i ] );
}
}
-698
View File
@@ -1,698 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#include "g_local.h"
qboolean G_SpawnString( const char *key, const char *defaultString, char **out )
{
int i;
if( !level.spawning )
{
*out = (char *)defaultString;
// G_Error( "G_SpawnString() called while not spawning" );
}
for( i = 0; i < level.numSpawnVars; i++ )
{
if( !Q_stricmp( key, level.spawnVars[ i ][ 0 ] ) )
{
*out = level.spawnVars[ i ][ 1 ];
return qtrue;
}
}
*out = (char *)defaultString;
return qfalse;
}
qboolean G_SpawnFloat( const char *key, const char *defaultString, float *out )
{
char *s;
qboolean present;
present = G_SpawnString( key, defaultString, &s );
*out = atof( s );
return present;
}
qboolean G_SpawnInt( const char *key, const char *defaultString, int *out )
{
char *s;
qboolean present;
present = G_SpawnString( key, defaultString, &s );
*out = atoi( s );
return present;
}
qboolean G_SpawnVector( const char *key, const char *defaultString, float *out )
{
char *s;
qboolean present;
present = G_SpawnString( key, defaultString, &s );
sscanf( s, "%f %f %f", &out[ 0 ], &out[ 1 ], &out[ 2 ] );
return present;
}
qboolean G_SpawnVector4( const char *key, const char *defaultString, float *out )
{
char *s;
qboolean present;
present = G_SpawnString( key, defaultString, &s );
sscanf( s, "%f %f %f %f", &out[ 0 ], &out[ 1 ], &out[ 2 ], &out[ 3 ] );
return present;
}
//
// fields are needed for spawning from the entity string
//
typedef enum
{
F_INT,
F_FLOAT,
F_LSTRING, // string on disk, pointer in memory, TAG_LEVEL
F_GSTRING, // string on disk, pointer in memory, TAG_GAME
F_VECTOR,
F_VECTOR4, //TA
F_ANGLEHACK,
F_ENTITY, // index on disk, pointer in memory
F_ITEM, // index on disk, pointer in memory
F_CLIENT, // index on disk, pointer in memory
F_IGNORE
} fieldtype_t;
typedef struct
{
char *name;
int ofs;
fieldtype_t type;
int flags;
} field_t;
field_t fields[ ] =
{
{"classname", FOFS(classname), F_LSTRING},
{"origin", FOFS(s.origin), F_VECTOR},
{"model", FOFS(model), F_LSTRING},
{"model2", FOFS(model2), F_LSTRING},
{"spawnflags", FOFS(spawnflags), F_INT},
{"speed", FOFS(speed), F_FLOAT},
{"target", FOFS(target), F_LSTRING},
{"targetname", FOFS(targetname), F_LSTRING},
{"message", FOFS(message), F_LSTRING},
{"team", FOFS(team), F_LSTRING},
{"wait", FOFS(wait), F_FLOAT},
{"random", FOFS(random), F_FLOAT},
{"count", FOFS(count), F_INT},
{"health", FOFS(health), F_INT},
{"light", 0, F_IGNORE},
{"dmg", FOFS(damage), F_INT},
{"angles", FOFS(s.angles), F_VECTOR},
{"angle", FOFS(s.angles), F_ANGLEHACK},
{"bounce", FOFS(physicsBounce), F_FLOAT},
{"alpha", FOFS(pos1), F_VECTOR},
{"radius", FOFS(pos2), F_VECTOR},
{"acceleration", FOFS(acceleration), F_VECTOR},
{"animation", FOFS(animation), F_VECTOR4},
{"rotatorAngle", FOFS(rotatorAngle), F_FLOAT},
{"targetShaderName", FOFS(targetShaderName), F_LSTRING},
{"targetShaderNewName", FOFS(targetShaderNewName), F_LSTRING},
{NULL}
};
typedef struct
{
char *name;
void (*spawn)(gentity_t *ent);
} spawn_t;
void SP_info_player_start( gentity_t *ent );
void SP_info_player_deathmatch( gentity_t *ent );
void SP_info_player_intermission( gentity_t *ent );
void SP_info_alien_intermission( gentity_t *ent );
void SP_info_human_intermission( gentity_t *ent );
void SP_info_firstplace( gentity_t *ent );
void SP_info_secondplace( gentity_t *ent );
void SP_info_thirdplace( gentity_t *ent );
void SP_info_podium( gentity_t *ent );
void SP_func_plat( gentity_t *ent );
void SP_func_static( gentity_t *ent );
void SP_func_rotating( gentity_t *ent );
void SP_func_bobbing( gentity_t *ent );
void SP_func_pendulum( gentity_t *ent );
void SP_func_button( gentity_t *ent );
void SP_func_door( gentity_t *ent );
void SP_func_door_rotating( gentity_t *ent );
void SP_func_door_model( gentity_t *ent );
void SP_func_train( gentity_t *ent );
void SP_func_timer( gentity_t *self);
void SP_trigger_always( gentity_t *ent );
void SP_trigger_multiple( gentity_t *ent );
void SP_trigger_push( gentity_t *ent );
void SP_trigger_teleport( gentity_t *ent );
void SP_trigger_hurt( gentity_t *ent );
void SP_trigger_stage( gentity_t *ent );
void SP_trigger_win( gentity_t *ent );
void SP_trigger_buildable( gentity_t *ent );
void SP_trigger_class( gentity_t *ent );
void SP_trigger_equipment( gentity_t *ent );
void SP_trigger_gravity( gentity_t *ent );
void SP_trigger_heal( gentity_t *ent );
void SP_trigger_ammo( gentity_t *ent );
void SP_target_delay( gentity_t *ent );
void SP_target_speaker( gentity_t *ent );
void SP_target_print( gentity_t *ent );
void SP_target_character( gentity_t *ent );
void SP_target_score( gentity_t *ent );
void SP_target_teleporter( gentity_t *ent );
void SP_target_relay( gentity_t *ent );
void SP_target_kill( gentity_t *ent );
void SP_target_position( gentity_t *ent );
void SP_target_location( gentity_t *ent );
void SP_target_push( gentity_t *ent );
void SP_target_rumble( gentity_t *ent );
void SP_target_alien_win( gentity_t *ent );
void SP_target_human_win( gentity_t *ent );
void SP_target_hurt( gentity_t *ent );
void SP_light( gentity_t *self );
void SP_info_null( gentity_t *self );
void SP_info_notnull( gentity_t *self );
void SP_info_camp( gentity_t *self );
void SP_path_corner( gentity_t *self );
void SP_misc_teleporter_dest( gentity_t *self );
void SP_misc_model( gentity_t *ent );
void SP_misc_portal_camera( gentity_t *ent );
void SP_misc_portal_surface( gentity_t *ent );
void SP_shooter_rocket( gentity_t *ent );
void SP_shooter_plasma( gentity_t *ent );
void SP_shooter_grenade( gentity_t *ent );
void SP_misc_particle_system( gentity_t *ent );
void SP_misc_anim_model( gentity_t *ent );
void SP_misc_light_flare( gentity_t *ent );
spawn_t spawns[ ] =
{
// info entities don't do anything at all, but provide positional
// information for things controlled by other processes
{ "info_player_start", SP_info_player_start },
{ "info_player_deathmatch", SP_info_player_deathmatch },
{ "info_player_intermission", SP_info_player_intermission },
//TA: extra bits
{ "info_alien_intermission", SP_info_alien_intermission },
{ "info_human_intermission", SP_info_human_intermission },
{ "info_null", SP_info_null },
{ "info_notnull", SP_info_notnull }, // use target_position instead
{ "func_plat", SP_func_plat },
{ "func_button", SP_func_button },
{ "func_door", SP_func_door },
{ "func_door_rotating", SP_func_door_rotating }, //TA
{ "func_door_model", SP_func_door_model }, //TA
{ "func_static", SP_func_static },
{ "func_rotating", SP_func_rotating },
{ "func_bobbing", SP_func_bobbing },
{ "func_pendulum", SP_func_pendulum },
{ "func_train", SP_func_train },
{ "func_group", SP_info_null },
{ "func_timer", SP_func_timer }, // rename trigger_timer?
// Triggers are brush objects that cause an effect when contacted
// by a living player, usually involving firing targets.
// While almost everything could be done with
// a single trigger class and different targets, triggered effects
// could not be client side predicted (push and teleport).
{ "trigger_always", SP_trigger_always },
{ "trigger_multiple", SP_trigger_multiple },
{ "trigger_push", SP_trigger_push },
{ "trigger_teleport", SP_trigger_teleport },
{ "trigger_hurt", SP_trigger_hurt },
{ "trigger_stage", SP_trigger_stage },
{ "trigger_win", SP_trigger_win },
{ "trigger_buildable", SP_trigger_buildable },
{ "trigger_class", SP_trigger_class },
{ "trigger_equipment", SP_trigger_equipment },
{ "trigger_gravity", SP_trigger_gravity },
{ "trigger_heal", SP_trigger_heal },
{ "trigger_ammo", SP_trigger_ammo },
// targets perform no action by themselves, but must be triggered
// by another entity
{ "target_delay", SP_target_delay },
{ "target_speaker", SP_target_speaker },
{ "target_print", SP_target_print },
{ "target_score", SP_target_score },
{ "target_teleporter", SP_target_teleporter },
{ "target_relay", SP_target_relay },
{ "target_kill", SP_target_kill },
{ "target_position", SP_target_position },
{ "target_location", SP_target_location },
{ "target_push", SP_target_push },
{ "target_rumble", SP_target_rumble },
{ "target_alien_win", SP_target_alien_win },
{ "target_human_win", SP_target_human_win },
{ "target_hurt", SP_target_hurt },
{ "light", SP_light },
{ "path_corner", SP_path_corner },
{ "misc_teleporter_dest", SP_misc_teleporter_dest },
{ "misc_model", SP_misc_model },
{ "misc_portal_surface", SP_misc_portal_surface },
{ "misc_portal_camera", SP_misc_portal_camera },
{ "misc_particle_system", SP_misc_particle_system },
{ "misc_anim_model", SP_misc_anim_model },
{ "misc_light_flare", SP_misc_light_flare },
{ NULL, 0 }
};
/*
===============
G_CallSpawn
Finds the spawn function for the entity and calls it,
returning qfalse if not found
===============
*/
qboolean G_CallSpawn( gentity_t *ent )
{
spawn_t *s;
buildable_t buildable;
if( !ent->classname )
{
G_Printf( "G_CallSpawn: NULL classname\n" );
return qfalse;
}
//check buildable spawn functions
if( ( buildable = BG_FindBuildNumForEntityName( ent->classname ) ) != BA_NONE )
{
// don't spawn built-in buildings if we are using a custom layout
if( level.layout[ 0 ] && Q_stricmp( level.layout, "*BUILTIN*" ) )
return qtrue;
if( buildable == BA_A_SPAWN || buildable == BA_H_SPAWN )
{
ent->s.angles[ YAW ] += 180.0f;
AngleNormalize360( ent->s.angles[ YAW ] );
}
G_SpawnBuildable( ent, buildable );
return qtrue;
}
// check normal spawn functions
for( s = spawns; s->name; s++ )
{
if( !strcmp( s->name, ent->classname ) )
{
// found it
s->spawn( ent );
return qtrue;
}
}
G_Printf( "%s doesn't have a spawn function\n", ent->classname );
return qfalse;
}
/*
=============
G_NewString
Builds a copy of the string, translating \n to real linefeeds
so message texts can be multi-line
=============
*/
char *G_NewString( const char *string )
{
char *newb, *new_p;
int i,l;
l = strlen( string ) + 1;
newb = G_Alloc( l );
new_p = newb;
// turn \n into a real linefeed
for( i = 0 ; i < l ; i++ )
{
if( string[ i ] == '\\' && i < l - 1 )
{
i++;
if( string[ i ] == 'n' )
*new_p++ = '\n';
else
*new_p++ = '\\';
}
else
*new_p++ = string[ i ];
}
return newb;
}
/*
===============
G_ParseField
Takes a key/value pair and sets the binary values
in a gentity
===============
*/
void G_ParseField( const char *key, const char *value, gentity_t *ent )
{
field_t *f;
byte *b;
float v;
vec3_t vec;
vec4_t vec4;
for( f = fields; f->name; f++ )
{
if( !Q_stricmp( f->name, key ) )
{
// found it
b = (byte *)ent;
switch( f->type )
{
case F_LSTRING:
*(char **)( b + f->ofs ) = G_NewString( value );
break;
case F_VECTOR:
sscanf( value, "%f %f %f", &vec[ 0 ], &vec[ 1 ], &vec[ 2 ] );
( (float *)( b + f->ofs ) )[ 0 ] = vec[ 0 ];
( (float *)( b + f->ofs ) )[ 1 ] = vec[ 1 ];
( (float *)( b + f->ofs ) )[ 2 ] = vec[ 2 ];
break;
case F_VECTOR4:
sscanf( value, "%f %f %f %f", &vec4[ 0 ], &vec4[ 1 ], &vec4[ 2 ], &vec4[ 3 ] );
( (float *)( b + f->ofs ) )[ 0 ] = vec4[ 0 ];
( (float *)( b + f->ofs ) )[ 1 ] = vec4[ 1 ];
( (float *)( b + f->ofs ) )[ 2 ] = vec4[ 2 ];
( (float *)( b + f->ofs ) )[ 3 ] = vec4[ 3 ];
break;
case F_INT:
*(int *)( b + f->ofs ) = atoi( value );
break;
case F_FLOAT:
*(float *)( b + f->ofs ) = atof( value );
break;
case F_ANGLEHACK:
v = atof( value );
( (float *)( b + f->ofs ) )[ 0 ] = 0;
( (float *)( b + f->ofs ) )[ 1 ] = v;
( (float *)( b + f->ofs ) )[ 2 ] = 0;
break;
default:
case F_IGNORE:
break;
}
return;
}
}
}
/*
===================
G_SpawnGEntityFromSpawnVars
Spawn an entity and fill in all of the level fields from
level.spawnVars[], then call the class specfic spawn function
===================
*/
void G_SpawnGEntityFromSpawnVars( void )
{
int i;
gentity_t *ent;
// get the next free entity
ent = G_Spawn( );
for( i = 0 ; i < level.numSpawnVars ; i++ )
G_ParseField( level.spawnVars[ i ][ 0 ], level.spawnVars[ i ][ 1 ], ent );
G_SpawnInt( "notq3a", "0", &i );
if( i )
{
G_FreeEntity( ent );
return;
}
// move editor origin to pos
VectorCopy( ent->s.origin, ent->s.pos.trBase );
VectorCopy( ent->s.origin, ent->r.currentOrigin );
// if we didn't get a classname, don't bother spawning anything
if( !G_CallSpawn( ent ) )
G_FreeEntity( ent );
}
/*
====================
G_AddSpawnVarToken
====================
*/
char *G_AddSpawnVarToken( const char *string )
{
int l;
char *dest;
l = strlen( string );
if( level.numSpawnVarChars + l + 1 > MAX_SPAWN_VARS_CHARS )
G_Error( "G_AddSpawnVarToken: MAX_SPAWN_CHARS" );
dest = level.spawnVarChars + level.numSpawnVarChars;
memcpy( dest, string, l + 1 );
level.numSpawnVarChars += l + 1;
return dest;
}
/*
====================
G_ParseSpawnVars
Parses a brace bounded set of key / value pairs out of the
level's entity strings into level.spawnVars[]
This does not actually spawn an entity.
====================
*/
qboolean G_ParseSpawnVars( void )
{
char keyname[ MAX_TOKEN_CHARS ];
char com_token[ MAX_TOKEN_CHARS ];
level.numSpawnVars = 0;
level.numSpawnVarChars = 0;
// parse the opening brace
if( !trap_GetEntityToken( com_token, sizeof( com_token ) ) )
{
// end of spawn string
return qfalse;
}
if( com_token[ 0 ] != '{' )
G_Error( "G_ParseSpawnVars: found %s when expecting {", com_token );
// go through all the key / value pairs
while( 1 )
{
// parse key
if( !trap_GetEntityToken( keyname, sizeof( keyname ) ) )
G_Error( "G_ParseSpawnVars: EOF without closing brace" );
if( keyname[0] == '}' )
break;
// parse value
if( !trap_GetEntityToken( com_token, sizeof( com_token ) ) )
G_Error( "G_ParseSpawnVars: EOF without closing brace" );
if( com_token[0] == '}' )
G_Error( "G_ParseSpawnVars: closing brace without data" );
if( level.numSpawnVars == MAX_SPAWN_VARS )
G_Error( "G_ParseSpawnVars: MAX_SPAWN_VARS" );
level.spawnVars[ level.numSpawnVars ][ 0 ] = G_AddSpawnVarToken( keyname );
level.spawnVars[ level.numSpawnVars ][ 1 ] = G_AddSpawnVarToken( com_token );
level.numSpawnVars++;
}
return qtrue;
}
/*QUAKED worldspawn (0 0 0) ?
Every map should have exactly one worldspawn.
"music" music wav file
"gravity" 800 is default gravity
"message" Text to print during connection process
*/
void SP_worldspawn( void )
{
char *s;
G_SpawnString( "classname", "", &s );
if( Q_stricmp( s, "worldspawn" ) )
G_Error( "SP_worldspawn: The first entity isn't 'worldspawn'" );
// make some data visible to connecting client
trap_SetConfigstring( CS_GAME_VERSION, GAME_VERSION );
trap_SetConfigstring( CS_LEVEL_START_TIME, va( "%i", level.startTime ) );
G_SpawnString( "music", "", &s );
trap_SetConfigstring( CS_MUSIC, s );
G_SpawnString( "message", "", &s );
trap_SetConfigstring( CS_MESSAGE, s ); // map specific message
trap_SetConfigstring( CS_MOTD, g_motd.string ); // message of the day
G_SpawnString( "gravity", "800", &s );
trap_Cvar_Set( "g_gravity", s );
G_SpawnString( "humanBuildPoints", DEFAULT_HUMAN_BUILDPOINTS, &s );
trap_Cvar_Set( "g_humanBuildPoints", s );
G_SpawnString( "humanMaxStage", DEFAULT_HUMAN_MAX_STAGE, &s );
trap_Cvar_Set( "g_humanMaxStage", s );
G_SpawnString( "humanStage2Threshold", DEFAULT_HUMAN_STAGE2_THRESH, &s );
trap_Cvar_Set( "g_humanStage2Threshold", s );
G_SpawnString( "humanStage3Threshold", DEFAULT_HUMAN_STAGE3_THRESH, &s );
trap_Cvar_Set( "g_humanStage3Threshold", s );
G_SpawnString( "alienBuildPoints", DEFAULT_ALIEN_BUILDPOINTS, &s );
trap_Cvar_Set( "g_alienBuildPoints", s );
G_SpawnString( "alienMaxStage", DEFAULT_ALIEN_MAX_STAGE, &s );
trap_Cvar_Set( "g_alienMaxStage", s );
G_SpawnString( "alienStage2Threshold", DEFAULT_ALIEN_STAGE2_THRESH, &s );
trap_Cvar_Set( "g_alienStage2Threshold", s );
G_SpawnString( "alienStage3Threshold", DEFAULT_ALIEN_STAGE3_THRESH, &s );
trap_Cvar_Set( "g_alienStage3Threshold", s );
G_SpawnString( "enableDust", "0", &s );
trap_Cvar_Set( "g_enableDust", s );
G_SpawnString( "enableBreath", "0", &s );
trap_Cvar_Set( "g_enableBreath", s );
G_SpawnString( "disabledEquipment", "", &s );
trap_Cvar_Set( "g_disabledEquipment", s );
G_SpawnString( "disabledClasses", "", &s );
trap_Cvar_Set( "g_disabledClasses", s );
G_SpawnString( "disabledBuildables", "", &s );
trap_Cvar_Set( "g_disabledBuildables", s );
g_entities[ ENTITYNUM_WORLD ].s.number = ENTITYNUM_WORLD;
g_entities[ ENTITYNUM_WORLD ].classname = "worldspawn";
if( g_restarted.integer )
trap_Cvar_Set( "g_restarted", "0" );
}
/*
==============
G_SpawnEntitiesFromString
Parses textual entity definitions out of an entstring and spawns gentities.
==============
*/
void G_SpawnEntitiesFromString( void )
{
// allow calls to G_Spawn*()
level.spawning = qtrue;
level.numSpawnVars = 0;
// the worldspawn is not an actual entity, but it still
// has a "spawn" function to perform any global setup
// needed by a level (setting configstrings or cvars, etc)
if( !G_ParseSpawnVars( ) )
G_Error( "SpawnEntities: no entities" );
SP_worldspawn( );
// parse ents
while( G_ParseSpawnVars( ) )
G_SpawnGEntityFromSpawnVars( );
level.spawning = qfalse; // any future calls to G_Spawn*() will be errors
}
-790
View File
@@ -1,790 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// this file holds commands that can be executed by the server console, but not remote clients
#include "g_local.h"
/*
==============================================================================
PACKET FILTERING
You can add or remove addresses from the filter list with:
addip <ip>
removeip <ip>
The ip address is specified in dot format, and you can use '*' to match any value
so you can specify an entire class C network with "addip 192.246.40.*"
Removeip will only remove an address specified exactly the same way. You cannot addip a subnet, then removeip a single host.
listip
Prints the current list of filters.
g_filterban <0 or 1>
If 1 (the default), then ip addresses matching the current list will be prohibited from entering the game. This is the default setting.
If 0, then only addresses matching the list will be allowed. This lets you easily set up a private game, or a game that only allows players from your local network.
TTimo NOTE: for persistence, bans are stored in g_banIPs cvar MAX_CVAR_VALUE_STRING
The size of the cvar string buffer is limiting the banning to around 20 masks
this could be improved by putting some g_banIPs2 g_banIps3 etc. maybe
still, you should rely on PB for banning instead
==============================================================================
*/
// extern vmCvar_t g_banIPs;
// extern vmCvar_t g_filterBan;
typedef struct ipFilter_s
{
unsigned mask;
unsigned compare;
} ipFilter_t;
#define MAX_IPFILTERS 1024
static ipFilter_t ipFilters[ MAX_IPFILTERS ];
static int numIPFilters;
/*
=================
StringToFilter
=================
*/
static qboolean StringToFilter( char *s, ipFilter_t *f )
{
char num[ 128 ];
int i, j;
byte b[ 4 ];
byte m[ 4 ];
for( i = 0; i < 4; i++ )
{
b[ i ] = 0;
m[ i ] = 0;
}
for( i = 0; i < 4; i++ )
{
if( *s < '0' || *s > '9' )
{
if( *s == '*' ) // 'match any'
{
//b[ i ] and m[ i ] to 0
s++;
if ( !*s )
break;
s++;
continue;
}
G_Printf( "Bad filter address: %s\n", s );
return qfalse;
}
j = 0;
while( *s >= '0' && *s <= '9' )
num[ j++ ] = *s++;
num[ j ] = 0;
b[ i ] = atoi( num );
m[ i ] = 255;
if( !*s )
break;
s++;
}
f->mask = *(unsigned *)m;
f->compare = *(unsigned *)b;
return qtrue;
}
/*
=================
UpdateIPBans
=================
*/
static void UpdateIPBans( void )
{
byte b[ 4 ];
byte m[ 4 ];
int i, j;
char iplist_final[ MAX_CVAR_VALUE_STRING ];
char ip[ 64 ];
*iplist_final = 0;
for( i = 0 ; i < numIPFilters ; i++ )
{
if( ipFilters[ i ].compare == 0xffffffff )
continue;
*(unsigned *)b = ipFilters[ i ].compare;
*(unsigned *)m = ipFilters[ i ].mask;
*ip = 0;
for( j = 0 ; j < 4 ; j++ )
{
if( m[ j ] != 255 )
Q_strcat( ip, sizeof( ip ), "*" );
else
Q_strcat( ip, sizeof( ip ), va( "%i", b[ j ] ) );
Q_strcat( ip, sizeof( ip ), ( j < 3 ) ? "." : " " );
}
if( strlen( iplist_final ) + strlen( ip ) < MAX_CVAR_VALUE_STRING )
Q_strcat( iplist_final, sizeof( iplist_final ), ip );
else
{
Com_Printf( "g_banIPs overflowed at MAX_CVAR_VALUE_STRING\n" );
break;
}
}
trap_Cvar_Set( "g_banIPs", iplist_final );
}
/*
=================
G_FilterPacket
=================
*/
qboolean G_FilterPacket( char *from )
{
int i;
unsigned in;
byte m[ 4 ];
char *p;
i = 0;
p = from;
while( *p && i < 4 )
{
m[ i ] = 0;
while( *p >= '0' && *p <= '9' )
{
m[ i ] = m[ i ] * 10 + ( *p - '0' );
p++;
}
if( !*p || *p == ':' )
break;
i++, p++;
}
in = *(unsigned *)m;
for( i = 0; i < numIPFilters; i++ )
if( ( in & ipFilters[ i ].mask ) == ipFilters[ i ].compare )
return g_filterBan.integer != 0;
return g_filterBan.integer == 0;
}
/*
=================
AddIP
=================
*/
static void AddIP( char *str )
{
int i;
for( i = 0 ; i < numIPFilters ; i++ )
if( ipFilters[ i ].compare == 0xffffffff )
break; // free spot
if( i == numIPFilters )
{
if( numIPFilters == MAX_IPFILTERS )
{
G_Printf( "IP filter list is full\n" );
return;
}
numIPFilters++;
}
if( !StringToFilter( str, &ipFilters[ i ] ) )
ipFilters[ i ].compare = 0xffffffffu;
UpdateIPBans( );
}
/*
=================
G_ProcessIPBans
=================
*/
void G_ProcessIPBans( void )
{
char *s, *t;
char str[ MAX_CVAR_VALUE_STRING ];
Q_strncpyz( str, g_banIPs.string, sizeof( str ) );
for( t = s = g_banIPs.string; *t; /* */ )
{
s = strchr( s, ' ' );
if( !s )
break;
while( *s == ' ' )
*s++ = 0;
if( *t )
AddIP( t );
t = s;
}
}
/*
=================
Svcmd_AddIP_f
=================
*/
void Svcmd_AddIP_f( void )
{
char str[ MAX_TOKEN_CHARS ];
if( trap_Argc( ) < 2 )
{
G_Printf( "Usage: addip <ip-mask>\n" );
return;
}
trap_Argv( 1, str, sizeof( str ) );
AddIP( str );
}
/*
=================
Svcmd_RemoveIP_f
=================
*/
void Svcmd_RemoveIP_f( void )
{
ipFilter_t f;
int i;
char str[ MAX_TOKEN_CHARS ];
if( trap_Argc( ) < 2 )
{
G_Printf( "Usage: sv removeip <ip-mask>\n" );
return;
}
trap_Argv( 1, str, sizeof( str ) );
if( !StringToFilter( str, &f ) )
return;
for( i = 0; i < numIPFilters; i++ )
{
if( ipFilters[ i ].mask == f.mask &&
ipFilters[ i ].compare == f.compare)
{
ipFilters[ i ].compare = 0xffffffffu;
G_Printf ( "Removed.\n" );
UpdateIPBans( );
return;
}
}
G_Printf ( "Didn't find %s.\n", str );
}
/*
===================
Svcmd_EntityList_f
===================
*/
void Svcmd_EntityList_f( void )
{
int e;
gentity_t *check;
check = g_entities + 1;
for( e = 1; e < level.num_entities; e++, check++ )
{
if( !check->inuse )
continue;
G_Printf( "%3i:", e );
switch( check->s.eType )
{
case ET_GENERAL:
G_Printf( "ET_GENERAL " );
break;
case ET_PLAYER:
G_Printf( "ET_PLAYER " );
break;
case ET_ITEM:
G_Printf( "ET_ITEM " );
break;
case ET_BUILDABLE:
G_Printf( "ET_BUILDABLE " );
break;
case ET_MISSILE:
G_Printf( "ET_MISSILE " );
break;
case ET_MOVER:
G_Printf( "ET_MOVER " );
break;
case ET_BEAM:
G_Printf( "ET_BEAM " );
break;
case ET_PORTAL:
G_Printf( "ET_PORTAL " );
break;
case ET_SPEAKER:
G_Printf( "ET_SPEAKER " );
break;
case ET_PUSH_TRIGGER:
G_Printf( "ET_PUSH_TRIGGER " );
break;
case ET_TELEPORT_TRIGGER:
G_Printf( "ET_TELEPORT_TRIGGER " );
break;
case ET_INVISIBLE:
G_Printf( "ET_INVISIBLE " );
break;
case ET_GRAPPLE:
G_Printf( "ET_GRAPPLE " );
break;
default:
G_Printf( "%3i ", check->s.eType );
break;
}
if( check->classname )
G_Printf( "%s", check->classname );
G_Printf( "\n" );
}
}
gclient_t *ClientForString( const char *s )
{
gclient_t *cl;
int i;
int idnum;
// numeric values are just slot numbers
if( s[ 0 ] >= '0' && s[ 0 ] <= '9' )
{
idnum = atoi( s );
if( idnum < 0 || idnum >= level.maxclients )
{
Com_Printf( "Bad client slot: %i\n", idnum );
return NULL;
}
cl = &level.clients[ idnum ];
if( cl->pers.connected == CON_DISCONNECTED )
{
G_Printf( "Client %i is not connected\n", idnum );
return NULL;
}
return cl;
}
// check for a name match
for( i = 0; i < level.maxclients; i++ )
{
cl = &level.clients[ i ];
if( cl->pers.connected == CON_DISCONNECTED )
continue;
if( !Q_stricmp( cl->pers.netname, s ) )
return cl;
}
G_Printf( "User %s is not on the server\n", s );
return NULL;
}
/*
===================
Svcmd_ForceTeam_f
forceteam <player> <team>
===================
*/
void Svcmd_ForceTeam_f( void )
{
gclient_t *cl;
char str[ MAX_TOKEN_CHARS ];
// find the player
trap_Argv( 1, str, sizeof( str ) );
cl = ClientForString( str );
if( !cl )
return;
// set the team
trap_Argv( 2, str, sizeof( str ) );
/*SetTeam( &g_entities[cl - level.clients], str );*/
//FIXME: tremulise this
}
/*
===================
Svcmd_LayoutSave_f
layoutsave <name>
===================
*/
void Svcmd_LayoutSave_f( void )
{
char str[ MAX_QPATH ];
char str2[ MAX_QPATH - 4 ];
char *s;
int i = 0;
if( trap_Argc( ) != 2 )
{
G_Printf( "usage: layoutsave LAYOUTNAME\n" );
return;
}
trap_Argv( 1, str, sizeof( str ) );
// sanitize name
s = &str[ 0 ];
while( *s && i < sizeof( str2 ) - 1 )
{
if( ( *s >= '0' && *s <= '9' ) ||
( *s >= 'a' && *s <= 'z' ) ||
( *s >= 'A' && *s <= 'Z' ) || *s == '-' || *s == '_' )
{
str2[ i++ ] = *s;
str2[ i ] = '\0';
}
s++;
}
if( !str2[ 0 ] )
{
G_Printf("layoutsave: invalid name \"%s\"\n", str );
return;
}
G_LayoutSave( str2 );
}
char *ConcatArgs( int start );
/*
===================
Svcmd_LayoutLoad_f
layoutload [<name> [<name2> [<name3 [...]]]]
This is just a silly alias for doing:
set g_layouts "name name2 name3"
map_restart
===================
*/
void Svcmd_LayoutLoad_f( void )
{
char layouts[ MAX_CVAR_VALUE_STRING ];
char *s;
s = ConcatArgs( 1 );
Q_strncpyz( layouts, s, sizeof( layouts ) );
trap_Cvar_Set( "g_layouts", layouts );
trap_SendConsoleCommand( EXEC_APPEND, "map_restart\n" );
level.restarted = qtrue;
}
/*
===================
Svcmd_NobuildSave_f
nobuildsave
===================
*/
void Svcmd_NobuildSave_f( void )
{
G_NobuildSave();
}
char *ConcatArgs( int start );
/*
===================
Svcmd_NobuildLoad_f
nobuildload
===================
*/
void Svcmd_NobuildLoad_f( void )
{
G_NobuildLoad();
}
static void Svcmd_AdmitDefeat_f( void )
{
int team;
char teamNum[ 2 ];
if( trap_Argc( ) != 2 )
{
G_Printf("admitdefeat: must provide a team\n");
return;
}
trap_Argv( 1, teamNum, sizeof( teamNum ) );
team = atoi( teamNum );
if( team == PTE_ALIENS || teamNum[ 0 ] == 'a' )
{
level.surrenderTeam = PTE_ALIENS;
G_BaseSelfDestruct( PTE_ALIENS );
G_TeamCommand( PTE_ALIENS, "cp \"Hivemind Link Broken\" 1");
trap_SendServerCommand( -1, "print \"Alien team has admitted defeat\n\"" );
}
else if( team == PTE_HUMANS || teamNum[ 0 ] == 'h' )
{
level.surrenderTeam = PTE_HUMANS;
G_BaseSelfDestruct( PTE_HUMANS );
G_TeamCommand( PTE_HUMANS, "cp \"Life Support Terminated\" 1");
trap_SendServerCommand( -1, "print \"Human team has admitted defeat\n\"" );
}
else
{
G_Printf("admitdefeat: invalid team\n");
}
}
/*
=================
ConsoleCommand
=================
*/
qboolean ConsoleCommand( void )
{
char cmd[ MAX_TOKEN_CHARS ];
trap_Argv( 0, cmd, sizeof( cmd ) );
if( Q_stricmp( cmd, "entitylist" ) == 0 )
{
Svcmd_EntityList_f( );
return qtrue;
}
if( Q_stricmp( cmd, "forceteam" ) == 0 )
{
Svcmd_ForceTeam_f( );
return qtrue;
}
if( Q_stricmp( cmd, "game_memory" ) == 0 )
{
Svcmd_GameMem_f( );
return qtrue;
}
if( Q_stricmp( cmd, "addip" ) == 0 )
{
Svcmd_AddIP_f( );
return qtrue;
}
if( Q_stricmp( cmd, "removeip" ) == 0 )
{
Svcmd_RemoveIP_f( );
return qtrue;
}
if( Q_stricmp( cmd, "listip" ) == 0 )
{
trap_SendConsoleCommand( EXEC_NOW, "g_banIPs\n" );
return qtrue;
}
if( Q_stricmp( cmd, "mapRotation" ) == 0 )
{
char *rotationName = ConcatArgs( 1 );
if( !G_StartMapRotation( rotationName, qfalse ) )
G_Printf( "Can't find map rotation %s\n", rotationName );
return qtrue;
}
if( Q_stricmp( cmd, "stopMapRotation" ) == 0 )
{
G_StopMapRotation( );
return qtrue;
}
if( Q_stricmp( cmd, "advanceMapRotation" ) == 0 )
{
G_AdvanceMapRotation( );
return qtrue;
}
if( Q_stricmp( cmd, "alienWin" ) == 0 )
{
int i;
gentity_t *e;
for( i = 1, e = g_entities + i; i < level.num_entities; i++, e++ )
{
if( e->s.modelindex == BA_H_SPAWN )
G_Damage( e, NULL, NULL, NULL, NULL, 10000, 0, MOD_SUICIDE );
}
return qtrue;
}
if( Q_stricmp( cmd, "humanWin" ) == 0 )
{
int i;
gentity_t *e;
for( i = 1, e = g_entities + i; i < level.num_entities; i++, e++ )
{
if( e->s.modelindex == BA_A_SPAWN )
G_Damage( e, NULL, NULL, NULL, NULL, 10000, 0, MOD_SUICIDE );
}
return qtrue;
}
if( !Q_stricmp( cmd, "layoutsave" ) )
{
Svcmd_LayoutSave_f( );
return qtrue;
}
if( !Q_stricmp( cmd, "layoutload" ) )
{
Svcmd_LayoutLoad_f( );
return qtrue;
}
if( !Q_stricmp( cmd, "nobuildsave" ) )
{
Svcmd_NobuildSave_f( );
return qtrue;
}
if( !Q_stricmp( cmd, "nobuildload" ) )
{
Svcmd_NobuildLoad_f( );
return qtrue;
}
if( !Q_stricmp( cmd, "admitdefeat" ) )
{
Svcmd_AdmitDefeat_f( );
return qtrue;
}
if( !Q_stricmp( cmd, "evacuation" ) )
{
trap_SendServerCommand( -1, "print \"Evacuation ordered\n\"" );
level.lastWin = PTE_NONE;
trap_SetConfigstring( CS_WINNER, "Evacuation" );
LogExit( "Evacuation." );
G_admin_maplog_result( "d" );
return qtrue;
}
// see if this is a a admin command
if( G_admin_cmd_check( NULL, qfalse ) )
return qtrue;
if( g_dedicated.integer )
{
if( Q_stricmp( cmd, "say" ) == 0 )
{
trap_SendServerCommand( -1, va( "print \"server: %s\n\"", ConcatArgs( 1 ) ) );
return qtrue;
}
else if( !Q_stricmp( cmd, "chat" ) )
{
trap_SendServerCommand( -1, va( "chat \"%s\" -1 0", ConcatArgs( 1 ) ) );
G_Printf( "chat: %s\n", ConcatArgs( 1 ) );
return qtrue;
}
else if( !Q_stricmp( cmd, "cp" ) )
{
char buffer[MAX_STRING_CHARS];
Q_strncpyz( buffer, ConcatArgs( 1 ), sizeof( buffer ) );
G_ParseEscapedString( buffer );
trap_SendServerCommand( -1, va( "cp \"%s\"", buffer ) );
trap_SendServerCommand( -1, va( "print \"CP: %s\n\"", buffer ) );
G_Printf( "cp: %s\n", ConcatArgs( 1 ) );
return qtrue;
}
else if( !Q_stricmp( cmd, "m" ) )
{
G_PrivateMessage( NULL );
return qtrue;
}
else if( !Q_stricmp( cmd, "a" ) || !Q_stricmp( cmd, "say_admins" ))
{
G_Say( NULL, NULL, SAY_ADMINS, ConcatArgs( 1 ) );
return qtrue;
}
G_Printf( "unknown command: %s\n", cmd );
return qtrue;
}
return qfalse;
}
-65
View File
@@ -1,65 +0,0 @@
code
equ trap_Printf -1
equ trap_Error -2
equ trap_Milliseconds -3
equ trap_Cvar_Register -4
equ trap_Cvar_Update -5
equ trap_Cvar_Set -6
equ trap_Cvar_VariableIntegerValue -7
equ trap_Cvar_VariableStringBuffer -8
equ trap_Argc -9
equ trap_Argv -10
equ trap_FS_FOpenFile -11
equ trap_FS_Read -12
equ trap_FS_Write -13
equ trap_FS_FCloseFile -14
equ trap_SendConsoleCommand -15
equ trap_LocateGameData -16
equ trap_DropClient -17
equ trap_SendServerCommand -18
equ trap_SetConfigstring -19
equ trap_GetConfigstring -20
equ trap_GetUserinfo -21
equ trap_SetUserinfo -22
equ trap_GetServerinfo -23
equ trap_SetBrushModel -24
equ trap_Trace -25
equ trap_PointContents -26
equ trap_InPVS -27
equ trap_InPVSIgnorePortals -28
equ trap_AdjustAreaPortalState -29
equ trap_AreasConnected -30
equ trap_LinkEntity -31
equ trap_UnlinkEntity -32
equ trap_EntitiesInBox -33
equ trap_EntityContact -34
equ trap_GetUsercmd -35
equ trap_GetEntityToken -36
equ trap_FS_GetFileList -37
equ trap_RealTime -38
equ trap_SnapVector -39
equ trap_TraceCapsule -40
equ trap_EntityContactCapsule -41
equ trap_FS_Seek -42
equ trap_Parse_AddGlobalDefine -43
equ trap_Parse_LoadSource -44
equ trap_Parse_FreeSource -45
equ trap_Parse_ReadToken -46
equ trap_Parse_SourceFileAndLine -47
equ trap_SendGameStat -48
equ memset -101
equ memcpy -102
equ strncpy -103
equ sin -104
equ cos -105
equ atan2 -106
equ sqrt -107
equ floor -111
equ ceil -112
equ testPrintInt -113
equ testPrintFloat -114
-284
View File
@@ -1,284 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#include "g_local.h"
// this file is only included when building a dll
// g_syscalls.asm is included instead when building a qvm
static intptr_t (QDECL *syscall)( intptr_t arg, ... ) = (intptr_t (QDECL *)( intptr_t, ...))-1;
void dllEntry( intptr_t (QDECL *syscallptr)( intptr_t arg,... ) )
{
syscall = syscallptr;
}
int PASSFLOAT( float x )
{
float floatTemp;
floatTemp = x;
return *(int *)&floatTemp;
}
void trap_Printf( const char *fmt )
{
syscall( G_PRINT, fmt );
}
void trap_Error( const char *fmt )
{
syscall( G_ERROR, fmt );
}
int trap_Milliseconds( void )
{
return syscall( G_MILLISECONDS );
}
int trap_Argc( void )
{
return syscall( G_ARGC );
}
void trap_Argv( int n, char *buffer, int bufferLength )
{
syscall( G_ARGV, n, buffer, bufferLength );
}
int trap_FS_FOpenFile( const char *qpath, fileHandle_t *f, fsMode_t mode )
{
return syscall( G_FS_FOPEN_FILE, qpath, f, mode );
}
void trap_FS_Read( void *buffer, int len, fileHandle_t f )
{
syscall( G_FS_READ, buffer, len, f );
}
void trap_FS_Write( const void *buffer, int len, fileHandle_t f )
{
syscall( G_FS_WRITE, buffer, len, f );
}
void trap_FS_FCloseFile( fileHandle_t f )
{
syscall( G_FS_FCLOSE_FILE, f );
}
int trap_FS_GetFileList( const char *path, const char *extension, char *listbuf, int bufsize )
{
return syscall( G_FS_GETFILELIST, path, extension, listbuf, bufsize );
}
void trap_SendConsoleCommand( int exec_when, const char *text )
{
syscall( G_SEND_CONSOLE_COMMAND, exec_when, text );
}
void trap_Cvar_Register( vmCvar_t *cvar, const char *var_name, const char *value, int flags )
{
syscall( G_CVAR_REGISTER, cvar, var_name, value, flags );
}
void trap_Cvar_Update( vmCvar_t *cvar )
{
syscall( G_CVAR_UPDATE, cvar );
}
void trap_Cvar_Set( const char *var_name, const char *value )
{
syscall( G_CVAR_SET, var_name, value );
}
int trap_Cvar_VariableIntegerValue( const char *var_name )
{
return syscall( G_CVAR_VARIABLE_INTEGER_VALUE, var_name );
}
void trap_Cvar_VariableStringBuffer( const char *var_name, char *buffer, int bufsize )
{
syscall( G_CVAR_VARIABLE_STRING_BUFFER, var_name, buffer, bufsize );
}
void trap_LocateGameData( gentity_t *gEnts, int numGEntities, int sizeofGEntity_t,
playerState_t *clients, int sizeofGClient )
{
syscall( G_LOCATE_GAME_DATA, gEnts, numGEntities, sizeofGEntity_t, clients, sizeofGClient );
}
void trap_DropClient( int clientNum, const char *reason )
{
syscall( G_DROP_CLIENT, clientNum, reason );
}
void trap_SendServerCommand( int clientNum, const char *text )
{
syscall( G_SEND_SERVER_COMMAND, clientNum, text );
}
void trap_SetConfigstring( int num, const char *string )
{
syscall( G_SET_CONFIGSTRING, num, string );
}
void trap_GetConfigstring( int num, char *buffer, int bufferSize )
{
syscall( G_GET_CONFIGSTRING, num, buffer, bufferSize );
}
void trap_GetUserinfo( int num, char *buffer, int bufferSize )
{
syscall( G_GET_USERINFO, num, buffer, bufferSize );
}
void trap_SetUserinfo( int num, const char *buffer )
{
syscall( G_SET_USERINFO, num, buffer );
}
void trap_GetServerinfo( char *buffer, int bufferSize )
{
syscall( G_GET_SERVERINFO, buffer, bufferSize );
}
void trap_SetBrushModel( gentity_t *ent, const char *name )
{
syscall( G_SET_BRUSH_MODEL, ent, name );
}
void trap_Trace( trace_t *results, const vec3_t start, const vec3_t mins,
const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask )
{
syscall( G_TRACE, results, start, mins, maxs, end, passEntityNum, contentmask );
}
void trap_TraceCapsule( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask )
{
syscall( G_TRACECAPSULE, results, start, mins, maxs, end, passEntityNum, contentmask );
}
int trap_PointContents( const vec3_t point, int passEntityNum )
{
return syscall( G_POINT_CONTENTS, point, passEntityNum );
}
qboolean trap_InPVS( const vec3_t p1, const vec3_t p2 )
{
return syscall( G_IN_PVS, p1, p2 );
}
qboolean trap_InPVSIgnorePortals( const vec3_t p1, const vec3_t p2 )
{
return syscall( G_IN_PVS_IGNORE_PORTALS, p1, p2 );
}
void trap_AdjustAreaPortalState( gentity_t *ent, qboolean open )
{
syscall( G_ADJUST_AREA_PORTAL_STATE, ent, open );
}
qboolean trap_AreasConnected( int area1, int area2 )
{
return syscall( G_AREAS_CONNECTED, area1, area2 );
}
void trap_LinkEntity( gentity_t *ent )
{
syscall( G_LINKENTITY, ent );
}
void trap_UnlinkEntity( gentity_t *ent )
{
syscall( G_UNLINKENTITY, ent );
}
int trap_EntitiesInBox( const vec3_t mins, const vec3_t maxs, int *list, int maxcount )
{
return syscall( G_ENTITIES_IN_BOX, mins, maxs, list, maxcount );
}
qboolean trap_EntityContact( const vec3_t mins, const vec3_t maxs, const gentity_t *ent )
{
return syscall( G_ENTITY_CONTACT, mins, maxs, ent );
}
qboolean trap_EntityContactCapsule( const vec3_t mins, const vec3_t maxs, const gentity_t *ent )
{
return syscall( G_ENTITY_CONTACTCAPSULE, mins, maxs, ent );
}
void trap_GetUsercmd( int clientNum, usercmd_t *cmd )
{
syscall( G_GET_USERCMD, clientNum, cmd );
}
qboolean trap_GetEntityToken( char *buffer, int bufferSize )
{
return syscall( G_GET_ENTITY_TOKEN, buffer, bufferSize );
}
int trap_RealTime( qtime_t *qtime )
{
return syscall( G_REAL_TIME, qtime );
}
void trap_SnapVector( float *v )
{
syscall( G_SNAPVECTOR, v );
return;
}
void trap_SendGameStat( const char *data )
{
syscall( G_SEND_GAMESTAT, data );
return;
}
int trap_Parse_AddGlobalDefine( char *define )
{
return syscall( G_PARSE_ADD_GLOBAL_DEFINE, define );
}
int trap_Parse_LoadSource( const char *filename )
{
return syscall( G_PARSE_LOAD_SOURCE, filename );
}
int trap_Parse_FreeSource( int handle )
{
return syscall( G_PARSE_FREE_SOURCE, handle );
}
int trap_Parse_ReadToken( int handle, pc_token_t *pc_token )
{
return syscall( G_PARSE_READ_TOKEN, handle, pc_token );
}
int trap_Parse_SourceFileAndLine( int handle, char *filename, int *line )
{
return syscall( G_PARSE_SOURCE_FILE_AND_LINE, handle, filename, line );
}
-472
View File
@@ -1,472 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#include "g_local.h"
//==========================================================
/*QUAKED target_delay (1 0 0) (-8 -8 -8) (8 8 8)
"wait" seconds to pause before firing targets.
"random" delay variance, total delay = delay +/- random seconds
*/
void Think_Target_Delay( gentity_t *ent )
{
G_UseTargets( ent, ent->activator );
}
void Use_Target_Delay( gentity_t *ent, gentity_t *other, gentity_t *activator )
{
ent->nextthink = level.time + ( ent->wait + ent->random * crandom( ) ) * 1000;
ent->think = Think_Target_Delay;
ent->activator = activator;
}
void SP_target_delay( gentity_t *ent )
{
// check delay for backwards compatability
if( !G_SpawnFloat( "delay", "0", &ent->wait ) )
G_SpawnFloat( "wait", "1", &ent->wait );
if( !ent->wait )
ent->wait = 1;
ent->use = Use_Target_Delay;
}
//==========================================================
/*QUAKED target_score (1 0 0) (-8 -8 -8) (8 8 8)
"count" number of points to add, default 1
The activator is given this many points.
*/
void Use_Target_Score( gentity_t *ent, gentity_t *other, gentity_t *activator )
{
AddScore( activator, ent->count );
}
void SP_target_score( gentity_t *ent )
{
if( !ent->count )
ent->count = 1;
ent->use = Use_Target_Score;
}
//==========================================================
/*QUAKED target_print (1 0 0) (-8 -8 -8) (8 8 8) humanteam alienteam private
"message" text to print
If "private", only the activator gets the message. If no checks, all clients get the message.
*/
void Use_Target_Print( gentity_t *ent, gentity_t *other, gentity_t *activator )
{
if( activator->client && ( ent->spawnflags & 4 ) )
{
trap_SendServerCommand( activator-g_entities, va( "cp \"%s\"", ent->message ) );
return;
}
if( ent->spawnflags & 3 )
{
if( ent->spawnflags & 1 )
G_TeamCommand( PTE_HUMANS, va( "cp \"%s\"", ent->message ) );
if( ent->spawnflags & 2 )
G_TeamCommand( PTE_ALIENS, va( "cp \"%s\"", ent->message ) );
return;
}
trap_SendServerCommand( -1, va("cp \"%s\"", ent->message ) );
}
void SP_target_print( gentity_t *ent )
{
ent->use = Use_Target_Print;
}
//==========================================================
/*QUAKED target_speaker (1 0 0) (-8 -8 -8) (8 8 8) looped-on looped-off global activator
"noise" wav file to play
A global sound will play full volume throughout the level.
Activator sounds will play on the player that activated the target.
Global and activator sounds can't be combined with looping.
Normal sounds play each time the target is used.
Looped sounds will be toggled by use functions.
Multiple identical looping sounds will just increase volume without any speed cost.
"wait" : Seconds between auto triggerings, 0 = don't auto trigger
"random" wait variance, default is 0
*/
void Use_Target_Speaker( gentity_t *ent, gentity_t *other, gentity_t *activator )
{
if( ent->spawnflags & 3 )
{ // looping sound toggles
if( ent->s.loopSound )
ent->s.loopSound = 0; // turn it off
else
ent->s.loopSound = ent->noise_index; // start it
}
else
{
// normal sound
if( ent->spawnflags & 8 )
G_AddEvent( activator, EV_GENERAL_SOUND, ent->noise_index );
else if( ent->spawnflags & 4 )
G_AddEvent( ent, EV_GLOBAL_SOUND, ent->noise_index );
else
G_AddEvent( ent, EV_GENERAL_SOUND, ent->noise_index );
}
}
void SP_target_speaker( gentity_t *ent )
{
char buffer[ MAX_QPATH ];
char *s;
G_SpawnFloat( "wait", "0", &ent->wait );
G_SpawnFloat( "random", "0", &ent->random );
if( !G_SpawnString( "noise", "NOSOUND", &s ) )
G_Error( "target_speaker without a noise key at %s", vtos( ent->s.origin ) );
// force all client reletive sounds to be "activator" speakers that
// play on the entity that activates it
if( s[ 0 ] == '*' )
ent->spawnflags |= 8;
if( !strstr( s, ".wav" ) )
Com_sprintf( buffer, sizeof( buffer ), "%s.wav", s );
else
Q_strncpyz( buffer, s, sizeof( buffer ) );
ent->noise_index = G_SoundIndex( buffer );
// a repeating speaker can be done completely client side
ent->s.eType = ET_SPEAKER;
ent->s.eventParm = ent->noise_index;
ent->s.frame = ent->wait * 10;
ent->s.clientNum = ent->random * 10;
// check for prestarted looping sound
if( ent->spawnflags & 1 )
ent->s.loopSound = ent->noise_index;
ent->use = Use_Target_Speaker;
if( ent->spawnflags & 4 )
ent->r.svFlags |= SVF_BROADCAST;
VectorCopy( ent->s.origin, ent->s.pos.trBase );
// must link the entity so we get areas and clusters so
// the server can determine who to send updates to
trap_LinkEntity( ent );
}
//==========================================================
void target_teleporter_use( gentity_t *self, gentity_t *other, gentity_t *activator )
{
gentity_t *dest;
if( !activator->client )
return;
dest = G_PickTarget( self->target );
if( !dest )
{
G_Printf( "Couldn't find teleporter destination\n" );
return;
}
TeleportPlayer( activator, dest->s.origin, dest->s.angles );
}
/*QUAKED target_teleporter (1 0 0) (-8 -8 -8) (8 8 8)
The activator will be teleported away.
*/
void SP_target_teleporter( gentity_t *self )
{
if( !self->targetname )
G_Printf( "untargeted %s at %s\n", self->classname, vtos( self->s.origin ) );
self->use = target_teleporter_use;
}
//==========================================================
/*QUAKED target_relay (.5 .5 .5) (-8 -8 -8) (8 8 8) RED_ONLY BLUE_ONLY RANDOM
This doesn't perform any actions except fire its targets.
The activator can be forced to be from a certain team.
if RANDOM is checked, only one of the targets will be fired, not all of them
*/
void target_relay_use( gentity_t *self, gentity_t *other, gentity_t *activator )
{
if( ( self->spawnflags & 1 ) && activator->client &&
activator->client->ps.stats[ STAT_PTEAM ] != PTE_HUMANS )
return;
if( ( self->spawnflags & 2 ) && activator->client &&
activator->client->ps.stats[ STAT_PTEAM ] != PTE_ALIENS )
return;
if( self->spawnflags & 4 )
{
gentity_t *ent;
ent = G_PickTarget( self->target );
if( ent && ent->use )
ent->use( ent, self, activator );
return;
}
G_UseTargets( self, activator );
}
void SP_target_relay( gentity_t *self )
{
self->use = target_relay_use;
}
//==========================================================
/*QUAKED target_kill (.5 .5 .5) (-8 -8 -8) (8 8 8)
Kills the activator.
*/
void target_kill_use( gentity_t *self, gentity_t *other, gentity_t *activator )
{
G_Damage( activator, NULL, NULL, NULL, NULL, 100000, DAMAGE_NO_PROTECTION, MOD_TELEFRAG );
}
void SP_target_kill( gentity_t *self )
{
self->use = target_kill_use;
}
/*QUAKED target_position (0 0.5 0) (-4 -4 -4) (4 4 4)
Used as a positional target for in-game calculation, like jumppad targets.
*/
void SP_target_position( gentity_t *self )
{
G_SetOrigin( self, self->s.origin );
}
static void target_location_linkup( gentity_t *ent )
{
int i;
int n;
if( level.locationLinked )
return;
level.locationLinked = qtrue;
level.locationHead = NULL;
trap_SetConfigstring( CS_LOCATIONS, "unknown" );
for( i = 0, ent = g_entities, n = 1; i < level.num_entities; i++, ent++)
{
if( ent->classname && !Q_stricmp( ent->classname, "target_location" ) )
{
// lets overload some variables!
ent->health = n; // use for location marking
trap_SetConfigstring( CS_LOCATIONS + n, ent->message );
n++;
ent->nextTrain = level.locationHead;
level.locationHead = ent;
}
}
// All linked together now
}
/*QUAKED target_location (0 0.5 0) (-8 -8 -8) (8 8 8)
Set "message" to the name of this location.
Set "count" to 0-7 for color.
0:white 1:red 2:green 3:yellow 4:blue 5:cyan 6:magenta 7:white
Closest target_location in sight used for the location, if none
in site, closest in distance
*/
void SP_target_location( gentity_t *self )
{
self->think = target_location_linkup;
self->nextthink = level.time + 200; // Let them all spawn first
G_SetOrigin( self, self->s.origin );
}
/*
===============
target_rumble_think
===============
*/
void target_rumble_think( gentity_t *self )
{
int i;
gentity_t *ent;
if( self->last_move_time < level.time )
self->last_move_time = level.time + 0.5;
for( i = 0, ent = g_entities + i; i < level.num_entities; i++, ent++ )
{
if( !ent->inuse )
continue;
if( !ent->client )
continue;
if( ent->client->ps.groundEntityNum == ENTITYNUM_NONE )
continue;
ent->client->ps.groundEntityNum = ENTITYNUM_NONE;
ent->client->ps.velocity[ 0 ] += crandom( ) * 150;
ent->client->ps.velocity[ 1 ] += crandom( ) * 150;
ent->client->ps.velocity[ 2 ] = self->speed;
}
if( level.time < self->timestamp )
self->nextthink = level.time + FRAMETIME;
}
/*
===============
target_rumble_use
===============
*/
void target_rumble_use( gentity_t *self, gentity_t *other, gentity_t *activator )
{
self->timestamp = level.time + ( self->count * FRAMETIME );
self->nextthink = level.time + FRAMETIME;
self->activator = activator;
self->last_move_time = 0;
}
/*
===============
SP_target_rumble
===============
*/
void SP_target_rumble( gentity_t *self )
{
if( !self->targetname )
{
G_Printf( S_COLOR_YELLOW "WARNING: untargeted %s at %s\n", self->classname,
vtos( self->s.origin ) );
}
if( !self->count )
self->count = 10;
if( !self->speed )
self->speed = 100;
self->think = target_rumble_think;
self->use = target_rumble_use;
}
/*
===============
target_alien_win_use
===============
*/
void target_alien_win_use( gentity_t *self, gentity_t *other, gentity_t *activator )
{
level.uncondAlienWin = qtrue;
}
/*
===============
SP_target_alien_win
===============
*/
void SP_target_alien_win( gentity_t *self )
{
self->use = target_alien_win_use;
}
/*
===============
target_human_win_use
===============
*/
void target_human_win_use( gentity_t *self, gentity_t *other, gentity_t *activator )
{
level.uncondHumanWin = qtrue;
}
/*
===============
SP_target_human_win
===============
*/
void SP_target_human_win( gentity_t *self )
{
self->use = target_human_win_use;
}
/*
===============
target_hurt_use
===============
*/
void target_hurt_use( gentity_t *self, gentity_t *other, gentity_t *activator )
{
// hurt the activator
if( !activator->takedamage )
return;
G_Damage( activator, self, self, NULL, NULL, self->damage, 0, MOD_TRIGGER_HURT );
}
/*
===============
SP_target_hurt
===============
*/
void SP_target_hurt( gentity_t *self )
{
if( !self->targetname )
{
G_Printf( S_COLOR_YELLOW "WARNING: untargeted %s at %s\n", self->classname,
vtos( self->s.origin ) );
}
if( !self->damage )
self->damage = 5;
self->use = target_hurt_use;
}
-276
View File
@@ -1,276 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#include "g_local.h"
// NULL for everyone
void QDECL PrintMsg( gentity_t *ent, const char *fmt, ... )
{
char msg[ 1024 ];
va_list argptr;
char *p;
va_start( argptr,fmt );
if( vsprintf( msg, fmt, argptr ) > sizeof( msg ) )
G_Error ( "PrintMsg overrun" );
va_end( argptr );
// double quotes are bad
while( ( p = strchr( msg, '"' ) ) != NULL )
*p = '\'';
trap_SendServerCommand( ( ( ent == NULL ) ? -1 : ent-g_entities ), va( "print \"%s\"", msg ) );
}
/*
==============
OnSameTeam
==============
*/
qboolean OnSameTeam( gentity_t *ent1, gentity_t *ent2 )
{
if( !ent1->client || !ent2->client )
return qfalse;
if( ent1->client->pers.teamSelection == ent2->client->pers.teamSelection )
return qtrue;
return qfalse;
}
/*
===========
Team_GetLocation
Report a location for the player. Uses placed nearby target_location entities
============
*/
gentity_t *Team_GetLocation( gentity_t *ent )
{
gentity_t *eloc, *best;
float bestlen, len;
vec3_t origin;
best = NULL;
bestlen = 3.0f * 8192.0f * 8192.0f;
VectorCopy( ent->r.currentOrigin, origin );
for( eloc = level.locationHead; eloc; eloc = eloc->nextTrain )
{
len = ( origin[ 0 ] - eloc->r.currentOrigin[ 0 ] ) * ( origin[ 0 ] - eloc->r.currentOrigin[ 0 ] )
+ ( origin[ 1 ] - eloc->r.currentOrigin[ 1 ] ) * ( origin[ 1 ] - eloc->r.currentOrigin[ 1 ] )
+ ( origin[ 2 ] - eloc->r.currentOrigin[ 2 ] ) * ( origin[ 2 ] - eloc->r.currentOrigin[ 2 ] );
if( len > bestlen )
continue;
if( !trap_InPVS( origin, eloc->r.currentOrigin ) )
continue;
bestlen = len;
best = eloc;
}
return best;
}
/*
===========
Team_GetLocationMsg
Report a location message for the player. Uses placed nearby target_location entities
============
*/
qboolean Team_GetLocationMsg( gentity_t *ent, char *loc, int loclen )
{
gentity_t *best;
best = Team_GetLocation( ent );
if( !best )
return qfalse;
if( best->count )
{
if( best->count < 0 )
best->count = 0;
if( best->count > 7 )
best->count = 7;
Com_sprintf( loc, loclen, "%c%c%s" S_COLOR_WHITE, Q_COLOR_ESCAPE, best->count + '0', best->message );
}
else
Com_sprintf( loc, loclen, "%s", best->message );
return qtrue;
}
/*---------------------------------------------------------------------------*/
static int QDECL SortClients( const void *a, const void *b )
{
return *(int *)a - *(int *)b;
}
/*
==================
TeamplayLocationsMessage
Format:
clientNum location health armor weapon powerups
==================
*/
void TeamplayInfoMessage( gentity_t *ent )
{
char entry[ 1024 ];
char string[ 8192 ];
int stringlength;
int i, j;
gentity_t *player;
int cnt;
int h, a = 0;
int clients[ TEAM_MAXOVERLAY ];
if( ! ent->client->pers.teamInfo )
return;
// figure out what client should be on the display
// we are limited to 8, but we want to use the top eight players
// but in client order (so they don't keep changing position on the overlay)
for( i = 0, cnt = 0; i < g_maxclients.integer && cnt < TEAM_MAXOVERLAY; i++ )
{
player = g_entities + level.sortedClients[ i ];
if( player->inuse && player->client->sess.sessionTeam ==
ent->client->sess.sessionTeam )
clients[ cnt++ ] = level.sortedClients[ i ];
}
// We have the top eight players, sort them by clientNum
qsort( clients, cnt, sizeof( clients[ 0 ] ), SortClients );
// send the latest information on all clients
string[ 0 ] = 0;
stringlength = 0;
for( i = 0, cnt = 0; i < g_maxclients.integer && cnt < TEAM_MAXOVERLAY; i++)
{
player = g_entities + i;
if( player->inuse && player->client->sess.sessionTeam ==
ent->client->sess.sessionTeam )
{
h = player->client->ps.stats[ STAT_HEALTH ];
if( h < 0 )
h = 0;
Com_sprintf( entry, sizeof( entry ),
" %i %i %i %i %i %i",
// level.sortedClients[i], player->client->pers.teamState.location, h, a,
i, player->client->pers.teamState.location, h, a,
player->client->ps.weapon, player->s.powerups );
j = strlen( entry );
if( stringlength + j > sizeof( string ) )
break;
strcpy( string + stringlength, entry );
stringlength += j;
cnt++;
}
}
trap_SendServerCommand( ent - g_entities, va( "tinfo %i %s", cnt, string ) );
}
void CheckTeamStatus( void )
{
int i;
gentity_t *loc, *ent;
if( level.time - level.lastTeamLocationTime > TEAM_LOCATION_UPDATE_TIME )
{
level.lastTeamLocationTime = level.time;
for( i = 0; i < g_maxclients.integer; i++ )
{
ent = g_entities + i;
if( ent->client->pers.connected != CON_CONNECTED )
continue;
if( ent->inuse && ( ent->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ||
ent->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) )
{
loc = Team_GetLocation( ent );
if( loc )
ent->client->pers.teamState.location = loc->health;
else
ent->client->pers.teamState.location = 0;
}
}
for( i = 0; i < g_maxclients.integer; i++ )
{
ent = g_entities + i;
if( ent->client->pers.connected != CON_CONNECTED )
continue;
if( ent->inuse && ( ent->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ||
ent->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) )
TeamplayInfoMessage( ent );
}
}
//Warn on unbalanced teams
if ( g_teamImbalanceWarnings.integer && !level.intermissiontime && level.time - level.lastTeamUnbalancedTime > ( g_teamImbalanceWarnings.integer * 1000 ) && level.numTeamWarnings<3 )
{
level.lastTeamUnbalancedTime = level.time;
if (level.numAlienSpawns > 0 && level.numHumanClients - level.numAlienClients > 2)
{
trap_SendServerCommand (-1, "print \"Teams are unbalanced. Humans have more players.\n Humans will keep their points when switching teams.\n\"");
level.numTeamWarnings++;
}
else if (level.numHumanSpawns > 0 && level.numAlienClients - level.numHumanClients > 2)
{
trap_SendServerCommand (-1, "print \"Teams are unbalanced. Aliens have more players.\n Aliens will keep their points when switching teams.\n\"");
level.numTeamWarnings++;
}
else
{
level.numTeamWarnings = 0;
}
}
}
-1141
View File
File diff suppressed because it is too large. Load diff
-848
View File
@@ -1,848 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// g_utils.c -- misc utility functions for game module
#include "g_local.h"
typedef struct
{
char oldShader[ MAX_QPATH ];
char newShader[ MAX_QPATH ];
float timeOffset;
} shaderRemap_t;
#define MAX_SHADER_REMAPS 128
int remapCount = 0;
shaderRemap_t remappedShaders[ MAX_SHADER_REMAPS ];
void AddRemap( const char *oldShader, const char *newShader, float timeOffset )
{
int i;
for( i = 0; i < remapCount; i++ )
{
if( Q_stricmp( oldShader, remappedShaders[ i ].oldShader ) == 0 )
{
// found it, just update this one
strcpy( remappedShaders[ i ].newShader,newShader );
remappedShaders[ i ].timeOffset = timeOffset;
return;
}
}
if( remapCount < MAX_SHADER_REMAPS )
{
strcpy( remappedShaders[ remapCount ].newShader,newShader );
strcpy( remappedShaders[ remapCount ].oldShader,oldShader );
remappedShaders[ remapCount ].timeOffset = timeOffset;
remapCount++;
}
}
const char *BuildShaderStateConfig( void )
{
static char buff[ MAX_STRING_CHARS * 4 ];
char out[ ( MAX_QPATH * 2 ) + 5 ];
int i;
memset( buff, 0, MAX_STRING_CHARS );
for( i = 0; i < remapCount; i++ )
{
Com_sprintf( out, ( MAX_QPATH * 2 ) + 5, "%s=%s:%5.2f@", remappedShaders[ i ].oldShader,
remappedShaders[ i ].newShader, remappedShaders[ i ].timeOffset );
Q_strcat( buff, sizeof( buff ), out );
}
return buff;
}
/*
=========================================================================
model / sound configstring indexes
=========================================================================
*/
/*
================
G_FindConfigstringIndex
================
*/
int G_FindConfigstringIndex( char *name, int start, int max, qboolean create )
{
int i;
char s[ MAX_STRING_CHARS ];
if( !name || !name[ 0 ] )
return 0;
for( i = 1; i < max; i++ )
{
trap_GetConfigstring( start + i, s, sizeof( s ) );
if( !s[ 0 ] )
break;
if( !strcmp( s, name ) )
return i;
}
if( !create )
return 0;
if( i == max )
G_Error( "G_FindConfigstringIndex: overflow" );
trap_SetConfigstring( start + i, name );
return i;
}
//TA: added ParticleSystemIndex
int G_ParticleSystemIndex( char *name )
{
return G_FindConfigstringIndex( name, CS_PARTICLE_SYSTEMS, MAX_GAME_PARTICLE_SYSTEMS, qtrue );
}
//TA: added ShaderIndex
int G_ShaderIndex( char *name )
{
return G_FindConfigstringIndex( name, CS_SHADERS, MAX_GAME_SHADERS, qtrue );
}
int G_ModelIndex( char *name )
{
return G_FindConfigstringIndex( name, CS_MODELS, MAX_MODELS, qtrue );
}
int G_SoundIndex( char *name )
{
return G_FindConfigstringIndex( name, CS_SOUNDS, MAX_SOUNDS, qtrue );
}
//=====================================================================
/*
================
G_TeamCommand
Broadcasts a command to only a specific team
================
*/
void G_TeamCommand( pTeam_t team, char *cmd )
{
int i;
for( i = 0 ; i < level.maxclients ; i++ )
{
if( level.clients[ i ].pers.connected == CON_CONNECTED )
{
if( level.clients[ i ].pers.teamSelection == team ||
( level.clients[ i ].pers.teamSelection == PTE_NONE &&
G_admin_permission( &g_entities[ i ], ADMF_SPEC_ALLCHAT ) ) )
trap_SendServerCommand( i, cmd );
}
}
}
/*
=============
G_Find
Searches all active entities for the next one that holds
the matching string at fieldofs (use the FOFS() macro) in the structure.
Searches beginning at the entity after from, or the beginning if NULL
NULL will be returned if the end of the list is reached.
=============
*/
gentity_t *G_Find( gentity_t *from, int fieldofs, const char *match )
{
char *s;
if( !from )
from = g_entities;
else
from++;
for( ; from < &g_entities[ level.num_entities ]; from++ )
{
if( !from->inuse )
continue;
s = *(char **)( (byte *)from + fieldofs );
if( !s )
continue;
if( !Q_stricmp( s, match ) )
return from;
}
return NULL;
}
/*
=============
G_PickTarget
Selects a random entity from among the targets
=============
*/
#define MAXCHOICES 32
gentity_t *G_PickTarget( char *targetname )
{
gentity_t *ent = NULL;
int num_choices = 0;
gentity_t *choice[ MAXCHOICES ];
if( !targetname )
{
G_Printf("G_PickTarget called with NULL targetname\n");
return NULL;
}
while( 1 )
{
ent = G_Find( ent, FOFS( targetname ), targetname );
if( !ent )
break;
choice[ num_choices++ ] = ent;
if( num_choices == MAXCHOICES )
break;
}
if( !num_choices )
{
G_Printf( "G_PickTarget: target %s not found\n", targetname );
return NULL;
}
return choice[ rand( ) % num_choices ];
}
/*
==============================
G_UseTargets
"activator" should be set to the entity that initiated the firing.
Search for (string)targetname in all entities that
match (string)self.target and call their .use function
==============================
*/
void G_UseTargets( gentity_t *ent, gentity_t *activator )
{
gentity_t *t;
if( !ent )
return;
if( ent->targetShaderName && ent->targetShaderNewName )
{
float f = level.time * 0.001;
AddRemap( ent->targetShaderName, ent->targetShaderNewName, f );
trap_SetConfigstring( CS_SHADERSTATE, BuildShaderStateConfig( ) );
}
if( !ent->target )
return;
t = NULL;
while( ( t = G_Find( t, FOFS( targetname ), ent->target ) ) != NULL )
{
if( t == ent )
G_Printf( "WARNING: Entity used itself.\n" );
else
{
if( t->use )
t->use( t, ent, activator );
}
if( !ent->inuse )
{
G_Printf( "entity was removed while using targets\n" );
return;
}
}
}
/*
=============
TempVector
This is just a convenience function
for making temporary vectors for function calls
=============
*/
float *tv( float x, float y, float z )
{
static int index;
static vec3_t vecs[ 8 ];
float *v;
// use an array so that multiple tempvectors won't collide
// for a while
v = vecs[ index ];
index = ( index + 1 ) & 7;
v[ 0 ] = x;
v[ 1 ] = y;
v[ 2 ] = z;
return v;
}
/*
=============
VectorToString
This is just a convenience function
for printing vectors
=============
*/
char *vtos( const vec3_t v )
{
static int index;
static char str[ 8 ][ 32 ];
char *s;
// use an array so that multiple vtos won't collide
s = str[ index ];
index = ( index + 1 ) & 7;
Com_sprintf( s, 32, "(%i %i %i)", (int)v[ 0 ], (int)v[ 1 ], (int)v[ 2 ] );
return s;
}
/*
===============
G_SetMovedir
The editor only specifies a single value for angles (yaw),
but we have special constants to generate an up or down direction.
Angles will be cleared, because it is being used to represent a direction
instead of an orientation.
===============
*/
void G_SetMovedir( vec3_t angles, vec3_t movedir )
{
static vec3_t VEC_UP = { 0, -1, 0 };
static vec3_t MOVEDIR_UP = { 0, 0, 1 };
static vec3_t VEC_DOWN = { 0, -2, 0 };
static vec3_t MOVEDIR_DOWN = { 0, 0, -1 };
if( VectorCompare( angles, VEC_UP ) )
VectorCopy( MOVEDIR_UP, movedir );
else if( VectorCompare( angles, VEC_DOWN ) )
VectorCopy( MOVEDIR_DOWN, movedir );
else
AngleVectors( angles, movedir, NULL, NULL );
VectorClear( angles );
}
float vectoyaw( const vec3_t vec )
{
float yaw;
if( vec[ YAW ] == 0 && vec[ PITCH ] == 0 )
{
yaw = 0;
}
else
{
if( vec[ PITCH ] )
yaw = ( atan2( vec[ YAW ], vec[ PITCH ] ) * 180 / M_PI );
else if( vec[ YAW ] > 0 )
yaw = 90;
else
yaw = 270;
if( yaw < 0 )
yaw += 360;
}
return yaw;
}
void G_InitGentity( gentity_t *e )
{
e->inuse = qtrue;
e->classname = "noclass";
e->s.number = e - g_entities;
e->r.ownerNum = ENTITYNUM_NONE;
}
/*
=================
G_Spawn
Either finds a free entity, or allocates a new one.
The slots from 0 to MAX_CLIENTS-1 are always reserved for clients, and will
never be used by anything else.
Try to avoid reusing an entity that was recently freed, because it
can cause the client to think the entity morphed into something else
instead of being removed and recreated, which can cause interpolated
angles and bad trails.
=================
*/
gentity_t *G_Spawn( void )
{
int i, force;
gentity_t *e;
e = NULL; // shut up warning
i = 0; // shut up warning
for( force = 0; force < 2; force++ )
{
// if we go through all entities and can't find one to free,
// override the normal minimum times before use
e = &g_entities[ MAX_CLIENTS ];
for( i = MAX_CLIENTS; i < level.num_entities; i++, e++ )
{
if( e->inuse )
continue;
// the first couple seconds of server time can involve a lot of
// freeing and allocating, so relax the replacement policy
if( !force && e->freetime > level.startTime + 2000 && level.time - e->freetime < 1000 )
continue;
// reuse this slot
G_InitGentity( e );
return e;
}
if( i != MAX_GENTITIES )
break;
}
if( i == ENTITYNUM_MAX_NORMAL )
{
for( i = 0; i < MAX_GENTITIES; i++ )
G_Printf( "%4i: %s\n", i, g_entities[ i ].classname );
G_Error( "G_Spawn: no free entities" );
}
// open up a new slot
level.num_entities++;
// let the server system know that there are more entities
trap_LocateGameData( level.gentities, level.num_entities, sizeof( gentity_t ),
&level.clients[ 0 ].ps, sizeof( level.clients[ 0 ] ) );
G_InitGentity( e );
return e;
}
/*
=================
G_EntitiesFree
=================
*/
qboolean G_EntitiesFree( void )
{
int i;
gentity_t *e;
e = &g_entities[ MAX_CLIENTS ];
for( i = MAX_CLIENTS; i < level.num_entities; i++, e++ )
{
if( e->inuse )
continue;
// slot available
return qtrue;
}
return qfalse;
}
/*
=================
G_FreeEntity
Marks the entity as free
=================
*/
void G_FreeEntity( gentity_t *ent )
{
trap_UnlinkEntity( ent ); // unlink from world
if( ent->neverFree )
return;
memset( ent, 0, sizeof( *ent ) );
ent->classname = "freent";
ent->freetime = level.time;
ent->inuse = qfalse;
}
/*
=================
G_TempEntity
Spawns an event entity that will be auto-removed
The origin will be snapped to save net bandwidth, so care
must be taken if the origin is right on a surface (snap towards start vector first)
=================
*/
gentity_t *G_TempEntity( vec3_t origin, int event )
{
gentity_t *e;
vec3_t snapped;
e = G_Spawn( );
e->s.eType = ET_EVENTS + event;
e->classname = "tempEntity";
e->eventTime = level.time;
e->freeAfterEvent = qtrue;
VectorCopy( origin, snapped );
SnapVector( snapped ); // save network bandwidth
G_SetOrigin( e, snapped );
// find cluster for PVS
trap_LinkEntity( e );
return e;
}
/*
==============================================================================
Kill box
==============================================================================
*/
/*
=================
G_KillBox
Kills all entities that would touch the proposed new positioning
of ent. Ent should be unlinked before calling this!
=================
*/
void G_KillBox( gentity_t *ent )
{
int i, num;
int touch[ MAX_GENTITIES ];
gentity_t *hit;
vec3_t mins, maxs;
VectorAdd( ent->client->ps.origin, ent->r.mins, mins );
VectorAdd( ent->client->ps.origin, ent->r.maxs, maxs );
num = trap_EntitiesInBox( mins, maxs, touch, MAX_GENTITIES );
for( i = 0; i < num; i++ )
{
hit = &g_entities[ touch[ i ] ];
if( !hit->client )
continue;
//TA: impossible to telefrag self
if( ent == hit )
continue;
// nail it
G_Damage( hit, ent, ent, NULL, NULL,
100000, DAMAGE_NO_PROTECTION, MOD_TELEFRAG );
}
}
//==============================================================================
/*
===============
G_AddPredictableEvent
Use for non-pmove events that would also be predicted on the
client side: jumppads and item pickups
Adds an event+parm and twiddles the event counter
===============
*/
void G_AddPredictableEvent( gentity_t *ent, int event, int eventParm )
{
if( !ent->client )
return;
BG_AddPredictableEventToPlayerstate( event, eventParm, &ent->client->ps );
}
/*
===============
G_AddEvent
Adds an event+parm and twiddles the event counter
===============
*/
void G_AddEvent( gentity_t *ent, int event, int eventParm )
{
int bits;
if( !event )
{
G_Printf( "G_AddEvent: zero event added for entity %i\n", ent->s.number );
return;
}
// eventParm is converted to uint8_t (0 - 255) in msg.c
if( eventParm & ~0xFF )
{
G_Printf( S_COLOR_YELLOW "WARNING: G_AddEvent: event %d "
" eventParm uint8_t overflow (given %d)\n", event, eventParm );
}
// clients need to add the event in playerState_t instead of entityState_t
if( ent->client )
{
bits = ent->client->ps.externalEvent & EV_EVENT_BITS;
bits = ( bits + EV_EVENT_BIT1 ) & EV_EVENT_BITS;
ent->client->ps.externalEvent = event | bits;
ent->client->ps.externalEventParm = eventParm;
ent->client->ps.externalEventTime = level.time;
}
else
{
bits = ent->s.event & EV_EVENT_BITS;
bits = ( bits + EV_EVENT_BIT1 ) & EV_EVENT_BITS;
ent->s.event = event | bits;
ent->s.eventParm = eventParm;
}
ent->eventTime = level.time;
}
/*
===============
G_BroadcastEvent
Sends an event to every client
===============
*/
void G_BroadcastEvent( int event, int eventParm )
{
gentity_t *ent;
ent = G_TempEntity( vec3_origin, event );
ent->s.eventParm = eventParm;
ent->r.svFlags = SVF_BROADCAST; // send to everyone
}
/*
=============
G_Sound
=============
*/
void G_Sound( gentity_t *ent, int channel, int soundIndex )
{
gentity_t *te;
te = G_TempEntity( ent->r.currentOrigin, EV_GENERAL_SOUND );
te->s.eventParm = soundIndex;
}
/*
=============
G_ClientIsLagging
=============
*/
qboolean G_ClientIsLagging( gclient_t *client )
{
if( client )
{
if( client->ps.ping >= 999 )
return qtrue;
else
return qfalse;
}
return qfalse; //is a non-existant client lagging? woooo zen
}
//==============================================================================
/*
================
G_SetOrigin
Sets the pos trajectory for a fixed position
================
*/
void G_SetOrigin( gentity_t *ent, vec3_t origin )
{
VectorCopy( origin, ent->s.pos.trBase );
ent->s.pos.trType = TR_STATIONARY;
ent->s.pos.trTime = 0;
ent->s.pos.trDuration = 0;
VectorClear( ent->s.pos.trDelta );
VectorCopy( origin, ent->r.currentOrigin );
VectorCopy( origin, ent->s.origin ); //TA: if shit breaks - blame this line
}
//TA: from quakestyle.telefragged.com
// (NOBODY): Code helper function
//
gentity_t *G_FindRadius( gentity_t *from, vec3_t org, float rad )
{
vec3_t eorg;
int j;
if( !from )
from = g_entities;
else
from++;
for( ; from < &g_entities[ level.num_entities ]; from++ )
{
if( !from->inuse )
continue;
for( j = 0; j < 3; j++ )
eorg[ j ] = org[ j ] - ( from->r.currentOrigin[ j ] + ( from->r.mins[ j ] + from->r.maxs[ j ] ) * 0.5 );
if( VectorLength( eorg ) > rad )
continue;
return from;
}
return NULL;
}
/*
===============
G_Visible
Test for a LOS between two entities
===============
*/
qboolean G_Visible( gentity_t *ent1, gentity_t *ent2 )
{
trace_t trace;
trap_Trace( &trace, ent1->s.pos.trBase, NULL, NULL, ent2->s.pos.trBase, ent1->s.number, MASK_SHOT );
if( trace.contents & CONTENTS_SOLID )
return qfalse;
return qtrue;
}
/*
===============
G_ClosestEnt
Test a list of entities for the closest to a particular point
===============
*/
gentity_t *G_ClosestEnt( vec3_t origin, gentity_t **entities, int numEntities )
{
int i;
float nd, d = 1000000.0f;
gentity_t *closestEnt = NULL;
for( i = 0; i < numEntities; i++ )
{
gentity_t *ent = entities[ i ];
if( ( nd = Distance( origin, ent->s.origin ) ) < d || !closestEnt )
{
d = nd;
closestEnt = ent;
}
}
return closestEnt;
}
/*
===============
G_TriggerMenu
Trigger a menu on some client
===============
*/
void G_TriggerMenu( int clientNum, dynMenu_t menu )
{
char buffer[ 32 ];
Com_sprintf( buffer, 32, "servermenu %d", menu );
trap_SendServerCommand( clientNum, buffer );
}
/*
===============
G_CloseMenus
Close all open menus on some client
===============
*/
void G_CloseMenus( int clientNum )
{
char buffer[ 32 ];
Com_sprintf( buffer, 32, "serverclosemenus" );
trap_SendServerCommand( clientNum, buffer );
}
-1627
View File
File diff suppressed because it is too large. Load diff
-633
View File
@@ -1,633 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
/*
* ALIEN weapons
*
* _REPEAT - time in msec until the weapon can be used again
* _DMG - amount of damage the weapon does
*
* ALIEN_WDMG_MODIFIER - overall damage modifier for coarse tuning
*
*/
#define ALIEN_WDMG_MODIFIER 1.0f
#define ADM(d) ((int)((float)d*ALIEN_WDMG_MODIFIER))
#define ABUILDER_BUILD_REPEAT 500
#define ABUILDER_CLAW_DMG ADM(20)
#define ABUILDER_CLAW_RANGE 64.0f
#define ABUILDER_CLAW_WIDTH 4.0f
#define ABUILDER_CLAW_REPEAT 1000
#define ABUILDER_CLAW_K_SCALE 1.0f
#define ABUILDER_BASE_DELAY 17000
#define ABUILDER_ADV_DELAY 12000
#define ABUILDER_BLOB_DMG ADM(4)
#define ABUILDER_BLOB_REPEAT 1000
#define ABUILDER_BLOB_SPEED 800.0f
#define ABUILDER_BLOB_SPEED_MOD 0.5f
#define ABUILDER_BLOB_TIME 5000
#define LEVEL0_BITE_DMG ADM(48)
#define LEVEL0_BITE_RANGE 64.0f
#define LEVEL0_BITE_WIDTH 6.0f
#define LEVEL0_BITE_REPEAT 500
#define LEVEL0_BITE_K_SCALE 1.0f
#define LEVEL1_CLAW_DMG ADM(32)
#define LEVEL1_CLAW_RANGE 96.0f
#define LEVEL1_CLAW_WIDTH 10.0f
#define LEVEL1_CLAW_REPEAT 600
#define LEVEL1_CLAW_U_REPEAT 500
#define LEVEL1_CLAW_K_SCALE 1.0f
#define LEVEL1_CLAW_U_K_SCALE 1.0f
#define LEVEL1_GRAB_RANGE 64.0f
#define LEVEL1_GRAB_TIME 300
#define LEVEL1_GRAB_U_TIME 450
#define LEVEL1_PCLOUD_DMG ADM(4)
#define LEVEL1_PCLOUD_RANGE 200.0f
#define LEVEL1_PCLOUD_REPEAT 2000
#define LEVEL1_PCLOUD_TIME 10000
#define LEVEL2_CLAW_DMG ADM(40)
#define LEVEL2_CLAW_RANGE 96.0f
#define LEVEL2_CLAW_WIDTH 12.0f
#define LEVEL2_CLAW_REPEAT 500
#define LEVEL2_CLAW_K_SCALE 1.0f
#define LEVEL2_CLAW_U_REPEAT 400
#define LEVEL2_CLAW_U_K_SCALE 1.0f
#define LEVEL2_AREAZAP_DMG ADM(80)
#define LEVEL2_AREAZAP_RANGE 200.0f
#define LEVEL2_AREAZAP_WIDTH 15.0f
#define LEVEL2_AREAZAP_REPEAT 1500
#define LEVEL2_AREAZAP_TIME 1000
#define LEVEL2_AREAZAP_MAX_TARGETS 3
#define LEVEL2_WALLJUMP_MAXSPEED 1000.0f
#define LEVEL3_CLAW_DMG ADM(80)
#define LEVEL3_CLAW_RANGE 96.0f
#define LEVEL3_CLAW_WIDTH 16.0f
#define LEVEL3_CLAW_REPEAT 700
#define LEVEL3_CLAW_K_SCALE 1.0f
#define LEVEL3_CLAW_U_REPEAT 600
#define LEVEL3_CLAW_U_K_SCALE 1.0f
#define LEVEL3_POUNCE_DMG ADM(100)
#define LEVEL3_POUNCE_RANGE 72.0f
#define LEVEL3_POUNCE_WIDTH 16.0f
#define LEVEL3_POUNCE_SPEED 700
#define LEVEL3_POUNCE_UPG_SPEED 800
#define LEVEL3_POUNCE_SPEED_MOD 0.75f
#define LEVEL3_POUNCE_CHARGE_TIME 700
#define LEVEL3_POUNCE_TIME 400
#define LEVEL3_BOUNCEBALL_DMG ADM(110)
#define LEVEL3_BOUNCEBALL_REPEAT 1000
#define LEVEL3_BOUNCEBALL_SPEED 1000.0f
#define LEVEL4_CLAW_DMG ADM(100)
#define LEVEL4_CLAW_RANGE 128.0f
#define LEVEL4_CLAW_WIDTH 20.0f
#define LEVEL4_CLAW_REPEAT 750
#define LEVEL4_CLAW_K_SCALE 1.0f
#define LEVEL4_REGEN_RANGE 200.0f
#define LEVEL4_REGEN_MOD 2.0f
#define LEVEL4_CHARGE_SPEED 2.0f
#define LEVEL4_CHARGE_TIME 3000
#define LEVEL4_CHARGE_CHARGE_TIME 1500
#define LEVEL4_MIN_CHARGE_TIME 750
#define LEVEL4_CHARGE_CHARGE_RATIO (LEVEL4_CHARGE_TIME/LEVEL4_CHARGE_CHARGE_TIME)
#define LEVEL4_CHARGE_REPEAT 1000
#define LEVEL4_CHARGE_DMG ADM(110)
/*
* ALIEN classes
*
* _SPEED - fraction of Q3A run speed the class can move
* _REGEN - health per second regained
*
* ALIEN_HLTH_MODIFIER - overall health modifier for coarse tuning
*
*/
#define ALIEN_HLTH_MODIFIER 1.0f
#define AHM(h) ((int)((float)h*ALIEN_HLTH_MODIFIER))
#define ALIEN_VALUE_MODIFIER 1.0f
#define AVM(h) ((int)((float)h*ALIEN_VALUE_MODIFIER))
#define ABUILDER_SPEED 0.8f
#define ABUILDER_VALUE AVM(200)
#define ABUILDER_HEALTH AHM(50)
#define ABUILDER_REGEN 2
#define ABUILDER_COST 0
#define ABUILDER_UPG_SPEED 1.0f
#define ABUILDER_UPG_VALUE AVM(250)
#define ABUILDER_UPG_HEALTH AHM(75)
#define ABUILDER_UPG_REGEN 3
#define ABUILDER_UPG_COST 0
#define LEVEL0_SPEED 1.3f
#define LEVEL0_VALUE AVM(175)
#define LEVEL0_HEALTH AHM(25)
#define LEVEL0_REGEN 1
#define LEVEL0_COST 0
#define LEVEL1_SPEED 1.25f
#define LEVEL1_VALUE AVM(225)
#define LEVEL1_HEALTH AHM(75)
#define LEVEL1_REGEN 2
#define LEVEL1_COST 1
#define LEVEL1_UPG_SPEED 1.25f
#define LEVEL1_UPG_VALUE AVM(275)
#define LEVEL1_UPG_HEALTH AHM(100)
#define LEVEL1_UPG_REGEN 3
#define LEVEL1_UPG_COST 1
#define LEVEL2_SPEED 1.2f
#define LEVEL2_VALUE AVM(350)
#define LEVEL2_HEALTH AHM(150)
#define LEVEL2_REGEN 4
#define LEVEL2_COST 1
#define LEVEL2_UPG_SPEED 1.2f
#define LEVEL2_UPG_VALUE AVM(450)
#define LEVEL2_UPG_HEALTH AHM(175)
#define LEVEL2_UPG_REGEN 5
#define LEVEL2_UPG_COST 1
#define LEVEL3_SPEED 1.1f
#define LEVEL3_VALUE AVM(500)
#define LEVEL3_HEALTH AHM(200)
#define LEVEL3_REGEN 6
#define LEVEL3_COST 1
#define LEVEL3_UPG_SPEED 1.1f
#define LEVEL3_UPG_VALUE AVM(600)
#define LEVEL3_UPG_HEALTH AHM(250)
#define LEVEL3_UPG_REGEN 7
#define LEVEL3_UPG_COST 1
#define LEVEL4_SPEED 1.2f
#define LEVEL4_VALUE AVM(800)
#define LEVEL4_HEALTH AHM(400)
#define LEVEL4_REGEN 7
#define LEVEL4_COST 2
/*
* ALIEN buildables
*
* _BP - build points required for this buildable
* _BT - build time required for this buildable
* _REGEN - the amount of health per second regained
* _SPLASHDAMGE - the amount of damage caused by this buildable when melting
* _SPLASHRADIUS - the radius around which it does this damage
*
* CREEP_BASESIZE - the maximum distance a buildable can be from an egg/overmind
* ALIEN_BHLTH_MODIFIER - overall health modifier for coarse tuning
*
*/
#define ALIEN_BHLTH_MODIFIER 1.0f
#define ABHM(h) ((int)((float)h*ALIEN_BHLTH_MODIFIER))
#define CREEP_BASESIZE 700
#define CREEP_TIMEOUT 1000
#define CREEP_MODIFIER 0.5f
#define CREEP_ARMOUR_MODIFIER 0.75f
#define CREEP_SCALEDOWN_TIME 3000
#define ASPAWN_BP 10
#define ASPAWN_BT 15000
#define ASPAWN_HEALTH ABHM(250)
#define ASPAWN_REGEN 8
#define ASPAWN_SPLASHDAMAGE 50
#define ASPAWN_SPLASHRADIUS 50
#define ASPAWN_CREEPSIZE 120
#define ASPAWN_VALUE 150
#define BARRICADE_BP 10
#define BARRICADE_BT 20000
#define BARRICADE_HEALTH ABHM(200)
#define BARRICADE_REGEN 14
#define BARRICADE_SPLASHDAMAGE 50
#define BARRICADE_SPLASHRADIUS 50
#define BARRICADE_CREEPSIZE 120
#define BOOSTER_BP 12
#define BOOSTER_BT 15000
#define BOOSTER_HEALTH ABHM(150)
#define BOOSTER_REGEN 8
#define BOOSTER_SPLASHDAMAGE 50
#define BOOSTER_SPLASHRADIUS 50
#define BOOSTER_CREEPSIZE 120
#define BOOSTER_INTERVAL 30000 //time in msec between uses (per player)
#define BOOSTER_REGEN_MOD 2.0f
#define BOOST_TIME 30000
#define ACIDTUBE_BP 8
#define ACIDTUBE_BT 15000
#define ACIDTUBE_HEALTH ABHM(125)
#define ACIDTUBE_REGEN 10
#define ACIDTUBE_SPLASHDAMAGE 6
#define ACIDTUBE_SPLASHRADIUS 300
#define ACIDTUBE_CREEPSIZE 120
#define ACIDTUBE_RANGE 300.0f
#define ACIDTUBE_REPEAT 3000
#define ACIDTUBE_K_SCALE 1.0f
#define HIVE_BP 12
#define HIVE_BT 20000
#define HIVE_HEALTH ABHM(125)
#define HIVE_REGEN 10
#define HIVE_SPLASHDAMAGE 30
#define HIVE_SPLASHRADIUS 200
#define HIVE_CREEPSIZE 120
#define HIVE_RANGE 400.0f
#define HIVE_REPEAT 5000
#define HIVE_K_SCALE 1.0f
#define HIVE_DMG 50
#define HIVE_SPEED 240.0f
#define HIVE_DIR_CHANGE_PERIOD 500
#define TRAPPER_BP 8
#define TRAPPER_BT 12000
#define TRAPPER_HEALTH ABHM(50)
#define TRAPPER_REGEN 6
#define TRAPPER_SPLASHDAMAGE 15
#define TRAPPER_SPLASHRADIUS 100
#define TRAPPER_CREEPSIZE 30
#define TRAPPER_RANGE 400
#define TRAPPER_REPEAT 1000
#define TRAPPER_K_SCALE 1.0f
#define LOCKBLOB_SPEED 650.0f
#define LOCKBLOB_LOCKTIME 5000
#define LOCKBLOB_DOT 0.85f // max angle = acos( LOCKBLOB_DOT )
#define LOCKBLOB_K_SCALE 1.0f
#define OVERMIND_BP 0
#define OVERMIND_BT 30000
#define OVERMIND_HEALTH ABHM(750)
#define OVERMIND_REGEN 6
#define OVERMIND_SPLASHDAMAGE 15
#define OVERMIND_SPLASHRADIUS 300
#define OVERMIND_CREEPSIZE 120
#define OVERMIND_ATTACK_RANGE 150.0f
#define OVERMIND_ATTACK_REPEAT 1000
#define OVERMIND_VALUE 300
#define HOVEL_BP 0
#define HOVEL_BT 15000
#define HOVEL_HEALTH ABHM(375)
#define HOVEL_REGEN 20
#define HOVEL_SPLASHDAMAGE 20
#define HOVEL_SPLASHRADIUS 200
#define HOVEL_CREEPSIZE 120
/*
* ALIEN misc
*
* ALIENSENSE_RANGE - the distance alien sense is useful for
*
*/
#define ALIENSENSE_RANGE 1000.0f
#define ALIEN_POISON_TIME 5000
#define ALIEN_POISON_DMG 5
#define ALIEN_POISON_DIVIDER (1.0f/1.32f) //about 1.0/(time`th root of damage)
#define ALIEN_SPAWN_REPEAT_TIME 10000
#define ALIEN_REGEN_DAMAGE_TIME 2000 //msec since damage that regen starts again
/*
* HUMAN weapons
*
* _REPEAT - time between firings
* _RELOAD - time needed to reload
* _PRICE - amount in credits weapon costs
*
* HUMAN_WDMG_MODIFIER - overall damage modifier for coarse tuning
*
*/
#define HUMAN_WDMG_MODIFIER 1.0f
#define HDM(d) ((int)((float)d*HUMAN_WDMG_MODIFIER))
#define BLASTER_REPEAT 600
#define BLASTER_K_SCALE 1.0f
#define BLASTER_SPREAD 200
#define BLASTER_SPEED 1400
#define BLASTER_DMG HDM(9)
#define RIFLE_CLIPSIZE 30
#define RIFLE_MAXCLIPS 6
#define RIFLE_REPEAT 90
#define RIFLE_K_SCALE 1.0f
#define RIFLE_RELOAD 2000
#define RIFLE_PRICE 0
#define RIFLE_SPREAD 200
#define RIFLE_DMG HDM(5)
#define PAINSAW_PRICE 100
#define PAINSAW_REPEAT 75
#define PAINSAW_K_SCALE 1.0f
#define PAINSAW_DAMAGE HDM(15)
#define PAINSAW_RANGE 40.0f
#define GRENADE_PRICE 200
#define GRENADE_REPEAT 0
#define GRENADE_K_SCALE 1.0f
#define GRENADE_DAMAGE HDM(310)
#define GRENADE_RANGE 192.0f
#define GRENADE_SPEED 400.0f
// Proximity Mine settings
#define PROXIMITY_INIT_TIME 3000
#define PROXIMITY_RANGE 100
#define PROXIMITY_CHECK_FREQUENCY 100
#define PROXIMITY_BOOM_TIME 20
//Unused now because i(google) added a cvar to control this
//#define PROXIMITY_PRICE 800
#define SHOTGUN_PRICE 150
#define SHOTGUN_SHELLS 8
#define SHOTGUN_PELLETS 8 //used to sync server and client side
#define SHOTGUN_MAXCLIPS 3
#define SHOTGUN_REPEAT 1000
#define SHOTGUN_K_SCALE 1.0f
#define SHOTGUN_RELOAD 2000
#define SHOTGUN_SPREAD 900
#define SHOTGUN_DMG HDM(7)
#define LASGUN_PRICE 250
#define LASGUN_AMMO 200
#define LASGUN_REPEAT 200
#define LASGUN_K_SCALE 1.0f
#define LASGUN_RELOAD 2000
#define LASGUN_DAMAGE HDM(9)
#define MDRIVER_PRICE 350
#define MDRIVER_CLIPSIZE 5
#define MDRIVER_MAXCLIPS 4
#define MDRIVER_DMG HDM(38)
#define MDRIVER_REPEAT 1000
#define MDRIVER_K_SCALE 1.0f
#define MDRIVER_RELOAD 2000
#define CHAINGUN_PRICE 400
#define CHAINGUN_BULLETS 300
#define CHAINGUN_REPEAT 80
#define CHAINGUN_K_SCALE 1.0f
#define CHAINGUN_SPREAD 1000
#define CHAINGUN_DMG HDM(6)
#define PRIFLE_PRICE 400
#define PRIFLE_CLIPS 50
#define PRIFLE_MAXCLIPS 4
#define PRIFLE_REPEAT 100
#define PRIFLE_K_SCALE 1.0f
#define PRIFLE_RELOAD 2000
#define PRIFLE_DMG HDM(9)
#define PRIFLE_SPEED 1000
#define FLAMER_PRICE 450
#define FLAMER_GAS 150
#define FLAMER_REPEAT 200
#define FLAMER_K_SCALE 1.0f
#define FLAMER_DMG HDM(20)
#define FLAMER_RADIUS 50
#define FLAMER_LIFETIME 800.0f
#define FLAMER_SPEED 200.0f
#define FLAMER_LAG 0.65f //the amount of player velocity that is added to the fireball
#define LCANNON_PRICE 600
#define LCANNON_AMMO 90
#define LCANNON_REPEAT 500
#define LCANNON_K_SCALE 1.0f
#define LCANNON_CHARGEREPEAT 1000
#define LCANNON_RELOAD 2000
#define LCANNON_DAMAGE HDM(265)
#define LCANNON_RADIUS 150
#define LCANNON_SECONDARY_DAMAGE HDM(27)
#define LCANNON_SECONDARY_RADIUS 75
#define LCANNON_SPEED 350
#define LCANNON_CHARGE_TIME 2000
#define LCANNON_TOTAL_CHARGE 255
#define LCANNON_MIN_CHARGE 50
#define HBUILD_PRICE 0
#define HBUILD_REPEAT 1000
#define HBUILD_DELAY 17500
#define HBUILD_HEALRATE 18
#define HBUILD2_PRICE 0
#define HBUILD2_REPEAT 1000
#define HBUILD2_DELAY 15000
/*
* HUMAN upgrades
*/
#define LIGHTARMOUR_PRICE 70
#define LIGHTARMOUR_POISON_PROTECTION 1
#define HELMET_PRICE 90
#define HELMET_RANGE 1000.0f
#define HELMET_POISON_PROTECTION 2
#define MEDKIT_PRICE 0
#define BATTPACK_PRICE 100
#define BATTPACK_MODIFIER 1.5f //modifier for extra energy storage available
#define JETPACK_PRICE 120
#define JETPACK_FLOAT_SPEED 128.0f //up movement speed
#define JETPACK_SINK_SPEED 192.0f //down movement speed
#define JETPACK_DISABLE_TIME 1000 //time to disable the jetpack when player damaged
#define JETPACK_DISABLE_CHANCE 0.3f
#define BSUIT_PRICE 400
#define BSUIT_POISON_PROTECTION 4
#define MGCLIP_PRICE 0
#define CGAMMO_PRICE 0
#define GAS_PRICE 0
#define MEDKIT_POISON_IMMUNITY_TIME 0
#define MEDKIT_STARTUP_TIME 4000
#define MEDKIT_STARTUP_SPEED 5
/*
* HUMAN buildables
*
* _BP - build points required for this buildable
* _BT - build time required for this buildable
* _SPLASHDAMGE - the amount of damage caused by this buildable when it blows up
* _SPLASHRADIUS - the radius around which it does this damage
*
* REACTOR_BASESIZE - the maximum distance a buildable can be from an reactor
* REPEATER_BASESIZE - the maximum distance a buildable can be from a repeater
* HUMAN_BHLTH_MODIFIER - overall health modifier for coarse tuning
*
*/
#define HUMAN_BHLTH_MODIFIER 1.0f
#define HBHM(h) ((int)((float)h*HUMAN_BHLTH_MODIFIER))
#define REACTOR_BASESIZE 1000
#define REPEATER_BASESIZE 500
#define HUMAN_DETONATION_DELAY 5000
#define HSPAWN_BP 10
#define HSPAWN_BT 10000
#define HSPAWN_HEALTH HBHM(310)
#define HSPAWN_SPLASHDAMAGE 50
#define HSPAWN_SPLASHRADIUS 100
#define HSPAWN_VALUE 1
#define MEDISTAT_BP 8
#define MEDISTAT_BT 10000
#define MEDISTAT_HEALTH HBHM(190)
#define MEDISTAT_SPLASHDAMAGE 50
#define MEDISTAT_SPLASHRADIUS 100
#define MGTURRET_BP 8
#define MGTURRET_BT 10000
#define MGTURRET_HEALTH HBHM(190)
#define MGTURRET_SPLASHDAMAGE 100
#define MGTURRET_SPLASHRADIUS 100
#define MGTURRET_ANGULARSPEED 8 //degrees/think ~= 200deg/sec
#define MGTURRET_ACCURACYTOLERANCE MGTURRET_ANGULARSPEED / 1.5f //angular difference for turret to fire
#define MGTURRET_VERTICALCAP 30 // +/- maximum pitch
#define MGTURRET_REPEAT 100
#define MGTURRET_K_SCALE 1.0f
#define MGTURRET_RANGE 300.0f
#define MGTURRET_SPREAD 200
#define MGTURRET_DMG HDM(4)
#define MGTURRET_DCC_ANGULARSPEED 10
#define MGTURRET_DCC_ACCURACYTOLERANCE MGTURRET_DCC_ANGULARSPEED / 1.5f
#define MGTURRET_GRAB_ANGULARSPEED 3
#define MGTURRET_GRAB_ACCURACYTOLERANCE MGTURRET_GRAB_ANGULARSPEED / 1.5f
#define TESLAGEN_BP 10
#define TESLAGEN_BT 15000
#define TESLAGEN_HEALTH HBHM(220)
#define TESLAGEN_SPLASHDAMAGE 50
#define TESLAGEN_SPLASHRADIUS 100
#define TESLAGEN_REPEAT 250
#define TESLAGEN_K_SCALE 4.0f
#define TESLAGEN_RANGE 250
#define TESLAGEN_DMG HDM(9)
#define DC_BP 8
#define DC_BT 10000
#define DC_HEALTH HBHM(190)
#define DC_SPLASHDAMAGE 50
#define DC_SPLASHRADIUS 100
#define ARMOURY_BP 10
#define ARMOURY_BT 10000
#define ARMOURY_HEALTH HBHM(280)
#define ARMOURY_SPLASHDAMAGE 50
#define ARMOURY_SPLASHRADIUS 100
#define REACTOR_BP 0
#define REACTOR_BT 20000
#define REACTOR_HEALTH HBHM(930)
#define REACTOR_SPLASHDAMAGE 200
#define REACTOR_SPLASHRADIUS 300
#define REACTOR_ATTACK_RANGE 100.0f
#define REACTOR_ATTACK_REPEAT 1000
#define REACTOR_ATTACK_DAMAGE 40
#define REACTOR_VALUE 2
#define REPEATER_BP 0
#define REPEATER_BT 10000
#define REPEATER_HEALTH HBHM(250)
#define REPEATER_SPLASHDAMAGE 50
#define REPEATER_SPLASHRADIUS 100
#define REPEATER_INACTIVE_TIME 90000
/*
* HUMAN misc
*/
#define HUMAN_SPRINT_MODIFIER 1.2f
#define HUMAN_JOG_MODIFIER 1.0f
#define HUMAN_BACK_MODIFIER 0.8f
#define HUMAN_SIDE_MODIFIER 0.9f
#define STAMINA_STOP_RESTORE 25
#define STAMINA_WALK_RESTORE 15
#define STAMINA_SPRINT_TAKE 8
#define STAMINA_LARMOUR_TAKE 4
#define HUMAN_SPAWN_REPEAT_TIME 10000
/*
* Misc
*/
#define MIN_FALL_DISTANCE 30.0f //the fall distance at which fall damage kicks in
#define MAX_FALL_DISTANCE 120.0f //the fall distance at which maximum damage is dealt
#define AVG_FALL_DISTANCE ((MIN_FALL_DISTANCE+MAX_FALL_DISTANCE)/2.0f)
#define HUMAN_MAXED 900 //a human with a strong selection of weapons/upgrades
#define HUMAN_MAX_CREDITS 2000
#define ALIEN_MAX_KILLS 9
#define ALIEN_MAX_SINGLE_KILLS 3
#define FREEKILL_PERIOD 120000 //msec
#define FREEKILL_ALIEN 1
#define FREEKILL_HUMAN LEVEL0_VALUE
#define DEFAULT_ALIEN_BUILDPOINTS "100"
#define DEFAULT_ALIEN_STAGE2_THRESH "20"
#define DEFAULT_ALIEN_STAGE3_THRESH "40"
#define DEFAULT_ALIEN_MAX_STAGE "2"
#define DEFAULT_HUMAN_BUILDPOINTS "100"
#define DEFAULT_HUMAN_STAGE2_THRESH "20"
#define DEFAULT_HUMAN_STAGE3_THRESH "40"
#define DEFAULT_HUMAN_MAX_STAGE "2"
#define DAMAGE_FRACTION_FOR_KILL 0.5f //how much damage players (versus structures) need to
//do to increment the stage kill counters
// g_suddenDeathMode settings
#define SDMODE_BP 0
#define SDMODE_NO_BUILD 1
#define SDMODE_SELECTIVE 2
-1562
View File
File diff suppressed because it is too large. Load diff
-335
View File
@@ -1,335 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
//
#ifndef __Q_PLATFORM_H
#define __Q_PLATFORM_H
// this is for determining if we have an asm version of a C function
#ifdef Q3_VM
#define id386 0
#define idppc 0
#define idppc_altivec 0
#else
#if (defined _M_IX86 || defined __i386__) && !defined(C_ONLY)
#define id386 1
#else
#define id386 0
#endif
#if (defined(powerc) || defined(powerpc) || defined(ppc) || \
defined(__ppc) || defined(__ppc__)) && !defined(C_ONLY)
#define idppc 1
#if defined(__VEC__)
#define idppc_altivec 1
#ifdef MACOS_X // Apple's GCC does this differently than the FSF.
#define VECCONST_UINT8(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
(vector unsigned char) (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p)
#else
#define VECCONST_UINT8(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
(vector unsigned char) {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p}
#endif
#else
#define idppc_altivec 0
#endif
#else
#define idppc 0
#define idppc_altivec 0
#endif
#endif
#ifndef __ASM_I386__ // don't include the C bits if included from qasm.h
// for windows fastcall option
#define QDECL
//================================================================= WIN32 ===
#ifdef _WIN32
#undef QDECL
#define QDECL __cdecl
#if defined( _MSC_VER )
#define OS_STRING "win_msvc"
#elif defined __MINGW32__
#define OS_STRING "win_mingw"
#endif
#define ID_INLINE __inline
#define PATH_SEP '\\'
#if defined( _M_IX86 ) || defined( __i386__ )
#define ARCH_STRING "x86"
#elif defined _M_ALPHA
#define ARCH_STRING "AXP"
#endif
#define Q3_LITTLE_ENDIAN
#define DLL_EXT ".dll"
#endif
//============================================================== MAC OS X ===
#if defined(MACOS_X) || defined(__APPLE_CC__)
// make sure this is defined, just for sanity's sake...
#ifndef MACOS_X
#define MACOS_X
#endif
#define OS_STRING "macosx"
#define ID_INLINE inline
#define PATH_SEP '/'
#ifdef __ppc__
#define ARCH_STRING "ppc"
#define Q3_BIG_ENDIAN
#elif defined __i386__
#define ARCH_STRING "x86"
#define Q3_LITTLE_ENDIAN
#endif
#define DLL_EXT ".dylib"
#endif
//================================================================= LINUX ===
#ifdef __linux__
#define OS_STRING "linux"
#define ID_INLINE inline
#define PATH_SEP '/'
#if defined __i386__
#define ARCH_STRING "x86"
#elif defined __x86_64__
#define ARCH_STRING "x86_64"
#elif defined __powerpc64__
#define ARCH_STRING "ppc64"
#elif defined __powerpc__
#define ARCH_STRING "ppc"
#elif defined __s390__
#define ARCH_STRING "s390"
#elif defined __s390x__
#define ARCH_STRING "s390x"
#elif defined __ia64__
#define ARCH_STRING "ia64"
#elif defined __alpha__
#define ARCH_STRING "alpha"
#elif defined __sparc__
#define ARCH_STRING "sparc"
#elif defined __arm__
#define ARCH_STRING "arm"
#elif defined __cris__
#define ARCH_STRING "cris"
#elif defined __hppa__
#define ARCH_STRING "hppa"
#elif defined __mips__
#define ARCH_STRING "mips"
#elif defined __sh__
#define ARCH_STRING "sh"
#endif
#if __FLOAT_WORD_ORDER == __BIG_ENDIAN
#define Q3_BIG_ENDIAN
#else
#define Q3_LITTLE_ENDIAN
#endif
#define DLL_EXT ".so"
#endif
//=============================================================== FreeBSD ===
#ifdef __FreeBSD__ // rb010123
#include <machine/endian.h>
#define OS_STRING "freebsd"
#define ID_INLINE inline
#define PATH_SEP '/'
#ifdef __i386__
#define ARCH_STRING "x86"
#elif defined __axp__
#define ARCH_STRING "alpha"
#endif
#if BYTE_ORDER == BIG_ENDIAN
#define Q3_BIG_ENDIAN
#else
#define Q3_LITTLE_ENDIAN
#endif
#define DLL_EXT ".so"
#endif
//================================================================ NetBSD ===
// This is very much like the FreeBSD one and can probably be merged
#ifdef __NetBSD__
#include <machine/endian.h>
#define OS_STRING "netbsd"
#define ID_INLINE inline
#define PATH_SEP '/'
#ifdef __i386__
#define ARCH_STRING "x86"
// Netbsd has alot of platforms
#endif
#if BYTE_ORDER == BIG_ENDIAN
#define Q3_BIG_ENDIAN
#else
#define Q3_LITTLE_ENDIAN
#endif
#define DLL_EXT ".so"
#endif
//================================================================= SUNOS ===
#ifdef __sun
#include <stdint.h>
#include <sys/byteorder.h>
#define OS_STRING "solaris"
#define ID_INLINE inline
#define PATH_SEP '/'
#ifdef __i386__
#define ARCH_STRING "x86"
#elif defined __sparc
#define ARCH_STRING "sparc"
#endif
#if defined( _BIG_ENDIAN )
#define Q3_BIG_ENDIAN
#elif defined( _LITTLE_ENDIAN )
#define Q3_LITTLE_ENDIAN
#endif
#define DLL_EXT ".so"
#endif
//================================================================== Q3VM ===
#ifdef Q3_VM
#define OS_STRING "q3vm"
#define ID_INLINE
#define PATH_SEP '/'
#define ARCH_STRING "bytecode"
#define DLL_EXT ".qvm"
#endif
//===========================================================================
//catch missing defines in above blocks
#if !defined( OS_STRING )
#error "Operating system not supported"
#endif
#if !defined( ARCH_STRING )
#error "Architecture not supported"
#endif
#ifndef ID_INLINE
#error "ID_INLINE not defined"
#endif
#ifndef PATH_SEP
#error "PATH_SEP not defined"
#endif
#ifndef DLL_EXT
#error "DLL_EXT not defined"
#endif
//endianness
short ShortSwap (short l);
int LongSwap (int l);
float FloatSwap (const float *f);
#if defined( Q3_BIG_ENDIAN ) && defined( Q3_LITTLE_ENDIAN )
#error "Endianness defined as both big and little"
#elif defined( Q3_BIG_ENDIAN )
#define LittleShort(x) ShortSwap(x)
#define LittleLong(x) LongSwap(x)
#define LittleFloat(x) FloatSwap(&x)
#define BigShort
#define BigLong
#define BigFloat
#elif defined( Q3_LITTLE_ENDIAN )
#define LittleShort
#define LittleLong
#define LittleFloat
#define BigShort(x) ShortSwap(x)
#define BigLong(x) LongSwap(x)
#define BigFloat(x) FloatSwap(&x)
#elif defined( Q3_VM )
#define LittleShort
#define LittleLong
#define LittleFloat
#define BigShort
#define BigLong
#define BigFloat
#else
#error "Endianness not defined"
#endif
//platform string
#ifdef NDEBUG
#define PLATFORM_STRING OS_STRING "-" ARCH_STRING
#else
#define PLATFORM_STRING OS_STRING "-" ARCH_STRING "-debug"
#endif
#endif
#endif
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-626
View File
@@ -1,626 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#ifndef __QFILES_H__
#define __QFILES_H__
//
// qfiles.h: quake file formats
// This file must be identical in the quake and utils directories
//
//Ignore __attribute__ on non-gcc platforms
#ifndef __GNUC__
#ifndef __attribute__
#define __attribute__(x)
#endif
#endif
// surface geometry should not exceed these limits
#define SHADER_MAX_VERTEXES 1000
#define SHADER_MAX_INDEXES (6*SHADER_MAX_VERTEXES)
// the maximum size of game relative pathnames
#define MAX_QPATH 64
/*
========================================================================
QVM files
========================================================================
*/
#define VM_MAGIC 0x12721444
#define VM_MAGIC_VER2 0x12721445
typedef struct {
int vmMagic;
int instructionCount;
int codeOffset;
int codeLength;
int dataOffset;
int dataLength;
int litLength; // ( dataLength - litLength ) should be byteswapped on load
int bssLength; // zero filled memory appended to datalength
//!!! below here is VM_MAGIC_VER2 !!!
int jtrgLength; // number of jump table targets
} vmHeader_t;
/*
========================================================================
PCX files are used for 8 bit images
========================================================================
*/
typedef struct {
char manufacturer;
char version;
char encoding;
char bits_per_pixel;
unsigned short xmin,ymin,xmax,ymax;
unsigned short hres,vres;
unsigned char palette[48];
char reserved;
char color_planes;
unsigned short bytes_per_line;
unsigned short palette_type;
char filler[58];
unsigned char data; // unbounded
} pcx_t;
/*
========================================================================
TGA files are used for 24/32 bit images
========================================================================
*/
typedef struct _TargaHeader {
unsigned char id_length, colormap_type, image_type;
unsigned short colormap_index, colormap_length;
unsigned char colormap_size;
unsigned short x_origin, y_origin, width, height;
unsigned char pixel_size, attributes;
} TargaHeader;
/*
========================================================================
.MD3 triangle model file format
========================================================================
*/
#define MD3_IDENT (('3'<<24)+('P'<<16)+('D'<<8)+'I')
#define MD3_VERSION 15
// limits
#define MD3_MAX_LODS 3
#define MD3_MAX_TRIANGLES 8192 // per surface
#define MD3_MAX_VERTS 4096 // per surface
#define MD3_MAX_SHADERS 256 // per surface
#define MD3_MAX_FRAMES 1024 // per model
#define MD3_MAX_SURFACES 32 // per model
#define MD3_MAX_TAGS 16 // per frame
// vertex scales
#define MD3_XYZ_SCALE (1.0/64)
typedef struct md3Frame_s {
vec3_t bounds[2];
vec3_t localOrigin;
float radius;
char name[16];
} md3Frame_t;
typedef struct md3Tag_s {
char name[MAX_QPATH]; // tag name
vec3_t origin;
vec3_t axis[3];
} md3Tag_t;
/*
** md3Surface_t
**
** CHUNK SIZE
** header sizeof( md3Surface_t )
** shaders sizeof( md3Shader_t ) * numShaders
** triangles[0] sizeof( md3Triangle_t ) * numTriangles
** st sizeof( md3St_t ) * numVerts
** XyzNormals sizeof( md3XyzNormal_t ) * numVerts * numFrames
*/
typedef struct {
int ident; //
char name[MAX_QPATH]; // polyset name
int flags;
int numFrames; // all surfaces in a model should have the same
int numShaders; // all surfaces in a model should have the same
int numVerts;
int numTriangles;
int ofsTriangles;
int ofsShaders; // offset from start of md3Surface_t
int ofsSt; // texture coords are common for all frames
int ofsXyzNormals; // numVerts * numFrames
int ofsEnd; // next surface follows
} md3Surface_t;
typedef struct {
char name[MAX_QPATH];
int shaderIndex; // for in-game use
} md3Shader_t;
typedef struct {
int indexes[3];
} md3Triangle_t;
typedef struct {
float st[2];
} md3St_t;
typedef struct {
short xyz[3];
short normal;
} md3XyzNormal_t;
typedef struct {
int ident;
int version;
char name[MAX_QPATH]; // model name
int flags;
int numFrames;
int numTags;
int numSurfaces;
int numSkins;
int ofsFrames; // offset for first frame
int ofsTags; // numFrames * numTags
int ofsSurfaces; // first surface, others follow
int ofsEnd; // end of file
} md3Header_t;
/*
==============================================================================
MD4 file format
==============================================================================
*/
#define MD4_IDENT (('4'<<24)+('P'<<16)+('D'<<8)+'I')
#define MD4_VERSION 1
#define MD4_MAX_BONES 128
typedef struct {
int boneIndex; // these are indexes into the boneReferences,
float boneWeight; // not the global per-frame bone list
vec3_t offset;
} md4Weight_t;
typedef struct {
vec3_t normal;
vec2_t texCoords;
int numWeights;
md4Weight_t weights[1]; // variable sized
} md4Vertex_t;
typedef struct {
int indexes[3];
} md4Triangle_t;
typedef struct {
int ident;
char name[MAX_QPATH]; // polyset name
char shader[MAX_QPATH];
int shaderIndex; // for in-game use
int ofsHeader; // this will be a negative number
int numVerts;
int ofsVerts;
int numTriangles;
int ofsTriangles;
// Bone references are a set of ints representing all the bones
// present in any vertex weights for this surface. This is
// needed because a model may have surfaces that need to be
// drawn at different sort times, and we don't want to have
// to re-interpolate all the bones for each surface.
int numBoneReferences;
int ofsBoneReferences;
int ofsEnd; // next surface follows
} md4Surface_t;
typedef struct {
float matrix[3][4];
} md4Bone_t;
typedef struct {
vec3_t bounds[2]; // bounds of all surfaces of all LOD's for this frame
vec3_t localOrigin; // midpoint of bounds, used for sphere cull
float radius; // dist from localOrigin to corner
md4Bone_t bones[1]; // [numBones]
} md4Frame_t;
typedef struct {
int numSurfaces;
int ofsSurfaces; // first surface, others follow
int ofsEnd; // next lod follows
} md4LOD_t;
typedef struct {
int ident;
int version;
char name[MAX_QPATH]; // model name
// frames and bones are shared by all levels of detail
int numFrames;
int numBones;
int ofsBoneNames; // char name[ MAX_QPATH ]
int ofsFrames; // md4Frame_t[numFrames]
// each level of detail has completely separate sets of surfaces
int numLODs;
int ofsLODs;
int ofsEnd; // end of file
} md4Header_t;
/*
* Here are the definitions for Ravensoft's model format of md4. Raven stores their
* playermodels in .mdr files, in some games, which are pretty much like the md4
* format implemented by ID soft. It seems like ID's original md4 stuff is not used at all.
* MDR is being used in EliteForce, JediKnight2 and Soldiers of Fortune2 (I think).
* So this comes in handy for anyone who wants to make it possible to load player
* models from these games.
* This format has bone tags, which is similar to the thing you have in md3 I suppose.
* Raven has released their version of md3view under GPL enabling me to add support
* to this codebase. Thanks to Steven Howes aka Skinner for helping with example
* source code.
*
* - Thilo Schulz (arny@ats.s.bawue.de)
*/
// If you want to enable support for Raven's .mdr / md4 format, uncomment the next
// line.
//#define RAVENMD4
#ifdef RAVENMD4
#define MDR_IDENT (('5'<<24)+('M'<<16)+('D'<<8)+'R')
#define MDR_VERSION 2
#define MDR_MAX_BONES 128
typedef struct {
int boneIndex; // these are indexes into the boneReferences,
float boneWeight; // not the global per-frame bone list
vec3_t offset;
} mdrWeight_t;
typedef struct {
vec3_t normal;
vec2_t texCoords;
int numWeights;
mdrWeight_t weights[1]; // variable sized
} mdrVertex_t;
typedef struct {
int indexes[3];
} mdrTriangle_t;
typedef struct {
int ident;
char name[MAX_QPATH]; // polyset name
char shader[MAX_QPATH];
int shaderIndex; // for in-game use
int ofsHeader; // this will be a negative number
int numVerts;
int ofsVerts;
int numTriangles;
int ofsTriangles;
// Bone references are a set of ints representing all the bones
// present in any vertex weights for this surface. This is
// needed because a model may have surfaces that need to be
// drawn at different sort times, and we don't want to have
// to re-interpolate all the bones for each surface.
int numBoneReferences;
int ofsBoneReferences;
int ofsEnd; // next surface follows
} mdrSurface_t;
typedef struct {
float matrix[3][4];
} mdrBone_t;
typedef struct {
vec3_t bounds[2]; // bounds of all surfaces of all LOD's for this frame
vec3_t localOrigin; // midpoint of bounds, used for sphere cull
float radius; // dist from localOrigin to corner
char name[16];
mdrBone_t bones[1]; // [numBones]
} mdrFrame_t;
typedef struct {
unsigned char Comp[24]; // MC_COMP_BYTES is in MatComp.h, but don't want to couple
} mdrCompBone_t;
typedef struct {
vec3_t bounds[2]; // bounds of all surfaces of all LOD's for this frame
vec3_t localOrigin; // midpoint of bounds, used for sphere cull
float radius; // dist from localOrigin to corner
mdrCompBone_t bones[1]; // [numBones]
} mdrCompFrame_t;
typedef struct {
int numSurfaces;
int ofsSurfaces; // first surface, others follow
int ofsEnd; // next lod follows
} mdrLOD_t;
typedef struct {
int boneIndex;
char name[32];
} mdrTag_t;
typedef struct {
int ident;
int version;
char name[MAX_QPATH]; // model name
// frames and bones are shared by all levels of detail
int numFrames;
int numBones;
int ofsFrames; // mdrFrame_t[numFrames]
// each level of detail has completely separate sets of surfaces
int numLODs;
int ofsLODs;
int numTags;
int ofsTags;
int ofsEnd; // end of file
} mdrHeader_t;
#endif
/*
==============================================================================
.BSP file format
==============================================================================
*/
#define BSP_IDENT (('P'<<24)+('S'<<16)+('B'<<8)+'I')
// little-endian "IBSP"
#define BSP_VERSION 46
// there shouldn't be any problem with increasing these values at the
// expense of more memory allocation in the utilities
#define MAX_MAP_MODELS 0x400
#define MAX_MAP_BRUSHES 0x8000
#define MAX_MAP_ENTITIES 0x800
#define MAX_MAP_ENTSTRING 0x40000
#define MAX_MAP_SHADERS 0x400
#define MAX_MAP_AREAS 0x100 // MAX_MAP_AREA_BYTES in q_shared must match!
#define MAX_MAP_FOGS 0x100
#define MAX_MAP_PLANES 0x20000
#define MAX_MAP_NODES 0x20000
#define MAX_MAP_BRUSHSIDES 0x20000
#define MAX_MAP_LEAFS 0x20000
#define MAX_MAP_LEAFFACES 0x20000
#define MAX_MAP_LEAFBRUSHES 0x40000
#define MAX_MAP_PORTALS 0x20000
#define MAX_MAP_LIGHTING 0x800000
#define MAX_MAP_LIGHTGRID 0x800000
#define MAX_MAP_VISIBILITY 0x200000
#define MAX_MAP_DRAW_SURFS 0x20000
#define MAX_MAP_DRAW_VERTS 0x80000
#define MAX_MAP_DRAW_INDEXES 0x80000
// key / value pair sizes in the entities lump
#define MAX_KEY 32
#define MAX_VALUE 1024
// the editor uses these predefined yaw angles to orient entities up or down
#define ANGLE_UP -1
#define ANGLE_DOWN -2
#define LIGHTMAP_WIDTH 128
#define LIGHTMAP_HEIGHT 128
#define MAX_WORLD_COORD ( 128*1024 )
#define MIN_WORLD_COORD ( -128*1024 )
#define WORLD_SIZE ( MAX_WORLD_COORD - MIN_WORLD_COORD )
//=============================================================================
typedef struct {
int fileofs, filelen;
} lump_t;
#define LUMP_ENTITIES 0
#define LUMP_SHADERS 1
#define LUMP_PLANES 2
#define LUMP_NODES 3
#define LUMP_LEAFS 4
#define LUMP_LEAFSURFACES 5
#define LUMP_LEAFBRUSHES 6
#define LUMP_MODELS 7
#define LUMP_BRUSHES 8
#define LUMP_BRUSHSIDES 9
#define LUMP_DRAWVERTS 10
#define LUMP_DRAWINDEXES 11
#define LUMP_FOGS 12
#define LUMP_SURFACES 13
#define LUMP_LIGHTMAPS 14
#define LUMP_LIGHTGRID 15
#define LUMP_VISIBILITY 16
#define HEADER_LUMPS 17
typedef struct {
int ident;
int version;
lump_t lumps[HEADER_LUMPS];
} dheader_t;
typedef struct {
float mins[3], maxs[3];
int firstSurface, numSurfaces;
int firstBrush, numBrushes;
} dmodel_t;
typedef struct {
char shader[MAX_QPATH];
int surfaceFlags;
int contentFlags;
} dshader_t;
// planes x^1 is allways the opposite of plane x
typedef struct {
float normal[3];
float dist;
} dplane_t;
typedef struct {
int planeNum;
int children[2]; // negative numbers are -(leafs+1), not nodes
int mins[3]; // for frustom culling
int maxs[3];
} dnode_t;
typedef struct {
int cluster; // -1 = opaque cluster (do I still store these?)
int area;
int mins[3]; // for frustum culling
int maxs[3];
int firstLeafSurface;
int numLeafSurfaces;
int firstLeafBrush;
int numLeafBrushes;
} dleaf_t;
typedef struct {
int planeNum; // positive plane side faces out of the leaf
int shaderNum;
} dbrushside_t;
typedef struct {
int firstSide;
int numSides;
int shaderNum; // the shader that determines the contents flags
} dbrush_t;
typedef struct {
char shader[MAX_QPATH];
int brushNum;
int visibleSide; // the brush side that ray tests need to clip against (-1 == none)
} dfog_t;
typedef struct {
vec3_t xyz;
float st[2];
float lightmap[2];
vec3_t normal;
byte color[4];
} drawVert_t;
#define drawVert_t_cleared(x) drawVert_t (x) = {{0, 0, 0}, {0, 0}, {0, 0}, {0, 0, 0}, {0, 0, 0, 0}}
typedef enum {
MST_BAD,
MST_PLANAR,
MST_PATCH,
MST_TRIANGLE_SOUP,
MST_FLARE
} mapSurfaceType_t;
typedef struct {
int shaderNum;
int fogNum;
int surfaceType;
int firstVert;
int numVerts;
int firstIndex;
int numIndexes;
int lightmapNum;
int lightmapX, lightmapY;
int lightmapWidth, lightmapHeight;
vec3_t lightmapOrigin;
vec3_t lightmapVecs[3]; // for patches, [0] and [1] are lodbounds
int patchWidth;
int patchHeight;
} dsurface_t;
#endif
-91
View File
@@ -1,91 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
//
// This file must be identical in the quake and utils directories
// contents flags are seperate bits
// a given brush can contribute multiple content bits
// these definitions also need to be in q_shared.h!
#define CONTENTS_SOLID 1 // an eye is never valid in a solid
#define CONTENTS_LAVA 8
#define CONTENTS_SLIME 16
#define CONTENTS_WATER 32
#define CONTENTS_FOG 64
#define CONTENTS_NOTTEAM1 0x0080
#define CONTENTS_NOTTEAM2 0x0100
#define CONTENTS_NOBOTCLIP 0x0200
#define CONTENTS_AREAPORTAL 0x8000
#define CONTENTS_PLAYERCLIP 0x10000
#define CONTENTS_MONSTERCLIP 0x20000
//bot specific contents types
#define CONTENTS_TELEPORTER 0x40000
#define CONTENTS_JUMPPAD 0x80000
#define CONTENTS_CLUSTERPORTAL 0x100000
#define CONTENTS_DONOTENTER 0x200000
#define CONTENTS_BOTCLIP 0x400000
#define CONTENTS_MOVER 0x800000
#define CONTENTS_ORIGIN 0x1000000 // removed before bsping an entity
#define CONTENTS_BODY 0x2000000 // should never be on a brush, only in game
#define CONTENTS_CORPSE 0x4000000
#define CONTENTS_DETAIL 0x8000000 // brushes not used for the bsp
#define CONTENTS_STRUCTURAL 0x10000000 // brushes used for the bsp
#define CONTENTS_TRANSLUCENT 0x20000000 // don't consume surface fragments inside
#define CONTENTS_TRIGGER 0x40000000
#define CONTENTS_NODROP 0x80000000 // don't leave bodies or items (death fog, lava)
//TA: custominfoparms below
#define CONTENTS_NOALIENBUILD 0x1000 //disallow alien building
#define CONTENTS_NOHUMANBUILD 0x2000 //disallow alien building
#define CONTENTS_NOBUILD 0x4000 //disallow alien building
#define SURF_NODAMAGE 0x1 // never give falling damage
#define SURF_SLICK 0x2 // effects game physics
#define SURF_SKY 0x4 // lighting from environment map
#define SURF_LADDER 0x8
#define SURF_NOIMPACT 0x10 // don't make missile explosions
#define SURF_NOMARKS 0x20 // don't leave missile marks
#define SURF_FLESH 0x40 // make flesh sounds and effects
#define SURF_NODRAW 0x80 // don't generate a drawsurface at all
#define SURF_HINT 0x100 // make a primary bsp splitter
#define SURF_SKIP 0x200 // completely ignore, allowing non-closed brushes
#define SURF_NOLIGHTMAP 0x400 // surface doesn't need a lightmap
#define SURF_POINTLIGHT 0x800 // generate lighting info at vertexes
#define SURF_METALSTEPS 0x1000 // clanking footsteps
#define SURF_NOSTEPS 0x2000 // no footstep sounds
#define SURF_NONSOLID 0x4000 // don't collide against curves with this set
#define SURF_LIGHTFILTER 0x8000 // act as a light filter during q3map -light
#define SURF_ALPHASHADOW 0x10000 // do per-pixel light shadow casting in q3map
#define SURF_NODLIGHT 0x20000 // don't dlight even if solid (solid lava, skies)
#define SURF_DUST 0x40000 // leave a dust trail when walking on this surface
//TA: custominfoparms below
#define SURF_NOALIENBUILD 0x80000 //disallow alien building
#define SURF_NOHUMANBUILD 0x100000 //disallow alien building
#define SURF_NOBUILD 0x200000 //disallow alien building
-43
View File
@@ -1,43 +0,0 @@
# yeah, couldn't do more simple really
ifeq ($(PLATFORM),mingw32)
BINEXT=.exe
else
BINEXT=
endif
ifeq ($(PLATFORM),sunos)
INSTALL=ginstall
else
INSTALL=install
endif
CC=gcc
Q3ASM_CFLAGS=-O2 -Wall -Werror -fno-strict-aliasing
ifeq ($(PLATFORM),darwin)
LCC_CFLAGS += -DMACOS_X=1
endif
ifndef USE_CCACHE
USE_CCACHE=0
endif
ifeq ($(USE_CCACHE),1)
CC := ccache $(CC)
CXX := ccache $(CXX)
endif
default: q3asm
q3asm: q3asm.c cmdlib.c
$(CC) $(Q3ASM_CFLAGS) -o $@ $^
clean:
rm -f q3asm *~ *.o
install: default
$(INSTALL) -s -m 0755 q3asm$(BINEXT) ../
uninstall:
rm -f ../q3asm$(BINEXT)
-10
View File
@@ -1,10 +0,0 @@
2002-10-25 Timothee Besset <ttimo@idsoftware.com>
If you are looking for a faster version of the q3asm tool, try:
http://www.icculus.org/~phaethon/q3/q3asm-turbo/q3asm-turbo.html
2001-10-31 Timothee Besset <ttimo@idsoftware.com>
updated from the $/source/q3asm code
modified for portability and use with >= 1.31 mod source release
the cmdlib.c cmdlib.h mathlib.h qfiles.h have been copied from
$/source/common
File diff suppressed because it is too large. Load diff
-161
View File
@@ -1,161 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// cmdlib.h
#ifndef __CMDLIB__
#define __CMDLIB__
#ifdef _MSC_VER
#pragma warning(disable : 4244) // MIPS
#pragma warning(disable : 4136) // X86
#pragma warning(disable : 4051) // ALPHA
#pragma warning(disable : 4018) // signed/unsigned mismatch
#pragma warning(disable : 4305) // truncate from double to float
#pragma check_stack(off)
#endif
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <ctype.h>
#include <time.h>
#include <stdarg.h>
#ifdef _MSC_VER
#pragma intrinsic( memset, memcpy )
#endif
#ifndef __BYTEBOOL__
#define __BYTEBOOL__
typedef enum { qfalse, qtrue } qboolean;
typedef unsigned char byte;
#endif
#define MAX_OS_PATH 1024
#define MEM_BLOCKSIZE 4096
// the dec offsetof macro doesnt work very well...
#define myoffsetof(type,identifier) ((size_t)&((type *)0)->identifier)
// set these before calling CheckParm
extern int myargc;
extern char **myargv;
char *strupr (char *in);
char *strlower (char *in);
int Q_strncasecmp( const char *s1, const char *s2, int n );
int Q_stricmp( const char *s1, const char *s2 );
void Q_getwd( char *out );
int Q_filelength (FILE *f);
int FileTime( const char *path );
void Q_mkdir( const char *path );
extern char qdir[1024];
extern char gamedir[1024];
extern char writedir[1024];
void SetQdirFromPath( const char *path );
char *ExpandArg( const char *path ); // from cmd line
char *ExpandPath( const char *path ); // from scripts
char *ExpandGamePath (const char *path);
char *ExpandPathAndArchive( const char *path );
double I_FloatTime( void );
void Error( const char *error, ... );
int CheckParm( const char *check );
FILE *SafeOpenWrite( const char *filename );
FILE *SafeOpenRead( const char *filename );
void SafeRead (FILE *f, void *buffer, int count);
void SafeWrite (FILE *f, const void *buffer, int count);
int LoadFile( const char *filename, void **bufferptr );
int LoadFileBlock( const char *filename, void **bufferptr );
int TryLoadFile( const char *filename, void **bufferptr );
void SaveFile( const char *filename, const void *buffer, int count );
qboolean FileExists( const char *filename );
void DefaultExtension( char *path, const char *extension );
void DefaultPath( char *path, const char *basepath );
void StripFilename( char *path );
void StripExtension( char *path );
void ExtractFilePath( const char *path, char *dest );
void ExtractFileBase( const char *path, char *dest );
void ExtractFileExtension( const char *path, char *dest );
int ParseNum (const char *str);
short BigShort (short l);
short LittleShort (short l);
int BigLong (int l);
int LittleLong (int l);
float BigFloat (float l);
float LittleFloat (float l);
char *COM_Parse (char *data);
extern char com_token[1024];
extern qboolean com_eof;
char *copystring(const char *s);
void CRC_Init(unsigned short *crcvalue);
void CRC_ProcessByte(unsigned short *crcvalue, byte data);
unsigned short CRC_Value(unsigned short crcvalue);
void CreatePath( const char *path );
void QCopyFile( const char *from, const char *to );
extern qboolean archive;
extern char archivedir[1024];
extern qboolean verbose;
void qprintf( const char *format, ... );
void _printf( const char *format, ... );
void ExpandWildcards( int *argc, char ***argv );
// for compression routines
typedef struct
{
void *data;
int count, width, height;
} cblock_t;
#endif
-31
View File
@@ -1,31 +0,0 @@
strlen
strcasecmp
tolower
strcat
strncpy
strcmp
strcpy
strchr
vsprintf
memcpy
memset
rand
atoi
atof
abs
floor
fabs
tan
atan
sqrt
log
cos
sin
atan2
-95
View File
@@ -1,95 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#ifndef __MATHLIB__
#define __MATHLIB__
// mathlib.h
#include <math.h>
#ifdef DOUBLEVEC_T
typedef double vec_t;
#else
typedef float vec_t;
#endif
typedef vec_t vec2_t[3];
typedef vec_t vec3_t[3];
typedef vec_t vec4_t[4];
#define SIDE_FRONT 0
#define SIDE_ON 2
#define SIDE_BACK 1
#define SIDE_CROSS -2
#define Q_PI 3.14159265358979323846
#define DEG2RAD( a ) ( ( (a) * Q_PI ) / 180.0F )
#define RAD2DEG( a ) ( ( (a) * 180.0f ) / Q_PI )
extern vec3_t vec3_origin;
#define EQUAL_EPSILON 0.001
// plane types are used to speed some tests
// 0-2 are axial planes
#define PLANE_X 0
#define PLANE_Y 1
#define PLANE_Z 2
#define PLANE_NON_AXIAL 3
qboolean VectorCompare( const vec3_t v1, const vec3_t v2 );
#define DotProduct(x,y) (x[0]*y[0]+x[1]*y[1]+x[2]*y[2])
#define VectorSubtract(a,b,c) {c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];}
#define VectorAdd(a,b,c) {c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];}
#define VectorCopy(a,b) {b[0]=a[0];b[1]=a[1];b[2]=a[2];}
#define VectorScale(a,b,c) {c[0]=b*a[0];c[1]=b*a[1];c[2]=b*a[2];}
#define VectorClear(x) {x[0] = x[1] = x[2] = 0;}
#define VectorNegate(x) {x[0]=-x[0];x[1]=-x[1];x[2]=-x[2];}
void Vec10Copy( vec_t *in, vec_t *out );
vec_t Q_rint (vec_t in);
vec_t _DotProduct (vec3_t v1, vec3_t v2);
void _VectorSubtract (vec3_t va, vec3_t vb, vec3_t out);
void _VectorAdd (vec3_t va, vec3_t vb, vec3_t out);
void _VectorCopy (vec3_t in, vec3_t out);
void _VectorScale (vec3_t v, vec_t scale, vec3_t out);
double VectorLength( const vec3_t v );
void VectorMA( const vec3_t va, double scale, const vec3_t vb, vec3_t vc );
void CrossProduct( const vec3_t v1, const vec3_t v2, vec3_t cross );
vec_t VectorNormalize( const vec3_t in, vec3_t out );
vec_t ColorNormalize( const vec3_t in, vec3_t out );
void VectorInverse (vec3_t v);
void ClearBounds (vec3_t mins, vec3_t maxs);
void AddPointToBounds( const vec3_t v, vec3_t mins, vec3_t maxs );
qboolean PlaneFromPoints( vec4_t plane, const vec3_t a, const vec3_t b, const vec3_t c );
void NormalToLatLong( const vec3_t normal, byte bytes[2] );
int PlaneTypeForNormal (vec3_t normal);
#endif
-16
View File
@@ -1,16 +0,0 @@
don't do any paramter conversion (double to float, etc)
Why?
Security.
Portability.
It may be more aproachable.
can still use regular dlls for development purposes
lcc
q3asm
-132
View File
@@ -1,132 +0,0 @@
CNSTF,
CNSTI,
CNSTP,
CNSTU,
ARGB,
ARGF,
ARGI,
ARGP,
ARGU,
ASGNB,
ASGNF,
ASGNI,
ASGNP,
ASGNU,
INDIRB,
INDIRF,
INDIRI,
INDIRP,
INDIRU,
CVFF,
CVFI,
CVIF,
CVII,
CVIU,
CVPU,
CVUI,
CVUP,
CVUU,
NEGF,
NEGI,
CALLB,
CALLF,
CALLI,
CALLP,
CALLU,
CALLV,
RETF,
RETI,
RETP,
RETU,
RETV,
ADDRGP,
ADDRFP,
ADDRLP,
ADDF,
ADDI,
ADDP,
ADDU,
SUBF,
SUBI,
SUBP,
SUBU,
LSHI,
LSHU,
MODI,
MODU,
RSHI,
RSHU,
BANDI,
BANDU,
BCOMI,
BCOMU,
BORI,
BORU,
BXORI,
BXORU,
DIVF,
DIVI,
DIVU,
MULF,
MULI,
MULU,
EQF,
EQI,
EQU,
GEF,
GEI,
GEU,
GTF,
GTI,
GTU,
LEF,
LEI,
LEU,
LTF,
LTI,
LTU,
NEF,
NEI,
NEU,
JUMPV,
LABELV,
LOADB,
LOADF,
LOADI,
LOADP,
LOADU,
-176
View File
@@ -1,176 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2006 Tim Angus
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
{ "BREAK", OP_BREAK },
{ "CNSTF4", OP_CONST },
{ "CNSTI4", OP_CONST },
{ "CNSTP4", OP_CONST },
{ "CNSTU4", OP_CONST },
{ "CNSTI2", OP_CONST },
{ "CNSTU2", OP_CONST },
{ "CNSTI1", OP_CONST },
{ "CNSTU1", OP_CONST },
//{ "ARGB", OP_ARG },
//{ "ARGF", OP_ARG },
//{ "ARGI", OP_ARG },
//{ "ARGP", OP_ARG },
//{ "ARGU", OP_ARG },
{ "ASGNB", OP_BLOCK_COPY },
{ "ASGNF4", OP_STORE4 },
{ "ASGNI4", OP_STORE4 },
{ "ASGNP4", OP_STORE4 },
{ "ASGNU4", OP_STORE4 },
{ "ASGNI2", OP_STORE2 },
{ "ASGNU2", OP_STORE2 },
{ "ASGNI1", OP_STORE1 },
{ "ASGNU1", OP_STORE1 },
{ "INDIRB", OP_IGNORE }, // block copy deals with this
{ "INDIRF4", OP_LOAD4 },
{ "INDIRI4", OP_LOAD4 },
{ "INDIRP4", OP_LOAD4 },
{ "INDIRU4", OP_LOAD4 },
{ "INDIRI2", OP_LOAD2 },
{ "INDIRU2", OP_LOAD2 },
{ "INDIRI1", OP_LOAD1 },
{ "INDIRU1", OP_LOAD1 },
{ "CVFF4", OP_UNDEF },
{ "CVFI4", OP_CVFI },
{ "CVIF4", OP_CVIF },
{ "CVII4", OP_SEX8 }, // will be either SEX8 or SEX16
{ "CVII1", OP_IGNORE },
{ "CVII2", OP_IGNORE },
{ "CVIU4", OP_IGNORE },
{ "CVPU4", OP_IGNORE },
{ "CVUI4", OP_IGNORE },
{ "CVUP4", OP_IGNORE },
{ "CVUU4", OP_IGNORE },
{ "CVUU1", OP_IGNORE },
{ "NEGF4", OP_NEGF },
{ "NEGI4", OP_NEGI },
//{ "CALLB", OP_UNDEF },
//{ "CALLF", OP_UNDEF },
//{ "CALLI", OP_UNDEF },
//{ "CALLP", OP_UNDEF },
//{ "CALLU", OP_UNDEF },
//{ "CALLV", OP_CALL },
//{ "RETF", OP_UNDEF },
//{ "RETI", OP_UNDEF },
//{ "RETP", OP_UNDEF },
//{ "RETU", OP_UNDEF },
//{ "RETV", OP_UNDEF },
{ "ADDRGP4", OP_CONST },
//{ "ADDRFP", OP_PARM },
//{ "ADDRLP", OP_LOCAL },
{ "ADDF4", OP_ADDF },
{ "ADDI4", OP_ADD },
{ "ADDP4", OP_ADD },
{ "ADDP", OP_ADD },
{ "ADDU4", OP_ADD },
{ "SUBF4", OP_SUBF },
{ "SUBI4", OP_SUB },
{ "SUBP4", OP_SUB },
{ "SUBU4", OP_SUB },
{ "LSHI4", OP_LSH },
{ "LSHU4", OP_LSH },
{ "MODI4", OP_MODI },
{ "MODU4", OP_MODU },
{ "RSHI4", OP_RSHI },
{ "RSHU4", OP_RSHU },
{ "BANDI4", OP_BAND },
{ "BANDU4", OP_BAND },
{ "BCOMI4", OP_BCOM },
{ "BCOMU4", OP_BCOM },
{ "BORI4", OP_BOR },
{ "BORU4", OP_BOR },
{ "BXORI4", OP_BXOR },
{ "BXORU4", OP_BXOR },
{ "DIVF4", OP_DIVF },
{ "DIVI4", OP_DIVI },
{ "DIVU4", OP_DIVU },
{ "MULF4", OP_MULF },
{ "MULI4", OP_MULI },
{ "MULU4", OP_MULU },
{ "EQF4", OP_EQF },
{ "EQI4", OP_EQ },
{ "EQU4", OP_EQ },
{ "GEF4", OP_GEF },
{ "GEI4", OP_GEI },
{ "GEU4", OP_GEU },
{ "GTF4", OP_GTF },
{ "GTI4", OP_GTI },
{ "GTU4", OP_GTU },
{ "LEF4", OP_LEF },
{ "LEI4", OP_LEI },
{ "LEU4", OP_LEU },
{ "LTF4", OP_LTF },
{ "LTI4", OP_LTI },
{ "LTU4", OP_LTU },
{ "NEF4", OP_NEF },
{ "NEI4", OP_NE },
{ "NEU4", OP_NE },
{ "JUMPV", OP_JUMP },
{ "LOADB4", OP_UNDEF },
{ "LOADF4", OP_UNDEF },
{ "LOADI4", OP_UNDEF },
{ "LOADP4", OP_UNDEF },
{ "LOADU4", OP_UNDEF },
File diff suppressed because it is too large. Load diff
Binary file not shown.
-61
View File
@@ -1,61 +0,0 @@
The authors of this software are Christopher W. Fraser and
David R. Hanson.
Copyright (c) 1991,1992,1993,1994,1995,1996,1997,1998 by AT&T,
Christopher W. Fraser, and David R. Hanson. All Rights Reserved.
Permission to use, copy, modify, and distribute this software for any
purpose, subject to the provisions described below, without fee is
hereby granted, provided that this entire notice is included in all
copies of any software that is or includes a copy or modification of
this software and in all copies of the supporting documentation for
such software.
THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR AT&T MAKE ANY
REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
lcc is not public-domain software, shareware, and it is not protected
by a `copyleft' agreement, like the code from the Free Software
Foundation.
lcc is available free for your personal research and instructional use
under the `fair use' provisions of the copyright law. You may, however,
redistribute lcc in whole or in part provided you acknowledge its
source and include this CPYRIGHT file. You may, for example, include
the distribution in a CDROM of free software, provided you charge only
for the media, or mirror the distribution files at your site.
You may not sell lcc or any product derived from it in which it is a
significant part of the value of the product. Using the lcc front end
to build a C syntax checker is an example of this kind of product.
You may use parts of lcc in products as long as you charge for only
those components that are entirely your own and you acknowledge the use
of lcc clearly in all product documentation and distribution media. You
must state clearly that your product uses or is based on parts of lcc
and that lcc is available free of charge. You must also request that
bug reports on your product be reported to you. Using the lcc front
end to build a C compiler for the Motorola 88000 chip and charging for
and distributing only the 88000 code generator is an example of this
kind of product.
Using parts of lcc in other products is more problematic. For example,
using parts of lcc in a C++ compiler could save substantial time and
effort and therefore contribute significantly to the profitability of
the product. This kind of use, or any use where others stand to make a
profit from what is primarily our work, requires a license agreement
with Addison-Wesley. Per-copy and unlimited use licenses are
available; for more information, contact
J. Carter Shanklin
Addison Wesley Longman, Inc.
2725 Sand Hill Rd.
Menlo Park, CA 94025
650/854-0300 x2478 FAX: 650/614-2930 jcs@awl.com
-----
Chris Fraser / cwfraser@microsoft.com
David Hanson / drh@microsoft.com
$Revision: 145 $ $Date: 2001-10-17 16:53:10 -0500 (Wed, 17 Oct 2001) $
-91
View File
@@ -1,91 +0,0 @@
From lcc 4.0 to 4.1:
Changes:
See doc/4.html for changes in the code-generation interface.
Warns about constants that are too large, eg, short x = 70000;
Warns about expressions that have no effect.
Unsigned shorts are now used for wide-character constants, and
wchar_t is a typedef for unsigned short.
More assertions in gen.c to confirm that the register allocator is
configured correctly; ie, that the various masks, wildcards,
clobbers, and targets are internally consistent. Full checking
appears impractical, but there's still more than than there was
before.
On the SPARC, lcc now emits .type and .size directives
unconditionally.
On the x86, constants are now emitted into the text segment.
If the environment variable "LCCDIR" is defined, it gives the directory
that contains the preprocessor, the compiler proper, and the
lcc-specific libraries.
Under Windows, lcc searches the directories named in the environment
variable "include" for header files.
Errors fixed:
Erroneously complained about unknown sizes for some const fields, eg,
typedef struct foo ref; struct foo { const ref *q; int a; };
f(ref *p, int i) { return p->q[i].a; }
-A -A erroneously complained about static main's that didn't conform
to the ANSI-mandated "int main(void)" or "int main(int, char **)".
Silently generated incorrect code for a structure copy with a
post-incremented target, eg,
struct { int x; } data = {1}, copy[2], *q = copy;
main() { *q++ = data; }
Generated incorrect values in some expressions with constant pointers.
Silently truncated string literals longer than 4095 characters.
Failed to emit debugging information for uninitialized globals.
Failed to diagnose missing sizes in some multi-dimensioned array
declarators, eg, extern int x[][10]; int x[5][];
Silently emitted incorrect sizes and initalizations for some
incomplete multi-dimensioned arrays involving pointers and whose size
is determined by the number of initializers.
Set only the x.name field for some back-end symbols (eg, wildcards),
and the uninitialized name field crashed some debugging output.
uses() failed to check the register *set* as well as the register
mask. There's no known bug demo, but a wildcard set might be
contrived that would need the test.
Crashed with -b on some conditional expressions involving calls, eg,
int p; void g(void) { p ? f() : 1; }
On the MIPS, sometimes generated an incorrect frame size and thus a
crash when floating-point registers were saved.
On the SPARC, erroneously reused a register variable as a temporary
when the variable is compiler-generated.
On the SPARC with -b, emitted incorrect code for returning structs.
On the x86, conversion from float to int rounded instead of truncated
with the default floating-point mode.
On the x86, eliminate rtargets for kids after the first (see p. 419).
On the x86, substitute reg for freg, in order to use the common reg
rules. Needed only for debugging output, since we're not using any
float regs as regs at this time.
On the x86, "double f(); main(){f();}" wasn't popping the FP register stack.
On the x86, ECX was saved by the callee, when it should have been
saved by the caller.
$Id: LOG 145 2001-10-17 21:53:10Z timo $
-163
View File
@@ -1,163 +0,0 @@
TEMPDIR=/tmp
A=.a
O=.o
ifeq ($(PLATFORM),mingw32)
E=.exe
else
E=
endif
CC=gcc
LCC_CFLAGS=-O2 -Wall -fno-strict-aliasing -MMD
LDFLAGS=
LD=gcc
AR=ar
ARFLAGS=cru
RANLIB=ranlib
DIFF=diff
RM=rm -f
RMDIR=rmdir
BUILDDIR=build-$(PLATFORM)-$(ARCH)
BD=$(BUILDDIR)/
ifeq ($(USE_CCACHE),1)
CC := ccache $(CC)
endif
# Need MACOS_X defined or this won't build.
ifeq ($(PLATFORM),darwin)
LCC_CFLAGS += -DMACOS_X
endif
ifeq ($(PLATFORM),sunos)
INSTALL=ginstall
else
INSTALL=install
endif
all: q3rcc lburg q3cpp q3lcc
q3rcc: makedirs $(BD)q3rcc$(E)
lburg: makedirs $(BD)lburg$(E)
q3cpp: makedirs $(BD)q3cpp$(E)
q3lcc: makedirs $(BD)q3lcc$(E)
makedirs:
@if [ ! -d $(BD) ];then mkdir $(BD);fi
@if [ ! -d $(BD)/etc ];then mkdir $(BD)/etc;fi
@if [ ! -d $(BD)/rcc ];then mkdir $(BD)/rcc;fi
@if [ ! -d $(BD)/cpp ];then mkdir $(BD)/cpp;fi
@if [ ! -d $(BD)/lburg ];then mkdir $(BD)/lburg;fi
# ===== RCC =====
RCCOBJS= \
$(BD)rcc/alloc$(O) \
$(BD)rcc/bind$(O) \
$(BD)rcc/bytecode$(O) \
$(BD)rcc/dag$(O) \
$(BD)rcc/dagcheck$(O) \
$(BD)rcc/decl$(O) \
$(BD)rcc/enode$(O) \
$(BD)rcc/error$(O) \
$(BD)rcc/event$(O) \
$(BD)rcc/expr$(O) \
$(BD)rcc/gen$(O) \
$(BD)rcc/init$(O) \
$(BD)rcc/inits$(O) \
$(BD)rcc/input$(O) \
$(BD)rcc/lex$(O) \
$(BD)rcc/list$(O) \
$(BD)rcc/main$(O) \
$(BD)rcc/null$(O) \
$(BD)rcc/output$(O) \
$(BD)rcc/prof$(O) \
$(BD)rcc/profio$(O) \
$(BD)rcc/simp$(O) \
$(BD)rcc/stmt$(O) \
$(BD)rcc/string$(O) \
$(BD)rcc/sym$(O) \
$(BD)rcc/symbolic$(O) \
$(BD)rcc/trace$(O) \
$(BD)rcc/tree$(O) \
$(BD)rcc/types$(O)
$(BD)q3rcc$(E): $(RCCOBJS)
$(LD) $(LDFLAGS) -o $@ $(RCCOBJS)
$(BD)rcc/%$(O): src/%.c
$(CC) $(LCC_CFLAGS) -c -Isrc -o $@ $<
$(BD)rcc/dagcheck$(O): $(BD)rcc/dagcheck.c
$(CC) $(LCC_CFLAGS) -Wno-unused -c -Isrc -o $@ $<
$(BD)rcc/dagcheck.c: $(BD)lburg/lburg$(E) src/dagcheck.md
$(BD)lburg/lburg$(E) src/dagcheck.md $@
# ===== LBURG =====
LBURGOBJS= \
$(BD)lburg/lburg$(O) \
$(BD)lburg/gram$(O)
$(BD)lburg/lburg$(E): $(LBURGOBJS)
$(LD) $(LDFLAGS) -o $@ $(LBURGOBJS)
$(BD)lburg/%$(O): lburg/%.c
$(CC) $(LCC_CFLAGS) -c -Ilburg -o $@ $<
# ===== CPP =====
CPPOBJS= \
$(BD)cpp/cpp$(O) \
$(BD)cpp/lex$(O) \
$(BD)cpp/nlist$(O) \
$(BD)cpp/tokens$(O) \
$(BD)cpp/macro$(O) \
$(BD)cpp/eval$(O) \
$(BD)cpp/include$(O) \
$(BD)cpp/hideset$(O) \
$(BD)cpp/getopt$(O) \
$(BD)cpp/unix$(O)
$(BD)q3cpp$(E): $(CPPOBJS)
$(LD) $(LDFLAGS) -o $@ $(CPPOBJS)
$(BD)cpp/%$(O): cpp/%.c
$(CC) $(LCC_CFLAGS) -c -Icpp -o $@ $<
# ===== LCC =====
LCCOBJS= \
$(BD)etc/lcc$(O) \
$(BD)etc/bytecode$(O)
$(BD)q3lcc$(E): $(LCCOBJS)
$(LD) $(LDFLAGS) -o $@ $(LCCOBJS)
$(BD)etc/%$(O): etc/%.c
$(CC) $(LCC_CFLAGS) -DTEMPDIR=\"$(TEMPDIR)\" -DSYSTEM=\"\" -c -Isrc -o $@ $<
install: q3lcc q3cpp q3rcc
$(INSTALL) -s -m 0755 $(BD)q3lcc$(E) ../
$(INSTALL) -s -m 0755 $(BD)q3cpp$(E) ../
$(INSTALL) -s -m 0755 $(BD)q3rcc$(E) ../
uninstall:
-$(RM) ../q3lcc$(E)
-$(RM) ../q3cpp$(E)
-$(RM) ../q3rcc$(E)
clean:
if [ -d $(BD) ];then (find $(BD) -name '*.d' -exec rm {} \;)fi
$(RM) $(RCCOBJS) $(LBURGOBJS) $(CPPOBJS) $(LCCOBJS)
$(RM) $(BD)rcc/dagcheck.c $(BD)lburg/lburg$(E)
$(RM) $(BD)q3lcc$(E) $(BD)q3cpp$(E) $(BD)q3rcc$(E)
$(RM) -r $(BD)
D_FILES=$(shell find . -name '*.d')
ifneq ($(strip $(D_FILES)),)
include $(D_FILES)
endif
-21
View File
@@ -1,21 +0,0 @@
This hierarchy is the distribution for lcc version 4.1.
lcc version 3.x is described in the book "A Retargetable C Compiler:
Design and Implementation" (Addison-Wesley, 1995, ISBN 0-8053-1670-1).
There are significant differences between 3.x and 4.x, most notably in
the intermediate code. doc/4.html summarizes the differences.
VERSION 4.1 IS INCOMPATIBLE WITH EARLIER VERSIONS OF LCC. DO NOT
UNLOAD THIS DISTRIBUTION ON TOP OF A 3.X DISTRIBUTION.
LOG describes the changes since the last release.
CPYRIGHT describes the conditions under you can use, copy, modify, and
distribute lcc or works derived from lcc.
doc/install.html is an HTML file that gives a complete description of
the distribution and installation instructions.
Chris Fraser / cwfraser@microsoft.com
David Hanson / drh@microsoft.com
$Revision: 145 $ $Date: 2001-10-17 16:53:10 -0500 (Wed, 17 Oct 2001) $
-3
View File
@@ -1,3 +0,0 @@
2001-10-31 Timothee Besset <ttimo@idsoftware.com>
updated from the $/source/lcc code
modified for portability and use with >= 1.31 mod source release
@@ -1 +0,0 @@
build-mingw32-x86/cpp/cpp.o: cpp/cpp.c cpp/cpp.h
@@ -1 +0,0 @@
build-mingw32-x86/cpp/eval.o: cpp/eval.c cpp/cpp.h
@@ -1 +0,0 @@
build-mingw32-x86/cpp/getopt.o: cpp/getopt.c
@@ -1 +0,0 @@
build-mingw32-x86/cpp/hideset.o: cpp/hideset.c cpp/cpp.h
@@ -1 +0,0 @@
build-mingw32-x86/cpp/include.o: cpp/include.c cpp/cpp.h
@@ -1 +0,0 @@
build-mingw32-x86/cpp/lex.o: cpp/lex.c cpp/cpp.h
@@ -1 +0,0 @@
build-mingw32-x86/cpp/macro.o: cpp/macro.c cpp/cpp.h
@@ -1 +0,0 @@
build-mingw32-x86/cpp/nlist.o: cpp/nlist.c cpp/cpp.h
@@ -1 +0,0 @@
build-mingw32-x86/cpp/tokens.o: cpp/tokens.c cpp/cpp.h
@@ -1 +0,0 @@
build-mingw32-x86/cpp/unix.o: cpp/unix.c cpp/cpp.h
@@ -1,2 +0,0 @@
build-mingw32-x86/etc/bytecode.o: etc/bytecode.c \
../../qcommon/q_platform.h
@@ -1 +0,0 @@
build-mingw32-x86/etc/lcc.o: etc/lcc.c
@@ -1 +0,0 @@
build-mingw32-x86/lburg/gram.o: lburg/gram.c lburg/lburg.h
@@ -1 +0,0 @@
build-mingw32-x86/lburg/lburg.o: lburg/lburg.c lburg/lburg.h
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +0,0 @@
build-mingw32-x86/rcc/alloc.o: src/alloc.c src/c.h src/config.h \
src/token.h
@@ -1 +0,0 @@
build-mingw32-x86/rcc/bind.o: src/bind.c src/c.h src/config.h src/token.h
@@ -1,2 +0,0 @@
build-mingw32-x86/rcc/bytecode.o: src/bytecode.c src/c.h src/config.h \
src/token.h
@@ -1 +0,0 @@
build-mingw32-x86/rcc/dag.o: src/dag.c src/c.h src/config.h src/token.h
File diff suppressed because it is too large. Load diff
@@ -1,2 +0,0 @@
build-mingw32-x86/rcc/dagcheck.o: build-mingw32-x86/rcc/dagcheck.c \
src/c.h src/config.h src/token.h
@@ -1 +0,0 @@
build-mingw32-x86/rcc/decl.o: src/decl.c src/c.h src/config.h src/token.h
@@ -1,2 +0,0 @@
build-mingw32-x86/rcc/enode.o: src/enode.c src/c.h src/config.h \
src/token.h
@@ -1,2 +0,0 @@
build-mingw32-x86/rcc/error.o: src/error.c src/c.h src/config.h \
src/token.h
@@ -1,2 +0,0 @@
build-mingw32-x86/rcc/event.o: src/event.c src/c.h src/config.h \
src/token.h
Loaded 100 of 181 files, more files were not shown because too many files have changed in this diff. Show more