- 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
This commit is contained in:
Ludwig Nussel 2001-12-06 19:23:52 +00:00 committed by l-n
parent 95a4f0e068
commit 5c59bae1df
3 changed files with 54 additions and 37 deletions

View File

@ -1,3 +1,8 @@
Dec 06, 2001: Ludwig Nussel <l-n@users.sourceforge.net>
- added rtcw gametypes
- changed master protocol for rtcw to 57
- added a missing gettext call
Nov 22, 2001: Ludwig Nussel <l-n@users.sourceforge.net> Nov 22, 2001: Ludwig Nussel <l-n@users.sourceforge.net>
- the ppc problem turned out to be a bug in filter.c, special thanks to Philipp - the ppc problem turned out to be a bug in filter.c, special thanks to Philipp
Thomas for finding it! Thomas for finding it!

View File

@ -1094,34 +1094,30 @@ static char *q3a_tribalctf_gametypes[MAX_Q3A_TRIBALCTF_TYPES] = {
NULL // 9+ ??? 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) { static void q3_analyze_serverinfo (struct server *s) {
char **info_ptr; char **info_ptr;
char *endptr; char *endptr;
long n; long n;
int newtypes;
char *fs_game=NULL; char *fs_game=NULL;
char *game=NULL; char *game=NULL;
char *gamename=NULL; char *gamename=NULL;
int is_default=0;
if ((games[s->type].flags & GAME_SPECTATE) != 0) if ((games[s->type].flags & GAME_SPECTATE) != 0)
s->flags |= SERVER_SPECTATE; 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) { for (info_ptr = s->info; info_ptr && *info_ptr; info_ptr += 2) {
/* /*
@ -1132,25 +1128,14 @@ static void q3_analyze_serverinfo (struct server *s) {
--baa --baa
*/ */
if (strcmp (*info_ptr, "fs_game") == 0) { if (strcmp (*info_ptr, "fs_game") == 0) {
if (strcmp (info_ptr[1], "baseq3")) {
fs_game = info_ptr[1]; fs_game = info_ptr[1];
} }
else is_default=1;
}
else if (strcmp (*info_ptr, "gamename") == 0) { 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]; gamename = info_ptr[1];
} }
else is_default=1;
}
else if (strcmp (*info_ptr, "game") == 0) { 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]; game = info_ptr[1];
} }
else is_default=1;
}
else if (strcmp (*info_ptr, "version" ) == 0) { else if (strcmp (*info_ptr, "version" ) == 0) {
if (strstr (info_ptr[1], "linux")) { if (strstr (info_ptr[1], "linux")) {
@ -1213,7 +1198,8 @@ static void q3_analyze_serverinfo (struct server *s) {
if(s->gametype) { if(s->gametype) {
n = strtol (s->gametype, &endptr, 10); n = strtol (s->gametype, &endptr, 10);
if (endptr != s->gametype) { if ( s->type == Q3_SERVER && endptr != s->gametype)
{
if(s->game) { if(s->game) {
if (!strcmp(s->game,"osp")) if (!strcmp(s->game,"osp"))
{ {
@ -1252,9 +1238,7 @@ static void q3_analyze_serverinfo (struct server *s) {
s->gametype = q3a_gametypes[n]; s->gametype = q3a_gametypes[n];
} }
if (!strcasecmp (s->game, "baseq3"))
}
else if (is_default == 1)
{ {
if( n >= MAX_Q3A_TYPES ) if( n >= MAX_Q3A_TYPES )
n = MAX_Q3A_TYPES - 1; n = MAX_Q3A_TYPES - 1;
@ -1263,6 +1247,33 @@ static void q3_analyze_serverinfo (struct server *s) {
} }
} }
} }
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;
}
}
} }
#endif #endif

View File

@ -1507,7 +1507,7 @@ static GtkWidget *generic_game_frame (enum server_type type) {
frame = gtk_frame_new (NULL); frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_OUT); 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_container_add (GTK_CONTAINER (frame), label);
gtk_widget_show (label); gtk_widget_show (label);
@ -1714,6 +1714,7 @@ static GtkWidget *games_config_page (int defgame) {
#endif #endif
games_notebook = gtk_notebook_new (); 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_tabs (GTK_NOTEBOOK (games_notebook), FALSE);
gtk_notebook_set_show_border (GTK_NOTEBOOK (games_notebook), FALSE); gtk_notebook_set_show_border (GTK_NOTEBOOK (games_notebook), FALSE);
#if defined GAMES_RADIOS #if defined GAMES_RADIOS
@ -2868,7 +2869,7 @@ int prefs_load (void) {
/* Wolfenstein */ /* Wolfenstein */
config_push_prefix ("/" CONFIG_FILE "/Game: WOS"); 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 ) if ( strlen( wo_opts.masterprotocol ) == 0 )
wo_opts.masterprotocol = NULL; wo_opts.masterprotocol = NULL;
wo_opts.vmfix = config_get_bool ("vmfix=false"); wo_opts.vmfix = config_get_bool ("vmfix=false");