shithub: choc

Download patch

ref: f4eb88dd2322db7831563ad55f8b6c45516906f9
parent: 57a9f56e2cba50249ee8a96533c8baed47814f92
author: Simon Howard <[email protected]>
date: Sun Dec 12 08:11:11 EST 2010

Add -privateserver and -servername options to chocolate-server manpage.
Add server registration option to setup tool (thanks exp(x)).

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 2220

--- a/man/chocolate-server.6
+++ b/man/chocolate-server.6
@@ -29,6 +29,12 @@
 .TP
 \fB-port <n>\fR
 Use the specified UDP port for communications, instead of the default (2342). 
+.TP
+\fB-privateserver\fR
+Don't register with the global master server.
+.TP
+\fB-servername <name>\fR
+Specify a name for the server.
 .SH SEE ALSO
 \fBchocolate-doom\fR(6),
 \fBchocolate-setup\fR(6)
--- a/setup/multiplayer.c
+++ b/setup/multiplayer.c
@@ -115,6 +115,7 @@
 static int respawn = 0;
 static int udpport = 2342;
 static int timer = 0;
+static int privateserver = 0;
 
 static txt_dropdown_list_t *skillbutton;
 static txt_button_t *warpbutton;
@@ -252,6 +253,11 @@
         {
             AddCmdLineParameter(exec, "-timer %i", timer);
         }
+
+        if (privateserver)
+        {
+            AddCmdLineParameter(exec, "-privateserver");
+        }
     }
 
     AddWADs(exec);
@@ -611,14 +617,12 @@
                    TXT_NewCheckBox("Respawning monsters", &respawn),
                    TXT_NewSeparator("Advanced"),
                    advanced_table = TXT_NewTable(2),
-                   TXT_NewButton2("Add extra parameters...", 
-                                  OpenExtraParamsWindow, NULL),
                    NULL);
 
     TXT_SetWindowAction(window, TXT_HORIZ_CENTER, WadWindowAction());
     TXT_SetWindowAction(window, TXT_HORIZ_RIGHT, StartGameAction(multiplayer));
     
-    TXT_SetColumnWidths(gameopt_table, 12, 12);
+    TXT_SetColumnWidths(gameopt_table, 12, 6);
 
     TXT_AddWidgets(gameopt_table,
            TXT_NewLabel("Game"),
@@ -640,13 +644,21 @@
                                NULL),
                NULL);
 
-        TXT_AddWidgets(advanced_table, 
+        TXT_AddWidget(window,
+                      TXT_NewInvertedCheckBox("Register with master server",
+                                              &privateserver));
+
+        TXT_AddWidgets(advanced_table,
                        TXT_NewLabel("UDP port"),
                        TXT_NewIntInputBox(&udpport, 5),
                        NULL);
     }
 
-    TXT_SetColumnWidths(advanced_table, 12, 12);
+    TXT_AddWidget(window,
+                  TXT_NewButton2("Add extra parameters...", 
+                                 OpenExtraParamsWindow, NULL));
+
+    TXT_SetColumnWidths(advanced_table, 12, 6);
 
     TXT_SignalConnect(iwad_selector, "changed", UpdateWarpType, NULL);