summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2006-06-03 12:38:24 +0000
committerSimon Howard2006-06-03 12:38:24 +0000
commit267d98c2325b2fbd78df25eff79ae6f048f48cfe (patch)
treee029e5022415dff9af161e4a588acb0e9b7a913f
parent48d2fd26ca4c1de5112103788841751619ebfe9c (diff)
downloadchocolate-doom-267d98c2325b2fbd78df25eff79ae6f048f48cfe.tar.gz
chocolate-doom-267d98c2325b2fbd78df25eff79ae6f048f48cfe.tar.bz2
chocolate-doom-267d98c2325b2fbd78df25eff79ae6f048f48cfe.zip
Bomb out with an error message if game options are specified to a
dedicated server. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 555
-rw-r--r--src/net_dedicated.c36
1 files changed, 36 insertions, 0 deletions
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);