- }
-}
-
-void Error(int status)
-{
- void *array[300];
- size_t size;
- char **strings;
-
- signal(SIGALRM, SIG_IGN);
- signal(SIGPIPE, SIG_IGN);
- signal(SIGTERM, SIG_IGN);
- signal(SIGABRT, SIG_IGN);
- signal(SIGSEGV, SIG_IGN);
- signal(SIGURG, SIG_IGN);
- signal(SIGKILL, SIG_IGN);
- log(DEFAULT,"*** fell down a pothole in the road to perfection ***");
-#ifdef HAS_EXECINFO
- log(DEFAULT,"Please report the backtrace lines shown below with any bugreport to the bugtracker at http://www.inspircd.org/bugtrack/");
- size = backtrace(array, 30);
- strings = backtrace_symbols(array, size);
- for (size_t i = 0; i < size; i++) {
- log(DEFAULT,"[%d] %s", i, strings[i]);
- }
- free(strings);
- WriteOpers("*** SIGSEGV: Please see the ircd.log for backtrace and report the error to http://www.inspircd.org/bugtrack/");
-#else
- log(DEFAULT,"You do not have execinfo.h so i could not backtrace -- on FreeBSD, please install the libexecinfo port.");
-#endif
- send_error("Somebody screwed up... Whoops. IRC Server terminating.");
- signal(SIGSEGV, SIG_DFL);
- if (raise(SIGSEGV) == -1)
- {
- log(DEFAULT,"What the hell, i couldnt re-raise SIGSEGV! Error: %s",strerror(errno));
- }
- Exit(status);
-}
-
-// this function counts all users connected, wether they are registered or NOT.
-int usercnt(void)
-{
- return clientlist.size();
-}
-
-// this counts only registered users, so that the percentages in /MAP don't mess up when users are sitting in an unregistered state
-int registered_usercount(void)
-{
- int c = 0;
-
- for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++)
- {
- c += (i->second->registered == REG_ALL);
- }
-
- return c;
-}
-
-int usercount_invisible(void)
-{
- 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 usercount_opers(void)
-{
- int c = 0;
-
- for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++)
- {
- if (*(i->second->oper))
- c++;
- }
- return c;
-}
-
-int usercount_unknown(void)
-{
- 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 chancount(void)
-{
- return chanlist.size();
-}
-
-long local_count()
-{
- int c = 0;