Commit Graph

2848 Commits

Author SHA1 Message Date
Zack Middleton acef71af5e Rename (already updated) opusfile-0.8 to opusfile-0.9 2018-03-16 13:29:20 -05:00
Zack Middleton 58a315fe3f Update opusfile from 0.8 to 0.9 2018-03-16 13:29:20 -05:00
Zack Middleton 8611eb421d Rename (already updated) opus-1.1.4 to opus-1.2.1 2018-03-16 13:29:19 -05:00
Zack Middleton cb24c59567 Update opus from 1.1.4 to 1.2.1 2018-03-16 13:29:19 -05:00
Zack Middleton c38c823a2a Rename (already updated) libvorbis-1.3.5 to libvorbis-1.3.6 2018-03-16 13:29:19 -05:00
Zack Middleton b78c6e61bf Update libvorbis from 1.3.5 to 1.3.6
* Fix CVE-2018-5146 - out-of-bounds write on codebook decoding.
* Fix CVE-2017-14632 - free() on unitialized data
* Fix CVE-2017-14633 - out-of-bounds read
2018-03-16 13:29:02 -05:00
Zack Middleton ebd3d516ac Rename (already updated) libogg-1.3.2 to libogg-1.3.3 2018-03-16 13:11:27 -05:00
Zack Middleton 2e7900c1aa Update libogg from 1.3.2 to 1.3.3 2018-03-16 13:11:27 -05:00
Tom Murphy af6b1f8edf Remove CON_FlushIn function and where STDIN needs flushing, use tcflush POSIX function 2018-03-14 21:43:56 +00:00
Zack Middleton b48d902672 OpenGL1: Use glGenTextures instead of hardcoded values
It's the proper way to use the OpenGL API. It's already done in the
OpenGL2 renderer.
2018-03-13 09:17:23 -05: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
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 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 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
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
David CARLIER c904f6d4aa fix a few potential buffer overwrite in Game VM 2017-12-16 12:51:34 -06:00
David CARLIER 76ec9fb6bd Few LCC memory fixes. 2017-12-15 18:08:23 -06:00
Zack Middleton 7c2dd01873 OpenGL2: Restore adding fixed ambient light when HDR is enabled
Use opengl1 renderer behavior of adding fixed amount of ambient light
to all models regardless of HDR setting. It fixes the view weapon
having zero ambient light on pillcity map.
2017-12-15 17:46:51 -06:00
Zack Middleton bad8c3ba4e Fix GCC 6 misleading-indentation warning 2017-12-03 05:51:40 -06:00
Zack Middleton 424e1ac7b1 Fix invalid model frame developer warnings in Team Arena
Models for Team Arena's holdable medkit and invulnerability effects use
the frames numbers from the player's torso but the actual models only
have one frame (0).
2017-11-22 20:21:02 -06:00
Zack Middleton d40b047f13 Correct spelling of two more words
Thanks Undeference for pointing out abreviations.
2017-11-22 20:17:21 -06:00
Edward Betts fe42b8653d Correct spelling mistakes. 2017-11-22 01:40:20 -06:00
Zack Middleton 3e1599ac4b Fix my previous commit about -1 ammo 2017-11-10 21:09:23 -06:00
Zack Middleton 4af2c91fbf Fix -1 (unlimited) ammo decreasing ammo time remaining
Gauntlet and Grappling Hook use -1 ammo. Gauntlet is excluded from
the check ammo loop but Grappling Hook causes ammo time remaining
to decrease 200 milliseconds.

The out of ammo check tests time remaining is equal to zero. This
means carrying Grappling Hook and out of ammo will have negative
time remaining which results in the low ammo message being displayed
instead of out of ammo.
2017-11-10 20:33:07 -06:00
Zack Middleton 471ea9e564 Fix Team Arena server refresh time format
Make minute less than 10 have a leading 0. Change '7:1' to '7:01'.
2017-11-10 20:06:04 -06:00
Zack Middleton e8450cae33 OpenGL2: Use ri.Error instead of Com_Error in tr_vbo.c
Com_Error is a wrapper for ri.Error. Use it directly.
2017-11-05 20:58:57 -06:00
Zack Middleton 690c5a4dac Don't send team overlay info to bots 2017-10-09 02:34:22 -05:00
Zack Middleton b4a4fe98d4 Fix reading crash log when log wraps around buffer 2017-10-08 07:19:07 -05:00
Zack Middleton 9e502bda4d Only draw cm_patch/bot debug polygons in world scenes
Fixes debug polygons appearing in HUD head model scene.
2017-10-08 07:18:40 -05:00
Zack Middleton e46e9846fc Fix memory leak in (unused) AAS_FloodAreas() 2017-10-07 08:02:24 -05:00
Zack Middleton 815c898bf5 Don't redefine MAX_PATH in bot code 2017-10-04 22:13:50 -05:00
Thomas Köppe 39b0702550 [botlib/be_aas_def.h] Change array size from MAX_PATH to MAX_QPATH
The array is part of a structure and should have a fixed size that does
not depend on inclusion order.
2017-10-04 21:41:41 -05:00
Zack Middleton d824cfa5a2 OpenGL2: Fix MD3 surface with zero shaders dividing by zero
Reported by @DescX.
2017-10-04 21:00:04 -05:00
Zack Middleton ac4802af8d OpenGL2: Fix brightness when r_autoExposure is disabled
The game world is too dark when r_autoExposure is disabled. It can be
fixed by setting (cheat) r_cameraExposure to 1 but then the game is
too bright when r_autoExposure is enabled. So default r_cameraExposure
to 1 and make auto exposure subtract 1 from r_cameraExposure value.
2017-10-02 20:46:36 -05:00
Thomas Köppe b3223dcfcb [qcommon] Use unsigned types where wrapping arithmetic is intended
The use of signed types in these expressions lead to overflow, hence undefined behaviour. The "sum" aggregator in Com_TouchMemory isn't even used (and presumbably just exists to inhibit optimizations from removing the memory access).
2017-10-02 19:46:37 -05:00
Zack Middleton a83ae01d93 Load OpenGL ES 1.1 function procs 2017-10-02 04:48:07 -05:00
Zack Middleton da07a6dbd9 Support parsing OpenGL ES version strings
The renderers don't support OpenGL ES though.
2017-10-01 23:09:20 -05:00
Zack Middleton c9d12aa3f3 Add common OpenGL version parsing + OpenGL 3 fixes
- Parse OpenGL version in sdl_glimp.c to share with both renderers.
- Add GL_VERSION_ATLEAST(major, minor) macro.
- Get address of glGetStringi if using OpenGL 3.
- Fix glConfig.extensions_string when using GL3 core context in
opengl2 renderer.
- Make opengl1 renderer's gfxinfo support qglGetStringi too.
2017-10-01 23:09:20 -05:00
Zack Middleton 20573bce43 Don't link to libGL at compile time
Get all OpenGL functions using SDL_GL_GetProcAddress(). This makes it
easier to cross-arch compile on Linux and add support for OpenGL ES
in the future.

