- c += (i->second->registered == REG_ALL);
- }
-
- return c;
-}
-
-int InspIRCd::usercount_invisible()
-{
- int c = 0;
-
- for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++)
- {
- c += ((i->second->registered == REG_ALL) && (i->second->modes[UM_INVISIBLE]));
- }
-
- return c;
-}
-
-int InspIRCd::usercount_opers()
-{
- int c = 0;
-
- for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++)
- {
- if (*(i->second->oper))
- c++;
- }
- return c;
-}
-
-int InspIRCd::usercount_unknown()
-{
- 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;
-}
-
-long InspIRCd::chancount()
-{
- return chanlist.size();
-}
-
-long InspIRCd::local_count()
-{
- 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;
-}
-
-void ShowMOTD(userrec *user)
-{
- if (!ServerInstance->Config->MOTD.size())
- {
- user->WriteServ("422 %s :Message of the day file is missing.",user->nick);
- return;
- }
- user->WriteServ("375 %s :%s message of the day", user->nick, ServerInstance->Config->ServerName);
-
- for (unsigned int i = 0; i < ServerInstance->Config->MOTD.size(); i++)
- user->WriteServ("372 %s :- %s",user->nick,ServerInstance->Config->MOTD[i].c_str());
-
- user->WriteServ("376 %s :End of message of the day.", user->nick);
-}
-
-void ShowRULES(userrec *user)
-{
- if (!ServerInstance->Config->RULES.size())
- {
- user->WriteServ("NOTICE %s :Rules file is missing.",user->nick);
- return;
- }
- user->WriteServ("NOTICE %s :%s rules",user->nick,ServerInstance->Config->ServerName);
-
- for (unsigned int i = 0; i < ServerInstance->Config->RULES.size(); i++)
- user->WriteServ("NOTICE %s :%s",user->nick,ServerInstance->Config->RULES[i].c_str());
-
- user->WriteServ("NOTICE %s :End of %s rules.",user->nick,ServerInstance->Config->ServerName);
-}
-
-// this returns 1 when all modules are satisfied that the user should be allowed onto the irc server
-// (until this returns true, a user will block in the waiting state, waiting to connect up to the
-// registration timeout maximum seconds)
-bool AllModulesReportReady(userrec* user)
-{
- if (!ServerInstance->Config->global_implementation[I_OnCheckReady])
- return true;