fix the server info string output on the console. kludgy, but it works :)

This commit is contained in:
Bill Currie 2001-01-08 19:59:38 +00:00
parent 22ad49f949
commit aa8785d2c2
2 changed files with 27 additions and 20 deletions

View file

@ -465,11 +465,14 @@ SVC_Status (void)
int ping;
int top, bottom;
extern int con_printf_no_log;
if (!sv_allow_status->int_val)
return;
if (CheckForFlood (FLOOD_STATUS))
return;
con_printf_no_log = 1;
Cmd_TokenizeString ("status");
SV_BeginRedirect (RD_PACKET);
Con_Printf ("%s\n", svs.info);
@ -490,6 +493,7 @@ SVC_Status (void)
}
}
SV_EndRedirect ();
con_printf_no_log = 0;
}
/*

View file

@ -57,6 +57,7 @@
char outputbuf[8000];
redirect_t sv_redirected;
int con_printf_no_log;
extern cvar_t *sv_phs;
extern cvar_t *sv_timestamps;
@ -146,29 +147,31 @@ Con_Printf (char *fmt, ...)
SV_FlushRedirect ();
strncat (outputbuf, msg, sizeof (outputbuf) - strlen (outputbuf));
}
// We want to output to console and maybe logfile
if (sv_timestamps && sv_timefmt && sv_timefmt->string
&& sv_timestamps->int_val && !pending)
timestamps = true;
if (!con_printf_no_log) {
// We want to output to console and maybe logfile
if (sv_timestamps && sv_timefmt && sv_timefmt->string
&& sv_timestamps->int_val && !pending)
timestamps = true;
if (timestamps) {
mytime = time (NULL);
local = localtime (&mytime);
strftime (msg3, sizeof (msg3), sv_timefmt->string, local);
if (timestamps) {
mytime = time (NULL);
local = localtime (&mytime);
strftime (msg3, sizeof (msg3), sv_timefmt->string, local);
snprintf (msg2, sizeof (msg2), "%s%s", msg3, msg);
} else {
snprintf (msg2, sizeof (msg2), "%s", msg);
snprintf (msg2, sizeof (msg2), "%s%s", msg3, msg);
} else {
snprintf (msg2, sizeof (msg2), "%s", msg);
}
if (msg2[strlen (msg2) - 1] != '\n') {
pending = 1;
} else {
pending = 0;
}
Sys_Printf ("%s", msg2); // also echo to debugging console
if (sv_logfile)
Qprintf (sv_logfile, "%s", msg2);
}
if (msg2[strlen (msg2) - 1] != '\n') {
pending = 1;
} else {
pending = 0;
}
Sys_Printf ("%s", msg2); // also echo to debugging console
if (sv_logfile)
Qprintf (sv_logfile, "%s", msg2);
}
/*