-reconnect wont work if being called from the console (it never did but now
authorblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 14 Jun 2005 19:26:27 +0000 (19:26 +0000)
committerblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 14 Jun 2005 19:26:27 +0000 (19:26 +0000)
 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
netconn.c

index b88d27b..fae72a9 100644 (file)
@@ -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");
index e806457..280030d 100755 (executable)
--- 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;