Commit graph

3265 commits

Author SHA1 Message Date
Zack Middleton
4a063679f8 Merge branch 'misc/lilium_common' into game/eliteforce
Conflicts:
	code/qcommon/common.c
	code/qcommon/q_shared.h
2018-03-04 05:10:01 -06:00
Zack Middleton
51a57b8420 Merge branch 'master' into misc/lilium_common
Conflicts:
	Makefile
	code/client/cl_main.c
	code/qcommon/common.c
	code/qcommon/q_shared.h
	code/sys/sys_unix.c
2018-03-04 05:08:08 -06:00
Zack Middleton
83e5ecfe36 Add BUILD_FINAL from Spearmint 2018-03-04 05:03:27 -06:00
Zack Middleton
c5e5ec3204 Fix macOS app bundle version/renderer_prefix
Rename baseq3 to baseEF.
Don't create missionpack.
Don't try to add VMs to app bundle.
2018-03-04 04:39:33 -06:00
Zack Middleton
6ae59a4186 Fix macOS app bundle with space in name 2018-03-04 04:23:42 -06:00
Zack Middleton
7fda468f5b Change renderer prefix, fix app bundle 2018-03-04 04:14:29 -06:00
Zack Middleton
3521787c14 Merge branch 'misc/lilium_common' into game/eliteforce
Conflicts:
	README.md
	code/client/cl_main.c
	code/qcommon/common.c
	code/qcommon/q_shared.h
	code/sys/sys_unix.c
2018-03-04 04:04:35 -06:00
Zack Middleton
4c31c90f6c Add lily icon for macOS and edit app bundle 2018-03-04 03:53:09 -06:00
Zack Middleton
95c3deaa0c Unify com_homepath and use XDG_DATA_HOME 2018-03-04 03:25:13 -06:00
Zack Middleton
cb7ccbacac Allow changing the renderer file name prefix
This makes it easier for forks to coexist without having issues with
incompatible renderers.
2018-03-04 03:17:31 -06:00
Zack Middleton
b9a643264d Change version to 1.39, update README 2018-03-04 01:52:27 -06:00
Zack Middleton
15a82def3b Fix server not being added to Raven master list
Raven master requires protocol in statusResponse. q3master and dpmaster
use protocol in infoResponse.
2018-03-04 00:39:38 -06:00
Zack Middleton
30190f45f3 Remove duplicate set netchan compat
Left over from before legacy protocol support was moved from iostvef
into ioquake3.
2018-03-04 00:32:06 -06:00
Zack Middleton
060610f671 Merge branch 'misc/lilium_common' into game/eliteforce 2018-03-03 23:21:51 -06:00
Zack Middleton
2c99e8f1d1 Update make-linux-portable.sh to current version in Spearmint 2018-03-03 23:21:15 -06:00
Zack Middleton
98272de2ea Update README for adding libmad source to local tree 2018-03-03 23:01:54 -06:00
Zack Middleton
c0c4385122 Merge branch 'codec/mp3' into game/eliteforce 2018-03-03 22:58:53 -06:00
Zack Middleton
0704abe5ec Add libmad source to internal source tree
Modified to fit into Quake 3 build system and use q_platform.h instead of
configure.
2018-03-03 22:47:09 -06:00
Zack Middleton
3d85ba00b1 Merge branch 'master' into codec/mp3
Conflicts:
	Makefile
2018-03-03 22:44:15 -06:00
Zack Middleton
b9131e5980 Add note about MP3 to Elite Force README 2018-03-03 19:28:37 -06:00
Zack Middleton
d2ee25c8e9 eliteforce: Revert "[qcommon] Remove dead serialization code"
This reverts commit d047210aca.
2018-03-03 19:28:29 -06:00
Zack Middleton
e45538b1c5 Merge branch 'master' into game/eliteforce
Conflicts:
	README.md
	code/server/sv_client.c
2018-03-03 19:27:28 -06:00
Zack Middleton
0d6edd227a Support Unicode characters greater than 0xFF in cl_consoleKeys
Unrelated: make '0x' value be -1 (invalid) instead of 0.

Reported by MAN-AT-ARMS.
2018-02-22 18:15:53 -06:00
Zack Middleton
00c3480938 OpenGL2: Fix crash when BSP has deluxe maps and vertex lit surfaces
Reported by Mickaël Thomas (mickael9).
2018-02-18 13:05:27 -06:00
Zack Middleton
d1f82ed567 Increase q3_ui .arena filename list buffer size to 4096 bytes
Allow listing about 273 .arena filenames for loading in q3_ui instead
of only about 136 that fit in a 2048 byte buffer (average 15 bytes per
file name).

The buffer for filename list runs out of space long before the buffer
for arena file content does. There is no warning for file list out of
space but there is a warning for arena file content.

