]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/helperfuncs.cpp
Fix for bug typo, dont let it creep into the release!
[user/henk/code/inspircd.git] / src / helperfuncs.cpp
index 84cc52df5f00dae4975ee29e098c8fa50280796d..3f0b5ff0ce8ceb93d22710a1f38d456fe78ec287 100644 (file)
@@ -310,7 +310,7 @@ int InspIRCd::RegisteredUserCount()
 
 int InspIRCd::ModeCount(const char mode)
 {
-       ModeHandler* mh = this->Modes->GetHandler(mode, MODETYPE_USER);
+       ModeHandler* mh = this->Modes->FindMode(mode, MODETYPE_USER);
 
        if (mh)
                return mh->GetCount();
@@ -325,21 +325,12 @@ int InspIRCd::InvisibleUserCount()
 
 int InspIRCd::OperCount()
 {
-       return ModeCount('o');
+       return this->all_opers.size();
 }
 
 int InspIRCd::UnregisteredUserCount()
 {
-       int c = 0;
-
-       for (std::vector<userrec*>::const_iterator i = local_users.begin(); i != local_users.end(); i++)
-       {
-               userrec* t = (userrec*)(*i);
-               if (t->registered != REG_ALL)
-                       c++;
-       }
-
-       return c;
+       return this->unregistered_count;
 }
 
 long InspIRCd::ChannelCount()
@@ -349,18 +340,10 @@ long InspIRCd::ChannelCount()
 
 long InspIRCd::LocalUserCount()
 {
-       int c = 0;
-
-       for (std::vector<userrec*>::const_iterator i = local_users.begin(); i != local_users.end(); i++)
-       {
-               userrec* t = (userrec*)(*i);
-               if (t->registered == REG_ALL)
-                       c++;
-       }
-
-       return c;
+       /* Doesnt count unregistered clients */
+       return (local_users.size() - this->UnregisteredUserCount());
 }
-
+       
 bool InspIRCd::IsChannel(const char *chname)
 {
        char *c;
@@ -478,13 +461,13 @@ void InspIRCd::LoadAllModules()
 
        for (int count = 0; count < Config->ConfValueEnum(Config->config_data, "module"); count++)
        {
-               Config->ConfValue(Config->config_data, "module","name",count,configToken,MAXBUF);
+               Config->ConfValue(Config->config_data, "module", "name", count, configToken, MAXBUF);
                printf("[\033[1;32m*\033[0m] Loading module:\t\033[1;32m%s\033[0m\n",configToken);
                
                if (!this->LoadModule(configToken))             
                {
-                       this->Log(DEFAULT,"There was an error loading a module: %s", this->ModuleError());
-                       printf("\nThere was an error loading a module: %s\n\n",this->ModuleError());
+                       this->Log(DEFAULT,"There was an error loading the module '%s': %s", configToken, this->ModuleError());
+                       printf("\n[\033[1;31m*\033[0m] There was an error loading the module '%s': %s\n\n", configToken, this->ModuleError());
                        Exit(EXIT_STATUS_MODULE);
                }
        }