]> jfr.im git - irc/gameservirc.git/blobdiff - gameserv/config.cpp
Updated the change log for the numrolloverfights directive
[irc/gameservirc.git] / gameserv / config.cpp
index 4df34843d9d4a61184f1c70f42ba34abcc3692fc..1f23d394807a82153d3f475b0ff4b55bf0cc8665 100644 (file)
@@ -37,7 +37,10 @@ int level1expire;            // Days for level 1 players to expire
 int defaultexpire;             // Days for other levels to expire
 int maxitems;                   // Maximum amount of items a player can carry
 long refreshperiod;            // Period for refreshing players
-long configflags;              // Holds the bit representation of some boolean values
+long rolloverperiod;            // Period for rolling over forest fights
+long configflags;              // Holds the binary representation of some boolean values
+long maxforestfights;           // Maximum amount of forest fights to roll over
+long numrolloverfights;         // Number of forest fights to roll over
 
 // Remote server stuff. This is used for the outgoing connection gameserv needs to make
 // to a real ircd.
@@ -113,7 +116,7 @@ int load_config_file(char *config)
 {
     char *buf, *directive, *value;
 
-    #define numdirectives 35
+    #define numdirectives 39
 
     unload_config_file();
 
@@ -174,6 +177,11 @@ int load_config_file(char *config)
     directives[32].desc = "MAXITEMS - Maximum number of items a player can carry";
     directives[33].desc = "STOREITEMDATA - File in which to store the items that are available in the store";
     directives[34].desc = "LOCALHOST - Local hostname or IP to bind to when connecting to the remote server";
+    directives[35].desc = "ROLLOVERFORESTFIGHTS - True/False as to wether or not to roll over forest fights "\
+      "into the next day";
+    directives[36].desc = "MAXFORESTFIGHTS - Maximum amount of forest fights to roll over";
+    directives[37].desc = "ROLLOVERPERIOD - Period (in seconds) to rollover forest fights";
+    directives[38].desc = "NUMROLLOVERFIGHTS - Number of forest fights to roll over";
 
     configflags = 0;
 
@@ -450,6 +458,39 @@ int load_config_file(char *config)
            strcpy(localhost, value);
            directives[34].done = true;
          }
+       else if (stricmp(directive, "ROLLOVERFORESTFIGHTS") == 0)
+         {
+           value = strtok(NULL, " ");
+           if (stricmp(value, "TRUE") == 0)
+             {
+               setRolloverForestFights();
+             }
+           else
+             {
+               directives[36].done = true;
+               directives[37].done = true;
+               directives[38].done = true;
+             }
+           directives[35].done = true;
+         }
+       else if (stricmp(directive, "MAXFORESTFIGHTS") == 0)
+         {
+           value = strtok(NULL, "");
+           maxforestfights = stringtoint(value);
+           directives[36].done = true;
+         }
+       else if (stricmp(directive, "ROLLOVERPERIOD") == 0)
+         {
+           value = strtok(NULL, "");
+           rolloverperiod = stringtoint(value);
+           directives[37].done = true;
+         }
+       else if (stricmp(directive, "NUMROLLOVERFIGHTS") == 0)
+         {
+           value = strtok(NULL, "");
+           numrolloverfights = stringtoint(value);
+           directives[38].done = true;
+         }
        else if (stricmp(directive, "WELCOMEMSG") == 0)
        {
            // This directive is optional