]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
-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 b88d27bcfd993d21693465b0e4a22ca5ce93ae2b..fae72a98624ba40d157eacf316ba7099dcd6ad49 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 e806457a982f37858feff5696b04ea34272af859..280030d708b4105457972adf3665f405d113b55e 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;