mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-29 20:20:43 +00:00
rearrange the svc_stufftext code so stuffbuff doesn't even get allocated if
it's not needed. This should speed things up fractionally for well behaved mods/servers that send atomic svc_stufftext packets (ie, always ending in \n).
This commit is contained in:
parent
ea3c2f0d78
commit
97029c0689
1 changed files with 14 additions and 7 deletions
|
@ -1210,14 +1210,21 @@ CL_ParseServerMessage (void)
|
|||
break;
|
||||
|
||||
case svc_stufftext:
|
||||
if (!stuffbuf) stuffbuf = dstring_newstr();
|
||||
s = MSG_ReadString (net_message);
|
||||
Con_DPrintf ("partial stufftext: %s\n", s);
|
||||
dstring_appendstr (stuffbuf, s);
|
||||
if (stuffbuf->str[strlen(stuffbuf->str)-1] == '\n') {
|
||||
Con_DPrintf ("stufftext: %s\n", stuffbuf->str);
|
||||
Cbuf_AddTextTo (cmd_legacybuffer, stuffbuf->str);
|
||||
dstring_clearstr (stuffbuf);
|
||||
if (s[strlen (s) - 1] == '\n') {
|
||||
if (stuffbuf && stuffbuf->str[0]) {
|
||||
Con_DPrintf ("stufftext: %s%s\n", stuffbuf->str, s);
|
||||
Cbuf_AddTextTo (cmd_legacybuffer, stuffbuf->str);
|
||||
dstring_clearstr (stuffbuf);
|
||||
} else {
|
||||
Con_DPrintf ("stufftext: %s\n", s);
|
||||
}
|
||||
Cbuf_AddTextTo (cmd_legacybuffer, s);
|
||||
} else {
|
||||
Con_DPrintf ("partial stufftext: %s\n", s);
|
||||
if (!stuffbuf)
|
||||
stuffbuf = dstring_newstr();
|
||||
dstring_appendstr (stuffbuf, s);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in a new issue