Users still have to supply their own libSDL2 for cross-arch compiling
on Linux. But now the user does not have to re-install libgl1-mesa-dev
package for i386 or amd64 on Debian when switching between compiling
ioquake3 for x86 and x86_64.
2017-10-01 23:07:33 -05:00
Zack Middleton 51e9aa2df0 Fix hit accuracy stats for lightning gun and shotgun kills
If a lightning bolt killed a player or the first shotgun pellet that
hit a player killed them, the shot was not counted as accurate.

Check if shot player is alive for hit accuracy before dealing damage.
2017-09-29 18:54:57 -05:00
Zack Middleton 45de6be4c2 Fix listen server sending snapshots each client frame
Running a server using the client engine would send server snapshots
to loopback and LAN clients each client frame (com_maxfps).

This causes excessive network traffic and likely does not provide new
information to the clients because SV_Frame() won't have run between
the extra snapshots.

This commit restores the original behavior of respecting local/LAN
client's snaps userinfo and sv_fps. The issue was introduced by the
following commit:

    Commit ac30d86db0
    From: Thilo Schulz
    Date: Wed, 13 Jul 2011 17:11:30 +0000
    Subject: - Improve snapshot rate and data rate control

Reported by Eugene C.
2017-09-15 19:31:00 -05:00
Zack Middleton 11b3bca555 Update UI player animation handling to match CGame
Fix "Error parsing animation file" messages in UI. Caused by fixing the
handling of missing tokens in animation.cfg parser in a past commit.
Fix new Team Arena torso animation frame numbers in UI.
Add support for fixedtorso and fixedlegs keywords.
Add support for reversed animations (negative numframes).
2017-09-10 20:20:30 -05:00
Zack Middleton 098d97bdb0 Fix in_nograb not releasing the mouse cursor
Disable SDL relative mouse mode when in_nograb is enabled. Relative
mouse mode hides the cursor and it cannot exit the window regardless
of the window's grab state.

This wasn't always the case. SDL before 2.0.4 on GNU/Linux released
the mouse cursor in relative mode. However, SDL 2.0.3/4 on Windows
does not. (I did not test other Windows versions.) So I think SDL
2.0.4 made GNU/Linux X11 behavior consistent with other platforms.

This fixes mouse input being unusable when debuging client crashes
in gdb.
2017-09-10 19:11:36 -05:00
Zack Middleton a48dcdf224 Fix crash when out of memory in Team Arena's String_Alloc 2017-09-10 19:11:35 -05:00
Zack Middleton dcf5707493 Don't reload arenas.txt/*.arena files in Team Arena UI
Entering Team Arena's start server or in-game callvote menu causes
arenas to be reloaded. The existing memory is not freed so after
a entering the menus a few times the UI runs out of memory and
crashes.

Just load arenas once when the UI loads like in q3_ui.
2017-09-10 19:11:35 -05:00
Eugene Molotov e0a367451f ignore window resize event on fullscreen 2017-09-10 14:31:51 +05:00
Zack Middleton 5f743bdb22 Disable DPI scaling on Windows
Windows DPI scaling prevents using full monitor resolution in
fullscreen mode.
2017-09-07 21:17:44 -05:00
Zack Middleton aeaecb4ae5 Add Windows application manifest
- Use common controls 6 so error dialogs use correct visuals on
Windows XP or later!
- Specify running as invoker so Windows doesn't guess if it should
prompt for admin permission on Vista or later.
- Specify compatible with Vista through Windows 10. Tells Windows
not to emulate Vista behavior, not sure if it affects anything.

Makefile automatically runs windres when manifest changes.
2017-09-07 21:04:52 -05:00
Zack Middleton 6f0736ce9a Fix loading renderer DLLs on Windows x86
After 'Fix floating point precision loss in renderer', Windows x86
client won't load the renderer DLLs. The problem is a 64 bit modulus.
I couldn't find any reports of this online. However, client with
built-in renderer worked with the 64 bit modulus.

Only tested with mingw-w64.
2017-09-07 20:42:31 -05:00
Zack Middleton c2ce1c2f51 Make client for Windows x86_64 use OpenAL64.dll by default
ioquake3.x86_64.exe can't load x86 OpenAL32.dll. Using separate
library names allows shipping OpenAL for both architectures.

Though since the dll name is saved in the config file, using both
clients on the same computer will cause one client arch to always
try to load the wrong OpenAL dll and then fallback to the correct
default OpenAL dll. I guess it could be fixed by using separate
cvar names for s_alDriver.
2017-09-04 20:34:55 -05:00
Zack Middleton 8192f66b39 Don't draw crosshair 0 in Team Arena setup menu
Don't draw crosshair 0 in Team Arena setup menu. It isn't drawn
in CGame. Wrap cg_drawCrosshair in missionpack menu like CGame
instead of treating as index 0 which is no longer drawn.
2017-09-02 18:19:08 -05:00
Zack Middleton e152761c28 Fix team chat box for spectators
Make spectators use green background for team chat box when following
players. The team chat messages are from spectators not the team of
the followed player.

Make spectators draw team chat box even when not following a player.
2017-09-02 17:57:26 -05:00
Zack Middleton 5d88c6fdee Limit ui_smallFont/ui_bigFont/cg_noTaunt cvars to missionpack
ui_smallFont and ui_bigFont are for missionpack HUD font size
selection. cg_noTaunt disables missionpack taunt voice chats.
2017-09-02 17:40:16 -05:00
Zack Middleton 2c22ead078 Make map names in q3_ui map select menu be uppercase
Makes map names match on both pages of start server menu.
2017-09-02 17:35:19 -05:00
Zack Middleton f4d68590c2 Fix going to previous browser source in q3_ui
It wasn't possible to go to previous source from favorites if
sv_master5 cvar wasn't set.
2017-09-02 17:31:04 -05:00
Zack Middleton c3e64d3806 Make bots only use q3tourney6 crusher to kill their enemy
Only use the crusher for killing the bot's enemy. This doesn't
affect 1v1 very much but prevents the whole team of bots in CTF
from suddenly shooting at the crusher button. Entering the crusher
bounds was basically instant death.
2017-08-28 21:46:58 -05:00
Zack Middleton ad1d0e616e Make bots use crusher on other q3tourney6 maps
Make bots activate crusher on q3tourney6_ctf and mpq3tourney6.

Check if player is inside the crush bounds instead of below the
crusher. There is a jumppad the goes under it in mpq3tourney6.
2017-08-28 21:46:57 -05:00
Zack Middleton 63e07afae9 Make input events use earliest possible time
SDL doesn't provide exact the exact time that input events happen
so use the earliest possible time that an event could happen.

This make sub-frame input actions such as walking take affect
immediately instead of in the next frame.

