summaryrefslogtreecommitdiff
path: root/source/q_shared.h
AgeCommit message (Collapse)Author
2010-09-15Renamed source tree subdirectory into ‘src’, moved ‘asm’ ↵Andrey Nazarov
subdirectory there and renamed it into ‘i386’.
2010-08-02Made client and server buildable with mingw32 again.Andrey Nazarov
Use uint64_t type for network counters.
2010-08-02Made Q_ClearStr operate in place and renamed it to COM_strclr.Andrey Nazarov
Removed unused Q_HightlightStr function. Changed Q_ prefix on several functions to COM_ for consistency. Clear the message string before passing it to Cmd_ExecTrigger.
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-13Fixed endianess issues in *.wav and *.tga loading code.Andrey Nazarov
Renamed MakeLong/MakeShort macros into MakeRawLong/MakeRawShort to prevent further confusion. Introduced LittleLongMem/LittleShortMem and RawLongMem/RawShortMem macros. Use more efficient versions of ShortSwap/LongSwap functions.
2010-06-09Expand the first ‘@’ character found in ‘logfile_prefix’ to a single ↵Andrey Nazarov
letter corresponding to message type (T - talk, D - developer, W - warning, E - error, A - everything else). Made player chat lines colored in dedicated server console.
2009-09-08Moved some more stuff from q_shared.c into common.cAndrey Nazarov
2009-09-05Changed return type of Info_SubValidate to size_t.Andrey Nazarov
Print more informative warnings when attempting to set an invalid info cvar value.
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-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-09-04Use one common implementation for timestamp formatting.Andrey Nazarov
Added Q_charascii function to convert quake chars to their ASCII equivalents, useful for writing into logfiles and system terminal.
2009-09-04Moved some math code out of q_shared.c into the main engine.Andrey Nazarov
2009-05-29Ran all source files through expand(1).Andrey Nazarov
2009-05-23Fixed scrolling in MVD clients menu.Andrey Nazarov
Implemented automatic chasecam hack for MVD observers. Correctly handle ICMP errors resluting in sendto() failing on Linux. Added ‘--disable-icmp’ option to configure script. Implemented ‘net_stats’ console command.
2009-05-10Display client PL, RTTs and packetdup values in ‘status l’ command ↵Andrey Nazarov
output, as well as ‘dumpuser’ output. Implemented naive protection against clients using ‘cl_nodelta 1’ via ‘sv_allow_nodelta’ cvar. Allow admins to vote regardless of ‘g_vote_spectators’ value. Changed level of obituary messages sent to victims/attackers to PRINT_HIGH. Fixed endianess issues. Fixed bashisms in ‘configure’ script.
2009-04-22Don't execute ‘cl_beginmapcmd’, ‘cl_changemapcmd’ and ↵Andrey Nazarov
‘cl_disconnectcmd’ triggers when playing back demos. Fixed automatic restart of sound subsystem after cvar change not working randomly. Don't crash in CL_Disconnect() on dedicated server exit. Added ‘sv_redirect_address’ variable. Fixed ‘\r’ char not stripped properly from filename when processing ‘\include’ directive in AC config files. Made AC config parser compliant with reference format as defined by R1Q2 implementation. Updated documentation.
2009-01-26Implemented ‘lag’ client command.Andrey Nazarov
Server now truncates client names at 15 chars.
2009-01-21Implemented Q_strcasestr() and rand_byte().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-11-14Fixed MSVC build.Andrey Nazarov
2008-11-13Fixed broken Windows build.Andrey Nazarov
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-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-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-20Updated menu scripts syntax.Andrey Nazarov
Updated client docs.
2008-05-09Autodetect gzipped demos during playback.Andrey Nazarov
Extended menu scripts.
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-04Added support for drawing colored text via `draw' client command.Andrey Nazarov
Cvar_Get now resets user defined cvar values for read-only cvars. Sever and game DLL features are now advertised via cvars instead of exports.
2008-04-02Use size_t instead of int where possible.Andrey Nazarov
Added initial support for Win64 port.
2008-03-30Added UF_MUTE_MISC flag and corresponding MVD menu entry.Andrey Nazarov
Avoid spamming MVD channels with broadcasts when client is dropped. Allow referencing MVD channels by name along with numeric ID. When spectator enters a MVD channel for the first time, start following the most followed player by default. Changed default GL driver to `libGL.so.1' on Unix.
2008-03-29Fixed a compilation warning in Image_LoadPCX.Andrey Nazarov
Use -Wno-strict-aliasing instead of -fno-strict-aliasing. Added q_packed attribute to zstatic_t structure.
2008-03-26CM loading code no longer calls Com_Error.Andrey Nazarov
Made endianness conversion macros return unsigned integers.
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-02-09Initial client support for variable server FPS.Andrey Nazarov
Added `cl_updaterate' variable. Fixed 'jerking bodies' bug when playing MVD stream. Fixed new entities warping when playing MVD stream. Allow dummy MVD client to be kicked. Never update layouts more than once per server frame for MVD observers. Added support for scrolling MVD client list using `invnext' and `invprev'. Fixed ref_soft compilation issue. Removed `mvd_wait_enter' and `mvd_wait_leave' variables in favor of `mvd_wait_delay' and `mvd_wait_percent'. Enter waiting state after buffer underflow only. Added `sv_locked' variable. Kick clients updating their userinfo to invalid one. Echo client name changes to the dedicated server console. Allow truncated MVDs to be played back in a row. Added `mvdpause' command. Made `serverstatus' command to query current server if called without argument. Enumerate clients in `serverstatus' command output. Demo browser now caches MVDs correctly. Allow `play' command to be used for playing MVDs too.
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-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-23Added support for parsing anticheat cvars.txt and hashes.txt.Andrey Nazarov
Properly parse multiple AC server messages received at once. Added `--enable-anticheat' option to configure script.
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-14Cleaned up info string stuff.Andrey Nazarov
Properly redirect messages longer than rd_buffersize.
2007-12-07Optimized FS_ListFiles (and broken Windows build).Andrey Nazarov
Initial changes to demo browser to support caching.
2007-12-02Finally fixed pak loading order on Windows.Andrey Nazarov
Minimize probability of prediction misses to be counted as ladder steps. Make sure Q_vnsprintf always returns length in range [0, destsize - 1].
2007-11-26Updated revision to 163.Andrey Nazarov
Manual pauses during re-recording of client demos are included in demo stream as zero frames. This makes adding audio comments to demos easier. Fixed compilation ussue with pre-4.X.X GCC versions.
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-11-23Added `com_uptime' macro.Andrey Nazarov
Version string no longer overdraws long command line in console. Cap `gl_celshading' value to 5 to prevent possible cheating.
2007-11-17Yet another batched update.Andrey Nazarov
Fixed munmap() hang in OSS_Shutdown(). Added (crappy) SDL audio driver, but ALSA should work now. Made r_maxfps and cl_maxfps really separate with cl_async 1. This way, any configuration is allowed (e.g. r_maxfps 60, cl_maxfps 120). Implemented water warping via fragment program, removed subdivision code. Removed (crappy) dynamic lighting. Removed surface sorting and batching. Minimized vertex copying operations. Implemented celshading. Removed S_RawSamples and friends. Smooth handling of smaller ladder steps (e.g. those on q2next2).