]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configreader.cpp
Begone shitty safe stl warnings!
[user/henk/code/inspircd.git] / src / configreader.cpp
index 0b3b806e38f5e16454697e5e165228bc0c59b183..392c7eb297a68b156c6f0d02b642800eb29c93fc 100644 (file)
@@ -341,6 +341,14 @@ bool ValidateModeLists(ServerConfig* conf, const char* tag, const char* value, V
        return true;
 }
 
+bool ValidateExemptChanOps(ServerConfig* conf, const char* tag, const char* value, ValueItem &data)
+{
+       memset(conf->ExemptChanOps, 0, 256);
+       for (const unsigned char* x = (const unsigned char*)data.GetString(); *x; ++x)
+               conf->ExemptChanOps[*x] = true;
+       return true;
+}
+
 bool ValidateWhoWas(ServerConfig* conf, const char* tag, const char* value, ValueItem &data)
 {
        conf->WhoWasMaxKeep = conf->GetInstance()->Duration(data.GetString());
@@ -567,6 +575,7 @@ void ServerConfig::Read(bool bail, userrec* user)
        static char debug[MAXBUF];      /* Temporary buffer for debugging value */
        static char maxkeep[MAXBUF];    /* Temporary buffer for WhoWasMaxKeep value */
        static char hidemodes[MAXBUF];  /* Modes to not allow listing from users below halfop */
+       static char exemptchanops[MAXBUF];      /* Exempt channel ops from these modes */
        int rem = 0, add = 0;           /* Number of modules added, number of modules removed */
        std::ostringstream errstr;      /* String stream containing the error output */
 
@@ -613,6 +622,7 @@ void ServerConfig::Read(bool bail, userrec* user)
                {"options",     "announceinvites", "1",                 new ValueContainerBool (&this->AnnounceInvites),        DT_BOOLEAN, NoValidation},
                {"options",     "hostintopic",  "1",                    new ValueContainerBool (&this->FullHostInTopic),        DT_BOOLEAN, NoValidation},
                {"options",     "hidemodes",    "",                     new ValueContainerChar (hidemodes),                     DT_CHARPTR, ValidateModeLists},
+               {"options",     "exemptchanops","",                     new ValueContainerChar (exemptchanops),                 DT_CHARPTR, ValidateExemptChanOps},
                {"pid",         "file",         "",                     new ValueContainerChar (this->PID),                     DT_CHARPTR, NoValidation},
                {"whowas",      "groupsize",    "10",                   new ValueContainerInt  (&this->WhoWasGroupSize),        DT_INTEGER, NoValidation},
                {"whowas",      "maxgroups",    "10240",                new ValueContainerInt  (&this->WhoWasMaxGroups),        DT_INTEGER, NoValidation},
@@ -846,12 +856,12 @@ void ServerConfig::Read(bool bail, userrec* user)
        {
                int found_ports = 0;
                FailedPortList pl;
-               ServerInstance->stats->BoundPortCount = ServerInstance->BindPorts(false, found_ports, pl);
+               ServerInstance->BindPorts(false, found_ports, pl);
 
                if (pl.size())
                {
                        user->WriteServ("NOTICE %s :*** Not all your client ports could be bound.", user->nick);
-                       user->WriteServ("NOTICE %s :*** The following port%s failed to bind:", user->nick, found_ports - ServerInstance->stats->BoundPortCount != 1 ? "s" : "");
+                       user->WriteServ("NOTICE %s :*** The following port(s) failed to bind:", user->nick);
                        int j = 1;
                        for (FailedPortList::iterator i = pl.begin(); i != pl.end(); i++, j++)
                        {
@@ -1528,6 +1538,10 @@ char* ServerConfig::CleanFilename(char* name)
 
 bool ServerConfig::DirValid(const char* dirandfile)
 {
+#ifdef WINDOWS
+       return true;
+#endif
+
        char work[1024];
        char buffer[1024];
        char otherdir[1024];
@@ -1566,7 +1580,6 @@ bool ServerConfig::DirValid(const char* dirandfile)
        if (strlen(otherdir) >= t)
        {
                otherdir[t] = '\0';
-
                if (!strcmp(otherdir,work))
                {
                        return true;