Based on patch by Alexander "wareya" Nadeau.
2017-08-21 22:43:33 -05:00
Zack Middleton 5993c63c4e Removing input functions from sys_local.h for last commit
It helps to actually save files before making commits.
2017-08-21 22:27:09 -05:00
Zack Middleton ead54782d0 Improve client input responsiveness
Move sampling input to the other side of framerate limiter.

Thanks to Alexander "wareya" Nadeau and Juraj "youurayy" Vitko for
pointing this out.
2017-08-21 21:40:54 -05:00
Zack Middleton 34d0b78754 Improve keys using international key layouts
Always map number row to number keys for AZERTY.
Map Unicode character keys to world keys using scan code.

Based on patches by @mickael9.
2017-08-21 20:21:18 -05:00
Zack Middleton be1c71d363 Combine mouse movement events in event queue
Fixes 'Com_QueueEvent: overflow' spam after hitch / map load.

Based on patch by @ec-.
2017-08-21 20:12:26 -05:00
Zack Middleton e793c0c37c Fix crash when pmove_msec is 0
When pmove_fixed is set to 1, setting pmove_msec to 0 would crash.
2017-08-19 01:42:38 -05:00
Mickaël Thomas bae86208f9 Only allow safe protocols for cURL downloads
A malicious server could abuse dangerous protocols such as gopher:// to,
for instance, send mail via SMTP.
2017-08-15 21:47:27 -05:00
Zack Middleton 9736e7ff91 Fix compiling Cmd_CallTeamVote_f 2017-08-09 19:19:59 -05:00
Zack Middleton 3f267728c3 Remove newlines from chat messages in Game VM
This has no affect due to ioquake3 engine already removing command
separators (which includes newlines) in Cmd_Args_Sanitize().
2017-08-09 18:41:26 -05:00
Zack Middleton f0b74a27c9 Check for all command separators in callTeamVote
Make callTeamVote check for all command separators like in callVote.
It's not exploitable as the only vote option (leader) always uses an
integer argument.

Also the ioquake3 engine remove command separators from client game
commands in Cmd_Args_Sanitize().
2017-08-09 18:37:18 -05:00
Zack Middleton 0bce5463f7 Add spawnflags to QUAKED for trigger_multiple 2017-08-09 17:47:33 -05:00
SmileTheory 9d1c6748f5 OpenGL2: Force VAO usage on OpenGL 3.0+ 2017-08-08 20:20:11 -07:00
SmileTheory 3f415abe61 OpenGL2: Use extension functions with OpenGL versions before 3.0. 2017-08-07 18:00:00 -07:00
SmileTheory 2955f8dadb Reject OpenGL contexts w/ software renderer when core context requested. 2017-08-03 14:20:33 -07:00
Zack Middleton 59b1262b82 Fix floating point precision loss in renderer [part 2]
Fix floatTime using float precision instead of double using GCC.
Fix R_BindAnimatedImage to be in sync with function table.
Fix vertexDeform bulge, vertexDeform normals, noise wave function
at high level time.

Revert unnecessary float -> double conversions.
2017-08-03 00:14:22 -05:00
Zack Middleton 30fdd88c9f Fix floating point precision loss in renderer [part 1]
Patch for https://bugzilla.icculus.org/show_bug.cgi?id=5931 by
Eugene C. from 2013 plus recent fix for tcMod rotate.

I merged the changes into the OpenGL2 renderer though the fix for
tcMod turb doesn't translate.
2017-08-02 23:44:44 -05:00
Tobias Kuehnhammer 9c4c363ccc Fix friction in AAS_ClientMovementPrediction
Ground and water friction were reversed.
2017-08-02 15:05:46 -05:00
Zack Middleton d2b1d124d4 Fix/improve buffer overflow in MSG_ReadBits/MSG_WriteBits
Prevent reading past end of message in MSG_ReadBits. If read past
end of msg->data buffer (16348 bytes) the engine could SEGFAULT.
Make MSG_WriteBits use an exact buffer overflow check instead of
possibly failing with a few bytes left.
2017-08-02 14:55:22 -05:00
Zack Middleton 2d6171f44c Remove CVAR_PROTECTED from cl_renderer
Setting cl_renderer isn't a security concern and valid behavior for
a menu to provide. Sys_LoadDLL ensures only libries are loaded and
engine prevents QVMs from writing them.
2017-08-02 14:50:22 -05:00
Zack Middleton c05fbe554e Make warmup in Team Deathmatch wait for players to join both teams
Reported by Cyrax.
2017-07-31 15:24:15 -05:00
Zack Middleton e62941396d Remove unused imgFlag_t value IMGFLAG_SRGB 2017-07-30 15:39:32 -05:00
Zack Middleton 39716745f9 Silence g_util.c warning about set but not read variable
Probably caused by my commit on June 2 2017.

  commit 4006358492
  Fix spawn/freed entity logic (specifically harvester skulls)
2017-07-28 17:36:20 -05:00
MAN-AT-ARMS e07ffa715c Update internal curl to 7.54.0 2017-07-28 16:32:22 +01:00
Zack Middleton 6693465336 Don't try to remove non-existant command 'shaderstate'
Remove commands in the order they are added because the different
orders is annoying.
2017-07-27 18:58:46 -05:00
Zack Middleton fa034c17ec Echo server say/tell/sayto message to console 2017-07-24 20:55:14 -05:00
SmileTheory 356ae10ef6 OpenGL2: Don't use initialized arrays in glsl shaders.
Unsupported in GLSL 1.20 (Mac OS X 10.6)
2017-07-24 16:29:04 -07:00
Zack Middleton 9f239d647b Make 'globalservers 0' fetch all masters
This commit fixes the vanilla Q3 UI VMs not displaying a server list
when id Software's master server is down.

Originally master 0 for the globalservers command was Internet and
master 1 was MPlayer (defunct). In 2008 ioquake3 changed it so that
master 0 to 4 were five separate master servers with no affect on
original Quake3/Team Arena UI VMs; they continued to get the server
list from master.quake3arena.com.

id Software's master server (master.quake3arena.com) goes down
occasionally. Using ioq3's UI VM additional master servers can be
accessed but players using the original UI VMs are unable to get a
server list.

In order to fix the original UI VMs in Quake3/Team Arena's pk3s this
commit makes 'globalservers 0' fetch all master servers. So players
get a combined list of id Software's and ioquake3's master list. Or
just ioquake3's list if id Software's master is down.

Getting lists from individual master servers using globalservers has
changed from 0 through 4 to 1 through 5 to accommodate using 0 for
other purposes. This commit modifies ioq3's UI code to support the new
values for globalservers command.

