From 267d98c2325b2fbd78df25eff79ae6f048f48cfe Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 3 Jun 2006 12:38:24 +0000 Subject: Bomb out with an error message if game options are specified to a dedicated server. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 555 --- src/net_dedicated.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src') diff --git a/src/net_dedicated.c b/src/net_dedicated.c index 77ad1a99..d67107b2 100644 --- a/src/net_dedicated.c +++ b/src/net_dedicated.c @@ -30,12 +30,48 @@ #include "i_system.h" #include "i_timer.h" +#include "m_argv.h" + #include "net_defs.h" #include "net_sdl.h" #include "net_server.h" +// +// People can become confused about how dedicated servers work. Game +// options are specified to the controlling player who is the first to +// join a game. Bomb out with an error message if game options are +// specified to a dedicated server. +// + +static char *not_dedicated_options[] = +{ + "-deh", "-iwad", "-cdrom", "-gameversion", "-nomonsters", "-respawn", + "-fast", "-altdeath", "-deathmatch", "-turbo", "-merge", "-af", "-as", + "-aa", "-file", "-wart", "-skill", "-episode", "-timer", "-avg", "-warp", + "-loadgame", "-longtics", "-extratics", "-dup", NULL, +}; + +static void CheckForClientOptions(void) +{ + int i; + + for (i=0; not_dedicated_options[i] != NULL; ++i) + { + if (M_CheckParm(not_dedicated_options[i]) > 0) + { + I_Error("The command line parameter '%s' was specified to a " + "dedicated server.\nGame parameters should be specified " + "to the first player to join a server, \nnot to the " + "server itself. ", + not_dedicated_options[i]); + } + } +} + void NET_DedicatedServer(void) { + CheckForClientOptions(); + NET_SV_Init(); NET_SV_AddModule(&net_sdl_module); -- cgit v1.2.3