This was requested by a user with many maps.
2018-02-11 15:54:05 -06:00
Zack Middleton
d4e7d987a3 Fix MAC_OS_X_VERSION_MIN_REQUIRED for macOS 10.10 and later
Manually specifying MACOSX_VERSION_MIN=10.10 or later would use the
wrong value for MAC_OS_X_VERSION_MIN_REQUIRED define. 1100 instead of
101000.
2018-02-08 10:23:44 -06:00
Thomas Köppe
3f29b8558d [qcommon] Make several zone variables and functions static. 2018-02-07 09:13:27 -06:00
Thomas Köppe
d047210aca [qcommon] Remove dead serialization code 2018-02-05 10:37:46 -06:00
Zack Middleton
71a9a5efa6 Make FS_InvalidGameDir() consider subdirectories invalid
fs_game shouldn't be a subdirectory and it simplifies the code.
2018-02-04 20:34:48 -06:00
Zack Middleton
3d6aa05694 OpenGL2: Fix dark lightmap on shader in mpteam6
Team Arena's mpteam6 map has a shader textures/base_wall2/space_concrete
that contains an opaque stage, two non-lightmap blendfunc filter stages,
a blendfunc add stage, and a lightmap stage. The lightmap was attached
to all four of the non-lightmap stages causing the filter stages to
darken the lightmap multiple times.

Change setting up the lightall GLSL shader to only use lightmap if it's
the first stage or not a blendfunc filter stage. Now only the opaque
and blendfunc add stages of the mpteam6 shader use the lightmap.

Reported by Alexander Nadeau (wareya).
2018-02-04 14:34:17 -06:00
Zack Middleton
0b6d97f849 Fix negative frag/capturelimit causing an infinite map end loop
Reported by @vloup.
2018-02-04 10:37:39 -06:00
Zack Middleton
fc16ac6bd2 Fix invalid access to cluster 0 in AAS_AreaRouteToGoalArea()
Newer versions of BSPC such as 2.1h included with the Quake 3 GPL source
code create AAS files containing areas in cluster 0 if the area has no
reachabilities.

The AAS files included with Quake 3 and Team Arena do not contain areas
in cluster 0. It's apparent that BSPC would not create them. Instead it
created clusters with no reachability areas.

It seems the intention was to check if the areanum and goalareanum have
reachable areas using AAS_AreaReachability(areanum) everywhere before
calling AAS_AreaRouteToGoalArea(). This prevents adding cluster 0 to
the routing cache and portal cache. However, it is not checked
everywhere and including some places in the Game VM.

Fix AAS_AreaRouteToGoalArea() instead of trying to wack-a-mole with all
the places that call it.

Cluster 0 access reported by Thomas Köppe (github @tkoeppe) as causing
crashes in rare cases.
2018-02-04 09:07:44 -06:00
Zack Middleton
0822772ea2 Fix timelimit causing an infinite map ending loop
A negative timelimit value or a value that would overflow the
multiplication by 60000 caused an endless map change/reload.

Based on patch and description by @vloup.
2018-02-04 09:00:08 -06:00
Zack Middleton
83119a990a Fix Q_vsnprintf for mingw-w64
By default mingw-w64 uses Microsoft's broken _vsnprintf() in msvcrt.dll.
It can be overriden by defining __USE_MINGW_ANSI_STDIO but let's just
use the same behavior for both MSVC and mingw-w64.

Reported by @birdstakes.
2018-02-04 08:04:13 -06:00
Zack Middleton
ad10e6610c Changes to systemd q3a.service
Use an absolute path as required by systemd. Distro packages will need
to change it. (Reported by @andreyv and @zeroxfourc.)
Link to server documentation on the wiki instead of maintaining a subset
in the service file.
2018-02-04 07:51:17 -06:00
Zack Middleton
df8f657f09 Fix exploit to bypass filename restrictions on Windows
Windows API ignores all trailing spaces and periods which can get around
Quake 3 file system restrictions. QVM opening 'uix86.dll.' actually
opens 'uix86.dll' which allows QVM to write native code.

This is done in the low-level Sys_FOpen() instead of the function
directly used by VMs ( FS_FOpenFileByMode() ) in case there are engine
commands now or in the future that can read or write arbitrary files.

Reported by Noah Metzger (Chomenor).
2018-01-30 07:59:25 -06:00
Zack Middleton
acce0e5452 Fix building msvc12 project
* Don't try to embed manifest (it causes build to fail because it's
  specified in win_resource.rc).
* Fix curl include path.
* Compile sys_autoupdater.c.
* Make quake3 debug link to msvcrtd.lib instead of msvcrt.lib to fix
  unresolved external symbol __imp___CrtDbgReportW.