A side affect of these changes is that UI VMs based on ioq3 since 2008
will have Internet1 fetch all master servers and Internet2 request
sv_master1 instead of sv_master2 and so on. It may be worth noting that
getting server list from masters 3-5 could not be done using ioq3's UI
before 2011.
2017-07-20 15:39:51 -05:00
Noah Metzger fa1549d457 Move CON_Init ahead of Com_Init to avoid Windows dedicated server crash 2017-07-15 10:16:13 +01:00
Zack Middleton 5f2e4a03c5 Add score bonus for defending the flag carrier in 1 Flag CTF
Set flag_pw to neutral flag instead of using CTF value for red or
blue flag so that flag carrier is detected correctly.
2017-07-14 19:06:43 -05:00
Zack Middleton 13831f9569 Restore not giving defense score bonus to flag carrier
The Team Arena code for giving defense bonus for fragging player
who recently damaged a skull carrier unintentionally applied to
the flag carrier.

The skull carrier case would of been handled by the flag carrier
block above it. However, Harvest mode doesn't call
Team_CheckHurtCarrier() so the skull carrier defense bonus does
not work.

This restores the pre-Team Arena behavior of not giving defense
score bonus to flag carrier.
2017-07-14 19:06:43 -05:00
Zack Middleton c8db6c55e5 Fix score bonus for defending the flag carrier in CTF
Fix copy-paste error in the original Quake 3 code. The wrong values
are used for v1 and v2. v2 was previously set to distance of attacker
to flag base; which should be handled already.

The game now gives defense score bonus to player when they frag an
enemy near their team's flag carrier while the player is more than
1000 units from the flag carrier.

This may also fix not giving defense bonus when near carrier due to
checking if carrier and enemy (instead of attacker) are in PVS.

