Author Topic: No New Players  (Read 1052 times)

Offline quixadhal

  • BFF
  • ***
  • Posts: 631
    • View Profile
    • WileyMUD
No New Players
« on: September 26, 2014, 11:33:49 AM »
This prevents the creation of new characters.

Code: [Select]
diff --git a/lib/secure/lib/connect.c b/lib/secure/lib/connect.c
index 9983c30..a3fde2c 100644
--- a/lib/secure/lib/connect.c
+++ b/lib/secure/lib/connect.c
@@ -219,6 +219,12 @@ static void InputName(string namen, string kill_me) {
         }
     }
     if( !user_exists(Name) ) {
+        if ( !ALLOW_NEW_PLAYERS ) {
+            receive("\nSorry, new players are not allowed at this time.\n");
+            flush_messages();
+            Destruct();
+            return;
+        }
         eventCreatePlayer(name);
         return;
     }

Code: [Select]
diff --git a/lib/secure/include/config.h b/lib/secure/include/config.h
index b5fca26..674faa9 100644
--- a/lib/secure/include/config.h
+++ b/lib/secure/include/config.h
@@ -8,7 +8,7 @@
 #define LOCAL_NEWS_PREFIX        "nm"
 #define MUD_IS_LOCKED            0
 #define AUTO_WIZ                 0
-#define RESTRICTED_INTERMUD      0
+#define RESTRICTED_INTERMUD      1
 #define DISABLE_INTERMUD         0
 #define DISABLE_IMC2             1
 #define MINUTES_REBOOT_WARNING   20
@@ -92,6 +92,7 @@
 #define MINIMAP                  1
 #define WIZMAP                   1
 #define GRID                     1
+#define ALLOW_NEW_PLAYERS        0
 #define ENABLE_INSTANCES         0
 #define CED_DISABLED             1
 #define CHANNEL_PIPES            1

Code: [Select]
diff --git a/lib/secure/cmds/admins/mudconfig.c b/lib/secure/cmds/admins/mudconfig.c
index 3a59d09..81b43da 100755
--- a/lib/secure/cmds/admins/mudconfig.c
+++ b/lib/secure/cmds/admins/mudconfig.c
@@ -27,7 +27,7 @@ string array modals = antimodals + ({ "channelpipes", "fastcombat",
         "compat", "exitsbare", "nmexits", "grid", "minimap", "wizmap",
         "cgi", "dirlist", "creweb", "selectclass", "severable",
         "retain", "defaultparse", "disablereboot", "loglocal", "logremote",
-        "questrequired", "autoadvance" });
+        "questrequired", "autoadvance", "newplayers" });
 string array inet_services = ({ "oob", "hftp", "ftp", "http", "rcp", "inet" });

 static int NotImplemented(string which);
@@ -480,7 +480,11 @@ static int ProcessOther(string which, string arg){
                 return 1;
         }
     if(which == "PING_INTERVAL") reload (PING_D,1,1);
-        return 1;
+    if(which == "ALLOW_NEW_PLAYERS") {
+        reload ("/secure/cmds/admins/mudconfig.c",1,1);
+        reload ("/secure/lib/connect.c",1,1);
+    }
+    return 1;
 }

 static int ProcessString(string which, string arg){
@@ -574,6 +578,7 @@ static int ProcessModal(string which, string arg){
                 case "minimap" : which = "MINIMAP";break;
                 case "wizmap" : which = "WIZMAP";break;
                 case "grid" : which = "GRID";break;
+                case "newplayers" : which = "ALLOW_NEW_PLAYERS";break;
             default : break;
         }
     foreach(string element in config){
@@ -1000,6 +1005,7 @@ string MyGetHelp(){
             "\nmudconfig minimap         [" + ( MINIMAP == 1 ? "%^B_GREEN%^" : "" ) + " yes %^RESET%^|" + ( MINIMAP == 0 ? "%^B_RED%^" : "" ) + " no %^RESET%^]  (Whether players get a minimap
             "\nmudconfig wizmap          [" + ( WIZMAP == 1 ? "%^B_GREEN%^" : "" ) + " yes %^RESET%^|" + ( WIZMAP == 0 ? "%^B_RED%^" : "" ) + " no %^RESET%^]  (Whether cres get an area map.)"
             "\nmudconfig grid            [" + ( GRID == 1 ? "%^B_GREEN%^" : "" ) + " yes %^RESET%^|" + ( GRID == 0 ? "%^B_RED%^" : "" ) + " no %^RESET%^]  (Enable or disable the room grid sys
+            "\nmudconfig newplayers      [" + ( ALLOW_NEW_PLAYERS == 1 ? "%^B_GREEN%^" : "" ) + " yes %^RESET%^|" + ( ALLOW_NEW_PLAYERS == 0 ? "%^B_RED%^" : "" ) + " no %^RESET%^]  (Enable or
             "\nmudconfig compat          [" + ( COMPAT_MODE == 1 ? "%^B_GREEN%^" : "" ) + " yes %^RESET%^|" + ( COMPAT_MODE == 0 ? "%^B_RED%^" : "" ) + " no %^RESET%^]"
             "\nmudconfig retain          [" + ( RETAIN_ON_QUIT == 1 ? "%^B_GREEN%^" : "" ) + " yes %^RESET%^|" + ( RETAIN_ON_QUIT == 0 ? "%^B_RED%^" : "" ) + " no %^RESET%^]  (Whether items a
             "\nmudconfig defaultparse    [" + ( DEFAULT_PARSING == 1 ? "%^B_GREEN%^" : "" ) + " yes %^RESET%^|" + ( DEFAULT_PARSING == 0 ? "%^B_RED%^" : "" ) + " no %^RESET%^]"
@@ -1118,6 +1124,7 @@ string GetHelp(){
         output += ({ sprintf( "  %-=15s %-=*s %=36s", "localtime",      width-2-15-1+(LOCAL_TIME ? ena_width : dis_width)-1-36-2,         (LOCAL_TIME ? enabled : disabled),         "use local

         output += ({ sprintf( "%%^BOLD%%^%%^CYAN%%^%|*'='s%%^RESET%%^", width, "[ CHARACTER OPTIONS ]") });
+        output += ({ sprintf( "  %-=15s %-=*s %=36s", "newplayers",     width-2-15-1+(ALLOW_NEW_PLAYERS ? ena_width : dis_width)-1-36-2,  (ALLOW_NEW_PLAYERS ? enabled : disabled),  "allow new
         output += ({ sprintf( "  %-=15s %-=*s %=36s", "autowiz",        width-2-15-1+(AUTO_WIZ ? ena_width : dis_width)-1-36-2,           (AUTO_WIZ ? enabled : disabled),           "all users
         output += ({ sprintf( "  %-=15s %-=*s %=36s", "justhumans",     width-2-15-1+(HUMANS_ONLY ? ena_width : dis_width)-1-36-2,        (HUMANS_ONLY ? enabled : disabled),        "restrict
         output += ({ sprintf( "  %-=15s %-=*s %=36s", "justenglish",    width-2-15-1+(ENGLISH_ONLY ? ena_width : dis_width)-1-36-2,       (ENGLISH_ONLY ? enabled : disabled),       "restrict