From 629a49b07e02ea193b10e069540cce2f9741e1a9 Mon Sep 17 00:00:00 2001 From: black Date: Tue, 14 Jun 2005 19:26:27 +0000 Subject: [PATCH] -reconnect wont work if being called from the console (it never did but now it wont get you into this 'zombie' state). -changed the severlist string compare function to convert all strings to lowercase before comparing. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5435 d7cf8633-e32d-0410-b094-e92efae38249 --- host_cmd.c | 5 +++++ netconn.c | 25 ++++++++++++++++--------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/host_cmd.c b/host_cmd.c index b88d27bc..fae72a98 100644 --- a/host_cmd.c +++ b/host_cmd.c @@ -369,6 +369,11 @@ This is sent just before a server changes levels */ void Host_Reconnect_f (void) { + if (cmd_source == src_command) + { + Con_Print("reconnect is not valid from the console\n"); + return; + } if (Cmd_Argc() != 1) { Con_Print("reconnect : wait for signon messages again\n"); diff --git a/netconn.c b/netconn.c index e806457a..280030d7 100755 --- a/netconn.c +++ b/netconn.c @@ -206,25 +206,32 @@ static qboolean _ServerList_CompareInt( int A, serverlist_maskop_t op, int B ) static qboolean _ServerList_CompareStr( const char *A, serverlist_maskop_t op, const char *B ) { + char bufferA[ 256 ], bufferB[ 256 ]; // should be more than enough + strcpy( bufferA, A ); + strlwr( bufferA ); + + strcpy( bufferB, B ); + strlwr( bufferB ); + // Same here, also using an intermediate & final return would be more appropriate // A info B mask switch( op ) { - case SLMO_CONTAINS: - return *B && !!strstr( A, B ); // we want a real bool + case SLMO_CONTAINS: + return *bufferB && !!strstr( bufferA, bufferB ); // we want a real bool case SLMO_NOTCONTAIN: - return !*B || !strstr( A, B ); + return !*bufferB || !strstr( bufferA, bufferB ); case SLMO_LESS: - return strcmp( A, B ) < 0; + return strcmp( bufferA, bufferB ) < 0; case SLMO_LESSEQUAL: - return strcmp( A, B ) <= 0; + return strcmp( bufferA, bufferB ) <= 0; case SLMO_EQUAL: - return strcmp( A, B ) == 0; + return strcmp( bufferA, bufferB ) == 0; case SLMO_GREATER: - return strcmp( A, B ) > 0; + return strcmp( bufferA, bufferB ) > 0; case SLMO_NOTEQUAL: - return strcmp( A, B ) != 0; + return strcmp( bufferA, bufferB ) != 0; case SLMO_GREATEREQUAL: - return strcmp( A, B ) >= 0; + return strcmp( bufferA, bufferB ) >= 0; default: Con_DPrint( "_ServerList_CompareStr: Bad op!\n" ); return false; -- 2.39.2