Found by @Razish.
2017-07-14 19:06:43 -05:00
SmileTheory 786f6fc525 whoops, left a bit of debugging enabled 2017-07-14 16:26:41 -07:00
SmileTheory 6f1712dafe OpenGL2: "Fix" cg_shadows 4. 2017-07-14 16:15:02 -07:00
SmileTheory 6a77f4e363 OpenGL2: Don't do MSAA resolve/shadow mask/SSAO on shadow views. 2017-07-14 15:42:41 -07:00
SmileTheory a4c09236b1 OpenGL2: Remove GLSL_ValidateProgram().
https://stackoverflow.com/questions/39761456/why-does-glvalidateprogram-fail-when-no-vao-is-bound
2017-07-13 12:10:09 -07:00
SmileTheory d549b642bc OpenGL2: Use an OpenGL 3.2 core context if available. 2017-07-13 12:03:10 -07:00
Zack Middleton 51ca4d35ea Fix misleading-indentation warnings in cl_cin.c 2017-07-09 14:01:41 -05:00
Zack Middleton e78da55a75 Fix more maybe-uninitialized warnings in opusfile 2017-07-09 14:01:41 -05:00
Brenton Bostick a33a904225 Fix warning about using abs() with floats (#222) 2017-07-09 14:00:56 -05:00
Zack Middleton 7c252066a3 Fix set-but-not-used variable warnings in vm_armv7l.c
offsidx and const_value were set but not used.
2017-07-08 16:48:23 -05:00
Zack Middleton dd73e19546 Improve warning for too many skin surfaces 2017-07-04 15:36:26 -05:00
Zack Middleton 904bbc1a8f Allow more than 32 surfaces in skin files
Models don't have a surface limit; skins shouldn't either. Some player
models require more than 32 surfaces since vanilla Quake 3 did not
enforce the limit.

Skins are now limited to 256 surfaces because having no limit would
require parsing the skin file twice. The skin surfaces are dynamically
allocated so it doesn't increase memory usage when less surfaces
are used.
2017-07-04 14:06:09 -05:00
Zack Middleton 4dffc52c1d Add warnings for animMap and videoMap shader keywords 2017-07-02 17:00:07 -05:00
Zack Middleton 5aa7fb39c2 OpenGL2: Remove two unused cvars and update readme 2017-07-02 16:47:55 -05:00
Zack Middleton cbd9e432b5 Fix nonresponsive favorites in q3_ui having no hostname
ArenaServers_InsertFavorites() fails to do anything because favorites
are added to the server list even if nonresponsive.

Set nonresponsive favorite server hostname to address.
2017-07-01 14:26:36 -05:00
Zack Middleton 8c3d1fcf59 Allow changing q3_ui server source during refresh
This makes it easier to scroll through the list, especially since
"Local" source now refreshes until a local server is found.
2017-07-01 14:17:45 -05:00
Zack Middleton 0ba359c29e Make UI continue searching for local servers until found
When refreshing local servers, Team Arean UI never changed the status
message when it timed out. This gave a false impression it was still
looking for servers.

Let's continue looking for local servers in q3_ui and Team Arena UI
until one is found.
2017-07-01 14:17:22 -05:00
Zack Middleton 21eeaee9c8 Make Team Arena UI aspect correct in widescreen 2017-07-01 11:27:42 -05:00
Zack Middleton d9c2e91919 Fix q3_ui cursor going off screen in widescreen 2017-07-01 11:27:22 -05:00
Zack Middleton e77153766a OpenGL2: Draw sun shadows for first person IQM player models
This makes IQM have the same behavior as MD3 and MDR.
2017-06-30 14:07:26 -05:00
Zack Middleton 102c79eb49 OpenGL2: Fix black planar projection shadows (cg_shadows 3)
Restore MD3 code for cg_shadows 2 and 3 like other model formats.
Fix planar projection shadow deform (cg_shadows 3) to use correct
light direction. I fixed light direction for stencil shadows
(cg_shadows 2) but it's still broken.
2017-06-30 14:06:13 -05:00
Zack Middleton 09a23e0417 OpenGL2: Fix checking r_shadowCascadeZFar pointer instead of value 2017-06-29 21:36:04 -05:00
Zack Middleton b984dd4a23 Add range check for bot skill in addbot command
Adding a bot with skill of 0 doesn't show icon on hud.
2017-06-29 19:43:37 -05:00
Zack Middleton cabc32362c Don't pick duplicate random bots until all bot types are added
Don't add the same bot to multiple teams until there are as many
bots on the server as there are bot types.

Previously each team would have unique bots until all bot types
were added to the team but other teams may have the same bot. Now
there will not be any duplicate bots until there are more bots than
bot types.

Now Quake 3 (32 bot types) in 16 vs 16 bot CTF will not contain
duplicate bot types. (You have to increase memory in code/game/
g_mem.c in order to add 32 bots though.)

I had to change G_AddRandomBot() to use 'addbot random' or else the
same bot could be added to red and blue teams. The bot was selected
and stored in console command buffer so game doesn't know not to
select the bot again.
2017-06-29 19:41:17 -05:00
Zack Middleton 0999aff28d Fix duplicate (delayed) random bots being choosen
Count delayed bots when looking for least used bot infos for deciding
which bot to add.
2017-06-29 19:41:17 -05:00
Zack Middleton d8f2ff7a4b Check delayed bot's team when counting bots for bot_minplayers
note: This requires my previous commit that added teampref userinfo
so that bots choose correct team in ClientConnect.
2017-06-29 19:41:17 -05:00
Zack Middleton 7c601da651 Fix not adding random bot when all bot info are in use on team
If there are two bot infos in scripts/bots.txt then each team can
only add two random bots via bot_minplayers or addbot random.

Pick random bot info from least used bot infos instead of only ones
that are used by zero players. That way a random bot can always be
added to the game.

This rarely affected Quake 3 since there is 32 bot infos. It could
easily affect new games though.
2017-06-29 19:41:16 -05:00
Zack Middleton d0d1fe1b7c Fix bot_minplayers passing delay as team to addbot in non-team gametypes 2017-06-29 19:41:16 -05:00
Zack Middleton 51649695a5 Fix random bot not looking for bots by funname
Quake 3's Anarki bot has a 'funname' with colors in it.
This commit fixes Anarki not being detected as in use.
2017-06-29 19:41:16 -05:00
Zack Middleton 23a331c9f8 Make 'addbot random' command select a random bot info
It reuses the random bot selection code for bot_minplayers cvar.
2017-06-29 19:41:16 -05:00
Zack Middleton 007e250e11 Split G_AddRandomBot into multiple functions 2017-06-29 17:52:06 -05:00
Zack Middleton 03336dd0bf Allow spectators to use noclip cheat 2017-06-24 20:27:24 -05:00
Zack Middleton 7b9ccd1463 Have spectator always be in first person
Flying around in third person with no body is weird.
2017-06-24 20:25:39 -05:00
Zack Middleton c2ca5e7856 Check for unlimited time power up using INT_MAX
It is possible for a power up to exceed 999 seconds without it being
unlimited time.
2017-06-24 20:25:39 -05:00
Zack Middleton 520b100449 Make cg_teamChatsOnly only affect team gametypes
Also made it so that 'tell voice chats' are always allowed for
consistancy with 'tell chat'.

Reported by Tobias Kuehnhammer.
2017-06-24 20:25:39 -05:00
Zack Middleton f19efb77c8 Fix Team Arena team base models not dropping to floor
Team Arena's Overload gametype has red and blue team Obelisk base
objects. It uses separate entities for visual and damage. Only the
damageable entity was dropped to floor. Leaving model floating off
the ground.

Team Arena's Harvester base has the same problem. Model entity
floats in air but trigger entity drops to floor.

Drop all Team Arena team base models to floor. Fixes CTF, 1Flag,
Overload, and Harvester base models.
2017-06-24 20:15:02 -05:00
Zack Middleton f7c3276fe8 Fix g_teamAutoJoin and g_teamForceBalance
There are various issues caused by not knowing the initial team for
the local client and bots when they connect. This is can be reproduced
by starting a team game from the main menu.

When g_teamAutoJoin is enabled, bots and local client join a random
team at connect and then execute their team command a few frames
later. This may result in the player being killed if they specify a
different team. In Team Arena's Harvester mode this causes harvester
skulls to be spawned at the beginning of the game.

When g_teamForceBalance is enabled, the local client and bots may not
be able to join their desired team. This may result in them being
spectators. If g_teamAutoJoin is also enabled they may be left on
the opposite (red/blue) team they were meant to join.

There is a hack for including bot's team in their player info string
(used by cgame for which team skin to use) before the bot joins
their desired team. Bots aren't guaranteed to join their desired team
(as may happen when both g_teamAutoJoin and g_teamForceBalance are
enabled) so clients may see them as being on the wrong team!

----

Add teampref userinfo option for team preference. If teampref is set
it will be used for attempting to join the team immediately at connect.

Bots now join team at connect using teampref userinfo. So remove
the hack for setting bot's team in player info string before the bot
joins the team.

To avoid the client sending teampref userinfo to all network servers,
the local client uses a g_localTeamPref cvar. The g_localTeamPref
cvar is cleared after it's used so it doesn't get used when starting
another server later. Another reason not to use a teampref userinfo
cvar is there isn't a reliable way to clear it in CGame/UI which are
likely loaded from baseq3 pk3.

Make it so g_teamAutoJoin doesn't affect clients who specify
teampref. If teampref is invalid, the client will join a random team
like g_teamAutoJoin.

Don't apply g_teamForceBalance to the local client or bots. Otherwise
they may be left as spectators when starting team game from menu.

The start server menus use team command and g_localTeamPref to set
the human player's team. This way it's compatible with vanilla Q3
game VMs and the new setting team at connect feature.
2017-06-22 21:56:20 -05:00
SmileTheory e03cdf444c OpenGL2: Remove SF_VAO_MESH. 2017-06-16 16:52:53 -07:00
Zachary J. Slater fd3b58b967 Merge pull request #293 from rcgordon/autoupdater-rsa-signature 2017-06-10 21:00:51 -10:00
Zack Middleton e9436abff0 Only allow connectionless print/echo from server/rcon address
Reported by Ensiform.
2017-06-10 19:15:26 -05:00
Zack Middleton dfce71929a Add con_autochat and con_autoclear cvars 2017-06-08 15:46:19 -05:00
Zack Middleton c12b81a273 Fix strncpy usage in botlib
All usage of strncpy in botlib should now either set string
terminator or use Q_strncpyz.
2017-06-07 21:48:01 -05:00
Tobias Kuehnhammer 8956ab41dd Fix notarget cheat
Bots no longer target players in 'no target mode'.
2017-06-07 21:27:33 -05:00
Zack Middleton c99281a0da Make bots stop attacking player after disconnect
Bots did not notice player disconnected, so they kept attacking
the last known position.

Checking if entity is valid in BotEntityVisible might fix other
similar issues too.
2017-06-07 21:11:52 -05:00
Zack Middleton 9aae0948ab Remove unused define MAX_COMMANDARGUMENTS from be_ea.c 2017-06-07 21:11:38 -05:00
Zack Middleton 74a59f17c7 Don't copy p->org to itself in cg_particles.c 2017-06-07 21:07:42 -05:00
Zack Middleton 8a6c9d1038 Remove unneeded 'angles' variables/clearing in ai_dmq3.c 2017-06-07 21:06:28 -05:00
Zack Middleton 730b917059 Fix comment in BotAIPredictObstacles 2017-06-07 20:53:35 -05:00
Zack Middleton a738cb9592 Fix overdraw in CG_DrawRect
It was noticeable in the corners when alpha was less than 1.
2017-06-07 20:40:16 -05:00
Zack Middleton 1a8bf792e7 Range check client number for trap_BotUserCommand 2017-06-07 20:38:12 -05:00
Zack Middleton 5b9302a7ef Don't start game entity loops at index 1 2017-06-07 20:32:57 -05:00
Zack Middleton 71512bb1fd Show client's name in callvote clientkick vote display message
Make callvote always kick by client num so player can't rename to
avoid being kicked. Don't allow calling a vote to kick host or
non-existent players.
2017-06-07 20:24:10 -05:00
Zack Middleton eeb28dc1d0 Fix score info being dropped by server
Server drops reliable command string if it's length is more than 1022.
2017-06-07 19:55:36 -05:00
Zack Middleton 91acf8a681 Don't build score info for bots, they don't parse it 2017-06-07 19:54:34 -05:00
Zack Middleton b511b8f2f6 Fix Coverity warning that endVelocity is uninitialized 2017-06-07 19:51:32 -05:00
Zack Middleton c96acec428 Fix (unused) check for map restart in CG_TransitionSnapshot 2017-06-07 19:42:32 -05:00
Zack Middleton 1456008d96 Fix comment for CG_SetInitialSnapshot 2017-06-07 19:41:46 -05:00
Zack Middleton 1048073e26 Unify checks for missing COM_Parse() token 2017-06-07 19:16:05 -05:00
Zack Middleton d58234a6c7 Fix 'missing token' in parsers for animations.cfg 2017-06-07 19:06:41 -05:00
Zack Middleton 6e340f9a5b Don't use uninitialized ps from BotAI_GetClientState
If BotAI_GetPlayerState returns qfalse, ps is untouched and in
some cases means uninitialized. So don't use it if not valid.
2017-06-07 19:02:20 -05:00
Zack Middleton 74aa4268b2 Stop caching sv_maxclients in bot code 2017-06-07 19:00:28 -05:00
Zack Middleton d1631d6ea3 Use const char pointers when possible in botlib's libvar code 2017-06-07 18:54:49 -05:00
Ryan C. Gordon b771192d52 Use "x86_64" and not "x86-64" like everything else in ioq3. 2017-06-04 02:46:49 -04:00
Ryan C. Gordon 749e17ab1d Add a log message if manifest is valid. 2017-06-04 02:23:49 -04:00
Ryan C. Gordon a761684a23 Windows support for autoupdater manifest signatures. 2017-06-04 02:21:55 -04:00
Ryan C. Gordon c9c5d8710a Added .gitignore for rsa_tools directory. 2017-06-04 01:49:33 -04:00
Ryan C. Gordon 06cc3a4e1b build-rsa-tools.sh now works on Linux. 2017-06-04 01:44:39 -04:00
Ryan C. Gordon e04bfd4967 Autoupdater now checks RSA digital signature for manifest. 2017-06-04 01:32:10 -04:00
Ryan C. Gordon f71260eb8c Replace sha256.c with libTomCrypt equivalent, since we'll be using it anyway. 2017-06-04 01:17:17 -04:00
Ryan C. Gordon 62f6f0c7e0 Wire up libTom stuff to build system. 2017-06-04 01:16:37 -04:00
Ryan C. Gordon 7542966e33 Verify libTom source archives aren't tampered with. 2017-06-04 01:15:38 -04:00
Ryan C. Gordon ece37f1390 Initial add of rsa_tools.
This is just a simple RSA public key digital signature thing built on
libtomcrypt. The gist:

Some admin will generate a public/private key with rsa_make_keys, keeping the
private key secret. Using the private key and rsa_sign, the admin will sign
the autoupdater manifests, generating manifest.txt.sig.

The public key ships with the game (adding 270 bytes to the download), the
.sig is downloaded with the manifest by the autoupdater (256 bytes extra
download), then the autoupdater checks the manifest against the signature
with the public key. if the signature isn't valid (the manifest was tampered
with or corrupt), the autoupdater refuses to continue.

