mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-06-01 09:02:08 +00:00
[console] Make quake encoding optional
Now, if either ormask is set or the first character of the string to be printed is 1-3, the quake character set is used, otherwise utf-8 is assumed. Other changes are for mapping untrusted strings.
This commit is contained in:
parent
68bc9155ac
commit
9552f3c133
16 changed files with 87 additions and 72 deletions
|
@ -478,9 +478,6 @@ C_SayTeam (inputline_t *il)
|
||||||
static __attribute__((format(PRINTF, 1, 0))) void
|
static __attribute__((format(PRINTF, 1, 0))) void
|
||||||
C_Print (const char *fmt, va_list args)
|
C_Print (const char *fmt, va_list args)
|
||||||
{
|
{
|
||||||
char *s;
|
|
||||||
int mask, c;
|
|
||||||
|
|
||||||
if (!c_print_buffer)
|
if (!c_print_buffer)
|
||||||
c_print_buffer = dstring_new ();
|
c_print_buffer = dstring_new ();
|
||||||
|
|
||||||
|
@ -494,23 +491,23 @@ C_Print (const char *fmt, va_list args)
|
||||||
if (!con_initialized)
|
if (!con_initialized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
s = c_print_buffer->str;
|
char *s = c_print_buffer->str;
|
||||||
|
|
||||||
mask = 0;
|
bool quake_encoding = s[0] > 0 && s[0] <= 3;
|
||||||
if (s[0] == 1 || s[0] == 2) {
|
bool colored = quake_encoding && s[0] < 0;
|
||||||
mask = 128; // go to colored text
|
int mask = (colored ? 128 : 0) | con_data.ormask;
|
||||||
s++;
|
s += quake_encoding;
|
||||||
}
|
|
||||||
if (mask || con_data.ormask) {
|
if (mask) {
|
||||||
for (char *m = s; *m; m++) {
|
for (char *m = s; *m; m++) {
|
||||||
if (*m >= ' ') {
|
if (*m >= ' ') {
|
||||||
*m |= mask | con_data.ormask;
|
*m |= mask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (con_data.realtime) {
|
if (con_data.realtime) {
|
||||||
c = Draw_PrintBuffer (notify_buffer, s);
|
int c = Draw_PrintBuffer (notify_buffer, s);
|
||||||
while (c-- > 0) {
|
while (c-- > 0) {
|
||||||
notify_times[notify_head++] = *con_data.realtime;
|
notify_times[notify_head++] = *con_data.realtime;
|
||||||
if (notify_head >= NOTIFY_LINES + 1) {
|
if (notify_head >= NOTIFY_LINES + 1) {
|
||||||
|
@ -529,14 +526,16 @@ C_Print (const char *fmt, va_list args)
|
||||||
Draw_PrintBuffer (console_buffer, s);
|
Draw_PrintBuffer (console_buffer, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (quake_encoding || mask) {
|
||||||
while (*s) {
|
while (*s) {
|
||||||
*s = sys_char_map[(byte) *s];
|
*s = sys_char_map[(byte) *s];
|
||||||
s++;
|
s++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// echo to debugging console
|
// echo to debugging console
|
||||||
// but don't print the highchars flag (leading \x01)
|
// but don't print the highchars/quake_encoding flag (leading \x01/2/3)
|
||||||
if ((byte)c_print_buffer->str[0] > 2)
|
if ((byte)c_print_buffer->str[0] > 3)
|
||||||
fputs (c_print_buffer->str, stdout);
|
fputs (c_print_buffer->str, stdout);
|
||||||
else if ((byte)c_print_buffer->str[0])
|
else if ((byte)c_print_buffer->str[0])
|
||||||
fputs (c_print_buffer->str + 1, stdout);
|
fputs (c_print_buffer->str + 1, stdout);
|
||||||
|
|
|
@ -823,13 +823,17 @@ C_Print (const char *fmt, va_list args)
|
||||||
Qputs (log_file, buffer->str);
|
Qputs (log_file, buffer->str);
|
||||||
Qflush (log_file);
|
Qflush (log_file);
|
||||||
}
|
}
|
||||||
|
char *s = buffer->str;
|
||||||
|
if (s[0] > 0 && s[0] <= 3) {
|
||||||
|
s++;
|
||||||
|
}
|
||||||
#ifdef HAVE_NCURSES
|
#ifdef HAVE_NCURSES
|
||||||
if (use_curses) {
|
if (use_curses) {
|
||||||
print (buffer->str);
|
print (s);
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
unsigned char *txt = (unsigned char *) buffer->str;
|
unsigned char *txt = (unsigned char *) s;
|
||||||
while (*txt)
|
while (*txt)
|
||||||
putc (sys_char_map[*txt++], stdout);
|
putc (sys_char_map[*txt++], stdout);
|
||||||
fflush (stdout);
|
fflush (stdout);
|
||||||
|
|
|
@ -236,7 +236,7 @@ PF_cvar_set (progs_t *pr, void *data)
|
||||||
if (!var)
|
if (!var)
|
||||||
var = Cvar_FindAlias (var_name);
|
var = Cvar_FindAlias (var_name);
|
||||||
if (!var) {
|
if (!var) {
|
||||||
Sys_Printf ("PF_cvar_set: variable %s not found\n", var_name);
|
Sys_Printf ("%cPF_cvar_set: variable %s not found\n", 3, var_name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -369,7 +369,7 @@ static void
|
||||||
PF_dprint (progs_t *pr, void *data)
|
PF_dprint (progs_t *pr, void *data)
|
||||||
{
|
{
|
||||||
qfZoneScoped (true);
|
qfZoneScoped (true);
|
||||||
Sys_Printf ("%s", PF_VarString (pr, 0, 1));
|
Sys_Printf ("%c%s", 3, PF_VarString (pr, 0, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -325,9 +325,9 @@ CL_ParseServerInfo (void)
|
||||||
Sbar_SetLevelName (cl.levelname, 0);
|
Sbar_SetLevelName (cl.levelname, 0);
|
||||||
|
|
||||||
// separate the printfs so the server message can have a color
|
// separate the printfs so the server message can have a color
|
||||||
Sys_Printf ("\n\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36"
|
Sys_Printf ("%c\n\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36"
|
||||||
"\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37\n"
|
"\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37\n"
|
||||||
"\n");
|
"\n", 3);
|
||||||
Sys_Printf ("%c%s\n", 2, str);
|
Sys_Printf ("%c%s\n", 2, str);
|
||||||
|
|
||||||
// first we go through and touch all of the precache data that still
|
// first we go through and touch all of the precache data that still
|
||||||
|
@ -369,7 +369,7 @@ CL_ParseServerInfo (void)
|
||||||
DARRAY_APPEND (&cl_world.models,
|
DARRAY_APPEND (&cl_world.models,
|
||||||
Mod_ForName (model_precache[i], false));
|
Mod_ForName (model_precache[i], false));
|
||||||
if (cl_world.models.a[i] == NULL) {
|
if (cl_world.models.a[i] == NULL) {
|
||||||
Sys_Printf ("Model %s not found\n", model_precache[i]);
|
Sys_Printf ("%cModel %s not found\n", 3, model_precache[i]);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
CL_KeepaliveMessage ();
|
CL_KeepaliveMessage ();
|
||||||
|
@ -827,7 +827,14 @@ CL_ParseServerMessage (void)
|
||||||
|
|
||||||
case svc_print:
|
case svc_print:
|
||||||
qfMessageL ("svc_print");
|
qfMessageL ("svc_print");
|
||||||
Sys_Printf ("%s", MSG_ReadString (net_message));
|
str = MSG_ReadString (net_message);
|
||||||
|
if (str[0]) {
|
||||||
|
if (str[0] <= 3) {
|
||||||
|
Sys_Printf ("%s", str);
|
||||||
|
} else {
|
||||||
|
Sys_Printf ("%c%s", 3, str);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case svc_stufftext:
|
case svc_stufftext:
|
||||||
|
|
|
@ -914,7 +914,6 @@ Host_Init (void)
|
||||||
{
|
{
|
||||||
qfZoneScoped (true);
|
qfZoneScoped (true);
|
||||||
BT_Init (com_argv[0]);
|
BT_Init (com_argv[0]);
|
||||||
sys_quake_encoding = true;
|
|
||||||
Sys_RegisterShutdown (Host_Shutdown, 0);
|
Sys_RegisterShutdown (Host_Shutdown, 0);
|
||||||
Sys_Printf ("Host_Init\n");
|
Sys_Printf ("Host_Init\n");
|
||||||
|
|
||||||
|
@ -970,8 +969,8 @@ Host_Init (void)
|
||||||
Sys_Printf ("\nVersion %s (build %04d)\n\n", PACKAGE_VERSION,
|
Sys_Printf ("\nVersion %s (build %04d)\n\n", PACKAGE_VERSION,
|
||||||
build_number ());
|
build_number ());
|
||||||
|
|
||||||
Sys_Printf ("\x80\x81\x81\x82 %s initialized \x80\x81\x81\x82\n",
|
Sys_Printf ("%c\x80\x81\x81\x82 %s initialized \x80\x81\x81\x82\n",
|
||||||
PACKAGE_NAME);
|
3, PACKAGE_NAME);
|
||||||
|
|
||||||
host_initialized = true;
|
host_initialized = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,7 +167,7 @@ SV_StartSound (edict_t *entity, int channel, const char *sample, int volume,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (sound_num == MAX_SOUNDS || !sv.sound_precache[sound_num]) {
|
if (sound_num == MAX_SOUNDS || !sv.sound_precache[sound_num]) {
|
||||||
Sys_Printf ("SV_StartSound: %s not precacheed\n", sample);
|
Sys_Printf ("%cSV_StartSound: %s not precacheed\n", 3, sample);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1159,7 +1159,7 @@ SV_SpawnServer (const char *server)
|
||||||
snprintf (sv.modelname, sizeof (sv.modelname), "maps/%s.bsp", server);
|
snprintf (sv.modelname, sizeof (sv.modelname), "maps/%s.bsp", server);
|
||||||
sv.worldmodel = Mod_ForName (sv.modelname, false);
|
sv.worldmodel = Mod_ForName (sv.modelname, false);
|
||||||
if (!sv.worldmodel) {
|
if (!sv.worldmodel) {
|
||||||
Sys_Printf ("Couldn't spawn server %s\n", sv.modelname);
|
Sys_Printf ("%cCouldn't spawn server %s\n", 3, sv.modelname);
|
||||||
sv.active = false;
|
sv.active = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ PF_error (progs_t *pr, void *data)
|
||||||
edict_t *ed;
|
edict_t *ed;
|
||||||
|
|
||||||
s = PF_VarString (pr, 0, 1);
|
s = PF_VarString (pr, 0, 1);
|
||||||
Sys_Printf ("======SERVER ERROR in %s:\n%s\n",
|
Sys_Printf ("%c======SERVER ERROR in %s:\n%s\n", 3,
|
||||||
PR_GetString (pr, pr->pr_xfunction->descriptor->name), s);
|
PR_GetString (pr, pr->pr_xfunction->descriptor->name), s);
|
||||||
ed = PROG_TO_EDICT (pr, *sv_globals.self);
|
ed = PROG_TO_EDICT (pr, *sv_globals.self);
|
||||||
ED_Print (pr, ed, 0);
|
ED_Print (pr, ed, 0);
|
||||||
|
@ -96,7 +96,7 @@ PF_objerror (progs_t *pr, void *data)
|
||||||
edict_t *ed;
|
edict_t *ed;
|
||||||
|
|
||||||
s = PF_VarString (pr, 0, 1);
|
s = PF_VarString (pr, 0, 1);
|
||||||
Sys_Printf ("======OBJECT ERROR in %s:\n%s\n",
|
Sys_Printf ("%c======OBJECT ERROR in %s:\n%s\n", 3,
|
||||||
PR_GetString (pr, pr->pr_xfunction->descriptor->name), s);
|
PR_GetString (pr, pr->pr_xfunction->descriptor->name), s);
|
||||||
ed = PROG_TO_EDICT (pr, *sv_globals.self);
|
ed = PROG_TO_EDICT (pr, *sv_globals.self);
|
||||||
ED_Print (pr, ed, 0);
|
ED_Print (pr, ed, 0);
|
||||||
|
@ -384,7 +384,7 @@ PF_ambientsound (progs_t *pr, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!*check) {
|
if (!*check) {
|
||||||
Sys_Printf ("no precache: %s\n", samp);
|
Sys_Printf ("%cno precache: %s\n", 3, samp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (soundnum > 255) {
|
if (soundnum > 255) {
|
||||||
|
|
|
@ -82,14 +82,14 @@ CL_Ignore_Sanity_Check (void)
|
||||||
|
|
||||||
static bool live_iterator (ignore_t *ig, llist_node_t *node)
|
static bool live_iterator (ignore_t *ig, llist_node_t *node)
|
||||||
{
|
{
|
||||||
Sys_Printf ("%5i - %s\n", ig->uid,
|
Sys_Printf ("%c%5i - %s\n", 3, ig->uid,
|
||||||
Info_ValueForKey (cl.players[ig->slot].userinfo, "name"));
|
Info_ValueForKey (cl.players[ig->slot].userinfo, "name"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool dead_iterator (ignore_t *ig, llist_node_t *node)
|
static bool dead_iterator (ignore_t *ig, llist_node_t *node)
|
||||||
{
|
{
|
||||||
Sys_Printf ("%s\n", ig->lastname);
|
Sys_Printf ("%c%s\n", 3, ig->lastname);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ CL_Ignore_f (void)
|
||||||
new->slot = i;
|
new->slot = i;
|
||||||
new->uid = uid;
|
new->uid = uid;
|
||||||
llist_append (ignore_list, new);
|
llist_append (ignore_list, new);
|
||||||
Sys_Printf ("User %i (%s) is now ignored.\n", uid,
|
Sys_Printf ("%cUser %i (%s) is now ignored.\n", 3, uid,
|
||||||
Info_ValueForKey (cl.players[i].userinfo, "name"));
|
Info_ValueForKey (cl.players[i].userinfo, "name"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ CL_Unignore_f (void)
|
||||||
uid = atoi (Cmd_Argv (1));
|
uid = atoi (Cmd_Argv (1));
|
||||||
if ((node = llist_findnode (ignore_list, &uid))) {
|
if ((node = llist_findnode (ignore_list, &uid))) {
|
||||||
int slot = LLIST_DATA (node, ignore_t)->slot;
|
int slot = LLIST_DATA (node, ignore_t)->slot;
|
||||||
Sys_Printf ("User %i (%s) is no longer ignored.\n", uid,
|
Sys_Printf ("%cUser %i (%s) is no longer ignored.\n", 3, uid,
|
||||||
Info_ValueForKey (cl.players[slot].userinfo, "name"));
|
Info_ValueForKey (cl.players[slot].userinfo, "name"));
|
||||||
CL_Ignore_Free (llist_remove (node), 0);
|
CL_Ignore_Free (llist_remove (node), 0);
|
||||||
return;
|
return;
|
||||||
|
@ -198,8 +198,8 @@ CL_Chat_User_Disconnected (int uid)
|
||||||
ig->lastname = strdup (Info_ValueForKey (cl.players[ig->slot].userinfo,
|
ig->lastname = strdup (Info_ValueForKey (cl.players[ig->slot].userinfo,
|
||||||
"name"));
|
"name"));
|
||||||
llist_append (dead_ignore_list, ig);
|
llist_append (dead_ignore_list, ig);
|
||||||
Sys_Printf ("Ignored user %i (%s) left the server. "
|
Sys_Printf ("%cIgnored user %i (%s) left the server. "
|
||||||
"Now ignoring by name...\n", ig->uid, ig->lastname);
|
"Now ignoring by name...\n", 3, ig->uid, ig->lastname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,8 +228,8 @@ CL_Chat_Check_Name (const char *name, int slot)
|
||||||
llist_append (ignore_list,
|
llist_append (ignore_list,
|
||||||
llist_remove (llist_getnode (dead_ignore_list,
|
llist_remove (llist_getnode (dead_ignore_list,
|
||||||
g_ccn_found)));
|
g_ccn_found)));
|
||||||
Sys_Printf ("User %i (%s) is using an ignored name. "
|
Sys_Printf ("%cUser %i (%s) is using an ignored name. "
|
||||||
"Now ignoring by user id...\n", g_ccn_found->uid,
|
"Now ignoring by user id...\n", 3, g_ccn_found->uid,
|
||||||
g_ccn_found->lastname);
|
g_ccn_found->lastname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2067,7 +2067,6 @@ Host_Init (void)
|
||||||
cl_cbuf = Cbuf_New (&id_interp);
|
cl_cbuf = Cbuf_New (&id_interp);
|
||||||
cl_stbuf = Cbuf_New (&id_interp);
|
cl_stbuf = Cbuf_New (&id_interp);
|
||||||
|
|
||||||
sys_quake_encoding = true;
|
|
||||||
Sys_Init ();
|
Sys_Init ();
|
||||||
GIB_Init (true);
|
GIB_Init (true);
|
||||||
GIB_Key_Init ();
|
GIB_Key_Init ();
|
||||||
|
@ -2126,7 +2125,7 @@ Host_Init (void)
|
||||||
|
|
||||||
Sys_Printf ("\nClient version %s (build %04d)\n\n", PACKAGE_VERSION,
|
Sys_Printf ("\nClient version %s (build %04d)\n\n", PACKAGE_VERSION,
|
||||||
build_number ());
|
build_number ());
|
||||||
Sys_Printf ("\x80\x81\x81\x82 %s initialized \x80\x81\x81\x82\n",
|
Sys_Printf ("%c\x80\x81\x81\x82 %s initialized \x80\x81\x81\x82\n", 3,
|
||||||
PACKAGE_NAME);
|
PACKAGE_NAME);
|
||||||
|
|
||||||
host_initialized = true;
|
host_initialized = true;
|
||||||
|
|
|
@ -232,7 +232,7 @@ CL_CheckOrDownloadFile (const char *filename)
|
||||||
}
|
}
|
||||||
// ZOID - can't download when recording
|
// ZOID - can't download when recording
|
||||||
if (cls.demorecording) {
|
if (cls.demorecording) {
|
||||||
Sys_Printf ("Unable to download %s in record mode.\n",
|
Sys_Printf ("%cUnable to download %s in record mode.\n", 3,
|
||||||
cls.downloadname->str);
|
cls.downloadname->str);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -242,7 +242,7 @@ CL_CheckOrDownloadFile (const char *filename)
|
||||||
|
|
||||||
dstring_copystr (cls.downloadname, filename);
|
dstring_copystr (cls.downloadname, filename);
|
||||||
dstring_copystr (cls.downloadtempname, filename);
|
dstring_copystr (cls.downloadtempname, filename);
|
||||||
Sys_Printf ("Downloading %s...\n", cls.downloadname->str);
|
Sys_Printf ("%cDownloading %s...\n", 3, cls.downloadname->str);
|
||||||
|
|
||||||
// download to a temp name, and rename to the real name only when done,
|
// download to a temp name, and rename to the real name only when done,
|
||||||
// so if interrupted a runt file wont be left
|
// so if interrupted a runt file wont be left
|
||||||
|
@ -312,8 +312,8 @@ Model_NextDownload (void)
|
||||||
Mod_ForName (cl.model_name[i], false));
|
Mod_ForName (cl.model_name[i], false));
|
||||||
|
|
||||||
if (!cl_world.models.a[i]) {
|
if (!cl_world.models.a[i]) {
|
||||||
Sys_Printf ("\nThe required model file '%s' could not be found or "
|
Sys_Printf ("%c\nThe required model file '%s' could not be found or"
|
||||||
"downloaded.\n\n", cl.model_name[i]);
|
" downloaded.\n\n", 3, cl.model_name[i]);
|
||||||
Sys_Printf ("You may need to download or purchase a %s client "
|
Sys_Printf ("You may need to download or purchase a %s client "
|
||||||
"pack in order to play on this server.\n\n",
|
"pack in order to play on this server.\n\n",
|
||||||
qfs_gamedir->gamedir);
|
qfs_gamedir->gamedir);
|
||||||
|
@ -453,7 +453,7 @@ CL_FinishDownload (void)
|
||||||
cls.downloadname->str + 6);
|
cls.downloadname->str + 6);
|
||||||
}
|
}
|
||||||
if (QFS_Rename (oldn->str, newn->str))
|
if (QFS_Rename (oldn->str, newn->str))
|
||||||
Sys_Printf ("failed to rename %s to %s, %s.\n", oldn->str,
|
Sys_Printf ("%cfailed to rename %s to %s, %s.\n", 3, oldn->str,
|
||||||
newn->str, strerror (errno));
|
newn->str, strerror (errno));
|
||||||
dstring_delete (oldn);
|
dstring_delete (oldn);
|
||||||
dstring_delete (newn);
|
dstring_delete (newn);
|
||||||
|
@ -510,7 +510,7 @@ CL_OpenDownload (void)
|
||||||
if (!cls.download) {
|
if (!cls.download) {
|
||||||
dstring_clearstr (cls.downloadname);
|
dstring_clearstr (cls.downloadname);
|
||||||
dstring_clearstr (cls.downloadurl);
|
dstring_clearstr (cls.downloadurl);
|
||||||
Sys_Printf ("Failed to open %s\n", name->str);
|
Sys_Printf ("%cFailed to open %s\n", 3, name->str);
|
||||||
CL_RequestNextDownload ();
|
CL_RequestNextDownload ();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -562,7 +562,7 @@ CL_ParseDownload (void)
|
||||||
strlen (cls.downloadname->str))
|
strlen (cls.downloadname->str))
|
||||||
|| strstr (newname + strlen (cls.downloadname->str), "/")) {
|
|| strstr (newname + strlen (cls.downloadname->str), "/")) {
|
||||||
Sys_Printf
|
Sys_Printf
|
||||||
("WARNING: server tried to give a strange new name: %s\n",
|
("%cWARNING: server tried to give a strange new name: %s\n", 3,
|
||||||
newname);
|
newname);
|
||||||
CL_RequestNextDownload ();
|
CL_RequestNextDownload ();
|
||||||
return;
|
return;
|
||||||
|
@ -572,7 +572,7 @@ CL_ParseDownload (void)
|
||||||
unlink (cls.downloadname->str);
|
unlink (cls.downloadname->str);
|
||||||
}
|
}
|
||||||
dstring_copystr (cls.downloadname, newname);
|
dstring_copystr (cls.downloadname, newname);
|
||||||
Sys_Printf ("downloading to %s\n", cls.downloadname->str);
|
Sys_Printf ("%cdownloading to %s\n", 3, cls.downloadname->str);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (size == DL_HTTP) {
|
if (size == DL_HTTP) {
|
||||||
|
@ -585,8 +585,8 @@ CL_ParseDownload (void)
|
||||||
strlen (cls.downloadname->str))
|
strlen (cls.downloadname->str))
|
||||||
|| strstr (newname + strlen (cls.downloadname->str), "/")) {
|
|| strstr (newname + strlen (cls.downloadname->str), "/")) {
|
||||||
Sys_Printf
|
Sys_Printf
|
||||||
("WARNING: server tried to give a strange new name: %s\n",
|
("%cWARNING: server tried to give a strange new name: %s\n",
|
||||||
newname);
|
3, newname);
|
||||||
CL_RequestNextDownload ();
|
CL_RequestNextDownload ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -597,7 +597,7 @@ CL_ParseDownload (void)
|
||||||
dstring_copystr (cls.downloadname, newname);
|
dstring_copystr (cls.downloadname, newname);
|
||||||
}
|
}
|
||||||
dstring_copystr (cls.downloadurl, url);
|
dstring_copystr (cls.downloadurl, url);
|
||||||
Sys_Printf ("downloading %s to %s\n", cls.downloadurl->str,
|
Sys_Printf ("%cdownloading %s to %s\n", 3, cls.downloadurl->str,
|
||||||
cls.downloadname->str);
|
cls.downloadname->str);
|
||||||
CL_HTTP_StartDownload ();
|
CL_HTTP_StartDownload ();
|
||||||
#else
|
#else
|
||||||
|
@ -799,8 +799,9 @@ CL_ParseServerData (void)
|
||||||
movevars.entgravity = MSG_ReadFloat (net_message);
|
movevars.entgravity = MSG_ReadFloat (net_message);
|
||||||
|
|
||||||
// separate the printfs so the server message can have a color
|
// separate the printfs so the server message can have a color
|
||||||
Sys_Printf ("\n\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36"
|
Sys_Printf ("%c\n\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36"
|
||||||
"\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37\n\n");
|
"\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37\n\n",
|
||||||
|
3);
|
||||||
Sys_Printf ("%c%s\n", 2, str);
|
Sys_Printf ("%c%s\n", 2, str);
|
||||||
|
|
||||||
// ask for the sound list next
|
// ask for the sound list next
|
||||||
|
@ -1285,7 +1286,13 @@ CL_ParseServerMessage (void)
|
||||||
GIB_Event_Callback (cl_chat_e, 1, str);
|
GIB_Event_Callback (cl_chat_e, 1, str);
|
||||||
Team_ParseChat (str);
|
Team_ParseChat (str);
|
||||||
}
|
}
|
||||||
|
if (str[0]) {
|
||||||
|
if (str[0] <= 3) {
|
||||||
Sys_Printf ("%s", str);
|
Sys_Printf ("%s", str);
|
||||||
|
} else {
|
||||||
|
Sys_Printf ("%c%s", 3, str);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (p)
|
if (p)
|
||||||
dstring_delete (p);
|
dstring_delete (p);
|
||||||
Con_SetOrMask (0);
|
Con_SetOrMask (0);
|
||||||
|
|
|
@ -188,7 +188,7 @@ CL_Color_f (void)
|
||||||
int top, bottom;
|
int top, bottom;
|
||||||
|
|
||||||
if (Cmd_Argc () == 1) {
|
if (Cmd_Argc () == 1) {
|
||||||
Sys_Printf ("\"color\" is \"%s %s\"\n",
|
Sys_Printf ("%c\"color\" is \"%s %s\"\n", 3,
|
||||||
Info_ValueForKey (cls.userinfo, "topcolor"),
|
Info_ValueForKey (cls.userinfo, "topcolor"),
|
||||||
Info_ValueForKey (cls.userinfo, "bottomcolor"));
|
Info_ValueForKey (cls.userinfo, "bottomcolor"));
|
||||||
Sys_Printf ("color <0-13> [0-13]\n");
|
Sys_Printf ("color <0-13> [0-13]\n");
|
||||||
|
|
|
@ -451,7 +451,7 @@ SL_Con_List (server_entry_t *sldata)
|
||||||
cp = SL_Get_By_Num (sldata, serv);
|
cp = SL_Get_By_Num (sldata, serv);
|
||||||
if (!cp)
|
if (!cp)
|
||||||
break;
|
break;
|
||||||
Sys_Printf ("%i) %s\n", (serv + 1), cp->desc);
|
Sys_Printf ("%c%i) %s\n", 3, (serv + 1), cp->desc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -491,7 +491,7 @@ SL_Con_Details (server_entry_t *sldata, int slitemno)
|
||||||
cp = SL_Get_By_Num (sldata, (slitemno - 1));
|
cp = SL_Get_By_Num (sldata, (slitemno - 1));
|
||||||
if (!cp)
|
if (!cp)
|
||||||
return;
|
return;
|
||||||
Sys_Printf ("Server: %s\n", cp->server);
|
Sys_Printf ("%cServer: %s\n", 3, cp->server);
|
||||||
Sys_Printf ("Ping: ");
|
Sys_Printf ("Ping: ");
|
||||||
if (cp->pongback)
|
if (cp->pongback)
|
||||||
Sys_Printf ("%i\n", (int) (cp->pongback * 1000));
|
Sys_Printf ("%i\n", (int) (cp->pongback * 1000));
|
||||||
|
@ -500,15 +500,16 @@ SL_Con_Details (server_entry_t *sldata, int slitemno)
|
||||||
if (cp->status) {
|
if (cp->status) {
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
Sys_Printf ("Name: %s\n", cp->desc);
|
Sys_Printf ("%cName: %s\n", 3, cp->desc);
|
||||||
Sys_Printf ("Game: %s\n", Info_ValueForKey (cp->status, "*gamedir"));
|
Sys_Printf ("%cGame: %s\n", 3,
|
||||||
Sys_Printf ("Map: %s\n", Info_ValueForKey (cp->status, "map"));
|
Info_ValueForKey (cp->status, "*gamedir"));
|
||||||
|
Sys_Printf ("%cMap: %s\n", 3, Info_ValueForKey (cp->status, "map"));
|
||||||
|
|
||||||
s = Info_MakeString (cp->status, 0);
|
s = Info_MakeString (cp->status, 0);
|
||||||
for (i = 0; i < strlen (s); i++)
|
for (i = 0; i < strlen (s); i++)
|
||||||
if (s[i] == '\n')
|
if (s[i] == '\n')
|
||||||
playercount++;
|
playercount++;
|
||||||
Sys_Printf ("Players: %i/%s\n", playercount,
|
Sys_Printf ("%cPlayers: %i/%s\n", 3, playercount,
|
||||||
Info_ValueForKey (cp->status, "maxclients"));
|
Info_ValueForKey (cp->status, "maxclients"));
|
||||||
} else
|
} else
|
||||||
Sys_Printf ("No Details Available\n");
|
Sys_Printf ("No Details Available\n");
|
||||||
|
|
|
@ -583,7 +583,7 @@ SV_Error (const char *error, va_list argptr)
|
||||||
string = dstring_new ();
|
string = dstring_new ();
|
||||||
dvsprintf (string, error, argptr);
|
dvsprintf (string, error, argptr);
|
||||||
|
|
||||||
Sys_Printf ("%s\n", string->str);
|
Sys_Printf ("%c%s\n", 3, string->str);
|
||||||
|
|
||||||
if (sv_net_initialized) {
|
if (sv_net_initialized) {
|
||||||
dstring_insertstr (string, 0, "server crashed: ");
|
dstring_insertstr (string, 0, "server crashed: ");
|
||||||
|
@ -2661,7 +2661,6 @@ SV_Init (void)
|
||||||
sv_cbuf = Cbuf_New (&id_interp);
|
sv_cbuf = Cbuf_New (&id_interp);
|
||||||
sv_args = Cbuf_ArgsNew ();
|
sv_args = Cbuf_ArgsNew ();
|
||||||
|
|
||||||
sys_quake_encoding = true;
|
|
||||||
Sys_RegisterShutdown (SV_Shutdown, 0);
|
Sys_RegisterShutdown (SV_Shutdown, 0);
|
||||||
|
|
||||||
Sys_Init ();
|
Sys_Init ();
|
||||||
|
|
|
@ -74,7 +74,7 @@ PF_error (progs_t *pr, void *data)
|
||||||
edict_t *ed;
|
edict_t *ed;
|
||||||
|
|
||||||
s = PF_VarString (pr, 0, 1);
|
s = PF_VarString (pr, 0, 1);
|
||||||
Sys_Printf ("======SERVER ERROR in %s:\n%s\n",
|
Sys_Printf ("%c======SERVER ERROR in %s:\n%s\n", 3,
|
||||||
PR_GetString (pr, pr->pr_xfunction->descriptor->name), s);
|
PR_GetString (pr, pr->pr_xfunction->descriptor->name), s);
|
||||||
ed = PROG_TO_EDICT (pr, *sv_globals.self);
|
ed = PROG_TO_EDICT (pr, *sv_globals.self);
|
||||||
ED_Print (pr, ed, 0);
|
ED_Print (pr, ed, 0);
|
||||||
|
@ -98,7 +98,7 @@ PF_objerror (progs_t *pr, void *data)
|
||||||
edict_t *ed;
|
edict_t *ed;
|
||||||
|
|
||||||
s = PF_VarString (pr, 0, 1);
|
s = PF_VarString (pr, 0, 1);
|
||||||
Sys_Printf ("======OBJECT ERROR in %s:\n%s\n",
|
Sys_Printf ("%c======OBJECT ERROR in %s:\n%s\n", 3,
|
||||||
PR_GetString (pr, pr->pr_xfunction->descriptor->name), s);
|
PR_GetString (pr, pr->pr_xfunction->descriptor->name), s);
|
||||||
ed = PROG_TO_EDICT (pr, *sv_globals.self);
|
ed = PROG_TO_EDICT (pr, *sv_globals.self);
|
||||||
ED_Print (pr, ed, 0);
|
ED_Print (pr, ed, 0);
|
||||||
|
@ -323,7 +323,7 @@ PF_ambientsound (progs_t *pr, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!*check) {
|
if (!*check) {
|
||||||
Sys_Printf ("no precache: %s\n", samp);
|
Sys_Printf ("%cno precache: %s\n", 3, samp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -666,7 +666,7 @@ PF_clientsound (progs_t *pr, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (sound_num == MAX_SOUNDS || !sv.sound_precache[sound_num]) {
|
if (sound_num == MAX_SOUNDS || !sv.sound_precache[sound_num]) {
|
||||||
Sys_Printf ("SV_StartSound: %s not precacheed\n", sample);
|
Sys_Printf ("%cSV_StartSound: %s not precacheed\n", 3, sample);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -458,7 +458,7 @@ PF_log (progs_t *pr, void *data)
|
||||||
clean_text (text);
|
clean_text (text);
|
||||||
|
|
||||||
if (P_FLOAT (pr, 1))
|
if (P_FLOAT (pr, 1))
|
||||||
Sys_Printf ("%s", text);
|
Sys_Printf ("%c%s", 3, text);
|
||||||
|
|
||||||
if (!file) {
|
if (!file) {
|
||||||
Sys_Printf ("coldn't open log file %s\n", name);
|
Sys_Printf ("coldn't open log file %s\n", name);
|
||||||
|
@ -475,7 +475,7 @@ PF_log (progs_t *pr, void *data)
|
||||||
static void
|
static void
|
||||||
PF_conprint (progs_t *pr, void *data)
|
PF_conprint (progs_t *pr, void *data)
|
||||||
{
|
{
|
||||||
Sys_Printf ("%s", PF_VarString (pr, 0, pr->pr_argc));
|
Sys_Printf ("%c%s", 3, PF_VarString (pr, 0, pr->pr_argc));
|
||||||
}
|
}
|
||||||
|
|
||||||
#define QWE (PR_RANGE_QWE << PR_RANGE_SHIFT) |
|
#define QWE (PR_RANGE_QWE << PR_RANGE_SHIFT) |
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue