X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Finspircd.cpp;h=8c297af07b45b2e65093b9bd3eddfd933e89ce41;hb=ed105d7fef72b5bb5f23e72fae40d6b4ffdcb5b8;hp=f182f7169b12a302a3d7ea908a81c0eaa9e4abeb;hpb=b3c2abf41eead7a9aac5820796e9600ced8430df;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/inspircd.cpp b/src/inspircd.cpp index f182f7169..8c297af07 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -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 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;