If the manifest is to be trusted, it lists sha256 checksums for every file to
download, so there's no need to sign every file; if they can't tamper with the
manifest, they can't tamper with any other file to be updated since the file's
listed sha256 won't match.

If the private key is compromised, we generate new keys and ship new
installers, so new installations will be able to update but existing ones
will need to do a new install to keep getting updates. Don't let the private
key get compromised. The private key doesn't go on a public server. Maybe it
doesn't even live on the admin's laptop hard drive.

If the download server is compromised and serving malware, the autoupdater
will reject it outright if they haven't compromised the private key, generated
a new manifest, and signed it with the private key.

libtomcrypt is sort of a big pile of source code, so instead of putting it
in revision control, we have a script to download it. Most things don't need
it. It lives on GitHub, so we _could_ do a git submodule, but most people
don't need it, so why waste their disk and bandwidth? That said, when compiled
you end up with a few hundred kilobytes of binary code to verify a signature
and no external dependencies, so it seems like a win.
2017-06-03 20:26:07 -04:00
Zack Middleton db1198f6ea Add mouse wheel support to UI list boxes
Allows scrolling server browser list and some other lists.
2017-06-03 14:03:09 -05:00
Zack Middleton 5592342b1b Only auto update empty Team Arena internet server cache
Previously tested a mod cvar which may be wrong when multiple
mods are involved or config is reset. Let's check the server
cache's internet server count directly.
2017-06-03 14:03:09 -05:00
Zack Middleton 66fec1b059 Remove unneeded code from OpenGL2's RB_RenderDrawSurfList
Make it more similar to OpenGL1.
2017-06-03 14:03:09 -05:00
Ryan C. Gordon 1aa20487a4 autoupdater: Fixed up GCC/clang printf function attribute. 2017-06-03 12:02:29 -04:00
Zachary J. Slater 87eecd7bc1 Merge pull request #290 from rcgordon/autoupdater
Initial shot at writing an ioquake3 autoupdater. Thank you icculus, and everyone who contributed to his patreon! https://www.patreon.com/icculus
2017-06-02 22:46:22 -10:00
Zack Middleton c14cb70f15 Draw disconnect icon over lagometer in Team Arena too
The blinking disconnect icon is drawn over lagometer in Q3.
Team Arena moved the lagometer location. Now let's draw the
disconnect icon over lagometer in Team Arena too!
2017-06-02 22:11:52 -05:00
Zack Middleton 082376ed9e Enable tourney scoreboard in Team Arena
"/team score" draws an oversized scoreboard in Q3. In Team Arena
it draws nothing. They probably intended to replace it with the
new .menu UI. But since it didn't happen, go ahead and use the Q3
tournament scoreboard.
2017-06-02 22:11:52 -05:00
Zack Middleton 1066214548 Fix "brought in 1 skulls" Harvester message
Use correct singular/plural form of skulls for Harvester's brought in
skulls message.

Reported by Tobias.
2017-06-02 22:11:52 -05:00
Zack Middleton 4006358492 Fix spawn/freed entity logic (specifically harvester skulls)
- Actually use the second 'force' pass in G_Spawn when out of
available slots.
- Make G_EntitiesFree return qtrue if we can open a new slot.
(Only used when spawning Harvester skulls.)

