summaryrefslogtreecommitdiff
path: root/source/sys_unix.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-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-05-09Added support for OpenAL sound output, activated by setting ‘s_enable’ ↵Andrey Nazarov
cvar to 2. Added ‘al_driver’ cvar for choosing what OpenAL library to link dynamically with.
2010-02-23Cosmetic changes to filesystem code.Andrey Nazarov
2009-10-30Assume 64 byte cachelines when doing Hunk_Alloc.Andrey Nazarov
2009-10-22Added a wrapper around select() for waiting on multiple file descriptors.Andrey Nazarov
Converted all TCP streams code to use single select() call per server frame.
2009-10-19Install SIGUSR1 handler that causes logfiles to be reopened just like SIGHUP ↵Andrey Nazarov
does, but without requiring the server to be run with ‘+set sys_console 0’.
2009-09-08Don't attempt to set color or title of disabled console.Andrey Nazarov
2009-09-04Removed support for color escapes embedded in text (but still allow colored ↵Andrey Nazarov
lines in console). Moved color stuff from q_shared.c into the client code.
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-02-05Report download size/done percentage in the output of ‘status d’ command.Andrey Nazarov
Fixed a small memory leak possible when client was requesting another download without stopping the previous one. Properly exit dedicated server running as Win32 service given a ‘quit’ command. No longer assume ‘portalopen’ array indices to be mapped directly into ‘areaportals’ array. No longer error out when CM_SetAreaPortalState is called on the areaportal inside MAX_MAP_AREAPORTALS range but not referenced anywhere on the map. Flush server logfile on Com_Error. Changed default value of ‘uf’ cvar to include UF_LOCALFOV (from 0 to 4). Added ‘cl_lag’ macro expanding to server to client packetloss percentage.
2009-01-30Client now works around the fact R1Q2 servers always report the highestAndrey Nazarov
protocol number they support in svc_serverdata message, regardless of the actual protocol version being used. Be silent and try to preserve reliable data at least when client demo message overflows, do not dump entire message. Use playerstate coordinates for positioning player's own entity in case it is invisible regardless of server protocol version. Changed ‘map_allsolid_bug’ default to 0, since it seems to break some mods. Implemented ‘recycle’ command for dedicated servers. Correctly parse comments from ‘/etc/default/q2pro’ config file. Install SIGHUP handler when running dedicated server only. It can now be used to reopen server logfile for rotation. Allow ${arg1-arg2} syntax when expanding alias parameters.
2008-12-17Added /etc/default/q2pro template.Andrey Nazarov
Removed -ffast-math option as it causes bad things to happen with recent GCC.
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-10-26Cleaned up `sys_win.c', moved some code into `win_ac.c' and `win_dbg.c'.Andrey Nazarov
Fixed broken `sv_ac.c' compilation.
2008-10-15Added `sv_mvd_allow_stufftext' and `sv_mvd_password' cvars.Andrey Nazarov
MVD admins now can execute arbitrary commands on behaf of the dummy MVD observer on game server side via `fwd' command, if allowed. MVD channel is now listed in the menu when it is not suspended, not just when there are active players. Made `mvdconnect' command accept --user and --pass options. When masking off high-bit characters before displaying them on system console or writing into logfile, ignore any control characters. Updated documentation.
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-30Output number of active players along with number of spectators inAndrey Nazarov
the Channel Chooser menu. Unknown commands from GTV spectators are now handled as chat. It is up to GTV admin to block mod-specific commands which spectators usually have bound to keyboard via `addfiltercmd' facility. Added `sys_parachute' cvar (default 1) which allows one to disable fatal signal handlers on Unix for automatic core dump creation purpose. Build all binaries with debugging symbols included by default.
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-18Accept `all' as special argument to `delstuffcmd' command.Andrey Nazarov
Cleaned up Cvar_Get and fixed semantic bug. Accept `background keyword in menu scripts. Renamed `gl_fastsky' to `gl_drawsky'. If at least one of the sky env maps fails lo load, disable entire sky drawing. Reworked loading screen. Fixed Com_Quit argument string handling. Catch more signals on *nix. Updated server docs.
2008-05-11Updated revision to 238.Andrey Nazarov
Use mremap only when _GNU_SOURCE is defined. Updated Debian package descriptions.
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-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-05Added `scr_showstats' variable.Andrey Nazarov
Fixed drawing of transparent sprites.
2008-04-02Use size_t instead of int where possible.Andrey Nazarov
Added initial support for Win64 port.
2008-03-24Remove useless time wraparound checks.Andrey Nazarov
Apply more careful input sanitizing in several places (issues revealed by zzuf(1)). Remove stereo *.wav loading stuff, Q2 has never supported it properly. Fixed a memory leak in Image_LoadPCX. Mark clients after receiving ICMP errors from them, drop after `sv_ghostime' seconds.
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-16Made stdout blocking on Unix.Andrey Nazarov
Made particle texture larger and more round. `gl_texturemode' now defaults to `GL_LINEAR_MIPMAP_LINEAR'. `gl_partscale' now defaults to `2'. Re-added `gl_polyblend' variable.
2008-01-08Fixed MVD recording problem while playback.Andrey Nazarov
Fixed data being written to MVD buffers even without dummy MVD client. Allow to specify up to 64 favorite servers via adrXX variables. Properly display servers without `hostname' or `mapname' infokeys. Set console title to display dedicated server hostname and port. Removed redundant `toggleconsole' from UI_PushMenu. Fixed AC_ParseQueryReply parsing message incorrectly. Fixed MVD_GameClientBeing setting cl->number instead of cl->slot.
2008-01-06Fixed invalid client ID being displayed by `status' command on GTV servers.Andrey Nazarov
Fixed stupid Sys_Sleep bug on Unix systems. Draw `Loading anticheat...' string in connection screen. Added Sys_GetAntiCheatAPI stub into sys_unix.c for testing purposes.
2007-12-29Made server ping measurements more accurate.Andrey Nazarov
2007-12-27Updated revision to 170.Andrey Nazarov
Removed `com_sleep' variable. Fixed master heartbeat timings. Enabled anticheat server interface for Windows builds. Added `--single-user' option to configure script. Build `q2pro-client' and `q2pro-server' binary *.deb packages by default. Allow absolute homedir path, autoexpand `~' character on Unix.
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-21Fixed garbage in high bits of FPU control word beingAndrey Nazarov
reported due to invalid local variable size.
2007-12-20Added initial server side support for r1ch.net anticheat.Andrey Nazarov
Renamed `listban' command to `listbans'. Make sure NET_Connect sets NS_CONNECTING state even if connect() succeedes immediately. Changed FIFO_Read/FIFO_Write semantics.
2007-12-17Fixed delta state corruption bug on secondary MVD clients.Andrey Nazarov
New minor MVD protocol version 2009. Pressing Ctrl+U kills current line in TTY console. Added `mvdcontrol' command.
2007-12-07Fixed Windows build.Andrey Nazarov
Fixed a crash in Player Setup menu. Updated revision to 166. Removed AC check for 64-bit Windows.
2007-12-07Optimized FS_ListFiles (and broken Windows build).Andrey Nazarov
Initial changes to demo browser to support caching.
2007-11-25Changed Com_sprintf --> Q_concat in quite some cases.Andrey Nazarov
Make sure WAVE sound driver is built by default. Added --disable-wave option to `configure'. Command line history is now remembered between sessions. ALT+Space refreshes all servers in Server Browser. Handle command line agruments like original Q2 engine did.
2007-09-30Make sure Info_RemoveKey removes any possible duplicates.Andrey Nazarov
Misc code cleanup.
2007-08-22Make sure JPEG and PNG libraries are linked in when building monolithic client.Andrey Nazarov
Added 'strip' target to Makefile. Embedded release number inside configure script. Enabled server side GetGameFeatures call.
2007-08-22FS_ExtCmp now correctly handles complex extensions, e.g. '.dm2.gz'.Andrey Nazarov
Fixed NULL pointer dereference when CL_Disconnect is called before client finishes initialization.
2007-08-14Initial import of the new Q2PRO tree.Andrey Nazarov