summaryrefslogtreecommitdiff
path: root/source/cl_parse.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2009-06-03 18:18:55 +0000
committerAndrey Nazarov <skuller@skuller.net>2009-06-03 18:18:55 +0000
commit9d9b671cc77440e9b3bfcd74288f09a720c0ee6b (patch)
treeecd94136c7742b1aab73f4e43f9e454cd0c63eba /source/cl_parse.c
parentbd27c070620fdc96c5c3e222b3bfe43657ce90c2 (diff)
Don't cap maxmsglen on loopback connections.
Use seperate buffer for stuffcmd processing on client so that something like ‘map foobar;wait;wait;wait;give shells’ works (original Q2 used deferred buffer for this). Don't include netgraph code into release builds. Made ‘changing’ and ‘precache’ commands not available from console, since they may confuse the client when typed manually. Client now handles newlines embedded into ‘cstring’ and ‘cstring2’ layout commands properly. Fixed a crash when displaying inventory. Detect zero bytes embedded into config files and refuse to execute them.
Diffstat (limited to 'source/cl_parse.c')
-rw-r--r--source/cl_parse.c42
1 files changed, 14 insertions, 28 deletions
diff --git a/source/cl_parse.c b/source/cl_parse.c
index 23fa50f..f85e311 100644
--- a/source/cl_parse.c
+++ b/source/cl_parse.c
@@ -120,17 +120,13 @@ void CL_Download_f( void ) {
Com_Printf( "Must be connected to a server.\n" );
return;
}
-
- if( Cmd_Argc() != 2 ) {
- Com_Printf( "Usage: download <filename>\n" );
+ if( !allow_download->integer ) {
+ Com_Printf( "Downloading is disabled.\n" );
return;
}
- path = Cmd_Argv( 1 );
-
- if( !allow_download->integer ) {
- Com_Printf( "Couldn't download '%s', "
- "downloading is locally disabled.\n", path );
+ if( Cmd_Argc() != 2 ) {
+ Com_Printf( "Usage: download <filename>\n" );
return;
}
@@ -142,6 +138,8 @@ void CL_Download_f( void ) {
return;
}
+ path = Cmd_Argv( 1 );
+
if( FS_LoadFile( path, NULL ) != INVALID_LENGTH ) {
Com_Printf( "File '%s' already exists.\n", path );
return;
@@ -776,7 +774,7 @@ static void CL_ParseServerData( void ) {
int i, protocol, attractloop;
size_t len;
- Cbuf_Execute(); // make sure any stuffed commands are done
+ Cbuf_Execute( &cl_cmdbuf ); // make sure any stuffed commands are done
// wipe the client_state_t struct
CL_ClearState();
@@ -901,7 +899,7 @@ static void CL_ParseServerData( void ) {
Con_Printf( S_COLOR_ALT "%s\n\n", levelname );
#if USE_SYSCON
- Sys_Printf( "\n\n%s\n", levelname );
+ Sys_Printf( "%s\n", levelname );
#endif
// make sure clientNum is in range
@@ -1155,6 +1153,8 @@ static void CL_ParseReconnect( void ) {
cls.state = ca_challenging;
cls.connect_time = cls.realtime - CONNECT_DELAY;
cls.connect_count = 0;
+
+ CL_CheckForResend();
}
#if USE_AUTOREPLY
@@ -1261,29 +1261,15 @@ CL_ParseStuffText
=====================
*/
static void CL_ParseStuffText( void ) {
- char s[MAX_STRING_CHARS], *p;
+ char s[MAX_STRING_CHARS];
MSG_ReadString( s, sizeof( s ) );
- //if( cl_shownet->integer > 2 ) {
- // Com_Printf( " \"%s\"\n", Q_FormatString( s ) );
- //}
-
- // FIXME: this is uuugly...
- if( cls.demo.playback &&
- strcmp( s, "precache\n" ) &&
- strcmp( s, "changing\n" ) &&
- ( strncmp( s, "play ", 5 ) || !( p = strchr( s, '\n' ) ) ||
- p[1] || strchr( s, ';' ) || strchr( s, '$' ) ) &&
- strcmp( s, "reconnect\n" ) )
- {
- Com_DPrintf( "ignored stufftext: %s\n", s );
- return;
+ if( cl_shownet->integer > 2 ) {
+ Com_Printf( " \"%s\"\n", Q_FormatString( s ) );
}
- Com_DPrintf( "stufftext: %s\n", Q_FormatString( s ) );
-
- Cbuf_AddText( s );
+ Cbuf_AddText( &cl_cmdbuf, s );
}
/*