]> jfr.im git - irc/gameservirc.git/blobdiff - gameserv/config.cpp
I've begun to add daily news and split up gameserv.cpp a bit
[irc/gameservirc.git] / gameserv / config.cpp
index 7adfa561a264a4abb7d9f61a58233508ee93eab0..9796938706e8c52639d7d2ff1a910e19cbd762f4 100644 (file)
@@ -40,6 +40,7 @@ char *remotepass;             // Password for the server link
 
 char *playerdata;              // File to store player data in
 char *monsterdata;             // File to load monster data from
+char *newsdata;                        // File to store news data in
 char *pidfile;                 // Process ID file
 
 #if defined(P10)
@@ -78,6 +79,8 @@ void unload_config_file()
        delete [] pidfile;
     if (ignoreserverslist)
        delete [] ignoreserverslist;
+    if (newsdata)
+       delete [] newsdata;
 
     configflags = 0;
 }
@@ -86,7 +89,7 @@ int load_config_file(char *config)
 {
     char *buf, *directive, *value;
 
-    #define numdirectives 21
+    #define numdirectives 22
 
     unload_config_file();
 
@@ -125,6 +128,7 @@ int load_config_file(char *config)
     directives[20].desc = "LISTENONC_FOREST - True/False as to "\
                                "whether or not to listen for forest "\
                                "commands on the forest channel";
+    directives[21].desc = "NEWSDATA - File to store daily news in";
 
     configflags = 0;
 
@@ -305,6 +309,13 @@ int load_config_file(char *config)
 
            directives[20].done = true;
        }
+       else if (stricmp(directive, "NEWSDATA") == 0)
+       {
+           value = strtok(NULL, " ");
+           newsdata = new char [strlen(value) + 1];
+           strcpy(newsdata, value);
+           directives[21].done = true;
+       }
        else if (stricmp(directive, "WELCOMEMSG") == 0)
        {
            // This directive is optional