X-Git-Url: https://jfr.im/git/irc/gameservirc.git/blobdiff_plain/451df086ac3cadf256173808e1ee8861bdf7611f..8e8005496ea89dc8d8c7ffb12c76836a4de701a4:/gameserv/config.cpp diff --git a/gameserv/config.cpp b/gameserv/config.cpp index ec3605e..c9f7230 100644 --- a/gameserv/config.cpp +++ b/gameserv/config.cpp @@ -45,6 +45,8 @@ char *remoteport; // Port to connect to on remoteserver char *remotepass; // Password for the server link char *playerdata; // File to store player data in +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 @@ -74,6 +76,10 @@ void unload_config_file() delete [] remotepass; if (playerdata) delete [] playerdata; + if (dragondata) + delete [] dragondata; + if (masterdata) + delete [] masterdata; if (adminpass) delete [] adminpass; if (welcomemsg) @@ -96,7 +102,7 @@ int load_config_file(char *config) { char *buf, *directive, *value; - #define numdirectives 28 + #define numdirectives 30 unload_config_file(); @@ -149,6 +155,9 @@ int load_config_file(char *config) "GameServ should identify with NickServ"; directives[26].desc = "NSNAME - Your network's NickServ nickname"; directives[27].desc = "NSPASS - GameServ's NickServ Password"; + directives[28].desc = "DRAGONDATA - File to store the current "\ + "dragon's stats in"; + directives[29].desc = "MASTERDATA - File to store the level master stats in"; configflags = 0; @@ -378,6 +387,20 @@ int load_config_file(char *config) strcpy(nspass, value); directives[27].done = true; } + else if (stricmp(directive, "DRAGONDATA") == 0) + { + value = strtok(NULL, ""); + dragondata = new char[strlen(value) + 1]; + strcpy(dragondata, value); + directives[28].done = true; + } + else if (stricmp(directive, "MASTERDATA") == 0) + { + value = strtok(NULL, ""); + masterdata = new char[strlen(value) + 1]; + strcpy(masterdata, value); + directives[29].done = true; + } else if (stricmp(directive, "WELCOMEMSG") == 0) { // This directive is optional