Fixes not spawning Harvester skulls when there are no 'open freed
slots', but we have other slots available to open.
2017-06-02 22:11:52 -05:00
Zack Middleton 4227d97958 Make Team Arena win logic handle more game types/blue team
The Team Arena menu uses red team for single player but q3_ui
(and mods could) use blue. Also handle all the game types, not
just the ones used by Team Arena. Fixes FFA and Team DM.
2017-06-02 22:07:27 -05:00
Zack Middleton 4506ebd5d7 Fix joining team when starting local team play server
AKA fix joining team in Team Arena single player. Though it also
affects starting Q3 skirmish in team dm or ctf modes.
2017-06-02 21:07:30 -05:00
Ryan C. Gordon b33551dfa2 Fixed comment typo: s/until/under 2017-06-02 11:28:33 -04:00
Ryan C. Gordon 063875e89a Fixed linking on things that need -ldl, and compiler warnings. 2017-06-02 01:39:03 -04:00
Ryan C. Gordon cd4aa2d9a9 Don't fail if the game process went away before we were ready to wait for it. 2017-06-02 01:32:33 -04:00
Ryan C. Gordon b5c54ec019 Use stdint.h on Visual C if >= Visual Studio 2010. 2017-06-02 01:31:45 -04:00
Ryan C. Gordon 82977da9c8 Working Windows port of the autoupdater! 2017-06-02 00:49:42 -04:00
Zack Middleton bd067540f5 Fix hitch when opening Team Arena find friend menu
Opening the find friend menu in the Team Arena server browser
hitches due to trying to resolve blank host names.

In UI_BuildFindPlayerList() status requests that are initial or
completed state or have timed out get reset. This means it starts
with MAX_SERVERSTATUSREQUESTS (16) blank host names. So just ignore
them in UI_GetServerStatusInfo().
2017-06-01 18:54:28 -05:00
Zack Middleton 0a19ae0306 Fix levelshot displayed in Team Arena server browser
Levelshot was not updated when server list was initially loaded or
server list was sorted.
2017-06-01 18:03:24 -05:00
Zack Middleton 2091a2e2d5 Fix favorite servers player count message in Team Arena UI
The console message "1 servers listed in browser with 2 players."
would count clients multiple times when viewing favorite servers.

When viewing favorite servers in Team Arena UI, servers are added
to list before getting ping response. Each time UI checked pings
and inserted server it incremented the player count.
2017-06-01 17:24:07 -05:00
Zack Middleton 6b5674e6bb Fix filtering favorite servers in Team Arena UI
Filter favorite servers based on cached server info and new info
instead of only the cached info.

If cached server info is filtered out, don't add it to server list
but wait for getinfo response before marking server as invisible.
2017-06-01 17:24:07 -05:00
Zack Middleton 0b853a659a Make Team Arena server list sub-sort clients by max clients
The player column in Team Arena UI lists clients and max clients
in format of "clients [maxclients]". When sorting by clients the
max clients is ignored which results in player column being
disorganized.

When servers have the same number of clients, sort based on max
clients. Otherwise client sort is sub-sorted based on order of
getinfo responses (ping).
2017-06-01 17:24:06 -05:00
Zack Middleton 2bbe178bc8 Replace constant value with UIAS_GLOBAL1 2017-06-01 17:24:06 -05:00
Zack Middleton e8f092637c Automatically get initial Internet servers in Team Arena UI
Having to manually request the list, with two buttons (get new
list, refresh list) is somewhat confusing. Also since it looks
like there are no servers, users might not try to figure out
how to get the server list.

The first time viewing a master server list in Team Arena UI,
automatically request a new server list. After that the cache
will be available with a timestamp of the last refresh time.
I think this will make it easier to understand how the menu
works.

This may cause unneeded updating of the server cache because the
last refresh timestamp is per-fs_game but the server cache is
shared by all games. This will only occur once for each game
though so it's not a big concern.
2017-06-01 17:24:06 -05:00
Zack Middleton f6f2710f94 Make server browser default to Internet
The default use to be local. In q3_ui you have to press spacebar or
wait for scan to time out before you can switch to Internet.
2017-06-01 16:58:21 -05:00
Ryan C. Gordon 8cf088ae27 Fully initialize ManifestItems (rollback, etc, was uninitialized before!). 2017-06-01 17:17:25 -04:00
Ryan C. Gordon b6a83a1494 ioquake3 calls this arch "x86" and not "i386". 2017-06-01 13:02:17 -04:00
Ryan C. Gordon a69020b217 Fixed up some types in sha256.* 2017-05-31 03:39:45 -04:00
Ryan C. Gordon d0da0724e7 Move the autoupdater launcher into its own public domain source file.
So other games can steal this piece if they want.
2017-05-31 01:22:40 -04:00
Ryan C. Gordon cf5dd87f57 Fix tabs vs spaces. 2017-05-31 01:04:17 -04:00
Ryan C. Gordon 02b116aae0 Initial Windows autoupdater support: the ioq3 internal bits.
This is just the piece that will launch the autoupdater; the autoupdater
itself will be a separate commit.
2017-05-31 01:02:26 -04:00
Ryan C. Gordon 67b0cccc75 Don't fclose(NULL) if a file doesn't exist. 2017-05-30 20:20:18 -04:00
Ryan C. Gordon f518f75149 Don't link directly to libcurl.
Lots of Linux distros have different names (libcurl-gnutls.so vs etc), and
version the symbols (curl_global_init@@CURL_LIBSSL_3), so it's more compatible
to just dlsym the basic entry points we need and just demand that libcurl is
installed at all.

Alternately: we'll use our own libcurl build, but we'll probably have to dump
SSL support to make this sane to do.
2017-05-30 20:15:59 -04:00
Zack Middleton 973e0a7e9c Refresh master server address cache every 24 hours
Resolve master server addresses every 24 hours instead of keeping
result forever. Don't clear sv_master[1-5] cvar if the address fails
to resolve; it might work later.
2017-05-30 18:33:15 -05:00
Ryan C. Gordon b892bcfdbc Cleanup in failures a little better. 2017-05-30 18:02:48 -04:00
Ryan C. Gordon 69829916b5 Fixed -Wstrict-prototypes warning. 2017-05-30 17:37:53 -04:00
Zack Middleton 8a50e2aa09 Don't repeat alt+enter key event
Holding alt+enter should not continuously toggle fullscreen mode.
2017-05-29 16:41:03 -05:00
Zack Middleton 024a8842bd Fix compiling debug code for writing VoIP data 2017-05-29 09:54:39 -05:00
Zack Middleton bc2f45508d Fix dllHandle possibly being uninitialized in Sys_LoadDll 2017-05-26 10:50:56 -05:00
Ryan C. Gordon 4729c683fd Initial shot at writing an ioquake3 autoupdater. 2017-05-25 14:13:18 -04:00
Eugene C c259e7cba3 Fix comment 2017-05-25 09:44:18 +01:00
ec- 566fb0edfc Allow unaligned load/store in QVM interpreter/x86 compiler
constructions like (dataMask & ~3) was used to protect against out-of-bound load/store when address is 4-byte closer to dataMask
 but at the same time it effectively cut low address bits for ALL load/store operations which is totally wrong in terms of conformance to ALLOWED (i.e. generated by q3lcc from C sources) low-level operations like packed binary data parsing
