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 | |
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
-rw-r--r-- | src/client/cl_ui.c | 23 | ||||
-rw-r--r-- | src/server/sv_ccmds.c | 6 | ||||
-rw-r--r-- | src/ui/ui_main.c | 12 |
3 files changed, 38 insertions, 3 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: diff --git a/src/server/sv_ccmds.c b/src/server/sv_ccmds.c index a89b0f21..d0b5956b 100644 --- a/src/server/sv_ccmds.c +++ b/src/server/sv_ccmds.c @@ -157,6 +157,7 @@ static void SV_Map_f( void ) { qboolean killBots, cheat; char expanded[MAX_QPATH]; char mapname[MAX_QPATH]; + int i; map = Cmd_Argv(1); if ( !map ) { @@ -196,6 +197,11 @@ static void SV_Map_f( void ) { } else { Cvar_Set( "sv_cheats", "0" ); } + + // This forces the local master server IP address cache + // to be updated on sending the next heartbeat + for( i = 0; i < MAX_MASTER_SERVERS; i++ ) + sv_master[ i ]->modified = qtrue; } /* diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index b323322e..aadad4fa 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -5042,10 +5042,18 @@ static const char *UI_FeederItemText(float feederID, int index, int column, qhan netnames[atoi(Info_ValueForKey(info, "nettype"))] ); return hostname; } - else { + else + { + char *text; + Com_sprintf( hostname, sizeof(hostname), "%s", Info_ValueForKey(info, "hostname")); - return hostname; + // Strip leading whitespace + text = hostname; + while( *text != '\0' && *text == ' ' ) + text++; + + return text; } } case SORT_MAP : |