From a2e9a7d0dc899b1feba44ad4ca57f7acaef64d91 Mon Sep 17 00:00:00 2001 From: Alex Burger Date: Sun, 26 Nov 2000 02:51:29 +0000 Subject: [PATCH] Update ChangeLog for 0.9.5a-beta git-svn-id: http://svn.code.sf.net/p/xqf/code/trunk@17 d2ac09be-c843-0410-8b1f-f8a84130e0ec --- xqf/ChangeLog | 4 ++++ xqf/README | 2 +- xqf/src/game.c | 37 ++++++++++++++++++++++++++++++++++++- xqf/src/xqf.c | 3 ++- 4 files changed, 43 insertions(+), 3 deletions(-) diff --git a/xqf/ChangeLog b/xqf/ChangeLog index a5d6b88..531d808 100644 --- a/xqf/ChangeLog +++ b/xqf/ChangeLog @@ -1,3 +1,7 @@ +Nov 24th 2000: Alex Burger +-Version changed to XQF 0.9.5a-beta +-Fixed UT launching. Now passes proper parameters to UT + Nov 18th 2000: Alex Burger -Version changed to XQF 0.9.5 diff --git a/xqf/README b/xqf/README index 8f8790b..e361f20 100644 --- a/xqf/README +++ b/xqf/README @@ -1,5 +1,5 @@ - XQF 0.9.5 + XQF 0.9.5a beta (November 18th 2000) DESCRIPTION diff --git a/xqf/src/game.c b/xqf/src/game.c index 5488cfa..e8eedbc 100644 --- a/xqf/src/game.c +++ b/xqf/src/game.c @@ -71,6 +71,7 @@ static int qw_exec (const struct condef *con, int forkit); static int q3_exec (const struct condef *con, int forkit); #endif static int q2_exec_generic (const struct condef *con, int forkit); +static int ut_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); @@ -368,7 +369,7 @@ struct game games[] = { NULL, config_is_valid_generic, NULL, - q2_exec_generic, + ut_exec, NULL, quake_save_info }, @@ -1511,6 +1512,40 @@ static int q2_exec_generic (const struct condef *con, int forkit) { return retval; } +static int ut_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++; + +// Pass server IP address first otherwise it won't work. +// Make sure ut/ut script (from installed game) contains +// exec "./ut-bin" $* -log and not -log $* at the end +// otherwise XQF you can not connect via the command line! + + if (con->server) { + argv[argi++] = con->server; + } + + if (default_nosound) { + argv[argi++] = "-nosound"; + } + + argv[argi] = NULL; + + retval = client_launch_exec (forkit, g->real_dir, argv, con->s); + + g_free (cmd); + return retval; +} + static char *dir_custom_cfg_filter (const char *dir, const char *str) { static const char *cfgext[] = { ".cfg", ".scr", ".rc", NULL }; diff --git a/xqf/src/xqf.c b/xqf/src/xqf.c index d66b9c8..e8c02be 100644 --- a/xqf/src/xqf.c +++ b/xqf/src/xqf.c @@ -573,7 +573,8 @@ static void launch_close_handler (struct stat_job *job, int killed) { } } - con->server = g_strdup_printf ("%s:%5d", inet_ntoa (s->host->ip), s->port); +// con->server = g_strdup_printf ("%s:%5d", inet_ntoa (s->host->ip), s->port); + con->server = g_strdup_printf ("%s:%d", inet_ntoa (s->host->ip), s->port); con->gamedir = g_strdup (s->game); if (props && props->rcon_password)