]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
Remove unused debug
[user/henk/code/inspircd.git] / src / inspircd.cpp
index f182f7169b12a302a3d7ea908a81c0eaa9e4abeb..8c297af07b45b2e65093b9bd3eddfd933e89ce41 100644 (file)
@@ -301,7 +301,7 @@ InspIRCd::InspIRCd(int argc, char** argv)
        if (stats->BoundPortCount != (unsigned int)found_ports)
        {
                printf("\nWARNING: Not all your client ports could be bound --\nstarting anyway with %ld of %d client ports bound.\n\n", stats->BoundPortCount, found_ports);
-               printf("The following %lu port%s failed to bind:\n", found_ports - stats->BoundPortCount, found_ports - stats->BoundPortCount != 1 ? "s" : "");
+               printf("The following port%s failed to bind:\n", found_ports - stats->BoundPortCount != 1 ? "s" : "");
                int j = 1;
                for (FailedPortList::iterator i = pl.begin(); i != pl.end(); i++, j++)
                {
@@ -505,6 +505,17 @@ bool InspIRCd::UnloadModule(const char* filename)
                                snprintf(MODERR,MAXBUF,"Module not unloadable (marked static)");
                                return false;
                        }
+                       std::pair<int,std::string> intercount = GetInterfaceInstanceCount(modules[j]);
+                       if (intercount.first > 0)
+                       {
+                               this->Log(DEFAULT,"Failed to unload module %s, being used by %d other(s) via interface '%s'",filename, intercount.first, intercount.second.c_str());
+                               snprintf(MODERR,MAXBUF,"Module not unloadable (Still in use by %d other module%s which %s using its interface '%s') -- unload dependent modules first!",
+                                               intercount.first,
+                                               intercount.first > 1 ? "s" : "",
+                                               intercount.first > 1 ? "are" : "is",
+                                               intercount.second.c_str());
+                               return false;
+                       }
                        /* Give the module a chance to tidy out all its metadata */
                        for (chan_hash::iterator c = this->chanlist.begin(); c != this->chanlist.end(); c++)
                        {
@@ -830,6 +841,29 @@ int InspIRCd::SetTimeDelta(int delta)
        return old;
 }
 
+void InspIRCd::AddLocalClone(userrec* user)
+{
+       clonemap::iterator x = local_clones.find(user->GetIPString());
+       if (x != local_clones.end())
+               x->second++;
+       else
+               local_clones[user->GetIPString()] = 1;
+}
+
+void InspIRCd::AddGlobalClone(userrec* user)
+{
+       clonemap::iterator y = global_clones.find(user->GetIPString());
+       if (y != global_clones.end())
+               y->second++;
+       else
+               global_clones[user->GetIPString()] = 1;
+}
+
+int InspIRCd::GetTimeDelta()
+{
+       return time_delta;
+}
+
 bool FileLogger::Readable()
 {
        return false;