diff --git a/xqf/ChangeLog b/xqf/ChangeLog index aeb15a3..80f4ec4 100644 --- a/xqf/ChangeLog +++ b/xqf/ChangeLog @@ -1,3 +1,7 @@ +Dec 06, 2002: Ludwig Nussel +- Added support for Serious Sam, appropriate qstat config with "SMS" game type + required + Dec 05, 2002: Ludwig Nussel - display RTCW voteflags like dmflags diff --git a/xqf/src/game.c b/xqf/src/game.c index 470a50d..2352731 100644 --- a/xqf/src/game.c +++ b/xqf/src/game.c @@ -84,6 +84,7 @@ static int ut_exec (const struct condef *con, int forkit); static int t2_exec (const struct condef *con, int forkit); static int gamespy_exec (const struct condef *con, int forkit); static int exec_generic (const struct condef *con, int forkit); +static int ssam_exec (const struct condef *con, int forkit); static GList *q1_custom_cfgs (char *dir, char *game); static GList *qw_custom_cfgs (char *dir, char *game); @@ -652,6 +653,37 @@ struct game games[] = { NULL, // real_dir NULL // game_cfg }, + + { + SSAM_SERVER, + GAME_CONNECT, + "Serious Sam", + 25600, + 0, + "SMS", + "SMS", + "-sms", + NULL, + &ssam_pix, + + un_parse_player, + quake_parse_server, + un_analyze_serverinfo, + config_is_valid_generic, + NULL, + ssam_exec, + NULL, + quake_save_info, + NULL, // Custom arguments + NULL, // arch_identifier + NULL, // identify_cpu + NULL, // identify_os + NULL, // cmd + NULL, // dir + NULL, // real_dir + NULL // game_cfg + }, + // any game using the gamespy protocol { GPS_SERVER, // server_type @@ -736,6 +768,7 @@ void init_games() game_set_attribute(UN_SERVER,"suggest_commands",strdup("ut")); game_set_attribute(UT2_SERVER,"suggest_commands",strdup("ut2003:ut2003_demo")); game_set_attribute(RUNE_SERVER,"suggest_commands",strdup("rune")); + game_set_attribute(SSAM_SERVER,"suggest_commands",strdup("ssamtfe")); game_set_attribute(SFS_SERVER,"game_notes",strdup(_ ("Note: Soldier of Fortune not will connect to a server correctly\n"\ @@ -748,6 +781,8 @@ void init_games() game_set_attribute(HL_SERVER,"game_notes",strdup(_ ("Sample Command Line: wine hl.exe -- hl.exe -console"))); + game_set_attribute(SSAM_SERVER,"game_notes",strdup(_ + ("Note: You need to create a qstat config file for this game to work"))); } // retreive game specific value that belongs to key, do not free return value! @@ -2941,6 +2976,33 @@ static int exec_generic (const struct condef *con, int forkit) { return retval; } +// Serious Sam: only supports +connect +static int ssam_exec(const struct condef *con, int forkit) { + char *argv[32]; + int argi = 0; + char *cmd; + struct game *g = &games[con->s->type]; + int retval; + + cmd = strdup_strip (g->cmd); + + argv[argi++] = strtok (cmd, delim); + while ((argv[argi] = strtok (NULL, delim)) != NULL) + argi++; + + if (con->server) { + argv[argi++] = "+connect"; + argv[argi++] = con->server; + } + + argv[argi] = NULL; + + retval = client_launch_exec (forkit, g->real_dir, argv, con->s); + + g_free (cmd); + return retval; +} + // launch any game that uses the gamespy protocol // the first argument is the content of gamename field (may be empty), // the second one the ip of the server diff --git a/xqf/src/pixmaps.c b/xqf/src/pixmaps.c index 6327e49..3c355d9 100644 --- a/xqf/src/pixmaps.c +++ b/xqf/src/pixmaps.c @@ -57,6 +57,7 @@ #include "xpm/ut2.xpm" #include "xpm/gamespy3d.xpm" +#include "xpm/ssam.xpm" #include "xpm/green-plus.xpm" #include "xpm/red-minus.xpm" @@ -118,6 +119,7 @@ struct pixmap ut2_pix; struct pixmap rune_pix; struct pixmap descent3_pix; struct pixmap gamespy3d_pix; +struct pixmap ssam_pix; struct pixmap gplus_pix; struct pixmap rminus_pix; @@ -225,6 +227,7 @@ void free_pixmaps (void) { free_pixmap (&rune_pix); free_pixmap (&descent3_pix); free_pixmap (&gamespy3d_pix); + free_pixmap (&ssam_pix); free_pixmap (&gplus_pix); free_pixmap (&rminus_pix); @@ -302,6 +305,7 @@ void init_pixmaps (GtkWidget *window) { create_pixmap (window, &rune_pix, rune_xpm); create_pixmap (window, &descent3_pix, descent3_xpm); create_pixmap (window, &gamespy3d_pix, gamespy3d_xpm); + create_pixmap (window, &ssam_pix, ssam_xpm); create_pixmap (window, &gplus_pix, green_plus_xpm); create_pixmap (window, &rminus_pix, red_minus_xpm); diff --git a/xqf/src/pixmaps.h b/xqf/src/pixmaps.h index 073d9c4..0c340d8 100644 --- a/xqf/src/pixmaps.h +++ b/xqf/src/pixmaps.h @@ -66,6 +66,7 @@ extern struct pixmap ut2_pix; extern struct pixmap rune_pix; extern struct pixmap descent3_pix; extern struct pixmap gamespy3d_pix; +extern struct pixmap ssam_pix; extern struct pixmap gplus_pix; extern struct pixmap rminus_pix; diff --git a/xqf/src/stat.c b/xqf/src/stat.c index 49e97d6..b2107c6 100644 --- a/xqf/src/stat.c +++ b/xqf/src/stat.c @@ -917,7 +917,7 @@ static struct stat_conn *stat_update_master_qstat (struct stat_job *job, char* masterprotocol; - if (!games[m->type].qstat_master_option) + if (m->master_type!=MASTER_LAN && !games[m->type].qstat_master_option) return NULL; argv[argi++] = QSTAT_EXEC; diff --git a/xqf/src/xpm/ssam.xpm b/xqf/src/xpm/ssam.xpm new file mode 100644 index 0000000..63975dd --- /dev/null +++ b/xqf/src/xpm/ssam.xpm @@ -0,0 +1,25 @@ +/* XPM */ +/* extracted from SeriousSam.exe with wrestool */ +static char * ssam_xpm[] = { +"16 16 5 1", +" c None", +". c #FF0000", +"+ c #FFFF00", +"@ c #000000", +"# c #808000", +" . ", +" .+. ", +" ....++.... ", +" .+@++++++. ", +" .+@+@@@@#+. ", +"..++@#@@@@@@+...", +" .++@+@@#@#@#+. ", +" .++@#@+#@+@@+. ", +" .++@#@@@@@@@+. ", +"..+@@+@@#++@#+. ", +" ..+++#@@@@@+...", +" .+++++@@#+. ", +" .+++++++++. ", +" ....++.... ", +" . .. . ", +" .. "}; diff --git a/xqf/src/xqf.h b/xqf/src/xqf.h index 12bde5c..38dbe88 100644 --- a/xqf/src/xqf.h +++ b/xqf/src/xqf.h @@ -114,6 +114,7 @@ enum server_type { RUNE_SERVER, #endif DESCENT3_SERVER, + SSAM_SERVER, GPS_SERVER, UNKNOWN_SERVER };