]> jfr.im git - irc/gameservirc.git/blobdiff - gameserv/config.cpp
Added everything necessary to save overtop of the old dragon when someone beats the...
[irc/gameservirc.git] / gameserv / config.cpp
index ec3605e033bec55fe2d0f0815826883171964d5c..c9f72304184b1d8f25cd3a39e41043044da28135 100644 (file)
@@ -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