]> jfr.im git - irc/gameservirc.git/blobdiff - gameserv/config.cpp
Bugfix relating to player fights (in Changes file) and fixed the run script.
[irc/gameservirc.git] / gameserv / config.cpp
index abdb4d2423e6543ca7ac9986c279e711c60b3c20..92086a8812e5e3366c219f5187b8d5e2cb424955 100644 (file)
@@ -1,5 +1,6 @@
 #include <fstream.h>
 #include <string.h>
+#include <stdlib.h>
 #include <stdio.h>
 #include "extern.h"
 
@@ -16,7 +17,9 @@ char *c_Forest;                       // Forest channel
 char *c_ForestTopic;           // Forest Channel Topic
 char *adminpass;               // Administrator password
 char *welcomemsg;              // Welcome Message
-int confloadtime;              // Welcome Message Delay
+int welcomedelay;              // Welcome Message Delay
+int updateperiod;              // Seconds until another player database update
+int forestfights;              // Forest fights per day
 
 // Remote server stuff. This is used for the outgoing connection gameserv needs to make
 // to a real ircd.
@@ -81,6 +84,12 @@ void load_config_file(char *config)
        
        directive = strtok(buf, " ");
 
+        if (stricmp(directive, "DIE") == 0)
+       {
+           value = strtok(NULL, "");
+           cerr << value << endl;
+           exit(0);
+       }
        if (stricmp(directive, "S_GAMESERV") == 0)
        {
            value = strtok(NULL, " ");
@@ -153,10 +162,20 @@ void load_config_file(char *config)
            adminpass = new char[strlen(value) + 1];
            strcpy(adminpass, value);
        }
-       else if (stricmp(directive, "CONFLOADTIME") == 0)
+       else if (stricmp(directive, "WELCOMEDELAY") == 0)
+       {
+           value = strtok(NULL, " ");
+           welcomedelay = stringtoint(value);
+       }
+       else if (stricmp(directive, "FORESTFIGHTS") == 0)
+       {
+           value = strtok(NULL, " ");
+           forestfights = stringtoint(value);
+       }
+       else if (stricmp(directive, "UPDATEPERIOD") == 0)
        {
            value = strtok(NULL, " ");
-           confloadtime = stringtoint(value);
+           updateperiod = stringtoint(value);
        }
        else if (stricmp(directive, "WELCOMEMSG") == 0)
        {