mirror of
https://git.code.sf.net/p/quake/newtree
synced 2025-05-31 17:21:46 +00:00
Added "last message repeated xx times" to cut down repeated lines from Con_Printf
This commit is contained in:
parent
7e689832db
commit
9b90de262a
1 changed files with 16 additions and 1 deletions
|
@ -134,14 +134,29 @@ void Con_Printf (char *fmt, ...)
|
||||||
char msg[MAXPRINTMSG];
|
char msg[MAXPRINTMSG];
|
||||||
char msg2[MAXPRINTMSG];
|
char msg2[MAXPRINTMSG];
|
||||||
char msg3[MAXPRINTMSG];
|
char msg3[MAXPRINTMSG];
|
||||||
|
static char lastmessage[MAXPRINTMSG];
|
||||||
|
static int msgcount=0;
|
||||||
time_t mytime = 0;
|
time_t mytime = 0;
|
||||||
struct tm *local = NULL;
|
struct tm *local = NULL;
|
||||||
qboolean timestamps = false;
|
qboolean timestamps = false;
|
||||||
|
|
||||||
va_start (argptr, fmt);
|
va_start (argptr, fmt);
|
||||||
vsnprintf (msg, sizeof(msg), fmt, argptr);
|
vsnprintf (msg, sizeof(msg), fmt, argptr);
|
||||||
va_end (argptr);
|
va_end (argptr);
|
||||||
|
|
||||||
|
if (strncmp(lastmessage,msg,MAXPRINTMSG)==0) {
|
||||||
|
msgcount+=1;
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
strncpy(lastmessage,msg,MAXPRINTMSG);
|
||||||
|
if (msgcount>0) {
|
||||||
|
Sys_Printf ("Last message repeated %d times\n", msgcount);
|
||||||
|
if (sv_logfile)
|
||||||
|
fprintf (sv_logfile, "Last message repeated %d times\n", msgcount);
|
||||||
|
msgcount=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (sv_timestamps && sv_timefmt && sv_timefmt->string && sv_timestamps->value)
|
if (sv_timestamps && sv_timefmt && sv_timefmt->string && sv_timestamps->value)
|
||||||
timestamps = true;
|
timestamps = true;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue