summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher Schwarz <lakitu7@gmail.com>2011-01-22 15:33:51 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:17:53 +0000
commitdcc1aa0ccfef2ff8d14e96c61102214c5536ae4d (patch)
treec1435bf696323ea987d5e674c3a71a655eaa5300 /src
parentb5dbdb31d3b685c1eea1c35d204b371e516d2630 (diff)
* (bug 3013) Add gametype column to server browser (Rezyn, with thanks to Jackmcbarn, Risujin)
Diffstat (limited to 'src')
-rw-r--r--src/client/cl_main.c5
-rw-r--r--src/client/cl_ui.c3
-rw-r--r--src/ui/ui_main.c3
-rw-r--r--src/ui/ui_public.h1
4 files changed, 11 insertions, 1 deletions
diff --git a/src/client/cl_main.c b/src/client/cl_main.c
index 15df946f..81cb98ac 100644
--- a/src/client/cl_main.c
+++ b/src/client/cl_main.c
@@ -3561,11 +3561,14 @@ void CL_Shutdown( void ) {
static void CL_SetServerInfo(serverInfo_t *server, const char *info, int ping) {
if (server) {
if (info) {
+ const char *game;
+
server->clients = atoi(Info_ValueForKey(info, "clients"));
Q_strncpyz(server->hostName,Info_ValueForKey(info, "hostname"), MAX_HOSTNAME_LENGTH );
Q_strncpyz(server->mapName, Info_ValueForKey(info, "mapname"), MAX_NAME_LENGTH);
server->maxClients = atoi(Info_ValueForKey(info, "sv_maxclients"));
- Q_strncpyz(server->game,Info_ValueForKey(info, "game"), MAX_NAME_LENGTH);
+ game = Info_ValueForKey(info, "game");
+ Q_strncpyz(server->game, (game[0]) ? game : BASEGAME, MAX_NAME_LENGTH);
server->gameType = atoi(Info_ValueForKey(info, "gametype"));
server->netType = atoi(Info_ValueForKey(info, "nettype"));
server->minPing = atoi(Info_ValueForKey(info, "minping"));
diff --git a/src/client/cl_ui.c b/src/client/cl_ui.c
index faa2dbab..ef53ebd8 100644
--- a/src/client/cl_ui.c
+++ b/src/client/cl_ui.c
@@ -458,6 +458,9 @@ static int LAN_CompareServers( int source, int sortKey, int sortDir, int s1, int
}
break;
+ case SORT_GAME:
+ res = Q_stricmp( server1->game, server2->game );
+ break;
case SORT_MAP:
res = Q_stricmp( server1->mapName, server2->mapName );
break;
diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c
index 3c1d21ec..b776521e 100644
--- a/src/ui/ui_main.c
+++ b/src/ui/ui_main.c
@@ -3617,6 +3617,9 @@ static const char *UI_FeederItemText( int feederID, int index, int column, qhand
}
}
+ case SORT_GAME:
+ return Info_ValueForKey( info, "game" );
+
case SORT_MAP:
return Info_ValueForKey( info, "mapname" );
diff --git a/src/ui/ui_public.h b/src/ui/ui_public.h
index f746eb38..edf2742f 100644
--- a/src/ui/ui_public.h
+++ b/src/ui/ui_public.h
@@ -152,6 +152,7 @@ uiMenuCommand_t;
typedef enum
{
SORT_HOST,
+ SORT_GAME,
SORT_MAP,
SORT_CLIENTS,
SORT_PING