- move suggest_commands into xml file

- add support for UT2004. Someone please tell me a master server for it!


git-svn-id: http://svn.code.sf.net/p/xqf/code/trunk@593 d2ac09be-c843-0410-8b1f-f8a84130e0ec
This commit is contained in:
Ludwig Nussel 2004-02-13 20:29:20 +00:00 committed by l-n
parent 0ddd56764a
commit 9e12841566
10 changed files with 128 additions and 5 deletions

View File

@ -1,3 +1,7 @@
Feb 13, 2004: Ludwig Nussel <l-n@users.sourceforge.net>
- move suggest_commands into xml file
- add support for UT2004. Someone please tell me a master server for it!
Feb 09, 2004: Ludwig Nussel <l-n@users.sourceforge.net>
- introduce GAME_ADMIN which allows to enter an rcon password without actually
supporting rcon

View File

@ -124,6 +124,7 @@ struct unreal_private
static struct unreal_private ut_private = { NULL, ".unr" };
static struct unreal_private ut2_private = { NULL, ".ut2" };
static struct unreal_private ut2004_private = { NULL, ".ut2" };
static struct unreal_private rune_private = { NULL, ".run" };
static struct unreal_private postal2_private = { NULL, ".fuk" };
static struct unreal_private aao_private = { NULL, ".aao" };
@ -1093,6 +1094,7 @@ void init_games()
g_datalist_init(&games[i].games_data);
}
#if 0
game_set_attribute(Q1_SERVER,"suggest_commands",strdup("twilight-nq:nq-sgl:nq-glx:nq-sdl:nq-x11"));
game_set_attribute(Q2_SERVER,"suggest_commands",strdup("quake2"));
game_set_attribute(QW_SERVER,"suggest_commands",strdup("twilight-qw:qw-client-sgl:qw-client-glx:qw-client-sdl:qw-client-x11"));
@ -1104,6 +1106,7 @@ void init_games()
game_set_attribute(T2_SERVER,"suggest_commands",strdup("tribes2"));
game_set_attribute(UN_SERVER,"suggest_commands",strdup("ut"));
game_set_attribute(UT2_SERVER,"suggest_commands",strdup("ut2003:ut2003_demo"));
game_set_attribute(UT2004_SERVER,"suggest_commands",strdup("ut2004:ut2004demo"));
game_set_attribute(RUNE_SERVER,"suggest_commands",strdup("rune"));
game_set_attribute(AAO_SERVER,"suggest_commands",strdup("armyops"));
game_set_attribute(POSTAL2_SERVER,"suggest_commands",strdup("postal2mp:postal2mpdemo"));
@ -1112,6 +1115,7 @@ void init_games()
game_set_attribute(MOHAA_SERVER,"suggest_commands",strdup("mohaa"));
game_set_attribute(SAS_SERVER,"suggest_commands",strdup("savage"));
game_set_attribute(COD_SERVER,"suggest_commands",strdup("codmp"));
#endif
game_set_attribute(SFS_SERVER,"game_notes",strdup(_
("Note: Soldier of Fortune will not connect to a server correctly\n"\

View File

@ -80,6 +80,8 @@ struct game {
enum CPU (*identify_cpu) (struct server *s, const char *versionstr);
enum OS (*identify_os) (struct server *s, char *versionstr);
char* suggest_commands;
char *cmd;
char *dir;
char *real_dir;

View File

@ -18,6 +18,7 @@ struct game games[] = {
save_info : quake_save_info,
init_maps : quake_init_maps,
has_map : quake_has_map,
suggest_commands : "twilight-nq:nq-sgl:nq-glx:nq-sdl:nq-x11",
pd : &q1_private,
},
{
@ -42,6 +43,7 @@ struct game games[] = {
save_info : quake_save_info,
init_maps : quake_init_maps,
has_map : quake_has_map,
suggest_commands : "twilight-qw:qw-client-sgl:qw-client-glx:qw-client-sdl:qw-client-x11",
pd : &qw_private,
},
{
@ -68,6 +70,7 @@ struct game games[] = {
arch_identifier : "version",
identify_cpu : identify_cpu,
identify_os : identify_os,
suggest_commands : "quake2",
pd : &q2_private,
},
{
@ -94,6 +97,7 @@ struct game games[] = {
arch_identifier : "version",
identify_cpu : identify_cpu,
identify_os : identify_os,
suggest_commands : "q3:quake3",
pd : &q3_private,
},
{
@ -119,6 +123,7 @@ struct game games[] = {
arch_identifier : "version",
identify_cpu : identify_cpu,
identify_os : identify_os,
suggest_commands : "wolf",
pd : &wolf_private,
},
{
@ -144,6 +149,7 @@ struct game games[] = {
arch_identifier : "version",
identify_cpu : identify_cpu,
identify_os : identify_os,
suggest_commands : "et",
pd : &wolfet_private,
},
{
@ -166,6 +172,7 @@ struct game games[] = {
arch_identifier : "version",
identify_cpu : identify_cpu,
identify_os : identify_os,
suggest_commands : "q3:quake3",
},
{
type : H2_SERVER,
@ -271,6 +278,7 @@ struct game games[] = {
config_is_valid : config_is_valid_generic,
exec_client : q2_exec_generic,
save_info : quake_save_info,
suggest_commands : "sof",
},
{
type : SOF2S_SERVER,
@ -292,6 +300,7 @@ struct game games[] = {
arch_identifier : "version",
identify_cpu : identify_cpu,
identify_os : identify_os,
suggest_commands : "q3:quake3",
},
{
type : T2_SERVER,
@ -312,6 +321,7 @@ struct game games[] = {
save_info : quake_save_info,
arch_identifier : "linux",
identify_os : t2_identify_os,
suggest_commands : "tribes2",
},
{
type : HR_SERVER,
@ -346,6 +356,7 @@ struct game games[] = {
save_info : quake_save_info,
init_maps : unreal_init_maps,
has_map : unreal_has_map,
suggest_commands : "ut",
pd : &ut_private,
},
{
@ -365,8 +376,29 @@ struct game games[] = {
save_info : quake_save_info,
init_maps : unreal_init_maps,
has_map : unreal_has_map,
suggest_commands : "ut2003:ut2003_demo",
pd : &ut2_private,
},
{
type : UT2004_SERVER,
flags : GAME_CONNECT | GAME_SPECTATE | GAME_PASSWORD | GAME_LAUNCH_HOSTPORT,
name : "UT 2004",
default_port : 7777,
id : "UT2004S",
qstat_str : "UT2S",
qstat_option : "-ut2s",
icon : "ut2004_xpm",
parse_player : un_parse_player,
parse_server : quake_parse_server,
analyze_serverinfo : un_analyze_serverinfo,
config_is_valid : config_is_valid_generic,
exec_client : ut_exec,
save_info : quake_save_info,
init_maps : unreal_init_maps,
has_map : unreal_has_map,
suggest_commands : "ut2004:ut2004demo",
pd : &ut2004_private,
},
{
type : RUNE_SERVER,
flags : GAME_CONNECT | GAME_PASSWORD,
@ -384,6 +416,7 @@ struct game games[] = {
save_info : quake_save_info,
init_maps : unreal_init_maps,
has_map : unreal_has_map,
suggest_commands : "rune",
pd : &rune_private,
},
{
@ -403,6 +436,7 @@ struct game games[] = {
save_info : quake_save_info,
init_maps : unreal_init_maps,
has_map : unreal_has_map,
suggest_commands : "postal2mp:postal2mpdemo",
pd : &postal2_private,
},
{
@ -422,6 +456,7 @@ struct game games[] = {
save_info : quake_save_info,
init_maps : unreal_init_maps,
has_map : unreal_has_map,
suggest_commands : "armyops",
pd : &aao_private,
},
{
@ -441,6 +476,7 @@ struct game games[] = {
config_is_valid : config_is_valid_generic,
exec_client : exec_generic,
save_info : quake_save_info,
suggest_commands : "descent3",
},
{
type : SSAM_SERVER,
@ -457,6 +493,7 @@ struct game games[] = {
config_is_valid : config_is_valid_generic,
exec_client : ssam_exec,
save_info : quake_save_info,
suggest_commands : "ssamtfe",
},
{
type : SSAMSE_SERVER,
@ -473,6 +510,7 @@ struct game games[] = {
config_is_valid : config_is_valid_generic,
exec_client : ssam_exec,
save_info : quake_save_info,
suggest_commands : "ssamtse",
},
{
type : MOHAA_SERVER,
@ -497,6 +535,7 @@ struct game games[] = {
arch_identifier : "version",
identify_cpu : identify_cpu,
identify_os : identify_os,
suggest_commands : "mohaa",
pd : &mohaa_private,
},
{
@ -521,11 +560,12 @@ struct game games[] = {
get_mapshot : q3_get_mapshot,
identify_cpu : identify_cpu,
identify_os : identify_os,
suggest_commands : "codmp",
pd : &cod_private,
},
{
type : SAS_SERVER,
flags : GAME_CONNECT | GAME_PASSWORD,
flags : GAME_CONNECT | GAME_PASSWORD | GAME_ADMIN,
name : "Savage",
default_port : 11235,
id : "SAS",
@ -538,6 +578,7 @@ struct game games[] = {
config_is_valid : config_is_valid_generic,
exec_client : savage_exec,
save_info : quake_save_info,
suggest_commands : "savage",
},
{
type : BF1942_SERVER,

View File

@ -24,6 +24,7 @@
<arch_identifier/>
<identify_cpu/>
<identify_os/>
<suggest_commands/>
<pd/>
</game>
<game>
@ -42,6 +43,7 @@
<custom_cfgs>q1_custom_cfgs</custom_cfgs>
<init_maps>quake_init_maps</init_maps>
<has_map>quake_has_map</has_map>
<suggest_commands>twilight-nq:nq-sgl:nq-glx:nq-sdl:nq-x11</suggest_commands>
<pd>q1_private</pd>
</game>
<game>
@ -64,6 +66,7 @@
<custom_cfgs>qw_custom_cfgs</custom_cfgs>
<init_maps>quake_init_maps</init_maps>
<has_map>quake_has_map</has_map>
<suggest_commands>twilight-qw:qw-client-sgl:qw-client-glx:qw-client-sdl:qw-client-x11</suggest_commands>
<pd>qw_private</pd>
</game>
<game>
@ -88,6 +91,7 @@
<arch_identifier>version</arch_identifier>
<identify_cpu>identify_cpu</identify_cpu>
<identify_os>identify_os</identify_os>
<suggest_commands>quake2</suggest_commands>
<pd>q2_private</pd>
</game>
<game>
@ -112,6 +116,7 @@
<arch_identifier>version</arch_identifier>
<identify_cpu>identify_cpu</identify_cpu>
<identify_os>identify_os</identify_os>
<suggest_commands>q3:quake3</suggest_commands>
<pd>q3_private</pd>
</game>
<game>
@ -122,6 +127,7 @@
<icon>wo_xpm</icon>
<config_is_valid>config_is_valid_generic</config_is_valid>
<custom_cfgs>NULL</custom_cfgs>
<suggest_commands>wolf</suggest_commands>
<pd>wolf_private</pd>
</game>
<game>
@ -132,6 +138,7 @@
<icon>et_xpm</icon>
<config_is_valid>config_is_valid_generic</config_is_valid>
<custom_cfgs>NULL</custom_cfgs>
<suggest_commands>et</suggest_commands>
<pd>wolfet_private</pd>
</game>
<game>
@ -235,6 +242,7 @@
<parse_player>q2_parse_player</parse_player>
<analyze_serverinfo>q2_analyze_serverinfo</analyze_serverinfo>
<exec_client>q2_exec_generic</exec_client>
<suggest_commands>sof</suggest_commands>
</game>
<game>
<base>Q3_SERVER</base>
@ -267,6 +275,7 @@
<exec_client>t2_exec</exec_client>
<arch_identifier>linux</arch_identifier>
<identify_os>t2_identify_os</identify_os>
<suggest_commands>tribes2</suggest_commands>
</game>
<game>
<type>HR_SERVER</type>
@ -295,6 +304,7 @@
<exec_client>ut_exec</exec_client>
<init_maps>unreal_init_maps</init_maps>
<has_map>unreal_has_map</has_map>
<suggest_commands>ut</suggest_commands>
<pd>ut_private</pd>
</game>
<game>
@ -306,14 +316,28 @@
<qstat_str>UT2S</qstat_str>
<qstat_option>-ut2s</qstat_option>
<icon>ut2_xpm</icon>
<suggest_commands>ut2003:ut2003_demo</suggest_commands>
<pd>ut2_private</pd>
</game>
<game>
<base>UN_SERVER</base>
<type>UT2004_SERVER</type>
<name>UT 2004</name>
<flags>GAME_CONNECT | GAME_SPECTATE | GAME_PASSWORD | GAME_LAUNCH_HOSTPORT</flags>
<id>UT2004S</id>
<qstat_str>UT2S</qstat_str>
<qstat_option>-ut2s</qstat_option>
<icon>ut2004_xpm</icon>
<suggest_commands>ut2004:ut2004demo</suggest_commands>
<pd>ut2004_private</pd>
</game>
<game>
<base>UN_SERVER</base>
<type>RUNE_SERVER</type>
<name>Rune</name>
<id>RUNESRV</id>
<icon>rune_xpm</icon>
<suggest_commands>rune</suggest_commands>
<pd>rune_private</pd>
</game>
<game>
@ -322,6 +346,7 @@
<name>Postal 2</name>
<id>POSTAL2</id>
<icon>postal2_xpm</icon>
<suggest_commands>postal2mp:postal2mpdemo</suggest_commands>
<pd>postal2_private</pd>
</game>
<game>
@ -331,6 +356,7 @@
<flags>GAME_CONNECT | GAME_SPECTATE | GAME_PASSWORD | GAME_LAUNCH_HOSTPORT</flags>
<id>AMS</id>
<icon>aao_xpm</icon>
<suggest_commands>armyops</suggest_commands>
<pd>aao_private</pd>
</game>
<game>
@ -347,6 +373,7 @@
<parse_player>descent3_parse_player</parse_player>
<analyze_serverinfo>descent3_analyze_serverinfo</analyze_serverinfo>
<exec_client>exec_generic</exec_client>
<suggest_commands>descent3</suggest_commands>
</game>
<game>
<type>SSAM_SERVER</type>
@ -360,12 +387,14 @@
<parse_player>un_parse_player</parse_player>
<analyze_serverinfo>un_analyze_serverinfo</analyze_serverinfo>
<exec_client>ssam_exec</exec_client>
<suggest_commands>ssamtfe</suggest_commands>
</game>
<game>
<base>SSAM_SERVER</base>
<type>SSAMSE_SERVER</type>
<name>Serious Sam TSE</name>
<id>SMSSE</id>
<suggest_commands>ssamtse</suggest_commands>
</game>
<game>
<base>Q3_SERVER</base>
@ -378,6 +407,7 @@
<icon>mohaa_xpm</icon>
<config_is_valid>config_is_valid_generic</config_is_valid>
<custom_cfgs>NULL</custom_cfgs>
<suggest_commands>mohaa</suggest_commands>
<pd>mohaa_private</pd>
</game>
<game>
@ -394,8 +424,8 @@
<config_is_valid>config_is_valid_generic</config_is_valid>
<custom_cfgs>NULL</custom_cfgs>
<arch_identifier>NULL</arch_identifier>
<suggest_commands>codmp</suggest_commands>
<pd>cod_private</pd>
</game>
<game>
<type>SAS_SERVER</type>
@ -409,6 +439,7 @@
<parse_player>savage_parse_player</parse_player>
<analyze_serverinfo>savage_analyze_serverinfo</analyze_serverinfo>
<exec_client>savage_exec</exec_client>
<suggest_commands>savage</suggest_commands>
</game>
<game>
<type>BF1942_SERVER</type>

View File

@ -51,6 +51,7 @@ typedef enum
TAG_arch_identifier,
TAG_identify_cpu,
TAG_identify_os,
TAG_suggest_commands,
TAG_pd,
TAG_end_basic = TAG_pd,
@ -89,6 +90,7 @@ static const xmlChar* tagstr[] =
"arch_identifier",
"identify_cpu",
"identify_os",
"suggest_commands",
"pd",
"data",
"base",
@ -245,6 +247,7 @@ void printGame(FILE* f, RawGame* rg, RawGame* template)
case TAG_qstat_master_option:
case TAG_arch_identifier:
case TAG_pix:
case TAG_suggest_commands:
fprintf(f, " %-20s: \"%s\",\n", tagstr[tag], val);
break;
case TAG_pd:

View File

@ -64,6 +64,7 @@
#include "xpm/rune.xpm"
#include "xpm/descent3.xpm"
#include "xpm/ut2.xpm"
#include "xpm/ut2004.xpm"
#include "xpm/gamespy3d.xpm"
#include "xpm/ssam.xpm"

View File

@ -1976,7 +1976,7 @@ static void pref_guess_dir(enum server_type type)
*/
static gboolean pref_can_suggest(enum server_type type)
{
return (game_get_attribute(type,"suggest_commands")!=0);
return (games[type].suggest_commands != NULL);
}
/**
@ -1987,7 +1987,7 @@ static void pref_suggest_command(enum server_type type)
const char* files = NULL;
char* suggested_file = NULL;
files = game_get_attribute(type,"suggest_commands");
files = games[type].suggest_commands;
if(!files)
{
return;
@ -4712,7 +4712,7 @@ static void user_fix_defaults (void)
for (i = 0; i < GAMES_TOTAL; i++)
{
files = game_get_attribute(games[i].type,"suggest_commands");
files = games[i].suggest_commands;
if(!files) continue;
suggested_file = find_file_in_path(files);
if(!suggested_file) continue;

36
xqf/src/xpm/ut2004.xpm Normal file
View File

@ -0,0 +1,36 @@
/* XPM */
static char * ut2004_xpm[] = {
"16 16 17 1",
" c None",
". c #1C1835",
"+ c #D8B374",
"@ c #A9864E",
"# c #7F674E",
"$ c #4A49E5",
"% c #554F60",
"& c #725E72",
"* c #2F2E9E",
"= c #E9D6B3",
"- c #8880C6",
"; c #433F69",
"> c #D4C0AC",
", c #6763C9",
"' c #212063",
") c #CA984B",
"! c #A2918B",
" ",
" ",
" --, ",
" !,,$$,, ",
" >=-$,,>&*,+ ",
" >===**=>''; =",
" )%>=''=>''' >",
" +$*++''+)'.' @",
"> %**!@''+)..% ",
"+ **')@'.>).' ",
"@ *''))#-+)@# ",
" %'*@)+@&@# ",
" %...%.; ",
" %%% ",
" ",
" "};

View File

@ -111,6 +111,7 @@ enum server_type {
HR_SERVER,
UN_SERVER,
UT2_SERVER,
UT2004_SERVER,
RUNE_SERVER,
POSTAL2_SERVER,
AAO_SERVER,