Complete the qstat fix.

This commit is contained in:
Jeff Teunissen 2000-10-02 04:24:08 +00:00
parent 3742a9e158
commit 04074515eb
4 changed files with 22 additions and 47 deletions

View file

@ -390,17 +390,17 @@ void Con_Printf (char *fmt, ...)
vsnprintf (msg, sizeof(msg), fmt, argptr); vsnprintf (msg, sizeof(msg), fmt, argptr);
va_end (argptr); va_end (argptr);
// also echo to debugging console // also echo to debugging console
Sys_Printf ("%s", msg); // also echo to debugging console Sys_Printf ("%s", msg); // also echo to debugging console
// log all messages to file // log all messages to file
if (con_debuglog) if (con_debuglog)
Sys_DebugLog(va("%s/qconsole.log",com_gamedir), "%s", msg); Sys_DebugLog (va ("%s/qconsole.log", com_gamedir), "%s", msg);
if (!con_initialized) if (!con_initialized)
return; return;
// write it to the scrollable buffer // write it to the scrollable buffer
Con_Print (msg); Con_Print (msg);
} }

View file

@ -147,7 +147,7 @@ void Con_Printf (char *fmt, ...)
va_end (argptr); va_end (argptr);
if (sv_redirected) { // Add to redirected message if (sv_redirected) { // Add to redirected message
if (strlen (msg) + strlen(outputbuf) > sizeof (outputbuf) - 1) if (strlen (msg) + strlen (outputbuf) > sizeof (outputbuf) - 1)
SV_FlushRedirect (); SV_FlushRedirect ();
strcat (outputbuf, msg); strcat (outputbuf, msg);
return; return;
@ -200,7 +200,7 @@ void Con_DPrintf (char *fmt, ...)
return; return;
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);
Con_Printf ("%s", msg); Con_Printf ("%s", msg);

View file

@ -98,32 +98,19 @@ void Sys_Printf (char *fmt, ...)
{ {
va_list argptr; va_list argptr;
char msg[MAXPRINTMSG]; char msg[MAXPRINTMSG];
#if 0
static char lastmessage[MAXPRINTMSG];
static int msgcount=0;
#endif
unsigned char *p; unsigned char *p;
if (sys_nostdout->value) return; if (sys_nostdout->value)
va_start(argptr,fmt);
vsnprintf(msg, sizeof(msg), fmt, argptr);
va_end(argptr);
#if 0
if (strncmp(lastmessage,msg,MAXPRINTMSG)==0) {
msgcount+=1;
return; return;
} else {
if (msgcount>0) printf("Last message repeated %d times\n",msgcount); va_start (argptr, fmt);
strncpy(lastmessage,msg,MAXPRINTMSG); vsnprintf(msg, sizeof (msg), fmt, argptr);
msgcount=0; va_end (argptr);
}
#endif
/* translate to ASCII instead of printing [xx] --KB */ /* translate to ASCII instead of printing [xx] --KB */
for (p = (unsigned char *)msg; *p; p++) for (p = (unsigned char *) msg; *p; p++)
putc(qfont_table[*p], stdout); putc (qfont_table[*p], stdout);
fflush (stdout); fflush (stdout);
} }

View file

@ -105,6 +105,7 @@ double Sys_DoubleTime (void)
return (now - starttime) / 1000.0; return (now - starttime) / 1000.0;
} }
#define MAXPRINTMSG 4096 #define MAXPRINTMSG 4096
/* /*
================ ================
@ -115,34 +116,21 @@ void Sys_Printf (char *fmt, ...)
{ {
va_list argptr; va_list argptr;
char msg[MAXPRINTMSG]; char msg[MAXPRINTMSG];
#if 0
static char lastmessage[MAXPRINTMSG];
static int msgcount=0;
#endif
unsigned char *p; unsigned char *p;
if (sys_nostdout->value) if (sys_nostdout->value)
return; return;
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 0
if (strncmp(lastmessage,msg,MAXPRINTMSG)==0) {
msgcount+=1;
return;
} else {
if (msgcount>0) printf("Last message repeated %d times\n",msgcount);
strncpy(lastmessage,msg,MAXPRINTMSG);
msgcount=0;
}
#endif
/* translate to ASCII instead of printing [xx] --KB */ /* translate to ASCII instead of printing [xx] --KB */
for (p = (unsigned char *)msg; *p; p++) for (p = (unsigned char *) msg; *p; p++)
putc(qfont_table[*p], stdout); putc (qfont_table[*p], stdout);
fflush(stdout);
fflush (stdout);
} }
/* /*