]> jfr.im git - irc/gameservirc.git/blobdiff - gameserv/config.cpp
Added code for the start of the DataLayer format as well as a basic FilePlayerDAO...
[irc/gameservirc.git] / gameserv / config.cpp
index 7e86f143e5b426957649437b4d194ddf3544cd37..306abbe31390ead6af8df8d5411b3fa1f5a330a5 100644 (file)
@@ -58,6 +58,7 @@ char *dragondata;             // File to store current dragon data in
 char *masterdata;              // File to store the master data in
 char *newsdata;                        // File to store news data in
 char *pidfile;                 // Process ID file
+char *scriptdir;        // Directory to store scripts in
 
 #if defined(P10)
 char *gsnum = "[]AAA";         // GameServ Numeric
@@ -109,6 +110,8 @@ void unload_config_file()
     delete [] nsname;
   if (nspass)
     delete [] nspass;
+  if (scriptdir)
+       delete [] scriptdir;
   
   configflags = 0;
 }
@@ -117,7 +120,7 @@ int load_config_file(char *config)
 {
   char *buf, *directive, *value;
   
-#define numdirectives 41
+#define numdirectives 42
   
   unload_config_file();
   
@@ -185,6 +188,7 @@ int load_config_file(char *config)
   directives[38].desc = "NUMROLLOVERFIGHTS - Number of forest fights to roll over";
   directives[39].desc = "FAIRFIGHTS - True/False as to whether or not to check for fair fights";
   directives[40].desc = "MAXNICKLEN - Maximum length a nickname can be";
+  directives[41].desc = "SCRIPTDIR - Directory to store scripts in";
   
   configflags = 0;
   
@@ -509,6 +513,13 @@ int load_config_file(char *config)
                  maxnicklen = stringtoint(value);
                  directives[40].done = true;
                }
+         else if (stricmp(directive, "SCRIPTDIR") == 0)
+               {
+                 value = strtok(NULL, " ");
+                 scriptdir = new char [strlen(value) + 1];
+                 strcpy(scriptdir, value);
+                 directives[41].done = true;
+               }
          else if (stricmp(directive, "WELCOMEMSG") == 0)
                {
                  // This directive is optional