X-Git-Url: https://jfr.im/git/irc/gameservirc.git/blobdiff_plain/accc7c20201425b55c4462263641efc331043a8c..c260a8d7699447c74d9a9ee8912582cc8814cec2:/gameserv/config.cpp diff --git a/gameserv/config.cpp b/gameserv/config.cpp index 7adfa56..9796938 100644 --- a/gameserv/config.cpp +++ b/gameserv/config.cpp @@ -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