summaryrefslogtreecommitdiff
path: root/source/sv_ac.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2010-07-03 16:01:48 +0000
committerAndrey Nazarov <skuller@skuller.net>2010-07-03 16:01:48 +0000
commit7a914ef872a436adcdb36d21ceddba6bb24eb993 (patch)
treedafc86024742e7bbced8ef897754beff5160f1ae /source/sv_ac.c
parent1acd69e9a128e4f3abf06b5ae97c968c87663864 (diff)
Yet another huge commit.
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.
Diffstat (limited to 'source/sv_ac.c')
-rw-r--r--source/sv_ac.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/sv_ac.c b/source/sv_ac.c
index 2795c46..e481c9a 100644
--- a/source/sv_ac.c
+++ b/source/sv_ac.c
@@ -392,9 +392,14 @@ static void AC_ParseToken( char *data, int linenum, const char *path ) {
static qboolean AC_ParseFile( const char *path, ac_parse_t parse, int depth ) {
char *raw, *data, *p;
int linenum = 1;
+ qerror_t ret;
- FS_LoadFile( path, ( void ** )&raw );
+ ret = FS_LoadFile( path, ( void ** )&raw );
if( !raw ) {
+ if( ret != Q_ERR_NOENT || depth ) {
+ Com_WPrintf( "ANTICHEAT: Could not %s %s: %s\n",
+ depth ? "include" : "load", path, Q_ErrorString( ret ) );
+ }
return qfalse;
}
@@ -417,8 +422,8 @@ static qboolean AC_ParseFile( const char *path, ac_parse_t parse, int depth ) {
if( !strncmp( data + 1, "include ", 8 ) ) {
if( depth == AC_MAX_INCLUDES ) {
Com_WPrintf( "ANTICHEAT: Includes too deeply nested.\n" );
- } else if( !AC_ParseFile( data + 9, parse, depth + 1 ) ) {
- Com_WPrintf( "ANTICHEAT: Could not include %s\n", data + 9 );
+ } else {
+ AC_ParseFile( data + 9, parse, depth + 1 );
}
} else {
Com_WPrintf( "ANTICHEAT: Unknown directive %s on line %d in %s\n", data + 1, linenum, path );