2017-05-25 09:44:18 +01:00
Zack Middleton 3b0a862290 Merge pull request #256 from WolfWings/patch-4
...too much MISSIONPACK ifdeffery.
2017-05-24 13:44:35 -05:00
Zack Middleton 80c3e503d9 Merge pull request #254 from WolfWings/patch-1
Redundant #ifndef MISSIONPACK block
2017-05-24 13:44:20 -05:00
Zack Middleton 2c225a5a2b Merge pull request #199 from UniQP/typos
Fix some typos in comments
2017-05-24 13:41:15 -05:00
Zack Middleton 66365a3a85 Merge pull request #198 from UniQP/deadvariable
Remove dead variables
2017-05-24 13:40:53 -05:00
Zack Middleton eecc8326a0 Save connect and playdemo argument before calling CL_Disconnect()
Save argument instead of using a pointer to cmd token memory that
might be overwritten when Cmd_TokenizeString() is called.

No known method for causing the issue without engine changes.
Cmd_TokenizeString() is called by FS_PureServerSetReferencedPaks()
in CL_Disconnect() but it's not an issue because the string is
blank.

Thanks @mickael9.
2017-05-24 12:46:25 -05:00
Zack Middleton 351e8f84d2 Merge pull request #270 from mickael9/unused-warning
Don't include (mission)pak_checksums in standalone build
2017-05-24 12:26:55 -05:00
Zack Middleton 70af7e673f Check for truncated paths in Sys_LoadDll
Check for truncated paths which could allow loading a library with
a non-standard extension. Also provides a better message for why a
valid library with a long path would fail to load.
2017-05-24 10:28:59 -05:00
Zack Middleton 05858d30e8 Don't load libraries with non-standard file extensions
Also don't allow writting files ending in a library extension such
as ".so.0" or ".dylib.0".
2017-05-24 10:28:46 -05:00
Zack Middleton fbada2caf6 Fix compiling when KEY_WOW64_32KEY is missing from system headers 2017-05-24 10:01:19 -05:00
Zack Middleton f4739e9c4d Rename (already updated) opusfile-0.5 to opusfile-0.8 2017-05-23 11:47:27 -05:00
Zack Middleton 7139094355 Update opusfile from 0.5 to 0.8 2017-05-23 11:47:27 -05:00
Zack Middleton ef8ad54421 Rename (already updated) opus-1.1 to opus-1.1.4 2017-05-23 11:47:27 -05:00
Zack Middleton 853110d5d4 Update opus from 1.1 to 1.1.4
Define FLOAT_APPROX in Makefile and misc/msvc12/quake3.vcxproj.
2017-05-23 11:47:26 -05:00
Zack Middleton 67bfe8f8d6 Rename (already updated) libvorbis-1.3.4 to libvorbis-1.3.5 2017-05-23 11:47:26 -05:00
Zack Middleton bba263d634 Update libvorbis from 1.3.4 to 1.3.5 2017-05-23 11:47:26 -05:00
Zack Middleton d87bd792c3 Rename (already updated) libogg-1.3.1 to libogg-1.3.2 2017-05-23 11:47:26 -05:00
Zack Middleton 04fc72899a Update libogg from 1.3.1 to 1.3.2 2017-05-23 11:47:26 -05:00
Zack Middleton e3ec11d42a Remove unused libspeex 2017-05-23 09:13:54 -05:00
SmileTheory c65d2c2657 Add vao cache for static surfaces.
Remove support for draw range elements, multi draw arrays, world vao creation, surface merging.
2017-04-28 02:13:25 -07:00
Zack Middleton 729766150f Don't start a vote after vote passed for map change
Processing a callvote command after a vote passed to change maps but
has not been executed yet will result in 1) map change immediately
happening 2) after new map loads players have vote HUD messages but
Game VM doesn't have a vote in progress. The phantom vote status will
only be removed if players start a new vote or run vid_restart.

The underlying issue is that a second callvote sets vote config
strings but a map change is executed before they are sent to clients.
Resulting in clients getting "cs" reliable commands with the config
string changes _after_ the map change. Out of sync config strings.

Even if the underlying issue was fixed, the second vote would be lost.
So it's best to not force a map change to happen immediately anyway.

Reported by Tobias Kuehnhammer.
2017-04-12 18:29:17 -05:00
Max Crofts af69d1148f Improve FS_GetModList
- Paths to search for mods are now specified in an array

- Mods can now consist solely of ".pk3dir" folders and still be
considered valid

- The function now has a consistent style
2017-04-12 17:49:50 +10:00
Max Crofts 7ff610db35 Detect GOG install path 2017-04-07 16:26:26 +10:00
Max Crofts f5143405f1 Add missing RegCloseKey to Sys_SteamPath 2017-04-07 15:18:28 +10:00
SmileTheory de3339ebcd Fill in filename in Com_WriteConfig_f() before checking extension.
Thanks BartoCH for pointing out.
2017-03-27 04:11:33 -07:00
SmileTheory d4e1a01f33 Remove FS_Read2().
Functionally the same as FS_Read().
Streaming functionality was removed in 672cfbf16f but flag remained.
2017-03-17 04:21:11 -07:00
SmileTheory b173ac0599 Merge some file writing extension checks from OpenJK.
Thanks Ensiform.
https://github.com/JACoders/OpenJK/commit/05928a57f9e4aae15a3bd0
https://github.com/JACoders/OpenJK/commit/ef124fd0fc48af164581176
2017-03-13 20:44:47 -07:00
SmileTheory f61fe5f6a0 Don't open .pk3 files as OpenAL drivers. 2017-03-13 20:28:37 -07:00
SmileTheory 376267d534 Don't load .pk3s as .dlls, and don't load user config files from .pk3s. 2017-03-13 14:14:00 -07:00
Mickaël Thomas 40ec42a425 Don't include (mission)pak_checksums in standalone build
Avoids a compiler warning
2017-03-12 22:57:17 +01:00
Zack Middleton cd41690fc3 Fix swapping AAS bboxes
Found in RTCW SP.
2017-02-27 18:18:15 -06:00
Zack Middleton 313064baa4 Fix command line variables not being set correctly
+seta, +sets, and +setu were ignored because Com_AddStartupCommands
thought Com_StartupVariable handled it.

+set didn't allow value to be multiple tokens which due to Unix shell
unintuitively removing quotes causes the variable to only be set to
the first token. This could be worked around by escaping quotes

    ioq3ded +set g_motd \"hello world\"

but it doesn't match behavior of other start up commands (which now
includes seta, sets, and setu) that use all tokens.
2017-02-22 15:16:50 -06:00
Zack Middleton da747fc291 Fix source filename/includepath length in l_precomp.c
source_t filename and includepath are 1024 but MAX_PATH is 64. As far as
I know the paths don't exceed that so this probably doesn't fix anything.
Similar changes were already made to l_script.c so this makes things
consistent. This was found because it was fixed in RTCW's code.
2017-02-19 09:24:50 -06:00