From 5c59bae1dff08446f24a8f16070a1eac6128ce66 Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Thu, 6 Dec 2001 19:23:52 +0000 Subject: [PATCH] - added rtcw gametypes - changed master protocol for rtcw to 57 - added a missing gettext call git-svn-id: http://svn.code.sf.net/p/xqf/code/trunk@115 d2ac09be-c843-0410-8b1f-f8a84130e0ec --- xqf/ChangeLog | 5 ++++ xqf/src/game.c | 81 ++++++++++++++++++++++++++++---------------------- xqf/src/pref.c | 5 ++-- 3 files changed, 54 insertions(+), 37 deletions(-) diff --git a/xqf/ChangeLog b/xqf/ChangeLog index 332587d..40ac4e6 100644 --- a/xqf/ChangeLog +++ b/xqf/ChangeLog @@ -1,3 +1,8 @@ +Dec 06, 2001: Ludwig Nussel +- added rtcw gametypes +- changed master protocol for rtcw to 57 +- added a missing gettext call + Nov 22, 2001: Ludwig Nussel - the ppc problem turned out to be a bug in filter.c, special thanks to Philipp Thomas for finding it! diff --git a/xqf/src/game.c b/xqf/src/game.c index b433ae2..b47396b 100644 --- a/xqf/src/game.c +++ b/xqf/src/game.c @@ -1094,34 +1094,30 @@ static char *q3a_tribalctf_gametypes[MAX_Q3A_TRIBALCTF_TYPES] = { NULL // 9+ ??? }; +#define MAX_WOLF_TYPES 9 +static char *wolf_gametypes[MAX_WOLF_TYPES] = { + NULL, // 0 - Unknown + NULL, // 1 - Unknown + NULL, // 2 - Unknown + NULL, // 3 - Unknown + NULL, // 4 - Unknown + "WolfMP", // 5 - standard objective mode + "WolfSW", // 6 - Stopwatch mode + "WolfCP", // 7 - Checkpoint mode + NULL // 8+ ??? +}; + static void q3_analyze_serverinfo (struct server *s) { char **info_ptr; char *endptr; long n; - int newtypes; char *fs_game=NULL; char *game=NULL; char *gamename=NULL; - int is_default=0; - if ((games[s->type].flags & GAME_SPECTATE) != 0) s->flags |= SERVER_SPECTATE; - // Get the server version first. - // If it is 1.2+, the new game types are used - for (info_ptr = s->info; info_ptr && *info_ptr; info_ptr += 2) { - if (strcmp (*info_ptr, "version") == 0) { - if (info_ptr[1][3] >= '1') // eg: 1 of 1.27 - { - if (info_ptr[1][5] >= '2') // eg: 2 of 1.27 - newtypes=1; - } - else - newtypes=0; - } - } - for (info_ptr = s->info; info_ptr && *info_ptr; info_ptr += 2) { /* @@ -1132,24 +1128,13 @@ static void q3_analyze_serverinfo (struct server *s) { --baa */ if (strcmp (*info_ptr, "fs_game") == 0) { - if (strcmp (info_ptr[1], "baseq3")) { fs_game = info_ptr[1]; - } - else is_default=1; } else if (strcmp (*info_ptr, "gamename") == 0) { - if (strcmp (info_ptr[1], "baseq3")) { - /* We only set the mod if the name is NOT baseq3. */ - gamename = info_ptr[1]; - } - else is_default=1; + gamename = info_ptr[1]; } else if (strcmp (*info_ptr, "game") == 0) { - if (strcmp (info_ptr[1], "baseq3")) { - /* We only set the mod if the name is NOT baseq3. */ - game = info_ptr[1]; - } - else is_default=1; + game = info_ptr[1]; } else if (strcmp (*info_ptr, "version" ) == 0) { @@ -1213,7 +1198,8 @@ static void q3_analyze_serverinfo (struct server *s) { if(s->gametype) { n = strtol (s->gametype, &endptr, 10); - if (endptr != s->gametype) { + if ( s->type == Q3_SERVER && endptr != s->gametype) + { if(s->game) { if (!strcmp(s->game,"osp")) { @@ -1252,16 +1238,41 @@ static void q3_analyze_serverinfo (struct server *s) { s->gametype = q3a_gametypes[n]; } - - } - else if (is_default == 1) - { + if (!strcasecmp (s->game, "baseq3")) + { if( n >= MAX_Q3A_TYPES ) n = MAX_Q3A_TYPES - 1; s->gametype = q3a_gametypes[n]; + } } } + if ( s->type == WO_SERVER && endptr != s->gametype) + { + if(s->game) + { + if (!strcasecmp (s->game, "main")) + { + if( n >= MAX_WOLF_TYPES ) + n = MAX_WOLF_TYPES - 1; + + s->gametype = wolf_gametypes[n]; + } + } + } + } + + // unset game if it's no mod + if ( s->game ) + { + if ( s->type == Q3_SERVER && !strcasecmp (s->game, "baseq3")) + { + s->game=NULL; + } + else if ( s->type == WO_SERVER && !strcasecmp (s->game, "main")) + { + s->game=NULL; + } } } diff --git a/xqf/src/pref.c b/xqf/src/pref.c index e7c62ef..748cb83 100644 --- a/xqf/src/pref.c +++ b/xqf/src/pref.c @@ -1507,7 +1507,7 @@ static GtkWidget *generic_game_frame (enum server_type type) { frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_OUT); - label = gtk_label_new (games[type].name); + label = gtk_label_new (_(games[type].name)); gtk_container_add (GTK_CONTAINER (frame), label); gtk_widget_show (label); @@ -1714,6 +1714,7 @@ static GtkWidget *games_config_page (int defgame) { #endif games_notebook = gtk_notebook_new (); + // the tabs are hidden, so nobody will notice its a notebook gtk_notebook_set_show_tabs (GTK_NOTEBOOK (games_notebook), FALSE); gtk_notebook_set_show_border (GTK_NOTEBOOK (games_notebook), FALSE); #if defined GAMES_RADIOS @@ -2868,7 +2869,7 @@ int prefs_load (void) { /* Wolfenstein */ config_push_prefix ("/" CONFIG_FILE "/Game: WOS"); - wo_opts.masterprotocol = config_get_string ("protocol=55"); + wo_opts.masterprotocol = config_get_string ("protocol=57"); if ( strlen( wo_opts.masterprotocol ) == 0 ) wo_opts.masterprotocol = NULL; wo_opts.vmfix = config_get_bool ("vmfix=false");