]> jfr.im git - irc/gameservirc.git/blobdiff - gameserv/config.cpp
Edited the version number after a release (1.2.3)
[irc/gameservirc.git] / gameserv / config.cpp
index b8b6774ac0ea9eb0b049692b05e4043ac12087ed..7adfa561a264a4abb7d9f61a58233508ee93eab0 100644 (file)
@@ -86,7 +86,7 @@ int load_config_file(char *config)
 {
     char *buf, *directive, *value;
 
-    #define numdirectives 22
+    #define numdirectives 21
 
     unload_config_file();
 
@@ -112,18 +112,17 @@ int load_config_file(char *config)
     directives[12].desc = "WELCOMEDELAY - Delay (in seconds) to wait before welcoming new users to the network";
     directives[13].desc = "FORESTFIGHTS - Number of forest fights players get every day";
     directives[14].desc = "UPDATEPERIOD - Number of seconds between every player data save";
-    directives[15].desc = "WELCOMEMSG - Message to send to new users on the network";
-    directives[16].desc = "PIDFILE - Filename to store the gameserv process ID in";
-    directives[17].desc = "MAXAFIGHTDISTANCE - The maximum number of levels above you "\
+    directives[15].desc = "PIDFILE - Filename to store the gameserv process ID in";
+    directives[16].desc = "MAXAFIGHTDISTANCE - The maximum number of levels above you "\
                                "that you can fight player->player";
-    directives[18].desc = "MAXBFIGHTDISTANCE - The maximum number of levels below you "\
+    directives[17].desc = "MAXBFIGHTDISTANCE - The maximum number of levels below you "\
                                "that you can fight player->player";
-    directives[19].desc = "MAXIDLETIME - The maximum amount of time (in seconds) "\
+    directives[18].desc = "MAXIDLETIME - The maximum amount of time (in seconds) "\
                                "that a player can be idle before something happens";
-    directives[20].desc = "IDLECHECKPERIOD - The period (in seconds) in which the entire "\
+    directives[19].desc = "IDLECHECKPERIOD - The period (in seconds) in which the entire "\
                                "players list will be checked for idlers. See also: "\
                                "MAXIDLETIME";
-    directives[21].desc = "LISTENONC_FOREST - True/False as to "\
+    directives[20].desc = "LISTENONC_FOREST - True/False as to "\
                                "whether or not to listen for forest "\
                                "commands on the forest channel";
 
@@ -267,56 +266,62 @@ int load_config_file(char *config)
            updateperiod = stringtoint(value);
            directives[14].done = true;
        }
-       else if (stricmp(directive, "WELCOMEMSG") == 0)
-       {
-           value = strtok(NULL, "");
-           welcomemsg = new char[strlen(value) + 1];
-           strcpy(welcomemsg, value);
-           directives[15].done = true;
-       }
        else if (stricmp(directive, "PIDFILE") == 0)
        {
            value = strtok(NULL, " ");
            pidfile = new char[strlen(value) + 1];
            strcpy(pidfile, value);
-           directives[16].done = true;
+           directives[15].done = true;
        }
        else if (stricmp(directive, "MAXAFIGHTDISTANCE") == 0)
        {
            value = strtok(NULL, " ");
            maxafightdistance = stringtoint(value);
-           directives[17].done = true;;
+           directives[16].done = true;;
        }
        else if (stricmp(directive, "MAXBFIGHTDISTANCE") == 0)
        {
            value = strtok(NULL, " ");
            maxbfightdistance = stringtoint(value);
-           directives[18].done = true;
+           directives[17].done = true;
        }
        else if (stricmp(directive, "MAXIDLETIME") == 0)
        {
            value = strtok(NULL, " ");
            maxidletime = stringtoint(value);
-           directives[19].done = true;
+           directives[18].done = true;
        }
        else if (stricmp(directive, "IDLECHECKPERIOD") == 0)
        {
            value = strtok(NULL, " ");
            idlecheckperiod = stringtoint(value);
-           directives[20].done = true;
+           directives[19].done = true;
        }
        else if (stricmp(directive, "LISTENONC_FOREST") == 0)
        {
            value = strtok(NULL, " ");
            if (stricmp(value, "TRUE") == 0)
-               setListenOnCF(configflags);
+               setListenOnCF();
 
-           directives[21].done = true;
+           directives[20].done = true;
+       }
+       else if (stricmp(directive, "WELCOMEMSG") == 0)
+       {
+           // This directive is optional
+           value = strtok(NULL, "");
+           welcomemsg = new char[strlen(value) + 1];
+           strcpy(welcomemsg, value);
+           setWelcome();
        }
        else if (stricmp(directive, "USEPRIVMSG") == 0)
        {
            // This directive is optional
-           setUsePrivmsg(configflags);
+           setUsePrivmsg();
+       }
+       else if (stricmp(directive, "BOPER") == 0)
+       {
+           // This directive is optional
+           setBOper();
        }
        else if (stricmp(directive, "IGNORESERVERS") == 0)
        {