mirror of
https://git.code.sf.net/p/quake/newtree
synced 2025-03-13 03:33:28 +00:00
fix the server info string output on the console. kludgy, but it works :)
This commit is contained in:
parent
22ad49f949
commit
aa8785d2c2
2 changed files with 27 additions and 20 deletions
|
@ -465,11 +465,14 @@ SVC_Status (void)
|
||||||
int ping;
|
int ping;
|
||||||
int top, bottom;
|
int top, bottom;
|
||||||
|
|
||||||
|
extern int con_printf_no_log;
|
||||||
|
|
||||||
if (!sv_allow_status->int_val)
|
if (!sv_allow_status->int_val)
|
||||||
return;
|
return;
|
||||||
if (CheckForFlood (FLOOD_STATUS))
|
if (CheckForFlood (FLOOD_STATUS))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
con_printf_no_log = 1;
|
||||||
Cmd_TokenizeString ("status");
|
Cmd_TokenizeString ("status");
|
||||||
SV_BeginRedirect (RD_PACKET);
|
SV_BeginRedirect (RD_PACKET);
|
||||||
Con_Printf ("%s\n", svs.info);
|
Con_Printf ("%s\n", svs.info);
|
||||||
|
@ -490,6 +493,7 @@ SVC_Status (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SV_EndRedirect ();
|
SV_EndRedirect ();
|
||||||
|
con_printf_no_log = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -57,6 +57,7 @@
|
||||||
char outputbuf[8000];
|
char outputbuf[8000];
|
||||||
|
|
||||||
redirect_t sv_redirected;
|
redirect_t sv_redirected;
|
||||||
|
int con_printf_no_log;
|
||||||
|
|
||||||
extern cvar_t *sv_phs;
|
extern cvar_t *sv_phs;
|
||||||
extern cvar_t *sv_timestamps;
|
extern cvar_t *sv_timestamps;
|
||||||
|
@ -146,29 +147,31 @@ Con_Printf (char *fmt, ...)
|
||||||
SV_FlushRedirect ();
|
SV_FlushRedirect ();
|
||||||
strncat (outputbuf, msg, sizeof (outputbuf) - strlen (outputbuf));
|
strncat (outputbuf, msg, sizeof (outputbuf) - strlen (outputbuf));
|
||||||
}
|
}
|
||||||
// We want to output to console and maybe logfile
|
if (!con_printf_no_log) {
|
||||||
if (sv_timestamps && sv_timefmt && sv_timefmt->string
|
// We want to output to console and maybe logfile
|
||||||
&& sv_timestamps->int_val && !pending)
|
if (sv_timestamps && sv_timefmt && sv_timefmt->string
|
||||||
timestamps = true;
|
&& sv_timestamps->int_val && !pending)
|
||||||
|
timestamps = true;
|
||||||
|
|
||||||
if (timestamps) {
|
if (timestamps) {
|
||||||
mytime = time (NULL);
|
mytime = time (NULL);
|
||||||
local = localtime (&mytime);
|
local = localtime (&mytime);
|
||||||
strftime (msg3, sizeof (msg3), sv_timefmt->string, local);
|
strftime (msg3, sizeof (msg3), sv_timefmt->string, local);
|
||||||
|
|
||||||
snprintf (msg2, sizeof (msg2), "%s%s", msg3, msg);
|
snprintf (msg2, sizeof (msg2), "%s%s", msg3, msg);
|
||||||
} else {
|
} else {
|
||||||
snprintf (msg2, sizeof (msg2), "%s", msg);
|
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue