From 35869586c94c83d0587462e62edc2f5e84d45a6b Mon Sep 17 00:00:00 2001 From: Jonathan Poncelet Date: Mon, 28 Jan 2019 18:32:29 +0000 Subject: [PATCH 1/2] Made various log messages more informative --- engine/client/cl_game.c | 4 ++-- engine/client/cl_gameui.c | 2 +- engine/client/cl_main.c | 4 ++-- engine/client/s_vox.c | 4 ++-- engine/common/mod_bmodel.c | 2 +- engine/common/model.c | 8 ++++---- engine/server/sv_game.c | 10 +++++----- engine/server/sv_save.c | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/engine/client/cl_game.c b/engine/client/cl_game.c index a1041a43..731ceb3a 100644 --- a/engine/client/cl_game.c +++ b/engine/client/cl_game.c @@ -1215,7 +1215,7 @@ static qboolean CL_LoadHudSprite( const char *szSpriteName, model_t *m_pSprite, } else { - Con_Reportf( S_ERROR "%s couldn't load\n", szSpriteName ); + Con_Reportf( S_ERROR "Could not load HUD sprite %s\n", szSpriteName ); Mod_UnloadSpriteModel( m_pSprite ); return false; } @@ -2341,7 +2341,7 @@ int CL_FindModelIndex( const char *m ) if( lasttimewarn < host.realtime ) { // tell user about problem (but don't spam console) - Con_Printf( S_ERROR "%s not precached\n", filepath ); + Con_Printf( S_ERROR "Could not find index for model %s: not precached\n", filepath ); lasttimewarn = host.realtime + 1.0f; } diff --git a/engine/client/cl_gameui.c b/engine/client/cl_gameui.c index eaf9a890..c288d7a9 100644 --- a/engine/client/cl_gameui.c +++ b/engine/client/cl_gameui.c @@ -382,7 +382,7 @@ static HIMAGE pfnPIC_Load( const char *szPicName, const byte *image_buf, int ima if( !szPicName || !*szPicName ) { - Con_Reportf( S_ERROR "CL_LoadImage: bad name!\n" ); + Con_Reportf( S_ERROR "CL_LoadImage: refusing to load image with empty name\n" ); return 0; } diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index ae4b0147..20fd57ca 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -2278,7 +2278,7 @@ void CL_ProcessFile( qboolean successfully_received, const char *filename ) } else { - Con_Printf( "Downloaded %i bytes for purported %i byte file, ignoring download\n", + Con_Printf( "Downloaded %i bytes for purported %i byte file, ignoring download\n", cls.netchan.tempbuffersize, p->nDownloadSize ); } @@ -2473,7 +2473,7 @@ qboolean CL_PrecacheResources( void ) { if( FBitSet( pRes->ucFlags, RES_WASMISSING )) { - Con_Printf( S_ERROR "%s%s couldn't load\n", DEFAULT_SOUNDPATH, pRes->szFileName ); + Con_Printf( S_ERROR "Could not load sound %s%s for precache\n", DEFAULT_SOUNDPATH, pRes->szFileName ); cl.sound_precache[pRes->nIndex][0] = 0; cl.sound_index[pRes->nIndex] = 0; } diff --git a/engine/client/s_vox.c b/engine/client/s_vox.c index 39b0e1d7..da11f4ba 100644 --- a/engine/client/s_vox.c +++ b/engine/client/s_vox.c @@ -545,7 +545,7 @@ void VOX_ParseLineCommands( char *pSentenceData, int sentenceIndex ) length = pNext - pSentenceData; if( tempBufferPos + length > sizeof( tempBuffer )) { - Con_Printf( S_ERROR "sentence too long!\n" ); + Con_Printf( S_ERROR "Sentence exceeded max length of %d\n", sizeof(tempBuffer) - 1 ); return; } @@ -619,7 +619,7 @@ void VOX_ReadSentenceFile( const char *psentenceFileName ) { if( g_numSentences >= MAX_SENTENCES ) { - Con_Printf( S_ERROR "VOX_Init: too many sentences specified\n" ); + Con_Printf( S_ERROR "VOX_Init: too many sentences specified, max is %d\n", MAX_SENTENCES ); break; } diff --git a/engine/common/mod_bmodel.c b/engine/common/mod_bmodel.c index 9e62218a..dad9490c 100644 --- a/engine/common/mod_bmodel.c +++ b/engine/common/mod_bmodel.c @@ -309,7 +309,7 @@ static void Mod_LoadLump( const byte *in, mlumpinfo_t *info, mlumpstat_t *stat, if( l->filelen % real_entrysize ) { if( !FBitSet( flags, LUMP_SILENT )) - Con_DPrintf( S_ERROR "Mod_Load%s: funny lump size\n", msg2 ); + Con_DPrintf( S_ERROR "Mod_Load%s: Lump size %d was not a multiple of %u bytes\n", msg2, l->filelen, real_entrysize ); loadstat.numerrors++; return; } diff --git a/engine/common/model.c b/engine/common/model.c index 177b3b21..d80cb199 100644 --- a/engine/common/model.c +++ b/engine/common/model.c @@ -288,8 +288,8 @@ model_t *Mod_LoadModel( model_t *mod, qboolean crash ) { memset( mod, 0, sizeof( model_t )); - if( crash ) Host_Error( "%s couldn't load\n", tempname ); - else Con_Printf( S_ERROR "%s couldn't load\n", tempname ); + if( crash ) Host_Error( "Could not load model %s from disk\n", tempname ); + else Con_Printf( S_ERROR "Could not load model %s from disk\n", tempname ); return NULL; } @@ -331,8 +331,8 @@ model_t *Mod_LoadModel( model_t *mod, qboolean crash ) Mod_FreeModel( mod ); Mem_Free( buf ); - if( crash ) Host_Error( "%s couldn't load\n", tempname ); - else Con_Printf( S_ERROR "%s couldn't load\n", tempname ); + if( crash ) Host_Error( "Could not load model %s\n", tempname ); + else Con_Printf( S_ERROR "Could not load model %s\n", tempname ); return NULL; } diff --git a/engine/server/sv_game.c b/engine/server/sv_game.c index 179cb121..53ccfde8 100644 --- a/engine/server/sv_game.c +++ b/engine/server/sv_game.c @@ -1303,7 +1303,7 @@ void pfnSetModel( edict_t *e, const char *m ) if( i == MAX_MODELS ) { - Con_Printf( S_ERROR "no precache: %s\n", name ); + Con_Printf( S_ERROR "Failed to set model %s: was not precached\n", name ); return; } } @@ -1311,7 +1311,7 @@ void pfnSetModel( edict_t *e, const char *m ) if( e == svgame.edicts ) { if( sv.state == ss_active ) - Con_Printf( S_ERROR "world model can't be changed\n" ); + Con_Printf( S_ERROR "Failed to set model %s: world model cannot be changed\n", name ); return; } @@ -1358,8 +1358,8 @@ int pfnModelIndex( const char *m ) return i; } - Con_Printf( S_ERROR "no precache: %s\n", name ); - return 0; + Con_Printf( S_ERROR "Cannot get index for model %s: not precached\n", name ); + return 0; } /* @@ -4410,7 +4410,7 @@ void pfnForceUnmodified( FORCE_TYPE type, float *mins, float *maxs, const char * if( !Q_strcmp( filename, pc->filename )) return; } - Con_Printf( S_ERROR "no precache: %s\n", filename ); + Con_Printf( S_ERROR "Failed to enforce consistency for %s: was not precached\n", filename ); } } diff --git a/engine/server/sv_save.c b/engine/server/sv_save.c index 5fb9e478..25dc0d3c 100644 --- a/engine/server/sv_save.c +++ b/engine/server/sv_save.c @@ -842,7 +842,7 @@ static SAVERESTOREDATA *LoadSaveData( const char *level ) if(( pFile = FS_Open( name, "rb", true )) == NULL ) { - Con_Printf( S_ERROR "couldn't open.\n" ); + Con_Printf( S_ERROR "Couldn't open save data file %s.\n", name ); return NULL; } From 69bb25bb18ddc7694f6f81e7a2c30bf89ad77de3 Mon Sep 17 00:00:00 2001 From: Jonathan Poncelet Date: Thu, 31 Jan 2019 13:31:27 +0000 Subject: [PATCH 2/2] Updated a couple of messages as per pull request --- engine/client/cl_main.c | 2 +- engine/client/s_vox.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index 20fd57ca..3b5b0080 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -2473,7 +2473,7 @@ qboolean CL_PrecacheResources( void ) { if( FBitSet( pRes->ucFlags, RES_WASMISSING )) { - Con_Printf( S_ERROR "Could not load sound %s%s for precache\n", DEFAULT_SOUNDPATH, pRes->szFileName ); + Con_Printf( S_ERROR "Could not load sound %s%s\n", DEFAULT_SOUNDPATH, pRes->szFileName ); cl.sound_precache[pRes->nIndex][0] = 0; cl.sound_index[pRes->nIndex] = 0; } diff --git a/engine/client/s_vox.c b/engine/client/s_vox.c index da11f4ba..5955e344 100644 --- a/engine/client/s_vox.c +++ b/engine/client/s_vox.c @@ -545,7 +545,7 @@ void VOX_ParseLineCommands( char *pSentenceData, int sentenceIndex ) length = pNext - pSentenceData; if( tempBufferPos + length > sizeof( tempBuffer )) { - Con_Printf( S_ERROR "Sentence exceeded max length of %d\n", sizeof(tempBuffer) - 1 ); + Con_Printf( S_ERROR "Sentence too long (max length %d characters)\n", sizeof(tempBuffer) - 1 ); return; }