* Fix q3_ui dll output directory.
* Fix opus path filter.
* Use UseOfMfc false and CharacterSet NotSet.
* Fix header paths and remove non-existent files.
2018-01-30 07:40:09 -06:00
Zack Middleton
738465d677 Revert my recent cvar latch changes
My cvar latch system changes prevent the Game VM from changing
g_gametype when the value is out of range due to it being registed in
the engine. It's been pointed out as fragile method of security, which
was still exploitable, by Noah Metzger (Chomenor). It doesn't seem like
this is working out to be a good solution.

The issue of fs_game '..' on server being relicated on client via
systeminfo exploit is still fixed as it's not affected by latch.
There are a few cases from current values of fs_game are used which
ideally should use fs_gamedir char array which has been validated.

Revert "Don't let VMs change engine latch cvars immediately"
Partially revert "Fix fs_game '..' reading outside of home and base path"
Revert "Fix VMs forcing engine latch cvar to update to latched value"
2018-01-21 22:45:46 -06:00
Zack Middleton
ed8d48cac3 Fix VMs forcing engine latch cvar to update to latched value
A few commits ago I stopped VM's Cvar_Set() from instantly updating
latched values. Now VM can't call Cvar_Register() afterword to force
latched value to be used.

Reported by Noah Metzger (Chomenor).
2018-01-21 19:49:16 -06:00
Zack Middleton
3638f69dff Fix fs_game '..' reading outside of home and base path
VMs could set fs_game to '..' at anytime to access files outside of home
and base path. fs_game sent by server to clients could also be '..' to
access files outside of home and base path.

'..' was not caught by FS_CheckDirTraversal() as it expects filenames
not a single directory.

I've made fs_game be latched to prevent VMs from changing it with no
good way to validate it before it's used. com_basegame and fs_basegame
are now latched as well.

Additionally, it's now possible to change com_basegame while the engine
is running. game_restart or vid_restart will make it take affect.
com_homepath is now CVAR_PROTECTED to prevent VMs from changing it
to a directory traversal.

This requires my two previous commits for preventing VMs from changing
engine latch cvars and only Cvar_Get fs_game in FS_Startup (so CVAR_INIT
isn't added in serveral other places).

Reported by Noah Metzger (Chomenor).
2018-01-21 06:02:28 -06:00
Zack Middleton
78ca670d4f Don't let VMs change engine latch cvars immediately
If a VM increases sv_maxclients while a server is running the engine
will crash. The value should be latched until engine decides to update
the cvar; the same as when a user sets it.
2018-01-21 06:02:08 -06:00
Zack Middleton
adef4e6c9e Don't register fs_game cvar everywhere just to get the value 2018-01-21 06:02:08 -06:00
Zack Middleton
3a6af1bc48 Fix VMs being able to change CVAR_PROTECTED cvars
VM could use Cvar_Register to set a protected cvar as user created and
was then able to use Cvar_Register with CVAR_ROM to change the value.

Don't allow Cvar_Register to affect protected cvars and prevent VMs
from adding internal flags to any cvars (creator, modified, protected,
nonexistent).

Reported by Noah Metzger (Chomenor).
2018-01-21 06:02:08 -06:00
Thomas Köppe
917bca4f7d Use standard offsetof facility. Dereferencing a null pointer results
in undefined behaviour.
2018-01-21 06:01:50 -06:00
Thomas Köppe
ed1794fe17 Change shift expressions to unsigned types. Shifting signed values to
a result that is not representable has undefined behaviour.
2018-01-21 06:01:50 -06:00
Zack Middleton
7e2aa2c627 Remove extra plus sign from Huff_Compress()
There was an extra plus sign in Huff_Compress(). It wasn't causing any
issues as it does not affect the generated code. Removing it makes the
source code the same as Huff_Decompress().

The odd source code was brought to my attention by Tobias Kuehnhammer.
2018-01-14 18:38:38 -06:00
Zachary J. Slater
6387c336b6 tiny readme thing 2018-01-07 21:41:55 -10:00
Zack Middleton
22fcd82965 Make FS_BuildOSPath for botlib.log consistent with typical usage
I don't think anywhere else uses "" to mean current game directory.
Though it's only an issue for my fork where I removed that behavior.
2017-12-23 17:01:08 -06:00
Eugene C
f3bdd6f022 Don't allow qagame module to create "botlib.log" at ANY filesystem location 2017-12-23 16:41:13 -06:00
Zack Middleton
7166a3cd39 Enable compiler optimization on all macOS architectures
It seems to improve framerate and still work on x86 and x86_64. I
haven't tested ppc64 as I don't have the hardware. ppc64 isn't built
into the universal bundle either.

I noticed this because compiling opus warns it may be slow due to
optimization being disabled.
2017-12-16 12:51:56 -06:00