summaryrefslogtreecommitdiff
path: root/source/files.c
AgeCommit message (Collapse)Author
2010-09-15Renamed source tree subdirectory into ‘src’, moved ‘asm’ ↵Andrey Nazarov
subdirectory there and renamed it into ‘i386’.
2010-09-12Fixed FS_LoadFile to return EMFILE instead of bogus ENOENT when out of handles.Andrey Nazarov
Changed FS_FOpenFile to return EMFILE instead of ENFILE.
2010-08-10Allocate pack filename at the end of the memory chunk to avoid alignment issues.Andrey Nazarov
2010-08-06Supply mandatory mode argument to open().Andrey Nazarov
2010-08-05Fixed unix builds broken by previous commit.Andrey Nazarov
2010-08-05Enable exclusive file opening even if fopen has no support for it.Andrey Nazarov
2010-08-03Set BASEGAME and new DEFGAME defines through config.h.Andrey Nazarov
2010-08-02Made client and server buildable with mingw32 again.Andrey Nazarov
Use uint64_t type for network counters.
2010-07-03Yet another huge commit.Andrey Nazarov
Implemented new error reporting framework based on errno and custom error codes. Converted filesystem code, image and model managers, BSP loader to use the new framework and report errors more accurately. Replaced fileHandle_t with qhandle_t. Removed INVALID_LENGTH definition. Killed USE_LOADBUF code. Defined FS_FileExists(Ex) macro, implemented FS_EasyOpenFile and FS_WriteFile helper functions. When testing for free screenshot slots, open the file with O_EXCL flag to avoid race conditions (works only on glibc yet). Don't allow quake paths with high bits set. Don't tolerate any fatal errors encountered when searching for files and pass errors back to the caller. FS_Seek() now fails on files from packs instead of returning an invalid position. Fixed ‘mvdskip’ command not working properly. Avoid inefficient usage of MakeColor macro in image loading functions. Prevent memory leak in JPEG and PNG image functions after calling longjmp() by marking some local variables volatile. Added support for loading monochrome JPEG images. Fixed signed integer overflow in GetWavinfo(). Fixed missing return statement in BSP_LoadSurfEdges() causing out of range edge indices to be left uncaught. Fixed possible access to uninitialized memory in BSP_LoadLeafs() for maps with no leafs. Properly NUL terminate the buffer in SCR_ScoreDump_f(), also check for being in a level. Always free latched_string when cvar is set back to current value. Fixed a crash in ‘mvdplay’ command possible when demo file is invalid.
2010-06-14Added more integer overflow checks for paks.Andrey Nazarov
Limit max loadable file size to 64 MiB to protect against malicious paks causing memory exhaustion.
2010-06-13Read ZIP packs directly using custom loader.Andrey Nazarov
Removed PKZIP library (bye bye 1600+ lines of unmaintained code). Don't fatal crash when packfile fails to read or we run out of free file handles, just print an error message. Allow filesystem to be restarted even if there are file handles reading from packfiles (packfile will be freed once file handle is closed).
2010-06-11Skip empty files/directories when loading ZIP archives.Andrey Nazarov
2010-06-11Fixed gamedir not being changed properly when connecting to a server.Andrey Nazarov
Forbid changing gamedir at all while connected to a server. Automatically restart filesystem when user changes gamedir while disconnected. Killed FS_NeedRestart and FS_SafeToRestart.
2010-02-23CVAR_FILES flag now applies only to files loaded by refresh.Andrey Nazarov
Added ‘r_reload’ command to be used in place of ‘fs_restart’ to flush refresh model and texture caches.
2010-02-23Cleaned up FS_Restart/FS_Shutdown code.Andrey Nazarov
Made ‘fs_restart’ command cause full filesystem restart (including reloading of the basedir).
2010-02-23Removed useless fs_restrict_mask cvar.Andrey Nazarov
2010-02-23Cosmetic changes to filesystem code.Andrey Nazarov
2009-09-04Changed Com_DPrintf, Com_WPrintf and Com_EPrintf functions to macros.Andrey Nazarov
Introduced Com_LPrintf, FS_DPrintf, SV_DPrintf. Don't include any developer code at all unless built with _DEBUG.
2009-06-03Don't cap maxmsglen on loopback connections.Andrey Nazarov
Use seperate buffer for stuffcmd processing on client so that something like ‘map foobar;wait;wait;wait;give shells’ works (original Q2 used deferred buffer for this). Don't include netgraph code into release builds. Made ‘changing’ and ‘precache’ commands not available from console, since they may confuse the client when typed manually. Client now handles newlines embedded into ‘cstring’ and ‘cstring2’ layout commands properly. Fixed a crash when displaying inventory. Detect zero bytes embedded into config files and refuse to execute them.
2009-06-01Initial portable savegame implementation.Andrey Nazarov
2009-05-29Ran all source files through expand(1).Andrey Nazarov
2009-01-10Made MinGW built OpenFFA game DLL loadable on Win32.Andrey Nazarov
Server now disallows ‘map’ command by default if no latched variables were changed. Added ‘sv_allow_map’ cvar to turn this check off. Implemented ‘kickban’ server command. Made address/mask matching code endianess safe. Made ‘dumpuser’ server command more verbose. Display client FPS value in the output of ‘status’ command. Fixed a crash when MVD channel with an active GTV connection was destroyed. Made it possible to re-enable old Q2 brush tracing bug via ‘map_allsolid_bug’ cvar. Added ‘allow_download_textures’ and ‘allow_download_pics’ cvar for fine tuning download options on client and server sides. Changed ‘allow_download’ default value to 0.
2008-12-15Put -lm back as it seems to break on non-i386 arches.Andrey Nazarov
Removed `sys_stdio' cvar in favor of `sys_console' on Unix. Unix client no longer writes anything on stdout by default if launched without a terminal (e.g. from X session). Server now uses entity origin instead of view origin when performing PVS/PHS culling of multicast data (fixes railing/chaining out of the water, etc). MVD client now clears roll angle of player entities. Really fixed MVD channel overflow recovery. Use RTLD_LAZY for loading game library on Unix to work around old mods. When adjusting lightmap/texture color saturation, calculate luminance accoring to sRGB colorspace specification. Fixed OpenGL renderer's PVS glitches when crossing water boundaries. Re-enable MD3 model support.
2008-11-13Hacked the source to get it compile on Windows Mobile using CeGCC toolchain.Andrey Nazarov
Fixed nasty memory corruption bug in UI scripts loading code. Fixed software refresh compilation issues on Windows. Inactive MVD channels are now completely destroyed and recreated once they are active again, and they are no longer allowed to stay in waiting state forever. Fixed delay buffer overflow resulting in fatal connection error. Preserve MVD stream flags in demos recorded on GTV server, and handle `inuse' flag correctly on players when writing gamestate. Updated documentation and Debian package descriptions.
2008-10-25Progress meter now works for local MVDs again.Andrey Nazarov
Implemented `mvdskip' command which allows one jump to the next map in a MVD. Removed `mvd_shownet' debugging stuff from dedicated server build. Dropped packets no longer have maximum height on the lagometer.
2008-10-11Major redesign of GTV protocol: added support for persistent GTV connections,Andrey Nazarov
bidirectional pinging, low traffic (`suspended') modes. HTTP server is now gone (remote console logging is temporary gone too), custom binary protocol is used for GTV connections now. MVD client no longer serves other MVD clients, only regular spectators. Changed FIFO buffers to be regular circular buffers, not BIP-buffers. Removed `sv_http_*', `sv_console_auth' variables. Added `sv_mvd_maxclients' variable, `addgtvhost', `delgtvhost' and `listgtvhosts' commands. Renamed `sv_mvd_max*' cvars for consistency. Reset `sv_ghostime' default value back to 6, but changed semantics: it now waits for any packet from client, not just `begin' packet. Added `--disable-mvd-server' and `--disable-mvd-client' options to configure script. FS_Restart() no longer chokes on real files opened for reading. Fixed client chat prompt length. Stubbed out more debugging stuff from dedicated server builds.
2008-10-01Stubbed out more client stuff from dedicated server build.Andrey Nazarov
Dedicated server now properly handles `wait' console command.
2008-09-27Use `sv_features', `g_features' and `fs_gamedir' cvars instead of environmentAndrey Nazarov
variables for communications between server and the game DLL. Fixed reverted `no PHS' check on sounds MVD client did.
2008-09-25Strip trailing whitespace as gi.args() expects.Andrey Nazarov
Properly set maxChars value for input fields on Unix.
2008-09-24Com_sprintf -> Q_snprintf, Q_strncpyz -> Q_strlcpy, Q_strcat -> Q_strlcat.Andrey Nazarov
Q_vsnprintf, Q_sprintf, Q_concat, Q_strlcpy, Q_strcat all return number of characters to be written into the buffer regardless of overflow. Removed COM_AppendExtension, FS_CopyFile, FS_RemoveFile, FS_CopyFile_f. Made sure Q2PRO can only write files into subdirectories of the game directory with a fixed extension. Moved `play' command implementation into main client code. Added support for `s_ambient' value of 3. Renamed `net_log_active' cvar to `net_log_enable'. Log files are now written into `logs/' subdirectory.
2008-08-16Split some monolithic include files into smaller ones.Andrey Nazarov
Use single BSP models cache for refresh and collision subsystems. Refresh libraries may not longer be dynamically loaded. Made gi.TagMalloc use separate tag namespace to avoid conflicts with engine reserverd tags. Fixed listing order of MVD channels in chooser menu. A lot of misc changes... MSVC build is definitely broken now.
2008-06-29Added client and server side support for 32-bit solids.Andrey Nazarov
New R1Q2 and Q2PRO minor protocol versions, 1905 and 1014. Use environment variables for game and server features negotiation. Relax restrictions on quake paths when searching inside pak files. Made OSS subsystem cvar names consistent with core sound system conventions. Misc latched cvar handling changes.
2008-05-09Autodetect gzipped demos during playback.Andrey Nazarov
Extended menu scripts.
2008-05-08Removed hardcoded menus in favor of scriptable ones.Andrey Nazarov
Made UI module part of the client, removed all glue. Added `pushmenu', `popmenu', 'forcemenuoff' commands. Detect gzipped files by contents, not by *.gz extension (TODO).
2008-05-05Fixed compilation issue.Andrey Nazarov
2008-05-05Brought SDL window resizing policy in compliance to ICCCM.Andrey Nazarov
Renamed `vid_placement' cvar to `vid_geometry'. Load *.pkz files by default. Do not allow backed-up quake paths at all. Apply `--enable-dsound' and `--enable-dinput' options to Unix too. Replaced `s_driver' and `in_driver' cvars with `s_direct' and `in_direct'. Renamed `s_initsound' cva to `s_enable'. Improved SDL input grabs handling in windowed mode. Allow `cl_noskins' to be dynamically changed. Run client at 10 fps if minimuzed, at 60 fps if not active (client is disconnected or in background). Fixed Sys_ExecDefault. Use absolute mouse positioning for UI. Hide custom UI cursor in windowed mode.
2008-04-23Added `dumpents' server command.Andrey Nazarov
Added support for `cl_noskins' value of 2 (default all female skins to `female/athena', all male skins to `male/grunt'). Renamed `scoreshot' command to `aashot', added `aadump' command. Fixed several alignment issues on ARM architecture. Server browser menu now indicates full and password protected servers with color codes. Implemented history search in console with Ctrl+R, Ctrl+S. Removed `cl_railtrail_alpha' variable, all `cl_rail*_color' variables now accept colors in #RRGGBBAA format. Added `map_override' cvar (enables loading map entity lump from external maps/*.ent file). Made `quit' command accept extra arguments. Made `draw' command accept arbitrary colors in #RRGGBBAA format. Fixed debian packages.
2008-04-09Added `addstuffcmd', `delstuffcmd' and `liststuffcmds'commands.Andrey Nazarov
Fixed broken delta decompression of clientNum field by the client. Rewrote SV_MvdPlayerIsActive, added flag 4 to `sv_mvd_capture_flags'. Added `scr_drawpmove' debugging variable. Improved intermission handling by the MVD client.
2008-04-02Use size_t instead of int where possible.Andrey Nazarov
Added initial support for Win64 port.
2008-03-05Rewrote autocompletion engine.Andrey Nazarov
Added `con_notifylines' variable. Do not allow chat beeps to overlap.
2008-02-28Do not spam dedicated server console with heartbeats.Andrey Nazarov
Added autocompletion of options for some commands. Made logfile_prefix not empty by default. Re-enabled `anti-kick' exploit fix.
2008-02-17Huge search and replace commit.Andrey Nazarov
Use fixed size integer types from stdint.h instead of custom defined ones. Get endianess infromation form endian.h. Added `remotemode' console command. Link with -ldl only on Linux.
2008-01-28Added `sv_mvd_capture_flags' variable.Andrey Nazarov
Re-introduced FOV compensation for player gun model. Made `gl_fastsky' actually work. Added support for following powerup carriers in MVD_Follow_f.
2008-01-16Handle WM_CHAR/WM_SYSCHAR messages on Windows.Andrey Nazarov
Repaint window when resizing, etc.
2008-01-14Added filtering cvars by flags to `cvarlist' command.Andrey Nazarov
Write aliases to config.cfg too. Added S_ISREG check so FS_FOpenFile never opens directories on Unix.
2008-01-10Always send nonzero areabytes to non-q2pro clientsAndrey Nazarov
(fixes hall of mirrors in MVD Waiting Room). Made `deathmatch' and `maxclients' default to `1' and `8' respectively. Made autocompletion work for some console variables too. Made `set' command accept multiple args with spaces, as well as Cvar_Command. Fixed potential crash on entities with EF_BFG bit and out of range skinnum. Levelshots work again now. Made `pingservers' command ping all 64 possible servers. Delete scrap texture on refresh shutdown. Added `leave' command for GTV, switches client to Waiting Room.
2008-01-02Updated revision to 175.Andrey Nazarov
Allow MVDs to be replayed from menu.
2008-01-01Inspect `play' command more carefully in CL_ParseStuffText.Andrey Nazarov
Made FS_LoadFile return 0 instead of -1 on gzipped files. Cleaned up MVD_ParseUnicast. Display chase target name on the screen for non-q2pro GTV clients. Implemented UF_NOGAMECHAT = 8, UF_NOMVDCHAT = 16 user flags. MVD_Say_f no longer uses SV_BroadcastPrintf. Changed `scr_showfollowing' default value back to 1. Filter svc_stufftext and svc_layout on game server before sending mvd_unicast message to MVD clients.
2007-12-21Use Sys_Setenv for setting environment variables in a safe way.Andrey Nazarov
Moved `writeconfig' command to client code section. Moved `setenv' command to common code section. Properly handle `--help' -and `--version' arguments on Unix.
2007-12-17Improved getopt-like option processing code.Andrey Nazarov
Implemented MVD playlists and looping.