diff options
author | Tim Angus <tim@ngus.net> | 2006-12-03 23:01:59 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2006-12-03 23:01:59 +0000 |
commit | 6b892b39592bc3fdf7e94616917f39ec071d390d (patch) | |
tree | 6da91cb1747f98967296fbeaec88e68f242a857a /src/client | |
parent | 344618181104012d609532848c5b1b0529247fa2 (diff) |
* 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
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/cl_ui.c | 23 |
1 files changed, 22 insertions, 1 deletions
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: |