From 6b892b39592bc3fdf7e94616917f39ec071d390d Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Sun, 3 Dec 2006 23:01:59 +0000 Subject: * Strip leading whitespace when displaying server names in the browser * Sort by server name on alpha characters only * Refresh master server IP address cache on map change --- src/client/cl_ui.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/client') diff --git a/src/client/cl_ui.c b/src/client/cl_ui.c index caa9179f..3b35709a 100644 --- a/src/client/cl_ui.c +++ b/src/client/cl_ui.c @@ -410,7 +410,28 @@ static int LAN_CompareServers( int source, int sortKey, int sortDir, int s1, int res = 0; switch( sortKey ) { case SORT_HOST: - res = Q_stricmp( server1->hostName, server2->hostName ); + { + char hostName1[ MAX_HOSTNAME_LENGTH ]; + char hostName2[ MAX_HOSTNAME_LENGTH ]; + char *p; + int i; + + for( p = server1->hostName, i = 0; *p != '\0'; p++ ) + { + if( Q_isalpha( *p ) ) + hostName1[ i++ ] = *p; + } + hostName1[ i ] = '\0'; + + for( p = server2->hostName, i = 0; *p != '\0'; p++ ) + { + if( Q_isalpha( *p ) ) + hostName2[ i++ ] = *p; + } + hostName2[ i ] = '\0'; + + res = Q_stricmp( hostName1, hostName2 ); + } break; case SORT_MAP: -- cgit