diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-01-17 13:07:49 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-01-17 13:07:49 +0000 |
commit | 94afde43b086f092bf8128d76d418cb63840e8eb (patch) | |
tree | 770c8b46167a86769625b6a22494e266321c18da | |
parent | 932e069f287ceeb184eafae71c0e22b259e62740 (diff) |
Remove InspIRCd::WriteOpers in favour of snomask O
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8728 e03df62e-2008-0410-955e-edbf42e46eb7
42 files changed, 87 insertions, 137 deletions
diff --git a/include/configreader.h b/include/configreader.h index 3774f3262..d9171d0fa 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -661,7 +661,7 @@ class CoreExport ServerConfig : public Extensible * @param bail If this is set to true, the error is sent to the console, and the program exits * @param user If this is set to a non-null value, and bail is false, the errors are spooled to * this user as SNOTICEs. - * If the parameter is NULL, the messages are spooled to all users via WriteOpers as SNOTICEs. + * If the parameter is NULL, the messages are spooled to all opers. */ void ReportConfigError(const std::string &errormessage, bool bail, User* user); diff --git a/include/inspircd.h b/include/inspircd.h index c8acf4240..4a013fbc6 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -525,17 +525,6 @@ class CoreExport InspIRCd : public classbase */ std::string GetServerDescription(const char* servername); - /** Write text to all opers connected to this server - * @param text The text format string - * @param ... Format args - */ - void WriteOpers(const char* text, ...); - - /** Write text to all opers connected to this server - * @param text The text to send - */ - void WriteOpers(const std::string &text); - /** Find a user in the nick hash. * If the user cant be found in the nick hash check the uuid hash * @param nick The nickname to find diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 82209015c..8746156c4 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -506,7 +506,7 @@ CmdResult cmd_reload::Handle(const char** parameters, int /* pcnt */, User *user if (ServerInstance->Parser->ReloadCommand(parameters[0], user)) { user->WriteServ("NOTICE %s :*** Successfully reloaded command '%s'", user->nick, parameters[0]); - ServerInstance->WriteOpers("*** RELOAD: %s reloaded the '%s' command.", user->nick, parameters[0]); + ServerInstance->SNO->WriteToSnoMask('O', "RELOAD: %s reloaded the '%s' command.", user->nick, parameters[0]); return CMD_SUCCESS; } else diff --git a/src/configreader.cpp b/src/configreader.cpp index 5d1c7f575..46db43def 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -776,10 +776,10 @@ void ServerConfig::ReportConfigError(const std::string &errormessage, bool bail, } else { - ServerInstance->WriteOpers("There were errors in the configuration file:"); + ServerInstance->SNO->WriteToSnoMask('O', "There were errors in the configuration file:"); while (start < errors.length()) { - ServerInstance->WriteOpers(errors.substr(start, 360).c_str()); + ServerInstance->SNO->WriteToSnoMask('O', errors.substr(start, 360).c_str()); start += 360; } } @@ -1212,7 +1212,7 @@ void ServerConfig::Read(bool bail, User* user, int pass) { if (ServerInstance->Modules->Unload(removing->c_str())) { - ServerInstance->WriteOpers("*** REHASH UNLOADED MODULE: %s",removing->c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "REHASH UNLOADED MODULE: %s",removing->c_str()); if (user) user->WriteServ("973 %s %s :Module %s successfully unloaded.",user->nick, removing->c_str(), removing->c_str()); rem++; @@ -1238,7 +1238,7 @@ void ServerConfig::Read(bool bail, User* user, int pass) if (ServerInstance->Modules->Load(adding->c_str())) { - ServerInstance->WriteOpers("*** REHASH LOADED MODULE: %s",adding->c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "REHASH LOADED MODULE: %s",adding->c_str()); if (user) user->WriteServ("975 %s %s :Module %s successfully loaded.",user->nick, adding->c_str(), adding->c_str()); @@ -1263,7 +1263,7 @@ void ServerConfig::Read(bool bail, User* user, int pass) if (user) user->WriteServ("NOTICE %s :*** Successfully rehashed server.", user->nick); else - ServerInstance->WriteOpers("*** Successfully rehashed server."); + ServerInstance->SNO->WriteToSnoMask('O', "Successfully rehashed server."); } /* XXX: This can and will block! */ diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 048de75ca..2d8a6f060 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -95,38 +95,6 @@ std::string InspIRCd::GetServerDescription(const char* servername) } } -/* XXX - We don't use WriteMode for this because WriteMode is very slow and - * this isnt. Basically WriteMode has to iterate ALL the users 'n' times for - * the number of modes provided, e.g. if you send WriteMode 'og' to write to - * opers with globops, and you have 2000 users, thats 4000 iterations. WriteOpers - * uses the oper list, which means if you have 2000 users but only 5 opers, - * it iterates 5 times. - */ -void InspIRCd::WriteOpers(const char* text, ...) -{ - char textbuffer[MAXBUF]; - va_list argsPtr; - - va_start(argsPtr, text); - vsnprintf(textbuffer, MAXBUF, text, argsPtr); - va_end(argsPtr); - - this->WriteOpers(std::string(textbuffer)); -} - -void InspIRCd::WriteOpers(const std::string &text) -{ - for (std::list<User*>::iterator i = this->all_opers.begin(); i != this->all_opers.end(); i++) - { - User* a = *i; - if (IS_LOCAL(a) && a->IsModeSet('s')) - { - // send server notices to all with +s - a->WriteServ("NOTICE %s :%s",a->nick,text.c_str()); - } - } -} - void InspIRCd::ServerNoticeAll(char* text, ...) { if (!text) diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 9318a03fd..8bb53de34 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -627,7 +627,7 @@ int InspIRCd::Run() { if (TIME < OLDTIME) { - WriteOpers("*** \002EH?!\002 -- Time is flowing BACKWARDS in this dimension! Clock drifted backwards %d secs.",abs(OLDTIME-TIME)); + SNO->WriteToSnoMask('O', "\002EH?!\002 -- Time is flowing BACKWARDS in this dimension! Clock drifted backwards %d secs.",abs(OLDTIME-TIME)); } if ((TIME % 3600) == 0) diff --git a/src/modules/extra/m_sqlauth.cpp b/src/modules/extra/m_sqlauth.cpp index 0e11afa51..3a88c05c9 100644 --- a/src/modules/extra/m_sqlauth.cpp +++ b/src/modules/extra/m_sqlauth.cpp @@ -121,7 +121,7 @@ public: else { if (verbose) - ServerInstance->WriteOpers("Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick, user->ident, user->host, req.error.Str()); + ServerInstance->SNO->WriteToSnoMask('O', "Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick, user->ident, user->host, req.error.Str()); return false; } } @@ -147,13 +147,13 @@ public: else if (verbose) { /* No rows in result, this means there was no record matching the user */ - ServerInstance->WriteOpers("Forbidden connection from %s!%s@%s (SQL query returned no matches)", user->nick, user->ident, user->host); + ServerInstance->SNO->WriteToSnoMask('O', "Forbidden connection from %s!%s@%s (SQL query returned no matches)", user->nick, user->ident, user->host); user->Extend("sqlauth_failed"); } } else if (verbose) { - ServerInstance->WriteOpers("Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick, user->ident, user->host, res->error.Str()); + ServerInstance->SNO->WriteToSnoMask('O', "Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick, user->ident, user->host, res->error.Str()); user->Extend("sqlauth_failed"); } } diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index 9fcf5062d..b52db1b8b 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -179,7 +179,7 @@ class ModuleAlias : public Module { if (!ServerInstance->ULine(u->server)) { - ServerInstance->WriteOpers("*** NOTICE -- Service "+Aliases[i].requires+" required by alias "+std::string(Aliases[i].text.c_str())+" is not on a u-lined server, possibly underhanded antics detected!"); + ServerInstance->SNO->WriteToSnoMask('O', "NOTICE -- Service "+Aliases[i].requires+" required by alias "+std::string(Aliases[i].text.c_str())+" is not on a u-lined server, possibly underhanded antics detected!"); user->WriteServ("401 "+std::string(user->nick)+" "+Aliases[i].requires+" :is an imposter! Please inform an IRC operator as soon as possible."); return 1; } diff --git a/src/modules/m_blockamsg.cpp b/src/modules/m_blockamsg.cpp index 70fb99b9a..13b7ef946 100644 --- a/src/modules/m_blockamsg.cpp +++ b/src/modules/m_blockamsg.cpp @@ -137,7 +137,7 @@ class ModuleBlockAmsg : public Module { // Block it... if(action == IBLOCK_KILLOPERS || action == IBLOCK_NOTICEOPERS) - ServerInstance->WriteOpers("*** %s had an /amsg or /ame denied", user->nick); + ServerInstance->SNO->WriteToSnoMask('O', "%s had an /amsg or /ame denied", user->nick); if(action == IBLOCK_KILL || action == IBLOCK_KILLOPERS) User::QuitUser(ServerInstance, user, "Global message (/amsg or /ame) detected"); diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index 76f06900f..d7c95f317 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -91,12 +91,12 @@ class CommandCban : public Command if(length > 0) { user->WriteServ("385 %s %s :Added %lu second channel ban (%s)", user->nick, parameters[0], length, reason.c_str()); - ServerInstance->WriteOpers("*** %s added %lu second channel ban on %s (%s)", user->nick, length, parameters[0], reason.c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "%s added %lu second channel ban on %s (%s)", user->nick, length, parameters[0], reason.c_str()); } else { user->WriteServ("385 %s %s :Added permanent channel ban (%s)", user->nick, parameters[0], reason.c_str()); - ServerInstance->WriteOpers("*** %s added permanent channel ban on %s (%s)", user->nick, parameters[0], reason.c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "%s added permanent channel ban on %s (%s)", user->nick, parameters[0], reason.c_str()); } } else @@ -159,7 +159,7 @@ class ModuleCBan : public Module { // Channel is banned. user->WriteServ( "384 %s %s :Cannot join channel, CBANed (%s)", user->nick, cname, iter->reason.c_str()); - ServerInstance->WriteOpers("*** %s tried to join %s which is CBANed (%s)", user->nick, cname, iter->reason.c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "%s tried to join %s which is CBANed (%s)", user->nick, cname, iter->reason.c_str()); return 1; } } @@ -228,7 +228,7 @@ class ModuleCBan : public Module { if (iter->set_on + iter->length <= ServerInstance->Time()) { - ServerInstance->WriteOpers("*** %li second CBAN on %s (%s) set on %s expired", iter->length, iter->chname.c_str(), iter->reason.c_str(), ServerInstance->TimeString(iter->set_on).c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "%li second CBAN on %s (%s) set on %s expired", iter->length, iter->chname.c_str(), iter->reason.c_str(), ServerInstance->TimeString(iter->set_on).c_str()); cbans.erase(iter); go_again = true; } diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index b971532db..f6437fe79 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -65,7 +65,7 @@ class CommandWebirc : public Command user->Extend("cgiirc_realhost", new std::string(user->host)); user->Extend("cgiirc_realip", new std::string(user->GetIPString())); if (notify) - ServerInstance->WriteOpers("*** Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", user->nick, user->host, parameters[2], user->host); + ServerInstance->SNO->WriteToSnoMask('O', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", user->nick, user->host, parameters[2], user->host); user->Extend("cgiirc_webirc_hostname", new std::string(parameters[2])); user->Extend("cgiirc_webirc_ip", new std::string(parameters[3])); return CMD_LOCALONLY; @@ -98,7 +98,7 @@ class CGIResolver : public Resolver if ((them) && (them == ServerInstance->SE->GetRef(theirfd))) { if (notify) - ServerInstance->WriteOpers("*** Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", them->nick, them->host, result.c_str(), typ.c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", them->nick, them->host, result.c_str(), typ.c_str()); strlcpy(them->host, result.c_str(), 63); strlcpy(them->dhost, result.c_str(), 63); @@ -112,7 +112,7 @@ class CGIResolver : public Resolver if ((them) && (them == ServerInstance->SE->GetRef(theirfd))) { if (notify) - ServerInstance->WriteOpers("*** Connecting user %s detected as using CGI:IRC (%s), but their host can't be resolved from their %s!", them->nick, them->host,typ.c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "Connecting user %s detected as using CGI:IRC (%s), but their host can't be resolved from their %s!", them->nick, them->host,typ.c_str()); } } @@ -344,7 +344,7 @@ public: { /* We were given a IP in the password, we don't do DNS so they get this is as their host as well. */ if(NotifyOpers) - ServerInstance->WriteOpers("*** Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from PASS", user->nick, user->host, user->password); + ServerInstance->SNO->WriteToSnoMask('O', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from PASS", user->nick, user->host, user->password); } else { @@ -359,14 +359,14 @@ public: catch (...) { if (NotifyOpers) - ServerInstance->WriteOpers("*** Connecting user %s detected as using CGI:IRC (%s), but i could not resolve their hostname!", user->nick, user->host); + ServerInstance->SNO->WriteToSnoMask('O', "Connecting user %s detected as using CGI:IRC (%s), but i could not resolve their hostname!", user->nick, user->host); } } *user->password = 0; /*if(NotifyOpers) - ServerInstance->WriteOpers("*** Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from PASS", user->nick, user->host, user->password);*/ + ServerInstance->SNO->WriteToSnoMask('O', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from PASS", user->nick, user->host, user->password);*/ return true; } @@ -424,7 +424,7 @@ public: user->InvalidateCache(); if(NotifyOpers) - ServerInstance->WriteOpers("*** Connecting user %s detected as using CGI:IRC (%s), but i could not resolve their hostname!", user->nick, user->host); + ServerInstance->SNO->WriteToSnoMask('O', "Connecting user %s detected as using CGI:IRC (%s), but i could not resolve their hostname!", user->nick, user->host); } /*strlcpy(user->host, newip, 16); strlcpy(user->dhost, newip, 16); diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp index 586747dc0..9e307ab00 100644 --- a/src/modules/m_chanprotect.cpp +++ b/src/modules/m_chanprotect.cpp @@ -364,7 +364,7 @@ class ModuleChanProtect : public Module /* These wont fail, we already owned the mode characters before */ ServerInstance->AddMode(cp); ServerInstance->AddMode(cf); - ServerInstance->WriteOpers("*** WARNING: +qa prefixes were enabled or disabled via a REHASH. Clients will probably need to reconnect to pick up this change."); + ServerInstance->SNO->WriteToSnoMask('O', "WARNING: +qa prefixes were enabled or disabled via a REHASH. Clients will probably need to reconnect to pick up this change."); } } diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index 20b669f22..c6819499b 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -63,7 +63,7 @@ class CommandChghost : public Command if ((dest->ChangeDisplayedHost(parameters[1])) && (!ServerInstance->ULine(user->server))) { // fix by brain - ulines set hosts silently - ServerInstance->WriteOpers(std::string(user->nick)+" used CHGHOST to make the displayed host of "+dest->nick+" become "+dest->dhost); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick)+" used CHGHOST to make the displayed host of "+dest->nick+" become "+dest->dhost); } /* route it! */ diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp index 648a0e669..d20533bc0 100644 --- a/src/modules/m_chgident.cpp +++ b/src/modules/m_chgident.cpp @@ -58,7 +58,7 @@ class CommandChgident : public Command dest->ChangeIdent(parameters[1]); if (!ServerInstance->ULine(user->server)) - ServerInstance->WriteOpers("%s used CHGIDENT to change %s's ident to '%s'", user->nick, dest->nick, dest->ident); + ServerInstance->SNO->WriteToSnoMask('O', "%s used CHGIDENT to change %s's ident to '%s'", user->nick, dest->nick, dest->ident); /* route it! */ return CMD_SUCCESS; diff --git a/src/modules/m_chgname.cpp b/src/modules/m_chgname.cpp index b58a4b177..0e4790eef 100644 --- a/src/modules/m_chgname.cpp +++ b/src/modules/m_chgname.cpp @@ -52,7 +52,7 @@ class CommandChgname : public Command if (IS_LOCAL(dest)) { dest->ChangeName(parameters[1]); - ServerInstance->WriteOpers("%s used CHGNAME to change %s's real name to '%s'", user->nick, dest->nick, dest->fullname); + ServerInstance->SNO->WriteToSnoMask('O', "%s used CHGNAME to change %s's real name to '%s'", user->nick, dest->nick, dest->fullname); return CMD_LOCALONLY; /* name change routed by FNAME in spanningtree now */ } diff --git a/src/modules/m_connflood.cpp b/src/modules/m_connflood.cpp index c44c29074..fe3cd06ac 100644 --- a/src/modules/m_connflood.cpp +++ b/src/modules/m_connflood.cpp @@ -81,7 +81,7 @@ public: { /* expire throttle */ throttled = 0; - ServerInstance->WriteOpers("*** Connection throttle deactivated"); + ServerInstance->SNO->WriteToSnoMask('O', "Connection throttle deactivated"); return 0; } User::QuitUser(ServerInstance, user, quitmsg); @@ -93,7 +93,7 @@ public: if (conns >= maxconns) { throttled = 1; - ServerInstance->WriteOpers("*** Connection throttle activated"); + ServerInstance->SNO->WriteToSnoMask('O', "Connection throttle activated"); User::QuitUser(ServerInstance, user, quitmsg); return 1; } diff --git a/src/modules/m_customtitle.cpp b/src/modules/m_customtitle.cpp index 4cc2906f2..bd888d3f3 100644 --- a/src/modules/m_customtitle.cpp +++ b/src/modules/m_customtitle.cpp @@ -90,7 +90,7 @@ bool OneOfMatches(const char* host, const char* ip, const char* hostlist) if (!ServerInstance->ULine(user->server)) // Ulines set TITLEs silently - ServerInstance->WriteOpers("*** %s used TITLE to set custom title '%s'",user->nick,title.c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "%s used TITLE to set custom title '%s'",user->nick,title.c_str()); user->WriteServ("NOTICE %s :Custom title set to '%s'",user->nick, title.c_str()); @@ -100,7 +100,7 @@ bool OneOfMatches(const char* host, const char* ip, const char* hostlist) if (!ServerInstance->ULine(user->server)) // Ulines also fail TITLEs silently - ServerInstance->WriteOpers("*** Failed TITLE attempt by %s!%s@%s using login '%s'",user->nick,user->ident,user->host,parameters[0]); + ServerInstance->SNO->WriteToSnoMask('O', "Failed TITLE attempt by %s!%s@%s using login '%s'",user->nick,user->ident,user->host,parameters[0]); user->WriteServ("NOTICE %s :Invalid title credentials",user->nick); return CMD_SUCCESS; diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 0a52a6817..b46317c59 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -156,7 +156,7 @@ class DNSBLResolver : public Resolver if (show) { - ServerInstance->WriteOpers("*** Connecting user %s detected as being on a DNS blacklist (%s) with result %d", them->GetFullRealHost(), ConfEntry->name.c_str(), bitmask); + ServerInstance->SNO->WriteToSnoMask('O', "Connecting user %s detected as being on a DNS blacklist (%s) with result %d", them->GetFullRealHost(), ConfEntry->name.c_str(), bitmask); } } else @@ -264,25 +264,25 @@ class ModuleDNSBL : public Module /* yeah, logic here is a little messy */ if (e->bitmask <= 0) { - ServerInstance->WriteOpers("*** DNSBL(#%d): invalid bitmask",i); + ServerInstance->SNO->WriteToSnoMask('O', "DNSBL(#%d): invalid bitmask",i); } else if (e->name.empty()) { - ServerInstance->WriteOpers("*** DNSBL(#%d): Invalid name",i); + ServerInstance->SNO->WriteToSnoMask('O', "DNSBL(#%d): Invalid name",i); } else if (e->domain.empty()) { - ServerInstance->WriteOpers("*** DNSBL(#%d): Invalid domain",i); + ServerInstance->SNO->WriteToSnoMask('O', "DNSBL(#%d): Invalid domain",i); } else if (e->banaction == DNSBLConfEntry::I_UNKNOWN) { - ServerInstance->WriteOpers("*** DNSBL(#%d): Invalid banaction", i); + ServerInstance->SNO->WriteToSnoMask('O', "DNSBL(#%d): Invalid banaction", i); } else { if (e->reason.empty()) { - ServerInstance->WriteOpers("*** DNSBL(#%d): empty reason, using defaults",i); + ServerInstance->SNO->WriteToSnoMask('O', "DNSBL(#%d): empty reason, using defaults",i); e->reason = "Your IP has been blacklisted."; } diff --git a/src/modules/m_filter.h b/src/modules/m_filter.h index 61c282b29..5313d5238 100644 --- a/src/modules/m_filter.h +++ b/src/modules/m_filter.h @@ -267,7 +267,7 @@ int FilterBase::OnUserPreNotice(User* user,void* dest,int target_type, std::stri } if (f->action == "block") { - ServerInstance->WriteOpers(std::string("FILTER: ")+user->nick+" had their message filtered, target was "+target+": "+f->reason); + ServerInstance->SNO->WriteToSnoMask('O', std::string("FILTER: ")+user->nick+" had their message filtered, target was "+target+": "+f->reason); user->WriteServ("NOTICE "+std::string(user->nick)+" :Your message has been filtered and opers notified: "+f->reason); } if (f->action == "silent") diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp index 1859cf5cb..7f594b7c9 100644 --- a/src/modules/m_globalload.cpp +++ b/src/modules/m_globalload.cpp @@ -35,7 +35,7 @@ class CommandGloadmodule : public Command { if (ServerInstance->Modules->Load(parameters[0])) { - ServerInstance->WriteOpers("*** NEW MODULE '%s' GLOBALLY LOADED BY '%s'",parameters[0],user->nick); + ServerInstance->SNO->WriteToSnoMask('O', "NEW MODULE '%s' GLOBALLY LOADED BY '%s'",parameters[0],user->nick); user->WriteServ("975 %s %s :Module successfully loaded.",user->nick, parameters[0]); } else @@ -44,7 +44,7 @@ class CommandGloadmodule : public Command } } else - ServerInstance->WriteOpers("*** MODULE '%s' GLOBAL LOAD BY '%s' (not loaded here)",parameters[0],user->nick); + ServerInstance->SNO->WriteToSnoMask('O', "MODULE '%s' GLOBAL LOAD BY '%s' (not loaded here)",parameters[0],user->nick); return CMD_SUCCESS; } @@ -69,7 +69,7 @@ class CommandGunloadmodule : public Command { if (ServerInstance->Modules->Unload(parameters[0])) { - ServerInstance->WriteOpers("*** MODULE '%s' GLOBALLY UNLOADED BY '%s'",parameters[0],user->nick); + ServerInstance->SNO->WriteToSnoMask('O', "MODULE '%s' GLOBALLY UNLOADED BY '%s'",parameters[0],user->nick); user->WriteServ("973 %s %s :Module successfully unloaded.",user->nick, parameters[0]); } else @@ -78,7 +78,7 @@ class CommandGunloadmodule : public Command } } else - ServerInstance->WriteOpers("*** MODULE '%s' GLOBAL UNLOAD BY '%s' (not unloaded here)",parameters[0],user->nick); + ServerInstance->SNO->WriteToSnoMask('O', "MODULE '%s' GLOBAL UNLOAD BY '%s' (not unloaded here)",parameters[0],user->nick); return CMD_SUCCESS; } @@ -109,11 +109,11 @@ class CommandGreloadmodule : public Command { user->WriteServ("974 %s %s :%s",user->nick, parameters[0],ServerInstance->Modules->LastError().c_str()); } - ServerInstance->WriteOpers("*** MODULE '%s' GLOBALLY RELOADED BY '%s'",parameters[0],user->nick); + ServerInstance->SNO->WriteToSnoMask('O', "MODULE '%s' GLOBALLY RELOADED BY '%s'",parameters[0],user->nick); user->WriteServ("975 %s %s :Module successfully loaded.",user->nick, parameters[0]); } else - ServerInstance->WriteOpers("*** MODULE '%s' GLOBAL RELOAD BY '%s' (not reloaded here)",parameters[0],user->nick); + ServerInstance->SNO->WriteToSnoMask('O', "MODULE '%s' GLOBAL RELOAD BY '%s' (not reloaded here)",parameters[0],user->nick); return CMD_SUCCESS; } diff --git a/src/modules/m_invisible.cpp b/src/modules/m_invisible.cpp index 1cb4906aa..b3f30275d 100644 --- a/src/modules/m_invisible.cpp +++ b/src/modules/m_invisible.cpp @@ -115,7 +115,7 @@ class InvisibleMode : public ModeHandler } } - ServerInstance->WriteOpers("*** \2NOTICE\2: Oper %s has become %svisible (%sQ)", dest->GetFullHost(), adding ? "in" : "", adding ? "+" : "-"); + ServerInstance->SNO->WriteToSnoMask('O', "\2NOTICE\2: Oper %s has become %svisible (%sQ)", dest->GetFullHost(), adding ? "in" : "", adding ? "+" : "-"); } return MODEACTION_ALLOW; } @@ -193,7 +193,7 @@ class ModuleInvisible : public Module silent = true; /* Because we silenced the event, make sure it reaches the user whos joining (but only them of course) */ this->WriteCommonFrom(user, channel, "JOIN %s", channel->name); - ServerInstance->WriteOpers("*** \2NOTICE\2: Oper %s has joined %s invisibly (+Q)", user->GetFullHost(), channel->name); + ServerInstance->SNO->WriteToSnoMask('O', "\2NOTICE\2: Oper %s has joined %s invisibly (+Q)", user->GetFullHost(), channel->name); } } diff --git a/src/modules/m_lockserv.cpp b/src/modules/m_lockserv.cpp index d9cd3c67c..80b90f129 100644 --- a/src/modules/m_lockserv.cpp +++ b/src/modules/m_lockserv.cpp @@ -38,7 +38,7 @@ public: { locked = true; user->WriteServ("988 %s %s :Closed for new connections", user->nick, user->server); - ServerInstance->WriteOpers("*** Oper %s used LOCKSERV to temporarily close for new connections", user->nick); + ServerInstance->SNO->WriteToSnoMask('O', "Oper %s used LOCKSERV to temporarily close for new connections", user->nick); /* Dont send to the network */ return CMD_LOCALONLY; } @@ -61,7 +61,7 @@ public: { locked = false; user->WriteServ("989 %s %s :Open for new connections", user->nick, user->server); - ServerInstance->WriteOpers("*** Oper %s used UNLOCKSERV to allow for new connections", user->nick); + ServerInstance->SNO->WriteToSnoMask('O', "Oper %s used UNLOCKSERV to allow for new connections", user->nick); /* Dont send to the network */ return CMD_LOCALONLY; } diff --git a/src/modules/m_nicklock.cpp b/src/modules/m_nicklock.cpp index 9dc1bca69..56d2216fd 100644 --- a/src/modules/m_nicklock.cpp +++ b/src/modules/m_nicklock.cpp @@ -54,7 +54,7 @@ class CommandNicklock : public Command } // let others know - ServerInstance->WriteOpers(std::string(user->nick)+" used NICKLOCK to change and hold "+parameters[0]+" to "+parameters[1]); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick)+" used NICKLOCK to change and hold "+parameters[0]+" to "+parameters[1]); if (!source->ForceNickChange(parameters[1])) { @@ -88,7 +88,7 @@ class CommandNickunlock : public Command { source->Shrink("nick_locked"); user->WriteServ("945 %s %s :Nickname now unlocked.",user->nick,source->nick); - ServerInstance->WriteOpers(std::string(user->nick)+" used NICKUNLOCK on "+parameters[0]); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick)+" used NICKUNLOCK on "+parameters[0]); return CMD_SUCCESS; } diff --git a/src/modules/m_operlevels.cpp b/src/modules/m_operlevels.cpp index 654cb5c01..5e0bc6704 100644 --- a/src/modules/m_operlevels.cpp +++ b/src/modules/m_operlevels.cpp @@ -19,22 +19,15 @@ class ModuleOperLevels : public Module { - private: - - ConfigReader* conf; - public: - ModuleOperLevels(InspIRCd* Me) : Module(Me) { - - conf = new ConfigReader(ServerInstance); - Implementation eventlist[] = { I_OnRehash, I_OnKill }; - ServerInstance->Modules->Attach(eventlist, this, 2); + Implementation eventlist[] = { I_OnRehash, I_OnKill }; + ServerInstance->Modules->Attach(eventlist, this, 2); } virtual ~ModuleOperLevels() @@ -81,7 +74,7 @@ class ModuleOperLevels : public Module } if (dest_level > source_level) { - ServerInstance->WriteOpers("Oper %s (level %d) attempted to /kill a higher oper: %s (level %d): Reason: %s",source->nick,source_level,dest->nick,dest_level,reason.c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "Oper %s (level %d) attempted to /kill a higher oper: %s (level %d): Reason: %s",source->nick,source_level,dest->nick,dest_level,reason.c_str()); dest->WriteServ("NOTICE %s :Oper %s attempted to /kill you!",dest->nick,source->nick); source->WriteServ("481 %s :Permission Denied - Oper %s is a higher level than you",source->nick,dest->nick); return 1; diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp index 9a625ed06..6ea1c948e 100644 --- a/src/modules/m_sajoin.cpp +++ b/src/modules/m_sajoin.cpp @@ -57,7 +57,7 @@ class CommandSajoin : public Command { if (n->HasUser(dest)) { - ServerInstance->WriteOpers("*** "+std::string(user->nick)+" used SAJOIN to make "+std::string(dest->nick)+" join "+parameters[1]); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick)+" used SAJOIN to make "+std::string(dest->nick)+" join "+parameters[1]); return CMD_SUCCESS; } else @@ -74,7 +74,7 @@ class CommandSajoin : public Command } else { - ServerInstance->WriteOpers("*** "+std::string(user->nick)+" sent remote SAJOIN to make "+std::string(dest->nick)+" join "+parameters[1]); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick)+" sent remote SAJOIN to make "+std::string(dest->nick)+" join "+parameters[1]); return CMD_SUCCESS; } } diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp index a907e2d90..fb379310f 100644 --- a/src/modules/m_samode.cpp +++ b/src/modules/m_samode.cpp @@ -35,7 +35,7 @@ class CommandSamode : public Command if (ServerInstance->Modes->GetLastParse().length()) { - ServerInstance->WriteOpers("*** " + std::string(user->nick) + " used SAMODE: " + ServerInstance->Modes->GetLastParse()); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick) + " used SAMODE: " + ServerInstance->Modes->GetLastParse()); std::deque<std::string> n; irc::spacesepstream spaced(ServerInstance->Modes->GetLastParse()); diff --git a/src/modules/m_sanick.cpp b/src/modules/m_sanick.cpp index c2989d390..62fd6ea8c 100644 --- a/src/modules/m_sanick.cpp +++ b/src/modules/m_sanick.cpp @@ -42,13 +42,13 @@ class CommandSanick : public Command { if (source->ForceNickChange(parameters[1])) { - ServerInstance->WriteOpers("*** " + oldnick+" used SANICK to change "+std::string(parameters[0])+" to "+parameters[1]); + ServerInstance->SNO->WriteToSnoMask('O', oldnick+" used SANICK to change "+std::string(parameters[0])+" to "+parameters[1]); return CMD_SUCCESS; } else { /* We couldnt change the nick */ - ServerInstance->WriteOpers("*** " + oldnick+" failed SANICK (from "+std::string(parameters[0])+" to "+parameters[1]+")"); + ServerInstance->SNO->WriteToSnoMask('O', oldnick+" failed SANICK (from "+std::string(parameters[0])+" to "+parameters[1]+")"); return CMD_FAILURE; } } diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp index 0b6408da7..e59c8f9b4 100644 --- a/src/modules/m_sapart.cpp +++ b/src/modules/m_sapart.cpp @@ -58,14 +58,14 @@ class CommandSapart : public Command Channel* n = ServerInstance->FindChan(parameters[1]); if (!n) { - ServerInstance->WriteOpers("*** "+std::string(user->nick)+" used SAPART to make "+dest->nick+" part "+parameters[1]); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick)+" used SAPART to make "+dest->nick+" part "+parameters[1]); return CMD_SUCCESS; } else { if (!n->HasUser(dest)) { - ServerInstance->WriteOpers("*** "+std::string(user->nick)+" used SAPART to make "+dest->nick+" part "+parameters[1]); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick)+" used SAPART to make "+dest->nick+" part "+parameters[1]); return CMD_SUCCESS; } else @@ -77,7 +77,7 @@ class CommandSapart : public Command } else { - ServerInstance->WriteOpers("*** "+std::string(user->nick)+" sent remote SAPART to make "+dest->nick+" part "+parameters[1]); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick)+" sent remote SAPART to make "+dest->nick+" part "+parameters[1]); } return CMD_SUCCESS; diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp index dbe8e85d3..14a534d17 100644 --- a/src/modules/m_saquit.cpp +++ b/src/modules/m_saquit.cpp @@ -40,7 +40,7 @@ class CommandSaquit : public Command irc::stringjoiner reason_join(" ", parameters, 1, pcnt - 1); std::string line = reason_join.GetJoined(); - ServerInstance->WriteOpers("*** "+std::string(user->nick)+" used SAQUIT to make "+std::string(dest->nick)+" quit with a reason of "+line); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick)+" used SAQUIT to make "+std::string(dest->nick)+" quit with a reason of "+line); // Pass the command on, so the client's server can quit it properly. if (!IS_LOCAL(dest)) diff --git a/src/modules/m_servprotect.cpp b/src/modules/m_servprotect.cpp index 99c6b9d95..0e7b8ce09 100644 --- a/src/modules/m_servprotect.cpp +++ b/src/modules/m_servprotect.cpp @@ -80,7 +80,7 @@ class ModuleServProtectMode : public Module if (dst->IsModeSet('k')) { src->WriteServ("485 %s :You are not allowed to kill %s Services!", src->nick, ServerInstance->Config->Network); - ServerInstance->WriteOpers("*** "+std::string(src->nick)+" tried to kill service "+dst->nick+" ("+reason+")"); + ServerInstance->SNO->WriteToSnoMask('O', std::string(src->nick)+" tried to kill service "+dst->nick+" ("+reason+")"); return 1; } return 0; diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp index 402d47ffe..079c2bfd4 100644 --- a/src/modules/m_sethost.cpp +++ b/src/modules/m_sethost.cpp @@ -52,7 +52,7 @@ class CommandSethost : public Command } if (user->ChangeDisplayedHost(parameters[0])) { - ServerInstance->WriteOpers(std::string(user->nick)+" used SETHOST to change their displayed host to "+user->dhost); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick)+" used SETHOST to change their displayed host to "+user->dhost); return CMD_SUCCESS; } diff --git a/src/modules/m_setident.cpp b/src/modules/m_setident.cpp index 5d0d999f8..a0447f92a 100644 --- a/src/modules/m_setident.cpp +++ b/src/modules/m_setident.cpp @@ -48,7 +48,7 @@ class CommandSetident : public Command } user->ChangeIdent(parameters[0]); - ServerInstance->WriteOpers("%s used SETIDENT to change their ident to '%s'", user->nick, user->ident); + ServerInstance->SNO->WriteToSnoMask('O', "%s used SETIDENT to change their ident to '%s'", user->nick, user->ident); return CMD_SUCCESS; } diff --git a/src/modules/m_setidle.cpp b/src/modules/m_setidle.cpp index 10043c4e0..bdad8bf8b 100644 --- a/src/modules/m_setidle.cpp +++ b/src/modules/m_setidle.cpp @@ -39,7 +39,7 @@ class CommandSetidle : public Command // minor tweak - we cant have signon time shorter than our idle time! if (user->signon > user->idle_lastmsg) user->signon = user->idle_lastmsg; - ServerInstance->WriteOpers(std::string(user->nick)+" used SETIDLE to set their idle time to "+ConvToStr(idle)+" seconds"); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick)+" used SETIDLE to set their idle time to "+ConvToStr(idle)+" seconds"); user->WriteServ("944 %s :Idle time set.",user->nick); return CMD_LOCALONLY; diff --git a/src/modules/m_setname.cpp b/src/modules/m_setname.cpp index 83d3c379e..4bf1f17b2 100644 --- a/src/modules/m_setname.cpp +++ b/src/modules/m_setname.cpp @@ -43,7 +43,7 @@ class CommandSetname : public Command if (user->ChangeName(parameters[0])) { - ServerInstance->WriteOpers("%s used SETNAME to change their GECOS to %s", user->nick, parameters[0]); + ServerInstance->SNO->WriteToSnoMask('O', "%s used SETNAME to change their GECOS to %s", user->nick, parameters[0]); return CMD_SUCCESS; } diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index dabc20fdf..bc11cfe1e 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -732,7 +732,7 @@ void ModuleSpanningTree::OnRehash(User* user, const std::string ¶meter) // check for self if (ServerInstance->MatchText(ServerInstance->Config->ServerName,parameter)) { - ServerInstance->WriteOpers("*** Remote rehash initiated locally by \002%s\002", user ? user->nick : ServerInstance->Config->ServerName); + ServerInstance->SNO->WriteToSnoMask('O', "Remote rehash initiated locally by \002%s\002", user ? user->nick : ServerInstance->Config->ServerName); ServerInstance->RehashServer(); } } diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index e5d25dc50..9f69f0ca1 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -1462,7 +1462,7 @@ bool TreeSocket::ProcessLine(std::string &line) if (!this->InboundServerName.empty()) sourceserv = this->InboundServerName; if (params.size() >= 1) - Instance->WriteOpers("*** From " + prefix + ": " + params[0]); + Instance->SNO->WriteToSnoMask('O', "From " + prefix + ": " + params[0]); return Utils->DoOneToAllButSenderRaw(line, sourceserv, prefix, command, params); } else if (command == "MODENOTICE") diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp index ac09beba8..0825a1a29 100644 --- a/src/modules/m_svshold.cpp +++ b/src/modules/m_svshold.cpp @@ -125,12 +125,12 @@ class CommandSvshold : public Command if(length > 0) { user->WriteServ( "385 %s %s :Added %lu second SVSHOLD (%s)", user->nick, parameters[0], length, reason.c_str()); - ServerInstance->WriteOpers("*** %s added %lu second SVSHOLD on %s (%s)", user->nick, length, parameters[0], reason.c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "%s added %lu second SVSHOLD on %s (%s)", user->nick, length, parameters[0], reason.c_str()); } else { user->WriteServ( "385 %s %s :Added permanent SVSHOLD on %s (%s)", user->nick, parameters[0], parameters[0], reason.c_str()); - ServerInstance->WriteOpers("*** %s added permanent SVSHOLD on %s (%s)", user->nick, parameters[0], reason.c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "%s added permanent SVSHOLD on %s (%s)", user->nick, parameters[0], reason.c_str()); } } else @@ -261,7 +261,7 @@ class ModuleSVSHold : public Module if ((*iter)->set_on + (*iter)->length <= ServerInstance->Time()) { ServerInstance->Log(DEBUG, "m_svshold.so: hold on %s expired, removing...", (*iter)->nickname.c_str()); - ServerInstance->WriteOpers("*** %li second SVSHOLD on %s (%s) set %u seconds ago expired", (*iter)->length, (*iter)->nickname.c_str(), (*iter)->reason.c_str(), ServerInstance->Time() - (*iter)->set_on); + ServerInstance->SNO->WriteToSnoMask('O',"%li second SVSHOLD on %s (%s) set %u seconds ago expired", (*iter)->length, (*iter)->nickname.c_str(), (*iter)->reason.c_str(), ServerInstance->Time() - (*iter)->set_on); HoldMap.erase(assign((*iter)->nickname)); delete *iter; safeiter = iter; diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index bf63ad1c4..93cf76023 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -62,7 +62,7 @@ class CommandSwhois : public Command if (!ServerInstance->ULine(user->server)) // Ulines set SWHOISes silently - ServerInstance->WriteOpers("*** %s used SWHOIS to set %s's extra whois from '%s' to '%s'", user->nick, dest->nick, text->c_str(), line.c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "%s used SWHOIS to set %s's extra whois from '%s' to '%s'", user->nick, dest->nick, text->c_str(), line.c_str()); dest->Shrink("swhois"); delete text; @@ -70,7 +70,7 @@ class CommandSwhois : public Command else if (!ServerInstance->ULine(user->server)) { // Ulines set SWHOISes silently - ServerInstance->WriteOpers("*** %s used SWHOIS to set %s's extra whois to '%s'", user->nick, dest->nick, line.c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "%s used SWHOIS to set %s's extra whois to '%s'", user->nick, dest->nick, line.c_str()); } text = new std::string(line); diff --git a/src/server.cpp b/src/server.cpp index c72ac1f91..9b6f1609e 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -46,10 +46,10 @@ void InspIRCd::Exit(int status) void InspIRCd::Rehash() { - this->WriteOpers("*** Rehashing config file %s due to SIGHUP",ServerConfig::CleanFilename(this->ConfigFileName)); + this->SNO->WriteToSnoMask('O', "Rehashing config file %s due to SIGHUP",ServerConfig::CleanFilename(this->ConfigFileName)); this->CloseLog(); if (!this->OpenLog(this->Config->argv, this->Config->argc)) - this->WriteOpers("*** ERROR: Could not open logfile %s: %s", Config->logpath.c_str(), strerror(errno)); + this->SNO->WriteToSnoMask('O', "ERROR: Could not open logfile %s: %s", Config->logpath.c_str(), strerror(errno)); this->RehashUsersAndChans(); FOREACH_MOD_I(this, I_OnGarbageCollect, OnGarbageCollect()); /*this->Config->Read(false,NULL);*/ @@ -61,7 +61,7 @@ void InspIRCd::Rehash() void InspIRCd::RehashServer() { - this->WriteOpers("*** Rehashing config file"); + this->SNO->WriteToSnoMask('O', "Rehashing config file"); this->RehashUsersAndChans(); /*this->Config->Read(false,NULL);*/ this->ResetMaxBans(); diff --git a/src/snomasks.cpp b/src/snomasks.cpp index 02dfb7c2f..9dec803aa 100644 --- a/src/snomasks.cpp +++ b/src/snomasks.cpp @@ -95,7 +95,7 @@ void SnomaskManager::SetupDefaults() this->EnableSnomask('K',"REMOTEKILL"); /* Remote kill notices */ this->EnableSnomask('l',"LINK"); /* Link notices */ this->EnableSnomask('o',"OPER"); /* Oper up/down notices */ - this->EnableSnomask('O',"ALLOPERS"); /* WriteOpers() - generic notices to all opers */ + this->EnableSnomask('O',"ALLOPERS"); /* formerly WriteOpers() - generic notices to all opers */ this->EnableSnomask('d',"DEBUG"); /* Debug notices */ this->EnableSnomask('x',"XLINE"); /* Xline notice (g/z/q/k/e) */ this->EnableSnomask('t',"STATS"); /* Local or remote stats request */ diff --git a/src/usermanager.cpp b/src/usermanager.cpp index bc5eb01a9..28aaf5605 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -31,7 +31,7 @@ void UserManager::AddClient(InspIRCd* Instance, int socket, int port, bool iscac catch (...) { Instance->Log(DEFAULT,"*** WTF *** Duplicated UUID! -- Crack smoking monkies have been unleashed."); - Instance->WriteOpers("*** WARNING *** Duplicate UUID allocated!"); + Instance->SNO->WriteToSnoMask('O', "WARNING *** Duplicate UUID allocated!"); return; } @@ -96,7 +96,7 @@ void UserManager::AddClient(InspIRCd* Instance, int socket, int port, bool iscac if ((Instance->local_users.size() > Instance->Config->SoftLimit) || (Instance->local_users.size() >= MAXCLIENTS)) { - Instance->WriteOpers("*** Warning: softlimit value has been reached: %d clients", Instance->Config->SoftLimit); + Instance->SNO->WriteToSnoMask('O', "Warning: softlimit value has been reached: %d clients", Instance->Config->SoftLimit); User::QuitUser(Instance, New,"No more connections allowed"); return; } diff --git a/src/users.cpp b/src/users.cpp index 6d902027d..6d8f8158a 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -452,7 +452,7 @@ bool User::AddBuffer(std::string a) if (this->MyClass && (recvq.length() > this->MyClass->GetRecvqMax())) { this->SetWriteError("RecvQ exceeded"); - ServerInstance->WriteOpers("*** User %s RecvQ of %d exceeds connect class maximum of %d",this->nick,recvq.length(),this->MyClass->GetRecvqMax()); + ServerInstance->SNO->WriteToSnoMask('O', "User %s RecvQ of %d exceeds connect class maximum of %d",this->nick,recvq.length(),this->MyClass->GetRecvqMax()); return false; } @@ -524,12 +524,12 @@ void User::AddWriteBuf(const std::string &data) if (this->MyClass && (sendq.length() + data.length() > this->MyClass->GetSendqMax())) { /* - * Fix by brain - Set the error text BEFORE calling writeopers, because + * Fix by brain - Set the error text BEFORE calling, because * if we dont it'll recursively call here over and over again trying * to repeatedly add the text to the sendq! */ this->SetWriteError("SendQ exceeded"); - ServerInstance->WriteOpers("*** User %s SendQ of %d exceeds connect class maximum of %d",this->nick,sendq.length() + data.length(),this->MyClass->GetSendqMax()); + ServerInstance->SNO->WriteToSnoMask('O', "User %s SendQ of %d exceeds connect class maximum of %d",this->nick,sendq.length() + data.length(),this->MyClass->GetSendqMax()); return; } @@ -543,7 +543,7 @@ void User::AddWriteBuf(const std::string &data) catch (...) { this->SetWriteError("SendQ exceeded"); - ServerInstance->WriteOpers("*** User %s SendQ got an exception",this->nick); + ServerInstance->SNO->WriteToSnoMask('O', "User %s SendQ got an exception",this->nick); } } @@ -741,13 +741,13 @@ void User::CheckClass() else if ((a->GetMaxLocal()) && (ServerInstance->Users->LocalCloneCount(this) > a->GetMaxLocal())) { User::QuitUser(ServerInstance, this, "No more connections allowed from your host via this connect class (local)"); - ServerInstance->WriteOpers("*** WARNING: maximum LOCAL connections (%ld) exceeded for IP %s", a->GetMaxLocal(), this->GetIPString()); + ServerInstance->SNO->WriteToSnoMask('O', "WARNING: maximum LOCAL connections (%ld) exceeded for IP %s", a->GetMaxLocal(), this->GetIPString()); return; } else if ((a->GetMaxGlobal()) && (ServerInstance->Users->GlobalCloneCount(this) > a->GetMaxGlobal())) { User::QuitUser(ServerInstance, this, "No more connections allowed from your host via this connect class (global)"); - ServerInstance->WriteOpers("*** WARNING: maximum GLOBAL connections (%ld) exceeded for IP %s", a->GetMaxGlobal(), this->GetIPString()); + ServerInstance->SNO->WriteToSnoMask('O', "WARNING: maximum GLOBAL connections (%ld) exceeded for IP %s", a->GetMaxGlobal(), this->GetIPString()); return; } |